smart-home-engine 1.10.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-tUihOf0o.js","assets/monaco-langs-Dt8a9eeo.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-CUmDOhNS.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-tUihOf0o.js","assets/monaco-langs-Dt8a9eeo.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-BVHy5rED.js"])))=>i.map(i=>d[i]);
2
2
  var $F=Object.defineProperty;var SS=o=>{throw TypeError(o)};var UF=(o,e,t)=>e in o?$F(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var wn=(o,e,t)=>UF(o,typeof e!="symbol"?e+"":e,t),Kb=(o,e,t)=>e.has(o)||SS("Cannot "+t);var we=(o,e,t)=>(Kb(o,e,"read from private field"),t?t.call(o):e.get(o)),xn=(o,e,t)=>e.has(o)?SS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),mn=(o,e,t,i)=>(Kb(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),Zn=(o,e,t)=>(Kb(o,e,"access private method"),t);import{_ as e2,m as t2,l as pi,A as wo,C as Ue,I as Qn,D as pp,a as vs,g as i2,M as ti,b as $i,E as aa,c as U,r as Nn,d as Pr,e as S,f as qF,h as Kn,R as vn,S as Hi,i as oo,j as Tr,k as Dn,n as rn,o as Be,p as xt,K as ys,q as di,s as Nt,t as Is,u as ee,v as hn,O as Oa,w as ks,P as _i,x as Zb,y as xp,z as n2,B as xl,F as la,G as XC,H as Gs,U as On,J as m0,L as bi,N as El,Q as GF,T as vo,V as YC,W as KF,X as s2,$ as ci,Y as Fn,Z as Sn,a0 as is,a1 as en,a2 as Xo,a3 as bg,a4 as Mt,a5 as $x,a6 as ZF,a7 as XF,a8 as Ls,a9 as YF,aa as ca,ab as So,ac as Si,ad as o2,ae as Xn,af as QF,ag as JF,ah as Co,ai as G0,aj as ws,ak as T_,al as go,am as zc,an as ww,ao as M_,ap as $s,aq as v0,ar as Us,as as R_,at as N_,au as e3,av as mp,aw as K0,ax as Pl,ay as t3,az as Z0,aA as i3,aB as Sw,aC as n3,aD as s3,aE as DS,aF as ms,aG as ml,aH as po,aI as on,aJ as hl,aK as o3,aL as Va,aM as Go,aN as Ws,aO as da,aP as Dw,aQ as Ps,aR as gs,aS as vm,aT as sn,aU as r2,aV as r3,aW as Aw,aX as O_,aY as kw,aZ as Bw,a_ as Cd,a$ as a3,b0 as Fw,b1 as l3,b2 as Lw,b3 as Tl,b4 as Ml,b5 as _0,b6 as Cg,b7 as Ro,b8 as vp,b9 as _m,ba as Xb,bb as zn,bc as Iw,bd as _p,be as H_,bf as c3,bg as a2,bh as Eg,bi as b0,bj as yg,bk as bp,bl as W_,bm as An,bn as Vc,bo as Cp,bp as d3,bq as u3,br as Pw,bs as h3,bt as bm,bu as cr,bv as Tw,bw as C0,bx as Rl,by as X0,bz as dn,bA as E0,bB as l2,bC as Ep,bD as f3,bE as Ed,bF as si,bG as AS,bH as Ux,bI as c2,bJ as Nr,bK as ia,bL as Un,bM as y0,bN as Ar,bO as w0,bP as ts,bQ as wg,bR as Hu,bS as QC,bT as d2,bU as u2,bV as h2,bW as Mw,bX as Fo,bY as Mn,bZ as yp,b_ as f2,b$ as vl,c0 as z_,c1 as g3,c2 as Fh,c3 as kS,c4 as wp,c5 as g2,c6 as Lh,c7 as p3,c8 as br,c9 as V_,ca as x3,cb as Do,cc as ua,cd as Sp,ce as Sg,cf as p2,cg as or,ch as Dp,ci as j_,cj as m3,ck as v3,cl as _3,cm as Y0,cn as ja,co as zs,cp as b3,cq as Rw,cr as C3,cs as E3,ct as BS,cu as y3,cv as Ap,cw as yl,cx as JC,cy as _u,cz as wl,cA as w3,cB as Ha,cC as kr,cD as jo,cE as FS,cF as ao,cG as kp,cH as Ic,cI as $a,cJ as S3,cK as ha,cL as Dg,cM as $_,cN as x2,cO as D3,cP as A3,cQ as Nw,cR as k3,cS as Ag,cT as B3,cU as oc,cV as kg,cW as LS,cX as F3,cY as L3,cZ as Ga,c_ as I3,c$ as Ow,d0 as m2,d1 as v2,d2 as _2,d3 as b2,d4 as P3,d5 as T3,d6 as C2,d7 as E2,d8 as M3,d9 as Hw,da as R3,db as N3,dc as os,dd as O3,de as Ww,df as H3,dg as Ih,dh as IS,di as W3,dj as z3,dk as V3,dl as j3,dm as $3,dn as U3,dp as S0,dq as U_,dr as e1,ds as q3,dt as G3,du as PS,dv as t1,dw as K3,dx as TS,dy as Yb,dz as Z3,dA as y2,dB as X3,dC as w2,dD as i1,dE as Y3,dF as Q3,dG as J3,dH as S2,dI as D2,dJ as e4,dK as Cm,dL as A2,dM as q_,dN as t4,dO as i4,dP as Pc,dQ as zw,dR as n4,dS as MS,dT as RS,dU as s4,dV as Ph,dW as k2,dX as o4,dY as r4,dZ as a4,d_ as l4,d$ as B2,e0 as F2,e1 as L2,e2 as I2,e3 as c4,e4 as Wa,e5 as NS,e6 as d4,e7 as Bp,e8 as u4,e9 as Mf,ea as P2,eb as OS,ec as Bg,ed as T2,ee as Em,ef as h4,eg as M2,eh as f4,ei as R2,ej as g4,ek as p4,el as N2,em as O2,en as Sl,eo as G_,ep as x4,eq as H2,er as Ko,es as yd,et as W2,eu as m4,ev as v4,ew as z2,ex as V2,ey as _4,ez as j2,eA as $2,eB as Fg,eC as b4,eD as C4,eE as E4,eF as y4,eG as wf,eH as HS,eI as w4,eJ as S4,eK as D4,eL as ym,eM as Js,eN as A4,eO as n1,eP as Wu,eQ as k4,eR as dl,eS as B4,eT as F4,eU as U2,eV as L4,eW as Jf,eX as I4,eY as P4,eZ as T4,e_ as M4,e$ as WS,f0 as zS,f1 as VS,f2 as zu,f3 as Vw,f4 as q2,f5 as s1,f6 as qx,f7 as G2,f8 as wm,f9 as R4,fa as N4,fb as O4,fc as H4,fd as jw,fe as K2,ff as W4,fg as Sm,fh as Z2,fi as X2,fj as z4,fk as V4,fl as j4,fm as $4,fn as U4,fo as q4,fp as G4,fq as K4,fr as Y2,fs as Z4,ft as Dm,fu as Q2,fv as X4,fw as J2,fx as Y4,fy as ek,fz as tk,fA as Q4,fB as jS,fC as ik,fD as $S,fE as J4,fF as Qb,fG as US,fH as eL,fI as tL,fJ as iL,fK as La,fL as Tc,fM as nL,fN as qS,fO as Gx,fP as sL,fQ as fl,fR as K_,fS as o1,fT as oL,fU as nk,fV as sk,fW as lo,fX as GS,fY as dx,fZ as $w,f_ as rL,f$ as aL,g0 as lL,g1 as cL,g2 as dL,g3 as uL,g4 as hL,g5 as fL,g6 as KS,g7 as gL,g8 as pL,g9 as xL,ga as D0,gb as eg,gc as ok,gd as mL,ge as Uw,gf as Kx,gg as ux,gh as Jb,gi as vL,gj as _L,gk as rk,gl as bL,gm as qw,gn as CL,go as EL,gp as ak,gq as Z_,gr as yL,gs as Am,gt as Gw,gu as Kw,gv as Zw,gw as lk,gx as ck,gy as dk,gz as uk,gA as hk,gB as fk,gC as gk,gD as ZS,gE as pk,gF as ah,gG as wL,gH as SL,gI as DL,gJ as AL,gK as xk,gL as kL,gM as BL,gN as XS,gO as r1,gP as hc,gQ as FL,gR as LL,gS as IL,gT as PL,gU as TL,gV as ML,gW as YS,gX as Xw,gY as a1,gZ as RL,g_ as l1,g$ as NL,h0 as OL,h1 as HL,h2 as WL,h3 as Yw,h4 as mk,h5 as QS,h6 as JS,h7 as zL,h8 as VL,h9 as jL,ha as e8,hb as eC,hc as $L,hd as UL,he as qL,hf as tC,hg as vk,hh as _k,hi as bk,hj as Ck,hk as Dl,hl as Ek,hm as Qw,hn as t8,ho as GL,hp as yk,hq as KL,hr as ZL,hs as X_,ht as Y_,hu as Vu,hv as Q_,hw as Fp,hx as XL,hy as J_,hz as YL,hA as QL,hB as JL,hC as wk,hD as Sf,hE as e7,hF as t7,hG as i7,hH as n7,hI as Lp,hJ as s7,hK as Sk,hL as Dk,hM as Ak,hN as c1,hO as o7,hP as r7,hQ as a7,hR as l7,hS as c7,hT as d1,hU as d7,hV as u7,hW as h7,hX as f7,hY as g7,hZ as p7,h_ as x7,h$ as m7,i0 as kk,i1 as v7,i2 as _7,i3 as b7,i4 as i8,i5 as C7,i6 as E7,i7 as ad,i8 as xr,i9 as n8,ia as y7,ib as w7,ic as S7}from"./monaco-langs-Dt8a9eeo.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=t(n);fetch(n.href,s)}})();const Bk=!1;var Jw=Array.isArray,D7=Array.prototype.indexOf,km=Array.prototype.includes,eb=Array.from,A7=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,k7=Object.getOwnPropertyDescriptors,B7=Object.prototype,F7=Array.prototype,Fk=Object.getPrototypeOf,s8=Object.isExtensible;const tb=()=>{};function L7(o){for(var e=0;e<o.length;e++)o[e]()}function Lk(){var o,e,t=new Promise((i,n)=>{o=i,e=n});return{promise:t,resolve:o,reject:e}}function I7(o,e,t=!1){return o===void 0?t?e():e:o}function o8(o,e){if(Array.isArray(o))return o;if(!(Symbol.iterator in o))return Array.from(o);const t=[];for(const i of o)if(t.push(i),t.length===e)break;return t}const ho=2,A0=4,ib=8,Ik=1<<24,na=16,ra=32,Mc=64,u1=128,Lr=512,eo=1024,no=2048,Ua=4096,Io=8192,Ir=16384,Q0=32768,h1=1<<25,k0=65536,Bm=1<<17,P7=1<<18,J0=1<<19,T7=1<<20,Ma=1<<25,bu=65536,Fm=1<<21,Zh=1<<22,fc=1<<23,wd=Symbol("$state"),M7=Symbol("legacy props"),R7=Symbol(""),Zx=Symbol("attributes"),f1=Symbol("class"),g1=Symbol("style"),Rf=Symbol("text"),Xx=Symbol("form reset"),nb=new class extends Error{constructor(){super(...arguments);wn(this,"name","StaleReactionError");wn(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var YA;const N7=!!((YA=globalThis.document)!=null&&YA.contentType)&&globalThis.document.contentType.includes("xml");function Pk(o){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function O7(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function H7(o,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function W7(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function z7(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function V7(o){throw new Error("https://svelte.dev/e/effect_orphan")}function j7(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $7(o){throw new Error("https://svelte.dev/e/props_invalid_value")}function U7(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function q7(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function G7(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function K7(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Z7=1,X7=2,Tk=4,Y7=8,Q7=16,J7=1,eI=4,tI=8,iI=16,nI=1,sI=2,Qs=Symbol("uninitialized"),Mk="http://www.w3.org/1999/xhtml",oI="http://www.w3.org/2000/svg",rI="http://www.w3.org/1998/Math/MathML";function aI(){console.warn("https://svelte.dev/e/derived_inert")}function lI(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function cI(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Rk(o){return o===this.v}function dI(o,e){return o!=o?e==e:o!==e||o!==null&&typeof o=="object"||typeof o=="function"}function Nk(o){return!dI(o,this.v)}let uI=!1,uo=null;function B0(o){uo=o}function Vs(o,e=!1,t){uo={p:uo,i:!1,c:null,e:null,s:o,x:null,r:Rn,l:null}}function js(o){var e=uo,t=e.e;if(t!==null){e.e=null;for(var i of t)o6(i)}return o!==void 0&&(e.x=o),e.i=!0,uo=e.p,o??{}}function Ok(){return!0}let hd=[];function Hk(){var o=hd;hd=[],L7(o)}function gc(o){if(hd.length===0&&!ig){var e=hd;queueMicrotask(()=>{e===hd&&Hk()})}hd.push(o)}function hI(){for(;hd.length>0;)Hk()}function Wk(o){var e=Rn;if(e===null)return Tn.f|=fc,o;if((e.f&Q0)===0&&(e.f&A0)===0)throw o;rc(o,e)}function rc(o,e){for(;e!==null;){if((e.f&u1)!==0){if((e.f&Q0)===0)throw o;try{e.b.error(o);return}catch(t){o=t}}e=e.parent}throw o}const fI=-7169;function Os(o,e){o.f=o.f&fI|e}function e9(o){(o.f&Lr)!==0||o.deps===null?Os(o,eo):Os(o,Ua)}function zk(o){if(o!==null)for(const e of o)(e.f&ho)===0||(e.f&bu)===0||(e.f^=bu,zk(e.deps))}function Vk(o,e,t){(o.f&no)!==0?e.add(o):(o.f&Ua)!==0&&t.add(o),zk(o.deps),Os(o,eo)}let hx=!1;function gI(o){var e=hx;try{return hx=!1,[o(),hx]}finally{hx=e}}let iC=null,lh=null,nn=null,tg=null,ro=null,p1=null,ig=!1,nC=!1,Th=null,Yx=null;var r8=0;let pI=1;var Jh,ic,xd,e0,t0,i0,rl,n0,Wo,cp,al,Gr,Aa,s0,md,rs,x1,Nf,m1,jk,$k,wh,xI,Of;const zv=class zv{constructor(){xn(this,rs);wn(this,"id",pI++);xn(this,Jh,!1);wn(this,"linked",!0);xn(this,ic,null);xn(this,xd,null);wn(this,"async_deriveds",new Map);wn(this,"current",new Map);wn(this,"previous",new Map);xn(this,e0,new Set);xn(this,t0,new Set);xn(this,i0,0);xn(this,rl,new Map);xn(this,n0,null);xn(this,Wo,[]);xn(this,cp,[]);xn(this,al,new Set);xn(this,Gr,new Set);xn(this,Aa,new Map);xn(this,s0,new Set);wn(this,"is_fork",!1);xn(this,md,!1);lh===null?iC=lh=this:(mn(lh,xd,this),mn(this,ic,lh)),lh=this}skip_effect(e){we(this,Aa).has(e)||we(this,Aa).set(e,{d:[],m:[]}),we(this,s0).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=we(this,Aa).get(e);if(i){we(this,Aa).delete(e);for(var n of i.d)Os(n,no),t(n);for(n of i.m)Os(n,Ua),t(n)}we(this,s0).add(e)}capture(e,t,i=!1){e.v!==Qs&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&fc)===0&&(this.current.set(e,[t,i]),ro==null||ro.set(e,t)),this.is_fork||(e.v=t)}activate(){nn=this}deactivate(){nn=null,ro=null}flush(){try{nC=!0,nn=this,Zn(this,rs,Nf).call(this)}finally{r8=0,p1=null,Th=null,Yx=null,nC=!1,nn=null,ro=null,Sd.clear()}}discard(){var e;for(const t of we(this,t0))t(this);we(this,t0).clear(),Zn(this,rs,Of).call(this),(e=we(this,n0))==null||e.resolve()}register_created_effect(e){we(this,cp).push(e)}increment(e,t){if(mn(this,i0,we(this,i0)+1),e){let i=we(this,rl).get(t)??0;we(this,rl).set(t,i+1)}}decrement(e,t){if(mn(this,i0,we(this,i0)-1),e){let i=we(this,rl).get(t)??0;i===1?we(this,rl).delete(t):we(this,rl).set(t,i-1)}we(this,md)||(mn(this,md,!0),gc(()=>{mn(this,md,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)we(this,al).add(i);for(const i of t)we(this,Gr).add(i);e.clear(),t.clear()}oncommit(e){we(this,e0).add(e)}ondiscard(e){we(this,t0).add(e)}settled(){return(we(this,n0)??mn(this,n0,Lk())).promise}static ensure(){if(nn===null){const e=nn=new zv;!nC&&!ig&&gc(()=>{we(e,Jh)||e.flush()})}return nn}apply(){{ro=null;return}}schedule(e){var n;if(p1=e,(n=e.b)!=null&&n.is_pending&&(e.f&(A0|ib|Ik))!==0&&(e.f&Q0)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(Th!==null&&t===Rn&&(Tn===null||(Tn.f&ho)===0))return;if((i&(Mc|ra))!==0){if((i&eo)===0)return;t.f^=eo}}we(this,Wo).push(t)}};Jh=new WeakMap,ic=new WeakMap,xd=new WeakMap,e0=new WeakMap,t0=new WeakMap,i0=new WeakMap,rl=new WeakMap,n0=new WeakMap,Wo=new WeakMap,cp=new WeakMap,al=new WeakMap,Gr=new WeakMap,Aa=new WeakMap,s0=new WeakMap,md=new WeakMap,rs=new WeakSet,x1=function(){if(this.is_fork)return!0;for(const i of we(this,rl).keys()){for(var e=i,t=!1;e.parent!==null;){if(we(this,Aa).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},Nf=function(){var d,u,f,g;mn(this,Jh,!0),r8++>1e3&&(Zn(this,rs,Of).call(this),vI());for(const p of we(this,al))we(this,Gr).delete(p),Os(p,no),this.schedule(p);for(const p of we(this,Gr))Os(p,Ua),this.schedule(p);const e=we(this,Wo);mn(this,Wo,[]),this.apply();var t=Th=[],i=[],n=Yx=[];for(const p of e)try{Zn(this,rs,m1).call(this,p,t,i)}catch(C){throw Gk(p),Zn(this,rs,x1).call(this)||this.discard(),C}if(nn=null,n.length>0){var s=zv.ensure();for(const p of n)s.schedule(p)}if(Th=null,Yx=null,Zn(this,rs,x1).call(this)){Zn(this,rs,wh).call(this,i),Zn(this,rs,wh).call(this,t);for(const[p,C]of we(this,Aa))qk(p,C);n.length>0&&Zn(d=nn,rs,Nf).call(d);return}const r=Zn(this,rs,jk).call(this);if(r){Zn(this,rs,wh).call(this,i),Zn(this,rs,wh).call(this,t),Zn(u=r,rs,$k).call(u,this);return}we(this,al).clear(),we(this,Gr).clear();for(const p of we(this,e0))p(this);we(this,e0).clear(),tg=this,a8(i),a8(t),tg=null,(f=we(this,n0))==null||f.resolve();var a=nn;if(we(this,i0)===0&&(we(this,Wo).length===0||a!==null)&&Zn(this,rs,Of).call(this),we(this,Wo).length>0)if(a!==null){const p=a;we(p,Wo).push(...we(this,Wo).filter(C=>!we(p,Wo).includes(C)))}else a=this;a!==null&&Zn(g=a,rs,Nf).call(g)},m1=function(e,t,i){e.f^=eo;for(var n=e.first;n!==null;){var s=n.f,r=(s&(ra|Mc))!==0,a=r&&(s&eo)!==0,d=a||(s&Io)!==0||we(this,Aa).has(n);if(!d&&n.fn!==null){r?n.f^=eo:(s&A0)!==0?t.push(n):Pp(n)&&((s&na)!==0&&we(this,Gr).add(n),L0(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var f=n.next;if(f!==null){n=f;break}n=n.parent}}},jk=function(){for(var e=we(this,ic);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=we(e,ic)}return null},$k=function(e){var i;for(const[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(const[n,s]of e.async_deriveds){const r=this.async_deriveds.get(n);r&&s.promise.then(r.resolve).catch(r.reject)}this.transfer_effects(we(e,al),we(e,Gr));const t=n=>{var s=n.reactions;if(s!==null)for(const d of s){var r=d.f;if((r&ho)!==0)t(d);else{var a=d;r&(Zh|na)&&!this.async_deriveds.has(a)&&(we(this,Gr).delete(a),Os(a,no),this.schedule(a))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),Zn(i=e,rs,Of).call(i),nn=this,Zn(this,rs,Nf).call(this)},wh=function(e){for(var t=0;t<e.length;t+=1)Vk(e[t],we(this,al),we(this,Gr))},xI=function(){var f;for(let g=iC;g!==null;g=we(g,xd)){var e=g.id<this.id,t=[];for(const[p,[C,b]]of this.current){if(g.current.has(p)){var i=g.current.get(p)[0];if(e&&C!==i)g.current.set(p,[C,b]);else continue}t.push(p)}if(e)for(const[p,C]of this.async_deriveds){const b=g.async_deriveds.get(p);b&&C.promise.then(b.resolve).catch(b.reject)}if(we(g,Jh)){var n=[...g.current.keys()].filter(p=>!g.current.get(p)[1]&&!this.current.has(p));if(n.length===0)e&&g.discard();else if(t.length>0){if(e)for(const p of we(this,s0))g.unskip_effect(p,C=>{var b;(C.f&(na|Zh))!==0?g.schedule(C):Zn(b=g,rs,wh).call(b,[C])});g.activate();var s=new Set,r=new Map;for(var a of t)Uk(a,n,s,r);r=new Map;var d=[...g.current].filter(([p,C])=>{const b=this.current.get(p);return b?b[0]!==C[0]||b[1]!==C[1]:!0}).map(([p])=>p);if(d.length>0)for(const p of we(this,cp))(p.f&(Ir|Io|Bm))===0&&t9(p,d,r)&&((p.f&(Zh|na))!==0?(Os(p,no),g.schedule(p)):we(g,al).add(p));if(we(g,Wo).length>0&&!we(g,md)){g.apply();for(var u of we(g,Wo))Zn(f=g,rs,m1).call(f,u,[],[]);mn(g,Wo,[])}g.deactivate()}}}},Of=function(){if(this.linked){var e=we(this,ic),t=we(this,xd);e===null?iC=t:mn(e,xd,t),t===null?lh=e:mn(t,ic,e),this.linked=!1}};let Cu=zv;function mI(o){var e=ig;ig=!0;try{for(var t;;){if(hI(),nn===null)return t;nn.flush()}}finally{ig=e}}function vI(){try{j7()}catch(o){rc(o,p1)}}let $r=null;function a8(o){var e=o.length;if(e!==0){for(var t=0;t<e;){var i=o[t++];if((i.f&(Ir|Io))===0&&Pp(i)&&($r=new Set,L0(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&l6(i),($r==null?void 0:$r.size)>0)){Sd.clear();for(const n of $r){if((n.f&(Ir|Io))!==0)continue;const s=[n];let r=n.parent;for(;r!==null;)$r.has(r)&&($r.delete(r),s.push(r)),r=r.parent;for(let a=s.length-1;a>=0;a--){const d=s[a];(d.f&(Ir|Io))===0&&L0(d)}}$r.clear()}}$r=null}}function Uk(o,e,t,i){if(!t.has(o)&&(t.add(o),o.reactions!==null))for(const n of o.reactions){const s=n.f;(s&ho)!==0?Uk(n,e,t,i):(s&(Zh|na))!==0&&(s&no)===0&&t9(n,e,i)&&(Os(n,no),i9(n))}}function t9(o,e,t){const i=t.get(o);if(i!==void 0)return i;if(o.deps!==null)for(const n of o.deps){if(km.call(e,n))return!0;if((n.f&ho)!==0&&t9(n,e,t))return t.set(n,!0),!0}return t.set(o,!1),!1}function i9(o){nn.schedule(o)}function qk(o,e){if(!((o.f&ra)!==0&&(o.f&eo)!==0)){(o.f&no)!==0?e.d.push(o):(o.f&Ua)!==0&&e.m.push(o),Os(o,eo);for(var t=o.first;t!==null;)qk(t,e),t=t.next}}function Gk(o){Os(o,eo);for(var e=o.first;e!==null;)Gk(e),e=e.next}function _I(o){let e=0,t=Eu(0),i;return()=>{r9()&&(c(t),ob(()=>(e===0&&(i=Ol(()=>o(()=>ng(t)))),e+=1,()=>{gc(()=>{e-=1,e===0&&(i==null||i(),i=void 0,ng(t))})})))}}var bI=k0|J0;function CI(o,e,t,i){new EI(o,e,t,i)}var Er,yw,yr,vd,zo,wr,ko,tr,ll,_d,nc,o0,dp,up,cl,Vv,Hs,yI,wI,SI,v1,Qx,Jx,_1,b1;class EI{constructor(e,t,i,n){xn(this,Hs);wn(this,"parent");wn(this,"is_pending",!1);wn(this,"transform_error");xn(this,Er);xn(this,yw,null);xn(this,yr);xn(this,vd);xn(this,zo);xn(this,wr,null);xn(this,ko,null);xn(this,tr,null);xn(this,ll,null);xn(this,_d,0);xn(this,nc,0);xn(this,o0,!1);xn(this,dp,new Set);xn(this,up,new Set);xn(this,cl,null);xn(this,Vv,_I(()=>(mn(this,cl,Eu(we(this,_d))),()=>{mn(this,cl,null)})));var s;mn(this,Er,e),mn(this,yr,t),mn(this,vd,r=>{var a=Rn;a.b=this,a.f|=u1,i(r)}),this.parent=Rn.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(r=>r),mn(this,zo,c9(()=>{Zn(this,Hs,v1).call(this)},bI))}defer_effect(e){Vk(e,we(this,dp),we(this,up))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!we(this,yr).pending}update_pending_count(e,t){Zn(this,Hs,_1).call(this,e,t),mn(this,_d,we(this,_d)+e),!(!we(this,cl)||we(this,o0))&&(mn(this,o0,!0),gc(()=>{mn(this,o0,!1),we(this,cl)&&F0(we(this,cl),we(this,_d))}))}get_effect_pending(){return we(this,Vv).call(this),c(we(this,cl))}error(e){if(!we(this,yr).onerror&&!we(this,yr).failed)throw e;nn!=null&&nn.is_fork?(we(this,wr)&&nn.skip_effect(we(this,wr)),we(this,ko)&&nn.skip_effect(we(this,ko)),we(this,tr)&&nn.skip_effect(we(this,tr)),nn.oncommit(()=>{Zn(this,Hs,b1).call(this,e)})):Zn(this,Hs,b1).call(this,e)}}Er=new WeakMap,yw=new WeakMap,yr=new WeakMap,vd=new WeakMap,zo=new WeakMap,wr=new WeakMap,ko=new WeakMap,tr=new WeakMap,ll=new WeakMap,_d=new WeakMap,nc=new WeakMap,o0=new WeakMap,dp=new WeakMap,up=new WeakMap,cl=new WeakMap,Vv=new WeakMap,Hs=new WeakSet,yI=function(){try{mn(this,wr,Sr(()=>we(this,vd).call(this,we(this,Er))))}catch(e){this.error(e)}},wI=function(e){const t=we(this,yr).failed;t&&mn(this,tr,Sr(()=>{t(we(this,Er),()=>e,()=>()=>{})}))},SI=function(){const e=we(this,yr).pending;e&&(this.is_pending=!0,mn(this,ko,Sr(()=>e(we(this,Er)))),gc(()=>{var t=mn(this,ll,document.createDocumentFragment()),i=_l();t.append(i),mn(this,wr,Zn(this,Hs,Jx).call(this,()=>Sr(()=>we(this,vd).call(this,i)))),we(this,nc)===0&&(we(this,Er).before(t),mn(this,ll,null),Ad(we(this,ko),()=>{mn(this,ko,null)}),Zn(this,Hs,Qx).call(this,nn))}))},v1=function(){try{if(this.is_pending=this.has_pending_snippet(),mn(this,nc,0),mn(this,_d,0),mn(this,wr,Sr(()=>{we(this,vd).call(this,we(this,Er))})),we(this,nc)>0){var e=mn(this,ll,document.createDocumentFragment());u9(we(this,wr),e);const t=we(this,yr).pending;mn(this,ko,Sr(()=>t(we(this,Er))))}else Zn(this,Hs,Qx).call(this,nn)}catch(t){this.error(t)}},Qx=function(e){this.is_pending=!1,e.transfer_effects(we(this,dp),we(this,up))},Jx=function(e){var t=Rn,i=Tn,n=uo;qa(we(this,zo)),Mr(we(this,zo)),B0(we(this,zo).ctx);try{return Cu.ensure(),e()}catch(s){return Wk(s),null}finally{qa(t),Mr(i),B0(n)}},_1=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&Zn(i=this.parent,Hs,_1).call(i,e,t);return}mn(this,nc,we(this,nc)+e),we(this,nc)===0&&(Zn(this,Hs,Qx).call(this,t),we(this,ko)&&Ad(we(this,ko),()=>{mn(this,ko,null)}),we(this,ll)&&(we(this,Er).before(we(this,ll)),mn(this,ll,null)))},b1=function(e){we(this,wr)&&(Zo(we(this,wr)),mn(this,wr,null)),we(this,ko)&&(Zo(we(this,ko)),mn(this,ko,null)),we(this,tr)&&(Zo(we(this,tr)),mn(this,tr,null));var t=we(this,yr).onerror;let i=we(this,yr).failed;var n=!1,s=!1;const r=()=>{if(n){cI();return}n=!0,s&&K7(),we(this,tr)!==null&&Ad(we(this,tr),()=>{mn(this,tr,null)}),Zn(this,Hs,Jx).call(this,()=>{Zn(this,Hs,v1).call(this)})},a=d=>{try{s=!0,t==null||t(d,r),s=!1}catch(u){rc(u,we(this,zo)&&we(this,zo).parent)}i&&mn(this,tr,Zn(this,Hs,Jx).call(this,()=>{try{return Sr(()=>{var u=Rn;u.b=this,u.f|=u1,i(we(this,Er),()=>d,()=>r)})}catch(u){return rc(u,we(this,zo).parent),null}}))};gc(()=>{var d;try{d=this.transform_error(e)}catch(u){rc(u,we(this,zo)&&we(this,zo).parent);return}d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(a,u=>rc(u,we(this,zo)&&we(this,zo).parent)):a(d)})};function DI(o,e,t,i){const n=Lg;var s=o.filter(p=>!p.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var r=Rn,a=AI(),d=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(p=>p.promise)):null;function u(p){if((r.f&Ir)===0){a();try{i(p)}catch(C){rc(C,r)}Lm()}}var f=Kk();if(t.length===0){d.then(()=>u(e.map(n))).finally(f);return}function g(){Promise.all(t.map(p=>kI(p))).then(p=>u([...e.map(n),...p])).catch(p=>rc(p,r)).finally(f)}d?d.then(()=>{a(),g(),Lm()}):g()}function AI(){var o=Rn,e=Tn,t=uo,i=nn;return function(s=!0){qa(o),Mr(e),B0(t),s&&(o.f&Ir)===0&&(i==null||i.activate(),i==null||i.apply())}}function Lm(o=!0){qa(null),Mr(null),B0(null),o&&(nn==null||nn.deactivate())}function Kk(){var o=Rn,e=o.b,t=nn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,o),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,o)}}function Lg(o){var e=ho|no;return Rn!==null&&(Rn.f|=J0),{ctx:uo,deps:null,effects:null,equals:Rk,f:e,fn:o,reactions:null,rv:0,v:Qs,wv:0,parent:Rn,ac:null}}const fx=Symbol("obsolete");function kI(o,e,t){let i=Rn;i===null&&O7();var n=void 0,s=Eu(Qs),r=!Tn,a=new Set;return WI(()=>{var C,b;var d=Rn,u=Lk();n=u.promise;try{Promise.resolve(o()).then(u.resolve,y=>{y!==nb&&u.reject(y)}).finally(Lm)}catch(y){u.reject(y),Lm()}var f=nn;if(r){if((d.f&Q0)!==0)var g=Kk();if((C=i.b)!=null&&C.is_rendered())(b=f.async_deriveds.get(d))==null||b.reject(fx);else for(const y of a.values())y.reject(fx);a.add(u),f.async_deriveds.set(d,u)}const p=(y,w=void 0)=>{g==null||g(),a.delete(u),w!==fx&&(f.activate(),w?(s.f|=fc,F0(s,w)):((s.f&fc)!==0&&(s.f^=fc),F0(s,y)),f.deactivate())};u.promise.then(p,y=>p(null,y||"unknown"))}),a9(()=>{for(const d of a)d.reject(fx)}),new Promise(d=>{function u(f){function g(){f===n?d(s):u(n)}f.then(g,g)}u(n)})}function Tt(o){const e=Lg(o);return u6(e),e}function n9(o){const e=Lg(o);return e.equals=Nk,e}function BI(o){var e=o.effects;if(e!==null){o.effects=null;for(var t=0;t<e.length;t+=1)Zo(e[t])}}function s9(o){var e,t=Rn,i=o.parent;if(!Al&&i!==null&&o.v!==Qs&&(i.f&(Ir|Io))!==0)return aI(),o.v;qa(i);try{o.f&=~bu,BI(o),e=p6(o)}finally{qa(t)}return e}function Zk(o){var e=s9(o);if(!o.equals(e)&&(o.wv=f6(),(!(nn!=null&&nn.is_fork)||o.deps===null)&&(nn!==null?(nn.capture(o,e,!0),tg==null||tg.capture(o,e,!0)):o.v=e,o.deps===null))){Os(o,eo);return}Al||(ro!==null?(r9()||nn!=null&&nn.is_fork)&&ro.set(o,e):e9(o))}function FI(o){var e,t;if(o.effects!==null)for(const i of o.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(nb),i.fn!==null&&(i.teardown=tb),i.ac=null,Ig(i,0),d9(i))}function Xk(o){if(o.effects!==null)for(const e of o.effects)e.teardown&&e.fn!==null&&L0(e)}let Im=new Set;const Sd=new Map;let Yk=!1;function Eu(o,e){var t={f:0,v:o,reactions:null,equals:Rk,rv:0,wv:0};return t}function I(o,e){const t=Eu(o);return u6(t),t}function LI(o,e=!1,t=!0){const i=Eu(o);return e||(i.equals=Nk),i}function m(o,e,t=!1){Tn!==null&&(!sa||(Tn.f&Bm)!==0)&&Ok()&&(Tn.f&(ho|na|Zh|Bm))!==0&&(za===null||!za.has(o))&&G7();let i=t?Ei(e):e;return F0(o,i,Yx)}function F0(o,e,t=null){if(!o.equals(e)){Sd.set(o,Al?e:o.v);var i=Cu.ensure();if(i.capture(o,e),(o.f&ho)!==0){const n=o;(o.f&no)!==0&&s9(n),ro===null&&e9(n)}o.wv=f6(),Qk(o,no,t),Rn!==null&&(Rn.f&eo)!==0&&(Rn.f&(ra|Mc))===0&&(Cr===null?VI([o]):Cr.push(o)),!i.is_fork&&Im.size>0&&!Yk&&II()}return e}function II(){Yk=!1;for(const o of Im){(o.f&eo)!==0&&Os(o,Ua);let e;try{e=Pp(o)}catch{e=!0}e&&L0(o)}Im.clear()}function l8(o,e=1){var t=c(o),i=e===1?t++:t--;return m(o,t),i}function ng(o){m(o,o.v+1)}function Qk(o,e,t){var i=o.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var r=i[s],a=r.f,d=(a&no)===0;if(d&&Os(r,e),(a&Bm)!==0)Im.add(r);else if((a&ho)!==0){var u=r;ro==null||ro.delete(u),(a&bu)===0&&(a&Lr&&(Rn===null||(Rn.f&Fm)===0)&&(r.f|=bu),Qk(u,Ua,t))}else if(d){var f=r;(a&na)!==0&&$r!==null&&$r.add(f),t!==null?t.push(f):i9(f)}}}function Ei(o){if(typeof o!="object"||o===null||wd in o)return o;const e=Fk(o);if(e!==B7&&e!==F7)return o;var t=new Map,i=Jw(o),n=I(0),s=kd,r=a=>{if(kd===s)return a();var d=Tn,u=kd;Mr(null),h8(s);var f=a();return Mr(d),h8(u),f};return i&&t.set("length",I(o.length)),new Proxy(o,{defineProperty(a,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&U7();var f=t.get(d);return f===void 0?r(()=>{var g=I(u.value);return t.set(d,g),g}):m(f,u.value,!0),!0},deleteProperty(a,d){var u=t.get(d);if(u===void 0){if(d in a){const f=r(()=>I(Qs));t.set(d,f),ng(n)}}else m(u,Qs),ng(n);return!0},get(a,d,u){var C;if(d===wd)return o;var f=t.get(d),g=d in a;if(f===void 0&&(!g||(C=Kh(a,d))!=null&&C.writable)&&(f=r(()=>{var b=Ei(g?a[d]:Qs),y=I(b);return y}),t.set(d,f)),f!==void 0){var p=c(f);return p===Qs?void 0:p}return Reflect.get(a,d,u)},getOwnPropertyDescriptor(a,d){var u=Reflect.getOwnPropertyDescriptor(a,d);if(u&&"value"in u){var f=t.get(d);f&&(u.value=c(f))}else if(u===void 0){var g=t.get(d),p=g==null?void 0:g.v;if(g!==void 0&&p!==Qs)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(a,d){var p;if(d===wd)return!0;var u=t.get(d),f=u!==void 0&&u.v!==Qs||Reflect.has(a,d);if(u!==void 0||Rn!==null&&(!f||(p=Kh(a,d))!=null&&p.writable)){u===void 0&&(u=r(()=>{var C=f?Ei(a[d]):Qs,b=I(C);return b}),t.set(d,u));var g=c(u);if(g===Qs)return!1}return f},set(a,d,u,f){var M;var g=t.get(d),p=d in a;if(i&&d==="length")for(var C=u;C<g.v;C+=1){var b=t.get(C+"");b!==void 0?m(b,Qs):C in a&&(b=r(()=>I(Qs)),t.set(C+"",b))}if(g===void 0)(!p||(M=Kh(a,d))!=null&&M.writable)&&(g=r(()=>I(void 0)),m(g,Ei(u)),t.set(d,g));else{p=g.v!==Qs;var y=r(()=>Ei(u));m(g,y)}var w=Reflect.getOwnPropertyDescriptor(a,d);if(w!=null&&w.set&&w.set.call(f,u),!p){if(i&&typeof d=="string"){var A=t.get("length"),P=Number(d);Number.isInteger(P)&&P>=A.v&&m(A,P+1)}ng(n)}return!0},ownKeys(a){c(n);var d=Reflect.ownKeys(a).filter(g=>{var p=t.get(g);return p===void 0||p.v!==Qs});for(var[u,f]of t)f.v!==Qs&&!(u in a)&&d.push(u);return d},setPrototypeOf(){q7()}})}function c8(o){try{if(o!==null&&typeof o=="object"&&wd in o)return o[wd]}catch{}return o}function PI(o,e){return Object.is(c8(o),c8(e))}var Dd,Jk,e6,t6,i6;function TI(){if(Dd===void 0){Dd=window,Jk=document,e6=/Firefox/.test(navigator.userAgent);var o=Element.prototype,e=Node.prototype,t=Text.prototype;t6=Kh(e,"firstChild").get,i6=Kh(e,"nextSibling").get,s8(o)&&(o[f1]=void 0,o[Zx]=null,o[g1]=void 0,o.__e=void 0),s8(t)&&(t[Rf]=void 0)}}function _l(o=""){return document.createTextNode(o)}function Ra(o){return t6.call(o)}function Ip(o){return i6.call(o)}function _(o,e){return Ra(o)}function yt(o,e=!1){{var t=Ra(o);return t instanceof Comment&&t.data===""?Ip(t):t}}function v(o,e=1,t=!1){let i=o;for(;e--;)i=Ip(i);return i}function MI(o){o.textContent=""}function n6(){return!1}function s6(o,e,t){return e==null||e===Mk?t?document.createElement(o,{is:t}):document.createElement(o):t?document.createElementNS(e,o,{is:t}):document.createElementNS(e,o)}let d8=!1;function RI(){d8||(d8=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{var e;if(!o.defaultPrevented)for(const t of o.target.elements)(e=t[Xx])==null||e.call(t)})},{capture:!0}))}function sb(o){var e=Tn,t=Rn;Mr(null),qa(null);try{return o()}finally{Mr(e),qa(t)}}function o9(o,e,t,i=t){o.addEventListener(e,()=>sb(t));const n=o[Xx];n?o[Xx]=()=>{n(),i(!0)}:o[Xx]=()=>i(!0),RI()}function NI(o){Rn===null&&(Tn===null&&V7(),z7()),Al&&W7()}function OI(o,e){var t=e.last;t===null?e.last=e.first=o:(t.next=o,o.prev=t,e.last=o)}function Nl(o,e){var t=Rn;t!==null&&(t.f&Io)!==0&&(o|=Io);var i={ctx:uo,deps:null,nodes:null,f:o|no|Lr,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};nn==null||nn.register_created_effect(i);var n=i;if((o&A0)!==0)Th!==null?Th.push(i):Cu.ensure().schedule(i);else if(e!==null){try{L0(i)}catch(r){throw Zo(i),r}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&J0)===0&&(n=n.first,(o&na)!==0&&(o&k0)!==0&&n!==null&&(n.f|=k0))}if(n!==null&&(n.parent=t,t!==null&&OI(n,t),Tn!==null&&(Tn.f&ho)!==0&&(o&Mc)===0)){var s=Tn;(s.effects??(s.effects=[])).push(n)}return i}function r9(){return Tn!==null&&!sa}function a9(o){const e=Nl(ib,null);return Os(e,eo),e.teardown=o,e}function $n(o){NI();var e=Rn.f,t=!Tn&&(e&ra)!==0&&uo!==null&&!uo.i;if(t){var i=uo;(i.e??(i.e=[])).push(o)}else return o6(o)}function o6(o){return Nl(A0|T7,o)}function HI(o){Cu.ensure();const e=Nl(Mc|J0,o);return(t={})=>new Promise(i=>{t.outro?Ad(e,()=>{Zo(e),i(void 0)}):(Zo(e),i(void 0))})}function l9(o){return Nl(A0,o)}function WI(o){return Nl(Zh|J0,o)}function ob(o,e=0){return Nl(ib|e,o)}function j(o,e=[],t=[],i=[]){DI(i,e,t,n=>{Nl(ib,()=>o(...n.map(c)))})}function c9(o,e=0){var t=Nl(na|e,o);return t}function Sr(o){return Nl(ra|J0,o)}function r6(o){var e=o.teardown;if(e!==null){const t=Al,i=Tn;u8(!0),Mr(null);try{e.call(null)}finally{u8(t),Mr(i)}}}function d9(o,e=!1){var t=o.first;for(o.first=o.last=null;t!==null;){const n=t.ac;n!==null&&sb(()=>{n.abort(nb)});var i=t.next;(t.f&Mc)!==0?t.parent=null:Zo(t,e),t=i}}function zI(o){for(var e=o.first;e!==null;){var t=e.next;(e.f&ra)===0&&Zo(e),e=t}}function Zo(o,e=!0){var t=!1;(e||(o.f&P7)!==0)&&o.nodes!==null&&o.nodes.end!==null&&(a6(o.nodes.start,o.nodes.end),t=!0),Os(o,h1),d9(o,e&&!t),Ig(o,0);var i=o.nodes&&o.nodes.t;if(i!==null)for(const s of i)s.stop();r6(o),o.f^=h1,o.f|=Ir;var n=o.parent;n!==null&&n.first!==null&&l6(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes=o.ac=o.b=null}function a6(o,e){for(;o!==null;){var t=o===e?null:Ip(o);o.remove(),o=t}}function l6(o){var e=o.parent,t=o.prev,i=o.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===o&&(e.first=i),e.last===o&&(e.last=t))}function Ad(o,e,t=!0){var i=[];c6(o,i,!0);var n=()=>{t&&Zo(o),e&&e()},s=i.length;if(s>0){var r=()=>--s||n();for(var a of i)a.out(r)}else n()}function c6(o,e,t){if((o.f&Io)===0){o.f^=Io;var i=o.nodes&&o.nodes.t;if(i!==null)for(const a of i)(a.is_global||t)&&e.push(a);for(var n=o.first;n!==null;){var s=n.next;if((n.f&Mc)===0){var r=(n.f&k0)!==0||(n.f&ra)!==0&&(o.f&na)!==0;c6(n,e,r?t:!1)}n=s}}}function Pm(o){d6(o,!0)}function d6(o,e){if((o.f&Io)!==0){o.f^=Io,(o.f&eo)===0&&(Os(o,no),Cu.ensure().schedule(o));for(var t=o.first;t!==null;){var i=t.next,n=(t.f&k0)!==0||(t.f&ra)!==0;d6(t,n?e:!1),t=i}var s=o.nodes&&o.nodes.t;if(s!==null)for(const r of s)(r.is_global||e)&&r.in()}}function u9(o,e){if(o.nodes)for(var t=o.nodes.start,i=o.nodes.end;t!==null;){var n=t===i?null:Ip(t);e.append(t),t=n}}let em=!1,Al=!1;function u8(o){Al=o}let Tn=null,sa=!1;function Mr(o){Tn=o}let Rn=null;function qa(o){Rn=o}let za=null;function u6(o){Tn!==null&&(za??(za=new Set)).add(o)}let Vo=null,Jo=0,Cr=null;function VI(o){Cr=o}let h6=1,fd=0,kd=fd;function h8(o){kd=o}function f6(){return++h6}function Pp(o){var e=o.f;if((e&no)!==0)return!0;if(e&ho&&(o.f&=~bu),(e&Ua)!==0){for(var t=o.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(Pp(s)&&Zk(s),s.wv>o.wv)return!0}(e&Lr)!==0&&ro===null&&Os(o,eo)}return!1}function g6(o,e,t=!0){var i=o.reactions;if(i!==null&&!(za!==null&&za.has(o)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&ho)!==0?g6(s,e,!1):e===s&&(t?Os(s,no):(s.f&eo)!==0&&Os(s,Ua),i9(s))}}function p6(o){var y;var e=Vo,t=Jo,i=Cr,n=Tn,s=za,r=uo,a=sa,d=kd,u=o.f;Vo=null,Jo=0,Cr=null,Tn=(u&(ra|Mc))===0?o:null,za=null,B0(o.ctx),sa=!1,kd=++fd,o.ac!==null&&(sb(()=>{o.ac.abort(nb)}),o.ac=null);try{o.f|=Fm;var f=o.fn,g=f();o.f|=Q0;var p=o.deps,C=nn==null?void 0:nn.is_fork;if(Vo!==null){var b;if(C||Ig(o,Jo),p!==null&&Jo>0)for(p.length=Jo+Vo.length,b=0;b<Vo.length;b++)p[Jo+b]=Vo[b];else o.deps=p=Vo;if(r9()&&(o.f&Lr)!==0)for(b=Jo;b<p.length;b++)((y=p[b]).reactions??(y.reactions=[])).push(o)}else!C&&p!==null&&Jo<p.length&&(Ig(o,Jo),p.length=Jo);if(Ok()&&Cr!==null&&!sa&&p!==null&&(o.f&(ho|Ua|no))===0)for(b=0;b<Cr.length;b++)g6(Cr[b],o);if(n!==null&&n!==o){if(fd++,n.deps!==null)for(let w=0;w<t;w+=1)n.deps[w].rv=fd;if(e!==null)for(const w of e)w.rv=fd;Cr!==null&&(i===null?i=Cr:i.push(...Cr))}return(o.f&fc)!==0&&(o.f^=fc),g}catch(w){return Wk(w)}finally{o.f^=Fm,Vo=e,Jo=t,Cr=i,Tn=n,za=s,B0(r),sa=a,kd=d}}function jI(o,e){let t=e.reactions;if(t!==null){var i=D7.call(t,o);if(i!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[i]=t[n],t.pop())}}if(t===null&&(e.f&ho)!==0&&(Vo===null||!km.call(Vo,e))){var s=e;(s.f&Lr)!==0&&(s.f^=Lr,s.f&=~bu),s.v!==Qs&&e9(s),FI(s),Ig(s,0)}}function Ig(o,e){var t=o.deps;if(t!==null)for(var i=e;i<t.length;i++)jI(o,t[i])}function L0(o){var e=o.f;if((e&Ir)===0){Os(o,eo);var t=Rn,i=em;Rn=o,em=!0;try{(e&(na|Ik))!==0?zI(o):d9(o),r6(o);var n=p6(o);o.teardown=typeof n=="function"?n:null,o.wv=h6;var s;Bk&&uI&&(o.f&no)!==0&&o.deps}finally{em=i,Rn=t}}}async function ul(){await Promise.resolve(),mI()}function c(o){var e=o.f,t=(e&ho)!==0;if(Tn!==null&&!sa){var i=Rn!==null&&(Rn.f&Ir)!==0;if(!i&&(za===null||!za.has(o))){var n=Tn.deps;if((Tn.f&Fm)!==0)o.rv<fd&&(o.rv=fd,Vo===null&&n!==null&&n[Jo]===o?Jo++:Vo===null?Vo=[o]:Vo.push(o));else{Tn.deps??(Tn.deps=[]),km.call(Tn.deps,o)||Tn.deps.push(o);var s=o.reactions;s===null?o.reactions=[Tn]:km.call(s,Tn)||s.push(Tn)}}}if(Al&&Sd.has(o))return Sd.get(o);if(t){var r=o;if(Al){var a=r.v;return((r.f&eo)===0&&r.reactions!==null||m6(r))&&(a=s9(r)),Sd.set(r,a),a}var d=(r.f&Lr)===0&&!sa&&Tn!==null&&(em||(Tn.f&Lr)!==0),u=(r.f&Q0)===0;Pp(r)&&(d&&(r.f|=Lr),Zk(r)),d&&!u&&(Xk(r),x6(r))}if(ro!=null&&ro.has(o))return ro.get(o);if((o.f&fc)!==0)throw o.v;return o.v}function x6(o){if(o.f|=Lr,o.deps!==null)for(const e of o.deps)(e.reactions??(e.reactions=[])).push(o),(e.f&ho)!==0&&(e.f&Lr)===0&&(Xk(e),x6(e))}function m6(o){if(o.v===Qs)return!0;if(o.deps===null)return!1;for(const e of o.deps)if(Sd.has(e)||(e.f&ho)!==0&&m6(e))return!0;return!1}function Ol(o){var e=sa;try{return sa=!0,o()}finally{sa=e}}const $I=["touchstart","touchmove"];function UI(o){return $I.includes(o)}const gd=Symbol("events"),v6=new Set,C1=new Set;function qI(o,e,t,i={}){function n(s){if(i.capture||E1.call(e,s),!s.cancelBubble)return sb(()=>t==null?void 0:t.call(this,s))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?gc(()=>{e.addEventListener(o,n,i)}):e.addEventListener(o,n,i),n}function fs(o,e,t,i,n){var s={capture:i,passive:n},r=qI(o,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&a9(()=>{e.removeEventListener(o,r,s)})}function $(o,e,t){(e[gd]??(e[gd]={}))[o]=t}function Zs(o){for(var e=0;e<o.length;e++)v6.add(o[e]);for(var t of C1)t(o)}let f8=null;function E1(o){var y,w;var e=this,t=e.ownerDocument,i=o.type,n=((y=o.composedPath)==null?void 0:y.call(o))||[],s=n[0]||o.target;f8=o;var r=0,a=f8===o&&o[gd];if(a){var d=n.indexOf(a);if(d!==-1&&(e===document||e===window)){o[gd]=e;return}var u=n.indexOf(e);if(u===-1)return;d<=u&&(r=d)}if(s=n[r]||o.target,s!==e){A7(o,"currentTarget",{configurable:!0,get(){return s||t}});var f=Tn,g=Rn;Mr(null),qa(null);try{for(var p,C=[];s!==null&&s!==e;){try{var b=(w=s[gd])==null?void 0:w[i];b!=null&&(!s.disabled||o.target===s)&&b.call(s,o)}catch(A){p?C.push(A):p=A}if(o.cancelBubble)break;r++,s=r<n.length?n[r]:null}if(p){for(let A of C)queueMicrotask(()=>{throw A});throw p}}finally{o[gd]=e,delete o.currentTarget,Mr(f),qa(g)}}}var QA;const sC=((QA=globalThis==null?void 0:globalThis.window)==null?void 0:QA.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:o=>o});function GI(o){return(sC==null?void 0:sC.createHTML(o))??o}function _6(o){var e=s6("template");return e.innerHTML=GI(o.replaceAll("<!>","<!---->")),e.content}function yu(o,e){var t=Rn;t.nodes===null&&(t.nodes={start:o,end:e,a:null,t:null})}function B(o,e){var t=(e&nI)!==0,i=(e&sI)!==0,n,s=!o.startsWith("<!>");return()=>{n===void 0&&(n=_6(s?o:"<!>"+o),t||(n=Ra(n)));var r=i||e6?document.importNode(n,!0):n.cloneNode(!0);if(t){var a=Ra(r),d=r.lastChild;yu(a,d)}else yu(r,r);return r}}function KI(o,e,t="svg"){var i=!o.startsWith("<!>"),n=`<${t}>${i?o:"<!>"+o}</${t}>`,s;return()=>{if(!s){var r=_6(n),a=Ra(r);s=Ra(a)}var d=s.cloneNode(!0);return yu(d,d),d}}function b6(o,e){return KI(o,e,"svg")}function _o(o=""){{var e=_l(o+"");return yu(e,e),e}}function Es(){var o=document.createDocumentFragment(),e=document.createComment(""),t=_l();return o.append(e,t),yu(e,t),o}function D(o,e){o!==null&&o.before(e)}function O(o,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(o[Rf]??(o[Rf]=o.nodeValue))&&(o[Rf]=t,o.nodeValue=`${t}`)}function ZI(o,e){return XI(o,e)}const gx=new Map;function XI(o,{target:e,anchor:t,props:i={},events:n,context:s,intro:r=!0,transformError:a}){TI();var d=void 0,u=HI(()=>{var f=t??e.appendChild(_l());CI(f,{pending:()=>{}},C=>{Vs({});var b=uo;s&&(b.c=s),n&&(i.$$events=n),d=o(C,i)||{},js()},a);var g=new Set,p=C=>{for(var b=0;b<C.length;b++){var y=C[b];if(!g.has(y)){g.add(y);var w=UI(y);for(const M of[e,document]){var A=gx.get(M);A===void 0&&(A=new Map,gx.set(M,A));var P=A.get(y);P===void 0?(M.addEventListener(y,E1,{passive:w}),A.set(y,1)):A.set(y,P+1)}}}};return p(eb(v6)),C1.add(p),()=>{var w;for(var C of g)for(const A of[e,document]){var b=gx.get(A),y=b.get(C);--y==0?(A.removeEventListener(C,E1),b.delete(C),b.size===0&&gx.delete(A)):b.set(C,y)}C1.delete(p),f!==t&&((w=f.parentNode)==null||w.removeChild(f))}});return YI.set(d,u),d}let YI=new WeakMap;var Kr,ka,ir,bd,hp,fp,jv;class QI{constructor(e,t=!0){wn(this,"anchor");xn(this,Kr,new Map);xn(this,ka,new Map);xn(this,ir,new Map);xn(this,bd,new Set);xn(this,hp,!0);xn(this,fp,e=>{if(we(this,Kr).has(e)){var t=we(this,Kr).get(e),i=we(this,ka).get(t);if(i)Pm(i),we(this,bd).delete(t);else{var n=we(this,ir).get(t);n&&(Pm(n.effect),we(this,ka).set(t,n.effect),we(this,ir).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,r]of we(this,Kr)){if(we(this,Kr).delete(s),s===e)break;const a=we(this,ir).get(r);a&&(Zo(a.effect),we(this,ir).delete(r))}for(const[s,r]of we(this,ka)){if(s===t||we(this,bd).has(s))continue;const a=()=>{if(Array.from(we(this,Kr).values()).includes(s)){var u=document.createDocumentFragment();u9(r,u),u.append(_l()),we(this,ir).set(s,{effect:r,fragment:u})}else Zo(r);we(this,bd).delete(s),we(this,ka).delete(s)};we(this,hp)||!i?(we(this,bd).add(s),Ad(r,a,!1)):a()}}});xn(this,jv,e=>{we(this,Kr).delete(e);const t=Array.from(we(this,Kr).values());for(const[i,n]of we(this,ir))t.includes(i)||(Zo(n.effect),we(this,ir).delete(i))});this.anchor=e,mn(this,hp,t)}ensure(e,t){var i=nn,n=n6();if(t&&!we(this,ka).has(e)&&!we(this,ir).has(e))if(n){var s=document.createDocumentFragment(),r=_l();s.append(r),we(this,ir).set(e,{effect:Sr(()=>t(r)),fragment:s})}else we(this,ka).set(e,Sr(()=>t(this.anchor)));if(we(this,Kr).set(i,e),n){for(const[a,d]of we(this,ka))a===e?i.unskip_effect(d):i.skip_effect(d);for(const[a,d]of we(this,ir))a===e?i.unskip_effect(d.effect):i.skip_effect(d.effect);i.oncommit(we(this,fp)),i.ondiscard(we(this,jv))}else we(this,fp).call(this,i)}}Kr=new WeakMap,ka=new WeakMap,ir=new WeakMap,bd=new WeakMap,hp=new WeakMap,fp=new WeakMap,jv=new WeakMap;function z(o,e,t=!1){var i=new QI(o),n=t?k0:0;function s(r,a){i.ensure(r,a)}c9(()=>{var r=!1;e((a,d=0)=>{r=!0,s(d,a)}),r||s(-1,null)},n)}function Ni(o,e){return e}function JI(o,e,t){for(var i=[],n=e.length,s,r=e.length,a=0;a<n;a++){let g=e[a];Ad(g,()=>{if(s){if(s.pending.delete(g),s.done.add(g),s.pending.size===0){var p=o.outrogroups;y1(o,eb(s.done)),p.delete(s),p.size===0&&(o.outrogroups=null)}}else r-=1},!1)}if(r===0){var d=i.length===0&&t!==null;if(d){var u=t,f=u.parentNode;MI(f),f.append(u),o.items.clear()}y1(o,e,!d)}else s={pending:new Set(e),done:new Set},(o.outrogroups??(o.outrogroups=new Set)).add(s)}function y1(o,e,t=!0){var i;if(o.pending.size>0){i=new Set;for(const r of o.pending.values())for(const a of r)i.add(o.items.get(a).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=Ma;const r=document.createDocumentFragment();u9(s,r)}else Zo(e[n],t)}}var g8;function ei(o,e,t,i,n,s=null){var r=o,a=new Map,d=(e&Tk)!==0;if(d){var u=o;r=u.appendChild(_l())}var f=null,g=n9(()=>{var M=t();return Jw(M)?M:M==null?[]:eb(M)}),p,C=new Map,b=!0;function y(M){(P.effect.f&Ir)===0&&(P.pending.delete(M),P.fallback=f,eP(P,p,r,e,i),f!==null&&(p.length===0?(f.f&Ma)===0?Pm(f):(f.f^=Ma,Hf(f,null,r)):Ad(f,()=>{f=null})))}function w(M){P.pending.delete(M)}var A=c9(()=>{p=c(g);for(var M=p.length,R=new Set,T=nn,V=n6(),W=0;W<M;W+=1){var Q=p[W],ne=i(Q,W),de=b?null:a.get(ne);de?(de.v&&F0(de.v,Q),de.i&&F0(de.i,W),V&&T.unskip_effect(de.e)):(de=tP(a,b?r:g8??(g8=_l()),Q,ne,W,n,e,t),b||(de.e.f|=Ma),a.set(ne,de)),R.add(ne)}if(M===0&&s&&!f&&(b?f=Sr(()=>s(r)):(f=Sr(()=>s(g8??(g8=_l()))),f.f|=Ma)),M>R.size&&H7(),!b)if(C.set(T,R),V){for(const[te,he]of a)R.has(te)||T.skip_effect(he.e);T.oncommit(y),T.ondiscard(w)}else y(T);c(g)}),P={effect:A,items:a,pending:C,outrogroups:null,fallback:f};b=!1}function Df(o){for(;o!==null&&(o.f&ra)===0;)o=o.next;return o}function eP(o,e,t,i,n){var de,te,he,De,oe,ge,Se,Re,xe;var s=(i&Y7)!==0,r=e.length,a=o.items,d=Df(o.effect.first),u,f=null,g,p=[],C=[],b,y,w,A;if(s)for(A=0;A<r;A+=1)b=e[A],y=n(b,A),w=a.get(y).e,(w.f&Ma)===0&&((te=(de=w.nodes)==null?void 0:de.a)==null||te.measure(),(g??(g=new Set)).add(w));for(A=0;A<r;A+=1){if(b=e[A],y=n(b,A),w=a.get(y).e,o.outrogroups!==null)for(const et of o.outrogroups)et.pending.delete(w),et.done.delete(w);if((w.f&Io)!==0&&(Pm(w),s&&((De=(he=w.nodes)==null?void 0:he.a)==null||De.unfix(),(g??(g=new Set)).delete(w))),(w.f&Ma)!==0)if(w.f^=Ma,w===d)Hf(w,null,t);else{var P=f?f.next:d;w===o.effect.last&&(o.effect.last=w.prev),w.prev&&(w.prev.next=w.next),w.next&&(w.next.prev=w.prev),jl(o,f,w),jl(o,w,P),Hf(w,P,t),f=w,p=[],C=[],d=Df(f.next);continue}if(w!==d){if(u!==void 0&&u.has(w)){if(p.length<C.length){var M=C[0],R;f=M.prev;var T=p[0],V=p[p.length-1];for(R=0;R<p.length;R+=1)Hf(p[R],M,t);for(R=0;R<C.length;R+=1)u.delete(C[R]);jl(o,T.prev,V.next),jl(o,f,T),jl(o,V,M),d=M,f=V,A-=1,p=[],C=[]}else u.delete(w),Hf(w,d,t),jl(o,w.prev,w.next),jl(o,w,f===null?o.effect.first:f.next),jl(o,f,w),f=w;continue}for(p=[],C=[];d!==null&&d!==w;)(u??(u=new Set)).add(d),C.push(d),d=Df(d.next);if(d===null)continue}(w.f&Ma)===0&&p.push(w),f=w,d=Df(w.next)}if(o.outrogroups!==null){for(const et of o.outrogroups)et.pending.size===0&&(y1(o,eb(et.done)),(oe=o.outrogroups)==null||oe.delete(et));o.outrogroups.size===0&&(o.outrogroups=null)}if(d!==null||u!==void 0){var W=[];if(u!==void 0)for(w of u)(w.f&Io)===0&&W.push(w);for(;d!==null;)(d.f&Io)===0&&d!==o.fallback&&W.push(d),d=Df(d.next);var Q=W.length;if(Q>0){var ne=(i&Tk)!==0&&r===0?t:null;if(s){for(A=0;A<Q;A+=1)(Se=(ge=W[A].nodes)==null?void 0:ge.a)==null||Se.measure();for(A=0;A<Q;A+=1)(xe=(Re=W[A].nodes)==null?void 0:Re.a)==null||xe.fix()}JI(o,W,ne)}}s&&gc(()=>{var et,We;if(g!==void 0)for(w of g)(We=(et=w.nodes)==null?void 0:et.a)==null||We.apply()})}function tP(o,e,t,i,n,s,r,a){var d=(r&Z7)!==0?(r&Q7)===0?LI(t,!1,!1):Eu(t):null,u=(r&X7)!==0?Eu(n):null;return{v:d,i:u,e:Sr(()=>(s(e,d??t,u??n,a),()=>{o.delete(i)}))}}function Hf(o,e,t){if(o.nodes)for(var i=o.nodes.start,n=o.nodes.end,s=e&&(e.f&Ma)===0?e.nodes.start:t;i!==null;){var r=Ip(i);if(s.before(i),i===n)return;i=r}}function jl(o,e,t){e===null?o.effect.first=t:e.next=t,t===null?o.effect.last=e:t.prev=e}function ac(o,e,t=!1,i=!1,n=!1,s=!1){var r=o,a="";if(t)var d=o;j(()=>{var u=Rn;if(a!==(a=e()??"")){if(t){u.nodes=null,d.innerHTML=a,a!==""&&yu(Ra(d),d.lastChild);return}if(u.nodes!==null&&(a6(u.nodes.start,u.nodes.end),u.nodes=null),a!==""){var f=i?oI:n?rI:void 0,g=s6(i?"svg":n?"math":"template",f);g.innerHTML=a;var p=i||n?g:g.content;if(yu(Ra(p),p.lastChild),i||n)for(;Ra(p);)r.before(Ra(p));else r.before(p)}}})}function C6(o){var e,t,i="";if(typeof o=="string"||typeof o=="number")i+=o;else if(typeof o=="object")if(Array.isArray(o)){var n=o.length;for(e=0;e<n;e++)o[e]&&(t=C6(o[e]))&&(i&&(i+=" "),i+=t)}else for(t in o)o[t]&&(i&&(i+=" "),i+=t);return i}function iP(){for(var o,e,t=0,i="",n=arguments.length;t<n;t++)(o=arguments[t])&&(e=C6(o))&&(i&&(i+=" "),i+=e);return i}function sg(o){return typeof o=="object"?iP(o):o??""}const p8=[...`
3
3
  \r\f \v\uFEFF`];function nP(o,e,t){var i=o==null?"":""+o;if(e&&(i=i?i+" "+e:e),t){for(var n of Object.keys(t))if(t[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,r=0;(r=i.indexOf(n,r))>=0;){var a=r+s;(r===0||p8.includes(i[r-1]))&&(a===i.length||p8.includes(i[a]))?i=(r===0?"":i.substring(0,r))+i.substring(a+1):r=a}}return i===""?null:i}function x8(o,e=!1){var t=e?" !important;":";",i="";for(var n of Object.keys(o)){var s=o[n];s!=null&&s!==""&&(i+=" "+n+": "+s+t)}return i}function oC(o){return o[0]!=="-"||o[1]!=="-"?o.toLowerCase():o}function sP(o,e){if(e){var t="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,o){o=String(o).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,r=0,a=!1,d=[];i&&d.push(...Object.keys(i).map(oC)),n&&d.push(...Object.keys(n).map(oC));var u=0,f=-1;const y=o.length;for(var g=0;g<y;g++){var p=o[g];if(a?p==="/"&&o[g-1]==="*"&&(a=!1):s?s===p&&(s=!1):p==="/"&&o[g+1]==="*"?a=!0:p==='"'||p==="'"?s=p:p==="("?r++:p===")"&&r--,!a&&s===!1&&r===0){if(p===":"&&f===-1)f=g;else if(p===";"||g===y-1){if(f!==-1){var C=oC(o.substring(u,f).trim());if(!d.includes(C)){p!==";"&&g++;var b=o.substring(u,g).trim();t+=" "+b+";"}}u=g+1,f=-1}}}}return i&&(t+=x8(i)),n&&(t+=x8(n,!0)),t=t.trim(),t===""?null:t}return o==null?null:String(o)}function Bt(o,e,t,i,n,s){var r=o[f1];if(r!==t||r===void 0){var a=nP(t,i,s);a==null?o.removeAttribute("class"):e?o.className=a:o.setAttribute("class",a),o[f1]=t}else if(s&&n!==s)for(var d in s){var u=!!s[d];(n==null||u!==!!n[d])&&o.classList.toggle(d,u)}return s}function rC(o,e={},t,i){for(var n in t){var s=t[n];e[n]!==s&&(t[n]==null?o.style.removeProperty(n):o.style.setProperty(n,s,i))}}function $o(o,e,t,i){var n=o[g1];if(n!==e){var s=sP(e,i);s==null?o.removeAttribute("style"):o.style.cssText=s,o[g1]=e}else i&&(Array.isArray(i)?(rC(o,t==null?void 0:t[0],i[0]),rC(o,t==null?void 0:t[1],i[1],"important")):rC(o,t,i));return i}function Tm(o,e,t=!1){if(o.multiple){if(e==null)return;if(!Jw(e))return lI();for(var i of o.options)i.selected=e.includes(og(i));return}for(i of o.options){var n=og(i);if(PI(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function w1(o){var e=new MutationObserver(()=>{Tm(o,o.__value)});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),a9(()=>{e.disconnect()})}function Fs(o,e,t=e){var i=new WeakSet,n=!0;o9(o,"change",s=>{var r=s?"[selected]":":checked",a;if(o.multiple)a=[].map.call(o.querySelectorAll(r),og);else{var d=o.querySelector(r)??o.querySelector("option:not([disabled])");a=d&&og(d)}t(a),o.__value=a,nn!==null&&i.add(nn)}),l9(()=>{var s=e();if(o===document.activeElement){var r=nn;if(i.has(r))return}if(Tm(o,s,n),n&&s===void 0){var a=o.querySelector(":checked");a!==null&&(s=og(a),t(s))}o.__value=s,n=!1}),w1(o)}function og(o){return"__value"in o?o.__value:o.value}const oP=Symbol("is custom element"),rP=Symbol("is html"),aP=N7?"progress":"PROGRESS";function S1(o,e){var t=h9(o);t.value===(t.value=e??void 0)||o.value===e&&(e!==0||o.nodeName!==aP)||(o.value=e??"")}function oa(o,e){var t=h9(o);t.checked!==(t.checked=e??void 0)&&(o.checked=e)}function ln(o,e,t,i){var n=h9(o);n[e]!==(n[e]=t)&&(e==="loading"&&(o[R7]=t),t==null?o.removeAttribute(e):typeof t!="string"&&lP(o).includes(e)?o[e]=t:o.setAttribute(e,t))}function h9(o){return o[Zx]??(o[Zx]={[oP]:o.nodeName.includes("-"),[rP]:o.namespaceURI===Mk})}var m8=new Map;function lP(o){var e=o.getAttribute("is")||o.nodeName,t=m8.get(e);if(t)return t;m8.set(e,t=[]);for(var i,n=o,s=Element.prototype;s!==n;){i=k7(n);for(var r in i)i[r].set&&r!=="innerHTML"&&r!=="textContent"&&r!=="innerText"&&t.push(r);n=Fk(n)}return t}function jt(o,e,t=e){var i=new WeakSet;o9(o,"input",async n=>{var s=n?o.defaultValue:o.value;if(s=aC(o)?lC(s):s,t(s),nn!==null&&i.add(nn),await ul(),s!==(s=e())){var r=o.selectionStart,a=o.selectionEnd,d=o.value.length;if(o.value=s??"",a!==null){var u=o.value.length;r===a&&a===d&&u>d?(o.selectionStart=u,o.selectionEnd=u):(o.selectionStart=r,o.selectionEnd=Math.min(a,u))}}}),Ol(e)==null&&o.value&&(t(aC(o)?lC(o.value):o.value),nn!==null&&i.add(nn)),ob(()=>{var n=e();if(o===document.activeElement){var s=nn;if(i.has(s))return}aC(o)&&n===lC(o.value)||o.type==="date"&&!n&&!o.value||n!==o.value&&(o.value=n??"")})}function Cs(o,e,t=e){o9(o,"change",i=>{var n=i?o.defaultChecked:o.checked;t(n)}),Ol(e)==null&&t(o.checked),ob(()=>{var i=e();o.checked=!!i})}function aC(o){var e=o.type;return e==="number"||e==="range"}function lC(o){return o===""?null:+o}var sc,r0,gp,$v,E6;const Uv=class Uv{constructor(e){xn(this,$v);xn(this,sc,new WeakMap);xn(this,r0);xn(this,gp);mn(this,gp,e)}observe(e,t){var i=we(this,sc).get(e)||new Set;return i.add(t),we(this,sc).set(e,i),Zn(this,$v,E6).call(this).observe(e,we(this,gp)),()=>{var n=we(this,sc).get(e);n.delete(t),n.size===0&&(we(this,sc).delete(e),we(this,r0).unobserve(e))}}};sc=new WeakMap,r0=new WeakMap,gp=new WeakMap,$v=new WeakSet,E6=function(){return we(this,r0)??mn(this,r0,new ResizeObserver(e=>{for(var t of e){Uv.entries.set(t.target,t);for(var i of we(this,sc).get(t.target)||[])i(t)}}))},wn(Uv,"entries",new WeakMap);let D1=Uv;var cP=new D1({box:"border-box"});function dP(o,e,t){var i=cP.observe(o,()=>t(o[e]));l9(()=>(Ol(()=>t(o[e])),i))}function cC(o,e){return o===e||(o==null?void 0:o[wd])===e}function us(o={},e,t,i){var n=uo.r,s=Rn;return l9(()=>{var r,a;return ob(()=>{r=a,a=[],Ol(()=>{cC(t(...a),o)||(e(o,...a),r&&cC(t(...r),o)&&e(null,...r))})}),()=>{let d=s;for(;d!==n&&d.parent!==null&&d.parent.f&h1;)d=d.parent;const u=()=>{a&&cC(t(...a),o)&&e(null,...a)},f=d.teardown;d.teardown=()=>{u(),f==null||f()}}}),o}function wu(o,e,t,i){var R;var n=!0,s=(t&tI)!==0,r=(t&iI)!==0,a=i,d=!0,u=void 0,f=()=>r&&n?(u??(u=Lg(i)),c(u)):(d&&(d=!1,a=r?Ol(i):i),a);let g;if(s){var p=wd in o||M7 in o;g=((R=Kh(o,e))==null?void 0:R.set)??(p&&e in o?T=>o[e]=T:void 0)}var C,b=!1;s?[C,b]=gI(()=>o[e]):C=o[e],C===void 0&&i!==void 0&&(C=f(),g&&($7(),g(C)));var y;if(y=()=>{var T=o[e];return T===void 0?f():(d=!0,T)},(t&eI)===0)return y;if(g){var w=o.$$legacy;return(function(T,V){return arguments.length>0?((!V||w||b)&&g(V?y():T),T):y()})}var A=!1,P=((t&J7)!==0?Lg:n9)(()=>(A=!1,y()));s&&c(P);var M=Rn;return(function(T,V){if(arguments.length>0){const W=V?c(P):s?Ei(T):T;return m(P,W),A=!0,a!==void 0&&(a=W),T}return Al&&A||(M.f&Ir)!==0?P.v:c(P)})}function Ks(o){uo===null&&Pk(),$n(()=>{const e=Ol(o);if(typeof e=="function")return e})}function Tp(o){uo===null&&Pk(),Ks(()=>()=>Ol(o))}const uP="5";var JA;typeof window<"u"&&((JA=window.__svelte??(window.__svelte={})).v??(JA.v=new Set)).add(uP);/*!-----------------------------------------------------------------------------
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,7 @@ var $F=Object.defineProperty;var SS=o=>{throw TypeError(o)};var UF=(o,e,t)=>e in
10
10
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
11
11
  * Released under the MIT license
12
12
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
13
- *-----------------------------------------------------------------------------*/var EP=Object.defineProperty,yP=Object.getOwnPropertyDescriptor,wP=Object.getOwnPropertyNames,SP=Object.prototype.hasOwnProperty,DP=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of wP(e))!SP.call(o,n)&&n!==t&&EP(o,n,{get:()=>e[n],enumerable:!(i=yP(e,n))||i.enumerable});return o},AP=(o,e,t)=>(DP(o,e,"default"),t),kP="5.4.5",I0={};AP(I0,t2);var S6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(S6||{}),D6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(D6||{}),A6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(A6||{}),k6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(k6||{}),B6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(B6||{}),F6=class{constructor(o,e,t,i,n){this._onDidChange=new I0.Emitter,this._onDidExtraLibsChange=new I0.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},BP=kP,L6={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},I6=new F6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},L6),P6=new F6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},L6),FP=()=>rb().then(o=>o.getTypeScriptWorker()),LP=()=>rb().then(o=>o.getJavaScriptWorker());I0.languages.typescript={ModuleKind:S6,JsxEmit:D6,NewLineKind:A6,ScriptTarget:k6,ModuleResolutionKind:B6,typescriptVersion:BP,typescriptDefaults:I6,javascriptDefaults:P6,getTypeScriptWorker:FP,getJavaScriptWorker:LP};function rb(){return e2(()=>import("./tsMode-CUmDOhNS.js"),__vite__mapDeps([3,1,2]))}I0.languages.onLanguage("typescript",()=>rb().then(o=>o.setupTypeScript(I6)));I0.languages.onLanguage("javascript",()=>rb().then(o=>o.setupJavaScript(P6)));class IP extends wo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:pi("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:$i.map,toggled:Ue.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ue.has("isInDiffEditor"),menu:{when:Ue.has("isInDiffEditor"),id:ti.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Qn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class T6 extends wo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:pi("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Qn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class M6 extends wo{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:pi("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Qn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const Rp=pi("diffEditor","Diff Editor");class PP extends aa{constructor(){super({id:"diffEditor.switchSide",title:pi("switchSide","Switch Side"),icon:$i.arrowSwap,precondition:Ue.has("isInDiffEditor"),f1:!0,category:Rp})}runEditorCommand(e,t,i){const n=ef(e);if(n instanceof pp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class TP extends aa{constructor(){super({id:"diffEditor.exitCompareMove",title:pi("exitCompareMove","Exit Compare Move"),icon:$i.close,precondition:U.comparingMovedCode,f1:!1,category:Rp,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=ef(e);n instanceof pp&&n.exitCompareMove()}}class MP extends aa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:pi("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:$i.fold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:Rp})}runEditorCommand(e,t,...i){const n=ef(e);n instanceof pp&&n.collapseAllUnchangedRegions()}}class RP extends aa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:pi("showAllUnchangedRegions","Show All Unchanged Regions"),icon:$i.unfold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:Rp})}runEditorCommand(e,t,...i){const n=ef(e);n instanceof pp&&n.showAllUnchangedRegions()}}class A1 extends wo{constructor(){super({id:"diffEditor.revert",title:pi("revert","Revert"),f1:!1,category:Rp})}run(e,t){const i=NP(e,t.originalUri,t.modifiedUri);i instanceof pp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const R6=pi("accessibleDiffViewer","Accessible Diff Viewer"),qv=class qv extends wo{constructor(){super({id:qv.id,title:pi("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:R6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=ef(e);t==null||t.accessibleDiffViewerNext()}};qv.id="editor.action.accessibleDiffViewer.next";let Pg=qv;const Gv=class Gv extends wo{constructor(){super({id:Gv.id,title:pi("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:R6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=ef(e);t==null||t.accessibleDiffViewerPrev()}};Gv.id="editor.action.accessibleDiffViewer.prev";let Mm=Gv;function NP(o,e,t){return o.get(vs).listDiffEditors().find(s=>{var d,u;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((d=r.getModel())==null?void 0:d.uri.toString())===t.toString()&&a&&((u=a.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function ef(o){const t=o.get(vs).listDiffEditors(),i=i2();if(i)for(const n of t){const s=n.getContainerDomNode();if(OP(s,i))return n}return null}function OP(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}Nn(IP);Nn(T6);Nn(M6);Pr.appendMenuItem(ti.EditorTitle,{command:{id:new M6().desc.id,title:S("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ue.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ue.has("isInDiffEditor")},order:11,group:"1_diff",when:Ue.and(U.diffEditorRenderSideBySideInlineBreakpointReached,Ue.has("isInDiffEditor"))});Pr.appendMenuItem(ti.EditorTitle,{command:{id:new T6().desc.id,title:S("showMoves","Show Moved Code Blocks"),icon:$i.move,toggled:qF.create("config.diffEditor.experimental.showMoves",!0),precondition:Ue.has("isInDiffEditor")},order:10,group:"1_diff",when:Ue.has("isInDiffEditor")});Nn(A1);for(const o of[{icon:$i.arrowRight,key:U.diffEditorInlineMode.toNegated()},{icon:$i.discard,key:U.diffEditorInlineMode}])Pr.appendMenuItem(ti.DiffEditorHunkToolbar,{command:{id:new A1().desc.id,title:S("revertHunk","Revert Block"),icon:o.icon},when:Ue.and(U.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),Pr.appendMenuItem(ti.DiffEditorSelectionToolbar,{command:{id:new A1().desc.id,title:S("revertSelection","Revert Selection"),icon:o.icon},when:Ue.and(U.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Nn(PP);Nn(TP);Nn(MP);Nn(RP);Pr.appendMenuItem(ti.EditorTitle,{command:{id:Pg.id,title:S("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ue.has("isInDiffEditor")},order:10,group:"2_diff",when:Ue.and(U.accessibleDiffViewerVisible.negate(),Ue.has("isInDiffEditor"))});Kn.registerCommandAlias("editor.action.diffReview.next",Pg.id);Nn(Pg);Kn.registerCommandAlias("editor.action.diffReview.prev",Mm.id);Nn(Mm);var HP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},WP=function(o,e){return function(t,i){e(t,i,o)}},k1;const ab=new vn("selectionAnchorSet",!1);var Id;let Rc=(Id=class{static get(e){return e.getContribution(k1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=ab.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(Hi.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new oo().appendText(S("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Tr(S("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Hi.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},k1=Id,Id.ID="editor.contrib.selectionAnchorController",Id);Rc=k1=HP([WP(1,Dn)],Rc);class zP extends xt{constructor(){super({id:"editor.action.setSelectionAnchor",label:S("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:ys(2089,2080),weight:100}})}async run(e,t){var i;(i=Rc.get(t))==null||i.setSelectionAnchor()}}class VP extends xt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:S("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:ab})}async run(e,t){var i;(i=Rc.get(t))==null||i.goToSelectionAnchor()}}class jP extends xt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:S("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:ab,kbOpts:{kbExpr:U.editorTextFocus,primary:ys(2089,2089),weight:100}})}async run(e,t){var i;(i=Rc.get(t))==null||i.selectFromAnchorToCursor()}}class $P extends xt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:S("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:ab,kbOpts:{kbExpr:U.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Rc.get(t))==null||i.cancelSelectionAnchor()}}rn(Rc.ID,Rc,4);Be(zP);Be(VP);Be(jP);Be($P);const UP=di("editorOverviewRuler.bracketMatchForeground","#A0A0A0",S("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class qP extends xt{constructor(){super({id:"editor.action.jumpToBracket",label:S("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Su.get(t))==null||i.jumpToBracket()}}class GP extends xt{constructor(){super({id:"editor.action.selectToBracket",label:S("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:pi("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=Su.get(t))==null||s.selectToBracket(n)}}class KP extends xt{constructor(){super({id:"editor.action.removeBrackets",label:S("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Su.get(t))==null||i.removeBrackets(this.id)}}class ZP{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Yl=class Yl extends Nt{static get(e){return e.getContribution(Yl.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Is(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new Hi(r.lineNumber,r.column,r.lineNumber,r.column):new Hi(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(r=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,d=null;if(r){r.sort(ee.compareRangesUsingStarts);const[u,f]=r;if(a=e?u.getStartPosition():u.getEndPosition(),d=e?f.getEndPosition():f.getStartPosition(),f.containsPosition(s)){const g=a;a=d,d=g}}a&&d&&i.push(new Hi(a.lineNumber,a.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let g=0,p=e.length;g<p;g++){const C=e[g];C.isEmpty()&&(s[r++]=C.getStartPosition())}s.length>1&&s.sort(_i.compare);const a=[];let d=0,u=0;const f=n.length;for(let g=0,p=s.length;g<p;g++){const C=s[g];for(;u<f&&n[u].position.isBefore(C);)u++;if(u<f&&n[u].position.equals(C))a[d++]=n[u];else{let b=t.bracketPairs.matchBracket(C,20),y=Yl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!b&&this._matchBrackets==="always"&&(b=t.bracketPairs.findEnclosingBrackets(C,20),y=Yl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new ZP(C,b,y)}}this._lastBracketsData=a,this._lastVersionId=i}};Yl.ID="editor.contrib.bracketMatchingController",Yl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=hn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ks(UP),position:Oa.Center}}),Yl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=hn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Su=Yl;rn(Su.ID,Su,1);Be(GP);Be(qP);Be(KP);Pr.appendMenuItem(ti.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:S({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class XP{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new ee(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,s,i,s),a)}else{const r=new ee(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Hi(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Hi(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class N6 extends xt{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new XP(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class YP extends N6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:S("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:U.writable})}}class QP extends N6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:S("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:U.writable})}}Be(YP);Be(QP);class JP extends xt{constructor(){super({id:"editor.action.transposeLetters",label:S("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,d=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&u===2))continue;const f=d===u?r.getPosition():Zb.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=Zb.leftPosition(i,f),p=Zb.leftPosition(i,g),C=i.getValueInRange(ee.fromPositions(p,g)),b=i.getValueInRange(ee.fromPositions(g,f)),y=ee.fromPositions(p,f);n.push(new xp(y,b+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Be(JP);const lb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function f9(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function eT(o,e,t){const i={id:lb(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class O6{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 xl.some(this,([i,n])=>n.asFile())&&t.push("files"),W6(Rm(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 Rm(e)}}function Rm(o){return o.toLowerCase()}function H6(o,e){return W6(Rm(o),e.map(Rm))}function W6(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const cb=Object.freeze({create:o=>n2(o.map(e=>e.toString())).join(`\r
13
+ *-----------------------------------------------------------------------------*/var EP=Object.defineProperty,yP=Object.getOwnPropertyDescriptor,wP=Object.getOwnPropertyNames,SP=Object.prototype.hasOwnProperty,DP=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of wP(e))!SP.call(o,n)&&n!==t&&EP(o,n,{get:()=>e[n],enumerable:!(i=yP(e,n))||i.enumerable});return o},AP=(o,e,t)=>(DP(o,e,"default"),t),kP="5.4.5",I0={};AP(I0,t2);var S6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(S6||{}),D6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(D6||{}),A6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(A6||{}),k6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(k6||{}),B6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(B6||{}),F6=class{constructor(o,e,t,i,n){this._onDidChange=new I0.Emitter,this._onDidExtraLibsChange=new I0.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},BP=kP,L6={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},I6=new F6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},L6),P6=new F6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},L6),FP=()=>rb().then(o=>o.getTypeScriptWorker()),LP=()=>rb().then(o=>o.getJavaScriptWorker());I0.languages.typescript={ModuleKind:S6,JsxEmit:D6,NewLineKind:A6,ScriptTarget:k6,ModuleResolutionKind:B6,typescriptVersion:BP,typescriptDefaults:I6,javascriptDefaults:P6,getTypeScriptWorker:FP,getJavaScriptWorker:LP};function rb(){return e2(()=>import("./tsMode-BVHy5rED.js"),__vite__mapDeps([3,1,2]))}I0.languages.onLanguage("typescript",()=>rb().then(o=>o.setupTypeScript(I6)));I0.languages.onLanguage("javascript",()=>rb().then(o=>o.setupJavaScript(P6)));class IP extends wo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:pi("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:$i.map,toggled:Ue.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ue.has("isInDiffEditor"),menu:{when:Ue.has("isInDiffEditor"),id:ti.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Qn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class T6 extends wo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:pi("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Qn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class M6 extends wo{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:pi("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Qn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const Rp=pi("diffEditor","Diff Editor");class PP extends aa{constructor(){super({id:"diffEditor.switchSide",title:pi("switchSide","Switch Side"),icon:$i.arrowSwap,precondition:Ue.has("isInDiffEditor"),f1:!0,category:Rp})}runEditorCommand(e,t,i){const n=ef(e);if(n instanceof pp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class TP extends aa{constructor(){super({id:"diffEditor.exitCompareMove",title:pi("exitCompareMove","Exit Compare Move"),icon:$i.close,precondition:U.comparingMovedCode,f1:!1,category:Rp,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=ef(e);n instanceof pp&&n.exitCompareMove()}}class MP extends aa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:pi("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:$i.fold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:Rp})}runEditorCommand(e,t,...i){const n=ef(e);n instanceof pp&&n.collapseAllUnchangedRegions()}}class RP extends aa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:pi("showAllUnchangedRegions","Show All Unchanged Regions"),icon:$i.unfold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:Rp})}runEditorCommand(e,t,...i){const n=ef(e);n instanceof pp&&n.showAllUnchangedRegions()}}class A1 extends wo{constructor(){super({id:"diffEditor.revert",title:pi("revert","Revert"),f1:!1,category:Rp})}run(e,t){const i=NP(e,t.originalUri,t.modifiedUri);i instanceof pp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const R6=pi("accessibleDiffViewer","Accessible Diff Viewer"),qv=class qv extends wo{constructor(){super({id:qv.id,title:pi("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:R6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=ef(e);t==null||t.accessibleDiffViewerNext()}};qv.id="editor.action.accessibleDiffViewer.next";let Pg=qv;const Gv=class Gv extends wo{constructor(){super({id:Gv.id,title:pi("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:R6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=ef(e);t==null||t.accessibleDiffViewerPrev()}};Gv.id="editor.action.accessibleDiffViewer.prev";let Mm=Gv;function NP(o,e,t){return o.get(vs).listDiffEditors().find(s=>{var d,u;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((d=r.getModel())==null?void 0:d.uri.toString())===t.toString()&&a&&((u=a.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function ef(o){const t=o.get(vs).listDiffEditors(),i=i2();if(i)for(const n of t){const s=n.getContainerDomNode();if(OP(s,i))return n}return null}function OP(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}Nn(IP);Nn(T6);Nn(M6);Pr.appendMenuItem(ti.EditorTitle,{command:{id:new M6().desc.id,title:S("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ue.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ue.has("isInDiffEditor")},order:11,group:"1_diff",when:Ue.and(U.diffEditorRenderSideBySideInlineBreakpointReached,Ue.has("isInDiffEditor"))});Pr.appendMenuItem(ti.EditorTitle,{command:{id:new T6().desc.id,title:S("showMoves","Show Moved Code Blocks"),icon:$i.move,toggled:qF.create("config.diffEditor.experimental.showMoves",!0),precondition:Ue.has("isInDiffEditor")},order:10,group:"1_diff",when:Ue.has("isInDiffEditor")});Nn(A1);for(const o of[{icon:$i.arrowRight,key:U.diffEditorInlineMode.toNegated()},{icon:$i.discard,key:U.diffEditorInlineMode}])Pr.appendMenuItem(ti.DiffEditorHunkToolbar,{command:{id:new A1().desc.id,title:S("revertHunk","Revert Block"),icon:o.icon},when:Ue.and(U.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),Pr.appendMenuItem(ti.DiffEditorSelectionToolbar,{command:{id:new A1().desc.id,title:S("revertSelection","Revert Selection"),icon:o.icon},when:Ue.and(U.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Nn(PP);Nn(TP);Nn(MP);Nn(RP);Pr.appendMenuItem(ti.EditorTitle,{command:{id:Pg.id,title:S("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ue.has("isInDiffEditor")},order:10,group:"2_diff",when:Ue.and(U.accessibleDiffViewerVisible.negate(),Ue.has("isInDiffEditor"))});Kn.registerCommandAlias("editor.action.diffReview.next",Pg.id);Nn(Pg);Kn.registerCommandAlias("editor.action.diffReview.prev",Mm.id);Nn(Mm);var HP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},WP=function(o,e){return function(t,i){e(t,i,o)}},k1;const ab=new vn("selectionAnchorSet",!1);var Id;let Rc=(Id=class{static get(e){return e.getContribution(k1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=ab.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(Hi.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new oo().appendText(S("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Tr(S("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Hi.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},k1=Id,Id.ID="editor.contrib.selectionAnchorController",Id);Rc=k1=HP([WP(1,Dn)],Rc);class zP extends xt{constructor(){super({id:"editor.action.setSelectionAnchor",label:S("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:ys(2089,2080),weight:100}})}async run(e,t){var i;(i=Rc.get(t))==null||i.setSelectionAnchor()}}class VP extends xt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:S("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:ab})}async run(e,t){var i;(i=Rc.get(t))==null||i.goToSelectionAnchor()}}class jP extends xt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:S("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:ab,kbOpts:{kbExpr:U.editorTextFocus,primary:ys(2089,2089),weight:100}})}async run(e,t){var i;(i=Rc.get(t))==null||i.selectFromAnchorToCursor()}}class $P extends xt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:S("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:ab,kbOpts:{kbExpr:U.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Rc.get(t))==null||i.cancelSelectionAnchor()}}rn(Rc.ID,Rc,4);Be(zP);Be(VP);Be(jP);Be($P);const UP=di("editorOverviewRuler.bracketMatchForeground","#A0A0A0",S("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class qP extends xt{constructor(){super({id:"editor.action.jumpToBracket",label:S("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Su.get(t))==null||i.jumpToBracket()}}class GP extends xt{constructor(){super({id:"editor.action.selectToBracket",label:S("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:pi("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=Su.get(t))==null||s.selectToBracket(n)}}class KP extends xt{constructor(){super({id:"editor.action.removeBrackets",label:S("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Su.get(t))==null||i.removeBrackets(this.id)}}class ZP{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Yl=class Yl extends Nt{static get(e){return e.getContribution(Yl.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Is(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new Hi(r.lineNumber,r.column,r.lineNumber,r.column):new Hi(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(r=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,d=null;if(r){r.sort(ee.compareRangesUsingStarts);const[u,f]=r;if(a=e?u.getStartPosition():u.getEndPosition(),d=e?f.getEndPosition():f.getStartPosition(),f.containsPosition(s)){const g=a;a=d,d=g}}a&&d&&i.push(new Hi(a.lineNumber,a.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let g=0,p=e.length;g<p;g++){const C=e[g];C.isEmpty()&&(s[r++]=C.getStartPosition())}s.length>1&&s.sort(_i.compare);const a=[];let d=0,u=0;const f=n.length;for(let g=0,p=s.length;g<p;g++){const C=s[g];for(;u<f&&n[u].position.isBefore(C);)u++;if(u<f&&n[u].position.equals(C))a[d++]=n[u];else{let b=t.bracketPairs.matchBracket(C,20),y=Yl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!b&&this._matchBrackets==="always"&&(b=t.bracketPairs.findEnclosingBrackets(C,20),y=Yl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new ZP(C,b,y)}}this._lastBracketsData=a,this._lastVersionId=i}};Yl.ID="editor.contrib.bracketMatchingController",Yl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=hn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ks(UP),position:Oa.Center}}),Yl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=hn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Su=Yl;rn(Su.ID,Su,1);Be(GP);Be(qP);Be(KP);Pr.appendMenuItem(ti.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:S({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class XP{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new ee(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,s,i,s),a)}else{const r=new ee(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Hi(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Hi(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class N6 extends xt{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new XP(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class YP extends N6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:S("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:U.writable})}}class QP extends N6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:S("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:U.writable})}}Be(YP);Be(QP);class JP extends xt{constructor(){super({id:"editor.action.transposeLetters",label:S("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,d=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&u===2))continue;const f=d===u?r.getPosition():Zb.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=Zb.leftPosition(i,f),p=Zb.leftPosition(i,g),C=i.getValueInRange(ee.fromPositions(p,g)),b=i.getValueInRange(ee.fromPositions(g,f)),y=ee.fromPositions(p,f);n.push(new xp(y,b+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Be(JP);const lb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function f9(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function eT(o,e,t){const i={id:lb(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class O6{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 xl.some(this,([i,n])=>n.asFile())&&t.push("files"),W6(Rm(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 Rm(e)}}function Rm(o){return o.toLowerCase()}function H6(o,e){return W6(Rm(o),e.map(Rm))}function W6(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const cb=Object.freeze({create:o=>n2(o.map(e=>e.toString())).join(`\r
14
14
  `),split:o=>o.split(`\r
15
15
  `),parse:o=>cb.split(o).filter(e=>!e.startsWith("#"))}),ya=class ya{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+ya.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ya((this.value?[this.value,...e]:e).join(ya.sep))}};ya.sep=".",ya.None=new ya("@@none@@"),ya.Empty=new ya("");let Yn=ya;const v8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class tT{}const iT={DragAndDropContribution:"workbench.contributions.dragAndDrop"};la.add(iT.DragAndDropContribution,new tT);const xg=class xg{constructor(){}static getInstance(){return xg.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};xg.INSTANCE=new xg;let B1=xg;function z6(o){const e=new O6;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,f9(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,nT(n))}}return e}function nT(o){const e=o.path?On.parse(o.path):void 0;return eT(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const sT=Object.freeze([v8.EDITORS,v8.FILES,XC.RESOURCES,XC.INTERNAL_URI_LIST]);function V6(o,e=!1){const t=z6(o),i=t.get(XC.INTERNAL_URI_LIST);if(i)t.replace(Gs.uriList,i);else if(e||!t.has(Gs.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(On.file(a).toString()):n.push(On.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Gs.uriList,f9(cb.create(n)))}for(const n of sT)t.delete(n);return t}var g9=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tg=function(o,e){return function(t,i){e(t,i,o)}};class p9{async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const mg=class mg extends p9{constructor(){super(...arguments),this.kind=mg.kind,this.dropMimeTypes=[Gs.text],this.pasteMimeTypes=[Gs.text]}async getEdit(e,t){const i=e.get(Gs.text);if(!i||e.has(Gs.uriList))return;const n=await i.asString();return{handledMimeType:Gs.text,title:S("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};mg.id="text",mg.kind=new Yn("text.plain");let Du=mg;class j6 extends p9{constructor(){super(...arguments),this.kind=new Yn("uri.absolute"),this.dropMimeTypes=[Gs.uriList],this.pasteMimeTypes=[Gs.uriList]}async getEdit(e,t){const i=await $6(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:d})=>a.scheme===vo.file?a.fsPath:(n++,d)).join(" ");let r;return n>0?r=i.length>1?S("defaultDropProvider.uriList.uris","Insert Uris"):S("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?S("defaultDropProvider.uriList.paths","Insert Paths"):S("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Gs.uriList,insertText:s,title:r,kind:this.kind}}}let Nm=class extends p9{constructor(e){super(),this._workspaceContextService=e,this.kind=new Yn("uri.relative"),this.dropMimeTypes=[Gs.uriList],this.pasteMimeTypes=[Gs.uriList]}async getEdit(e,t){const i=await $6(e);if(!i.length||t.isCancellationRequested)return;const n=El(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?GF(r.uri,s):void 0}));if(n.length)return{handledMimeType:Gs.uriList,insertText:n.join(" "),title:i.length>1?S("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):S("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};Nm=g9([Tg(0,m0)],Nm);class oT{constructor(){this.kind=new Yn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Gs.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var d;if(n.triggerKind!==YC.PasteAs&&!((d=n.only)!=null&&d.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function $6(o){const e=o.get(Gs.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of cb.parse(t))try{i.push({uri:On.parse(n),originalText:n})}catch{}return i}let F1=class extends Nt{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Du)),this._register(e.documentDropEditProvider.register("*",new j6)),this._register(e.documentDropEditProvider.register("*",new Nm(t)))}};F1=g9([Tg(0,bi),Tg(1,m0)],F1);let L1=class extends Nt{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Du)),this._register(e.documentPasteEditProvider.register("*",new j6)),this._register(e.documentPasteEditProvider.register("*",new Nm(t))),this._register(e.documentPasteEditProvider.register("*",new oT))}};L1=g9([Tg(0,bi),Tg(1,m0)],L1);const mr=class mr{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=mr._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(mr.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(mr.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(mr.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(mr.isVariableCharacter(i)||mr.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof mr._table[i]>"u"&&!mr.isDigitCharacter(i)&&!mr.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};mr._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let I1=mr;class tf{constructor(){this._children=[]}appendChild(e){return e instanceof Lo&&this._children[this._children.length-1]instanceof Lo?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(a,d){for(const u of a)u.parent=d,r(u.children,u)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Np)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let Lo=class U6 extends tf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new U6(this.value)}};class q6 extends tf{}class rr extends q6{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 nf?this._children[0]:void 0}clone(){const e=new rr(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class nf extends tf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Lo&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new nf;return this.options.forEach(e.appendChild,e),e}}class x9 extends tf{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Zr&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Zr){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new x9;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Zr extends tf{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Zr(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Mg extends q6{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 Lo(t)],!0):!1}clone(){const e=new Mg(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function _8(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class Np extends tf{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof rr&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return _8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof rr&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Mg&&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 Np;return this._children=this.children.map(t=>t.clone()),e}walk(e){_8(this.children,e)}}class Au{constructor(){this._scanner=new I1,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new Np;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(d=>(d instanceof rr&&(d.isFinalTabstop?n.set(0,void 0):!n.has(d.index)&&d.children.length>0?n.set(d.index,d.children):s.push(d)),!0));const r=(d,u)=>{const f=n.get(d.index);if(!f)return;const g=new rr(d.index);g.transform=d.transform;for(const p of f){const C=p.clone();g.appendChild(C),C instanceof rr&&n.has(C.index)&&!u.has(C.index)&&(u.add(C.index),r(C,u),u.delete(C.index))}t.replace(d,[g])},a=new Set;for(const d of s)r(d,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new rr(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Lo(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 rr(Number(t)):new Mg(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new rr(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Lo("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new nf;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Lo(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new Mg(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Lo("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new x9;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new Lo(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Zr(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Zr(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Zr(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Zr(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Zr(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new Zr(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Zr(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Lo(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function G6(o,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(s=>new KF(o,{range:s,text:typeof t.insertText=="string"?Au.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function K6(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const d of o)if(d!==r&&e(a,d)){let u=t.get(r);u||(u=[],t.set(r,u)),u.push(d)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let d=[];const u=t.get(a);return u&&(n.push(a),d=s(u),n.pop()),i.add(a),[...d,a,...s(r.slice(1))]}return s(Array.from(o))}var rT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aT=function(o,e){return function(t,i){e(t,i,o)}};const lT=hn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:s2,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Kv=class Kv extends Nt{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ci(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ci("span.icon");this.domNode.append(t),t.classList.add(...Fn.asClassNameArray($i.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(Sn(this.domNode,is.CLICK,n=>{this.delegate.cancel()}))}getId(){return Kv.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)}};Kv.baseId="editor.widget.inlineProgressWidget";let P1=Kv,Om=class extends Nt{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Xo),this._currentWidget=this._register(new Xo),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=bg(()=>{const a=ee.fromPositions(e);this._currentDecorations.set([{range:a,options:lT}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(P1,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Om=rT([aT(2,en)],Om);var cT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},b8=function(o,e){return function(t,i){e(t,i,o)}},tm,xc;let Po=(xc=class{static get(e){return e.getContribution(tm.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Xo,this._messageListeners=new Mt,this._mouseOverMessage=!1,this._editor=e,this._visible=tm.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){Tr($x(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=$x(e)?ZF(e,{actionHandler:{callback:n=>{this.closeMessage(),XF(this._openerService,n,$x(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new C8(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Ls.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&YF(i2(),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(Sn(this._messageWidget.value.getDomNode(),is.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Sn(this._messageWidget.value.getDomNode(),is.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new ee(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(C8.fadeOut(this._messageWidget.value))}},tm=xc,xc.ID="editor.contrib.messageController",xc.MESSAGE_VISIBLE=new vn("messageVisible",!1,S("messageVisible","Whether the editor is currently showing an inline message")),xc);Po=tm=cT([b8(1,Dn),b8(2,ca)],Po);const dT=So.bindToContribution(Po.get);Si(new dT({id:"leaveEditorMessage",precondition:Po.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let C8=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};rn(Po.ID,Po,4);function dC(o,e){return e&&(o.stack||o.stacktrace)?S("stackTrace.format","{0}: {1}",y8(o),E8(o.stack)||E8(o.stacktrace)):y8(o)}function E8(o){return Array.isArray(o)?o.join(`
16
16
  `):o}function y8(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?S("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Hm(o=null,e=!1){if(!o)return S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=El(o),i=Hm(t[0],e);return t.length>1?S("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(o2(o))return o;if(o.detail){const t=o.detail;if(t.error)return dC(t.error,e);if(t.exception)return dC(t.exception,e)}return o.stack?dC(o,e):o.message?o.message:S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var Z6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Xh=function(o,e){return function(t,i){e(t,i,o)}},T1,Pd;let M1=(Pd=class extends Nt{constructor(e,t,i,n,s,r,a,d,u,f){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=d,this._keybindingService=f,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Xn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Xn((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(g=>{s.containsPosition(g.position)||this.dispose()})),this._register(Ls.runAndSubscribe(f.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ci(".post-edit-widget"),this.button=this._register(new QF(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Sn(this.domNode,is.CLICK,()=>this.showSelector()))}getId(){return T1.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Co(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>JF({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},T1=Pd,Pd.baseId="editor.widget.postEditWidget",Pd);M1=T1=Z6([Xh(7,G0),Xh(8,Dn),Xh(9,ws)],M1);let Wm=class extends Nt{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Xo),this._register(Ls.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const d=async w=>{const A=this._editor.getModel();A&&(await A.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:w,allEdits:t.allEdits},i,n,s))},u=(w,A)=>{zc(w)||(this._notificationService.error(A),i&&this.show(e[0],t,d))};let f;try{f=await n(a,s)}catch(w){return u(w,S("resolveError",`Error resolving edit '{0}':
@@ -78,7 +78,7 @@ var $F=Object.defineProperty;var SS=o=>{throw TypeError(o)};var UF=(o,e,t)=>e in
78
78
  `)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(S("no result","No result.")),n);return r}}async function BV(o,e,t,i){const n=new X9(e,t,o),s=await n.resolveRenameLocation(on.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,on.None)}var hu;let Hc=(hu=class{static get(e){return e.getContribution(Py.ID)}constructor(e,t,i,n,s,r,a,d,u){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=d,this._telemetryService=u,this._disposableStore=new Mt,this._cts=new Us,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Iy,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var b,y;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Us,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new X9(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new v0(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const w=i.resolveRenameLocation(n.token);this._progressService.showWhile(w,250),s=await w,e("resolved rename location")}catch(w){w instanceof N_?e("resolve rename location cancelled",JSON.stringify(w,null," ")):(e("resolve rename location failed",w instanceof Error?w:JSON.stringify(w,null," ")),(typeof w=="string"||$x(w))&&((b=Po.get(this.editor))==null||b.showMessage(w||S("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(y=Po.get(this.editor))==null||y.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new v0(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),d=this._languageFeaturesService.newSymbolNamesProvider.all(a),u=await Promise.all(d.map(async w=>[w,await w.supportsAutomaticNewSymbolNamesTriggerKind??!1])),f=(w,A)=>{let P=u.slice();return w===a1.Automatic&&(P=P.filter(([M,R])=>R)),P.map(([M])=>M.provideNewSymbolNames(a,s.range,w,A))};e("creating rename input field and awaiting its result");const g=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),p=await this._renameWidget.getInput(s.range,s.text,g,d.length>0?f:void 0,r);if(e("received response from rename input field"),d.length>0&&this._reportTelemetry(d.length,a.getLanguageId(),p),typeof p=="boolean"){e(`returning early - rename input field response - ${p}`),p&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const C=mp(i.provideRenameEdits(p.newName,r.token),r.token).then(async w=>{if(!w){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(w.rejectReason){e(`returning early - rejected with reason: ${w.rejectReason}`),this._notificationService.info(w.rejectReason);return}this.editor.setSelection(ee.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(w,{editor:this.editor,showPreview:p.wantsPreview,label:S("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,p.newName),code:"undoredo.rename",quotableLabel:S("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,p.newName),respectAutoSaveConfig:!0}).then(A=>{e("edits applied"),A.ariaSummary&&Tr(S("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,p.newName,A.ariaSummary))}).catch(A=>{e(`error when applying edits ${JSON.stringify(A,null," ")}`),this._notificationService.error(S("rename.failedApply","Rename failed to apply edits")),this._logService.error(A)})},w=>{e("error when providing rename edits",JSON.stringify(w,null," ")),this._notificationService.error(S("rename.failed","Rename failed to compute edits")),this._logService.error(w)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(C,250),C}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},Py=hu,hu.ID="editor.contrib.renameController",hu);Hc=Py=kV([ql(1,en),ql(2,go),ql(3,T_),ql(4,_p),ql(5,zu),ql(6,OL),ql(7,bi),ql(8,da)],Hc);class FV extends xt{constructor(){super({id:"editor.action.rename",label:S("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Ue.and(U.writable,U.hasRenameProvider),kbOpts:{kbExpr:U.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(vs),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return On.isUri(n)&&_i.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},zn):super.runCommand(e,t)}run(e,t){const i=e.get(zu),n=Hc.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}rn(Hc.ID,Hc,4);Be(FV);const Y9=So.bindToContribution(Hc.get);Si(new Y9({id:"acceptRenameInput",precondition:rf,handler:o=>o.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:Ue.and(U.focus,Ue.not("isComposing")),primary:3}}));Si(new Y9({id:"acceptRenameInputWithPreview",precondition:Ue.and(rf,Ue.has("config.editor.rename.enablePreview")),handler:o=>o.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:Ue.and(U.focus,Ue.not("isComposing")),primary:2051}}));Si(new Y9({id:"cancelRenameInput",precondition:rf,handler:o=>o.cancelRenameInput(),kbOpts:{weight:199,kbExpr:U.focus,primary:9,secondary:[1033]}}));Nn(class extends wo{constructor(){super({id:"focusNextRenameSuggestion",title:{...pi("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:rf,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(vs).getFocusedCodeEditor();if(!t)return;const i=Hc.get(t);i&&i.focusNextRenameSuggestion()}});Nn(class extends wo{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...pi("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:rf,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(vs).getFocusedCodeEditor();if(!t)return;const i=Hc.get(t);i&&i.focusPreviousRenameSuggestion()}});Do("_executeDocumentRenameProvider",function(o,e,t,...i){const[n]=i;An(typeof n=="string");const{renameProvider:s}=o.get(bi);return BV(s,e,t,n)});Do("_executePrepareRename",async function(o,e,t){const{renameProvider:i}=o.get(bi),s=await new X9(e,t,i).resolveRenameLocation(on.None);if(s!=null&&s.rejectReason)throw new Error(s.rejectReason);return s});la.as(bp.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:S("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var LV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zD=function(o,e){return function(t,i){e(t,i,o)}},f0;let Sv=(f0=class extends Nt{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var r;const s=(r=this.editor.getModel())==null?void 0:r.getLanguageId();s&&n.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Is(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(s=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(s)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const r=t.validateRange(s.range),a=t.tokenization.getLineTokens(r.startLineNumber),d=a.findTokenIndexAtOffset(r.startColumn-1),u=a.getStandardTokenType(d);return a.getLanguageId(d)===t.getLanguageId()&&u===1}));const i=Object.values(this.currentOccurrences).map(s=>s.decorationId),n=e.map(s=>IV(s));this.editor.changeDecorations(s=>{const r=s.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,d=r.length;a<d;a++){const u={sectionHeader:e[a],decorationId:r[a]};this.currentOccurrences[u.decorationId]=u}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},f0.ID="editor.sectionHeaderDetector",f0);Sv=LV([zD(1,zs),zD(2,Rl)],Sv);function IV(o){return{range:o.range,options:hn.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:o.hasSeparatorLine?2:1,sectionHeaderText:o.text}})}}rn(Sv.ID,Sv,1);function PV(o){for(let e=0,t=o.length;e<t;e+=4){const i=o[e+0],n=o[e+1],s=o[e+2],r=o[e+3];o[e+0]=r,o[e+1]=s,o[e+2]=n,o[e+3]=i}}function TV(o){const e=new Uint8Array(o.buffer,o.byteOffset,o.length*4);return HL()||PV(e),WL.wrap(e)}function MB(o){const e=new Uint32Array(MV(o));let t=0;if(e[t++]=o.id,o.type==="full")e[t++]=1,e[t++]=o.data.length,e.set(o.data,t),t+=o.data.length;else{e[t++]=2,e[t++]=o.deltas.length;for(const i of o.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return TV(e)}function MV(o){let e=0;if(e+=2,o.type==="full")e+=1+o.data.length;else{e+=1,e+=3*o.deltas.length;for(const t of o.deltas)t.data&&(e+=t.data.length)}return e}function yb(o){return o&&!!o.data}function RB(o){return o&&Array.isArray(o.edits)}class RV{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function NB(o,e){return o.has(e)}function NV(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function OB(o,e,t,i,n){const s=NV(o,e),r=await Promise.all(s.map(async a=>{let d,u=null;try{d=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(f){u=f,d=null}return(!d||!yb(d)&&!RB(d))&&(d=null),new RV(a,d,u)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function OV(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:null}class HV{constructor(e,t){this.provider=e,this.tokens=t}}function WV(o,e){return o.has(e)}function HB(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function Q9(o,e,t,i){const n=HB(o,e),s=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(d){ms(d),a=null}return(!a||!yb(a))&&(a=null),new HV(r,a)}));for(const r of s)if(r.tokens)return r;return s.length>0?s[0]:null}Kn.registerCommand("_provideDocumentSemanticTokensLegend",async(o,...e)=>{const[t]=e;An(t instanceof On);const i=o.get(po).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(bi),s=OV(n,i);return s?s[0].getLegend():o.get(Ws).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Kn.registerCommand("_provideDocumentSemanticTokens",async(o,...e)=>{const[t]=e;An(t instanceof On);const i=o.get(po).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(bi);if(!NB(n,i))return o.get(Ws).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await OB(n,i,null,null,on.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!yb(a))return;const d=MB({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),d});Kn.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(o,...e)=>{const[t,i]=e;An(t instanceof On);const n=o.get(po).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(bi),r=HB(s,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!ee.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await Q9(s,n,ee.lift(i),on.None);if(a)return a.provider.getLegend()});Kn.registerCommand("_provideDocumentRangeSemanticTokens",async(o,...e)=>{const[t,i]=e;An(t instanceof On),An(ee.isIRange(i));const n=o.get(po).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(bi),r=await Q9(s,n,ee.lift(i),on.None);if(!(!r||!r.tokens))return MB({id:0,type:"full",data:r.tokens.data})});const J9="editor.semanticHighlighting";function um(o,e,t){var n;const i=(n=t.getValue(J9,{overrideIdentifier:o.getLanguageId(),resource:o.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var WB=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fa=function(o,e){return function(t,i){e(t,i,o)}},Zl;let Ty=class extends Nt{constructor(e,t,i,n,s,r){super(),this._watchers=Object.create(null);const a=f=>{this._watchers[f.uri.toString()]=new My(f,e,i,s,r)},d=(f,g)=>{g.dispose(),delete this._watchers[f.uri.toString()]},u=()=>{for(const f of t.getModels()){const g=this._watchers[f.uri.toString()];um(f,i,n)?g||a(f):g&&d(f,g)}};t.getModels().forEach(f=>{um(f,i,n)&&a(f)}),this._register(t.onModelAdded(f=>{um(f,i,n)&&a(f)})),this._register(t.onModelRemoved(f=>{const g=this._watchers[f.uri.toString()];g&&d(f,g)})),this._register(n.onDidChangeConfiguration(f=>{f.affectsConfiguration(J9)&&u()})),this._register(i.onDidColorThemeChange(u))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Ty=WB([Fa(0,Yw),Fa(1,po),Fa(2,Nr),Fa(3,Qn),Fa(4,cr),Fa(5,bi)],Ty);var Fc;let My=(Fc=class extends Nt{constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Zl.REQUEST_MIN_DELAY,max:Zl.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Is(()=>this._fetchDocumentSemanticTokensNow(),Zl.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{ao(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),ao(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!NB(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Us,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=OB(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],r=this._model.onDidChangeContent(d=>{s.push(d)}),a=new Ro(!1);n.then(d=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!d)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:u,tokens:f}=d,g=this._semanticTokensStylingService.getStyling(u);this._setDocumentSemanticTokens(u,f||null,g,s)}},d=>{d&&(zc(d)||typeof d.message=="string"&&d.message.indexOf("busy")!==-1)||zn(d),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let r=0;r<s;r++)i[n+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,n){const s=this._currentDocumentResponse,r=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(RB(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const p of t.edits)a+=(p.data?p.data.length:0)-p.deleteCount;const d=s.data,u=new Uint32Array(d.length+a);let f=d.length,g=u.length;for(let p=t.edits.length-1;p>=0;p--){const C=t.edits[p];if(C.start>d.length){i.warnInvalidEditStart(s.resultId,t.resultId,p,C.start,d.length),this._model.tokenization.setSemanticTokens(null,!0);return}const b=f-(C.start+C.deleteCount);b>0&&(Zl._copy(d,f-b,u,g-b,b),g-=b),C.data&&(Zl._copy(C.data,0,u,g-C.data.length,C.data.length),g-=C.data.length),f=C.start}f>0&&Zl._copy(d,0,u,0,f),t={resultId:t.resultId,data:u}}}if(yb(t)){this._currentDocumentResponse=new zV(e,t.resultId,t.data);const a=mk(t,i,this._model.getLanguageId());if(n.length>0)for(const d of n)for(const u of a)for(const f of d.changes)u.applyEdit(f.range,f.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},Zl=Fc,Fc.REQUEST_MIN_DELAY=300,Fc.REQUEST_MAX_DELAY=2e3,Fc);My=Zl=WB([Fa(1,Yw),Fa(2,Nr),Fa(3,cr),Fa(4,bi)],My);class zV{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}X0(Ty);var VV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},If=function(o,e){return function(t,i){e(t,i,o)}},g0;let Dv=(g0=class extends Nt{constructor(e,t,i,n,s,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Is(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(d=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(d=>{d.affectsConfiguration(J9)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!um(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!WV(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=$s(r=>Promise.resolve(Q9(this._provider,e,t,r))),s=new Ro(!1);return n.then(r=>{if(this._debounceInformation.update(e,s.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:d}=r,u=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,mk(d,u,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},g0.ID="editor.contrib.viewportSemanticTokens",g0);Dv=VV([If(1,Yw),If(2,Nr),If(3,Qn),If(4,cr),If(5,bi)],Dv);rn(Dv.ID,Dv,1);class jV{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,n),this._addWordRanges(s,e,n),this._addWhitespaceLine(s,e,n),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:r}=n,a=i.column-r;let d=a,u=a,f=0;for(;d>=0;d--){const g=s.charCodeAt(d);if(d!==a&&(g===95||g===45))break;if(QS(g)&&JS(f))break;f=g}for(d+=1;u<s.length;u++){const g=s.charCodeAt(u);if(JS(g)&&QS(f))break;if(g===95||g===45)break;f=g}d<u&&e.push({range:new ee(i.lineNumber,r+d,i.lineNumber,r+u)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new ee(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new ee(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var $V=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UV=function(o,e){return function(t,i){e(t,i,o)}},Ry;class eS{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new eS(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var fu;let Jg=(fu=class{static get(e){return e.getContribution(Ry.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await VB(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(114),on.None).then(s=>{var r;if(!(!Go(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!Va(this._editor.getSelections(),t,(a,d)=>a.equalsSelection(d)))){for(let a=0;a<s.length;a++)s[a]=s[a].filter(d=>d.containsPosition(t[a].getStartPosition())&&d.containsPosition(t[a].getEndPosition())),s[a].unshift(t[a]);this._state=s.map(a=>new eS(0,a)),(r=this._selectionListener)==null||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const n=this._state.map(s=>Hi.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},Ry=fu,fu.ID="editor.contrib.smartSelectController",fu);Jg=Ry=$V([UV(1,bi)],Jg);class zB extends xt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=Jg.get(t);i&&await i.run(this._forward)}}class qV extends zB{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:S("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ti.MenubarSelectionMenu,group:"1_basic",title:S({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Kn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class GV extends zB{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:S("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ti.MenubarSelectionMenu,group:"1_basic",title:S({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}rn(Jg.ID,Jg,4);Be(qV);Be(GV);async function VB(o,e,t,i,n){const s=o.all(e).concat(new jV(i.selectSubwords));s.length===1&&s.unshift(new dv);const r=[],a=[];for(const d of s)r.push(Promise.resolve(d.provideSelectionRanges(e,t,n)).then(u=>{if(Go(u)&&u.length===t.length)for(let f=0;f<t.length;f++){a[f]||(a[f]=[]);for(const g of u[f])ee.isIRange(g.range)&&ee.containsPosition(g.range,t[f])&&a[f].push(ee.lift(g.range))}},ms));return await Promise.all(r),a.map(d=>{if(d.length===0)return[];d.sort((p,C)=>_i.isBefore(p.getStartPosition(),C.getStartPosition())?1:_i.isBefore(C.getStartPosition(),p.getStartPosition())||_i.isBefore(p.getEndPosition(),C.getEndPosition())?-1:_i.isBefore(C.getEndPosition(),p.getEndPosition())?1:0);const u=[];let f;for(const p of d)(!f||ee.containsRange(p,f)&&!ee.equalsRange(p,f))&&(u.push(p),f=p);if(!i.selectLeadingAndTrailingWhitespace)return u;const g=[u[0]];for(let p=1;p<u.length;p++){const C=u[p-1],b=u[p];if(b.startLineNumber!==C.startLineNumber||b.endLineNumber!==C.endLineNumber){const y=new ee(C.startLineNumber,e.getLineFirstNonWhitespaceColumn(C.startLineNumber),C.endLineNumber,e.getLineLastNonWhitespaceColumn(C.endLineNumber));y.containsRange(C)&&!y.equalsRange(C)&&b.containsRange(y)&&!b.equalsRange(y)&&g.push(y);const w=new ee(C.startLineNumber,1,C.endLineNumber,e.getLineMaxColumn(C.endLineNumber));w.containsRange(C)&&!w.equalsRange(y)&&b.containsRange(w)&&!b.equalsRange(w)&&g.push(w)}g.push(b)}return g})}Kn.registerCommand("_executeSelectionRangeProvider",async function(o,...e){const[t,i]=e;An(On.isUri(t));const n=o.get(bi).selectionRangeProvider,s=await o.get(ha).createModelReference(t);try{return VB(n,s.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},on.None)}finally{s.dispose()}});const KV=Object.freeze({View:pi("view","View"),Help:pi("help","Help"),Test:pi("test","Test"),File:pi("file","File"),Preferences:pi("preferences","Preferences"),Developer:pi({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class hg{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Va(this.startLineNumbers,e.startLineNumbers)&&Va(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new hg([],[],0)}}const VD=H2("stickyScrollViewLayer",{createHTML:o=>o}),MC="data-sticky-line-index",jD="data-sticky-is-line",ZV="data-sticky-is-line-number",$D="data-sticky-is-folding-icon";class XV extends Nt{constructor(e){super(),this._editor=e,this._foldingIconStore=new Mt,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Rr),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),s=n?void 0:e,r=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(s,t,r),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,n=e.startLineNumbers.findIndex(s=>!i.startLineNumbers.includes(s));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const n=this._editor.getLayoutInfo(),s=this._lineNumbers.slice(i);for(const[a,d]of s.entries()){const u=this._renderChildNode(a+i,d,t,n);u&&(this._linesDomNode.appendChild(u.lineDomNode),this._lineNumbersDomNode.appendChild(u.lineNumberDomNode),this._renderedStickyLines.push(u))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const r=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${r}px`,this._linesDomNodeScrollable.style.height=`${r}px`,this._rootDomNode.style.height=`${r}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(Sn(this._lineNumbersDomNode,is.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(Sn(this._lineNumbersDomNode,is.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const s=this._editor._getViewModel();if(!s)return;const r=s.coordinatesConverter.convertModelPositionToViewPosition(new _i(t,1)).lineNumber,a=s.getViewLineRenderingData(r),d=this._editor.getOption(68);let u;try{u=Fg.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{u=[]}const f=new V2(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,u,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),g=new W2(2e3),p=z2(f,g);let C;VD?C=VD.createHTML(g.build()):C=g.build();const b=document.createElement("span");b.setAttribute(MC,String(e)),b.setAttribute(jD,""),b.setAttribute("role","listitem"),b.tabIndex=0,b.className="sticky-line-content",b.classList.add(`stickyLine${t}`),b.style.lineHeight=`${this._lineHeight}px`,b.innerHTML=C;const y=document.createElement("span");y.setAttribute(MC,String(e)),y.setAttribute(ZV,""),y.className="sticky-line-number",y.style.lineHeight=`${this._lineHeight}px`;const w=n.contentLeft;y.style.width=`${w}px`;const A=document.createElement("span");d.renderType===1||d.renderType===3&&t%10===0?A.innerText=t.toString():d.renderType===2&&(A.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),A.className="sticky-line-number-inner",A.style.lineHeight=`${this._lineHeight}px`,A.style.width=`${n.lineNumbersWidth}px`,A.style.paddingLeft=`${n.lineNumbersLeft}px`,y.appendChild(A);const P=this._renderFoldingIconForLine(i,t);P&&y.appendChild(P.domNode),this._editor.applyFontInfo(b),this._editor.applyFontInfo(A),y.style.lineHeight=`${this._lineHeight}px`,b.style.lineHeight=`${this._lineHeight}px`,y.style.height=`${this._lineHeight}px`,b.style.height=`${this._lineHeight}px`;const M=new YV(e,t,b,y,P,p.characterMapping,b.scrollWidth);return this._updateTopAndZIndexOfStickyLine(M)}_updateTopAndZIndexOfStickyLine(e){var f;const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,s=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=s?r:a,n.style.zIndex=s?r:a;const d=`${t*this._lineHeight+this._lastLineRelativePosition+((f=e.foldingIcon)!=null&&f.isCollapsed?1:0)}px`,u=`${t*this._lineHeight}px`;return i.style.top=s?d:u,n.style.top=s?d:u,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const n=e.regions,s=n.findRange(t),r=n.getStartLineNumber(s);if(!(t===r))return;const d=n.isCollapsed(s),u=new QV(d,r,n.getEndLineNumber(s),this._lineHeight);return u.setVisible(this._isOnGlyphMargin?!0:d||i==="always"),u.domNode.setAttribute($D,""),u}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=zL(t.characterMapping,e,0);return new _i(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,MC);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,jD)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,$D)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class YV{constructor(e,t,i,n,s,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=r,this.scrollWidth=a}}class QV{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=Fn.asClassName(e?Jm:Qm)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class fg{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Av{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class jB{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var wb=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ep=function(o,e){return function(t,i){e(t,i,o)}},gg;(function(o){o.OUTLINE_MODEL="outlineModel",o.FOLDING_PROVIDER_MODEL="foldingProviderModel",o.INDENTATION_MODEL="indentationModel"})(gg||(gg={}));var dc;(function(o){o[o.VALID=0]="VALID",o[o.INVALID=1]="INVALID",o[o.CANCELED=2]="CANCELED"})(dc||(dc={}));let Ny=class extends Nt{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Pc(300)),this._updateOperation=this._register(new Mt),this._editor.getOption(116).defaultModel){case gg.OUTLINE_MODEL:this._modelProviders.push(new Oy(this._editor,n));case gg.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new Wy(this._editor,t,n));case gg.INDENTATION_MODEL:this._modelProviders.push(new Hy(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const s=await i;if(this._modelPromise!==n)return null;switch(s){case dc.CANCELED:return this._updateOperation.clear(),null;case dc.VALID:return t.stickyModel}}return null}).catch(t=>(zn(t),null))}};Ny=wb([ep(2,en),ep(3,bi)],Ny);class $B extends Nt{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,dc.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=$s(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?dc.CANCELED:(this._stickyModel=this.createStickyModel(e,i),dc.VALID):this._invalid()).then(void 0,i=>(zn(i),dc.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let Oy=class extends $B{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return ol.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var r;const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,(r=this._stickyModel)==null?void 0:r.outlineProviderId),s=this._editor.getModel();return new jB(s.uri,s.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(xl.first(e.children.values())instanceof uB){const a=xl.find(e.children.values(),d=>d.id===t);if(a)i=a.children;else{let d="",u=-1,f;for(const[g,p]of e.children.entries()){const C=this._findSumOfRangesOfGroup(p);C>u&&(f=p,u=C,d=p.id)}t=d,i=f.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort((a,d)=>{const u=new fg(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),f=new fg(d.symbol.range.startLineNumber,d.symbol.range.endLineNumber);return this._comparator(u,f)});for(const a of s)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Av(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const r of s.children.values())i.push(this._stickyModelFromOutlineElement(r,s.symbol.selectionRange.startLineNumber));i.sort((s,r)=>this._comparator(s.range,r.range));const n=new fg(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Av(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof AE?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Oy=wb([ep(1,bi)],Oy);class UB extends $B{constructor(e){super(e),this._foldingLimitReporter=new lB(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new jB(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new Av(void 0,[],void 0);for(let s=0;s<t;s++){const r=e.getParentIndex(s);let a;r!==-1?a=i[r]:a=n;const d=new Av(new fg(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],a);a.children.push(d),i.push(d)}return n}}let Hy=class extends UB{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new H9(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};Hy=wb([ep(1,zs)],Hy);let Wy=class extends UB{constructor(e,t,i){super(e),this._languageFeaturesService=i;const n=Oc.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());n.length>0&&(this.provider=this._register(new W9(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};Wy=wb([ep(2,bi)],Wy);var JV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UD=function(o,e){return function(t,i){e(t,i,o)}};class ej{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let zy=class extends Nt{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new sn),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Mt),this._updateSoon=this._register(new Is(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Xn(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new Ny(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new Us,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s){if(t.children.length===0)return;let r=s;const a=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];g.range&&a.push(g.range.startLineNumber)}const d=this.updateIndex(Sm(a,e.startLineNumber,(f,g)=>f-g)),u=this.updateIndex(Sm(a,e.startLineNumber+n,(f,g)=>f-g));for(let f=d;f<=u;f++){const g=t.children[f];if(!g)return;if(g.range){const p=g.range.startLineNumber,C=g.range.endLineNumber;e.startLineNumber<=C+1&&p-1<=e.endLineNumber&&p!==r&&(r=p,i.push(new ej(p,C-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,g,i,n+1,p))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,g,i,n,s)}}getCandidateStickyLinesIntersecting(e){var n,s;if(!((n=this._model)!=null&&n.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(s=this._editor._getViewModel())==null?void 0:s.getHiddenAreas();if(i)for(const r of i)t=t.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return t}};zy=JV([UD(1,bi),UD(2,zs)],zy);var tj=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vh=function(o,e){return function(t,i){e(t,i,o)}},Vy,gu;let Ll=(gu=class extends Nt{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new Mt,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new XV(this._editor),this._stickyLineCandidateProvider=new zy(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=hg.Empty,this._onDidResize(),this._readConfiguration();const d=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(f=>{this._readConfigurationChange(f)})),this._register(Sn(d,is.CONTEXT_MENU,async f=>{this._onContextMenu(Ed(d),f)})),this._stickyScrollFocusedContextKey=U.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=U.stickyScrollVisible.bindTo(this._contextKeyService);const u=this._register(_0(d));this._register(u.onDidBlur(f=>{this._positionRevealed===!1&&d.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(u.onDidFocus(f=>{this.focus()})),this._registerMouseListeners(),this._register(Sn(d,is.MOUSE_DOWN,f=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(Vy.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Mt,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(ee.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Mt),t=this._register(new fb(this._editor,{extractLineNumberFromMouseEvent:s=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return r?r.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const r=s.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new ee(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(wl(n,is.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const u=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(u===null)return;const f=new _i(this._endLineNumbers[u],1);this._revealLineInCenterIfOutsideViewport(f);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(u);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let d=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!d){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(u===null)return;d=new _i(u,1)}this._revealPosition(d)})),this._register(wl(n,is.MOUSE_MOVE,s=>{if(s.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(Sn(n,is.MOUSE_LEAVE,s=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,r])=>{const a=i(s);if(!a||!s.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:d,textElement:u}=a;if(!d.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=d,e.clear();else if(u.style.textDecoration==="underline")return;const f=new Us;e.add(Xn(()=>f.dispose(!0)));let g;zp(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new _i(d.startLineNumber,d.startColumn+1),!1,f.token).then((p=>{if(!f.token.isCancellationRequested)if(p.length!==0){this._candidateDefinitionsLength=p.length;const C=u;g!==C?(e.clear(),g=C,g.style.textDecoration="underline",e.add(Xn(()=>{g.style.textDecoration="none"}))):g||(g=C,g.style.textDecoration="underline",e.add(Xn(()=>{g.style.textDecoration="none"})))}else e.clear()}))})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(U5,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new VL(e,t);this._contextMenuService.showContextMenu({menuId:ti.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;R9(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=Oc.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=hg.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let n=0;const s=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const d=new fg(a[0].startLineNumber,a[a.length-1].endLineNumber),u=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(d);for(const f of u){const g=f.startLineNumber,p=f.endLineNumber,C=f.nestingDepth;if(p-g>0){const b=(C-1)*e,y=C*e,w=this._editor.getBottomForLineNumber(g)-i,A=this._editor.getTopForLineNumber(p)-i,P=this._editor.getBottomForLineNumber(p)-i;if(b>A&&b<=P){s.push(g),r.push(p+1),n=P-y;break}else y>w&&y<=P&&(s.push(g),r.push(p+1));if(s.length===t)break}}}return this._endLineNumbers=r,new hg(s,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},Vy=gu,gu.ID="store.contrib.stickyScrollController",gu);Ll=Vy=tj([vh(1,G0),vh(2,bi),vh(3,en),vh(4,zs),vh(5,cr),vh(6,Dn)],Ll);class ij extends wo{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...pi("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:S({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:pi("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:KV.View,toggled:{condition:Ue.equals("config.editor.stickyScroll.enabled",!0),title:S("stickyScroll","Sticky Scroll"),mnemonicTitle:S({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:ti.CommandPalette},{id:ti.MenubarAppearanceMenu,group:"4_editor",order:3},{id:ti.StickyScrollContext}]})}async run(e){const t=e.get(Qn),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const Sb=100;class nj extends aa{constructor(){super({id:"editor.action.focusStickyScroll",title:{...pi("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:S({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:Ue.and(Ue.has("config.editor.stickyScroll.enabled"),U.stickyScrollVisible),menu:[{id:ti.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Ll.get(t))==null||i.focus()}}class sj extends aa{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:pi("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Sb,primary:18}})}runEditorCommand(e,t){var i;(i=Ll.get(t))==null||i.focusNext()}}class oj extends aa{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:pi("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Sb,primary:16}})}runEditorCommand(e,t){var i;(i=Ll.get(t))==null||i.focusPrevious()}}class rj extends aa{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:pi("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Sb,primary:3}})}runEditorCommand(e,t){var i;(i=Ll.get(t))==null||i.goToFocused()}}class aj extends aa{constructor(){super({id:"editor.action.selectEditor",title:pi("selectEditor.title","Select Editor"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Sb,primary:9}})}runEditorCommand(e,t){var i;(i=Ll.get(t))==null||i.selectEditor()}}rn(Ll.ID,Ll,1);Nn(ij);Nn(nj);Nn(oj);Nn(sj);Nn(rj);Nn(aj);var qB=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Kf=function(o,e){return function(t,i){e(t,i,o)}};class lj{constructor(e,t,i,n,s,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.completion=r}}let jy=class extends jL{constructor(e,t,i,n,s,r){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=xl.slice(t,i),s=xl.slice(t,0,i);let r=5;for(const a of xl.concat(n,s)){if(a.score===Ag.Default)continue;const d=new ee(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),u=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new lj(d,u,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),r-->=0&&a.resolve(on.None)}return e}};jy=qB([Kf(5,bb)],jy);let $y=class extends Nt{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var C;if(i.selectedSuggestionInfo)return;let s;for(const b of this._editorService.listCodeEditors())if(b.getModel()===e){s=b;break}if(!s)return;const r=s.getOption(90);if(Hh.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),d=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Hh.valueFor(r,d)!=="inline")return;let u=e.getWordAtPosition(t),f;if(u!=null&&u.word||(f=this._getTriggerCharacterInfo(e,t)),!(u!=null&&u.word)&&!f||(u||(u=e.getWordUntilPosition(t)),u.endColumn!==t.column))return;let g;const p=e.getValueInRange(new ee(t.lineNumber,1,t.lineNumber,t.column));if(!f&&((C=this._lastResult)!=null&&C.canBeReused(e,t.lineNumber,u))){const b=new FD(p,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=b,this._lastResult.acquire(),g=this._lastResult}else{const b=await z9(this._languageFeatureService.completionProvider,e,t,new Ug(void 0,hv.createSuggestFilter(s).itemKind,f==null?void 0:f.providers),f&&{triggerKind:1,triggerCharacter:f.ch},n);let y;b.needsClipboard&&(y=await this._clipboardService.readText());const w=new ec(b.items,t.column,new FD(p,0),uv.None,s.getOption(119),s.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},y);g=new jy(e,t.lineNumber,u,w,b,this._suggestMemoryService)}return this._lastResult=g,g}handleItemDidShow(e,t){t.completion.resolve(on.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var s;const i=e.getValueInRange(ee.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))(s=r.triggerCharacters)!=null&&s.includes(i)&&n.add(r);if(n.size!==0)return{providers:n,ch:i}}};$y=qB([Kf(0,bi),Kf(1,K0),Kf(2,bb),Kf(3,vs)],$y);X0($y);class cj extends xt{constructor(){super({id:"editor.action.forceRetokenize",label:S("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Ro;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Be(cj);const y_=class y_ extends wo{constructor(){super({id:y_.ID,title:pi({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:pi("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!e8.getTabFocusMode();e8.setTabFocusMode(t),t?Tr(S("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element")):Tr(S("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};y_.ID="editor.action.toggleTabFocusMode";let Uy=y_;Nn(Uy);var dj=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qD=function(o,e){return function(t,i){e(t,i,o)}};let qy=class extends Nt{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,s){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=si(e,ci("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??q_("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new eC(this.el,"click")),a=this._register(new eC(this.el,"keypress")),d=Ls.chain(a.event,g=>g.map(p=>new Xw(p)).filter(p=>p.keyCode===3)),u=this._register(new eC(this.el,$L.Tap)).event;this._register(r2.addTarget(this.el));const f=Ls.any(r.event,d,u);this._register(f(g=>{this.enabled&&(Cm.stop(g,!0),i!=null&&i.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};qy=dj([qD(3,Sp),qD(4,ca)],qy);var GB=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KB=function(o,e){return function(t,i){e(t,i,o)}};const uj=26;let Gy=class extends Nt{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Ky))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,uj)}};Gy=GB([KB(1,en)],Gy);let Ky=class extends Nt{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Y0,{}),this.element=ci("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=ci("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ha(this.element)}show(e){Ha(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=si(this.element,ci("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(ci(`div${Fn.asCSSSelector(e.icon)}`));const n=si(this.element,ci("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=si(this.element,ci("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(qy,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=si(this.element,ci("div.action-container"));this.actionBar=this._register(new Cg(s)),this.actionBar.push(this._register(new y0("banner.close","Close Banner",Fn.asClassName(k2),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Ky=GB([KB(0,en)],Ky);var tS=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qh=function(o,e){return function(t,i){e(t,i,o)}};const hj=gs("extensions-warning-message",$i.warning,S("warningIcon","Icon shown with a warning message in the extensions editor."));var p0;let tp=(p0=class extends Nt{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const r=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=r)a={message:S("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new np};else if(s.ambiguousCharacterCount>=r)a={message:S("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new Ru};else if(s.invisibleCharacterCount>=r)a={message:S("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new ip};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:hj,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(Gy,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=fj(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?UL:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new Zy(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new gj(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},p0.ID="editor.contrib.unicodeHighlighter",p0);tp=tS([Qh(1,Rl),Qh(2,qL),Qh(3,en)],tp);function fj(o,e){return{nonBasicASCII:e.nonBasicASCII===tC?!o:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===tC?!o:e.includeComments,includeStrings:e.includeStrings===tC?!o:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let Zy=class extends Nt{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Is(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:kv.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!vk(t,e))return null;const i=t.getValueInRange(e.range);return{reason:XB(i,this._options),inComment:bk(t,e),inString:_k(t,e)}}};Zy=tS([Qh(3,Rl)],Zy);class gj extends Nt{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Is(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const s=Ck.computeUnicodeHighlights(this._model,this._options,n);for(const r of s.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:kv.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return vk(t,e)?{reason:XB(i,this._options),inComment:bk(t,e),inString:_k(t,e)}:null}}const ZB=S("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let Xy=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(tp.ID);if(!n)return[];const s=[],r=new Set;let a=300;for(const d of t){const u=n.getDecorationInfo(d);if(!u)continue;const g=i.getValueInRange(d.range).codePointAt(0),p=RC(g);let C;switch(u.reason.kind){case 0:{$2(u.reason.confusableWith)?C=S("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",p,RC(u.reason.confusableWith.codePointAt(0))):C=S("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",p,RC(u.reason.confusableWith.codePointAt(0)));break}case 1:C=S("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",p);break;case 2:C=S("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",p);break}if(r.has(C))continue;r.add(C);const b={codePoint:g,reason:u.reason,inComment:u.inComment,inString:u.inString},y=S("unicodeHighlight.adjustSettings","Adjust settings"),w=`command:${Bv.ID}?${encodeURIComponent(JSON.stringify(b))}`,A=new oo("",!0).appendMarkdown(C).appendText(" ").appendLink(w,y,ZB);s.push(new Br(this,d.range,[A],!1,a++))}return s}renderHoverParts(e,t){return jM(e,t,this._editor,this._languageService,this._openerService)}};Xy=tS([Qh(1,ua),Qh(2,ca)],Xy);function Yy(o){return`U+${o.toString(16).padStart(4,"0")}`}function RC(o){let e=`\`${Yy(o)}\``;return Ek.isInvisibleCharacter(o)||(e+=` "${`${pj(o)}`}"`),e}function pj(o){return o===96?"`` ` ``":"`"+String.fromCodePoint(o)+"`"}function XB(o,e){return Ck.computeUnicodeHighlightReason(o,e)}const w_=class w_{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=hn.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};w_.instance=new w_;let kv=w_;class xj extends xt{constructor(){super({id:Ru.ID,label:S("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=S("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e==null?void 0:e.get(Qn);n&&this.runAction(n)}async runAction(e){await e.updateValue(Dl.includeComments,!1,2)}}class mj extends xt{constructor(){super({id:Ru.ID,label:S("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=S("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e==null?void 0:e.get(Qn);n&&this.runAction(n)}async runAction(e){await e.updateValue(Dl.includeStrings,!1,2)}}const S_=class S_ extends xt{constructor(){super({id:S_.ID,label:S("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=S("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Qn);n&&this.runAction(n)}async runAction(e){await e.updateValue(Dl.ambiguousCharacters,!1,2)}};S_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let Ru=S_;const D_=class D_ extends xt{constructor(){super({id:D_.ID,label:S("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=S("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Qn);n&&this.runAction(n)}async runAction(e){await e.updateValue(Dl.invisibleCharacters,!1,2)}};D_.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let ip=D_;const A_=class A_ extends xt{constructor(){super({id:A_.ID,label:S("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=S("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Qn);n&&this.runAction(n)}async runAction(e){await e.updateValue(Dl.nonBasicASCII,!1,2)}};A_.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let np=A_;const k_=class k_ extends xt{constructor(){super({id:k_.ID,label:S("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:s,inString:r,inComment:a}=i,d=String.fromCodePoint(n),u=e.get(Pl),f=e.get(Qn);function g(b){return Ek.isInvisibleCharacter(b)?S("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",Yy(b)):S("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${Yy(b)} "${d}"`)}const p=[];if(s.kind===0)for(const b of s.notAmbiguousInLocales)p.push({label:S("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',b),run:async()=>{_j(f,[b])}});if(p.push({label:g(n),run:()=>vj(f,[n])}),a){const b=new xj;p.push({label:b.label,run:async()=>b.runAction(f)})}else if(r){const b=new mj;p.push({label:b.label,run:async()=>b.runAction(f)})}if(s.kind===0){const b=new Ru;p.push({label:b.label,run:async()=>b.runAction(f)})}else if(s.kind===1){const b=new ip;p.push({label:b.label,run:async()=>b.runAction(f)})}else if(s.kind===2){const b=new np;p.push({label:b.label,run:async()=>b.runAction(f)})}else bj(s);const C=await u.pick(p,{title:ZB});C&&await C.run()}};k_.ID="editor.action.unicodeHighlight.showExcludeOptions";let Bv=k_;async function vj(o,e){const t=o.getValue(Dl.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await o.updateValue(Dl.allowedCharacters,i,2)}async function _j(o,e){var n;const t=(n=o.inspect(Dl.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const s of e)i[s]=!0;await o.updateValue(Dl.allowedLocales,i,2)}function bj(o){throw new Error(`Unexpected value: ${o}`)}Be(Ru);Be(ip);Be(np);Be(Bv);rn(tp.ID,tp,1);Uu.register(Xy);var Cj=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GD=function(o,e){return function(t,i){e(t,i,o)}};const YB="ignoreUnusualLineTerminators";function Ej(o,e,t){o.setModelProperty(e.uri,YB,t)}function yj(o,e){return o.getModelProperty(e.uri,YB)}var x0;let Fv=(x0=class extends Nt{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||yj(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:S("unusualLineTerminators.title","Unusual Line Terminators"),message:S("unusualLineTerminators.message","Detected unusual line terminators"),detail:S("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",$a(e.uri)),primaryButton:S({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:S("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){Ej(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},x0.ID="editor.contrib.unusualLineTerminatorsDetector",x0);Fv=Cj([GD(1,Qw),GD(2,vs)],Fv);rn(Fv.ID,Fv,1);var wj=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Sj=function(o,e){return function(t,i){e(t,i,o)}};class KD{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,t8,!1).map(a=>({range:a.range,kind:Am.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const s=new Ic,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(s);for(const a of[e,...i]){if(a.isDisposed())continue;const u=a.findMatches(r.word,!0,!1,!0,t8,!1).map(f=>({range:f.range,kind:Am.Text}));u&&s.set(a.uri,u)}return s}}let Qy=class extends Nt{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new KD)),this._register(e.multiDocumentHighlightProvider.register("*",new KD))}};Qy=wj([Sj(0,bi)],Qy);var QB=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hm=function(o,e){return function(t,i){e(t,i,o)}},ds,Jy;const iS=new vn("hasWordHighlights",!1);function JB(o,e,t,i){const n=o.ordered(e);return qw(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,ms)),s=>s!=null).then(s=>{if(s){const r=new Ic;return r.set(e.uri,s),r}return new Ic})}function Dj(o,e,t,i,n,s){const r=o.ordered(e);return qw(r.map(a=>()=>{const d=s.filter(u=>KL(u)).filter(u=>ZL(a.selector,u.uri,u.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,d,n)).then(void 0,ms)}),a=>a!=null)}class eF{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=$s(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new ee(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,s=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let d=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let u=0,f=i.length;!d&&u<f;u++){const g=i.getRange(u);g&&g.startLineNumber===n&&g.startColumn<=s&&g.endColumn>=r&&(d=!0)}return d}cancel(){this.result.cancel()}}class Aj extends eF{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return JB(this._providers,e,t.getPosition(),n).then(s=>s||new Ic)}}class kj extends eF{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return Dj(this._providers,e,t.getPosition(),i,n,this._otherModels).then(s=>s||new Ic)}}function Bj(o,e,t,i,n){return new Aj(e,t,n,o)}function Fj(o,e,t,i,n,s){return new kj(e,t,n,o,s)}Do("_executeDocumentHighlights",async(o,e,t)=>{const i=o.get(bi),n=await JB(i.documentHighlightProvider,e,t,on.None);return n==null?void 0:n.get(e.uri)});var Lc;let ew=(Lc=class{constructor(e,t,i,n,s){this.toUnhook=new Mt,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Ic,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Pc(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this._hasWordHighlights=iS.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(r)})})),this.toUnhook.add(e.onDidFocusEditorText(r=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(r=>{GL(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():ds.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{var d,u;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(d=ds.query)==null?void 0:d.modelInfo)==null?void 0:u.model);break;case"multiFile":ds.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,ds.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(ee.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);Tr(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);Tr(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=ds.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),ds.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||_m(n.getModel().uri,e==null?void 0:e.uri))continue;const s=ds.storedDecorationIDs.get(n.getModel().uri);if(!s)continue;n.removeDecorations(s),i.push(n.getModel().uri);const r=Wc.get(n);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)ds.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==vo.vscodeNotebookCell&&((i=(t=ds.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==vo.vscodeNotebookCell?(ds.query=null,this._run()):(n=ds.query)!=null&&n.modelInfo&&(ds.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==vo.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===vo.vscodeNotebookCell){const s=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const d=a.getModel();d&&d!==e&&d.uri.scheme===vo.vscodeNotebookCell&&s.push(d)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!yk(s))continue;const r=s.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const s of n){const r=s.getModel();r&&r!==e&&i.push(r)}return i}_run(e){var n,s;let t;if(this.editor.hasTextFocus()){const r=this.editor.getSelection();if(!r||r.startLineNumber!==r.endLineNumber){ds.query=null,this._stopAll();return}const a=r.startColumn,d=r.endColumn,u=this._getWord();if(!u||u.startColumn>a||u.endColumn<d){ds.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,r,this.decorations),ds.query={modelInfo:{model:this.model,selection:r},word:u}}else if(!ds.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(_m(this.editor.getModel().uri,(n=ds.query.modelInfo)==null?void 0:n.model.uri)){if(!e){const d=this.decorations.getRanges();for(const u of d)if(u.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const r=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!ds.query||!ds.query.modelInfo||ds.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(ds.query.modelInfo.model,ds.query.modelInfo.selection,ds.query.word,a),(s=this.workerRequest)==null||s.result.then(d=>{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations())},zn)}}computeWithModel(e,t,i,n){return n.length?Fj(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),n):Bj(this.providers,e,t,i,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const s of e){const r=Wc.get(s);if(!r)continue;const a=[],d=(t=s.getModel())==null?void 0:t.uri;if(d&&this.workerRequestValue.has(d)){const u=ds.storedDecorationIDs.get(d),f=this.workerRequestValue.get(d);if(f)for(const p of f)p.range&&a.push({range:p.range,options:vz(p.kind)});let g=[];s.changeDecorations(p=>{g=p.deltaDecorations(u??[],a)}),ds.storedDecorationIDs=ds.storedDecorationIDs.set(d,g),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(n=r.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},ds=Lc,Lc.storedDecorationIDs=new Ic,Lc.query=null,Lc);ew=ds=QB([hm(4,vs)],ew);var pu;let Wc=(pu=class extends Nt{static get(e){return e.getContribution(Jy.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new ew(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},Jy=pu,pu.ID="editor.contrib.wordHighlighter",pu);Wc=Jy=QB([hm(1,Dn),hm(2,bi),hm(3,vs)],Wc);class tF extends xt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Wc.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Lj extends tF{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:S("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:iS,kbOpts:{kbExpr:U.editorTextFocus,primary:65,weight:100}})}}class Ij extends tF{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:S("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:iS,kbOpts:{kbExpr:U.editorTextFocus,primary:1089,weight:100}})}}class Pj extends xt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:S("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Wc.get(t);n&&n.restoreViewState(!0)}}rn(Wc.ID,Wc,0);Be(Lj);Be(Ij);Be(Pj);X0(Qy);class Db extends So{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Vu(t.getOption(132),t.getOption(131)),s=t.getModel(),r=t.getSelections(),a=r.length>1,d=r.map(u=>{const f=new _i(u.positionLineNumber,u.positionColumn),g=this._move(n,s,f,this._wordNavigationType,a);return this._moveTo(u,g,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,d.map(u=>XL.fromModelSelection(u))),d.length===1){const u=new _i(d[0].positionLineNumber,d[0].positionColumn);t.revealPosition(u,0)}}_moveTo(e,t,i){return i?new Hi(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Hi(t.lineNumber,t.column,t.lineNumber,t.column)}}class $c extends Db{_move(e,t,i,n,s){return Fp.moveWordLeft(e,t,i,n,s)}}class Uc extends Db{_move(e,t,i,n,s){return Fp.moveWordRight(e,t,i,n)}}class Tj extends $c{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class Mj extends $c{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Rj extends $c{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Ue.and(U.textInputFocus,(e=Ue.and(X_,Y_))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Nj extends $c{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Oj extends $c{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Hj extends $c{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Ue.and(U.textInputFocus,(e=Ue.and(X_,Y_))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Wj extends $c{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,s){return super._move(Vu(Q_.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class zj extends $c{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Vu(Q_.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class Vj extends Uc{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class jj extends Uc{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Ue.and(U.textInputFocus,(e=Ue.and(X_,Y_))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class $j extends Uc{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Uj extends Uc{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class qj extends Uc{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Ue.and(U.textInputFocus,(e=Ue.and(X_,Y_))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Gj extends Uc{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Kj extends Uc{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,s){return super._move(Vu(Q_.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class Zj extends Uc{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Vu(Q_.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class Ab extends So{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(zs);if(!t.hasModel())return;const s=Vu(t.getOption(132),t.getOption(131)),r=t.getModel(),a=t.getSelections(),d=t.getOption(6),u=t.getOption(11),f=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),g=t._getViewModel(),p=a.map(C=>{const b=this._delete({wordSeparators:s,model:r,selection:C,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:d,autoClosingQuotes:u,autoClosingPairs:f,autoClosedCharacters:g.getCursorAutoClosedCharacters()},this._wordNavigationType);return new xp(b,"")});t.pushUndoStop(),t.executeCommands(this.id,p),t.pushUndoStop()}}class nS extends Ab{_delete(e,t){const i=Fp.deleteWordLeft(e,t);return i||new ee(1,1,1,1)}}class sS extends Ab{_delete(e,t){const i=Fp.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new ee(n,s,n,s)}}class Xj extends nS{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:U.writable})}}class Yj extends nS{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:U.writable})}}class Qj extends nS{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Jj extends sS{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:U.writable})}}class e$ extends sS{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:U.writable})}}class t$ extends sS{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class i$ extends xt{constructor(){super({id:"deleteInsideWord",precondition:U.writable,label:S("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Vu(t.getOption(132),t.getOption(131)),s=t.getModel(),a=t.getSelections().map(d=>{const u=Fp.deleteInsideWord(n,s,d);return new xp(u,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Si(new Tj);Si(new Mj);Si(new Rj);Si(new Nj);Si(new Oj);Si(new Hj);Si(new Vj);Si(new jj);Si(new $j);Si(new Uj);Si(new qj);Si(new Gj);Si(new Wj);Si(new zj);Si(new Kj);Si(new Zj);Si(new Xj);Si(new Yj);Si(new Qj);Si(new Jj);Si(new e$);Si(new t$);Be(i$);class n$ extends Ab{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=J_.deleteWordPartLeft(e);return i||new ee(1,1,1,1)}}class s$ extends Ab{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=J_.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new ee(n,s,n,s)}}class iF extends Db{_move(e,t,i,n,s){return J_.moveWordPartLeft(e,t,i,s)}}class o$ extends iF{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Kn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class r$ extends iF{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Kn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class nF extends Db{_move(e,t,i,n,s){return J_.moveWordPartRight(e,t,i)}}class a$ extends nF{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class l$ extends nF{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Si(new n$);Si(new s$);Si(new o$);Si(new r$);Si(new a$);Si(new l$);const ES=class ES extends Nt{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Po.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new oo(S("editor.simple.readonly","Cannot edit in read-only input")):t=new oo(S("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};ES.ID="editor.contrib.readOnlyMessageController";let Lv=ES;rn(Lv.ID,Lv,2);var c$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ZD=function(o,e){return function(t,i){e(t,i,o)}};let tw=class extends Nt{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Ko(this,void 0);const n=yd("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=yd("_textModel.onDidChangeContent",Ls.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(yp(async(r,a)=>{n.read(r),s.read(r);const d=a.add(new JL),u=await this._outlineModelService.getOrCreate(this._textModel,d.token);a.isDisposed||this._currentModel.set(u,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return n.sort(QL(Dp(s=>s.range.endLineNumber-s.range.startLineNumber,j_))),n.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};tw=c$([ZD(1,bi),ZD(2,$p)],tw);YL.setBreadcrumbsSourceFactory((o,e)=>e.createInstance(tw,o));const yS=class yS extends Nt{constructor(e){super(),this.editor=e,this.widget=null,t1&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new iw(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};yS.ID="editor.contrib.iPadShowKeyboard";let Iv=yS;const B_=class B_ extends Nt{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(Sn(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(Sn(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return B_.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};B_.ID="editor.contrib.ShowKeyboardWidget";let iw=B_;rn(Iv.ID,Iv,3);var d$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XD=function(o,e){return function(t,i){e(t,i,o)}},nw,xu;let sp=(xu=class extends Nt{static get(e){return e.getContribution(nw.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(U_.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new sw(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},nw=xu,xu.ID="editor.contrib.inspectTokens",xu);sp=nw=d$([XD(1,wk),XD(2,ua)],sp);class u$ extends xt{constructor(){super({id:"editor.action.inspectTokens",label:n7.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=sp.get(t);i==null||i.launch()}}function h$(o){let e="";for(let t=0,i=o.length;t<i;t++){const n=o.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function f$(o,e){const t=U_.get(e);if(t)return t;const i=o.encodeLanguageId(e);return{getInitialState:()=>e7,tokenize:(n,s,r)=>i7(e,r),tokenizeEncoded:(n,s,r)=>t7(i,r)}}const F_=class F_ extends Nt{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=f$(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return F_._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let d=t.tokens1.length-1;d>=0;d--){const u=t.tokens1[d];if(e.column-1>=u.offset){i=d;break}}let n=0;for(let d=t.tokens2.length>>>1;d>=0;d--)if(e.column-1>=t.tokens2[d<<1]){n=d;break}const s=this._model.getLineContent(e.lineNumber);let r="";if(i<t.tokens1.length){const d=t.tokens1[i].offset,u=i+1<t.tokens1.length?t.tokens1[i+1].offset:s.length;r=s.substring(d,u)}bm(this._domNode,ci("h2.tm-token",void 0,h$(r),ci("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),si(this._domNode,ci("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;si(this._domNode,ci("table.tm-metadata-table",void 0,ci("tbody",void 0,ci("tr",void 0,ci("td.tm-metadata-key",void 0,"language"),ci("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),ci("tr",void 0,ci("td.tm-metadata-key",void 0,"token type"),ci("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),ci("tr",void 0,ci("td.tm-metadata-key",void 0,"font style"),ci("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),ci("tr",void 0,ci("td.tm-metadata-key",void 0,"foreground"),ci("td.tm-metadata-value",void 0,`${a?dn.Format.CSS.formatHex(a.foreground):"-?-"}`)),ci("tr",void 0,ci("td.tm-metadata-key",void 0,"background"),ci("td.tm-metadata-value",void 0,`${a?dn.Format.CSS.formatHex(a.background):"-?-"}`))))),si(this._domNode,ci("hr.tokens-inspect-separator")),i<t.tokens1.length&&si(this._domNode,ci("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=U_.getColorMap(),i=Sf.getLanguageId(e),n=Sf.getTokenType(e),s=Sf.getFontStyle(e),r=Sf.getForeground(e),a=Sf.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:s,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};F_._ID="editor.contrib.inspectTokensWidget";let sw=F_;rn(sp.ID,sp,4);Be(u$);var g$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},YD=function(o,e){return function(t,i){e(t,i,o)}},Zf,mu;let ow=(mu=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=la.as(Lp.Quickaccess)}provide(e){const t=new Mt;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(Zf.PREFIX.length));n&&n.prefix&&n.prefix!==Zf.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==Zf.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:S("helpPickAriaLabel","{0}, {1}",n,t.description),description:t.description}})}},Zf=mu,mu.PREFIX="?",mu);ow=Zf=g$([YD(0,Pl),YD(1,ws)],ow);la.as(Lp.Quickaccess).registerQuickAccessProvider({ctor:ow,prefix:"",helpEntries:[{description:s7.helpQuickAccessActionLabel}]});class sF{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const n=new Mt;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new Xo);return s.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Mt,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const r={editor:s},a=Sk(s);if(a){let d=s.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{d=s.saveViewState()??void 0})),r.restoreViewState=()=>{d&&s===this.activeTextEditorControl&&s.restoreViewState(d)},n.add(Dk(t.onCancellationRequested)(()=>{var u;return(u=r.restoreViewState)==null?void 0:u.call(r)}))}n.add(Xn(()=>this.clearDecorations(s))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&b0(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return yk(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:ks(L2),position:Oa.Full}}}],[r,a]=i.deltaDecorations(n,s);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const L_=class L_ extends sF{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=S("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Nt.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new Mt;s.add(t.onDidAccept(d=>{const[u]=t.selectedItems;if(u){if(!this.isValidLineNumber(n,u.lineNumber))return;this.gotoLocation(e,{range:this.toRange(u.lineNumber,u.column),keyMods:t.keyMods,preserveFocus:d.inBackground}),d.inBackground||t.hide()}}));const r=()=>{const d=this.parsePosition(n,t.value.trim().substr(L_.PREFIX.length)),u=this.getPickLabel(n,d.lineNumber,d.column);if(t.items=[{lineNumber:d.lineNumber,column:d.column,label:u}],t.ariaLabel=u,!this.isValidLineNumber(n,d.lineNumber)){this.clearDecorations(n);return}const f=this.toRange(d.lineNumber,d.column);n.revealRangeInCenter(f,0),this.addDecorations(n,f)};r(),s.add(t.onDidChangeValue(()=>r()));const a=Sk(n);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),s.add(Xn(()=>a.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(s=>parseInt(s,10)).filter(s=>!isNaN(s)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?S("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):S("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?S("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,s):S("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const s={lineNumber:t,column:i};return n.validatePosition(s).equals(s)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};L_.PREFIX=":";let rw=L_;var p$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},x$=function(o,e){return function(t,i){e(t,i,o)}};let op=class extends rw{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Ls.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};op=p$([x$(0,vs)],op);var vu;let oF=(vu=class extends xt{constructor(){super({id:vu.ID,label:Ak.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Pl).quickAccess.show(op.PREFIX)}},vu.ID="editor.action.gotoLine",vu);Be(oF);la.as(Lp.Quickaccess).registerQuickAccessProvider({ctor:op,prefix:op.PREFIX,helpEntries:[{description:Ak.gotoLineActionLabel,commandId:oF.ID}]});const rF=[void 0,[]];function NC(o,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?m$(o,n.values,t,i):aF(o,e,t,i)}function m$(o,e,t,i){let n=0;const s=[];for(const r of e){const[a,d]=aF(o,r,t,i);if(typeof a!="number")return rF;n+=a,s.push(...d)}return[n,v$(s)]}function aF(o,e,t,i){const n=X2(e.original,e.originalLowercase,t,o,o.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],$_(n)]:rF}function v$(o){const e=o.sort((n,s)=>n.start-s.start),t=[];let i;for(const n of e)!i||!_$(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function _$(o,e){return!(o.end<e.start||e.end<o.start)}function QD(o){return o.startsWith('"')&&o.endsWith('"')}const lF=" ";function aw(o){typeof o!="string"&&(o="");const e=o.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=JD(o),s=t.indexOf(c1)>=0,r=QD(o);let a;const d=o.split(lF);if(d.length>1)for(const u of d){const f=QD(u),{pathNormalized:g,normalized:p,normalizedLowercase:C}=JD(u);p&&(a||(a=[]),a.push({original:u,originalLowercase:u.toLowerCase(),pathNormalized:g,normalized:p,normalizedLowercase:C,expectContiguousMatch:f}))}return{original:o,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function JD(o){let e;M_?e=o.replace(/\//g,c1):e=o.replace(/\\/g,c1);const t=o7(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function eA(o){return Array.isArray(o)?aw(o.map(e=>e.original).join(lF)):aw(o.original)}var b$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tA=function(o,e){return function(t,i){e(t,i,o)}},fm,ea;let Ld=(ea=class extends sF{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,S("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Nt.None}provideWithTextEditor(e,t,i,n){const s=e.editor,r=this.getModel(s);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):Nt.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new Mt;return this.provideLabelPick(i,S("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||n.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new R_,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(Xn(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,s){var g;const r=e.editor,a=new Mt;a.add(i.onDidAccept(p=>{var b;const[C]=i.selectedItems;C&&C.range&&(this.gotoLocation(e,{range:C.range.selection,keyMods:i.keyMods,preserveFocus:p.inBackground}),(b=s==null?void 0:s.handleAccept)==null||b.call(s,C),p.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:p})=>{p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const d=this.getDocumentSymbols(t,n);let u;const f=async p=>{u==null||u.dispose(!0),i.busy=!1,u=new Us(n),i.busy=!0;try{const C=aw(i.value.substr(fm.PREFIX.length).trim()),b=await this.doGetSymbolPicks(d,C,void 0,u.token,t);if(n.isCancellationRequested)return;if(b.length>0){if(i.items=b,p&&C.original.length===0){const y=c7(b,w=>!!(w.type!=="separator"&&w.range&&ee.containsPosition(w.range.decoration,p)));y&&(i.activeItems=[y])}}else C.original.length>0?this.provideLabelPick(i,S("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,S("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>f(void 0))),f((g=r.getSelection())==null?void 0:g.getPosition()),a.add(i.onDidChangeActive(()=>{const[p]=i.activeItems;p&&p.range&&(r.revealRangeInCenter(p.range.selection,0),this.addDecorations(r,p.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,s){var w,A;const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(fm.SCOPE_PREFIX)===0,d=a?1:0;let u,f;t.values&&t.values.length>1?(u=eA(t.values[0]),f=eA(t.values.slice(1))):u=t;let g;const p=(A=(w=this.options)==null?void 0:w.openSideBySideDirection)==null?void 0:A.call(w);p&&(g=[{iconClass:p==="right"?Fn.asClassName($i.splitHorizontal):Fn.asClassName($i.splitVertical),tooltip:p==="right"?S("openToSide","Open to the Side"):S("openToBottom","Open to the Bottom")}]);const C=[];for(let P=0;P<r.length;P++){const M=r[P],R=r7(M.name),T=`$(${a7.toIcon(M.kind).id}) ${R}`,V=T.length-R.length;let W=M.containerName;i!=null&&i.extraContainerLabel&&(W?W=`${i.extraContainerLabel} • ${W}`:W=i.extraContainerLabel);let Q,ne,de,te;if(t.original.length>d){let De=!1;if(u!==t&&([Q,ne]=NC(T,{...t,values:void 0},d,V),typeof Q=="number"&&(De=!0)),typeof Q!="number"&&([Q,ne]=NC(T,u,d,V),typeof Q!="number"))continue;if(!De&&f){if(W&&f.original.length>0&&([de,te]=NC(W,f)),typeof de!="number")continue;typeof Q=="number"&&(Q+=de)}}const he=M.tags&&M.tags.indexOf(1)>=0;C.push({index:P,kind:M.kind,score:Q,label:T,ariaLabel:l7(M.name,M.kind),description:W,highlights:he?void 0:{label:ne,description:te},range:{selection:ee.collapseToStart(M.selectionRange),decoration:M.range},uri:s.uri,symbolName:R,strikethrough:he,buttons:g})}const b=C.sort((P,M)=>a?this.compareByKindAndScore(P,M):this.compareByScore(P,M));let y=[];if(a){let T=function(){M&&typeof P=="number"&&R>0&&(M.label=zw(HC[P]||OC,R))},P,M,R=0;for(const V of b)P!==V.kind?(T(),P=V.kind,R=1,M={type:"separator"},y.push(M)):R++,y.push(V);T()}else b.length>0&&(y=[{label:S("symbols","symbols ({0})",C.length),type:"separator"},...b]);return y}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=HC[e.kind]||OC,n=HC[t.kind]||OC,s=i.localeCompare(n);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},fm=ea,ea.PREFIX="@",ea.SCOPE_PREFIX=":",ea.PREFIX_BY_CATEGORY=`${ea.PREFIX}${ea.SCOPE_PREFIX}`,ea);Ld=fm=b$([tA(0,bi),tA(1,$p)],Ld);const OC=S("property","properties ({0})"),HC={5:S("method","methods ({0})"),11:S("function","functions ({0})"),8:S("_constructor","constructors ({0})"),12:S("variable","variables ({0})"),4:S("class","classes ({0})"),22:S("struct","structs ({0})"),23:S("event","events ({0})"),24:S("operator","operators ({0})"),10:S("interface","interfaces ({0})"),2:S("namespace","namespaces ({0})"),3:S("package","packages ({0})"),25:S("typeParameter","type parameters ({0})"),1:S("modules","modules ({0})"),6:S("property","properties ({0})"),9:S("enum","enumerations ({0})"),21:S("enumMember","enumeration members ({0})"),14:S("string","strings ({0})"),0:S("file","files ({0})"),17:S("array","arrays ({0})"),15:S("number","numbers ({0})"),16:S("boolean","booleans ({0})"),18:S("object","objects ({0})"),19:S("key","keys ({0})"),7:S("field","fields ({0})"),13:S("constant","constants ({0})")};var C$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},WC=function(o,e){return function(t,i){e(t,i,o)}};let lw=class extends Ld{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Ls.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};lw=C$([WC(0,vs),WC(1,bi),WC(2,$p)],lw);const I_=class I_ extends xt{constructor(){super({id:I_.ID,label:d1.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:U.hasDocumentSymbolProvider,kbOpts:{kbExpr:U.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Pl).quickAccess.show(Ld.PREFIX,{itemActivation:d7.NONE})}};I_.ID="editor.action.quickOutline";let Pv=I_;Be(Pv);la.as(Lp.Quickaccess).registerQuickAccessProvider({ctor:lw,prefix:Ld.PREFIX,helpEntries:[{description:d1.quickOutlineActionLabel,prefix:Ld.PREFIX,commandId:Pv.ID},{description:d1.quickOutlineByCategoryActionLabel,prefix:Ld.PREFIX_BY_CATEGORY}]});function E$(o){const e=new Map;for(const t of o)e.set(t,(e.get(t)??0)+1);return e}class pg{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const d of a.chunks){const u=this.computeSimilarityScore(d,i,n);u>0&&s.push({key:r,score:u})}}return s}static termFrequencies(e){return E$(pg.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const s of n)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const s=pg.termFrequencies(n);for(const r of s.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:s})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const s=this.chunkOccurrences.get(n);if(typeof s=="number"){const r=s-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,r]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let d=i.get(s);typeof d!="number"&&(d=this.computeIdf(s),i.set(s,d));const u=a*d;n+=u*r}return n}computeEmbedding(e){const t=pg.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function y$(o){var i;const e=o.slice(0);e.sort((n,s)=>s.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var zh;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(zh||(zh={}));function zC(o){return Array.isArray(o.items)}function iA(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class w$ extends Nt{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var u;const n=new Mt;e.canAcceptInBackground=!!((u=this.options)!=null&&u.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const r=n.add(new Xo),a=async()=>{var w;const f=r.value=new Mt;s==null||s.dispose(!0),e.busy=!1,s=new Us(t);const g=s.token;let p=e.value.substring(this.prefix.length);(w=this.options)!=null&&w.shouldSkipTrimPickFilter||(p=p.trim());const C=this._getPicks(p,f,g,i),b=(A,P)=>{var T;let M,R;if(zC(A)?(M=A.items,R=A.active):M=A,M.length===0){if(P)return!1;(p.length>0||e.hideInput)&&((T=this.options)!=null&&T.noResultsPick)&&(u7(this.options.noResultsPick)?M=[this.options.noResultsPick(p)]:M=[this.options.noResultsPick])}return e.items=M,R&&(e.activeItems=[R]),!0},y=async A=>{let P=!1,M=!1;await Promise.all([(async()=>{typeof A.mergeDelay=="number"&&(await K_(A.mergeDelay),g.isCancellationRequested)||M||(P=b(A.picks,!0))})(),(async()=>{e.busy=!0;try{const R=await A.additionalPicks;if(g.isCancellationRequested)return;let T,V;zC(A.picks)?(T=A.picks.items,V=A.picks.active):T=A.picks;let W,Q;if(zC(R)?(W=R.items,Q=R.active):W=R,W.length>0||!P){let ne;if(!V&&!Q){const de=e.activeItems[0];de&&T.indexOf(de)!==-1&&(ne=de)}b({items:[...T,...W],active:V||Q||ne})}}finally{g.isCancellationRequested||(e.busy=!1),M=!0}})()])};if(C!==null)if(iA(C))await y(C);else if(!(C instanceof Promise))b(C);else{e.busy=!0;try{const A=await C;if(g.isCancellationRequested)return;iA(A)?await y(A):b(A)}finally{g.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(f=>{var p;if(i!=null&&i.handleAccept){f.inBackground||e.hide(),(p=i.handleAccept)==null||p.call(i,e.activeItems[0]);return}const[g]=e.selectedItems;typeof(g==null?void 0:g.accept)=="function"&&(f.inBackground||e.hide(),g.accept(e.keyMods,f))}));const d=async(f,g)=>{var C;if(typeof g.trigger!="function")return;const p=((C=g.buttons)==null?void 0:C.indexOf(f))??-1;if(p>=0){const b=g.trigger(p,e.keyMods),y=typeof b=="number"?b:await b;if(t.isCancellationRequested)return;switch(y){case zh.NO_ACTION:break;case zh.CLOSE_PICKER:e.hide();break;case zh.REFRESH_PICKER:a();break;case zh.REMOVE_ITEM:{const w=e.items.indexOf(g);if(w!==-1){const A=e.items.slice(),P=A.splice(w,1),M=e.activeItems.filter(T=>T!==P[0]),R=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=A,M&&(e.activeItems=M),e.keepScrollPosition=R}break}}}};return n.add(e.onDidTriggerItemButton(({button:f,item:g})=>d(f,g))),n.add(e.onDidTriggerSeparatorButton(({button:f,separator:g})=>d(f,g))),n}}var cF=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tc=function(o,e){return function(t,i){e(t,i,o)}},rd,bs,Ta;let cw=(Ta=class extends w${constructor(e,t,i,n,s,r){super(rd.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(dw)),this.options=e}async _getPicks(e,t,i,n){var C,b;const s=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=Dk(()=>{const y=new pg;y.updateDocuments(s.map(A=>({key:A.commandId,textChunks:[this.getTfIdfChunk(A)]})));const w=y.calculateScores(e,i);return y$(w).filter(A=>A.score>rd.TFIDF_THRESHOLD).slice(0,rd.TFIDF_MAX_RESULTS)}),a=[];for(const y of s){const w=rd.WORD_FILTER(e,y.label)??void 0,A=y.commandAlias?rd.WORD_FILTER(e,y.commandAlias)??void 0:void 0;if(w||A)y.highlights={label:w,detail:this.options.showAlias?A:void 0},a.push(y);else if(e===y.commandId)a.push(y);else if(e.length>=3){const P=r();if(i.isCancellationRequested)return[];const M=P.find(R=>R.key===y.commandId);M&&(y.tfIdfScore=M.score,a.push(y))}}const d=new Map;for(const y of a){const w=d.get(y.label);w?(y.description=y.commandId,w.description=w.commandId):d.set(y.label,y)}a.sort((y,w)=>{if(y.tfIdfScore&&w.tfIdfScore)return y.tfIdfScore===w.tfIdfScore?y.label.localeCompare(w.label):w.tfIdfScore-y.tfIdfScore;if(y.tfIdfScore)return 1;if(w.tfIdfScore)return-1;const A=this.commandsHistory.peek(y.commandId),P=this.commandsHistory.peek(w.commandId);if(A&&P)return A>P?-1:1;if(A)return-1;if(P)return 1;if(this.options.suggestedCommandIds){const M=this.options.suggestedCommandIds.has(y.commandId),R=this.options.suggestedCommandIds.has(w.commandId);if(M&&R)return 0;if(M)return-1;if(R)return 1}return y.label.localeCompare(w.label)});const u=[];let f=!1,g=!0,p=!!this.options.suggestedCommandIds;for(let y=0;y<a.length;y++){const w=a[y];y===0&&this.commandsHistory.peek(w.commandId)&&(u.push({type:"separator",label:S("recentlyUsed","recently used")}),f=!0),g&&w.tfIdfScore!==void 0&&(u.push({type:"separator",label:S("suggested","similar commands")}),g=!1),p&&w.tfIdfScore===void 0&&!this.commandsHistory.peek(w.commandId)&&((C=this.options.suggestedCommandIds)!=null&&C.has(w.commandId))&&(u.push({type:"separator",label:S("commonlyUsed","commonly used")}),f=!0,p=!1),f&&w.tfIdfScore===void 0&&!this.commandsHistory.peek(w.commandId)&&!((b=this.options.suggestedCommandIds)!=null&&b.has(w.commandId))&&(u.push({type:"separator",label:S("morecCommands","other commands")}),f=!1),u.push(this.toCommandPick(w,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:u,additionalPicks:(async()=>{var A;const y=await this.getAdditionalCommandPicks(s,a,e,i);if(i.isCancellationRequested)return[];const w=y.map(P=>this.toCommandPick(P,n));return g&&((A=w[0])==null?void 0:A.type)!=="separator"&&w.unshift({type:"separator",label:S("suggested","similar commands")}),w})()}:u}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?S("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(s=e.args)!=null&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){zc(r)||this.dialogService.error(S("canNotRun","Command '{0}' resulted in an error",e.label),Hm(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},rd=Ta,Ta.PREFIX=">",Ta.TFIDF_THRESHOLD=.5,Ta.TFIDF_MAX_RESULTS=5,Ta.WORD_FILTER=h7(p7,g7,f7),Ta);cw=rd=cF([tc(1,en),tc(2,ws),tc(3,Ws),tc(4,da),tc(5,Qw)],cw);var ta;let dw=(ta=class extends Nt{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Pw.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=bs.getConfiguredCommandHistoryLength(this.configurationService),bs.cache&&bs.cache.limit!==this.configuredCommandsHistoryLength&&(bs.cache.limit=this.configuredCommandsHistoryLength,bs.hasChanges=!0))}load(){const e=this.storageService.get(bs.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=bs.cache=new Cp(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,r)=>s.value-r.value),n.forEach(s=>i.set(s.key,s.value))}bs.counter=this.storageService.getNumber(bs.PREF_KEY_COUNTER,0,bs.counter)}push(e){bs.cache&&(bs.cache.set(e,bs.counter++),bs.hasChanges=!0)}peek(e){var t;return(t=bs.cache)==null?void 0:t.peek(e)}saveState(){if(!bs.cache||!bs.hasChanges)return;const e={usesLRU:!0,entries:[]};bs.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(bs.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(bs.PREF_KEY_COUNTER,bs.counter,0,0),bs.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,s;const i=(s=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:s.history;return typeof i=="number"?i:bs.DEFAULT_COMMANDS_HISTORY_LENGTH}},bs=ta,ta.DEFAULT_COMMANDS_HISTORY_LENGTH=50,ta.PREF_KEY_CACHE="commandPalette.mru.cache",ta.PREF_KEY_COUNTER="commandPalette.mru.counter",ta.counter=1,ta.hasChanges=!1,ta);dw=bs=cF([tc(0,Vc),tc(1,Qn),tc(2,zu)],dw);class S$ extends cw{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let s;(i=n.metadata)!=null&&i.description&&(x7(n.metadata.description)?s=n.metadata.description:s={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:s,label:m7(n.label)||n.id})}return t}}var D$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_h=function(o,e){return function(t,i){e(t,i,o)}};let rp=class extends S${get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,s,r){super({showAlias:!1},e,i,n,s,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};rp=D$([_h(0,en),_h(1,vs),_h(2,ws),_h(3,Ws),_h(4,da),_h(5,Qw)],rp);const P_=class P_ extends xt{constructor(){super({id:P_.ID,label:kk.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Pl).quickAccess.show(rp.PREFIX)}};P_.ID="editor.action.quickCommand";let Tv=P_;Be(Tv);la.as(Lp.Quickaccess).registerQuickAccessProvider({ctor:rp,prefix:rp.PREFIX,helpEntries:[{description:kk.quickCommandHelp,commandId:Tv.ID}]});var A$=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bh=function(o,e){return function(t,i){e(t,i,o)}};let uw=class extends Iu{constructor(e,t,i,n,s,r,a){super(!0,e,t,i,n,s,r,a)}};uw=A$([bh(1,Dn),bh(2,vs),bh(3,go),bh(4,en),bh(5,Vc),bh(6,Qn)],uw);rn(Iu.ID,uw,4);class k$ extends xt{constructor(){super({id:"editor.action.toggleHighContrast",label:v7.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(wk),n=i.getColorTheme();Eg(n.type)?(i.setTheme(this._originalThemeName||(i8(n.type)?_7:b7)),this._originalThemeName=null):(i.setTheme(i8(n.type)?C7:E7),this._originalThemeName=n.themeName)}}Be(k$);let hw=null;function B$(o){hw=o}function F$(o={}){return{"Content-Type":"application/json",...o}}async function $t(o,e,t){const i=await fetch(e,{method:o,headers:F$(),body:t!==void 0?JSON.stringify(t):void 0});if(i.status===401)throw hw&&hw(),new Error("Unauthorized");if(!i.ok){const n=await i.json().catch(()=>({error:i.statusText}));throw new Error(n.error??i.statusText)}return i.json()}async function L$(){return await(await fetch("/she/auth/mode")).json()}async function I$(o){const e=await fetch("/she/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:o})});if(!e.ok){const t=await e.json().catch(()=>({error:e.statusText}));throw new Error(t.error??"Login failed")}}async function P$(){await fetch("/she/auth/logout",{method:"POST"})}async function T$(o,e,t,i){const n=await fetch("/she/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:o,password:e,proxyHeader:t,proxyLogoutUrl:i})});if(!n.ok){const s=await n.json().catch(()=>({error:n.statusText}));throw new Error(s.error??"Setup failed")}}function M$(){return $t("GET","/she/scripts/tree")}function Nx(o){return $t("GET",`/she/scripts/${o}`)}function Gl(o,e){return $t("PUT",`/she/scripts/${o}`,{content:e})}function nA(o,e={}){const t=new URLSearchParams({q:o});return e.regex&&t.set("regex","true"),e.caseSensitive&&t.set("caseSensitive","true"),e.mode&&t.set("mode",e.mode),$t("GET",`/she/scripts/search?${t}`)}function Ox(o){return $t("DELETE",`/she/scripts/${o}`)}function sA(o,e){return $t("POST",`/she/scripts/${o}/rename`,{newPath:e})}function R$(o){return $t("POST","/she/scripts/mkdir",{path:o})}function N$(){return $t("GET","/she/git/status")}function Xf(){return $t("GET","/she/status")}function dF(){return $t("POST","/she/restart")}function O$(){return $t("POST","/she/update")}function H$(){return $t("POST","/she/check-update")}function W$(o,e){return $t("POST","/she/git/commit",{path:o,message:e})}function oA(o,e){return $t("POST","/she/git/commit",{files:o,message:e})}function rA(o){return $t("POST","/she/git/commit",{message:o})}function Hx(o){return $t("POST","/she/git/push",{remote:o})}function z$(o,e){return $t("GET",`/she/git/log?path=${encodeURIComponent(o)}&limit=${e}`)}function V$(o,e){return $t("GET",`/she/git/show?hash=${encodeURIComponent(o)}&path=${encodeURIComponent(e)}`)}function Il(){return $t("GET","/she/config")}function ap(o){return $t("PUT","/she/config",o)}function uF(){return $t("GET","/she/db/docs")}function j$(o){return $t("GET",`/she/db/docs/${o}`)}function aA(o,e){return $t("PUT",`/she/db/docs/${o}`,e)}function $$(o){return $t("DELETE",`/she/db/docs/${o}`)}function hF(){return $t("GET","/she/db/views")}function U$(o){return $t("GET",`/she/db/views/${o}`)}function lA(o,e){return $t("PUT",`/she/db/views/${o}`,e)}function q$(o){return $t("DELETE",`/she/db/views/${o}`)}function G$(){return $t("GET","/she/deps")}function K$(o){return $t("GET",`/she/deps/search?q=${encodeURIComponent(o)}`)}function Z$(o,e){return $t("POST","/she/deps/install",{name:o,version:null})}function X$(o){return $t("POST","/she/deps/remove",{name:o})}function Y$(o){return $t("POST","/she/deps/update",{name:o})}function fF(){return $t("GET","/she/deps/outdated")}function Q$(){return $t("POST","/she/deps/check-outdated")}function J$(){return $t("GET","/she/ai/conversations")}function cA(o){return $t("GET",`/she/ai/conversations/${encodeURIComponent(o)}`)}function eU(o,e,t){return $t("PUT",`/she/ai/conversations/${encodeURIComponent(o)}`,{title:e,messages:t})}function tU(o){return $t("DELETE",`/she/ai/conversations/${encodeURIComponent(o)}`)}function VC(o){return $t("GET",`/she/db/views/${o}/result`)}function gF(){return $t("GET","/she/matter/devices")}function gm(o){return $t("GET",`/she/matter/devices/${o}`)}function iU(o){return $t("POST","/she/matter/commission",o)}function nU(o){return $t("DELETE",`/she/matter/devices/${o}`)}function sU(o,e,t,i,n){return $t("POST",`/she/matter/devices/${o}/command`,{endpointId:e,clusterName:t,command:i,args:n})}function pF(){return $t("GET","/she/mqtt/state")}function dA(o,e,t=!1,i=0){return $t("POST","/she/mqtt/publish",{topic:o,payload:e,retain:t,qos:i})}function xF(){return $t("GET","/she/ai/config")}function mF(){return $t("GET","/she/ai/models")}function fw(o){return $t("GET",`/she/ai/model-info?model=${encodeURIComponent(o)}`)}function vF(o){return $t("POST","/she/ai/prompt",o)}async function _F(o,e,t,i){const s=await fetch("/she/ai/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o),signal:t});if(!s.ok){const u=await s.json().catch(()=>({error:s.statusText}));throw new Error(u.error??s.statusText)}const r=s.body.getReader(),a=new TextDecoder;let d="";try{for(;;){const{done:u,value:f}=await r.read();if(u)break;d+=a.decode(f,{stream:!0});const g=d.split(`
79
79
  `);d=g.pop()??"";for(const p of g){if(!p.startsWith("data: "))continue;const C=p.slice(6).trim();if(C==="[DONE]")return;try{const b=JSON.parse(C);if(b.error)throw new Error(b.error);if(b.type==="tool_call"||b.type==="tool_result"){i==null||i({type:b.type,name:b.name??"",args:b.args,content:b.content});continue}b.token&&e(b.token)}catch(b){if(b instanceof SyntaxError)continue;throw b}}}}finally{r.releaseLock()}}function oS(){return $t("GET","/she/broker/status")}function oU(){return $t("GET","/she/broker/local/check")}function rU(){return $t("GET","/she/broker/ip-addresses")}function rS(){return $t("GET","/she/broker/config")}function aU(o=500){return $t("GET",`/she/broker/logs?limit=${o}`)}function bF(o){return $t("PUT","/she/broker/config",o)}function CF(){return $t("POST","/she/broker/reload")}function lU(){return $t("POST","/she/broker/restart")}function cU(){return $t("POST","/she/broker/wizard/deactivate")}function dU(){return $t("POST","/she/broker/wizard/reinit")}function uU(){return $t("GET","/she/broker/wizard/diagnose")}function hU(){return $t("GET","/she/broker/users")}function fU(o,e){return $t("POST","/she/broker/users",{username:o,password:e})}function gU(o){return $t("DELETE",`/she/broker/users/${encodeURIComponent(o)}`)}function pU(o,e){return $t("PUT",`/she/broker/users/${encodeURIComponent(o)}/password`,{password:e})}function xU(o,e){return $t("POST",`/she/broker/users/${encodeURIComponent(o)}/roles`,{rolename:e})}function mU(o,e){return $t("DELETE",`/she/broker/users/${encodeURIComponent(o)}/roles/${encodeURIComponent(e)}`)}function EF(){return $t("GET","/she/broker/roles")}function vU(o){return $t("POST","/she/broker/roles",{rolename:o})}function _U(o){return $t("DELETE",`/she/broker/roles/${encodeURIComponent(o)}`)}function bU(o,e){return $t("POST",`/she/broker/roles/${encodeURIComponent(o)}/acls`,e)}function CU(o,e,t){return $t("DELETE",`/she/broker/roles/${encodeURIComponent(o)}/acls`,{acltype:e,topic:t})}function EU(){return $t("GET","/she/broker/groups")}function yU(o){return $t("POST","/she/broker/groups",{groupname:o})}function wU(o){return $t("DELETE",`/she/broker/groups/${encodeURIComponent(o)}`)}function uA(o,e){return $t("POST",`/she/broker/groups/${encodeURIComponent(o)}/clients`,{username:e})}function hA(o,e){return $t("DELETE",`/she/broker/groups/${encodeURIComponent(o)}/clients/${encodeURIComponent(e)}`)}function SU(o,e){return $t("POST",`/she/broker/groups/${encodeURIComponent(o)}/roles`,{rolename:e})}function DU(o,e){return $t("DELETE",`/she/broker/groups/${encodeURIComponent(o)}/roles/${encodeURIComponent(e)}`)}function AU(){return $t("GET","/she/broker/acl-defaults")}function kU(o){return $t("PUT","/she/broker/acl-defaults",{acls:o})}function BU(o){return $t("GET",`/she/broker/acl-check?${new URLSearchParams({topic:o})}`)}function FU(){return $t("GET","/she/broker/anonymous-group")}function LU(o){return $t("PUT","/she/broker/anonymous-group",{groupname:o})}function IU(){return $t("GET","/she/broker/ca/server")}function PU(o){return $t("POST","/she/broker/ca/server/generate",o)}function TU(o){return $t("POST","/she/broker/ca/server/csr",o)}function jC(o){return $t("POST","/she/broker/ca/server/import",o)}function MU(){return $t("GET","/she/broker/ca/trusted")}function RU(o){return $t("POST","/she/broker/ca/trusted",{pem:o})}function NU(o){return $t("DELETE",`/she/broker/ca/trusted/${encodeURIComponent(o)}`)}function OU(o){return $t("GET",`/she/broker/fs/complete?path=${encodeURIComponent(o)}`)}function HU(o){return $t("POST","/she/broker/ca/server/pathlink",o)}function WU(o){return $t("POST","/she/broker/ca/trusted/addpath",{path:o})}const zU=2e3,pm=[],VU=500,xm=[];function yF(){return pm.slice()}function jU(){return xm.slice()}let uc=null;const Mv=new Set,Vh=new Map;let gw=null;function lp(){let o=Mv.size;for(const e of Vh.values())o+=e.size;return o}function $U(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/she/ws`}function aS(){if(uc)return;const o=$U(),e=new WebSocket(o);uc=e,e.onmessage=t=>{try{const i=JSON.parse(t.data);if(i.type==="log"){const s={level:i.level,msg:i.msg,ts:i.ts};pm.length>=zU&&pm.shift(),pm.push(s),Mv.forEach(r=>r(s))}if(i.type==="brokerLog"){const s={level:i.level,msg:i.msg,ts:i.ts};xm.length>=VU&&xm.shift(),xm.push(s)}const n=Vh.get(i.type);n&&n.forEach(s=>s(i))}catch{}},e.onclose=()=>{uc===e&&(uc=null),lp()>0&&(gw=setTimeout(aS,3e3))},e.onerror=()=>{e.close()}}function wF(){gw&&clearTimeout(gw),uc==null||uc.close(),uc=null}function lS(o){return Mv.add(o),lp()===1&&aS(),()=>{Mv.delete(o),lp()===0&&wF()}}function ar(o,e){return Vh.has(o)||Vh.set(o,new Set),Vh.get(o).add(e),lp()===1&&aS(),()=>{var t;(t=Vh.get(o))==null||t.delete(e),lp()===0&&wF()}}var UU=B('<button class="cancel svelte-1eh8v5n">Cancel</button>'),qU=B('<div class="backdrop svelte-1eh8v5n" role="presentation"></div> <div class="dialog svelte-1eh8v5n" role="dialog" aria-modal="true"><p class="svelte-1eh8v5n"> </p> <div class="actions svelte-1eh8v5n"><!> <button> </button></div></div>',1);function qc(o,e){Vs(e,!0);let t=I(!1),i=I(""),n=I("Confirm"),s=I(!1),r=I(!1),a=null;function d(y,w){return m(i,y,!0),m(n,(w==null?void 0:w.confirm)??(w!=null&&w.alert?"OK":"Confirm"),!0),m(s,(w==null?void 0:w.danger)??!1,!0),m(r,(w==null?void 0:w.alert)??!1,!0),m(t,!0),new Promise(A=>a=A)}function u(y){m(t,!1),a==null||a(y),a=null}function f(y){c(t)&&(y.key==="Escape"&&u(!1),y.key==="Enter"&&u(!0))}var g={show:d},p=Es();fs("keydown",Dd,f);var C=yt(p);{var b=y=>{var w=qU(),A=yt(w),P=v(A,2),M=_(P),R=_(M),T=v(M,2),V=_(T);{var W=te=>{var he=UU();$("click",he,()=>u(!1)),D(te,he)};z(V,te=>{c(r)||te(W)})}var Q=v(V,2);let ne;var de=_(Q);j(()=>{O(R,c(i)),ne=Bt(Q,1,"svelte-1eh8v5n",null,ne,{danger:c(s)}),O(de,c(n))}),$("click",A,()=>u(!1)),$("click",Q,()=>u(!0)),D(y,w)};z(C,y=>{c(t)&&y(b)})}return D(o,p),js(g)}Zs(["click"]);var GU=B('<div class="backdrop svelte-1vi95tb" role="presentation"></div> <div class="dialog svelte-1vi95tb" role="dialog" aria-modal="true"><p class="svelte-1vi95tb"> </p> <input class="svelte-1vi95tb"/> <div class="actions svelte-1vi95tb"><button class="cancel svelte-1vi95tb">Cancel</button> <button class="svelte-1vi95tb"> </button></div></div>',1);function KU(o,e){Vs(e,!0);let t=I(!1),i=I(""),n=I(""),s=I("OK"),r=I(""),a=null,d=I(void 0);function u(A,P){return m(i,A,!0),m(n,(P==null?void 0:P.placeholder)??"",!0),m(s,(P==null?void 0:P.confirm)??"OK",!0),m(r,(P==null?void 0:P.initial)??"",!0),m(t,!0),setTimeout(()=>{if(c(d)){c(d).focus();const M=c(d).value.length;c(d).setSelectionRange(M,M)}},0),new Promise(M=>a=M)}function f(){const A=c(r).trim();A&&(m(t,!1),a==null||a(A),a=null,m(r,""))}function g(){m(t,!1),a==null||a(null),a=null,m(r,"")}function p(A){c(t)&&A.key==="Escape"&&(A.stopPropagation(),g())}var C={show:u},b=Es();fs("keydown",Dd,p);var y=yt(b);{var w=A=>{var P=GU(),M=yt(P),R=v(M,2),T=_(R),V=_(T),W=v(T,2);us(W,he=>m(d,he),()=>c(d));var Q=v(W,2),ne=_(Q),de=v(ne,2),te=_(de);j(he=>{O(V,c(i)),ln(W,"placeholder",c(n)),de.disabled=he,O(te,c(s))},[()=>!c(r).trim()]),$("click",M,g),$("keydown",W,he=>{he.key==="Enter"&&(he.preventDefault(),f())}),jt(W,()=>c(r),he=>m(r,he)),$("click",ne,g),$("click",de,f),D(A,P)};z(y,A=>{c(t)&&A(w)})}return D(o,b),js(C)}Zs(["click","keydown"]);function cS(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var $C,fA;function ZU(){if(fA)return $C;fA=1;function o(X){return X instanceof Map?X.clear=X.delete=X.set=function(){throw new Error("map is read-only")}:X instanceof Set&&(X.add=X.clear=X.delete=function(){throw new Error("set is read-only")}),Object.freeze(X),Object.getOwnPropertyNames(X).forEach(Ae=>{const qe=X[Ae],nt=typeof qe;(nt==="object"||nt==="function")&&!Object.isFrozen(qe)&&o(qe)}),X}class e{constructor(Ae){Ae.data===void 0&&(Ae.data={}),this.data=Ae.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(X,...Ae){const qe=Object.create(null);for(const nt in X)qe[nt]=X[nt];return Ae.forEach(function(nt){for(const qt in nt)qe[qt]=nt[qt]}),qe}const n="</span>",s=X=>!!X.scope,r=(X,{prefix:Ae})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const qe=X.split(".");return[`${Ae}${qe.shift()}`,...qe.map((nt,qt)=>`${nt}${"_".repeat(qt+1)}`)].join(" ")}return`${Ae}${X}`};class a{constructor(Ae,qe){this.buffer="",this.classPrefix=qe.classPrefix,Ae.walk(this)}addText(Ae){this.buffer+=t(Ae)}openNode(Ae){if(!s(Ae))return;const qe=r(Ae.scope,{prefix:this.classPrefix});this.span(qe)}closeNode(Ae){s(Ae)&&(this.buffer+=n)}value(){return this.buffer}span(Ae){this.buffer+=`<span class="${Ae}">`}}const d=(X={})=>{const Ae={children:[]};return Object.assign(Ae,X),Ae};class u{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Ae){this.top.children.push(Ae)}openNode(Ae){const qe=d({scope:Ae});this.add(qe),this.stack.push(qe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Ae){return this.constructor._walk(Ae,this.rootNode)}static _walk(Ae,qe){return typeof qe=="string"?Ae.addText(qe):qe.children&&(Ae.openNode(qe),qe.children.forEach(nt=>this._walk(Ae,nt)),Ae.closeNode(qe)),Ae}static _collapse(Ae){typeof Ae!="string"&&Ae.children&&(Ae.children.every(qe=>typeof qe=="string")?Ae.children=[Ae.children.join("")]:Ae.children.forEach(qe=>{u._collapse(qe)}))}}class f extends u{constructor(Ae){super(),this.options=Ae}addText(Ae){Ae!==""&&this.add(Ae)}startScope(Ae){this.openNode(Ae)}endScope(){this.closeNode()}__addSublanguage(Ae,qe){const nt=Ae.root;qe&&(nt.scope=`language:${qe}`),this.add(nt)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(X){return X?typeof X=="string"?X:X.source:null}function p(X){return y("(?=",X,")")}function C(X){return y("(?:",X,")*")}function b(X){return y("(?:",X,")?")}function y(...X){return X.map(qe=>g(qe)).join("")}function w(X){const Ae=X[X.length-1];return typeof Ae=="object"&&Ae.constructor===Object?(X.splice(X.length-1,1),Ae):{}}function A(...X){return"("+(w(X).capture?"":"?:")+X.map(nt=>g(nt)).join("|")+")"}function P(X){return new RegExp(X.toString()+"|").exec("").length-1}function M(X,Ae){const qe=X&&X.exec(Ae);return qe&&qe.index===0}const R=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function T(X,{joinWith:Ae}){let qe=0;return X.map(nt=>{qe+=1;const qt=qe;let se=g(nt),Ee="";for(;se.length>0;){const Le=R.exec(se);if(!Le){Ee+=se;break}Ee+=se.substring(0,Le.index),se=se.substring(Le.index+Le[0].length),Le[0][0]==="\\"&&Le[1]?Ee+="\\"+String(Number(Le[1])+qt):(Ee+=Le[0],Le[0]==="("&&qe++)}return Ee}).map(nt=>`(${nt})`).join(Ae)}const V=/\b\B/,W="[a-zA-Z]\\w*",Q="[a-zA-Z_]\\w*",ne="\\b\\d+(\\.\\d+)?",de="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",te="\\b(0b[01]+)",he="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",De=(X={})=>{const Ae=/^#![ ]*\//;return X.binary&&(X.begin=y(Ae,/.*\b/,X.binary,/\b.*/)),i({scope:"meta",begin:Ae,end:/$/,relevance:0,"on:begin":(qe,nt)=>{qe.index!==0&&nt.ignoreMatch()}},X)},oe={begin:"\\\\[\\s\\S]",relevance:0},ge={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[oe]},Se={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[oe]},Re={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},xe=function(X,Ae,qe={}){const nt=i({scope:"comment",begin:X,end:Ae,contains:[]},qe);nt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const qt=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return nt.contains.push({begin:y(/[ ]+/,"(",qt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),nt},et=xe("//","$"),We=xe("/\\*","\\*/"),_e=xe("#","$"),dt={scope:"number",begin:ne,relevance:0},Wt={scope:"number",begin:de,relevance:0},tt={scope:"number",begin:te,relevance:0},kt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[oe,{begin:/\[/,end:/\]/,relevance:0,contains:[oe]}]},be={scope:"title",begin:W,relevance:0},Rt={scope:"title",begin:Q,relevance:0},ut={begin:"\\.\\s*"+Q,relevance:0};var Ze=Object.freeze({__proto__:null,APOS_STRING_MODE:ge,BACKSLASH_ESCAPE:oe,BINARY_NUMBER_MODE:tt,BINARY_NUMBER_RE:te,COMMENT:xe,C_BLOCK_COMMENT_MODE:We,C_LINE_COMMENT_MODE:et,C_NUMBER_MODE:Wt,C_NUMBER_RE:de,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(Ae,qe)=>{qe.data._beginMatch=Ae[1]},"on:end":(Ae,qe)=>{qe.data._beginMatch!==Ae[1]&&qe.ignoreMatch()}})},HASH_COMMENT_MODE:_e,IDENT_RE:W,MATCH_NOTHING_RE:V,METHOD_GUARD:ut,NUMBER_MODE:dt,NUMBER_RE:ne,PHRASAL_WORDS_MODE:Re,QUOTE_STRING_MODE:Se,REGEXP_MODE:kt,RE_STARTERS_RE:he,SHEBANG:De,TITLE_MODE:be,UNDERSCORE_IDENT_RE:Q,UNDERSCORE_TITLE_MODE:Rt});function Pt(X,Ae){X.input[X.index-1]==="."&&Ae.ignoreMatch()}function ui(X,Ae){X.className!==void 0&&(X.scope=X.className,delete X.className)}function wt(X,Ae){Ae&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=Pt,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function Ft(X,Ae){Array.isArray(X.illegal)&&(X.illegal=A(...X.illegal))}function Vt(X,Ae){if(X.match){if(X.begin||X.end)throw new Error("begin & end are not supported with match");X.begin=X.match,delete X.match}}function zt(X,Ae){X.relevance===void 0&&(X.relevance=1)}const Zt=(X,Ae)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const qe=Object.assign({},X);Object.keys(X).forEach(nt=>{delete X[nt]}),X.keywords=qe.keywords,X.begin=y(qe.beforeMatch,p(qe.begin)),X.starts={relevance:0,contains:[Object.assign(qe,{endsParent:!0})]},X.relevance=0,delete qe.beforeMatch},mt=["of","and","for","in","not","or","if","then","parent","list","value"],Mi="keyword";function Ri(X,Ae,qe=Mi){const nt=Object.create(null);return typeof X=="string"?qt(qe,X.split(" ")):Array.isArray(X)?qt(qe,X):Object.keys(X).forEach(function(se){Object.assign(nt,Ri(X[se],Ae,se))}),nt;function qt(se,Ee){Ae&&(Ee=Ee.map(Le=>Le.toLowerCase())),Ee.forEach(function(Le){const Y=Le.split("|");nt[Y[0]]=[se,Di(Y[0],Y[1])]})}}function Di(X,Ae){return Ae?Number(Ae):Ui(X)?0:1}function Ui(X){return mt.includes(X.toLowerCase())}const ji={},Bi=X=>{console.error(X)},fn=(X,...Ae)=>{console.log(`WARN: ${X}`,...Ae)},an=(X,Ae)=>{ji[`${X}/${Ae}`]||(console.log(`Deprecated as of ${X}. ${Ae}`),ji[`${X}/${Ae}`]=!0)},Zi=new Error;function _n(X,Ae,{key:qe}){let nt=0;const qt=X[qe],se={},Ee={};for(let Le=1;Le<=Ae.length;Le++)Ee[Le+nt]=qt[Le],se[Le+nt]=!0,nt+=P(Ae[Le-1]);X[qe]=Ee,X[qe]._emit=se,X[qe]._multi=!0}function gt(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw Bi("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Zi;if(typeof X.beginScope!="object"||X.beginScope===null)throw Bi("beginScope must be object"),Zi;_n(X,X.begin,{key:"beginScope"}),X.begin=T(X.begin,{joinWith:""})}}function Yt(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw Bi("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Zi;if(typeof X.endScope!="object"||X.endScope===null)throw Bi("endScope must be object"),Zi;_n(X,X.end,{key:"endScope"}),X.end=T(X.end,{joinWith:""})}}function Ci(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function Wi(X){Ci(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),gt(X),Yt(X)}function Pi(X){function Ae(Ee,Le){return new RegExp(g(Ee),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Le?"g":""))}class qe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Le,Y){Y.position=this.position++,this.matchIndexes[this.matchAt]=Y,this.regexes.push([Y,Le]),this.matchAt+=P(Le)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Le=this.regexes.map(Y=>Y[1]);this.matcherRe=Ae(T(Le,{joinWith:"|"}),!0),this.lastIndex=0}exec(Le){this.matcherRe.lastIndex=this.lastIndex;const Y=this.matcherRe.exec(Le);if(!Y)return null;const Oe=Y.findIndex((ye,At)=>At>0&&ye!==void 0),Ve=this.matchIndexes[Oe];return Y.splice(0,Oe),Object.assign(Y,Ve)}}class nt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Le){if(this.multiRegexes[Le])return this.multiRegexes[Le];const Y=new qe;return this.rules.slice(Le).forEach(([Oe,Ve])=>Y.addRule(Oe,Ve)),Y.compile(),this.multiRegexes[Le]=Y,Y}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Le,Y){this.rules.push([Le,Y]),Y.type==="begin"&&this.count++}exec(Le){const Y=this.getMatcher(this.regexIndex);Y.lastIndex=this.lastIndex;let Oe=Y.exec(Le);if(this.resumingScanAtSamePosition()&&!(Oe&&Oe.index===this.lastIndex)){const Ve=this.getMatcher(0);Ve.lastIndex=this.lastIndex+1,Oe=Ve.exec(Le)}return Oe&&(this.regexIndex+=Oe.position+1,this.regexIndex===this.count&&this.considerAll()),Oe}}function qt(Ee){const Le=new nt;return Ee.contains.forEach(Y=>Le.addRule(Y.begin,{rule:Y,type:"begin"})),Ee.terminatorEnd&&Le.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&Le.addRule(Ee.illegal,{type:"illegal"}),Le}function se(Ee,Le){const Y=Ee;if(Ee.isCompiled)return Y;[ui,Vt,Wi,Zt].forEach(Ve=>Ve(Ee,Le)),X.compilerExtensions.forEach(Ve=>Ve(Ee,Le)),Ee.__beforeBegin=null,[wt,Ft,zt].forEach(Ve=>Ve(Ee,Le)),Ee.isCompiled=!0;let Oe=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Oe=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Oe=Oe||/\w+/,Ee.keywords&&(Ee.keywords=Ri(Ee.keywords,X.case_insensitive)),Y.keywordPatternRe=Ae(Oe,!0),Le&&(Ee.begin||(Ee.begin=/\B|\b/),Y.beginRe=Ae(Y.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(Y.endRe=Ae(Y.end)),Y.terminatorEnd=g(Y.end)||"",Ee.endsWithParent&&Le.terminatorEnd&&(Y.terminatorEnd+=(Ee.end?"|":"")+Le.terminatorEnd)),Ee.illegal&&(Y.illegalRe=Ae(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Ve){return Oi(Ve==="self"?Ee:Ve)})),Ee.contains.forEach(function(Ve){se(Ve,Y)}),Ee.starts&&se(Ee.starts,Le),Y.matcher=qt(Y),Y}if(X.compilerExtensions||(X.compilerExtensions=[]),X.contains&&X.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return X.classNameAliases=i(X.classNameAliases||{}),se(X)}function Ti(X){return X?X.endsWithParent||Ti(X.starts):!1}function Oi(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(Ae){return i(X,{variants:null},Ae)})),X.cachedVariants?X.cachedVariants:Ti(X)?i(X,{starts:X.starts?i(X.starts):null}):Object.isFrozen(X)?i(X):X}var Qi="11.11.1";class yi extends Error{constructor(Ae,qe){super(Ae),this.name="HTMLInjectionError",this.html=qe}}const Xe=t,St=i,Ai=Symbol("nomatch"),ki=7,fi=function(X){const Ae=Object.create(null),qe=Object.create(null),nt=[];let qt=!0;const se="Could not find the language '{}', did you forget to load/include a language module?",Ee={disableAutodetect:!0,name:"Plain text",contains:[]};let Le={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function Y(F){return Le.noHighlightRe.test(F)}function Oe(F){let H=F.className+" ";H+=F.parentNode?F.parentNode.className:"";const K=Le.languageDetectRe.exec(H);if(K){const le=Jt(K[1]);return le||(fn(se.replace("{}",K[1])),fn("Falling back to no-highlight mode for this block.",F)),le?K[1]:"no-highlight"}return H.split(/\s+/).find(le=>Y(le)||Jt(le))}function Ve(F,H,K){let le="",Z="";typeof H=="object"?(le=F,K=H.ignoreIllegals,Z=H.language):(an("10.7.0","highlight(lang, code, ...args) has been deprecated."),an("10.7.0",`Please use highlight(code, options) instead.
80
80
  https://github.com/highlightjs/highlight.js/issues/2277`),Z=F,le=H),K===void 0&&(K=!0);const J={code:le,language:Z};_t("before:highlight",J);const ce=J.result?J.result:ye(J.language,J.code,K);return ce.code=J.code,_t("after:highlight",ce),ce}function ye(F,H,K,le){const Z=Object.create(null);function J(Me,st){return Me.keywords[st]}function ce(){if(!Fe.keywords){Ge.addText(ze);return}let Me=0;Fe.keywordPatternRe.lastIndex=0;let st=Fe.keywordPatternRe.exec(ze),Lt="";for(;st;){Lt+=ze.substring(Me,st.index);const Ht=ke.case_insensitive?st[0].toLowerCase():st[0],pt=J(Fe,Ht);if(pt){const[vi,wi]=pt;if(Ge.addText(Lt),Lt="",Z[Ht]=(Z[Ht]||0)+1,Z[Ht]<=ki&&(Je+=wi),vi.startsWith("_"))Lt+=st[0];else{const qi=ke.classNameAliases[vi]||vi;pe(st[0],qi)}}else Lt+=st[0];Me=Fe.keywordPatternRe.lastIndex,st=Fe.keywordPatternRe.exec(ze)}Lt+=ze.substring(Me),Ge.addText(Lt)}function Qe(){if(ze==="")return;let Me=null;if(typeof Fe.subLanguage=="string"){if(!Ae[Fe.subLanguage]){Ge.addText(ze);return}Me=ye(Fe.subLanguage,ze,!0,Dt[Fe.subLanguage]),Dt[Fe.subLanguage]=Me._top}else Me=Ot(ze,Fe.subLanguage.length?Fe.subLanguage:null);Fe.relevance>0&&(Je+=Me.relevance),Ge.__addSublanguage(Me._emitter,Me.language)}function ae(){Fe.subLanguage!=null?Qe():ce(),ze=""}function pe(Me,st){Me!==""&&(Ge.startScope(st),Ge.addText(Me),Ge.endScope())}function Te(Me,st){let Lt=1;const Ht=st.length-1;for(;Lt<=Ht;){if(!Me._emit[Lt]){Lt++;continue}const pt=ke.classNameAliases[Me[Lt]]||Me[Lt],vi=st[Lt];pt?pe(vi,pt):(ze=vi,ce(),ze=""),Lt++}}function me(Me,st){return Me.scope&&typeof Me.scope=="string"&&Ge.openNode(ke.classNameAliases[Me.scope]||Me.scope),Me.beginScope&&(Me.beginScope._wrap?(pe(ze,ke.classNameAliases[Me.beginScope._wrap]||Me.beginScope._wrap),ze=""):Me.beginScope._multi&&(Te(Me.beginScope,st),ze="")),Fe=Object.create(Me,{parent:{value:Fe}}),Fe}function Ie(Me,st,Lt){let Ht=M(Me.endRe,Lt);if(Ht){if(Me["on:end"]){const pt=new e(Me);Me["on:end"](st,pt),pt.isMatchIgnored&&(Ht=!1)}if(Ht){for(;Me.endsParent&&Me.parent;)Me=Me.parent;return Me}}if(Me.endsWithParent)return Ie(Me.parent,st,Lt)}function lt(Me){return Fe.matcher.regexIndex===0?(ze+=Me[0],1):(It=!0,0)}function G(Me){const st=Me[0],Lt=Me.rule,Ht=new e(Lt),pt=[Lt.__beforeBegin,Lt["on:begin"]];for(const vi of pt)if(vi&&(vi(Me,Ht),Ht.isMatchIgnored))return lt(st);return Lt.skip?ze+=st:(Lt.excludeBegin&&(ze+=st),ae(),!Lt.returnBegin&&!Lt.excludeBegin&&(ze=st)),me(Lt,Me),Lt.returnBegin?0:st.length}function re(Me){const st=Me[0],Lt=H.substring(Me.index),Ht=Ie(Fe,Me,Lt);if(!Ht)return Ai;const pt=Fe;Fe.endScope&&Fe.endScope._wrap?(ae(),pe(st,Fe.endScope._wrap)):Fe.endScope&&Fe.endScope._multi?(ae(),Te(Fe.endScope,Me)):pt.skip?ze+=st:(pt.returnEnd||pt.excludeEnd||(ze+=st),ae(),pt.excludeEnd&&(ze=st));do Fe.scope&&Ge.closeNode(),!Fe.skip&&!Fe.subLanguage&&(Je+=Fe.relevance),Fe=Fe.parent;while(Fe!==Ht.parent);return Ht.starts&&me(Ht.starts,Me),pt.returnEnd?0:st.length}function Ne(){const Me=[];for(let st=Fe;st!==ke;st=st.parent)st.scope&&Me.unshift(st.scope);Me.forEach(st=>Ge.openNode(st))}let it={};function Pe(Me,st){const Lt=st&&st[0];if(ze+=Me,Lt==null)return ae(),0;if(it.type==="begin"&&st.type==="end"&&it.index===st.index&&Lt===""){if(ze+=H.slice(st.index,st.index+1),!qt){const Ht=new Error(`0 width match regex (${F})`);throw Ht.languageName=F,Ht.badRule=it.rule,Ht}return 1}if(it=st,st.type==="begin")return G(st);if(st.type==="illegal"&&!K){const Ht=new Error('Illegal lexeme "'+Lt+'" for mode "'+(Fe.scope||"<unnamed>")+'"');throw Ht.mode=Fe,Ht}else if(st.type==="end"){const Ht=re(st);if(Ht!==Ai)return Ht}if(st.type==="illegal"&&Lt==="")return ze+=`
81
- `,1;if($e>1e5&&$e>st.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=Lt,Lt.length}const ke=Jt(F);if(!ke)throw Bi(se.replace("{}",F)),new Error('Unknown language: "'+F+'"');const Ct=Pi(ke);let vt="",Fe=le||Ct;const Dt={},Ge=new Le.__emitter(Le);Ne();let ze="",Je=0,bt=0,$e=0,It=!1;try{if(ke.__emitTokens)ke.__emitTokens(H,Ge);else{for(Fe.matcher.considerAll();;){$e++,It?It=!1:Fe.matcher.considerAll(),Fe.matcher.lastIndex=bt;const Me=Fe.matcher.exec(H);if(!Me)break;const st=H.substring(bt,Me.index),Lt=Pe(st,Me);bt=Me.index+Lt}Pe(H.substring(bt))}return Ge.finalize(),vt=Ge.toHTML(),{language:F,value:vt,relevance:Je,illegal:!1,_emitter:Ge,_top:Fe}}catch(Me){if(Me.message&&Me.message.includes("Illegal"))return{language:F,value:Xe(H),illegal:!0,relevance:0,_illegalBy:{message:Me.message,index:bt,context:H.slice(bt-100,bt+100),mode:Me.mode,resultSoFar:vt},_emitter:Ge};if(qt)return{language:F,value:Xe(H),illegal:!1,relevance:0,errorRaised:Me,_emitter:Ge,_top:Fe};throw Me}}function At(F){const H={value:Xe(F),illegal:!1,relevance:0,_top:Ee,_emitter:new Le.__emitter(Le)};return H._emitter.addText(F),H}function Ot(F,H){H=H||Le.languages||Object.keys(Ae);const K=At(F),le=H.filter(Jt).filter(Ke).map(ae=>ye(ae,F,!1));le.unshift(K);const Z=le.sort((ae,pe)=>{if(ae.relevance!==pe.relevance)return pe.relevance-ae.relevance;if(ae.language&&pe.language){if(Jt(ae.language).supersetOf===pe.language)return 1;if(Jt(pe.language).supersetOf===ae.language)return-1}return 0}),[J,ce]=Z,Qe=J;return Qe.secondBest=ce,Qe}function ri(F,H,K){const le=H&&qe[H]||K;F.classList.add("hljs"),F.classList.add(`language-${le}`)}function oi(F){let H=null;const K=Oe(F);if(Y(K))return;if(_t("before:highlightElement",{el:F,language:K}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(Le.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),Le.throwUnescapedHTML))throw new yi("One of your code blocks includes unescaped HTML.",F.innerHTML);H=F;const le=H.textContent,Z=K?Ve(le,{language:K,ignoreIllegals:!0}):Ot(le);F.innerHTML=Z.value,F.dataset.highlighted="yes",ri(F,K,Z.language),F.result={language:Z.language,re:Z.relevance,relevance:Z.relevance},Z.secondBest&&(F.secondBest={language:Z.secondBest.language,relevance:Z.secondBest.relevance}),_t("after:highlightElement",{el:F,result:Z,text:le})}function xi(F){Le=St(Le,F)}const Ut=()=>{Ye(),an("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function mi(){Ye(),an("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let He=!1;function Ye(){function F(){Ye()}if(document.readyState==="loading"){He||window.addEventListener("DOMContentLoaded",F,!1),He=!0;return}document.querySelectorAll(Le.cssSelector).forEach(oi)}function Qt(F,H){let K=null;try{K=H(X)}catch(le){if(Bi("Language definition for '{}' could not be registered.".replace("{}",F)),qt)Bi(le);else throw le;K=Ee}K.name||(K.name=F),Ae[F]=K,K.rawDefinition=H.bind(null,X),K.aliases&&fe(K.aliases,{languageName:F})}function Gt(F){delete Ae[F];for(const H of Object.keys(qe))qe[H]===F&&delete qe[H]}function gi(){return Object.keys(Ae)}function Jt(F){return F=(F||"").toLowerCase(),Ae[F]||Ae[qe[F]]}function fe(F,{languageName:H}){typeof F=="string"&&(F=[F]),F.forEach(K=>{qe[K.toLowerCase()]=H})}function Ke(F){const H=Jt(F);return H&&!H.disableAutodetect}function ot(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=H=>{F["before:highlightBlock"](Object.assign({block:H.el},H))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=H=>{F["after:highlightBlock"](Object.assign({block:H.el},H))})}function rt(F){ot(F),nt.push(F)}function ht(F){const H=nt.indexOf(F);H!==-1&&nt.splice(H,1)}function _t(F,H){const K=F;nt.forEach(function(le){le[K]&&le[K](H)})}function Xt(F){return an("10.7.0","highlightBlock will be removed entirely in v12.0"),an("10.7.0","Please use highlightElement now."),oi(F)}Object.assign(X,{highlight:Ve,highlightAuto:Ot,highlightAll:Ye,highlightElement:oi,highlightBlock:Xt,configure:xi,initHighlighting:Ut,initHighlightingOnLoad:mi,registerLanguage:Qt,unregisterLanguage:Gt,listLanguages:gi,getLanguage:Jt,registerAliases:fe,autoDetection:Ke,inherit:St,addPlugin:rt,removePlugin:ht}),X.debugMode=function(){qt=!1},X.safeMode=function(){qt=!0},X.versionString=Qi,X.regex={concat:y,lookahead:p,either:A,optional:b,anyNumberOfTimes:C};for(const F in Ze)typeof Ze[F]=="object"&&o(Ze[F]);return Object.assign(X,Ze),X},Ii=fi({});return Ii.newInstance=()=>fi({}),$C=Ii,Ii.HighlightJS=Ii,Ii.default=Ii,$C}var XU=ZU();const Rv=cS(XU),gA="[A-Za-z$_][0-9A-Za-z$_]*",YU=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],QU=["true","false","null","undefined","NaN","Infinity"],SF=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],DF=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],AF=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],JU=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],eq=[].concat(AF,SF,DF);function kF(o){const e=o.regex,t=(xe,{after:et})=>{const We="</"+xe[0].slice(1);return xe.input.indexOf(We,et)!==-1},i=gA,n={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(xe,et)=>{const We=xe[0].length+xe.index,_e=xe.input[We];if(_e==="<"||_e===","){et.ignoreMatch();return}_e===">"&&(t(xe,{after:We})||et.ignoreMatch());let dt;const Wt=xe.input.substring(We);if(dt=Wt.match(/^\s*=/)){et.ignoreMatch();return}if((dt=Wt.match(/^\s+extends\s+/))&&dt.index===0){et.ignoreMatch();return}}},a={$pattern:gA,keyword:YU,literal:QU,built_in:eq,"variable.language":JU},d="[0-9](_?[0-9])*",u=`\\.(${d})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${d})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,p],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,p]},P={className:"comment",variants:[o.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]},M=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,C,b,y,w,{match:/\$\d+/},g];p.contains=M.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(M)});const R=[].concat(P,p.contains),T=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(R)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:T},W={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...SF,...DF]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function he(xe){return e.concat("(?!",xe.join("|"),")")}const De={match:e.concat(/\b/,he([...AF,"super","import"].map(xe=>`${xe}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},Se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",Re={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,C,b,y,w,P,{match:/\$\d+/},g,Q,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Re,{begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[P,o.REGEXP_MODE,{className:"function",begin:Se,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:s},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,o.inherit(o.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},oe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},De,te,W,ge,{match:/\$[(.]/}]}}function dS(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Zu=dS();function BF(o){Zu=o}var cd={exec:()=>null};function Ch(o){let e=[];return t=>{let i=Math.max(0,Math.min(3,t-1)),n=e[i];return n||(n=o(i),e[i]=n),n}}function Gn(o,e=""){let t=typeof o=="string"?o:o.source,i={replace:(n,s)=>{let r=typeof s=="string"?s:s.source;return r=r.replace(bo.caret,"$1"),t=t.replace(n,r),i},getRegex:()=>new RegExp(t,e)};return i}var tq=((o="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+o)}catch{return!1}})(),bo={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ch(o=>new RegExp(`^ {0,${o}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ch(o=>new RegExp(`^ {0,${o}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}#`)),htmlBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}>`))},iq=/^(?:[ \t]*(?:\n|$))+/,nq=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sq=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qp=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oq=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,uS=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,FF=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,LF=Gn(FF).replace(/bull/g,uS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),rq=Gn(FF).replace(/bull/g,uS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),hS=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,aq=/^[^\n]+/,fS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lq=Gn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fS).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cq=Gn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,uS).getRegex(),kb="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",gS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dq=Gn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",gS).replace("tag",kb).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IF=Gn(hS).replace("hr",qp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kb).getRegex(),uq=Gn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",IF).getRegex(),pS={blockquote:uq,code:nq,def:lq,fences:sq,heading:oq,hr:qp,html:dq,lheading:LF,list:cq,newline:iq,paragraph:IF,table:cd,text:aq},pA=Gn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kb).getRegex(),hq={...pS,lheading:rq,table:pA,paragraph:Gn(hS).replace("hr",qp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pA).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kb).getRegex()},fq={...pS,html:Gn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gS).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gn(hS).replace("hr",qp).replace("heading",` *#{1,6} *[^
81
+ `,1;if($e>1e5&&$e>st.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=Lt,Lt.length}const ke=Jt(F);if(!ke)throw Bi(se.replace("{}",F)),new Error('Unknown language: "'+F+'"');const bt=Pi(ke);let vt="",Fe=le||bt;const Dt={},Ge=new Le.__emitter(Le);Ne();let ze="",Je=0,Ct=0,$e=0,It=!1;try{if(ke.__emitTokens)ke.__emitTokens(H,Ge);else{for(Fe.matcher.considerAll();;){$e++,It?It=!1:Fe.matcher.considerAll(),Fe.matcher.lastIndex=Ct;const Me=Fe.matcher.exec(H);if(!Me)break;const st=H.substring(Ct,Me.index),Lt=Pe(st,Me);Ct=Me.index+Lt}Pe(H.substring(Ct))}return Ge.finalize(),vt=Ge.toHTML(),{language:F,value:vt,relevance:Je,illegal:!1,_emitter:Ge,_top:Fe}}catch(Me){if(Me.message&&Me.message.includes("Illegal"))return{language:F,value:Xe(H),illegal:!0,relevance:0,_illegalBy:{message:Me.message,index:Ct,context:H.slice(Ct-100,Ct+100),mode:Me.mode,resultSoFar:vt},_emitter:Ge};if(qt)return{language:F,value:Xe(H),illegal:!1,relevance:0,errorRaised:Me,_emitter:Ge,_top:Fe};throw Me}}function At(F){const H={value:Xe(F),illegal:!1,relevance:0,_top:Ee,_emitter:new Le.__emitter(Le)};return H._emitter.addText(F),H}function Ot(F,H){H=H||Le.languages||Object.keys(Ae);const K=At(F),le=H.filter(Jt).filter(Ke).map(ae=>ye(ae,F,!1));le.unshift(K);const Z=le.sort((ae,pe)=>{if(ae.relevance!==pe.relevance)return pe.relevance-ae.relevance;if(ae.language&&pe.language){if(Jt(ae.language).supersetOf===pe.language)return 1;if(Jt(pe.language).supersetOf===ae.language)return-1}return 0}),[J,ce]=Z,Qe=J;return Qe.secondBest=ce,Qe}function ri(F,H,K){const le=H&&qe[H]||K;F.classList.add("hljs"),F.classList.add(`language-${le}`)}function oi(F){let H=null;const K=Oe(F);if(Y(K))return;if(_t("before:highlightElement",{el:F,language:K}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(Le.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),Le.throwUnescapedHTML))throw new yi("One of your code blocks includes unescaped HTML.",F.innerHTML);H=F;const le=H.textContent,Z=K?Ve(le,{language:K,ignoreIllegals:!0}):Ot(le);F.innerHTML=Z.value,F.dataset.highlighted="yes",ri(F,K,Z.language),F.result={language:Z.language,re:Z.relevance,relevance:Z.relevance},Z.secondBest&&(F.secondBest={language:Z.secondBest.language,relevance:Z.secondBest.relevance}),_t("after:highlightElement",{el:F,result:Z,text:le})}function xi(F){Le=St(Le,F)}const Ut=()=>{Ye(),an("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function mi(){Ye(),an("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let He=!1;function Ye(){function F(){Ye()}if(document.readyState==="loading"){He||window.addEventListener("DOMContentLoaded",F,!1),He=!0;return}document.querySelectorAll(Le.cssSelector).forEach(oi)}function Qt(F,H){let K=null;try{K=H(X)}catch(le){if(Bi("Language definition for '{}' could not be registered.".replace("{}",F)),qt)Bi(le);else throw le;K=Ee}K.name||(K.name=F),Ae[F]=K,K.rawDefinition=H.bind(null,X),K.aliases&&fe(K.aliases,{languageName:F})}function Gt(F){delete Ae[F];for(const H of Object.keys(qe))qe[H]===F&&delete qe[H]}function gi(){return Object.keys(Ae)}function Jt(F){return F=(F||"").toLowerCase(),Ae[F]||Ae[qe[F]]}function fe(F,{languageName:H}){typeof F=="string"&&(F=[F]),F.forEach(K=>{qe[K.toLowerCase()]=H})}function Ke(F){const H=Jt(F);return H&&!H.disableAutodetect}function ot(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=H=>{F["before:highlightBlock"](Object.assign({block:H.el},H))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=H=>{F["after:highlightBlock"](Object.assign({block:H.el},H))})}function rt(F){ot(F),nt.push(F)}function ht(F){const H=nt.indexOf(F);H!==-1&&nt.splice(H,1)}function _t(F,H){const K=F;nt.forEach(function(le){le[K]&&le[K](H)})}function Xt(F){return an("10.7.0","highlightBlock will be removed entirely in v12.0"),an("10.7.0","Please use highlightElement now."),oi(F)}Object.assign(X,{highlight:Ve,highlightAuto:Ot,highlightAll:Ye,highlightElement:oi,highlightBlock:Xt,configure:xi,initHighlighting:Ut,initHighlightingOnLoad:mi,registerLanguage:Qt,unregisterLanguage:Gt,listLanguages:gi,getLanguage:Jt,registerAliases:fe,autoDetection:Ke,inherit:St,addPlugin:rt,removePlugin:ht}),X.debugMode=function(){qt=!1},X.safeMode=function(){qt=!0},X.versionString=Qi,X.regex={concat:y,lookahead:p,either:A,optional:b,anyNumberOfTimes:C};for(const F in Ze)typeof Ze[F]=="object"&&o(Ze[F]);return Object.assign(X,Ze),X},Ii=fi({});return Ii.newInstance=()=>fi({}),$C=Ii,Ii.HighlightJS=Ii,Ii.default=Ii,$C}var XU=ZU();const Rv=cS(XU),gA="[A-Za-z$_][0-9A-Za-z$_]*",YU=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],QU=["true","false","null","undefined","NaN","Infinity"],SF=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],DF=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],AF=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],JU=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],eq=[].concat(AF,SF,DF);function kF(o){const e=o.regex,t=(xe,{after:et})=>{const We="</"+xe[0].slice(1);return xe.input.indexOf(We,et)!==-1},i=gA,n={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(xe,et)=>{const We=xe[0].length+xe.index,_e=xe.input[We];if(_e==="<"||_e===","){et.ignoreMatch();return}_e===">"&&(t(xe,{after:We})||et.ignoreMatch());let dt;const Wt=xe.input.substring(We);if(dt=Wt.match(/^\s*=/)){et.ignoreMatch();return}if((dt=Wt.match(/^\s+extends\s+/))&&dt.index===0){et.ignoreMatch();return}}},a={$pattern:gA,keyword:YU,literal:QU,built_in:eq,"variable.language":JU},d="[0-9](_?[0-9])*",u=`\\.(${d})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${d})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,p],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,p]},P={className:"comment",variants:[o.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]},M=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,C,b,y,w,{match:/\$\d+/},g];p.contains=M.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(M)});const R=[].concat(P,p.contains),T=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(R)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:T},W={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...SF,...DF]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function he(xe){return e.concat("(?!",xe.join("|"),")")}const De={match:e.concat(/\b/,he([...AF,"super","import"].map(xe=>`${xe}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},Se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",Re={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,C,b,y,w,P,{match:/\$\d+/},g,Q,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Re,{begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[P,o.REGEXP_MODE,{className:"function",begin:Se,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:s},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,o.inherit(o.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},oe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},De,te,W,ge,{match:/\$[(.]/}]}}function dS(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Zu=dS();function BF(o){Zu=o}var cd={exec:()=>null};function Ch(o){let e=[];return t=>{let i=Math.max(0,Math.min(3,t-1)),n=e[i];return n||(n=o(i),e[i]=n),n}}function Gn(o,e=""){let t=typeof o=="string"?o:o.source,i={replace:(n,s)=>{let r=typeof s=="string"?s:s.source;return r=r.replace(bo.caret,"$1"),t=t.replace(n,r),i},getRegex:()=>new RegExp(t,e)};return i}var tq=((o="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+o)}catch{return!1}})(),bo={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ch(o=>new RegExp(`^ {0,${o}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ch(o=>new RegExp(`^ {0,${o}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}#`)),htmlBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Ch(o=>new RegExp(`^ {0,${o}}>`))},iq=/^(?:[ \t]*(?:\n|$))+/,nq=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sq=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qp=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oq=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,uS=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,FF=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,LF=Gn(FF).replace(/bull/g,uS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),rq=Gn(FF).replace(/bull/g,uS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),hS=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,aq=/^[^\n]+/,fS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lq=Gn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fS).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cq=Gn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,uS).getRegex(),kb="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",gS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dq=Gn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",gS).replace("tag",kb).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IF=Gn(hS).replace("hr",qp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kb).getRegex(),uq=Gn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",IF).getRegex(),pS={blockquote:uq,code:nq,def:lq,fences:sq,heading:oq,hr:qp,html:dq,lheading:LF,list:cq,newline:iq,paragraph:IF,table:cd,text:aq},pA=Gn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kb).getRegex(),hq={...pS,lheading:rq,table:pA,paragraph:Gn(hS).replace("hr",qp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pA).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kb).getRegex()},fq={...pS,html:Gn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gS).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gn(hS).replace("hr",qp).replace("heading",` *#{1,6} *[^
82
82
  ]`).replace("lheading",LF).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gq=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pq=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,PF=/^( {2,}|\\)\n(?!\s*$)/,xq=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,af=/[\p{P}\p{S}]/u,Bb=/[\s\p{P}\p{S}]/u,xS=/[^\s\p{P}\p{S}]/u,mq=Gn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bb).getRegex(),TF=/(?!~)[\p{P}\p{S}]/u,vq=/(?!~)[\s\p{P}\p{S}]/u,_q=/(?:[^\s\p{P}\p{S}]|~)/u,bq=Gn(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",tq?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),MF=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Cq=Gn(MF,"u").replace(/punct/g,af).getRegex(),Eq=Gn(MF,"u").replace(/punct/g,TF).getRegex(),RF="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yq=Gn(RF,"gu").replace(/notPunctSpace/g,xS).replace(/punctSpace/g,Bb).replace(/punct/g,af).getRegex(),wq=Gn(RF,"gu").replace(/notPunctSpace/g,_q).replace(/punctSpace/g,vq).replace(/punct/g,TF).getRegex(),Sq=Gn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xS).replace(/punctSpace/g,Bb).replace(/punct/g,af).getRegex(),Dq=Gn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,af).getRegex(),Aq="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",kq=Gn(Aq,"gu").replace(/notPunctSpace/g,xS).replace(/punctSpace/g,Bb).replace(/punct/g,af).getRegex(),Bq=Gn(/\\(punct)/,"gu").replace(/punct/g,af).getRegex(),Fq=Gn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Lq=Gn(gS).replace("(?:-->|$)","-->").getRegex(),Iq=Gn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Lq).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nv=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Pq=Gn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Nv).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NF=Gn(/^!?\[(label)\]\[(ref)\]/).replace("label",Nv).replace("ref",fS).getRegex(),OF=Gn(/^!?\[(ref)\](?:\[\])?/).replace("ref",fS).getRegex(),Tq=Gn("reflink|nolink(?!\\()","g").replace("reflink",NF).replace("nolink",OF).getRegex(),xA=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mS={_backpedal:cd,anyPunctuation:Bq,autolink:Fq,blockSkip:bq,br:PF,code:pq,del:cd,delLDelim:cd,delRDelim:cd,emStrongLDelim:Cq,emStrongRDelimAst:yq,emStrongRDelimUnd:Sq,escape:gq,link:Pq,nolink:OF,punctuation:mq,reflink:NF,reflinkSearch:Tq,tag:Iq,text:xq,url:cd},Mq={...mS,link:Gn(/^!?\[(label)\]\((.*?)\)/).replace("label",Nv).getRegex(),reflink:Gn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nv).getRegex()},pw={...mS,emStrongRDelimAst:wq,emStrongLDelim:Eq,delLDelim:Dq,delRDelim:kq,url:Gn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xA).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Gn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",xA).getRegex()},Rq={...pw,br:Gn(PF).replace("{2,}","*").getRegex(),text:Gn(pw.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Wx={normal:pS,gfm:hq,pedantic:fq},Pf={normal:mS,gfm:pw,breaks:Rq,pedantic:Mq},Nq={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mA=o=>Nq[o];function Ea(o,e){if(e){if(bo.escapeTest.test(o))return o.replace(bo.escapeReplace,mA)}else if(bo.escapeTestNoEncode.test(o))return o.replace(bo.escapeReplaceNoEncode,mA);return o}function vA(o){try{o=encodeURI(o).replace(bo.percentDecode,"%")}catch{return null}return o}function _A(o,e){var s;let t=o.replace(bo.findPipe,(r,a,d)=>{let u=!1,f=a;for(;--f>=0&&d[f]==="\\";)u=!u;return u?"|":" |"}),i=t.split(bo.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(bo.slashPipe,"|");return i}function Kl(o,e,t){let i=o.length;if(i===0)return"";let n=0;for(;n<i&&o.charAt(i-n-1)===e;)n++;return o.slice(0,i-n)}function bA(o){let e=o.split(`
83
83
  `),t=e.length-1;for(;t>=0&&bo.blankLine.test(e[t]);)t--;return e.length-t<=2?o:e.slice(0,t+1).join(`
84
84
  `)}function Oq(o,e){if(o.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<o.length;i++)if(o[i]==="\\")i++;else if(o[i]===e[0])t++;else if(o[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function Hq(o,e=0){let t=e,i="";for(let n of o)if(n===" "){let s=4-t%4;i+=" ".repeat(s),t+=s}else i+=n,t++;return i}function CA(o,e,t,i,n){let s=e.href,r=e.title||null,a=o[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:o[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:r,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,d}function Wq(o,e,t){let i=o.match(t.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
@@ -146,10 +146,10 @@ $2
146
146
  `),Ne=[],it=/```(\w*)\n([\s\S]*?)```/g;let Pe=0,ke;for(;(ke=it.exec(re))!==null;)ke.index>Pe&&Ne.push({type:"text",text:re.slice(Pe,ke.index)}),Ne.push({type:"code",lang:ke[1]||"text",text:ke[2].trimEnd()}),Pe=ke.index+ke[0].length;return Pe<re.length&&Ne.push({type:"text",text:re.slice(Pe)}),Ne}const Rt=15;function ut(G){return G.split(`
147
147
  `).length>Rt}function at(G){const re=new Set(c(M));re.has(G)?re.delete(G):re.add(G),m(M,re,!0)}function Ze(G,re){if(Vt(re))try{return Rv.highlight(G,{language:"javascript"}).value}catch{}return G.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Pt(G){return es.parse(G)}function ui(G){const re=G.replace(/(\n|^)(\/{2} @[a-z-]+:[^\n]+)\n(```\w*)\n/g,`$1$3
148
148
  $2
149
- `),Ne=[],it=/```(\w*)\n([\s\S]*?)```/g;let Pe=0,ke;for(;(ke=it.exec(re))!==null;)ke.index>Pe&&Ne.push({type:"text",text:re.slice(Pe,ke.index)}),Ne.push({type:"code",lang:ke[1]||"text",text:ke[2].trimEnd()}),Pe=ke.index+ke[0].length;const Ct=re.slice(Pe),vt=Ct.match(/```(\w*)\n([\s\S]*)$/);return vt?(vt.index>0&&Ne.push({type:"text",text:Ct.slice(0,vt.index)}),Ne.push({type:"code",lang:vt[1]||"text",text:vt[2]})):Ct&&Ne.push({type:"text",text:Ct}),Ne}function wt(G){navigator.clipboard.writeText(G).catch(()=>{})}function Ft(G,re=!1){var Ne;re&&t()&&m(A,t().path,!0),(Ne=e.onApply)==null||Ne.call(e,G)}function Vt(G){return!G||G==="js"||G==="javascript"}function zt(G){const re=G.match(/^\/\/ @new-file:\s*(\S+\.js)[ \t]*\n/);return re?{filename:re[1],code:G.slice(re[0].length)}:null}function Zt(G){return G>=1e9?`${(G/1e9).toFixed(1)} GB`:G>=1e6?`${(G/1e6).toFixed(0)} MB`:G>=1024?`${(G/1024).toFixed(1)} kB`:`${G} B`}async function mt(){if(m(R,!0),!(c(T)||c(V))){m(V,!0),m(W,"");try{m(T,await fw(c(w)||c(u).model),!0)}catch(G){m(W,G.message,!0)}m(V,!1)}}function Mi(G){const re=G.match(/\.([^.]+)$/);return re?re[1].toUpperCase():"?"}function Ri(G){switch(G){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"⇓";case"JSON":case"JSONC":return"{}";default:return G}}function Di(G){i(i().filter((re,Ne)=>Ne!==G))}function Ui(){Se.click()}async function ji(G){if(!(!G||G.length===0))for(const re of Array.from(G)){const Ne=await re.text();i([...i(),{name:re.name,content:Ne}])}}function Bi(G){const re=G.target;ji(re.files),re.value=""}function fn(G){var re;G.preventDefault(),m(ge,!1),ji(((re=G.dataTransfer)==null?void 0:re.files)??null)}function an(G){var re;(re=G.dataTransfer)!=null&&re.types.includes("Files")&&(G.preventDefault(),m(ge,!0))}function Zi(){m(ge,!1)}async function _n(){try{m(C,await J$(),!0)}catch{}}async function gt(){var re;if(c(n).length===0)return;const G=((re=c(n).find(Ne=>Ne.role==="user"))==null?void 0:re.content.slice(0,80))??c(p);try{await eU(c(p),G,c(n)),await _n()}catch{}}async function Yt(G){try{const re=await cA(G);m(n,re.messages,!0),m(p,G,!0),m(b,!1),m(d,"")}catch{}}async function Ci(G){try{await tU(G),await _n(),G===c(p)&&Wi()}catch{}}function Wi(){m(n,[],!0),m(d,""),m(p,g(),!0),m(b,!1)}Ks(async()=>{kt();try{const G=await cA(c(p));m(n,G.messages,!0)}catch{}await _n()});async function Pi(){const G=c(r).trim();if(!G||c(a))return;m(r,""),m(d,""),m(a,!0);const re={role:"user",content:G};m(n,[...c(n),re],!0),ne=new AbortController,m(Re,[],!0);try{await _F({messages:c(n),currentScript:c(tt),context:c(We),modelOverride:c(w)||void 0,extraFiles:i().length>0?i():void 0},Ne=>{m(s,(c(s)??"")+Ne)},ne.signal,Ne=>{m(Re,[...c(Re),Ne],!0)}),m(n,[...c(n),{role:"assistant",content:c(s)??"",toolEvents:c(Re).length>0?[...c(Re)]:void 0}],!0),m(Re,[],!0)}catch(Ne){if(Ne.name==="AbortError"){const it=c(s);it&&it.trim()&&m(n,[...c(n),{role:"assistant",content:it+`
149
+ `),Ne=[],it=/```(\w*)\n([\s\S]*?)```/g;let Pe=0,ke;for(;(ke=it.exec(re))!==null;)ke.index>Pe&&Ne.push({type:"text",text:re.slice(Pe,ke.index)}),Ne.push({type:"code",lang:ke[1]||"text",text:ke[2].trimEnd()}),Pe=ke.index+ke[0].length;const bt=re.slice(Pe),vt=bt.match(/```(\w*)\n([\s\S]*)$/);return vt?(vt.index>0&&Ne.push({type:"text",text:bt.slice(0,vt.index)}),Ne.push({type:"code",lang:vt[1]||"text",text:vt[2]})):bt&&Ne.push({type:"text",text:bt}),Ne}function wt(G){navigator.clipboard.writeText(G).catch(()=>{})}function Ft(G,re=!1){var Ne;re&&t()&&m(A,t().path,!0),(Ne=e.onApply)==null||Ne.call(e,G)}function Vt(G){return!G||G==="js"||G==="javascript"}function zt(G){const re=G.match(/^\/\/ @new-file:\s*(\S+\.js)[ \t]*\n/);return re?{filename:re[1],code:G.slice(re[0].length)}:null}function Zt(G){return G>=1e9?`${(G/1e9).toFixed(1)} GB`:G>=1e6?`${(G/1e6).toFixed(0)} MB`:G>=1024?`${(G/1024).toFixed(1)} kB`:`${G} B`}async function mt(){if(m(R,!0),!(c(T)||c(V))){m(V,!0),m(W,"");try{m(T,await fw(c(w)||c(u).model),!0)}catch(G){m(W,G.message,!0)}m(V,!1)}}function Mi(G){const re=G.match(/\.([^.]+)$/);return re?re[1].toUpperCase():"?"}function Ri(G){switch(G){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"⇓";case"JSON":case"JSONC":return"{}";default:return G}}function Di(G){i(i().filter((re,Ne)=>Ne!==G))}function Ui(){Se.click()}async function ji(G){if(!(!G||G.length===0))for(const re of Array.from(G)){const Ne=await re.text();i([...i(),{name:re.name,content:Ne}])}}function Bi(G){const re=G.target;ji(re.files),re.value=""}function fn(G){var re;G.preventDefault(),m(ge,!1),ji(((re=G.dataTransfer)==null?void 0:re.files)??null)}function an(G){var re;(re=G.dataTransfer)!=null&&re.types.includes("Files")&&(G.preventDefault(),m(ge,!0))}function Zi(){m(ge,!1)}async function _n(){try{m(C,await J$(),!0)}catch{}}async function gt(){var re;if(c(n).length===0)return;const G=((re=c(n).find(Ne=>Ne.role==="user"))==null?void 0:re.content.slice(0,80))??c(p);try{await eU(c(p),G,c(n)),await _n()}catch{}}async function Yt(G){try{const re=await cA(G);m(n,re.messages,!0),m(p,G,!0),m(b,!1),m(d,"")}catch{}}async function Ci(G){try{await tU(G),await _n(),G===c(p)&&Wi()}catch{}}function Wi(){m(n,[],!0),m(d,""),m(p,g(),!0),m(b,!1)}Ks(async()=>{kt();try{const G=await cA(c(p));m(n,G.messages,!0)}catch{}await _n()});async function Pi(){const G=c(r).trim();if(!G||c(a))return;m(r,""),m(d,""),m(a,!0);const re={role:"user",content:G};m(n,[...c(n),re],!0),ne=new AbortController,m(Re,[],!0);try{await _F({messages:c(n),currentScript:c(tt),context:c(We),modelOverride:c(w)||void 0,extraFiles:i().length>0?i():void 0},Ne=>{m(s,(c(s)??"")+Ne)},ne.signal,Ne=>{m(Re,[...c(Re),Ne],!0)}),m(n,[...c(n),{role:"assistant",content:c(s)??"",toolEvents:c(Re).length>0?[...c(Re)]:void 0}],!0),m(Re,[],!0)}catch(Ne){if(Ne.name==="AbortError"){const it=c(s);it&&it.trim()&&m(n,[...c(n),{role:"assistant",content:it+`
150
150
 
151
- *[stopped]*`,toolEvents:c(Re).length>0?[...c(Re)]:void 0}],!0)}else m(d,Ne.message,!0)}finally{ne=null,m(s,null),m(Re,[],!0),m(a,!1),gt()}}function Ti(){ne==null||ne.abort()}function Oi(G){G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),Pi())}function Qi(){Wi()}const yi=["Explain what this script does","Add error handling","Add a 30-minute schedule before sunrise","Write a new script that forwards MQTT topic A to topic B","Write a new script that turns lights on at sunset"];function Xe(G){m(r,G,!0),xe==null||xe.focus()}var St=PG(),Ai=yt(St),ki=_(Ai),fi=v(_(ki),2);{var Ii=G=>{var re=Vq(),Ne=_(re);{var it=Ct=>{var vt=_o();j(()=>O(vt,`${c(u).provider??""} · ${(c(w)||c(u).model)??""}`)),D(Ct,vt)},Pe=Ct=>{var vt=_o();j(()=>O(vt,`${c(u).provider??""} · pick a model below`)),D(Ct,vt)},ke=Ct=>{var vt=_o("Not configured");D(Ct,vt)};z(Ne,Ct=>{c(dt)?Ct(it):c(u).provider?Ct(Pe,1):Ct(ke,-1)})}j(()=>ln(re,"title",`Provider: ${c(u).provider??""}`)),D(G,re)};z(fi,G=>{c(u)&&G(Ii)})}var X=v(fi,2);let Ae;var qe=v(X,2);{var nt=G=>{var re=jq();$("click",re,Qi),D(G,re)};z(qe,G=>{c(n).length>0&&G(nt)})}var qt=v(ki,2);{var se=G=>{var re=Gq(),Ne=_(re),it=v(_(Ne),2),Pe=v(Ne,2);{var ke=vt=>{var Fe=$q();D(vt,Fe)},Ct=vt=>{var Fe=qq();ei(Fe,21,()=>c(C),Dt=>Dt.id,(Dt,Ge)=>{var ze=Uq();let Je;var bt=_(ze),$e=_(bt),It=v(bt,2);j(()=>{Je=Bt(ze,1,"history-item svelte-10ayso4",null,Je,{"history-active":c(Ge).id===c(p)}),ln(bt,"title",c(Ge).id),O($e,c(Ge).title||c(Ge).id)}),$("click",bt,()=>Yt(c(Ge).id)),$("click",It,()=>Ci(c(Ge).id)),D(Dt,ze)}),D(vt,Fe)};z(Pe,vt=>{c(C).length===0?vt(ke):vt(Ct,-1)})}$("click",it,Wi),D(G,re)};z(qt,G=>{c(b)&&G(se)})}var Ee=v(qt,2),Le=_(Ee);{var Y=G=>{var re=Kq();D(G,re)},Oe=G=>{var re=Yq(),Ne=_(re),it=_(Ne);{var Pe=vt=>{var Fe=Zq(),Dt=v(yt(Fe)),Ge=_(Dt);j(ze=>O(Ge,ze),[()=>t().path.split("/").pop()]),D(vt,Fe)},ke=vt=>{var Fe=_o("No script open. Ask a general she scripting question.");D(vt,Fe)};z(it,vt=>{t()?vt(Pe):vt(ke,-1)})}var Ct=v(Ne,2);ei(Ct,17,()=>yi,Ni,(vt,Fe)=>{var Dt=Xq(),Ge=_(Dt);j(()=>O(Ge,c(Fe))),$("click",Dt,()=>Xe(c(Fe))),D(vt,Dt)}),D(G,re)};z(Le,G=>{c(_e)?c(n).length===0&&c(s)===null&&G(Oe,1):G(Y)})}var Ve=v(Le,2);ei(Ve,17,()=>c(n),Ni,(G,re,Ne)=>{var it=rG(),Pe=_(it);{var ke=vt=>{var Fe=Qq(),Dt=_(Fe);j(()=>O(Dt,c(re).content)),D(vt,Fe)},Ct=vt=>{const Fe=Tt(()=>be(c(re).content));var Dt=oG(),Ge=yt(Dt);{var ze=bt=>{var $e=SA();ei($e,21,()=>c(re).toolEvents,Ni,(It,Me)=>{var st=Es(),Lt=yt(st);{var Ht=vi=>{var wi=yA(),qi=v(_(wi),2),Fi=_(qi),Gi=v(qi,2);{var Li=ii=>{var Xi=EA(),Ji=_(Xi);j(Ln=>O(Ji,Ln),[()=>Object.entries(c(Me).args).map(([Ln,Jn])=>`${Ln}=${JSON.stringify(Jn)}`).join(", ")]),D(ii,Xi)},ni=Tt(()=>c(Me).args&&Object.keys(c(Me).args).length>0);z(Gi,ii=>{c(ni)&&ii(Li)})}j(ii=>O(Fi,ii),[()=>c(Me).name.replace(/_/g," ")]),D(vi,wi)},pt=vi=>{var wi=wA(),qi=v(_(wi),2),Fi=_(qi);j(Gi=>O(Fi,Gi),[()=>c(Me).name.replace(/_/g," ")]),D(vi,wi)};z(Lt,vi=>{c(Me).type==="tool_call"?vi(Ht):vi(pt,-1)})}D(It,st)}),D(bt,$e)};z(Ge,bt=>{var $e;($e=c(re).toolEvents)!=null&&$e.length&&bt(ze)})}var Je=v(Ge,2);ei(Je,21,()=>c(Fe),Ni,(bt,$e,It)=>{var Me=Es(),st=yt(Me);{var Lt=pt=>{var vi=DA();ac(vi,()=>Pt(c($e).text),!0),D(pt,vi)},Ht=pt=>{const vi=Tt(()=>Vt(c($e).lang)?zt(c($e).text):null),wi=Tt(()=>c(vi)?c(vi).code:c($e).text),qi=Tt(()=>`${Ne}:${It}`),Fi=Tt(()=>ut(c(wi))),Gi=Tt(()=>c(M).has(c(qi)));var Li=sG(),ni=_(Li),ii=_(ni),Xi=_(ii),Ji=v(ii,2),Ln=_(Ji),Jn=v(Ln,2);{var Ss=Vn=>{var Ts=Jq();$("click",Ts,()=>e.onCreateFile(c(vi).filename,c(vi).code)),D(Vn,Ts)},as=Vn=>{var Ts=iG(),dr=yt(Ts),Or=v(dr,2);{var Za=ur=>{var ga=eG();D(ur,ga)},Xa=ur=>{var ga=tG();$("click",ga,()=>Ft(c($e).text,!0)),D(ur,ga)};z(Or,ur=>{c(P)?ur(Za):ur(Xa,-1)})}$("click",dr,()=>Ft(c($e).text)),D(Vn,Ts)},Bs=Tt(()=>Vt(c($e).lang)&&t());z(Jn,Vn=>{c(vi)&&e.onCreateFile?Vn(Ss):c(Bs)&&Vn(as,1)})}var kn=v(ni,2);let ss;var ps=_(kn),zi=_(ps);ac(zi,()=>Ze(c(wi),c($e).lang??""),!0);var Ys=v(ps,2);{var Pn=Vn=>{var Ts=nG(),dr=_(Ts);j(()=>O(dr,c(Gi)?"▲ collapse":"▼ expand")),$("click",Ts,()=>at(c(qi))),D(Vn,Ts)};z(Ys,Vn=>{c(Fi)&&Vn(Pn)})}j(()=>{O(Xi,c(vi)?`new: ${c(vi).filename}`:c($e).lang),ss=Bt(kn,1,"code-body svelte-10ayso4",null,ss,{collapsed:c(Fi)&&!c(Gi)})}),$("click",Ln,()=>wt(c(wi))),D(pt,Li)};z(st,pt=>{c($e).type==="text"?pt(Lt):pt(Ht,-1)})}D(bt,Me)}),D(vt,Dt)};z(Pe,vt=>{c(re).role==="user"?vt(ke):vt(Ct,-1)})}j(()=>Bt(it,1,`message ${c(re).role??""}`,"svelte-10ayso4")),D(G,it)});var ye=v(Ve,2);{var At=G=>{var re=SA();ei(re,21,()=>c(Re),Ni,(Ne,it)=>{var Pe=Es(),ke=yt(Pe);{var Ct=Fe=>{var Dt=yA(),Ge=v(_(Dt),2),ze=_(Ge),Je=v(Ge,2);{var bt=It=>{var Me=EA(),st=_(Me);j(Lt=>O(st,Lt),[()=>Object.entries(c(it).args).map(([Lt,Ht])=>`${Lt}=${JSON.stringify(Ht)}`).join(", ")]),D(It,Me)},$e=Tt(()=>c(it).args&&Object.keys(c(it).args).length>0);z(Je,It=>{c($e)&&It(bt)})}j(It=>O(ze,It),[()=>c(it).name.replace(/_/g," ")]),D(Fe,Dt)},vt=Fe=>{var Dt=wA(),Ge=v(_(Dt),2),ze=_(Ge);j(Je=>O(ze,Je),[()=>c(it).name.replace(/_/g," ")]),D(Fe,Dt)};z(ke,Fe=>{c(it).type==="tool_call"?Fe(Ct):Fe(vt,-1)})}D(Ne,Pe)}),D(G,re)};z(ye,G=>{c(Re).length>0&&G(At)})}var Ot=v(ye,2);{var ri=G=>{var re=aG(),Ne=_(re),it=_(Ne),Pe=_(it);j(()=>O(Pe,te[c(de)])),D(G,re)};z(Ot,G=>{c(a)&&c(s)===null&&c(Re).length===0&&G(ri)})}var oi=v(Ot,2);{var xi=G=>{var re=cG(),Ne=_(re);ei(Ne,21,()=>ui(c(s)),Ni,(it,Pe)=>{var ke=Es(),Ct=yt(ke);{var vt=Dt=>{var Ge=DA();ac(Ge,()=>Pt(c(Pe).text),!0),D(Dt,Ge)},Fe=Dt=>{var Ge=lG(),ze=_(Ge),Je=_(ze),bt=_(Je),$e=v(ze,2),It=_($e);ac(It,()=>Ze(c(Pe).text,c(Pe).lang??""),!0),j(()=>O(bt,c(Pe).lang)),D(Dt,Ge)};z(Ct,Dt=>{c(Pe).type==="text"?Dt(vt):Dt(Fe,-1)})}D(it,ke)}),D(G,re)};z(oi,G=>{c(s)!==null&&G(xi)})}us(Ee,G=>et=G,()=>et);var Ut=v(Ee,2);{var mi=G=>{var re=dG(),Ne=_(re);j(()=>O(Ne,c(d))),D(G,re)};z(Ut,G=>{c(d)&&G(mi)})}var He=v(Ut,2),Ye=_(He),Qt=_(Ye),Gt=v(Ye,2),gi=_(Gt),Jt=v(Gt,2),fe=_(Jt),Ke=v(fe);{var ot=G=>{const re=Tt(()=>Math.min(100,Math.round(c(Wt)/4/c(T).contextLength*100)));var Ne=uG(),it=_(Ne),Pe=v(_(it));j((ke,Ct)=>{ln(Ne,"title",`~${c(re)??""}% of ${ke??""} token context window used`),ln(Pe,"stroke",c(re)>80?"var(--fg-err)":c(re)>50?"var(--fg-warn)":"var(--fg-ok)"),ln(Pe,"stroke-dasharray",`${Ct??""} 31.4`)},[()=>c(T).contextLength.toLocaleString(),()=>(c(re)/100*31.4).toFixed(1)]),D(G,Ne)};z(Ke,G=>{var re;(re=c(T))!=null&&re.contextLength&&G(ot)})}var rt=v(He,2),ht=_(rt);{var _t=G=>{const re=Tt(()=>Mi(t().path.split("/").pop()??t().path));var Ne=hG();let it;var Pe=_(Ne),ke=_(Pe),Ct=v(Pe,2),vt=_(Ct),Fe=v(Ct,2),Dt=_(Fe);j((Ge,ze)=>{it=Bt(Ne,1,"file-chip svelte-10ayso4",null,it,{inactive:!c(oe)}),Bt(Pe,1,`badge badge-${Ge??""}`,"svelte-10ayso4"),O(ke,ze),O(vt,t().path),ln(Fe,"title",c(oe)?"Remove from context":"Re-add to context"),O(Dt,c(oe)?"×":"+")},[()=>c(re).toLowerCase(),()=>Ri(c(re))]),$("click",Fe,()=>m(oe,!c(oe))),D(G,Ne)};z(ht,G=>{t()&&G(_t)})}var Xt=v(ht,2);ei(Xt,17,i,Ni,(G,re,Ne)=>{const it=Tt(()=>Mi(c(re).name));var Pe=fG(),ke=_(Pe),Ct=_(ke),vt=v(ke,2),Fe=_(vt),Dt=v(vt,2);j((Ge,ze)=>{Bt(ke,1,`badge badge-${Ge??""}`,"svelte-10ayso4"),O(Ct,ze),O(Fe,c(re).name)},[()=>c(it).toLowerCase(),()=>Ri(c(it))]),$("click",Dt,()=>Di(Ne)),D(G,Pe)});var F=v(Xt,2),H=v(F,2);us(H,G=>Se=G,()=>Se);var K=v(rt,2);let le;var Z=_(K);let J;var ce=_(Z);us(ce,G=>xe=G,()=>xe);var Qe=v(Z,2);{var ae=G=>{var re=gG();$("click",re,Ti),D(G,re)},pe=G=>{var re=pG();j(Ne=>re.disabled=Ne,[()=>!c(r).trim()||!c(dt)]),$("click",re,Pi),D(G,re)};z(Qe,G=>{c(a)?G(ae):G(pe,-1)})}var Te=v(K,2);{var me=G=>{var re=bG(),Ne=_(re),it=_(Ne),Pe=v(Ne,2);{var ke=Dt=>{var Ge=mG();ei(Ge,21,()=>c(y),Ni,(ze,Je)=>{var bt=xG(),$e=_(bt),It={};j(()=>{O($e,c(Je)),It!==(It=c(Je))&&(bt.value=(bt.__value=c(Je))??"")}),D(ze,bt)}),j(()=>Ge.disabled=c(a)),Fs(Ge,()=>c(w),ze=>m(w,ze)),D(Dt,Ge)},Ct=Dt=>{var Ge=vG(),ze=_(Ge);j(()=>O(ze,c(w)||c(u).model)),D(Dt,Ge)};z(Pe,Dt=>{c(y).length>0?Dt(ke):Dt(Ct,-1)})}var vt=v(Pe,2);{var Fe=Dt=>{var Ge=_G();$("click",Ge,mt),D(Dt,Ge)};z(vt,Dt=>{c(u).provider==="ollama"&&Dt(Fe)})}j(()=>O(it,c(u).provider)),D(G,re)};z(Te,G=>{var re;(re=c(u))!=null&&re.provider&&(c(_e)||c(y).length>0)&&G(me)})}var Ie=v(Ai,2);{var lt=G=>{var re=IG(),Ne=_(re),it=_(Ne),Pe=_(it),ke=_(Pe),Ct=v(Pe,2),vt=v(it,2),Fe=_(vt);{var Dt=Je=>{var bt=CG();D(Je,bt)},Ge=Je=>{var bt=EG(),$e=_(bt);j(()=>O($e,c(W))),D(Je,bt)},ze=Je=>{var bt=LG(),$e=_(bt);{var It=ni=>{var ii=yG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).version)),D(ni,ii)};z($e,ni=>{c(T).version&&ni(It)})}var Me=v($e,2);{var st=ni=>{var ii=wG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.family)),D(ni,ii)};z(Me,ni=>{var ii;(ii=c(T).details)!=null&&ii.family&&ni(st)})}var Lt=v(Me,2);{var Ht=ni=>{var ii=SG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.parameter_size)),D(ni,ii)};z(Lt,ni=>{var ii;(ii=c(T).details)!=null&&ii.parameter_size&&ni(Ht)})}var pt=v(Lt,2);{var vi=ni=>{var ii=DG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.quantization_level)),D(ni,ii)};z(pt,ni=>{var ii;(ii=c(T).details)!=null&&ii.quantization_level&&ni(vi)})}var wi=v(pt,2);{var qi=ni=>{var ii=AG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.format)),D(ni,ii)};z(wi,ni=>{var ii;(ii=c(T).details)!=null&&ii.format&&ni(qi)})}var Fi=v(wi,2);{var Gi=ni=>{var ii=BG(),Xi=v(yt(ii),2);ei(Xi,21,()=>c(T).running,Ni,(Ji,Ln)=>{var Jn=kG(),Ss=_(Jn);j(as=>O(Ss,`${c(Ln).name??""} · ${as??""} VRAM`),[()=>Zt(c(Ln).size_vram)]),D(Ji,Jn)}),D(ni,ii)},Li=ni=>{var ii=FG();D(ni,ii)};z(Fi,ni=>{c(T).running&&c(T).running.length>0?ni(Gi):c(T).running!==null&&ni(Li,1)})}D(Je,bt)};z(Fe,Je=>{c(V)?Je(Dt):c(W)?Je(Ge,1):c(T)&&Je(ze,2)})}j(()=>{var Je;return O(ke,`Ollama · ${(c(w)||((Je=c(u))==null?void 0:Je.model))??""}`)}),$("click",re,()=>m(R,!1)),$("click",Ne,Je=>Je.stopPropagation()),$("click",Ct,()=>m(R,!1)),D(G,re)};z(Ie,G=>{c(R)&&G(lt)})}j(G=>{Ae=Bt(X,1,"icon-hdr-btn svelte-10ayso4",null,Ae,{active:c(b)}),O(fe,G),le=Bt(K,1,"input-row svelte-10ayso4",null,le,{"drag-over":c(ge)}),J=Bt(Z,1,"textarea-wrap svelte-10ayso4",null,J,{loading:c(a)}),ln(ce,"placeholder",c(dt)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":c(_e)?"Select a model above to start chatting":"AI not configured"),ce.disabled=c(a)||!c(dt)},[()=>Zt(c(Wt))]),$("click",X,()=>m(b,!c(b))),Cs(Qt,()=>c(he),G=>m(he,G)),Cs(gi,()=>c(De),G=>m(De,G)),$("click",F,Ui),$("change",H,Bi),fs("dragover",K,an),fs("dragleave",K,Zi),fs("drop",K,fn),$("keydown",ce,Oi),jt(ce,()=>c(r),G=>m(r,G)),D(o,St),js()}Zs(["click","change","keydown"]);const MG={OnOff:["onOff","globalSceneControl","onTime","offWaitTime"],LevelControl:["currentLevel","remainingTime","minLevel","maxLevel","currentFrequency","onOffTransitionTime","onLevel"],ColorControl:["currentHue","currentSaturation","remainingTime","currentX","currentY","colorTemperatureMireds","colorMode","colorTempPhysicalMinMireds","colorTempPhysicalMaxMireds"],BasicInformation:["vendorName","vendorId","productName","productId","nodeLabel","location","softwareVersion","softwareVersionString","serialNumber"],Identify:["identifyTime","identifyType"],Groups:["nameSupport"],OccupancySensing:["occupancy","occupancySensorType"],IlluminanceMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue","tolerance","lightSensorType"],TemperatureMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue","tolerance"],RelativeHumidityMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue","tolerance"],PressureMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue"],Thermostat:["localTemperature","outdoorTemperature","occupiedCoolingSetpoint","occupiedHeatingSetpoint","unoccupiedCoolingSetpoint","unoccupiedHeatingSetpoint","minHeatSetpointLimit","maxHeatSetpointLimit","systemMode","thermostatRunningMode","occupancy"],DoorLock:["lockState","lockType","actuatorEnabled","doorState"],WindowCovering:["type","currentPositionLiftPercent100ths","currentPositionTiltPercent100ths","operationalStatus","targetPositionLiftPercent100ths","targetPositionTiltPercent100ths","endProductType","mode"],FanControl:["fanMode","fanModeSequence","percentSetting","percentCurrent","speedMax","speedSetting","speedCurrent"],Descriptor:["deviceTypeList","serverList","clientList","partsList"],PowerSource:["status","order","description","wiredCurrentType","wiredMaximumCurrent","batteryVoltage","batteryPercentRemaining","batChargeLevel"],Switch:["numberOfPositions","currentPosition","multiPressMax"],BooleanState:["stateValue"],FlowMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue"]},RG={OnOff:["on","off","toggle"],LevelControl:["moveToLevel","move","step","stop","moveToLevelWithOnOff","moveWithOnOff","stepWithOnOff","stopWithOnOff"],ColorControl:["moveToHue","moveHue","stepHue","moveToSaturation","moveSaturation","stepSaturation","moveToHueAndSaturation","moveToColor","moveColor","stepColor","moveToColorTemperature","moveColorTemperature","stepColorTemperature"],Identify:["identify","triggerEffect"],Groups:["addGroup","viewGroup","getGroupMembership","removeGroup","removeAllGroups","addGroupIfIdentifying"],Thermostat:["setpointRaiseLower","setWeeklySchedule","getWeeklySchedule","clearWeeklySchedule"],DoorLock:["lockDoor","unlockDoor","unlockWithTimeout"],WindowCovering:["upOrOpen","downOrClose","stopMotion","goToLiftValue","goToLiftPercentage","goToTiltValue","goToTiltPercentage"],FanControl:[]};let vw=[],_w=[],bw=[];const Wv=new Map;let HF=[];const Cw=new Map,Ew=new Map;async function AA(){try{vw=(await pF()).map(e=>e.topic)}catch{}}async function kA(){try{const[o,e]=await Promise.all([uF(),hF()]);_w=o,bw=e}catch{}}async function BA(){try{const o=await gF();HF=o.map(e=>e.nodeId),Cw.clear(),Ew.clear();for(const e of o)e.name&&(Cw.set(e.nodeId,e.name),Ew.set(e.name,e.nodeId));await Promise.all(o.map(async e=>{if(!Wv.has(e.nodeId))try{Wv.set(e.nodeId,await gm(e.nodeId))}catch{}}))}catch{}}function NG(o){const e=/(?:she\.mqtt\.(?:sub|pub|get|set|link|age|getProp|or|and|max|min|timer)|she\.(?:getValue|setValue|getProp))\s*\([^)]*?['"]([^'"]*)\s*$/,t=o.match(e);if(t)return{type:"mqtt",prefix:t[1]};const i=/she\.db\.sub\s*\([^)]*?['"]([^'"]*)\s*$/,n=o.match(i);if(n)return{type:"db",prefix:n[1],includeViews:!0};const s=/she\.db\.(?:get|set|extend|delete|prop|query)\s*\([^)]*?['"]([^'"]*)\s*$/,r=o.match(s);if(r)return{type:"db",prefix:r[1],includeViews:!1};const a=/she\.matter\.(?:sub|get|send|on)\s*\(\s*(.*)\s*$/,d=o.match(a);if(d){const u=d[1],f=OG(u),g=HG(u);if(f===0)return{type:"matter-nodeId",prefix:g};if(f===1){const p=Eh(u,0);if(p)return{type:"matter-endpointId",nodeId:p}}if(f===2){const p=Eh(u,0),C=FA(u,1)??Eh(u,1);if(p&&C!==null)return{type:"matter-cluster",nodeId:p,endpointId:C}}if(f>=3){const p=Eh(u,0),C=FA(u,1)??Eh(u,1),b=Eh(u,2),y=/she\.matter\.send\s*\(/.test(o);if(p&&C!==null&&b)return{type:"matter-attr",nodeId:p,endpointId:C,cluster:b,isSend:y}}}return null}function OG(o){let e=0,t=0,i=!1,n="";for(const s of o){if(i){s===n&&(i=!1);continue}if(s==='"'||s==="'"){i=!0,n=s;continue}if(s==="("||s==="["||s==="{"){e++;continue}if(s===")"||s==="]"||s==="}"){e--;continue}s===","&&e===0&&t++}return t}function HG(o){const e=o.match(/['"]([^'"]*)\s*$/);return e?e[1]:""}function Eh(o,e){var s;const i=(s=WF(o)[e])==null?void 0:s.trim();if(!i)return null;const n=i.match(/^['"](.*)['"]$/);return n?n[1]:null}function FA(o,e){var s;const i=(s=WF(o)[e])==null?void 0:s.trim();if(!i)return null;const n=parseInt(i,10);return isNaN(n)?null:n}function WF(o){const e=[];let t="",i=0,n=!1,s="";for(const r of o){if(n){r===s&&(n=!1),t+=r;continue}if(r==='"'||r==="'"){n=!0,s=r,t+=r;continue}if(r==="("||r==="["||r==="{"){i++,t+=r;continue}if(r===")"||r==="]"||r==="}"){i--,t+=r;continue}if(r===","&&i===0){e.push(t),t="";continue}t+=r}return e.push(t),e}const Ou=ad.CompletionItemKind;function WG(o,e){return(e?vw.filter(i=>i.startsWith(e)):vw).map(i=>({label:i,kind:Ou.Value,insertText:i,range:o,detail:"MQTT topic",sortText:"0"+i}))}function zG(o,e,t){const i=t?[..._w,...bw]:_w;return(e?i.filter(s=>s.startsWith(e)):i).map(s=>({label:s,kind:Ou.Value,insertText:s,range:o,detail:bw.includes(s)?"sheDB view":"sheDB document",sortText:"0"+s}))}function VG(o,e){return HF.map(t=>{const i=Cw.get(t)??t;return e&&!i.startsWith(e)&&!t.startsWith(e)?null:{label:i,kind:Ou.Value,insertText:i,range:o,detail:i!==t?`Node ID: ${t}`:"Matter node",sortText:"0"+i}}).filter(Boolean)}function zF(o){return Ew.get(o)??o}function jG(o,e){if(typeof e=="number")return o.endpoints.find(i=>i.endpointId===e);const t=parseInt(e,10);return isNaN(t)?o.endpoints.find(i=>i.name===e):o.endpoints.find(i=>i.endpointId===t)}function $G(o,e){const t=Wv.get(zF(e));return t?t.endpoints.map(i=>{const n=i.name??String(i.endpointId),s=i.clusters.map(r=>r.name).join(", ");return{label:n,kind:Ou.Value,insertText:n,range:o,detail:i.name?`Endpoint ${i.endpointId} — ${s}`:`Clusters: ${s}`,sortText:"0"+String(i.endpointId).padStart(4,"0")}}):[]}function UG(o,e,t){const i=Wv.get(zF(e));if(!i)return[];const n=jG(i,t);return n?n.clusters.map(s=>({label:s.name,kind:Ou.Value,insertText:s.name,range:o,detail:"Matter cluster",sortText:"0"+s.name})):[]}function qG(o,e,t){return(t?RG[e]??[]:MG[e]??[]).map(n=>({label:n,kind:t?Ou.Function:Ou.Property,insertText:n,range:o,detail:t?`${e} command`:`${e} attribute`,sortText:"0"+n}))}let LA=!1;function GG(){LA||(LA=!0,AA(),kA(),BA(),setInterval(AA,15e3),setInterval(kA,1e4),setInterval(BA,6e4),ad.registerCompletionItemProvider("javascript",{triggerCharacters:["'",'"',"(",","," "],provideCompletionItems(o,e){const t=o.getValueInRange({startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=NG(t);if(!i)return null;const n=o.getWordUntilPosition(e),s=Math.max(t.lastIndexOf("'"),t.lastIndexOf('"')),r=s>=0?s+2:n.startColumn,a={startLineNumber:e.lineNumber,endLineNumber:e.lineNumber,startColumn:r,endColumn:e.column};switch(i.type){case"mqtt":return{suggestions:WG(a,i.prefix)};case"db":return{suggestions:zG(a,i.prefix,i.includeViews)};case"matter-nodeId":return{suggestions:VG(a,i.prefix)};case"matter-endpointId":return{suggestions:$G(a,i.nodeId)};case"matter-cluster":return{suggestions:UG(a,i.nodeId,i.endpointId)};case"matter-attr":return{suggestions:qG(a,i.cluster,i.isSend)};default:return null}}}))}var KG=B('<button class="svelte-1pyfjii">New file here</button> <button class="svelte-1pyfjii">New subfolder here</button> <hr class="svelte-1pyfjii"/> <button class="svelte-1pyfjii">Rename folder…</button> <button class="danger svelte-1pyfjii">Delete folder…</button>',1),ZG=B('<button class="svelte-1pyfjii">Show git history</button>'),XG=B('<button class="svelte-1pyfjii">Open</button> <button class="svelte-1pyfjii">Rename…</button> <button class="svelte-1pyfjii">Add to AI context</button> <!> <hr class="svelte-1pyfjii"/> <button class="danger svelte-1pyfjii">Delete</button>',1),YG=B('<div class="ctx-backdrop svelte-1pyfjii" role="presentation"></div> <div class="ctx-menu svelte-1pyfjii"><!></div>',1),QG=B('<div class="lib-tip-float svelte-1pyfjii">Library directory — files here are not auto-loaded as scripts</div>'),IA=B('<span class="git-mod svelte-1pyfjii" title="Uncommitted changes">M</span>'),JG=B('<ul class="tree-children svelte-1pyfjii"></ul>'),eK=B('<li class="tree-dir svelte-1pyfjii"><div role="treeitem" tabindex="-1" draggable="true"><button>›</button> <span role="button" tabindex="0"> </span> <!> <label class="lib-label svelte-1pyfjii" title="Library directory — files here are not auto-loaded as scripts"><input type="checkbox" class="svelte-1pyfjii"/> <span class="lib-checkmark svelte-1pyfjii"></span> <svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h8a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H3V3z"></path><line x1="3" y1="12" x2="13" y2="12"></line><line x1="6" y1="3" x2="6" y2="12"></line></svg></label> <label class="dis-label svelte-1pyfjii" title="Disable — scripts in this folder will not be executed"><input type="checkbox" class="svelte-1pyfjii"/> <span class="dis-checkmark svelte-1pyfjii"></span> <svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="8" cy="8" r="6"></circle><line x1="3.8" y1="12.2" x2="12.2" y2="3.8"></line></svg></label></div> <!></li>'),tK=B('<span class="dirty-dot svelte-1pyfjii">●</span>'),iK=B('<span class="run-dot svelte-1pyfjii" title="Running">●</span>'),nK=B('<span class="err-dot svelte-1pyfjii">●</span>'),sK=B('<label><input type="checkbox" class="svelte-1pyfjii"/> <span class="dis-checkmark svelte-1pyfjii"></span> <svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="8" cy="8" r="6"></circle><line x1="3.8" y1="12.2" x2="12.2" y2="3.8"></line></svg></label>'),oK=B('<span class="dis-spacer svelte-1pyfjii"></span>'),rK=B('<li draggable="true"><div class="file-row svelte-1pyfjii"><button><span> </span> <span class="fname svelte-1pyfjii"> </span> <!><!> <!> <!></button> <!></div></li>'),aK=B('<div class="err svelte-1pyfjii"> </div>'),lK=B('<button title="Case sensitive">Aa</button> <button title="Use regex">.*</button> <button title="Replace">⇄</button>',1),cK=B('<div class="search-input-row svelte-1pyfjii"><input placeholder="Replace with…" class="svelte-1pyfjii"/> <button class="svelte-1pyfjii"> </button></div>'),dK=B('<div class="search-status svelte-1pyfjii">Searching…</div>'),uK=B('<div class="search-status search-err svelte-1pyfjii"> </div>'),hK=B('<div class="search-status svelte-1pyfjii">No results.</div>'),fK=B('<div class="search-status search-trunc svelte-1pyfjii">Showing first 500 matches.</div>'),gK=B('<button class="search-match-row svelte-1pyfjii"><span class="search-lnum svelte-1pyfjii"> </span> <span class="search-preview svelte-1pyfjii"> </span></button>'),pK=B('<div class="search-file-group svelte-1pyfjii"><button class="search-file-btn svelte-1pyfjii"><span class="search-fname svelte-1pyfjii"> </span> <span class="search-fcount svelte-1pyfjii"> </span></button> <!></div>'),UC=B("<!> <!>",1),xK=B('<div class="search-status svelte-1pyfjii">No files found.</div>'),mK=B('<div class="search-status search-trunc svelte-1pyfjii">Showing first 200 results.</div>'),vK=B('<button class="search-match-row search-file-result svelte-1pyfjii"><span class="search-preview svelte-1pyfjii"> </span></button>'),_K=B('<label class="replace-item svelte-1pyfjii"><input type="checkbox"/> <span class="replace-item-path svelte-1pyfjii"> </span> <span class="replace-item-n svelte-1pyfjii"> </span></label>'),bK=B('<div class="replace-confirm svelte-1pyfjii"><div class="replace-confirm-hdr svelte-1pyfjii"><span> </span> <div class="replace-confirm-btns svelte-1pyfjii"><button class="svelte-1pyfjii">Apply</button> <button class="svelte-1pyfjii">Cancel</button></div></div> <div class="replace-confirm-list svelte-1pyfjii"></div></div>'),CK=B('<div class="search-panel svelte-1pyfjii"><div class="search-mode-bar svelte-1pyfjii"><button>Text</button> <button>Files</button> <button class="search-close-btn svelte-1pyfjii" title="Close">×</button></div> <div class="search-input-row svelte-1pyfjii"><input class="svelte-1pyfjii"/> <!></div> <!> <div class="search-results svelte-1pyfjii"><!></div> <!></div>'),EK=B('<div class="history-empty svelte-1pyfjii">Loading…</div>'),yK=B('<div class="history-empty svelte-1pyfjii">No commits found.</div>'),wK=B('<button class="history-row svelte-1pyfjii"><span class="history-subject svelte-1pyfjii"> </span> <span class="history-meta svelte-1pyfjii"> </span></button>'),SK=B('<button class="history-load-more svelte-1pyfjii"> </button>'),DK=B('<div class="history-panel svelte-1pyfjii"><div class="history-resize-handle svelte-1pyfjii" role="separator"></div> <div class="history-hdr svelte-1pyfjii"><span class="history-title svelte-1pyfjii"> </span> <button class="history-close svelte-1pyfjii">✕</button></div> <div class="history-body svelte-1pyfjii"><!></div></div>'),AK=B('<span class="tab-dirty svelte-1pyfjii">●</span>'),kK=B('<div role="tab" tabindex="0"><span class="tab-label svelte-1pyfjii"> </span> <!> <button class="tab-close svelte-1pyfjii" title="Close">×</button></div>'),BK=B('<div class="tab-bar-wrap svelte-1pyfjii"><button class="tab-scroll-btn svelte-1pyfjii" aria-label="Scroll tabs left">‹</button> <div class="tab-bar svelte-1pyfjii" role="tablist"></div> <button class="tab-scroll-btn svelte-1pyfjii" aria-label="Scroll tabs right">›</button></div>'),FK=B('<li class="changes-item svelte-1pyfjii"><input type="checkbox" class="changes-check svelte-1pyfjii"/> <span class="changes-status svelte-1pyfjii"> </span> <span class="changes-file svelte-1pyfjii"> </span></li>'),LK=B('<div class="changes-err svelte-1pyfjii"> </div>'),IK=B('<div class="changes-backdrop svelte-1pyfjii" role="presentation"></div> <div class="changes-popup svelte-1pyfjii"><div class="changes-popup-hdr svelte-1pyfjii">Uncommitted changes</div> <ul class="changes-list svelte-1pyfjii"></ul> <div class="changes-commit-row svelte-1pyfjii"><input class="changes-msg-input svelte-1pyfjii" type="text" placeholder="Commit message…"/> <button class="changes-commit-btn svelte-1pyfjii"> </button></div> <!></div>',1),PK=B('<div class="changes-wrap svelte-1pyfjii"><button class="git-changes svelte-1pyfjii"> </button> <!></div>'),TK=B('<div class="changes-backdrop svelte-1pyfjii" role="presentation"></div> <div class="changes-popup svelte-1pyfjii"><div class="changes-popup-hdr svelte-1pyfjii"> </div> <div class="changes-commit-row svelte-1pyfjii"><button class="changes-commit-btn svelte-1pyfjii">Push</button></div></div>',1),MK=B('<div class="changes-wrap svelte-1pyfjii"><button class="git-ahead svelte-1pyfjii"> </button> <!></div>'),RK=B('<span class="git-behind svelte-1pyfjii"> </span>'),NK=B('<span class="git-status svelte-1pyfjii"><span class="git-branch svelte-1pyfjii"> </span> <!> <!> <!></span>'),OK=B('<div class="split-backdrop svelte-1pyfjii" role="presentation"></div> <div class="split-menu svelte-1pyfjii"><button class="svelte-1pyfjii">Save</button> <button class="svelte-1pyfjii">Save &amp; Commit</button></div>',1),HK=B('<button class="danger svelte-1pyfjii">Delete</button>'),WK=B(`<div class="welcome svelte-1pyfjii"><div class="welcome-inner svelte-1pyfjii"><div class="welcome-logo svelte-1pyfjii">she</div> <p class="welcome-sub svelte-1pyfjii">Smart Home Engine — a scriptable smart home automation engine</p> <div class="welcome-hint svelte-1pyfjii"><strong>Quick start:</strong> click <kbd class="svelte-1pyfjii">+ File</kbd> in the sidebar to create your first script,
152
- or click an existing file to open it. Scripts run in a sandboxed VM with access to the <code class="svelte-1pyfjii">she</code> object for MQTT, scheduling, and more.</div> <div class="welcome-links svelte-1pyfjii"><a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-1pyfjii">GitHub</a> <span class="svelte-1pyfjii">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/sandbox-api.md" target="_blank" rel="noopener" class="svelte-1pyfjii">API reference</a> <span class="svelte-1pyfjii">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/README.md" target="_blank" rel="noopener" class="svelte-1pyfjii">README</a></div> <div class="welcome-shortcuts svelte-1pyfjii"><div class="welcome-shortcuts-title svelte-1pyfjii">Keyboard shortcuts</div> <div class="welcome-shortcuts-grid svelte-1pyfjii"><span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">S</kbd></span><span class="svelte-1pyfjii">Save</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">F</kbd></span><span class="svelte-1pyfjii">Find</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">H</kbd></span><span class="svelte-1pyfjii">Find &amp; Replace</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">G</kbd></span><span class="svelte-1pyfjii">Go to line</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">Z</kbd></span><span class="svelte-1pyfjii">Undo</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">Shift</kbd><kbd class="svelte-1pyfjii">Z</kbd></span><span class="svelte-1pyfjii">Redo</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">/</kbd></span><span class="svelte-1pyfjii">Toggle comment</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Alt</kbd><kbd class="svelte-1pyfjii">↑ / ↓</kbd></span><span class="svelte-1pyfjii">Move line up / down</span></div></div></div></div>`),zK=B('<button class="svelte-1pyfjii">Always accept in this session</button>'),VK=B('<button class="svelte-1pyfjii">Disable auto-accept</button>'),jK=B('<div class="split-backdrop svelte-1pyfjii" role="presentation"></div> <div class="split-menu svelte-1pyfjii"><!></div>',1),$K=B('<div class="diff-overlay svelte-1pyfjii"><div class="diff-bar svelte-1pyfjii"><span class="diff-title svelte-1pyfjii">Proposed changes — <em class="svelte-1pyfjii"> </em></span> <div class="diff-actions svelte-1pyfjii"><div class="split-wrap svelte-1pyfjii"><div class="split-btn accept-split svelte-1pyfjii"><button class="split-main svelte-1pyfjii"> </button> <button class="split-arrow svelte-1pyfjii" aria-label="Accept options">▾</button></div> <!></div> <button class="discard-btn svelte-1pyfjii">Discard</button></div></div> <div class="diff-container svelte-1pyfjii"></div></div>'),UK=B('<div class="history-diff-notice svelte-1pyfjii">Binary file — diff not available.</div>'),qK=B('<div class="diff-container svelte-1pyfjii"></div>'),GK=B('<div class="diff-overlay svelte-1pyfjii"><div class="diff-bar svelte-1pyfjii"><span class="diff-title svelte-1pyfjii">Commit <code> </code> → current — <em class="svelte-1pyfjii"> </em></span> <div class="diff-actions svelte-1pyfjii"><button class="discard-btn svelte-1pyfjii">Close</button></div></div> <!></div>'),KK=B('<div class="log-resize-handle svelte-1pyfjii" role="separator"></div>'),ZK=B('<span class="log-file svelte-1pyfjii"> </span>'),XK=B("<option> </option>"),YK=B('<select class="log-filter-level svelte-1pyfjii"></select> <input class="log-filter-text svelte-1pyfjii" type="search" placeholder="Filter…"/> <label class="log-filter-regex svelte-1pyfjii" title="Interpret filter as a regular expression"><input type="checkbox" class="svelte-1pyfjii"/> <span class="log-filter-checkmark svelte-1pyfjii"></span> Regex</label> <button class="log-clear svelte-1pyfjii">Clear</button>',1),QK=B('<div><span class="ts svelte-1pyfjii"> </span> <span class="lvl svelte-1pyfjii"> </span> <span class="msg svelte-1pyfjii"> </span></div>'),JK=B('<span class="log-empty svelte-1pyfjii">No log output for this script.</span>'),eZ=B('<div class="log-body svelte-1pyfjii"><!> <!></div>'),tZ=B('<div class="chat-resize-handle svelte-1pyfjii" role="separator"></div> <div class="chat-container svelte-1pyfjii"><!></div>',1),iZ=B('<!> <!> <!> <!> <div class="layout svelte-1pyfjii"><aside class="svelte-1pyfjii"><div class="toolbar svelte-1pyfjii"><button title="New script" class="svelte-1pyfjii">+ File</button> <button title="New folder" class="svelte-1pyfjii">+ Folder</button> <button title="Find in files / Find files (Ctrl+Shift+F)">&#x2315;</button> <button title="Refresh" class="refresh svelte-1pyfjii">↻</button></div> <!> <!> <ul class="tree svelte-1pyfjii"><li role="presentation"></li> <!></ul> <!></aside> <div class="sidebar-resize-handle svelte-1pyfjii" role="separator"></div> <div class="editor-area svelte-1pyfjii"><!> <div class="editor-toolbar svelte-1pyfjii"><span class="filename svelte-1pyfjii"> </span> <!> <div class="split-wrap svelte-1pyfjii"><div class="split-btn svelte-1pyfjii"><button class="split-main svelte-1pyfjii"> </button> <button class="split-arrow svelte-1pyfjii" aria-label="Save options">▾</button></div> <!></div> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button></div> <div class="editor-body svelte-1pyfjii"><div class="editor-left svelte-1pyfjii"><div class="editor-stack svelte-1pyfjii"><div class="editor-container svelte-1pyfjii"></div> <!> <!> <!></div> <div><!> <div class="log-header svelte-1pyfjii"><button class="log-toggle svelte-1pyfjii"> <!></button> <!></div> <!></div></div> <!></div></div></div>',1);function nZ(o,e){Vs(e,!0);let t=I(Ei([])),i=I(Ei({})),n=I(null),s=I(null),r=I(null),a=I(null),d=I(Ei([])),u=I(null),f=I(!1),g=I(""),p=I(!1),C=I(!0),b=I(null),y=I(!1),w=I(!1),A=I(null),P=I(Ei([])),M=I(!1),R=I(30),T=I(void 0),V=null,W=null,Q=null,ne=I(!1),de=I(""),te=I(!1),he=I(void 0),De=I(Ei(new Set));const oe=new Set;let ge=I(Ei(new Set)),Se=I(Ei([])),Re=I(!1),xe=I("text"),et=I(""),We=I(!1),_e=I(!1),dt=I(!1),Wt=I(""),tt=I(Ei([])),kt=I(Ei([])),be=I(!1),Rt=I(!1),ut=I(""),at=I(void 0),Ze=I(Ei([])),Pt=I(!1),ui=I(!1),wt=null,Ft=I(void 0),Vt=I(!1),zt=I(!1),Zt=null;function mt(){c(Ft)&&(m(Vt,c(Ft).scrollLeft>0),m(zt,c(Ft).scrollLeft+c(Ft).clientWidth<c(Ft).scrollWidth-1))}function Mi(q){var ue;(ue=c(Ft))==null||ue.scrollBy({left:q*200,behavior:"smooth"})}function Ri(q="text"){m(Re,!0),m(xe,q,!0),ul().then(()=>{var ue;return(ue=c(at))==null?void 0:ue.focus()})}function Di(){m(Re,!1),m(et,""),m(tt,[],!0),m(kt,[],!0),m(be,!1),m(ut,""),m(dt,!1),m(Pt,!1)}function Ui(){wt&&clearTimeout(wt),wt=setTimeout(ji,300)}async function ji(){const q=c(et).trim();if(!q){m(tt,[],!0),m(kt,[],!0),m(be,!1),m(ut,"");return}m(Rt,!0),m(ut,"");try{if(c(xe)==="files"){const ue=await nA(q,{mode:"files"});m(kt,ue.results,!0),m(be,ue.truncated,!0)}else{const ue=await nA(q,{regex:c(_e),caseSensitive:c(We)});m(tt,ue.results,!0),m(be,ue.truncated,!0)}}catch(ue){m(ut,ue.message||"Search failed",!0)}finally{m(Rt,!1)}}async function Bi(q,ue){await Ct(q),St&&(St.revealLineInCenter(ue.line),St.setPosition({lineNumber:ue.line,column:ue.col}),St.focus())}function fn(q){return q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function an(){if(!c(et).trim()||!c(tt).length)return;m(ui,!0);const q=[],ue="g"+(c(We)?"":"i");for(const ct of c(tt))try{const ft=await Nx(ct.path),je=c(_e)?new RegExp(c(et),ue):new RegExp(fn(c(et)),ue),Kt=ft.content.replace(je,c(Wt));Kt!==ft.content&&q.push({path:ct.path,checked:!0,original:ft.content,replaced:Kt,changes:ct.matches.length})}catch{}m(Ze,q,!0),m(ui,!1),m(Pt,!0)}async function Zi(){for(const q of c(Ze).filter(ue=>ue.checked))try{await Gl(q.path,q.replaced);const ue=c(d).find(ct=>ct.path===q.path);ue!=null&&ue.model&&(ue.model.setValue(q.replaced),ue.savedContent=q.replaced,ue.dirty=!1)}catch{}m(Pt,!1),await ji()}function _n(q){q.ctrlKey&&q.shiftKey&&q.key==="F"&&(q.preventDefault(),c(Re)&&c(xe)==="text"?Di():Ri("text"))}$n(()=>{c(Ft)&&(Zt==null||Zt.disconnect(),Zt=new ResizeObserver(mt),Zt.observe(c(Ft)),mt())});let gt=I("all"),Yt=I(""),Ci=I(!1);const Wi=["all","debug","info","warn","error"],Pi={debug:0,info:1,warn:2,error:3};function Ti(q){if(c(gt)!=="all"&&Pi[q.level]<Pi[c(gt)])return!1;if(!c(Yt))return!0;if(c(Ci))try{return new RegExp(c(Yt),"i").test(q.msg)}catch{}return q.msg.toLowerCase().includes(c(Yt).toLowerCase())}let Oi=I(null);function Qi(q){const ue=q.currentTarget.getBoundingClientRect();m(Oi,{x:ue.left,y:ue.top},!0)}function yi(){m(Oi,null)}let Xe,St,Ai,ki=!1,fi=null,Ii=null,X=!1,Ae=!1,qe=I(!1),nt=I(null),qt=I(!1),se=I(!1),Ee=I(void 0),Le=null,Y=null,Oe=null,Ve=I(Ei(parseInt(localStorage.getItem("she-scripts-sidebar-width")??"220",10))),ye=I(Ei(parseInt(localStorage.getItem("she-scripts-log-height")??"130",10))),At=I(Ei(parseInt(localStorage.getItem("she-scripts-chat-width")??"340",10))),Ot=I(Ei(parseInt(localStorage.getItem("she-scripts-history-height")??"220",10))),ri=!1,oi=0,xi=0,Ut=!1,mi=0,He=0,Ye=!1,Qt=0,Gt=0,gi=!1,Jt=0,fe=0;const Ke=Tt(()=>{var q;return c(u)&&c(ce)?{path:c(u),content:((q=c(ce).model)==null?void 0:q.getValue())??c(ce).savedContent}:null}),ot=Tt(()=>{var q;return new Set(((q=c(b))==null?void 0:q.changes.map(ue=>ue.file))??[])}),rt=Tt(()=>{const q=new Set;for(const ue of c(ot)){const ct=ue.split("/");for(let ft=1;ft<ct.length;ft++)q.add(ct.slice(0,ft).join("/"))}return q});let ht=I(!1),_t=I(!1),Xt=I(""),F=I(!1),H=I(""),K=I(Ei(new Set));async function le(){var q;if(!(!c(Xt).trim()||c(K).size===0)){m(F,!0),m(H,"");try{const ue=c(b).changes.filter(ct=>c(K).has(ct.file)).map(ct=>ct.file);if(ue.length===c(b).changes.length?await rA(c(Xt).trim()):await oA(ue,c(Xt).trim()),c(w))try{await Hx()}catch{}m(Xt,""),await Dt(),(q=c(b))!=null&&q.changes.length?m(K,new Set(c(b).changes.map(ct=>ct.file)),!0):m(ht,!1)}catch(ue){m(H,ue.message,!0)}finally{m(F,!1)}}}let Z,J,ce=Tt(()=>c(d).find(q=>q.path===c(u))??null);const Qe="she-tabs",ae="she-active-tab",pe="she-log-open",Te="she-chat-open";let me=wu(e,"active",3,!0);$n(()=>{Ae&&(localStorage.setItem(Qe,JSON.stringify(c(d).map(q=>q.path))),c(u)?localStorage.setItem(ae,c(u)):localStorage.removeItem(ae))}),$n(()=>{Ae&&localStorage.setItem(Te,String(c(qe)))}),$n(()=>{me()&&St&&St.layout()});const Ie=`
151
+ *[stopped]*`,toolEvents:c(Re).length>0?[...c(Re)]:void 0}],!0)}else m(d,Ne.message,!0)}finally{ne=null,m(s,null),m(Re,[],!0),m(a,!1),gt()}}function Ti(){ne==null||ne.abort()}function Oi(G){G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),Pi())}function Qi(){Wi()}const yi=["Explain what this script does","Add error handling","Add a 30-minute schedule before sunrise","Write a new script that forwards MQTT topic A to topic B","Write a new script that turns lights on at sunset"];function Xe(G){m(r,G,!0),xe==null||xe.focus()}var St=PG(),Ai=yt(St),ki=_(Ai),fi=v(_(ki),2);{var Ii=G=>{var re=Vq(),Ne=_(re);{var it=bt=>{var vt=_o();j(()=>O(vt,`${c(u).provider??""} · ${(c(w)||c(u).model)??""}`)),D(bt,vt)},Pe=bt=>{var vt=_o();j(()=>O(vt,`${c(u).provider??""} · pick a model below`)),D(bt,vt)},ke=bt=>{var vt=_o("Not configured");D(bt,vt)};z(Ne,bt=>{c(dt)?bt(it):c(u).provider?bt(Pe,1):bt(ke,-1)})}j(()=>ln(re,"title",`Provider: ${c(u).provider??""}`)),D(G,re)};z(fi,G=>{c(u)&&G(Ii)})}var X=v(fi,2);let Ae;var qe=v(X,2);{var nt=G=>{var re=jq();$("click",re,Qi),D(G,re)};z(qe,G=>{c(n).length>0&&G(nt)})}var qt=v(ki,2);{var se=G=>{var re=Gq(),Ne=_(re),it=v(_(Ne),2),Pe=v(Ne,2);{var ke=vt=>{var Fe=$q();D(vt,Fe)},bt=vt=>{var Fe=qq();ei(Fe,21,()=>c(C),Dt=>Dt.id,(Dt,Ge)=>{var ze=Uq();let Je;var Ct=_(ze),$e=_(Ct),It=v(Ct,2);j(()=>{Je=Bt(ze,1,"history-item svelte-10ayso4",null,Je,{"history-active":c(Ge).id===c(p)}),ln(Ct,"title",c(Ge).id),O($e,c(Ge).title||c(Ge).id)}),$("click",Ct,()=>Yt(c(Ge).id)),$("click",It,()=>Ci(c(Ge).id)),D(Dt,ze)}),D(vt,Fe)};z(Pe,vt=>{c(C).length===0?vt(ke):vt(bt,-1)})}$("click",it,Wi),D(G,re)};z(qt,G=>{c(b)&&G(se)})}var Ee=v(qt,2),Le=_(Ee);{var Y=G=>{var re=Kq();D(G,re)},Oe=G=>{var re=Yq(),Ne=_(re),it=_(Ne);{var Pe=vt=>{var Fe=Zq(),Dt=v(yt(Fe)),Ge=_(Dt);j(ze=>O(Ge,ze),[()=>t().path.split("/").pop()]),D(vt,Fe)},ke=vt=>{var Fe=_o("No script open. Ask a general she scripting question.");D(vt,Fe)};z(it,vt=>{t()?vt(Pe):vt(ke,-1)})}var bt=v(Ne,2);ei(bt,17,()=>yi,Ni,(vt,Fe)=>{var Dt=Xq(),Ge=_(Dt);j(()=>O(Ge,c(Fe))),$("click",Dt,()=>Xe(c(Fe))),D(vt,Dt)}),D(G,re)};z(Le,G=>{c(_e)?c(n).length===0&&c(s)===null&&G(Oe,1):G(Y)})}var Ve=v(Le,2);ei(Ve,17,()=>c(n),Ni,(G,re,Ne)=>{var it=rG(),Pe=_(it);{var ke=vt=>{var Fe=Qq(),Dt=_(Fe);j(()=>O(Dt,c(re).content)),D(vt,Fe)},bt=vt=>{const Fe=Tt(()=>be(c(re).content));var Dt=oG(),Ge=yt(Dt);{var ze=Ct=>{var $e=SA();ei($e,21,()=>c(re).toolEvents,Ni,(It,Me)=>{var st=Es(),Lt=yt(st);{var Ht=vi=>{var wi=yA(),qi=v(_(wi),2),Fi=_(qi),Gi=v(qi,2);{var Li=ii=>{var Xi=EA(),Ji=_(Xi);j(Ln=>O(Ji,Ln),[()=>Object.entries(c(Me).args).map(([Ln,Jn])=>`${Ln}=${JSON.stringify(Jn)}`).join(", ")]),D(ii,Xi)},ni=Tt(()=>c(Me).args&&Object.keys(c(Me).args).length>0);z(Gi,ii=>{c(ni)&&ii(Li)})}j(ii=>O(Fi,ii),[()=>c(Me).name.replace(/_/g," ")]),D(vi,wi)},pt=vi=>{var wi=wA(),qi=v(_(wi),2),Fi=_(qi);j(Gi=>O(Fi,Gi),[()=>c(Me).name.replace(/_/g," ")]),D(vi,wi)};z(Lt,vi=>{c(Me).type==="tool_call"?vi(Ht):vi(pt,-1)})}D(It,st)}),D(Ct,$e)};z(Ge,Ct=>{var $e;($e=c(re).toolEvents)!=null&&$e.length&&Ct(ze)})}var Je=v(Ge,2);ei(Je,21,()=>c(Fe),Ni,(Ct,$e,It)=>{var Me=Es(),st=yt(Me);{var Lt=pt=>{var vi=DA();ac(vi,()=>Pt(c($e).text),!0),D(pt,vi)},Ht=pt=>{const vi=Tt(()=>Vt(c($e).lang)?zt(c($e).text):null),wi=Tt(()=>c(vi)?c(vi).code:c($e).text),qi=Tt(()=>`${Ne}:${It}`),Fi=Tt(()=>ut(c(wi))),Gi=Tt(()=>c(M).has(c(qi)));var Li=sG(),ni=_(Li),ii=_(ni),Xi=_(ii),Ji=v(ii,2),Ln=_(Ji),Jn=v(Ln,2);{var Ss=Vn=>{var Ts=Jq();$("click",Ts,()=>e.onCreateFile(c(vi).filename,c(vi).code)),D(Vn,Ts)},as=Vn=>{var Ts=iG(),dr=yt(Ts),Or=v(dr,2);{var Za=ur=>{var ga=eG();D(ur,ga)},Xa=ur=>{var ga=tG();$("click",ga,()=>Ft(c($e).text,!0)),D(ur,ga)};z(Or,ur=>{c(P)?ur(Za):ur(Xa,-1)})}$("click",dr,()=>Ft(c($e).text)),D(Vn,Ts)},Bs=Tt(()=>Vt(c($e).lang)&&t());z(Jn,Vn=>{c(vi)&&e.onCreateFile?Vn(Ss):c(Bs)&&Vn(as,1)})}var kn=v(ni,2);let ss;var ps=_(kn),zi=_(ps);ac(zi,()=>Ze(c(wi),c($e).lang??""),!0);var Ys=v(ps,2);{var Pn=Vn=>{var Ts=nG(),dr=_(Ts);j(()=>O(dr,c(Gi)?"▲ collapse":"▼ expand")),$("click",Ts,()=>at(c(qi))),D(Vn,Ts)};z(Ys,Vn=>{c(Fi)&&Vn(Pn)})}j(()=>{O(Xi,c(vi)?`new: ${c(vi).filename}`:c($e).lang),ss=Bt(kn,1,"code-body svelte-10ayso4",null,ss,{collapsed:c(Fi)&&!c(Gi)})}),$("click",Ln,()=>wt(c(wi))),D(pt,Li)};z(st,pt=>{c($e).type==="text"?pt(Lt):pt(Ht,-1)})}D(Ct,Me)}),D(vt,Dt)};z(Pe,vt=>{c(re).role==="user"?vt(ke):vt(bt,-1)})}j(()=>Bt(it,1,`message ${c(re).role??""}`,"svelte-10ayso4")),D(G,it)});var ye=v(Ve,2);{var At=G=>{var re=SA();ei(re,21,()=>c(Re),Ni,(Ne,it)=>{var Pe=Es(),ke=yt(Pe);{var bt=Fe=>{var Dt=yA(),Ge=v(_(Dt),2),ze=_(Ge),Je=v(Ge,2);{var Ct=It=>{var Me=EA(),st=_(Me);j(Lt=>O(st,Lt),[()=>Object.entries(c(it).args).map(([Lt,Ht])=>`${Lt}=${JSON.stringify(Ht)}`).join(", ")]),D(It,Me)},$e=Tt(()=>c(it).args&&Object.keys(c(it).args).length>0);z(Je,It=>{c($e)&&It(Ct)})}j(It=>O(ze,It),[()=>c(it).name.replace(/_/g," ")]),D(Fe,Dt)},vt=Fe=>{var Dt=wA(),Ge=v(_(Dt),2),ze=_(Ge);j(Je=>O(ze,Je),[()=>c(it).name.replace(/_/g," ")]),D(Fe,Dt)};z(ke,Fe=>{c(it).type==="tool_call"?Fe(bt):Fe(vt,-1)})}D(Ne,Pe)}),D(G,re)};z(ye,G=>{c(Re).length>0&&G(At)})}var Ot=v(ye,2);{var ri=G=>{var re=aG(),Ne=_(re),it=_(Ne),Pe=_(it);j(()=>O(Pe,te[c(de)])),D(G,re)};z(Ot,G=>{c(a)&&c(s)===null&&c(Re).length===0&&G(ri)})}var oi=v(Ot,2);{var xi=G=>{var re=cG(),Ne=_(re);ei(Ne,21,()=>ui(c(s)),Ni,(it,Pe)=>{var ke=Es(),bt=yt(ke);{var vt=Dt=>{var Ge=DA();ac(Ge,()=>Pt(c(Pe).text),!0),D(Dt,Ge)},Fe=Dt=>{var Ge=lG(),ze=_(Ge),Je=_(ze),Ct=_(Je),$e=v(ze,2),It=_($e);ac(It,()=>Ze(c(Pe).text,c(Pe).lang??""),!0),j(()=>O(Ct,c(Pe).lang)),D(Dt,Ge)};z(bt,Dt=>{c(Pe).type==="text"?Dt(vt):Dt(Fe,-1)})}D(it,ke)}),D(G,re)};z(oi,G=>{c(s)!==null&&G(xi)})}us(Ee,G=>et=G,()=>et);var Ut=v(Ee,2);{var mi=G=>{var re=dG(),Ne=_(re);j(()=>O(Ne,c(d))),D(G,re)};z(Ut,G=>{c(d)&&G(mi)})}var He=v(Ut,2),Ye=_(He),Qt=_(Ye),Gt=v(Ye,2),gi=_(Gt),Jt=v(Gt,2),fe=_(Jt),Ke=v(fe);{var ot=G=>{const re=Tt(()=>Math.min(100,Math.round(c(Wt)/4/c(T).contextLength*100)));var Ne=uG(),it=_(Ne),Pe=v(_(it));j((ke,bt)=>{ln(Ne,"title",`~${c(re)??""}% of ${ke??""} token context window used`),ln(Pe,"stroke",c(re)>80?"var(--fg-err)":c(re)>50?"var(--fg-warn)":"var(--fg-ok)"),ln(Pe,"stroke-dasharray",`${bt??""} 31.4`)},[()=>c(T).contextLength.toLocaleString(),()=>(c(re)/100*31.4).toFixed(1)]),D(G,Ne)};z(Ke,G=>{var re;(re=c(T))!=null&&re.contextLength&&G(ot)})}var rt=v(He,2),ht=_(rt);{var _t=G=>{const re=Tt(()=>Mi(t().path.split("/").pop()??t().path));var Ne=hG();let it;var Pe=_(Ne),ke=_(Pe),bt=v(Pe,2),vt=_(bt),Fe=v(bt,2),Dt=_(Fe);j((Ge,ze)=>{it=Bt(Ne,1,"file-chip svelte-10ayso4",null,it,{inactive:!c(oe)}),Bt(Pe,1,`badge badge-${Ge??""}`,"svelte-10ayso4"),O(ke,ze),O(vt,t().path),ln(Fe,"title",c(oe)?"Remove from context":"Re-add to context"),O(Dt,c(oe)?"×":"+")},[()=>c(re).toLowerCase(),()=>Ri(c(re))]),$("click",Fe,()=>m(oe,!c(oe))),D(G,Ne)};z(ht,G=>{t()&&G(_t)})}var Xt=v(ht,2);ei(Xt,17,i,Ni,(G,re,Ne)=>{const it=Tt(()=>Mi(c(re).name));var Pe=fG(),ke=_(Pe),bt=_(ke),vt=v(ke,2),Fe=_(vt),Dt=v(vt,2);j((Ge,ze)=>{Bt(ke,1,`badge badge-${Ge??""}`,"svelte-10ayso4"),O(bt,ze),O(Fe,c(re).name)},[()=>c(it).toLowerCase(),()=>Ri(c(it))]),$("click",Dt,()=>Di(Ne)),D(G,Pe)});var F=v(Xt,2),H=v(F,2);us(H,G=>Se=G,()=>Se);var K=v(rt,2);let le;var Z=_(K);let J;var ce=_(Z);us(ce,G=>xe=G,()=>xe);var Qe=v(Z,2);{var ae=G=>{var re=gG();$("click",re,Ti),D(G,re)},pe=G=>{var re=pG();j(Ne=>re.disabled=Ne,[()=>!c(r).trim()||!c(dt)]),$("click",re,Pi),D(G,re)};z(Qe,G=>{c(a)?G(ae):G(pe,-1)})}var Te=v(K,2);{var me=G=>{var re=bG(),Ne=_(re),it=_(Ne),Pe=v(Ne,2);{var ke=Dt=>{var Ge=mG();ei(Ge,21,()=>c(y),Ni,(ze,Je)=>{var Ct=xG(),$e=_(Ct),It={};j(()=>{O($e,c(Je)),It!==(It=c(Je))&&(Ct.value=(Ct.__value=c(Je))??"")}),D(ze,Ct)}),j(()=>Ge.disabled=c(a)),Fs(Ge,()=>c(w),ze=>m(w,ze)),D(Dt,Ge)},bt=Dt=>{var Ge=vG(),ze=_(Ge);j(()=>O(ze,c(w)||c(u).model)),D(Dt,Ge)};z(Pe,Dt=>{c(y).length>0?Dt(ke):Dt(bt,-1)})}var vt=v(Pe,2);{var Fe=Dt=>{var Ge=_G();$("click",Ge,mt),D(Dt,Ge)};z(vt,Dt=>{c(u).provider==="ollama"&&Dt(Fe)})}j(()=>O(it,c(u).provider)),D(G,re)};z(Te,G=>{var re;(re=c(u))!=null&&re.provider&&(c(_e)||c(y).length>0)&&G(me)})}var Ie=v(Ai,2);{var lt=G=>{var re=IG(),Ne=_(re),it=_(Ne),Pe=_(it),ke=_(Pe),bt=v(Pe,2),vt=v(it,2),Fe=_(vt);{var Dt=Je=>{var Ct=CG();D(Je,Ct)},Ge=Je=>{var Ct=EG(),$e=_(Ct);j(()=>O($e,c(W))),D(Je,Ct)},ze=Je=>{var Ct=LG(),$e=_(Ct);{var It=ni=>{var ii=yG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).version)),D(ni,ii)};z($e,ni=>{c(T).version&&ni(It)})}var Me=v($e,2);{var st=ni=>{var ii=wG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.family)),D(ni,ii)};z(Me,ni=>{var ii;(ii=c(T).details)!=null&&ii.family&&ni(st)})}var Lt=v(Me,2);{var Ht=ni=>{var ii=SG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.parameter_size)),D(ni,ii)};z(Lt,ni=>{var ii;(ii=c(T).details)!=null&&ii.parameter_size&&ni(Ht)})}var pt=v(Lt,2);{var vi=ni=>{var ii=DG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.quantization_level)),D(ni,ii)};z(pt,ni=>{var ii;(ii=c(T).details)!=null&&ii.quantization_level&&ni(vi)})}var wi=v(pt,2);{var qi=ni=>{var ii=AG(),Xi=v(yt(ii)),Ji=_(Xi);j(()=>O(Ji,c(T).details.format)),D(ni,ii)};z(wi,ni=>{var ii;(ii=c(T).details)!=null&&ii.format&&ni(qi)})}var Fi=v(wi,2);{var Gi=ni=>{var ii=BG(),Xi=v(yt(ii),2);ei(Xi,21,()=>c(T).running,Ni,(Ji,Ln)=>{var Jn=kG(),Ss=_(Jn);j(as=>O(Ss,`${c(Ln).name??""} · ${as??""} VRAM`),[()=>Zt(c(Ln).size_vram)]),D(Ji,Jn)}),D(ni,ii)},Li=ni=>{var ii=FG();D(ni,ii)};z(Fi,ni=>{c(T).running&&c(T).running.length>0?ni(Gi):c(T).running!==null&&ni(Li,1)})}D(Je,Ct)};z(Fe,Je=>{c(V)?Je(Dt):c(W)?Je(Ge,1):c(T)&&Je(ze,2)})}j(()=>{var Je;return O(ke,`Ollama · ${(c(w)||((Je=c(u))==null?void 0:Je.model))??""}`)}),$("click",re,()=>m(R,!1)),$("click",Ne,Je=>Je.stopPropagation()),$("click",bt,()=>m(R,!1)),D(G,re)};z(Ie,G=>{c(R)&&G(lt)})}j(G=>{Ae=Bt(X,1,"icon-hdr-btn svelte-10ayso4",null,Ae,{active:c(b)}),O(fe,G),le=Bt(K,1,"input-row svelte-10ayso4",null,le,{"drag-over":c(ge)}),J=Bt(Z,1,"textarea-wrap svelte-10ayso4",null,J,{loading:c(a)}),ln(ce,"placeholder",c(dt)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":c(_e)?"Select a model above to start chatting":"AI not configured"),ce.disabled=c(a)||!c(dt)},[()=>Zt(c(Wt))]),$("click",X,()=>m(b,!c(b))),Cs(Qt,()=>c(he),G=>m(he,G)),Cs(gi,()=>c(De),G=>m(De,G)),$("click",F,Ui),$("change",H,Bi),fs("dragover",K,an),fs("dragleave",K,Zi),fs("drop",K,fn),$("keydown",ce,Oi),jt(ce,()=>c(r),G=>m(r,G)),D(o,St),js()}Zs(["click","change","keydown"]);const MG={OnOff:["onOff","globalSceneControl","onTime","offWaitTime"],LevelControl:["currentLevel","remainingTime","minLevel","maxLevel","currentFrequency","onOffTransitionTime","onLevel"],ColorControl:["currentHue","currentSaturation","remainingTime","currentX","currentY","colorTemperatureMireds","colorMode","colorTempPhysicalMinMireds","colorTempPhysicalMaxMireds"],BasicInformation:["vendorName","vendorId","productName","productId","nodeLabel","location","softwareVersion","softwareVersionString","serialNumber"],Identify:["identifyTime","identifyType"],Groups:["nameSupport"],OccupancySensing:["occupancy","occupancySensorType"],IlluminanceMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue","tolerance","lightSensorType"],TemperatureMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue","tolerance"],RelativeHumidityMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue","tolerance"],PressureMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue"],Thermostat:["localTemperature","outdoorTemperature","occupiedCoolingSetpoint","occupiedHeatingSetpoint","unoccupiedCoolingSetpoint","unoccupiedHeatingSetpoint","minHeatSetpointLimit","maxHeatSetpointLimit","systemMode","thermostatRunningMode","occupancy"],DoorLock:["lockState","lockType","actuatorEnabled","doorState"],WindowCovering:["type","currentPositionLiftPercent100ths","currentPositionTiltPercent100ths","operationalStatus","targetPositionLiftPercent100ths","targetPositionTiltPercent100ths","endProductType","mode"],FanControl:["fanMode","fanModeSequence","percentSetting","percentCurrent","speedMax","speedSetting","speedCurrent"],Descriptor:["deviceTypeList","serverList","clientList","partsList"],PowerSource:["status","order","description","wiredCurrentType","wiredMaximumCurrent","batteryVoltage","batteryPercentRemaining","batChargeLevel"],Switch:["numberOfPositions","currentPosition","multiPressMax"],BooleanState:["stateValue"],FlowMeasurement:["measuredValue","minMeasuredValue","maxMeasuredValue"]},RG={OnOff:["on","off","toggle"],LevelControl:["moveToLevel","move","step","stop","moveToLevelWithOnOff","moveWithOnOff","stepWithOnOff","stopWithOnOff"],ColorControl:["moveToHue","moveHue","stepHue","moveToSaturation","moveSaturation","stepSaturation","moveToHueAndSaturation","moveToColor","moveColor","stepColor","moveToColorTemperature","moveColorTemperature","stepColorTemperature"],Identify:["identify","triggerEffect"],Groups:["addGroup","viewGroup","getGroupMembership","removeGroup","removeAllGroups","addGroupIfIdentifying"],Thermostat:["setpointRaiseLower","setWeeklySchedule","getWeeklySchedule","clearWeeklySchedule"],DoorLock:["lockDoor","unlockDoor","unlockWithTimeout"],WindowCovering:["upOrOpen","downOrClose","stopMotion","goToLiftValue","goToLiftPercentage","goToTiltValue","goToTiltPercentage"],FanControl:[]};let vw=[],_w=[],bw=[];const Wv=new Map;let HF=[];const Cw=new Map,Ew=new Map;async function AA(){try{vw=(await pF()).map(e=>e.topic)}catch{}}async function kA(){try{const[o,e]=await Promise.all([uF(),hF()]);_w=o,bw=e}catch{}}async function BA(){try{const o=await gF();HF=o.map(e=>e.nodeId),Cw.clear(),Ew.clear();for(const e of o)e.name&&(Cw.set(e.nodeId,e.name),Ew.set(e.name,e.nodeId));await Promise.all(o.map(async e=>{if(!Wv.has(e.nodeId))try{Wv.set(e.nodeId,await gm(e.nodeId))}catch{}}))}catch{}}function NG(o){const e=/(?:she\.mqtt\.(?:sub|pub|get|set|link|age|getProp|or|and|max|min|timer)|she\.(?:getValue|setValue|getProp))\s*\([^)]*?['"]([^'"]*)\s*$/,t=o.match(e);if(t)return{type:"mqtt",prefix:t[1]};const i=/she\.db\.sub\s*\([^)]*?['"]([^'"]*)\s*$/,n=o.match(i);if(n)return{type:"db",prefix:n[1],includeViews:!0};const s=/she\.db\.(?:get|set|extend|delete|prop|query)\s*\([^)]*?['"]([^'"]*)\s*$/,r=o.match(s);if(r)return{type:"db",prefix:r[1],includeViews:!1};const a=/she\.matter\.(?:sub|get|send|on)\s*\(\s*(.*)\s*$/,d=o.match(a);if(d){const u=d[1],f=OG(u),g=HG(u);if(f===0)return{type:"matter-nodeId",prefix:g};if(f===1){const p=Eh(u,0);if(p)return{type:"matter-endpointId",nodeId:p}}if(f===2){const p=Eh(u,0),C=FA(u,1)??Eh(u,1);if(p&&C!==null)return{type:"matter-cluster",nodeId:p,endpointId:C}}if(f>=3){const p=Eh(u,0),C=FA(u,1)??Eh(u,1),b=Eh(u,2),y=/she\.matter\.send\s*\(/.test(o);if(p&&C!==null&&b)return{type:"matter-attr",nodeId:p,endpointId:C,cluster:b,isSend:y}}}return null}function OG(o){let e=0,t=0,i=!1,n="";for(const s of o){if(i){s===n&&(i=!1);continue}if(s==='"'||s==="'"){i=!0,n=s;continue}if(s==="("||s==="["||s==="{"){e++;continue}if(s===")"||s==="]"||s==="}"){e--;continue}s===","&&e===0&&t++}return t}function HG(o){const e=o.match(/['"]([^'"]*)\s*$/);return e?e[1]:""}function Eh(o,e){var s;const i=(s=WF(o)[e])==null?void 0:s.trim();if(!i)return null;const n=i.match(/^['"](.*)['"]$/);return n?n[1]:null}function FA(o,e){var s;const i=(s=WF(o)[e])==null?void 0:s.trim();if(!i)return null;const n=parseInt(i,10);return isNaN(n)?null:n}function WF(o){const e=[];let t="",i=0,n=!1,s="";for(const r of o){if(n){r===s&&(n=!1),t+=r;continue}if(r==='"'||r==="'"){n=!0,s=r,t+=r;continue}if(r==="("||r==="["||r==="{"){i++,t+=r;continue}if(r===")"||r==="]"||r==="}"){i--,t+=r;continue}if(r===","&&i===0){e.push(t),t="";continue}t+=r}return e.push(t),e}const Ou=ad.CompletionItemKind;function WG(o,e){return(e?vw.filter(i=>i.startsWith(e)):vw).map(i=>({label:i,kind:Ou.Value,insertText:i,range:o,detail:"MQTT topic",sortText:"0"+i}))}function zG(o,e,t){const i=t?[..._w,...bw]:_w;return(e?i.filter(s=>s.startsWith(e)):i).map(s=>({label:s,kind:Ou.Value,insertText:s,range:o,detail:bw.includes(s)?"sheDB view":"sheDB document",sortText:"0"+s}))}function VG(o,e){return HF.map(t=>{const i=Cw.get(t)??t;return e&&!i.startsWith(e)&&!t.startsWith(e)?null:{label:i,kind:Ou.Value,insertText:i,range:o,detail:i!==t?`Node ID: ${t}`:"Matter node",sortText:"0"+i}}).filter(Boolean)}function zF(o){return Ew.get(o)??o}function jG(o,e){if(typeof e=="number")return o.endpoints.find(i=>i.endpointId===e);const t=parseInt(e,10);return isNaN(t)?o.endpoints.find(i=>i.name===e):o.endpoints.find(i=>i.endpointId===t)}function $G(o,e){const t=Wv.get(zF(e));return t?t.endpoints.map(i=>{const n=i.name??String(i.endpointId),s=i.clusters.map(r=>r.name).join(", ");return{label:n,kind:Ou.Value,insertText:n,range:o,detail:i.name?`Endpoint ${i.endpointId} — ${s}`:`Clusters: ${s}`,sortText:"0"+String(i.endpointId).padStart(4,"0")}}):[]}function UG(o,e,t){const i=Wv.get(zF(e));if(!i)return[];const n=jG(i,t);return n?n.clusters.map(s=>({label:s.name,kind:Ou.Value,insertText:s.name,range:o,detail:"Matter cluster",sortText:"0"+s.name})):[]}function qG(o,e,t){return(t?RG[e]??[]:MG[e]??[]).map(n=>({label:n,kind:t?Ou.Function:Ou.Property,insertText:n,range:o,detail:t?`${e} command`:`${e} attribute`,sortText:"0"+n}))}let LA=!1;function GG(){LA||(LA=!0,AA(),kA(),BA(),setInterval(AA,15e3),setInterval(kA,1e4),setInterval(BA,6e4),ad.registerCompletionItemProvider("javascript",{triggerCharacters:["'",'"',"(",","," "],provideCompletionItems(o,e){const t=o.getValueInRange({startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=NG(t);if(!i)return null;const n=o.getWordUntilPosition(e),s=Math.max(t.lastIndexOf("'"),t.lastIndexOf('"')),r=s>=0?s+2:n.startColumn,a={startLineNumber:e.lineNumber,endLineNumber:e.lineNumber,startColumn:r,endColumn:e.column};switch(i.type){case"mqtt":return{suggestions:WG(a,i.prefix)};case"db":return{suggestions:zG(a,i.prefix,i.includeViews)};case"matter-nodeId":return{suggestions:VG(a,i.prefix)};case"matter-endpointId":return{suggestions:$G(a,i.nodeId)};case"matter-cluster":return{suggestions:UG(a,i.nodeId,i.endpointId)};case"matter-attr":return{suggestions:qG(a,i.cluster,i.isSend)};default:return null}}}))}var KG=B('<button class="svelte-1pyfjii">New file here</button> <button class="svelte-1pyfjii">New subfolder here</button> <hr class="svelte-1pyfjii"/> <button class="svelte-1pyfjii">Rename folder…</button> <button class="danger svelte-1pyfjii">Delete folder…</button>',1),ZG=B('<button class="svelte-1pyfjii">Show git history</button>'),XG=B('<button class="svelte-1pyfjii">Open</button> <button class="svelte-1pyfjii">Rename…</button> <button class="svelte-1pyfjii">Add to AI context</button> <!> <hr class="svelte-1pyfjii"/> <button class="danger svelte-1pyfjii">Delete</button>',1),YG=B('<div class="ctx-backdrop svelte-1pyfjii" role="presentation"></div> <div class="ctx-menu svelte-1pyfjii"><!></div>',1),QG=B('<div class="lib-tip-float svelte-1pyfjii">Library directory — files here are not auto-loaded as scripts</div>'),IA=B('<span class="git-mod svelte-1pyfjii" title="Uncommitted changes">M</span>'),JG=B('<ul class="tree-children svelte-1pyfjii"></ul>'),eK=B('<li class="tree-dir svelte-1pyfjii"><div role="treeitem" tabindex="-1" draggable="true"><button>›</button> <span role="button" tabindex="0"> </span> <!> <label class="lib-label svelte-1pyfjii" title="Library directory — files here are not auto-loaded as scripts"><input type="checkbox" class="svelte-1pyfjii"/> <span class="lib-checkmark svelte-1pyfjii"></span> <svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h8a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H3V3z"></path><line x1="3" y1="12" x2="13" y2="12"></line><line x1="6" y1="3" x2="6" y2="12"></line></svg></label> <label class="dis-label svelte-1pyfjii" title="Disable — scripts in this folder will not be executed"><input type="checkbox" class="svelte-1pyfjii"/> <span class="dis-checkmark svelte-1pyfjii"></span> <svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="8" cy="8" r="6"></circle><line x1="3.8" y1="12.2" x2="12.2" y2="3.8"></line></svg></label></div> <!></li>'),tK=B('<span class="dirty-dot svelte-1pyfjii">●</span>'),iK=B('<span class="run-dot svelte-1pyfjii" title="Running">●</span>'),nK=B('<span class="err-dot svelte-1pyfjii">●</span>'),sK=B('<label><input type="checkbox" class="svelte-1pyfjii"/> <span class="dis-checkmark svelte-1pyfjii"></span> <svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="8" cy="8" r="6"></circle><line x1="3.8" y1="12.2" x2="12.2" y2="3.8"></line></svg></label>'),oK=B('<span class="dis-spacer svelte-1pyfjii"></span>'),rK=B('<li draggable="true"><div class="file-row svelte-1pyfjii"><button><span> </span> <span class="fname svelte-1pyfjii"> </span> <!><!> <!> <!></button> <!></div></li>'),aK=B('<div class="err svelte-1pyfjii"> </div>'),lK=B('<button title="Case sensitive">Aa</button> <button title="Use regex">.*</button> <button title="Replace">⇄</button>',1),cK=B('<div class="search-input-row svelte-1pyfjii"><input placeholder="Replace with…" class="svelte-1pyfjii"/> <button class="svelte-1pyfjii"> </button></div>'),dK=B('<div class="search-status svelte-1pyfjii">Searching…</div>'),uK=B('<div class="search-status search-err svelte-1pyfjii"> </div>'),hK=B('<div class="search-status svelte-1pyfjii">No results.</div>'),fK=B('<div class="search-status search-trunc svelte-1pyfjii">Showing first 500 matches.</div>'),gK=B('<button class="search-match-row svelte-1pyfjii"><span class="search-lnum svelte-1pyfjii"> </span> <span class="search-preview svelte-1pyfjii"> </span></button>'),pK=B('<div class="search-file-group svelte-1pyfjii"><button class="search-file-btn svelte-1pyfjii"><span class="search-fname svelte-1pyfjii"> </span> <span class="search-fcount svelte-1pyfjii"> </span></button> <!></div>'),UC=B("<!> <!>",1),xK=B('<div class="search-status svelte-1pyfjii">No files found.</div>'),mK=B('<div class="search-status search-trunc svelte-1pyfjii">Showing first 200 results.</div>'),vK=B('<button class="search-match-row search-file-result svelte-1pyfjii"><span class="search-preview svelte-1pyfjii"> </span></button>'),_K=B('<label class="replace-item svelte-1pyfjii"><input type="checkbox"/> <span class="replace-item-path svelte-1pyfjii"> </span> <span class="replace-item-n svelte-1pyfjii"> </span></label>'),bK=B('<div class="replace-confirm svelte-1pyfjii"><div class="replace-confirm-hdr svelte-1pyfjii"><span> </span> <div class="replace-confirm-btns svelte-1pyfjii"><button class="svelte-1pyfjii">Apply</button> <button class="svelte-1pyfjii">Cancel</button></div></div> <div class="replace-confirm-list svelte-1pyfjii"></div></div>'),CK=B('<div class="search-panel svelte-1pyfjii"><div class="search-mode-bar svelte-1pyfjii"><button>Text</button> <button>Files</button> <button class="search-close-btn svelte-1pyfjii" title="Close">×</button></div> <div class="search-input-row svelte-1pyfjii"><input class="svelte-1pyfjii"/> <!></div> <!> <div class="search-results svelte-1pyfjii"><!></div> <!></div>'),EK=B('<div class="history-empty svelte-1pyfjii">Loading…</div>'),yK=B('<div class="history-empty svelte-1pyfjii">No commits found.</div>'),wK=B('<button class="history-row svelte-1pyfjii"><span class="history-subject svelte-1pyfjii"> </span> <span class="history-meta svelte-1pyfjii"> </span></button>'),SK=B('<button class="history-load-more svelte-1pyfjii"> </button>'),DK=B('<div class="history-panel svelte-1pyfjii"><div class="history-resize-handle svelte-1pyfjii" role="separator"></div> <div class="history-hdr svelte-1pyfjii"><span class="history-title svelte-1pyfjii"> </span> <button class="history-close svelte-1pyfjii">✕</button></div> <div class="history-body svelte-1pyfjii"><!></div></div>'),AK=B('<span class="tab-dirty svelte-1pyfjii">●</span>'),kK=B('<div role="tab" tabindex="0"><span class="tab-label svelte-1pyfjii"> </span> <!> <button class="tab-close svelte-1pyfjii" title="Close">×</button></div>'),BK=B('<div class="tab-bar-wrap svelte-1pyfjii"><button class="tab-scroll-btn svelte-1pyfjii" aria-label="Scroll tabs left">‹</button> <div class="tab-bar svelte-1pyfjii" role="tablist"></div> <button class="tab-scroll-btn svelte-1pyfjii" aria-label="Scroll tabs right">›</button></div>'),FK=B('<li class="changes-item svelte-1pyfjii"><input type="checkbox" class="changes-check svelte-1pyfjii"/> <span class="changes-status svelte-1pyfjii"> </span> <span class="changes-file svelte-1pyfjii"> </span></li>'),LK=B('<div class="changes-err svelte-1pyfjii"> </div>'),IK=B('<div class="changes-backdrop svelte-1pyfjii" role="presentation"></div> <div class="changes-popup svelte-1pyfjii"><div class="changes-popup-hdr svelte-1pyfjii">Uncommitted changes</div> <ul class="changes-list svelte-1pyfjii"></ul> <div class="changes-commit-row svelte-1pyfjii"><input class="changes-msg-input svelte-1pyfjii" type="text" placeholder="Commit message…"/> <button class="changes-commit-btn svelte-1pyfjii"> </button></div> <!></div>',1),PK=B('<div class="changes-wrap svelte-1pyfjii"><button class="git-changes svelte-1pyfjii"> </button> <!></div>'),TK=B('<div class="changes-backdrop svelte-1pyfjii" role="presentation"></div> <div class="changes-popup svelte-1pyfjii"><div class="changes-popup-hdr svelte-1pyfjii"> </div> <div class="changes-commit-row svelte-1pyfjii"><button class="changes-commit-btn svelte-1pyfjii">Push</button></div></div>',1),MK=B('<div class="changes-wrap svelte-1pyfjii"><button class="git-ahead svelte-1pyfjii"> </button> <!></div>'),RK=B('<span class="git-behind svelte-1pyfjii"> </span>'),NK=B('<span class="git-status svelte-1pyfjii"><span class="git-branch svelte-1pyfjii"> </span> <!> <!> <!></span>'),OK=B('<div class="split-backdrop svelte-1pyfjii" role="presentation"></div> <div class="split-menu svelte-1pyfjii"><button class="svelte-1pyfjii">Save</button> <button class="svelte-1pyfjii">Save &amp; Commit</button></div>',1),HK=B('<button class="danger svelte-1pyfjii">Delete</button>'),WK=B(`<div class="welcome svelte-1pyfjii"><div class="welcome-inner svelte-1pyfjii"><div class="welcome-logo svelte-1pyfjii">she</div> <p class="welcome-sub svelte-1pyfjii">Smart Home Engine — a scriptable smart home automation engine</p> <div class="welcome-hint svelte-1pyfjii"><strong>Quick start:</strong> click <kbd class="svelte-1pyfjii">+ File</kbd> in the sidebar to create your first script,
152
+ or click an existing file to open it. Scripts run in a sandboxed VM with access to the <code class="svelte-1pyfjii">she</code> object for MQTT, scheduling, and more.</div> <div class="welcome-links svelte-1pyfjii"><a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-1pyfjii">GitHub</a> <span class="svelte-1pyfjii">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/sandbox-api.md" target="_blank" rel="noopener" class="svelte-1pyfjii">API reference</a> <span class="svelte-1pyfjii">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/README.md" target="_blank" rel="noopener" class="svelte-1pyfjii">README</a></div> <div class="welcome-shortcuts svelte-1pyfjii"><div class="welcome-shortcuts-title svelte-1pyfjii">Keyboard shortcuts</div> <div class="welcome-shortcuts-grid svelte-1pyfjii"><span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">S</kbd></span><span class="svelte-1pyfjii">Save</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">F</kbd></span><span class="svelte-1pyfjii">Find</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">H</kbd></span><span class="svelte-1pyfjii">Find &amp; Replace</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">G</kbd></span><span class="svelte-1pyfjii">Go to line</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">Z</kbd></span><span class="svelte-1pyfjii">Undo</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">Shift</kbd><kbd class="svelte-1pyfjii">Z</kbd></span><span class="svelte-1pyfjii">Redo</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Ctrl</kbd><kbd class="svelte-1pyfjii">/</kbd></span><span class="svelte-1pyfjii">Toggle comment</span> <span class="keys svelte-1pyfjii"><kbd class="svelte-1pyfjii">Alt</kbd><kbd class="svelte-1pyfjii">↑ / ↓</kbd></span><span class="svelte-1pyfjii">Move line up / down</span></div></div></div></div>`),zK=B('<button class="svelte-1pyfjii">Always accept in this session</button>'),VK=B('<button class="svelte-1pyfjii">Disable auto-accept</button>'),jK=B('<div class="split-backdrop svelte-1pyfjii" role="presentation"></div> <div class="split-menu svelte-1pyfjii"><!></div>',1),$K=B('<div class="diff-overlay svelte-1pyfjii"><div class="diff-bar svelte-1pyfjii"><span class="diff-title svelte-1pyfjii">Proposed changes — <em class="svelte-1pyfjii"> </em></span> <div class="diff-actions svelte-1pyfjii"><div class="split-wrap svelte-1pyfjii"><div class="split-btn accept-split svelte-1pyfjii"><button class="split-main svelte-1pyfjii"> </button> <button class="split-arrow svelte-1pyfjii" aria-label="Accept options">▾</button></div> <!></div> <button class="discard-btn svelte-1pyfjii">Discard</button></div></div> <div class="diff-container svelte-1pyfjii"></div></div>'),UK=B('<div class="history-diff-notice svelte-1pyfjii">Binary file — diff not available.</div>'),qK=B('<div class="diff-container svelte-1pyfjii"></div>'),GK=B('<div class="diff-overlay svelte-1pyfjii"><div class="diff-bar svelte-1pyfjii"><span class="diff-title svelte-1pyfjii">Commit <code> </code> → current — <em class="svelte-1pyfjii"> </em></span> <div class="diff-actions svelte-1pyfjii"><button class="discard-btn svelte-1pyfjii">Close</button></div></div> <!></div>'),KK=B('<div class="log-resize-handle svelte-1pyfjii" role="separator"></div>'),ZK=B('<span class="log-file svelte-1pyfjii"> </span>'),XK=B("<option> </option>"),YK=B('<select class="log-filter-level svelte-1pyfjii"></select> <input class="log-filter-text svelte-1pyfjii" type="search" placeholder="Filter…"/> <label class="log-filter-regex svelte-1pyfjii" title="Interpret filter as a regular expression"><input type="checkbox" class="svelte-1pyfjii"/> <span class="log-filter-checkmark svelte-1pyfjii"></span> Regex</label> <button class="log-clear svelte-1pyfjii">Clear</button>',1),QK=B('<div><span class="ts svelte-1pyfjii"> </span> <span class="lvl svelte-1pyfjii"> </span> <span class="msg svelte-1pyfjii"> </span></div>'),JK=B('<span class="log-empty svelte-1pyfjii">No log output for this script.</span>'),eZ=B('<div class="log-body svelte-1pyfjii"><!> <!></div>'),tZ=B('<div class="chat-resize-handle svelte-1pyfjii" role="separator"></div> <div class="chat-container svelte-1pyfjii"><!></div>',1),iZ=B('<!> <!> <!> <!> <div class="layout svelte-1pyfjii"><aside class="svelte-1pyfjii"><div class="toolbar svelte-1pyfjii"><button title="New script" class="svelte-1pyfjii">+ File</button> <button title="New folder" class="svelte-1pyfjii">+ Folder</button> <button title="Find in files / Find files (Ctrl+Shift+F)">&#x2315;</button> <button title="Refresh" class="refresh svelte-1pyfjii">↻</button></div> <!> <!> <ul class="tree svelte-1pyfjii"><li role="presentation"></li> <!></ul> <!></aside> <div class="sidebar-resize-handle svelte-1pyfjii" role="separator"></div> <div class="editor-area svelte-1pyfjii"><!> <div class="editor-toolbar svelte-1pyfjii"><span class="filename svelte-1pyfjii"> </span> <!> <div class="split-wrap svelte-1pyfjii"><div class="split-btn svelte-1pyfjii"><button class="split-main svelte-1pyfjii"> </button> <button class="split-arrow svelte-1pyfjii" aria-label="Save options">▾</button></div> <!></div> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button></div> <div class="editor-body svelte-1pyfjii"><div class="editor-left svelte-1pyfjii"><div class="editor-stack svelte-1pyfjii"><div class="editor-container svelte-1pyfjii"></div> <!> <!> <!></div> <div><!> <div class="log-header svelte-1pyfjii"><button class="log-toggle svelte-1pyfjii"> <!></button> <!></div> <!></div></div> <!></div></div></div>',1);function nZ(o,e){Vs(e,!0);let t=I(Ei([])),i=I(Ei({})),n=I(null),s=I(null),r=I(null),a=I(null),d=I(Ei([])),u=I(null),f=I(!1),g=I(""),p=I(!1),C=I(!0),b=I(null),y=I(!1),w=I(!1),A=I(null),P=I(Ei([])),M=I(!1),R=I(30),T=I(void 0),V=null,W=null,Q=null,ne=I(!1),de=I(""),te=I(!1),he=I(void 0),De=I(Ei(new Set));const oe=new Set;let ge=I(Ei(new Set)),Se=I(Ei([])),Re=I(!1),xe=I("text"),et=I(""),We=I(!1),_e=I(!1),dt=I(!1),Wt=I(""),tt=I(Ei([])),kt=I(Ei([])),be=I(!1),Rt=I(!1),ut=I(""),at=I(void 0),Ze=I(Ei([])),Pt=I(!1),ui=I(!1),wt=null,Ft=I(void 0),Vt=I(!1),zt=I(!1),Zt=null;function mt(){c(Ft)&&(m(Vt,c(Ft).scrollLeft>0),m(zt,c(Ft).scrollLeft+c(Ft).clientWidth<c(Ft).scrollWidth-1))}function Mi(q){var ue;(ue=c(Ft))==null||ue.scrollBy({left:q*200,behavior:"smooth"})}function Ri(q="text"){m(Re,!0),m(xe,q,!0),ul().then(()=>{var ue;return(ue=c(at))==null?void 0:ue.focus()})}function Di(){m(Re,!1),m(et,""),m(tt,[],!0),m(kt,[],!0),m(be,!1),m(ut,""),m(dt,!1),m(Pt,!1)}function Ui(){wt&&clearTimeout(wt),wt=setTimeout(ji,300)}async function ji(){const q=c(et).trim();if(!q){m(tt,[],!0),m(kt,[],!0),m(be,!1),m(ut,"");return}m(Rt,!0),m(ut,"");try{if(c(xe)==="files"){const ue=await nA(q,{mode:"files"});m(kt,ue.results,!0),m(be,ue.truncated,!0)}else{const ue=await nA(q,{regex:c(_e),caseSensitive:c(We)});m(tt,ue.results,!0),m(be,ue.truncated,!0)}}catch(ue){m(ut,ue.message||"Search failed",!0)}finally{m(Rt,!1)}}async function Bi(q,ue){await bt(q),St&&(St.revealLineInCenter(ue.line),St.setPosition({lineNumber:ue.line,column:ue.col}),St.focus())}function fn(q){return q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function an(){if(!c(et).trim()||!c(tt).length)return;m(ui,!0);const q=[],ue="g"+(c(We)?"":"i");for(const ct of c(tt))try{const ft=await Nx(ct.path),je=c(_e)?new RegExp(c(et),ue):new RegExp(fn(c(et)),ue),Kt=ft.content.replace(je,c(Wt));Kt!==ft.content&&q.push({path:ct.path,checked:!0,original:ft.content,replaced:Kt,changes:ct.matches.length})}catch{}m(Ze,q,!0),m(ui,!1),m(Pt,!0)}async function Zi(){for(const q of c(Ze).filter(ue=>ue.checked))try{await Gl(q.path,q.replaced);const ue=c(d).find(ct=>ct.path===q.path);ue!=null&&ue.model&&(ue.model.setValue(q.replaced),ue.savedContent=q.replaced,ue.dirty=!1)}catch{}m(Pt,!1),await ji()}function _n(q){q.ctrlKey&&q.shiftKey&&q.key==="F"&&(q.preventDefault(),c(Re)&&c(xe)==="text"?Di():Ri("text"))}$n(()=>{c(Ft)&&(Zt==null||Zt.disconnect(),Zt=new ResizeObserver(mt),Zt.observe(c(Ft)),mt())});let gt=I("all"),Yt=I(""),Ci=I(!1);const Wi=["all","debug","info","warn","error"],Pi={debug:0,info:1,warn:2,error:3};function Ti(q){if(c(gt)!=="all"&&Pi[q.level]<Pi[c(gt)])return!1;if(!c(Yt))return!0;if(c(Ci))try{return new RegExp(c(Yt),"i").test(q.msg)}catch{}return q.msg.toLowerCase().includes(c(Yt).toLowerCase())}let Oi=I(null);function Qi(q){const ue=q.currentTarget.getBoundingClientRect();m(Oi,{x:ue.left,y:ue.top},!0)}function yi(){m(Oi,null)}let Xe,St,Ai,ki=!1,fi=null,Ii=null,X=!1,Ae=!1,qe=I(!1),nt=I(null),qt=I(!1),se=I(!1),Ee=I(void 0),Le=null,Y=null,Oe=null,Ve=I(Ei(parseInt(localStorage.getItem("she-scripts-sidebar-width")??"220",10))),ye=I(Ei(parseInt(localStorage.getItem("she-scripts-log-height")??"130",10))),At=I(Ei(parseInt(localStorage.getItem("she-scripts-chat-width")??"340",10))),Ot=I(Ei(parseInt(localStorage.getItem("she-scripts-history-height")??"220",10))),ri=!1,oi=0,xi=0,Ut=!1,mi=0,He=0,Ye=!1,Qt=0,Gt=0,gi=!1,Jt=0,fe=0;const Ke=Tt(()=>{var q;return c(u)&&c(ce)?{path:c(u),content:((q=c(ce).model)==null?void 0:q.getValue())??c(ce).savedContent}:null}),ot=Tt(()=>{var q;return new Set(((q=c(b))==null?void 0:q.changes.map(ue=>ue.file))??[])}),rt=Tt(()=>{const q=new Set;for(const ue of c(ot)){const ct=ue.split("/");for(let ft=1;ft<ct.length;ft++)q.add(ct.slice(0,ft).join("/"))}return q});let ht=I(!1),_t=I(!1),Xt=I(""),F=I(!1),H=I(""),K=I(Ei(new Set));async function le(){var q;if(!(!c(Xt).trim()||c(K).size===0)){m(F,!0),m(H,"");try{const ue=c(b).changes.filter(ct=>c(K).has(ct.file)).map(ct=>ct.file);if(ue.length===c(b).changes.length?await rA(c(Xt).trim()):await oA(ue,c(Xt).trim()),c(w))try{await Hx()}catch{}m(Xt,""),await Dt(),(q=c(b))!=null&&q.changes.length?m(K,new Set(c(b).changes.map(ct=>ct.file)),!0):m(ht,!1)}catch(ue){m(H,ue.message,!0)}finally{m(F,!1)}}}let Z,J,ce=Tt(()=>c(d).find(q=>q.path===c(u))??null);const Qe="she-tabs",ae="she-active-tab",pe="she-log-open",Te="she-chat-open";let me=wu(e,"active",3,!0);$n(()=>{Ae&&(localStorage.setItem(Qe,JSON.stringify(c(d).map(q=>q.path))),c(u)?localStorage.setItem(ae,c(u)):localStorage.removeItem(ae))}),$n(()=>{Ae&&localStorage.setItem(Te,String(c(qe)))}),$n(()=>{me()&&St&&St.layout()});const Ie=`
153
153
  declare const she: {
154
154
  log(...args: any[]): void;
155
155
  info(...args: any[]): void;
@@ -213,13 +213,13 @@ declare const she: {
213
213
  find(index: string, field: string, text: string, size?: number): Promise<any[]>;
214
214
  };
215
215
  };
216
- `;function lt(q){c(d).some(ue=>ue.dirty)&&q.preventDefault()}Ks(async()=>{var ft;window.addEventListener("beforeunload",lt),m(C,localStorage.getItem(pe)!=="false"),m(qe,localStorage.getItem(Te)==="true"),ad.typescript.javascriptDefaults.addExtraLib(Ie,"she-api.d.ts"),ad.typescript.javascriptDefaults.setCompilerOptions({target:ad.typescript.ScriptTarget.ES2022,allowNonTsExtensions:!0,checkJs:!0}),ad.typescript.javascriptDefaults.setDiagnosticsOptions({noSyntaxValidation:!1,noSemanticValidation:!0}),GG(),Ai=xr.createModel("","javascript"),St=xr.create(Xe,{model:Ai,theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1}),St.addCommand(n8.CtrlCmd|n8.Shift|y7.KeyF,()=>{c(Re)&&c(xe)==="text"?Di():Ri("text")}),St.onDidChangeModelContent(()=>{if(ki)return;const je=c(d).find(Kt=>Kt.path===c(u));je&&(je.dirty=St.getValue()!==je.savedContent),Pn&&clearTimeout(Pn),Pn=setTimeout(Vn,600)}),fi=lS(je=>{const Kt=je.msg.match(/^([^:\n]+\.js):\s/);if(!Kt)return;const ai=Kt[1];if(je.level==="error")oe.add(ai),c(De).has(ai)||m(De,new Set([...c(De),ai]),!0);else if(oe.has(ai)){oe.delete(ai);const Yi=new Set(c(De));Yi.delete(ai),m(De,Yi,!0)}const tn=c(d).find(Yi=>Yi.path===ai);tn&&(tn.logEntries=[...tn.logEntries.slice(-199),je],tn.path===c(u)&&c(C)&&c(he)&&ul().then(()=>{c(he)&&(c(he).scrollTop=c(he).scrollHeight)}))}),Ii=ar("script:running",je=>{const Kt=je.path;if(je.running)m(ge,new Set([...c(ge),Kt]),!0);else{const ai=new Set(c(ge));ai.delete(Kt),m(ge,ai,!0)}}),await G(),Dt();try{const je=await Il();typeof je.gitAutoCommit=="boolean"&&m(y,je.gitAutoCommit,!0),typeof je.gitAutoPush=="boolean"&&m(w,je.gitAutoPush,!0)}catch{}try{const je=await getDaemonStatus();m(ge,new Set(je.runningScripts??[]),!0)}catch{}const q=JSON.parse(localStorage.getItem(Qe)??"[]"),ue=localStorage.getItem(ae);for(const je of q)await ke(je,!1);const ct=ue&&c(d).some(je=>je.path===ue)?ue:((ft=c(d)[0])==null?void 0:ft.path)??null;ct&&await vt(ct),Ae=!0}),Tp(()=>{var q;window.removeEventListener("beforeunload",lt),Zt==null||Zt.disconnect(),Pn&&clearTimeout(Pn),fi==null||fi(),Ii==null||Ii();for(const ue of c(d))(q=ue.model)==null||q.dispose();Ai==null||Ai.dispose(),St==null||St.dispose()});async function G(){try{if(m(t,await M$(),!0),!X){let ue=function(ct){for(const ft of ct)ft.type==="dir"&&(q[ft.path]=!0,ft.children&&ue(ft.children))};X=!0;const q={};ue(c(t)),m(i,q,!0)}m(g,"")}catch(q){m(g,q.message,!0)}}function re(q){c(i)[q]=!c(i)[q]}function Ne(q){switch(q){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"⇓";case"JSON":case"JSONC":return"{}";default:return q}}async function it(q,ue){try{ue?await Gl(`${q}/.shelib`,""):await Ox(`${q}/.shelib`),await G(),await Ge("all",ue?`lib ${q}`:`unlib ${q}`)}catch(ct){m(g,ct.message,!0)}}async function Pe(q,ue){const ct=q.split("/").pop(),ft=q.includes("/")?q.slice(0,q.lastIndexOf("/")):"",je=ft?`${ft}/.shedisable-${ct}`:`.shedisable-${ct}`;try{ue?await Gl(je,""):await Ox(je),await G(),await Ge("all",ue?`disable ${q}`:`enable ${q}`)}catch(Kt){m(g,Kt.message,!0)}}async function ke(q,ue=!0){var ct;if(c(d).some(ft=>ft.path===q)){ue&&await vt(q);return}try{const{content:ft}=await Nx(q),je=w7.parse(`file:///she-scripts/${encodeURIComponent(q)}`);(ct=xr.getModel(je))==null||ct.dispose();const Kt=xr.createModel(ft,Ys(q),je);m(d,[...c(d),{path:q,dirty:!1,savedContent:ft,model:Kt,logEntries:[]}],!0),ue&&await vt(q)}catch(ft){m(g,ft.message,!0)}}async function Ct(q){await ke(q,!0)}async function vt(q){var ct,ft;const ue=c(d).find(je=>je.path===q);ue!=null&&ue.model&&(pt(),m(nt,null),m(u,q,!0),ki=!0,St.setModel(ue.model),ki=!1,Vn(),await ul(),(ft=(ct=c(Ft))==null?void 0:ct.querySelector(`[data-tab-path="${CSS.escape(q)}"]`))==null||ft.scrollIntoView({inline:"nearest",block:"nearest"}),mt())}async function Fe(q){var ft;const ue=c(d).find(je=>je.path===q);if(!ue||ue.dirty&&!await Z.show(`Discard unsaved changes to ${q}?`,{confirm:"Discard"}))return;const ct=c(d).findIndex(je=>je.path===q);if((ft=ue.model)==null||ft.dispose(),m(d,c(d).filter(je=>je.path!==q),!0),c(u)===q){const je=c(d)[ct]??c(d)[ct-1]??null;je?await vt(je.path):(m(u,null),St.setModel(Ai))}}async function Dt(){try{m(b,await N$(),!0)}catch{m(b,null)}}async function Ge(q,ue){if(c(b))try{if(q==="all"?await rA(ue):await oA(q,ue),c(w))try{await Hx()}catch{}await Dt()}catch{}}async function ze(){if(!c(u))return;const q=c(d).find(ue=>ue.path===c(u));if(q){m(f,!0);try{const ue=St.getValue();await Gl(c(u),ue),q.savedContent=ue,q.dirty=!1,m(g,""),c(y)?await Ge([c(u)],`update ${c(u)}`):Dt()}catch(ue){m(g,ue.message,!0)}finally{m(f,!1)}}}async function Je(){if(!c(u)||(await ze(),c(g)))return;const q=await J.show("Commit message:",{initial:`update ${c(u)}`,placeholder:"Update script",confirm:"Commit"});if(q)try{if(await W$(c(u),q),c(w))try{await Hx()}catch{}Dt()}catch(ue){m(g,"Git: "+ue.message)}}async function bt(){m(p,!1);try{await Hx(),await Dt(),m(g,"")}catch(q){m(g,"Git push: "+q.message)}}function $e(q){const ue=Date.now()-new Date(q).getTime(),ct=Math.floor(ue/1e3);if(ct<60)return"just now";const ft=Math.floor(ct/60);if(ft<60)return`${ft}m ago`;const je=Math.floor(ft/60);if(je<24)return`${je}h ago`;const Kt=Math.floor(je/24);if(Kt<30)return`${Kt}d ago`;const ai=Math.floor(Kt/30);return ai<12?`${ai}mo ago`:`${Math.floor(ai/12)}y ago`}async function It(q){Fi(),m(A,q,!0),m(P,[],!0),m(R,30),await Me()}async function Me(){if(c(A)){m(M,!0);try{m(P,await z$(c(A).path,c(R)),!0)}catch{}finally{m(M,!1)}}}async function st(){m(R,c(R)+30),await Me()}function Lt(){m(A,null),m(P,[],!0),pt()}async function Ht(q){if(!c(A))return;pt(),await Ct(c(A).path);let ue;try{ue=await V$(q.hash,c(A).path)}catch{return}if(m(de,q.hash,!0),m(te,ue.binary,!0),m(ne,!0),ue.binary||ue.content===null)return;let ct="";const ft=c(d).find(Kt=>Kt.path===c(A).path);if(ft!=null&&ft.model)ct=ft.model.getValue();else try{ct=(await Nx(c(A).path)).content}catch{}if(await ul(),!c(T))return;const je=Ys(c(A).path);W=xr.createModel(ue.content,je),Q=xr.createModel(ct,je),V=xr.createDiffEditor(c(T),{theme:"vs-dark",readOnly:!0,renderSideBySide:!0,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,scrollBeyondLastLine:!1}),V.setModel({original:W,modified:Q})}function pt(){m(ne,!1),m(te,!1),V==null||V.dispose(),V=null,W==null||W.dispose(),W=null,Q==null||Q.dispose(),Q=null}async function vi(){const q=c(n)?`${c(n)}/`:"",ue=await J.show("New script name:",{placeholder:q?`${q}myscript.js`:"myscript.js",initial:q,confirm:"Create"});if(!ue)return;const ct=ue.endsWith(".js")?`/* global she */
216
+ `;function lt(q){c(d).some(ue=>ue.dirty)&&q.preventDefault()}Ks(async()=>{var ft;window.addEventListener("beforeunload",lt),m(C,localStorage.getItem(pe)!=="false"),m(qe,localStorage.getItem(Te)==="true"),ad.typescript.javascriptDefaults.addExtraLib(Ie,"she-api.d.ts"),ad.typescript.javascriptDefaults.setCompilerOptions({target:ad.typescript.ScriptTarget.ES2022,allowNonTsExtensions:!0,checkJs:!0}),ad.typescript.javascriptDefaults.setDiagnosticsOptions({noSyntaxValidation:!1,noSemanticValidation:!0}),GG(),Ai=xr.createModel("","javascript"),St=xr.create(Xe,{model:Ai,theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1}),St.addCommand(n8.CtrlCmd|n8.Shift|y7.KeyF,()=>{c(Re)&&c(xe)==="text"?Di():Ri("text")}),St.onDidChangeModelContent(()=>{if(ki)return;const je=c(d).find(Kt=>Kt.path===c(u));je&&(je.dirty=St.getValue()!==je.savedContent),Pn&&clearTimeout(Pn),Pn=setTimeout(Vn,600)}),fi=lS(je=>{const Kt=je.msg.match(/^([^:\n]+\.js):\s/);if(!Kt)return;const ai=Kt[1];if(je.level==="error")oe.add(ai),c(De).has(ai)||m(De,new Set([...c(De),ai]),!0);else if(oe.has(ai)){oe.delete(ai);const Yi=new Set(c(De));Yi.delete(ai),m(De,Yi,!0)}const tn=c(d).find(Yi=>Yi.path===ai);tn&&(tn.logEntries=[...tn.logEntries.slice(-199),je],tn.path===c(u)&&c(C)&&c(he)&&ul().then(()=>{c(he)&&(c(he).scrollTop=c(he).scrollHeight)}))}),Ii=ar("script:running",je=>{const Kt=je.path;if(je.running)m(ge,new Set([...c(ge),Kt]),!0);else{const ai=new Set(c(ge));ai.delete(Kt),m(ge,ai,!0)}}),await G(),Dt();try{const je=await Il();typeof je.gitAutoCommit=="boolean"&&m(y,je.gitAutoCommit,!0),typeof je.gitAutoPush=="boolean"&&m(w,je.gitAutoPush,!0)}catch{}try{const je=await getDaemonStatus();m(ge,new Set(je.runningScripts??[]),!0)}catch{}const q=JSON.parse(localStorage.getItem(Qe)??"[]"),ue=localStorage.getItem(ae);for(const je of q)await ke(je,!1);const ct=ue&&c(d).some(je=>je.path===ue)?ue:((ft=c(d)[0])==null?void 0:ft.path)??null;ct&&await vt(ct),Ae=!0}),Tp(()=>{var q;window.removeEventListener("beforeunload",lt),Zt==null||Zt.disconnect(),Pn&&clearTimeout(Pn),fi==null||fi(),Ii==null||Ii();for(const ue of c(d))(q=ue.model)==null||q.dispose();Ai==null||Ai.dispose(),St==null||St.dispose()});async function G(){try{if(m(t,await M$(),!0),!X){let ue=function(ct){for(const ft of ct)ft.type==="dir"&&(q[ft.path]=!0,ft.children&&ue(ft.children))};X=!0;const q={};ue(c(t)),m(i,q,!0)}m(g,"")}catch(q){m(g,q.message,!0)}}function re(q){c(i)[q]=!c(i)[q]}function Ne(q){switch(q){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"⇓";case"JSON":case"JSONC":return"{}";default:return q}}async function it(q,ue){try{ue?await Gl(`${q}/.shelib`,""):await Ox(`${q}/.shelib`),await G(),await Ge("all",ue?`lib ${q}`:`unlib ${q}`)}catch(ct){m(g,ct.message,!0)}}async function Pe(q,ue){const ct=q.split("/").pop(),ft=q.includes("/")?q.slice(0,q.lastIndexOf("/")):"",je=ft?`${ft}/.shedisable-${ct}`:`.shedisable-${ct}`;try{ue?await Gl(je,""):await Ox(je),await G(),await Ge("all",ue?`disable ${q}`:`enable ${q}`)}catch(Kt){m(g,Kt.message,!0)}}async function ke(q,ue=!0){var ct;if(c(d).some(ft=>ft.path===q)){ue&&await vt(q);return}try{const{content:ft}=await Nx(q),je=w7.parse(`file:///she-scripts/${encodeURIComponent(q)}`);(ct=xr.getModel(je))==null||ct.dispose();const Kt=xr.createModel(ft,Ys(q),je);m(d,[...c(d),{path:q,dirty:!1,savedContent:ft,model:Kt,logEntries:[]}],!0),ue&&await vt(q)}catch(ft){m(g,ft.message,!0)}}async function bt(q){await ke(q,!0)}async function vt(q){var ct,ft;const ue=c(d).find(je=>je.path===q);ue!=null&&ue.model&&(pt(),m(nt,null),m(u,q,!0),ki=!0,St.setModel(ue.model),ki=!1,Vn(),await ul(),(ft=(ct=c(Ft))==null?void 0:ct.querySelector(`[data-tab-path="${CSS.escape(q)}"]`))==null||ft.scrollIntoView({inline:"nearest",block:"nearest"}),mt())}async function Fe(q){var ft;const ue=c(d).find(je=>je.path===q);if(!ue||ue.dirty&&!await Z.show(`Discard unsaved changes to ${q}?`,{confirm:"Discard"}))return;const ct=c(d).findIndex(je=>je.path===q);if((ft=ue.model)==null||ft.dispose(),m(d,c(d).filter(je=>je.path!==q),!0),c(u)===q){const je=c(d)[ct]??c(d)[ct-1]??null;je?await vt(je.path):(m(u,null),St.setModel(Ai))}}async function Dt(){try{m(b,await N$(),!0)}catch{m(b,null)}}async function Ge(q,ue){if(c(b))try{if(q==="all"?await rA(ue):await oA(q,ue),c(w))try{await Hx()}catch{}await Dt()}catch{}}async function ze(){if(!c(u))return;const q=c(d).find(ue=>ue.path===c(u));if(q){m(f,!0);try{const ue=St.getValue();await Gl(c(u),ue),q.savedContent=ue,q.dirty=!1,m(g,""),c(y)?await Ge([c(u)],`update ${c(u)}`):Dt()}catch(ue){m(g,ue.message,!0)}finally{m(f,!1)}}}async function Je(){if(!c(u)||(await ze(),c(g)))return;const q=await J.show("Commit message:",{initial:`update ${c(u)}`,placeholder:"Update script",confirm:"Commit"});if(q)try{if(await W$(c(u),q),c(w))try{await Hx()}catch{}Dt()}catch(ue){m(g,"Git: "+ue.message)}}async function Ct(){m(p,!1);try{await Hx(),await Dt(),m(g,"")}catch(q){m(g,"Git push: "+q.message)}}function $e(q){const ue=Date.now()-new Date(q).getTime(),ct=Math.floor(ue/1e3);if(ct<60)return"just now";const ft=Math.floor(ct/60);if(ft<60)return`${ft}m ago`;const je=Math.floor(ft/60);if(je<24)return`${je}h ago`;const Kt=Math.floor(je/24);if(Kt<30)return`${Kt}d ago`;const ai=Math.floor(Kt/30);return ai<12?`${ai}mo ago`:`${Math.floor(ai/12)}y ago`}async function It(q){Fi(),m(A,q,!0),m(P,[],!0),m(R,30),await Me()}async function Me(){if(c(A)){m(M,!0);try{m(P,await z$(c(A).path,c(R)),!0)}catch{}finally{m(M,!1)}}}async function st(){m(R,c(R)+30),await Me()}function Lt(){m(A,null),m(P,[],!0),pt()}async function Ht(q){if(!c(A))return;pt(),await bt(c(A).path);let ue;try{ue=await V$(q.hash,c(A).path)}catch{return}if(m(de,q.hash,!0),m(te,ue.binary,!0),m(ne,!0),ue.binary||ue.content===null)return;let ct="";const ft=c(d).find(Kt=>Kt.path===c(A).path);if(ft!=null&&ft.model)ct=ft.model.getValue();else try{ct=(await Nx(c(A).path)).content}catch{}if(await ul(),!c(T))return;const je=Ys(c(A).path);W=xr.createModel(ue.content,je),Q=xr.createModel(ct,je),V=xr.createDiffEditor(c(T),{theme:"vs-dark",readOnly:!0,renderSideBySide:!0,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,scrollBeyondLastLine:!1}),V.setModel({original:W,modified:Q})}function pt(){m(ne,!1),m(te,!1),V==null||V.dispose(),V=null,W==null||W.dispose(),W=null,Q==null||Q.dispose(),Q=null}async function vi(){const q=c(n)?`${c(n)}/`:"",ue=await J.show("New script name:",{placeholder:q?`${q}myscript.js`:"myscript.js",initial:q,confirm:"Create"});if(!ue)return;const ct=ue.endsWith(".js")?`/* global she */
217
217
  'use strict';
218
218
 
219
- `:"";await Gl(ue,ct),await G(),await ke(ue,!0)}async function wi(){const q=c(n)?`${c(n)}/`:"",ue=await J.show("New folder name:",{placeholder:q?`${q}subfolder`:"myfolder",initial:q,confirm:"Create"});ue&&(await R$(ue),c(i)[ue]=!0,await G())}function qi(q,ue){q.preventDefault(),m(s,{x:q.clientX,y:q.clientY,entry:ue},!0)}function Fi(){m(s,null)}async function Gi(q){Fi(),m(n,q,!0),c(i)[q]=!0,await vi()}async function Li(q){Fi(),m(n,q,!0),await wi()}async function ni(q){Fi();const ue=q.path.includes("/")?q.path.slice(0,q.path.lastIndexOf("/")+1):"",ct=await J.show(q.type==="dir"?"Rename folder:":"Rename script:",{initial:q.name,placeholder:q.name,confirm:"Rename"});if(!ct||ct===q.name)return;const ft=ue+ct;try{await sA(q.path,ft);const je=c(d).find(Kt=>Kt.path===q.path);je&&(je.path=ft,c(u)===q.path&&m(u,ft)),await G(),await Ge("all",`rename ${q.path} → ${ft}`)}catch(je){m(g,je.message,!0)}}function ii(q){if(!q.children)return 0;let ue=0;for(const ct of q.children)ue++,ct.type==="dir"&&(ue+=ii(ct));return ue}async function Xi(q){Fi();let ue=`Delete ${q.type==="dir"?"folder":"file"} "${q.path}"?`;if(q.type==="dir"){const ct=ii(q);ct>0&&(ue+=` This will also delete ${ct} item${ct===1?"":"s"} inside.`)}if(await Z.show(ue,{confirm:"Delete",danger:!0})){if(q.type==="dir")for(const ct of[...c(d)])ct.path.startsWith(q.path+"/")&&await Fe(ct.path);else await Fe(q.path);await Ox(q.path),await G(),await Ge("all",`delete ${q.path}`)}}async function Ji(q){Fi();const{content:ue}=await Nx(q.path);c(Se).some(ct=>ct.name===q.path)||m(Se,[...c(Se),{name:q.path,content:ue}],!0),m(qe,!0)}function Ln(q,ue){var ct;m(r,ue,!0),(ct=q.dataTransfer)==null||ct.setData("text/plain",ue)}function Jn(q,ue){if(q.preventDefault(),c(r)&&(c(r)===ue||ue.startsWith(c(r)+"/"))){q.dataTransfer&&(q.dataTransfer.dropEffect="none"),m(a,null);return}q.dataTransfer&&(q.dataTransfer.dropEffect="move"),m(a,ue,!0)}function Ss(){m(a,null)}async function as(q,ue){var ai,tn,Yi;q.preventDefault(),m(a,null);const ct=Array.from(((ai=q.dataTransfer)==null?void 0:ai.items)??[]).filter(cn=>cn.kind==="file");if(ct.length>0&&!c(r)){for(const cn of ct){const Cn=(tn=cn.webkitGetAsEntry)==null?void 0:tn.call(cn);Cn&&await Bs(Cn,ue,!0)}await G();return}const ft=c(r)??((Yi=q.dataTransfer)==null?void 0:Yi.getData("text/plain"));if(m(r,null),!ft||ft===ue||ue.startsWith(ft+"/"))return;const je=ft.split("/").pop(),Kt=ue?`${ue}/${je}`:je;if(Kt!==ft)try{await sA(ft,Kt);for(const cn of c(d))if(cn.path===ft)c(u)===ft&&m(u,Kt,!0),cn.path=Kt;else if(cn.path.startsWith(ft+"/")){const Cn=Kt+cn.path.slice(ft.length);c(u)===cn.path&&m(u,Cn),cn.path=Cn}await G(),await Ge("all",`rename ${ft} → ${Kt}`)}catch(cn){m(g,cn.message,!0)}}async function Bs(q,ue,ct){if(q.isFile){const je=await(await new Promise((ai,tn)=>q.file(ai,tn))).text(),Kt=ue?`${ue}/${q.name}`:q.name;await Gl(Kt,je),ct&&q.name.endsWith(".js")&&await Pe(Kt,!0)}else if(q.isDirectory){const ft=q.createReader();let je=[],Kt;do Kt=await new Promise((ai,tn)=>ft.readEntries(ai,tn)),je=[...je,...Kt];while(Kt.length>0);for(const ai of je)await Bs(ai,ue?`${ue}/${q.name}`:q.name,!1);if(ct){const ai=ue?`${ue}/${q.name}`:q.name;await Pe(ai,!0)}}}async function kn(){if(!c(u)||!await Z.show(`Delete ${c(u)}?`,{confirm:"Delete",danger:!0}))return;const q=c(u);await Fe(q),await Ox(q),await G(),await Ge("all",`delete ${q}`)}function ss(){c(ce)&&(c(ce).logEntries=[])}function ps(){m(C,!c(C)),localStorage.setItem(pe,String(c(C)))}function zi(q){return new Date(q).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ys(q){var ft;const ue=((ft=q.split(".").pop())==null?void 0:ft.toLowerCase())??"";return{js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",json:"json",jsonc:"json",md:"markdown",markdown:"markdown",yaml:"yaml",yml:"yaml",sh:"shell",bash:"shell",css:"css",html:"html",xml:"xml",ini:"ini",toml:"ini"}[ue]??"plaintext"}let Pn=null;async function Vn(){const q=c(d).find(ct=>ct.path===c(u));if(!(q!=null&&q.model))return;const ue=q.model;try{const Kt=(await(await(await ad.typescript.getJavaScriptWorker())(ue.uri)).getSyntacticDiagnostics(ue.uri.toString())).map(ai=>{const tn=ue.getPositionAt(ai.start??0),Yi=ue.getPositionAt((ai.start??0)+(ai.length??0));return{severity:S7.Error,startLineNumber:tn.lineNumber,startColumn:tn.column,endLineNumber:Yi.lineNumber,endColumn:Yi.column,message:typeof ai.messageText=="string"?ai.messageText:JSON.stringify(ai.messageText),source:"she-syntax"}});if(xr.setModelMarkers(ue,"she-syntax",Kt),c(u)){if(Kt.length>0)oe.add(c(u)),c(De).has(c(u))||m(De,new Set([...c(De),c(u)]),!0);else if(oe.has(c(u))){oe.delete(c(u));const ai=new Set(c(De));ai.delete(c(u)),m(De,ai,!0)}}}catch{}}function Ts(q){ri=!0,oi=q.clientX,xi=c(Ve),q.preventDefault()}function dr(q){Ut=!0,mi=q.clientY,He=c(ye),q.preventDefault()}function Or(q){Ye=!0,Qt=q.clientX,Gt=c(At),q.preventDefault()}function Za(q){gi=!0,Jt=q.clientY,fe=c(Ot),q.preventDefault()}function Xa(q){ri&&m(Ve,Math.max(140,Math.min(500,xi+q.clientX-oi)),!0),Ut&&m(ye,Math.max(60,Math.min(500,He-(q.clientY-mi))),!0),Ye&&m(At,Math.max(200,Math.min(700,Gt-(q.clientX-Qt))),!0),gi&&m(Ot,Math.max(80,Math.min(600,fe-(q.clientY-Jt))),!0)}function ur(){ri&&(ri=!1,localStorage.setItem("she-scripts-sidebar-width",String(c(Ve)))),Ut&&(Ut=!1,localStorage.setItem("she-scripts-log-height",String(c(ye)))),Ye&&(Ye=!1,localStorage.setItem("she-scripts-chat-width",String(c(At)))),gi&&(gi=!1,localStorage.setItem("she-scripts-history-height",String(c(Ot))))}function ga(q){(q.ctrlKey||q.metaKey)&&q.key==="s"&&(q.preventDefault(),ze()),q.key==="Escape"&&(m(p,!1),m(s,null),m(_t,!1))}async function Hr(q,ue){const ct=await J.show("Save new script as:",{placeholder:"myscript.js",initial:q,confirm:"Create"});if(ct)try{await Gl(ct,ue),await G(),await ke(ct,!0)}catch(ft){m(g,ft.message,!0)}}async function Fb(q){var ct,ft;if(c(qt)&&c(u)){m(nt,q,!0),await Oo();return}if(m(nt,q,!0),await ul(),!c(Ee))return;Y==null||Y.dispose(),Oe==null||Oe.dispose(),Le==null||Le.dispose();const ue=((ft=(ct=c(ce))==null?void 0:ct.model)==null?void 0:ft.getValue())??"";Y=xr.createModel(ue,"javascript"),Oe=xr.createModel(q,"javascript"),Le=xr.createDiffEditor(c(Ee),{theme:"vs-dark",readOnly:!0,renderSideBySide:!0,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,scrollBeyondLastLine:!1}),Le.setModel({original:Y,modified:Oe})}$n(()=>{c(u),m(qt,!1),m(se,!1)});async function Oo(){if(c(nt)===null||!c(u))return;const q=c(nt);m(nt,null);const ue=c(d).find(ct=>ct.path===c(u));ue!=null&&ue.model&&(ki=!0,ue.model.setValue(q),ki=!1,ue.dirty=!1,ue.savedContent=q);try{await Gl(c(u),q),m(g,""),c(y)?await Ge([c(u)],`update ${c(u)}`):Dt()}catch(ct){m(g,ct.message,!0)}lf()}function Lb(){m(nt,null),lf()}function lf(){Le==null||Le.dispose(),Le=null,Y==null||Y.dispose(),Y=null,Oe==null||Oe.dispose(),Oe=null}var Wr=iZ();fs("keydown",Dd,ga),fs("mousemove",Dd,Xa),fs("mouseup",Dd,ur);var cf=yt(Wr);us(qc(cf,{}),q=>Z=q,()=>Z);var df=v(cf,2);us(KU(df,{}),q=>J=q,()=>J);var Xu=v(df,2);{var Ib=q=>{var ue=YG(),ct=yt(ue),ft=v(ct,2);let je;var Kt=_(ft);{var ai=Yi=>{var cn=KG(),Cn=yt(cn),gn=v(Cn,2),En=v(gn,4),bn=v(En,2);$("click",Cn,()=>Gi(c(s).entry.path)),$("click",gn,()=>Li(c(s).entry.path)),$("click",En,()=>ni(c(s).entry)),$("click",bn,()=>Xi(c(s).entry)),D(Yi,cn)},tn=Yi=>{var cn=XG(),Cn=yt(cn),gn=v(Cn,2),En=v(gn,2),bn=v(En,2);{var yn=pn=>{var Hn=ZG();$("click",Hn,()=>It(c(s).entry)),D(pn,Hn)};z(bn,pn=>{c(b)&&pn(yn)})}var ls=v(bn,4);$("click",Cn,()=>Ct(c(s).entry.path)),$("click",gn,()=>ni(c(s).entry)),$("click",En,()=>Ji(c(s).entry)),$("click",ls,()=>Xi(c(s).entry)),D(Yi,cn)};z(Kt,Yi=>{c(s).entry.type==="dir"?Yi(ai):Yi(tn,-1)})}j(()=>je=$o(ft,"",je,{left:`${c(s).x??""}px`,top:`${c(s).y??""}px`})),$("click",ct,Fi),$("contextmenu",ct,Yi=>{Yi.preventDefault(),Fi()}),D(q,ue)};z(Xu,q=>{c(s)&&q(Ib)})}var uf=v(Xu,2);{var Gp=q=>{var ue=QG();let ct;j(()=>ct=$o(ue,"",ct,{left:`${c(Oi).x??""}px`,top:`${c(Oi).y-4}px`})),D(q,ue)};z(uf,q=>{c(Oi)&&q(Gp)})}var Kp=v(uf,2),hf=_(Kp);let Yu;{const q=(ft,je=tb,Kt)=>{let ai=n9(()=>I7(Kt==null?void 0:Kt(),!1));var tn=Es(),Yi=yt(tn);{var cn=gn=>{var En=eK(),bn=_(En);let yn;var ls=_(bn);let pn;var Hn=v(ls,2);let Ms;var mo=_(Hn),Rs=v(Hn,2);{var Ds=x=>{var E=IA();D(x,E)},cs=Tt(()=>c(ot).has(je().path)||c(rt).has(je().path));z(Rs,x=>{c(cs)&&x(Ds)})}var ns=v(Rs,2),qs=_(ns),Bn=v(ns,2),hs=_(Bn),l=v(bn,2);{var h=x=>{var E=JG();ei(E,21,()=>je().children,k=>k.path,(k,N)=>{q(k,()=>c(N),()=>je().disabled||c(ai))}),D(x,E)};z(l,x=>{c(i)[je().path]&&je().children&&x(h)})}j(()=>{yn=Bt(bn,1,"dir-row svelte-1pyfjii",null,yn,{"dir-selected":c(n)===je().path,"drag-target":c(a)===je().path}),ln(bn,"aria-selected",c(n)===je().path),pn=Bt(ls,1,"chevron svelte-1pyfjii",null,pn,{open:c(i)[je().path]}),Ms=Bt(Hn,1,"dir-name svelte-1pyfjii",null,Ms,{lib:je().lib}),O(mo,je().name),oa(qs,je().lib),oa(hs,je().disabled)}),fs("dragstart",bn,x=>Ln(x,je().path)),fs("dragover",bn,x=>Jn(x,je().path)),fs("dragleave",bn,Ss),fs("drop",bn,x=>as(x,je().path)),$("contextmenu",bn,x=>qi(x,je())),$("click",ls,()=>re(je().path)),$("click",Hn,()=>{m(n,je().path,!0),c(i)[je().path]=!0}),$("keydown",Hn,x=>x.key==="Enter"&&m(n,je().path,!0)),fs("mouseenter",ns,Qi),fs("mouseleave",ns,yi),$("change",qs,()=>it(je().path,!je().lib)),$("change",hs,()=>Pe(je().path,!je().disabled)),D(gn,En)},Cn=gn=>{const En=Tt(()=>c(De).has(je().path)),bn=Tt(()=>c(ot).has(je().path)),yn=Tt(()=>c(d).some(hi=>hi.path===je().path&&hi.dirty)),ls=Tt(()=>(je().name.split(".").pop()??"txt").toUpperCase()),pn=Tt(()=>je().name.endsWith(".js"));var Hn=rK();let Ms;var mo=_(Hn),Rs=_(mo);let Ds;var cs=_(Rs);let ns;var qs=_(cs),Bn=v(cs,2),hs=_(Bn),l=v(Bn,2);{var h=hi=>{var un=IA();D(hi,un)};z(l,hi=>{c(bn)&&hi(h)})}var x=v(l);{var E=hi=>{var un=tK();D(hi,un)};z(x,hi=>{c(yn)&&hi(E)})}var k=v(x,2);{var N=hi=>{var un=iK();D(hi,un)},ie=Tt(()=>c(pn)&&c(ge).has(je().path)&&!c(En));z(k,hi=>{c(ie)&&hi(N)})}var ve=v(k,2);{var Ce=hi=>{var un=nK();D(hi,un)};z(ve,hi=>{c(En)&&hi(Ce)})}var Et=v(Rs,2);{var li=hi=>{var un=sK();let In;var _s=_(un);j(()=>{In=Bt(un,1,"dis-label svelte-1pyfjii",null,In,{"dis-locked":c(ai)}),ln(un,"title",c(ai)?"Disabled by parent directory":"Disable — this script will not be executed"),oa(_s,je().disabled),_s.disabled=c(ai)}),$("change",_s,()=>Pe(je().path,!je().disabled)),D(hi,un)},Ki=hi=>{var un=oK();D(hi,un)};z(Et,hi=>{c(pn)?hi(li):hi(Ki,-1)})}j((hi,un,In)=>{Ms=Bt(Hn,1,"tree-file svelte-1pyfjii",null,Ms,hi),Ds=Bt(Rs,1,"svelte-1pyfjii",null,Ds,{lib:je().lib,dis:je().disabled,err:c(En)}),ns=Bt(cs,1,`badge badge-${un??""}`,"svelte-1pyfjii",ns,{"badge-shelib":je().lib}),O(qs,In),O(hs,je().name)},[()=>({active:c(d).some(hi=>hi.path===je().path),"active-tab":je().path===c(u)}),()=>c(ls).toLowerCase(),()=>Ne(c(ls))]),fs("dragstart",Hn,hi=>Ln(hi,je().path)),$("contextmenu",Hn,hi=>qi(hi,je())),$("click",Rs,()=>Ct(je().path)),D(gn,Hn)};z(Yi,gn=>{je().type==="dir"?gn(cn):gn(Cn,-1)})}D(ft,tn)};var Zp=_(hf),ff=_(Zp),gf=v(ff,2),Wl=v(gf,2);let ue;var Ya=v(Wl,2),Xp=v(Zp,2);{var Gc=ft=>{var je=aK(),Kt=_(je);j(()=>O(Kt,c(g))),D(ft,je)};z(Xp,ft=>{c(g)&&ft(Gc)})}var Ao=v(Xp,2);{var Yp=ft=>{var je=CK(),Kt=_(je),ai=_(Kt);let tn;var Yi=v(ai,2);let cn;var Cn=v(Yi,2),gn=v(Kt,2),En=_(gn);us(En,Bn=>m(at,Bn),()=>c(at));var bn=v(En,2);{var yn=Bn=>{var hs=lK(),l=yt(hs);let h;var x=v(l,2);let E;var k=v(x,2);let N;j(()=>{h=Bt(l,1,"svelte-1pyfjii",null,h,{active:c(We)}),E=Bt(x,1,"svelte-1pyfjii",null,E,{active:c(_e)}),N=Bt(k,1,"svelte-1pyfjii",null,N,{active:c(dt)})}),$("click",l,()=>{m(We,!c(We)),Ui()}),$("click",x,()=>{m(_e,!c(_e)),Ui()}),$("click",k,()=>m(dt,!c(dt))),D(Bn,hs)};z(bn,Bn=>{c(xe)==="text"&&Bn(yn)})}var ls=v(gn,2);{var pn=Bn=>{var hs=cK(),l=_(hs),h=v(l,2),x=_(h);j(E=>{h.disabled=E,O(x,c(ui)?"…":"Preview")},[()=>!c(et).trim()||c(tt).length===0||c(ui)]),jt(l,()=>c(Wt),E=>m(Wt,E)),$("click",h,an),D(Bn,hs)};z(ls,Bn=>{c(xe)==="text"&&c(dt)&&Bn(pn)})}var Hn=v(ls,2),Ms=_(Hn);{var mo=Bn=>{var hs=dK();D(Bn,hs)},Rs=Bn=>{var hs=uK(),l=_(hs);j(()=>O(l,c(ut))),D(Bn,hs)},Ds=Bn=>{var hs=Es(),l=yt(hs);{var h=E=>{var k=Es(),N=yt(k);{var ie=Ce=>{var Et=hK();D(Ce,Et)},ve=Ce=>{var Et=UC(),li=yt(Et);{var Ki=un=>{var In=fK();D(un,In)};z(li,un=>{c(be)&&un(Ki)})}var hi=v(li,2);ei(hi,17,()=>c(tt),Ni,(un,In)=>{var _s=pK(),Ns=_(_s),Vr=_(Ns),Wb=_(Vr),zb=v(Vr,2),Vb=_(zb),cx=v(Ns,2);ei(cx,17,()=>c(In).matches,Ni,(jb,rh)=>{var As=gK(),Jc=_(As),$b=_(Jc),Ub=v(Jc,2),qb=_(Ub);j(()=>{O($b,c(rh).line),O(qb,c(rh).preview)}),$("click",As,()=>Bi(c(In).path,c(rh))),D(jb,As)}),j(()=>{O(Wb,c(In).path),O(Vb,c(In).matches.length)}),$("click",Ns,()=>Ct(c(In).path)),D(un,_s)}),D(Ce,Et)};z(N,Ce=>{c(tt).length===0?Ce(ie):Ce(ve,-1)})}D(E,k)},x=E=>{var k=Es(),N=yt(k);{var ie=Ce=>{var Et=xK();D(Ce,Et)},ve=Ce=>{var Et=UC(),li=yt(Et);{var Ki=un=>{var In=mK();D(un,In)};z(li,un=>{c(be)&&un(Ki)})}var hi=v(li,2);ei(hi,17,()=>c(kt),Ni,(un,In)=>{var _s=vK(),Ns=_(_s),Vr=_(Ns);j(()=>O(Vr,c(In))),$("click",_s,()=>vt(c(In))),D(un,_s)}),D(Ce,Et)};z(N,Ce=>{c(kt).length===0?Ce(ie):Ce(ve,-1)})}D(E,k)};z(l,E=>{c(xe)==="text"?E(h):E(x,-1)})}D(Bn,hs)},cs=Tt(()=>c(et).trim());z(Ms,Bn=>{c(Rt)?Bn(mo):c(ut)?Bn(Rs,1):c(cs)&&Bn(Ds,2)})}var ns=v(Hn,2);{var qs=Bn=>{var hs=bK(),l=_(hs),h=_(l),x=_(h),E=v(h,2),k=_(E),N=v(k,2),ie=v(l,2);ei(ie,21,()=>c(Ze),Ni,(ve,Ce,Et)=>{var li=_K(),Ki=_(li),hi=v(Ki,2),un=_(hi),In=v(hi,2),_s=_(In);j(()=>{O(un,c(Ce).path),O(_s,`${c(Ce).changes??""}×`)}),Cs(Ki,()=>c(Ce).checked,Ns=>c(Ce).checked=Ns),D(ve,li)}),j((ve,Ce)=>{O(x,`Replace in ${ve??""} file(s)`),k.disabled=Ce},[()=>c(Ze).filter(ve=>ve.checked).length,()=>c(Ze).filter(ve=>ve.checked).length===0]),$("click",k,Zi),$("click",N,()=>m(Pt,!1)),D(Bn,hs)};z(ns,Bn=>{c(Pt)&&Bn(qs)})}j(()=>{tn=Bt(ai,1,"svelte-1pyfjii",null,tn,{active:c(xe)==="text"}),cn=Bt(Yi,1,"svelte-1pyfjii",null,cn,{active:c(xe)==="files"}),ln(En,"placeholder",c(xe)==="text"?"Find in files…":"Find files…")}),$("click",ai,()=>{m(xe,"text"),Ui()}),$("click",Yi,()=>{m(xe,"files"),Ui()}),$("click",Cn,Di),$("input",En,Ui),$("keydown",En,Bn=>Bn.key==="Escape"&&Di()),jt(En,()=>c(et),Bn=>m(et,Bn)),D(ft,je)};z(Ao,ft=>{c(Re)&&ft(Yp)})}var pf=v(Ao,2),Kc=_(pf);let ct;var xf=v(Kc,2);ei(xf,17,()=>c(t),ft=>ft.path,(ft,je)=>{q(ft,()=>c(je))});var mf=v(pf,2);{var Pb=ft=>{var je=DK();let Kt;var ai=_(je),tn=v(ai,2),Yi=_(tn),cn=_(Yi),Cn=v(Yi,2),gn=v(tn,2),En=_(gn);{var bn=pn=>{var Hn=EK();D(pn,Hn)},yn=pn=>{var Hn=yK();D(pn,Hn)},ls=pn=>{var Hn=UC(),Ms=yt(Hn);ei(Ms,17,()=>c(P),Ds=>Ds.hash,(Ds,cs)=>{var ns=wK(),qs=_(ns),Bn=_(qs),hs=v(qs,2),l=_(hs);j((h,x)=>{O(Bn,c(cs).subject),O(l,`${h??""} · ${x??""}`)},[()=>c(cs).hash.slice(0,7),()=>$e(c(cs).date)]),$("click",ns,()=>Ht(c(cs))),D(Ds,ns)});var mo=v(Ms,2);{var Rs=Ds=>{var cs=SK(),ns=_(cs);j(()=>{cs.disabled=c(M),O(ns,c(M)?"Loading…":"Load more")}),$("click",cs,st),D(Ds,cs)};z(mo,Ds=>{c(P).length>=c(R)&&Ds(Rs)})}D(pn,Hn)};z(En,pn=>{c(M)&&c(P).length===0?pn(bn):c(P).length===0?pn(yn,1):pn(ls,-1)})}j(()=>{Kt=$o(je,"",Kt,{height:`${c(Ot)??""}px`}),ln(Yi,"title",c(A).path),O(cn,`History: ${c(A).name??""}`)}),$("mousedown",ai,Za),$("click",Cn,Lt),D(ft,je)};z(mf,ft=>{c(A)&&ft(Pb)})}j(()=>{ue=Bt(Wl,1,"search-toggle svelte-1pyfjii",null,ue,{active:c(Re)}),ct=Bt(Kc,1,"tree-root-drop svelte-1pyfjii",null,ct,{"drag-target":c(a)===""})}),$("click",ff,vi),$("click",gf,wi),$("click",Wl,()=>c(Re)?Di():Ri("text")),$("click",Ya,G),fs("dragover",Kc,ft=>Jn(ft,"")),fs("dragleave",Kc,Ss),fs("drop",Kc,ft=>as(ft,""))}var Qp=v(hf,2),Jp=v(Qp,2),ex=_(Jp);{var Qo=q=>{var ue=BK(),ct=_(ue),ft=v(ct,2);ei(ft,21,()=>c(d),Kt=>Kt.path,(Kt,ai)=>{var tn=kK();let Yi;var cn=_(tn),Cn=_(cn),gn=v(cn,2);{var En=yn=>{var ls=AK();D(yn,ls)};z(gn,yn=>{c(ai).dirty&&yn(En)})}var bn=v(gn,2);j(yn=>{Yi=Bt(tn,1,"tab svelte-1pyfjii",null,Yi,{active:c(ai).path===c(u)}),ln(tn,"data-tab-path",c(ai).path),O(Cn,yn)},[()=>c(ai).path.split("/").pop()]),$("click",tn,()=>vt(c(ai).path)),$("keydown",tn,yn=>yn.key==="Enter"&&vt(c(ai).path)),$("click",bn,yn=>{yn.stopPropagation(),Fe(c(ai).path)}),D(Kt,tn)}),us(ft,Kt=>m(Ft,Kt),()=>c(Ft));var je=v(ft,2);j(()=>{ct.disabled=!c(Vt),je.disabled=!c(zt)}),$("click",ct,()=>Mi(-1)),fs("scroll",ft,mt),fs("wheel",ft,Kt=>{Kt.preventDefault(),c(Ft).scrollLeft+=Kt.deltaY,mt()}),$("click",je,()=>Mi(1)),D(q,ue)};z(ex,q=>{c(d).length>0&&q(Qo)})}var Qa=v(ex,2),tx=_(Qa),zr=_(tx),ix=v(tx,2);{var zl=q=>{var ue=NK(),ct=_(ue),ft=_(ct),je=v(ct,2);{var Kt=Cn=>{var gn=PK(),En=_(gn),bn=_(En),yn=v(En,2);{var ls=pn=>{var Hn=IK(),Ms=yt(Hn),mo=v(Ms,2),Rs=v(_(mo),2);ei(Rs,21,()=>c(b).changes,Ni,(l,h)=>{var x=FK(),E=_(x),k=v(E,2),N=_(k),ie=v(k,2),ve=_(ie);j(Ce=>{oa(E,Ce),O(N,c(h).status),O(ve,c(h).file)},[()=>c(K).has(c(h).file)]),$("change",E,()=>{const Ce=new Set(c(K));Ce.has(c(h).file)?Ce.delete(c(h).file):Ce.add(c(h).file),m(K,Ce,!0)}),D(l,x)});var Ds=v(Rs,2),cs=_(Ds),ns=v(cs,2),qs=_(ns),Bn=v(Ds,2);{var hs=l=>{var h=LK(),x=_(h);j(()=>O(x,c(H))),D(l,h)};z(Bn,l=>{c(H)&&l(hs)})}j(l=>{var h;ns.disabled=l,O(qs,c(F)?"…":c(K).size===((h=c(b))==null?void 0:h.changes.length)?"Commit all":`Commit ${c(K).size}`)},[()=>!c(Xt).trim()||c(F)||c(K).size===0]),$("click",Ms,()=>m(ht,!1)),$("keydown",cs,l=>l.key==="Enter"&&le()),jt(cs,()=>c(Xt),l=>m(Xt,l)),$("click",ns,le),D(pn,Hn)};z(yn,pn=>{c(ht)&&pn(ls)})}j(()=>{ln(En,"title",`${c(b).changes.length??""} uncommitted change(s) — click to view`),O(bn,`✎${c(b).changes.length??""}`)}),$("click",En,()=>{c(ht)||m(K,new Set(c(b).changes.map(pn=>pn.file)),!0),m(ht,!c(ht)),m(H,"")}),D(Cn,gn)};z(je,Cn=>{c(b).changes.length>0&&Cn(Kt)})}var ai=v(je,2);{var tn=Cn=>{var gn=MK(),En=_(gn),bn=_(En),yn=v(En,2);{var ls=pn=>{var Hn=TK(),Ms=yt(Hn),mo=v(Ms,2),Rs=_(mo),Ds=_(Rs),cs=v(Rs,2),ns=_(cs);j(()=>O(Ds,`${c(b).ahead??""} unpushed commit(s)`)),$("click",Ms,()=>m(_t,!1)),$("click",ns,()=>{m(_t,!1),bt()}),D(pn,Hn)};z(yn,pn=>{c(_t)&&pn(ls)})}j(()=>{ln(En,"title",`${c(b).ahead??""} commit(s) ahead of upstream — click to push`),O(bn,`↑${c(b).ahead??""}`)}),$("click",En,()=>m(_t,!c(_t))),D(Cn,gn)};z(ai,Cn=>{c(b).ahead>0&&Cn(tn)})}var Yi=v(ai,2);{var cn=Cn=>{var gn=RK(),En=_(gn);j(()=>{ln(gn,"title",`${c(b).behind??""} commit(s) behind upstream`),O(En,`↓${c(b).behind??""}`)}),D(Cn,gn)};z(Yi,Cn=>{c(b).behind>0&&Cn(cn)})}j(()=>{ln(ct,"title",`Branch: ${c(b).branch??""}`),O(ft,`⎇ ${c(b).branch??""}`)}),D(q,ue)};z(ix,q=>{c(b)&&q(zl)})}var nx=v(ix,2),Vl=_(nx),Zc=_(Vl),Qu=_(Zc),sx=v(Zc,2),pa=v(Vl,2);{var Ju=q=>{var ue=OK(),ct=yt(ue),ft=v(ct,2),je=_(ft),Kt=v(je,2);$("click",ct,()=>m(p,!1)),$("click",je,()=>{m(p,!1),ze()}),$("click",Kt,()=>{m(p,!1),Je()}),D(q,ue)};z(pa,q=>{c(p)&&q(Ju)})}var ox=v(nx,2);{var vf=q=>{var ue=HK();$("click",ue,kn),D(q,ue)};z(ox,q=>{c(u)&&q(vf)})}var _f=v(ox,2);let hr;var Tb=v(Qa,2),Ja=_(Tb),rx=_(Ja),fr=_(rx);us(fr,q=>Xe=q,()=>Xe);var Xc=v(fr,2);{var ax=q=>{var ue=WK();D(q,ue)};z(Xc,q=>{c(u)||q(ax)})}var eh=v(Xc,2);{var th=q=>{var ue=$K(),ct=_(ue),ft=_(ct),je=v(_(ft)),Kt=_(je),ai=v(ft,2),tn=_(ai),Yi=_(tn),cn=_(Yi),Cn=_(cn),gn=v(cn,2),En=v(Yi,2);{var bn=pn=>{var Hn=jK(),Ms=yt(Hn),mo=v(Ms,2),Rs=_(mo);{var Ds=ns=>{var qs=zK();$("click",qs,()=>{m(se,!1),m(qt,!0),Oo()}),D(ns,qs)},cs=ns=>{var qs=VK();$("click",qs,()=>{m(se,!1),m(qt,!1)}),D(ns,qs)};z(Rs,ns=>{c(qt)?ns(cs,-1):ns(Ds)})}$("click",Ms,()=>m(se,!1)),D(pn,Hn)};z(En,pn=>{c(se)&&pn(bn)})}var yn=v(tn,2),ls=v(ct,2);us(ls,pn=>m(Ee,pn),()=>c(Ee)),j(pn=>{O(Kt,pn),O(Cn,c(qt)?"Auto-accept ✓":"Accept")},[()=>{var pn;return(pn=c(u))==null?void 0:pn.split("/").pop()}]),$("click",cn,Oo),$("click",gn,()=>m(se,!c(se))),$("click",yn,Lb),D(q,ue)};z(eh,q=>{c(nt)!==null&&q(th)})}var bf=v(eh,2);{var ih=q=>{var ue=GK(),ct=_(ue),ft=_(ct),je=v(_(ft)),Kt=_(je),ai=v(je,2),tn=_(ai),Yi=v(ft,2),cn=_(Yi),Cn=v(ct,2);{var gn=bn=>{var yn=UK();D(bn,yn)},En=bn=>{var yn=qK();us(yn,ls=>m(T,ls),()=>c(T)),D(bn,yn)};z(Cn,bn=>{c(te)?bn(gn):bn(En,-1)})}j(bn=>{var yn;O(Kt,bn),O(tn,(yn=c(A))==null?void 0:yn.name)},[()=>c(de).slice(0,7)]),$("click",cn,pt),D(q,ue)};z(bf,q=>{c(ne)&&q(ih)})}var xa=v(rx,2);let Yc,nh;var Cf=_(xa);{var Mb=q=>{var ue=KK();$("mousedown",ue,dr),D(q,ue)};z(Cf,q=>{c(C)&&q(Mb)})}var Qc=v(Cf,2),Ef=_(Qc),yf=_(Ef),Rb=v(yf);{var lx=q=>{var ue=ZK(),ct=_(ue);j(ft=>O(ct,`— ${ft??""}`),[()=>c(u).split("/").pop()]),D(q,ue)};z(Rb,q=>{c(u)&&q(lx)})}var Nb=v(Ef,2);{var gr=q=>{var ue=YK(),ct=yt(ue);ei(ct,21,()=>Wi,Ni,(tn,Yi)=>{var cn=XK(),Cn=_(cn),gn={};j(()=>{O(Cn,c(Yi)),gn!==(gn=c(Yi))&&(cn.value=(cn.__value=c(Yi))??"")}),D(tn,cn)});var ft=v(ct,2),je=v(ft,2),Kt=_(je),ai=v(je,2);Fs(ct,()=>c(gt),tn=>m(gt,tn)),jt(ft,()=>c(Yt),tn=>m(Yt,tn)),Cs(Kt,()=>c(Ci),tn=>m(Ci,tn)),$("click",ai,ss),D(q,ue)};z(Nb,q=>{c(C)&&q(gr)})}var sh=v(Qc,2);{var Ob=q=>{var ue=eZ(),ct=_(ue);ei(ct,17,()=>{var Kt;return(((Kt=c(ce))==null?void 0:Kt.logEntries)??[]).filter(Ti)},Kt=>Kt.ts+Kt.msg,(Kt,ai)=>{var tn=QK(),Yi=_(tn),cn=_(Yi),Cn=v(Yi,2),gn=_(Cn),En=v(Cn,2),bn=_(En);j((yn,ls)=>{Bt(tn,1,`log-line ${c(ai).level??""}`,"svelte-1pyfjii"),O(cn,yn),O(gn,ls),O(bn,c(ai).msg)},[()=>zi(c(ai).ts),()=>c(ai).level.toUpperCase()]),D(Kt,tn)});var ft=v(ct,2);{var je=Kt=>{var ai=JK();D(Kt,ai)};z(ft,Kt=>{var ai;(((ai=c(ce))==null?void 0:ai.logEntries.length)??0)===0&&Kt(je)})}us(ue,Kt=>m(he,Kt),()=>c(he)),D(q,ue)};z(sh,q=>{c(C)&&q(Ob)})}var oh=v(Ja,2);{var Hb=q=>{var ue=tZ(),ct=yt(ue),ft=v(ct,2);let je;var Kt=_(ft);TG(Kt,{get currentScript(){return c(Ke)},onApply:Fb,onCreateFile:Hr,get extraFiles(){return c(Se)},set extraFiles(ai){m(Se,ai,!0)}}),j(()=>je=$o(ft,"",je,{width:`${c(At)??""}px`})),$("mousedown",ct,Or),D(q,ue)};z(oh,q=>{c(qe)&&q(Hb)})}j(()=>{var q;Yu=$o(hf,"",Yu,{width:`${c(Ve)??""}px`}),O(zr,c(u)??"No file selected"),Zc.disabled=!((q=c(ce))!=null&&q.dirty)||c(f),O(Qu,c(f)?"Saving…":"Save"),sx.disabled=!c(u),hr=Bt(_f,1,"ai-toggle svelte-1pyfjii",null,hr,{"ai-open":c(qe)}),ln(_f,"title",c(qe)?"Close AI assistant":"Open AI assistant"),Yc=Bt(xa,1,"log-panel svelte-1pyfjii",null,Yc,{collapsed:!c(C)}),nh=$o(xa,"",nh,{height:c(C)?`${c(ye)}px`:"26px"}),O(yf,`${c(C)?"▾":"▸"} Script Log `)}),$("keydown",Kp,_n),$("mousedown",Qp,Ts),$("click",Zc,ze),$("click",sx,()=>m(p,!c(p))),$("click",_f,()=>m(qe,!c(qe))),$("click",Ef,ps),D(o,Wr),js()}Zs(["click","contextmenu","keydown","change","input","mousedown"]);const VF="she-theme";function sZ(){return localStorage.getItem(VF)??"dark"}function oZ(o){localStorage.setItem(VF,o);const e=document.documentElement;o==="system"?e.removeAttribute("data-theme"):e.setAttribute("data-theme",o)}var Qf={exports:{}};/* @preserve
219
+ `:"";await Gl(ue,ct),await G(),await ke(ue,!0)}async function wi(){const q=c(n)?`${c(n)}/`:"",ue=await J.show("New folder name:",{placeholder:q?`${q}subfolder`:"myfolder",initial:q,confirm:"Create"});ue&&(await R$(ue),c(i)[ue]=!0,await G())}function qi(q,ue){q.preventDefault(),m(s,{x:q.clientX,y:q.clientY,entry:ue},!0)}function Fi(){m(s,null)}async function Gi(q){Fi(),m(n,q,!0),c(i)[q]=!0,await vi()}async function Li(q){Fi(),m(n,q,!0),await wi()}async function ni(q){Fi();const ue=q.path.includes("/")?q.path.slice(0,q.path.lastIndexOf("/")+1):"",ct=await J.show(q.type==="dir"?"Rename folder:":"Rename script:",{initial:q.name,placeholder:q.name,confirm:"Rename"});if(!ct||ct===q.name)return;const ft=ue+ct;try{await sA(q.path,ft);const je=c(d).find(Kt=>Kt.path===q.path);je&&(je.path=ft,c(u)===q.path&&m(u,ft)),await G(),await Ge("all",`rename ${q.path} → ${ft}`)}catch(je){m(g,je.message,!0)}}function ii(q){if(!q.children)return 0;let ue=0;for(const ct of q.children)ue++,ct.type==="dir"&&(ue+=ii(ct));return ue}async function Xi(q){Fi();let ue=`Delete ${q.type==="dir"?"folder":"file"} "${q.path}"?`;if(q.type==="dir"){const ct=ii(q);ct>0&&(ue+=` This will also delete ${ct} item${ct===1?"":"s"} inside.`)}if(await Z.show(ue,{confirm:"Delete",danger:!0})){if(q.type==="dir")for(const ct of[...c(d)])ct.path.startsWith(q.path+"/")&&await Fe(ct.path);else await Fe(q.path);await Ox(q.path),await G(),await Ge("all",`delete ${q.path}`)}}async function Ji(q){Fi();const{content:ue}=await Nx(q.path);c(Se).some(ct=>ct.name===q.path)||m(Se,[...c(Se),{name:q.path,content:ue}],!0),m(qe,!0)}function Ln(q,ue){var ct;m(r,ue,!0),(ct=q.dataTransfer)==null||ct.setData("text/plain",ue)}function Jn(q,ue){if(q.preventDefault(),c(r)&&(c(r)===ue||ue.startsWith(c(r)+"/"))){q.dataTransfer&&(q.dataTransfer.dropEffect="none"),m(a,null);return}q.dataTransfer&&(q.dataTransfer.dropEffect="move"),m(a,ue,!0)}function Ss(){m(a,null)}async function as(q,ue){var ai,tn,Yi;q.preventDefault(),m(a,null);const ct=Array.from(((ai=q.dataTransfer)==null?void 0:ai.items)??[]).filter(cn=>cn.kind==="file");if(ct.length>0&&!c(r)){for(const cn of ct){const Cn=(tn=cn.webkitGetAsEntry)==null?void 0:tn.call(cn);Cn&&await Bs(Cn,ue,!0)}await G();return}const ft=c(r)??((Yi=q.dataTransfer)==null?void 0:Yi.getData("text/plain"));if(m(r,null),!ft||ft===ue||ue.startsWith(ft+"/"))return;const je=ft.split("/").pop(),Kt=ue?`${ue}/${je}`:je;if(Kt!==ft)try{await sA(ft,Kt);for(const cn of c(d))if(cn.path===ft)c(u)===ft&&m(u,Kt,!0),cn.path=Kt;else if(cn.path.startsWith(ft+"/")){const Cn=Kt+cn.path.slice(ft.length);c(u)===cn.path&&m(u,Cn),cn.path=Cn}await G(),await Ge("all",`rename ${ft} → ${Kt}`)}catch(cn){m(g,cn.message,!0)}}async function Bs(q,ue,ct){if(q.isFile){const je=await(await new Promise((ai,tn)=>q.file(ai,tn))).text(),Kt=ue?`${ue}/${q.name}`:q.name;await Gl(Kt,je),ct&&q.name.endsWith(".js")&&await Pe(Kt,!0)}else if(q.isDirectory){const ft=q.createReader();let je=[],Kt;do Kt=await new Promise((ai,tn)=>ft.readEntries(ai,tn)),je=[...je,...Kt];while(Kt.length>0);for(const ai of je)await Bs(ai,ue?`${ue}/${q.name}`:q.name,!1);if(ct){const ai=ue?`${ue}/${q.name}`:q.name;await Pe(ai,!0)}}}async function kn(){if(!c(u)||!await Z.show(`Delete ${c(u)}?`,{confirm:"Delete",danger:!0}))return;const q=c(u);await Fe(q),await Ox(q),await G(),await Ge("all",`delete ${q}`)}function ss(){c(ce)&&(c(ce).logEntries=[])}function ps(){m(C,!c(C)),localStorage.setItem(pe,String(c(C)))}function zi(q){return new Date(q).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ys(q){var ft;const ue=((ft=q.split(".").pop())==null?void 0:ft.toLowerCase())??"";return{js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",json:"json",jsonc:"json",md:"markdown",markdown:"markdown",yaml:"yaml",yml:"yaml",sh:"shell",bash:"shell",css:"css",html:"html",xml:"xml",ini:"ini",toml:"ini"}[ue]??"plaintext"}let Pn=null;async function Vn(){const q=c(d).find(ct=>ct.path===c(u));if(!(q!=null&&q.model))return;const ue=q.model;try{const Kt=(await(await(await ad.typescript.getJavaScriptWorker())(ue.uri)).getSyntacticDiagnostics(ue.uri.toString())).map(ai=>{const tn=ue.getPositionAt(ai.start??0),Yi=ue.getPositionAt((ai.start??0)+(ai.length??0));return{severity:S7.Error,startLineNumber:tn.lineNumber,startColumn:tn.column,endLineNumber:Yi.lineNumber,endColumn:Yi.column,message:typeof ai.messageText=="string"?ai.messageText:JSON.stringify(ai.messageText),source:"she-syntax"}});if(xr.setModelMarkers(ue,"she-syntax",Kt),c(u)){if(Kt.length>0)oe.add(c(u)),c(De).has(c(u))||m(De,new Set([...c(De),c(u)]),!0);else if(oe.has(c(u))){oe.delete(c(u));const ai=new Set(c(De));ai.delete(c(u)),m(De,ai,!0)}}}catch{}}function Ts(q){ri=!0,oi=q.clientX,xi=c(Ve),q.preventDefault()}function dr(q){Ut=!0,mi=q.clientY,He=c(ye),q.preventDefault()}function Or(q){Ye=!0,Qt=q.clientX,Gt=c(At),q.preventDefault()}function Za(q){gi=!0,Jt=q.clientY,fe=c(Ot),q.preventDefault()}function Xa(q){ri&&m(Ve,Math.max(140,Math.min(500,xi+q.clientX-oi)),!0),Ut&&m(ye,Math.max(60,Math.min(500,He-(q.clientY-mi))),!0),Ye&&m(At,Math.max(200,Math.min(700,Gt-(q.clientX-Qt))),!0),gi&&m(Ot,Math.max(80,Math.min(600,fe-(q.clientY-Jt))),!0)}function ur(){ri&&(ri=!1,localStorage.setItem("she-scripts-sidebar-width",String(c(Ve)))),Ut&&(Ut=!1,localStorage.setItem("she-scripts-log-height",String(c(ye)))),Ye&&(Ye=!1,localStorage.setItem("she-scripts-chat-width",String(c(At)))),gi&&(gi=!1,localStorage.setItem("she-scripts-history-height",String(c(Ot))))}function ga(q){(q.ctrlKey||q.metaKey)&&q.key==="s"&&(q.preventDefault(),ze()),q.key==="Escape"&&(m(p,!1),m(s,null),m(_t,!1))}async function Hr(q,ue){const ct=await J.show("Save new script as:",{placeholder:"myscript.js",initial:q,confirm:"Create"});if(ct)try{await Gl(ct,ue),await G(),await ke(ct,!0)}catch(ft){m(g,ft.message,!0)}}async function Fb(q){var ct,ft;if(c(qt)&&c(u)){m(nt,q,!0),await Oo();return}if(m(nt,q,!0),await ul(),!c(Ee))return;Y==null||Y.dispose(),Oe==null||Oe.dispose(),Le==null||Le.dispose();const ue=((ft=(ct=c(ce))==null?void 0:ct.model)==null?void 0:ft.getValue())??"";Y=xr.createModel(ue,"javascript"),Oe=xr.createModel(q,"javascript"),Le=xr.createDiffEditor(c(Ee),{theme:"vs-dark",readOnly:!0,renderSideBySide:!0,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,scrollBeyondLastLine:!1}),Le.setModel({original:Y,modified:Oe})}$n(()=>{c(u),m(qt,!1),m(se,!1)});async function Oo(){if(c(nt)===null||!c(u))return;const q=c(nt);m(nt,null);const ue=c(d).find(ct=>ct.path===c(u));ue!=null&&ue.model&&(ki=!0,ue.model.setValue(q),ki=!1,ue.dirty=!1,ue.savedContent=q);try{await Gl(c(u),q),m(g,""),c(y)?await Ge([c(u)],`update ${c(u)}`):Dt()}catch(ct){m(g,ct.message,!0)}lf()}function Lb(){m(nt,null),lf()}function lf(){Le==null||Le.dispose(),Le=null,Y==null||Y.dispose(),Y=null,Oe==null||Oe.dispose(),Oe=null}var Wr=iZ();fs("keydown",Dd,ga),fs("mousemove",Dd,Xa),fs("mouseup",Dd,ur);var cf=yt(Wr);us(qc(cf,{}),q=>Z=q,()=>Z);var df=v(cf,2);us(KU(df,{}),q=>J=q,()=>J);var Xu=v(df,2);{var Ib=q=>{var ue=YG(),ct=yt(ue),ft=v(ct,2);let je;var Kt=_(ft);{var ai=Yi=>{var cn=KG(),Cn=yt(cn),gn=v(Cn,2),En=v(gn,4),bn=v(En,2);$("click",Cn,()=>Gi(c(s).entry.path)),$("click",gn,()=>Li(c(s).entry.path)),$("click",En,()=>ni(c(s).entry)),$("click",bn,()=>Xi(c(s).entry)),D(Yi,cn)},tn=Yi=>{var cn=XG(),Cn=yt(cn),gn=v(Cn,2),En=v(gn,2),bn=v(En,2);{var yn=pn=>{var Hn=ZG();$("click",Hn,()=>It(c(s).entry)),D(pn,Hn)};z(bn,pn=>{c(b)&&pn(yn)})}var ls=v(bn,4);$("click",Cn,()=>bt(c(s).entry.path)),$("click",gn,()=>ni(c(s).entry)),$("click",En,()=>Ji(c(s).entry)),$("click",ls,()=>Xi(c(s).entry)),D(Yi,cn)};z(Kt,Yi=>{c(s).entry.type==="dir"?Yi(ai):Yi(tn,-1)})}j(()=>je=$o(ft,"",je,{left:`${c(s).x??""}px`,top:`${c(s).y??""}px`})),$("click",ct,Fi),$("contextmenu",ct,Yi=>{Yi.preventDefault(),Fi()}),D(q,ue)};z(Xu,q=>{c(s)&&q(Ib)})}var uf=v(Xu,2);{var Gp=q=>{var ue=QG();let ct;j(()=>ct=$o(ue,"",ct,{left:`${c(Oi).x??""}px`,top:`${c(Oi).y-4}px`})),D(q,ue)};z(uf,q=>{c(Oi)&&q(Gp)})}var Kp=v(uf,2),hf=_(Kp);let Yu;{const q=(ft,je=tb,Kt)=>{let ai=n9(()=>I7(Kt==null?void 0:Kt(),!1));var tn=Es(),Yi=yt(tn);{var cn=gn=>{var En=eK(),bn=_(En);let yn;var ls=_(bn);let pn;var Hn=v(ls,2);let Ms;var mo=_(Hn),Rs=v(Hn,2);{var Ds=x=>{var E=IA();D(x,E)},cs=Tt(()=>c(ot).has(je().path)||c(rt).has(je().path));z(Rs,x=>{c(cs)&&x(Ds)})}var ns=v(Rs,2),qs=_(ns),Bn=v(ns,2),hs=_(Bn),l=v(bn,2);{var h=x=>{var E=JG();ei(E,21,()=>je().children,k=>k.path,(k,N)=>{q(k,()=>c(N),()=>je().disabled||c(ai))}),D(x,E)};z(l,x=>{c(i)[je().path]&&je().children&&x(h)})}j(()=>{yn=Bt(bn,1,"dir-row svelte-1pyfjii",null,yn,{"dir-selected":c(n)===je().path,"drag-target":c(a)===je().path}),ln(bn,"aria-selected",c(n)===je().path),pn=Bt(ls,1,"chevron svelte-1pyfjii",null,pn,{open:c(i)[je().path]}),Ms=Bt(Hn,1,"dir-name svelte-1pyfjii",null,Ms,{lib:je().lib}),O(mo,je().name),oa(qs,je().lib),oa(hs,je().disabled)}),fs("dragstart",bn,x=>Ln(x,je().path)),fs("dragover",bn,x=>Jn(x,je().path)),fs("dragleave",bn,Ss),fs("drop",bn,x=>as(x,je().path)),$("contextmenu",bn,x=>qi(x,je())),$("click",ls,()=>re(je().path)),$("click",Hn,()=>{m(n,je().path,!0),c(i)[je().path]=!0}),$("keydown",Hn,x=>x.key==="Enter"&&m(n,je().path,!0)),fs("mouseenter",ns,Qi),fs("mouseleave",ns,yi),$("change",qs,()=>it(je().path,!je().lib)),$("change",hs,()=>Pe(je().path,!je().disabled)),D(gn,En)},Cn=gn=>{const En=Tt(()=>c(De).has(je().path)),bn=Tt(()=>c(ot).has(je().path)),yn=Tt(()=>c(d).some(hi=>hi.path===je().path&&hi.dirty)),ls=Tt(()=>(je().name.split(".").pop()??"txt").toUpperCase()),pn=Tt(()=>je().name.endsWith(".js"));var Hn=rK();let Ms;var mo=_(Hn),Rs=_(mo);let Ds;var cs=_(Rs);let ns;var qs=_(cs),Bn=v(cs,2),hs=_(Bn),l=v(Bn,2);{var h=hi=>{var un=IA();D(hi,un)};z(l,hi=>{c(bn)&&hi(h)})}var x=v(l);{var E=hi=>{var un=tK();D(hi,un)};z(x,hi=>{c(yn)&&hi(E)})}var k=v(x,2);{var N=hi=>{var un=iK();D(hi,un)},ie=Tt(()=>c(pn)&&c(ge).has(je().path)&&!c(En));z(k,hi=>{c(ie)&&hi(N)})}var ve=v(k,2);{var Ce=hi=>{var un=nK();D(hi,un)};z(ve,hi=>{c(En)&&hi(Ce)})}var Et=v(Rs,2);{var li=hi=>{var un=sK();let In;var _s=_(un);j(()=>{In=Bt(un,1,"dis-label svelte-1pyfjii",null,In,{"dis-locked":c(ai)}),ln(un,"title",c(ai)?"Disabled by parent directory":"Disable — this script will not be executed"),oa(_s,je().disabled),_s.disabled=c(ai)}),$("change",_s,()=>Pe(je().path,!je().disabled)),D(hi,un)},Ki=hi=>{var un=oK();D(hi,un)};z(Et,hi=>{c(pn)?hi(li):hi(Ki,-1)})}j((hi,un,In)=>{Ms=Bt(Hn,1,"tree-file svelte-1pyfjii",null,Ms,hi),Ds=Bt(Rs,1,"svelte-1pyfjii",null,Ds,{lib:je().lib,dis:je().disabled,err:c(En)}),ns=Bt(cs,1,`badge badge-${un??""}`,"svelte-1pyfjii",ns,{"badge-shelib":je().lib}),O(qs,In),O(hs,je().name)},[()=>({active:c(d).some(hi=>hi.path===je().path),"active-tab":je().path===c(u)}),()=>c(ls).toLowerCase(),()=>Ne(c(ls))]),fs("dragstart",Hn,hi=>Ln(hi,je().path)),$("contextmenu",Hn,hi=>qi(hi,je())),$("click",Rs,()=>bt(je().path)),D(gn,Hn)};z(Yi,gn=>{je().type==="dir"?gn(cn):gn(Cn,-1)})}D(ft,tn)};var Zp=_(hf),ff=_(Zp),gf=v(ff,2),Wl=v(gf,2);let ue;var Ya=v(Wl,2),Xp=v(Zp,2);{var Gc=ft=>{var je=aK(),Kt=_(je);j(()=>O(Kt,c(g))),D(ft,je)};z(Xp,ft=>{c(g)&&ft(Gc)})}var Ao=v(Xp,2);{var Yp=ft=>{var je=CK(),Kt=_(je),ai=_(Kt);let tn;var Yi=v(ai,2);let cn;var Cn=v(Yi,2),gn=v(Kt,2),En=_(gn);us(En,Bn=>m(at,Bn),()=>c(at));var bn=v(En,2);{var yn=Bn=>{var hs=lK(),l=yt(hs);let h;var x=v(l,2);let E;var k=v(x,2);let N;j(()=>{h=Bt(l,1,"svelte-1pyfjii",null,h,{active:c(We)}),E=Bt(x,1,"svelte-1pyfjii",null,E,{active:c(_e)}),N=Bt(k,1,"svelte-1pyfjii",null,N,{active:c(dt)})}),$("click",l,()=>{m(We,!c(We)),Ui()}),$("click",x,()=>{m(_e,!c(_e)),Ui()}),$("click",k,()=>m(dt,!c(dt))),D(Bn,hs)};z(bn,Bn=>{c(xe)==="text"&&Bn(yn)})}var ls=v(gn,2);{var pn=Bn=>{var hs=cK(),l=_(hs),h=v(l,2),x=_(h);j(E=>{h.disabled=E,O(x,c(ui)?"…":"Preview")},[()=>!c(et).trim()||c(tt).length===0||c(ui)]),jt(l,()=>c(Wt),E=>m(Wt,E)),$("click",h,an),D(Bn,hs)};z(ls,Bn=>{c(xe)==="text"&&c(dt)&&Bn(pn)})}var Hn=v(ls,2),Ms=_(Hn);{var mo=Bn=>{var hs=dK();D(Bn,hs)},Rs=Bn=>{var hs=uK(),l=_(hs);j(()=>O(l,c(ut))),D(Bn,hs)},Ds=Bn=>{var hs=Es(),l=yt(hs);{var h=E=>{var k=Es(),N=yt(k);{var ie=Ce=>{var Et=hK();D(Ce,Et)},ve=Ce=>{var Et=UC(),li=yt(Et);{var Ki=un=>{var In=fK();D(un,In)};z(li,un=>{c(be)&&un(Ki)})}var hi=v(li,2);ei(hi,17,()=>c(tt),Ni,(un,In)=>{var _s=pK(),Ns=_(_s),Vr=_(Ns),Wb=_(Vr),zb=v(Vr,2),Vb=_(zb),cx=v(Ns,2);ei(cx,17,()=>c(In).matches,Ni,(jb,rh)=>{var As=gK(),Jc=_(As),$b=_(Jc),Ub=v(Jc,2),qb=_(Ub);j(()=>{O($b,c(rh).line),O(qb,c(rh).preview)}),$("click",As,()=>Bi(c(In).path,c(rh))),D(jb,As)}),j(()=>{O(Wb,c(In).path),O(Vb,c(In).matches.length)}),$("click",Ns,()=>bt(c(In).path)),D(un,_s)}),D(Ce,Et)};z(N,Ce=>{c(tt).length===0?Ce(ie):Ce(ve,-1)})}D(E,k)},x=E=>{var k=Es(),N=yt(k);{var ie=Ce=>{var Et=xK();D(Ce,Et)},ve=Ce=>{var Et=UC(),li=yt(Et);{var Ki=un=>{var In=mK();D(un,In)};z(li,un=>{c(be)&&un(Ki)})}var hi=v(li,2);ei(hi,17,()=>c(kt),Ni,(un,In)=>{var _s=vK(),Ns=_(_s),Vr=_(Ns);j(()=>O(Vr,c(In))),$("click",_s,()=>bt(c(In))),D(un,_s)}),D(Ce,Et)};z(N,Ce=>{c(kt).length===0?Ce(ie):Ce(ve,-1)})}D(E,k)};z(l,E=>{c(xe)==="text"?E(h):E(x,-1)})}D(Bn,hs)},cs=Tt(()=>c(et).trim());z(Ms,Bn=>{c(Rt)?Bn(mo):c(ut)?Bn(Rs,1):c(cs)&&Bn(Ds,2)})}var ns=v(Hn,2);{var qs=Bn=>{var hs=bK(),l=_(hs),h=_(l),x=_(h),E=v(h,2),k=_(E),N=v(k,2),ie=v(l,2);ei(ie,21,()=>c(Ze),Ni,(ve,Ce,Et)=>{var li=_K(),Ki=_(li),hi=v(Ki,2),un=_(hi),In=v(hi,2),_s=_(In);j(()=>{O(un,c(Ce).path),O(_s,`${c(Ce).changes??""}×`)}),Cs(Ki,()=>c(Ce).checked,Ns=>c(Ce).checked=Ns),D(ve,li)}),j((ve,Ce)=>{O(x,`Replace in ${ve??""} file(s)`),k.disabled=Ce},[()=>c(Ze).filter(ve=>ve.checked).length,()=>c(Ze).filter(ve=>ve.checked).length===0]),$("click",k,Zi),$("click",N,()=>m(Pt,!1)),D(Bn,hs)};z(ns,Bn=>{c(Pt)&&Bn(qs)})}j(()=>{tn=Bt(ai,1,"svelte-1pyfjii",null,tn,{active:c(xe)==="text"}),cn=Bt(Yi,1,"svelte-1pyfjii",null,cn,{active:c(xe)==="files"}),ln(En,"placeholder",c(xe)==="text"?"Find in files…":"Find files…")}),$("click",ai,()=>{m(xe,"text"),Ui()}),$("click",Yi,()=>{m(xe,"files"),Ui()}),$("click",Cn,Di),$("input",En,Ui),$("keydown",En,Bn=>Bn.key==="Escape"&&Di()),jt(En,()=>c(et),Bn=>m(et,Bn)),D(ft,je)};z(Ao,ft=>{c(Re)&&ft(Yp)})}var pf=v(Ao,2),Kc=_(pf);let ct;var xf=v(Kc,2);ei(xf,17,()=>c(t),ft=>ft.path,(ft,je)=>{q(ft,()=>c(je))});var mf=v(pf,2);{var Pb=ft=>{var je=DK();let Kt;var ai=_(je),tn=v(ai,2),Yi=_(tn),cn=_(Yi),Cn=v(Yi,2),gn=v(tn,2),En=_(gn);{var bn=pn=>{var Hn=EK();D(pn,Hn)},yn=pn=>{var Hn=yK();D(pn,Hn)},ls=pn=>{var Hn=UC(),Ms=yt(Hn);ei(Ms,17,()=>c(P),Ds=>Ds.hash,(Ds,cs)=>{var ns=wK(),qs=_(ns),Bn=_(qs),hs=v(qs,2),l=_(hs);j((h,x)=>{O(Bn,c(cs).subject),O(l,`${h??""} · ${x??""}`)},[()=>c(cs).hash.slice(0,7),()=>$e(c(cs).date)]),$("click",ns,()=>Ht(c(cs))),D(Ds,ns)});var mo=v(Ms,2);{var Rs=Ds=>{var cs=SK(),ns=_(cs);j(()=>{cs.disabled=c(M),O(ns,c(M)?"Loading…":"Load more")}),$("click",cs,st),D(Ds,cs)};z(mo,Ds=>{c(P).length>=c(R)&&Ds(Rs)})}D(pn,Hn)};z(En,pn=>{c(M)&&c(P).length===0?pn(bn):c(P).length===0?pn(yn,1):pn(ls,-1)})}j(()=>{Kt=$o(je,"",Kt,{height:`${c(Ot)??""}px`}),ln(Yi,"title",c(A).path),O(cn,`History: ${c(A).name??""}`)}),$("mousedown",ai,Za),$("click",Cn,Lt),D(ft,je)};z(mf,ft=>{c(A)&&ft(Pb)})}j(()=>{ue=Bt(Wl,1,"search-toggle svelte-1pyfjii",null,ue,{active:c(Re)}),ct=Bt(Kc,1,"tree-root-drop svelte-1pyfjii",null,ct,{"drag-target":c(a)===""})}),$("click",ff,vi),$("click",gf,wi),$("click",Wl,()=>c(Re)?Di():Ri("text")),$("click",Ya,G),fs("dragover",Kc,ft=>Jn(ft,"")),fs("dragleave",Kc,Ss),fs("drop",Kc,ft=>as(ft,""))}var Qp=v(hf,2),Jp=v(Qp,2),ex=_(Jp);{var Qo=q=>{var ue=BK(),ct=_(ue),ft=v(ct,2);ei(ft,21,()=>c(d),Kt=>Kt.path,(Kt,ai)=>{var tn=kK();let Yi;var cn=_(tn),Cn=_(cn),gn=v(cn,2);{var En=yn=>{var ls=AK();D(yn,ls)};z(gn,yn=>{c(ai).dirty&&yn(En)})}var bn=v(gn,2);j(yn=>{Yi=Bt(tn,1,"tab svelte-1pyfjii",null,Yi,{active:c(ai).path===c(u)}),ln(tn,"data-tab-path",c(ai).path),O(Cn,yn)},[()=>c(ai).path.split("/").pop()]),$("click",tn,()=>vt(c(ai).path)),$("keydown",tn,yn=>yn.key==="Enter"&&vt(c(ai).path)),$("click",bn,yn=>{yn.stopPropagation(),Fe(c(ai).path)}),D(Kt,tn)}),us(ft,Kt=>m(Ft,Kt),()=>c(Ft));var je=v(ft,2);j(()=>{ct.disabled=!c(Vt),je.disabled=!c(zt)}),$("click",ct,()=>Mi(-1)),fs("scroll",ft,mt),fs("wheel",ft,Kt=>{Kt.preventDefault(),c(Ft).scrollLeft+=Kt.deltaY,mt()}),$("click",je,()=>Mi(1)),D(q,ue)};z(ex,q=>{c(d).length>0&&q(Qo)})}var Qa=v(ex,2),tx=_(Qa),zr=_(tx),ix=v(tx,2);{var zl=q=>{var ue=NK(),ct=_(ue),ft=_(ct),je=v(ct,2);{var Kt=Cn=>{var gn=PK(),En=_(gn),bn=_(En),yn=v(En,2);{var ls=pn=>{var Hn=IK(),Ms=yt(Hn),mo=v(Ms,2),Rs=v(_(mo),2);ei(Rs,21,()=>c(b).changes,Ni,(l,h)=>{var x=FK(),E=_(x),k=v(E,2),N=_(k),ie=v(k,2),ve=_(ie);j(Ce=>{oa(E,Ce),O(N,c(h).status),O(ve,c(h).file)},[()=>c(K).has(c(h).file)]),$("change",E,()=>{const Ce=new Set(c(K));Ce.has(c(h).file)?Ce.delete(c(h).file):Ce.add(c(h).file),m(K,Ce,!0)}),D(l,x)});var Ds=v(Rs,2),cs=_(Ds),ns=v(cs,2),qs=_(ns),Bn=v(Ds,2);{var hs=l=>{var h=LK(),x=_(h);j(()=>O(x,c(H))),D(l,h)};z(Bn,l=>{c(H)&&l(hs)})}j(l=>{var h;ns.disabled=l,O(qs,c(F)?"…":c(K).size===((h=c(b))==null?void 0:h.changes.length)?"Commit all":`Commit ${c(K).size}`)},[()=>!c(Xt).trim()||c(F)||c(K).size===0]),$("click",Ms,()=>m(ht,!1)),$("keydown",cs,l=>l.key==="Enter"&&le()),jt(cs,()=>c(Xt),l=>m(Xt,l)),$("click",ns,le),D(pn,Hn)};z(yn,pn=>{c(ht)&&pn(ls)})}j(()=>{ln(En,"title",`${c(b).changes.length??""} uncommitted change(s) — click to view`),O(bn,`✎${c(b).changes.length??""}`)}),$("click",En,()=>{c(ht)||m(K,new Set(c(b).changes.map(pn=>pn.file)),!0),m(ht,!c(ht)),m(H,"")}),D(Cn,gn)};z(je,Cn=>{c(b).changes.length>0&&Cn(Kt)})}var ai=v(je,2);{var tn=Cn=>{var gn=MK(),En=_(gn),bn=_(En),yn=v(En,2);{var ls=pn=>{var Hn=TK(),Ms=yt(Hn),mo=v(Ms,2),Rs=_(mo),Ds=_(Rs),cs=v(Rs,2),ns=_(cs);j(()=>O(Ds,`${c(b).ahead??""} unpushed commit(s)`)),$("click",Ms,()=>m(_t,!1)),$("click",ns,()=>{m(_t,!1),Ct()}),D(pn,Hn)};z(yn,pn=>{c(_t)&&pn(ls)})}j(()=>{ln(En,"title",`${c(b).ahead??""} commit(s) ahead of upstream — click to push`),O(bn,`↑${c(b).ahead??""}`)}),$("click",En,()=>m(_t,!c(_t))),D(Cn,gn)};z(ai,Cn=>{c(b).ahead>0&&Cn(tn)})}var Yi=v(ai,2);{var cn=Cn=>{var gn=RK(),En=_(gn);j(()=>{ln(gn,"title",`${c(b).behind??""} commit(s) behind upstream`),O(En,`↓${c(b).behind??""}`)}),D(Cn,gn)};z(Yi,Cn=>{c(b).behind>0&&Cn(cn)})}j(()=>{ln(ct,"title",`Branch: ${c(b).branch??""}`),O(ft,`⎇ ${c(b).branch??""}`)}),D(q,ue)};z(ix,q=>{c(b)&&q(zl)})}var nx=v(ix,2),Vl=_(nx),Zc=_(Vl),Qu=_(Zc),sx=v(Zc,2),pa=v(Vl,2);{var Ju=q=>{var ue=OK(),ct=yt(ue),ft=v(ct,2),je=_(ft),Kt=v(je,2);$("click",ct,()=>m(p,!1)),$("click",je,()=>{m(p,!1),ze()}),$("click",Kt,()=>{m(p,!1),Je()}),D(q,ue)};z(pa,q=>{c(p)&&q(Ju)})}var ox=v(nx,2);{var vf=q=>{var ue=HK();$("click",ue,kn),D(q,ue)};z(ox,q=>{c(u)&&q(vf)})}var _f=v(ox,2);let hr;var Tb=v(Qa,2),Ja=_(Tb),rx=_(Ja),fr=_(rx);us(fr,q=>Xe=q,()=>Xe);var Xc=v(fr,2);{var ax=q=>{var ue=WK();D(q,ue)};z(Xc,q=>{c(u)||q(ax)})}var eh=v(Xc,2);{var th=q=>{var ue=$K(),ct=_(ue),ft=_(ct),je=v(_(ft)),Kt=_(je),ai=v(ft,2),tn=_(ai),Yi=_(tn),cn=_(Yi),Cn=_(cn),gn=v(cn,2),En=v(Yi,2);{var bn=pn=>{var Hn=jK(),Ms=yt(Hn),mo=v(Ms,2),Rs=_(mo);{var Ds=ns=>{var qs=zK();$("click",qs,()=>{m(se,!1),m(qt,!0),Oo()}),D(ns,qs)},cs=ns=>{var qs=VK();$("click",qs,()=>{m(se,!1),m(qt,!1)}),D(ns,qs)};z(Rs,ns=>{c(qt)?ns(cs,-1):ns(Ds)})}$("click",Ms,()=>m(se,!1)),D(pn,Hn)};z(En,pn=>{c(se)&&pn(bn)})}var yn=v(tn,2),ls=v(ct,2);us(ls,pn=>m(Ee,pn),()=>c(Ee)),j(pn=>{O(Kt,pn),O(Cn,c(qt)?"Auto-accept ✓":"Accept")},[()=>{var pn;return(pn=c(u))==null?void 0:pn.split("/").pop()}]),$("click",cn,Oo),$("click",gn,()=>m(se,!c(se))),$("click",yn,Lb),D(q,ue)};z(eh,q=>{c(nt)!==null&&q(th)})}var bf=v(eh,2);{var ih=q=>{var ue=GK(),ct=_(ue),ft=_(ct),je=v(_(ft)),Kt=_(je),ai=v(je,2),tn=_(ai),Yi=v(ft,2),cn=_(Yi),Cn=v(ct,2);{var gn=bn=>{var yn=UK();D(bn,yn)},En=bn=>{var yn=qK();us(yn,ls=>m(T,ls),()=>c(T)),D(bn,yn)};z(Cn,bn=>{c(te)?bn(gn):bn(En,-1)})}j(bn=>{var yn;O(Kt,bn),O(tn,(yn=c(A))==null?void 0:yn.name)},[()=>c(de).slice(0,7)]),$("click",cn,pt),D(q,ue)};z(bf,q=>{c(ne)&&q(ih)})}var xa=v(rx,2);let Yc,nh;var Cf=_(xa);{var Mb=q=>{var ue=KK();$("mousedown",ue,dr),D(q,ue)};z(Cf,q=>{c(C)&&q(Mb)})}var Qc=v(Cf,2),Ef=_(Qc),yf=_(Ef),Rb=v(yf);{var lx=q=>{var ue=ZK(),ct=_(ue);j(ft=>O(ct,`— ${ft??""}`),[()=>c(u).split("/").pop()]),D(q,ue)};z(Rb,q=>{c(u)&&q(lx)})}var Nb=v(Ef,2);{var gr=q=>{var ue=YK(),ct=yt(ue);ei(ct,21,()=>Wi,Ni,(tn,Yi)=>{var cn=XK(),Cn=_(cn),gn={};j(()=>{O(Cn,c(Yi)),gn!==(gn=c(Yi))&&(cn.value=(cn.__value=c(Yi))??"")}),D(tn,cn)});var ft=v(ct,2),je=v(ft,2),Kt=_(je),ai=v(je,2);Fs(ct,()=>c(gt),tn=>m(gt,tn)),jt(ft,()=>c(Yt),tn=>m(Yt,tn)),Cs(Kt,()=>c(Ci),tn=>m(Ci,tn)),$("click",ai,ss),D(q,ue)};z(Nb,q=>{c(C)&&q(gr)})}var sh=v(Qc,2);{var Ob=q=>{var ue=eZ(),ct=_(ue);ei(ct,17,()=>{var Kt;return(((Kt=c(ce))==null?void 0:Kt.logEntries)??[]).filter(Ti)},Kt=>Kt.ts+Kt.msg,(Kt,ai)=>{var tn=QK(),Yi=_(tn),cn=_(Yi),Cn=v(Yi,2),gn=_(Cn),En=v(Cn,2),bn=_(En);j((yn,ls)=>{Bt(tn,1,`log-line ${c(ai).level??""}`,"svelte-1pyfjii"),O(cn,yn),O(gn,ls),O(bn,c(ai).msg)},[()=>zi(c(ai).ts),()=>c(ai).level.toUpperCase()]),D(Kt,tn)});var ft=v(ct,2);{var je=Kt=>{var ai=JK();D(Kt,ai)};z(ft,Kt=>{var ai;(((ai=c(ce))==null?void 0:ai.logEntries.length)??0)===0&&Kt(je)})}us(ue,Kt=>m(he,Kt),()=>c(he)),D(q,ue)};z(sh,q=>{c(C)&&q(Ob)})}var oh=v(Ja,2);{var Hb=q=>{var ue=tZ(),ct=yt(ue),ft=v(ct,2);let je;var Kt=_(ft);TG(Kt,{get currentScript(){return c(Ke)},onApply:Fb,onCreateFile:Hr,get extraFiles(){return c(Se)},set extraFiles(ai){m(Se,ai,!0)}}),j(()=>je=$o(ft,"",je,{width:`${c(At)??""}px`})),$("mousedown",ct,Or),D(q,ue)};z(oh,q=>{c(qe)&&q(Hb)})}j(()=>{var q;Yu=$o(hf,"",Yu,{width:`${c(Ve)??""}px`}),O(zr,c(u)??"No file selected"),Zc.disabled=!((q=c(ce))!=null&&q.dirty)||c(f),O(Qu,c(f)?"Saving…":"Save"),sx.disabled=!c(u),hr=Bt(_f,1,"ai-toggle svelte-1pyfjii",null,hr,{"ai-open":c(qe)}),ln(_f,"title",c(qe)?"Close AI assistant":"Open AI assistant"),Yc=Bt(xa,1,"log-panel svelte-1pyfjii",null,Yc,{collapsed:!c(C)}),nh=$o(xa,"",nh,{height:c(C)?`${c(ye)}px`:"26px"}),O(yf,`${c(C)?"▾":"▸"} Script Log `)}),$("keydown",Kp,_n),$("mousedown",Qp,Ts),$("click",Zc,ze),$("click",sx,()=>m(p,!c(p))),$("click",_f,()=>m(qe,!c(qe))),$("click",Ef,ps),D(o,Wr),js()}Zs(["click","contextmenu","keydown","change","input","mousedown"]);const VF="she-theme";function sZ(){return localStorage.getItem(VF)??"dark"}function oZ(o){localStorage.setItem(VF,o);const e=document.documentElement;o==="system"?e.removeAttribute("data-theme"):e.setAttribute("data-theme",o)}var Qf={exports:{}};/* @preserve
220
220
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
221
221
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
222
- */var rZ=Qf.exports,PA;function aZ(){return PA||(PA=1,(function(o,e){(function(t,i){i(e)})(rZ,(function(t){var i="1.9.4";function n(l){var h,x,E,k;for(x=1,E=arguments.length;x<E;x++){k=arguments[x];for(h in k)l[h]=k[h]}return l}var s=Object.create||(function(){function l(){}return function(h){return l.prototype=h,new l}})();function r(l,h){var x=Array.prototype.slice;if(l.bind)return l.bind.apply(l,x.call(arguments,1));var E=x.call(arguments,2);return function(){return l.apply(h,E.length?E.concat(x.call(arguments)):arguments)}}var a=0;function d(l){return"_leaflet_id"in l||(l._leaflet_id=++a),l._leaflet_id}function u(l,h,x){var E,k,N,ie;return ie=function(){E=!1,k&&(N.apply(x,k),k=!1)},N=function(){E?k=arguments:(l.apply(x,arguments),setTimeout(ie,h),E=!0)},N}function f(l,h,x){var E=h[1],k=h[0],N=E-k;return l===E&&x?l:((l-k)%N+N)%N+k}function g(){return!1}function p(l,h){if(h===!1)return l;var x=Math.pow(10,h===void 0?6:h);return Math.round(l*x)/x}function C(l){return l.trim?l.trim():l.replace(/^\s+|\s+$/g,"")}function b(l){return C(l).split(/\s+/)}function y(l,h){Object.prototype.hasOwnProperty.call(l,"options")||(l.options=l.options?s(l.options):{});for(var x in h)l.options[x]=h[x];return l.options}function w(l,h,x){var E=[];for(var k in l)E.push(encodeURIComponent(x?k.toUpperCase():k)+"="+encodeURIComponent(l[k]));return(!h||h.indexOf("?")===-1?"?":"&")+E.join("&")}var A=/\{ *([\w_ -]+) *\}/g;function P(l,h){return l.replace(A,function(x,E){var k=h[E];if(k===void 0)throw new Error("No value provided for variable "+x);return typeof k=="function"&&(k=k(h)),k})}var M=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"};function R(l,h){for(var x=0;x<l.length;x++)if(l[x]===h)return x;return-1}var T="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function V(l){return window["webkit"+l]||window["moz"+l]||window["ms"+l]}var W=0;function Q(l){var h=+new Date,x=Math.max(0,16-(h-W));return W=h+x,window.setTimeout(l,x)}var ne=window.requestAnimationFrame||V("RequestAnimationFrame")||Q,de=window.cancelAnimationFrame||V("CancelAnimationFrame")||V("CancelRequestAnimationFrame")||function(l){window.clearTimeout(l)};function te(l,h,x){if(x&&ne===Q)l.call(h);else return ne.call(window,r(l,h))}function he(l){l&&de.call(window,l)}var De={__proto__:null,extend:n,create:s,bind:r,get lastId(){return a},stamp:d,throttle:u,wrapNum:f,falseFn:g,formatNum:p,trim:C,splitWords:b,setOptions:y,getParamString:w,template:P,isArray:M,indexOf:R,emptyImageUrl:T,requestFn:ne,cancelFn:de,requestAnimFrame:te,cancelAnimFrame:he};function oe(){}oe.extend=function(l){var h=function(){y(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},x=h.__super__=this.prototype,E=s(x);E.constructor=h,h.prototype=E;for(var k in this)Object.prototype.hasOwnProperty.call(this,k)&&k!=="prototype"&&k!=="__super__"&&(h[k]=this[k]);return l.statics&&n(h,l.statics),l.includes&&(ge(l.includes),n.apply(null,[E].concat(l.includes))),n(E,l),delete E.statics,delete E.includes,E.options&&(E.options=x.options?s(x.options):{},n(E.options,l.options)),E._initHooks=[],E.callInitHooks=function(){if(!this._initHooksCalled){x.callInitHooks&&x.callInitHooks.call(this),this._initHooksCalled=!0;for(var N=0,ie=E._initHooks.length;N<ie;N++)E._initHooks[N].call(this)}},h},oe.include=function(l){var h=this.prototype.options;return n(this.prototype,l),l.options&&(this.prototype.options=h,this.mergeOptions(l.options)),this},oe.mergeOptions=function(l){return n(this.prototype.options,l),this},oe.addInitHook=function(l){var h=Array.prototype.slice.call(arguments,1),x=typeof l=="function"?l:function(){this[l].apply(this,h)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(x),this};function ge(l){if(!(typeof L>"u"||!L||!L.Mixin)){l=M(l)?l:[l];for(var h=0;h<l.length;h++)l[h]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Se={on:function(l,h,x){if(typeof l=="object")for(var E in l)this._on(E,l[E],h);else{l=b(l);for(var k=0,N=l.length;k<N;k++)this._on(l[k],h,x)}return this},off:function(l,h,x){if(!arguments.length)delete this._events;else if(typeof l=="object")for(var E in l)this._off(E,l[E],h);else{l=b(l);for(var k=arguments.length===1,N=0,ie=l.length;N<ie;N++)k?this._off(l[N]):this._off(l[N],h,x)}return this},_on:function(l,h,x,E){if(typeof h!="function"){console.warn("wrong listener type: "+typeof h);return}if(this._listens(l,h,x)===!1){x===this&&(x=void 0);var k={fn:h,ctx:x};E&&(k.once=!0),this._events=this._events||{},this._events[l]=this._events[l]||[],this._events[l].push(k)}},_off:function(l,h,x){var E,k,N;if(this._events&&(E=this._events[l],!!E)){if(arguments.length===1){if(this._firingCount)for(k=0,N=E.length;k<N;k++)E[k].fn=g;delete this._events[l];return}if(typeof h!="function"){console.warn("wrong listener type: "+typeof h);return}var ie=this._listens(l,h,x);if(ie!==!1){var ve=E[ie];this._firingCount&&(ve.fn=g,this._events[l]=E=E.slice()),E.splice(ie,1)}}},fire:function(l,h,x){if(!this.listens(l,x))return this;var E=n({},h,{type:l,target:this,sourceTarget:h&&h.sourceTarget||this});if(this._events){var k=this._events[l];if(k){this._firingCount=this._firingCount+1||1;for(var N=0,ie=k.length;N<ie;N++){var ve=k[N],Ce=ve.fn;ve.once&&this.off(l,Ce,ve.ctx),Ce.call(ve.ctx||this,E)}this._firingCount--}}return x&&this._propagateEvent(E),this},listens:function(l,h,x,E){typeof l!="string"&&console.warn('"string" type argument expected');var k=h;typeof h!="function"&&(E=!!h,k=void 0,x=void 0);var N=this._events&&this._events[l];if(N&&N.length&&this._listens(l,k,x)!==!1)return!0;if(E){for(var ie in this._eventParents)if(this._eventParents[ie].listens(l,h,x,E))return!0}return!1},_listens:function(l,h,x){if(!this._events)return!1;var E=this._events[l]||[];if(!h)return!!E.length;x===this&&(x=void 0);for(var k=0,N=E.length;k<N;k++)if(E[k].fn===h&&E[k].ctx===x)return k;return!1},once:function(l,h,x){if(typeof l=="object")for(var E in l)this._on(E,l[E],h,!0);else{l=b(l);for(var k=0,N=l.length;k<N;k++)this._on(l[k],h,x,!0)}return this},addEventParent:function(l){return this._eventParents=this._eventParents||{},this._eventParents[d(l)]=l,this},removeEventParent:function(l){return this._eventParents&&delete this._eventParents[d(l)],this},_propagateEvent:function(l){for(var h in this._eventParents)this._eventParents[h].fire(l.type,n({layer:l.target,propagatedFrom:l.target},l),!0)}};Se.addEventListener=Se.on,Se.removeEventListener=Se.clearAllEventListeners=Se.off,Se.addOneTimeEventListener=Se.once,Se.fireEvent=Se.fire,Se.hasEventListeners=Se.listens;var Re=oe.extend(Se);function xe(l,h,x){this.x=x?Math.round(l):l,this.y=x?Math.round(h):h}var et=Math.trunc||function(l){return l>0?Math.floor(l):Math.ceil(l)};xe.prototype={clone:function(){return new xe(this.x,this.y)},add:function(l){return this.clone()._add(We(l))},_add:function(l){return this.x+=l.x,this.y+=l.y,this},subtract:function(l){return this.clone()._subtract(We(l))},_subtract:function(l){return this.x-=l.x,this.y-=l.y,this},divideBy:function(l){return this.clone()._divideBy(l)},_divideBy:function(l){return this.x/=l,this.y/=l,this},multiplyBy:function(l){return this.clone()._multiplyBy(l)},_multiplyBy:function(l){return this.x*=l,this.y*=l,this},scaleBy:function(l){return new xe(this.x*l.x,this.y*l.y)},unscaleBy:function(l){return new xe(this.x/l.x,this.y/l.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=et(this.x),this.y=et(this.y),this},distanceTo:function(l){l=We(l);var h=l.x-this.x,x=l.y-this.y;return Math.sqrt(h*h+x*x)},equals:function(l){return l=We(l),l.x===this.x&&l.y===this.y},contains:function(l){return l=We(l),Math.abs(l.x)<=Math.abs(this.x)&&Math.abs(l.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function We(l,h,x){return l instanceof xe?l:M(l)?new xe(l[0],l[1]):l==null?l:typeof l=="object"&&"x"in l&&"y"in l?new xe(l.x,l.y):new xe(l,h,x)}function _e(l,h){if(l)for(var x=h?[l,h]:l,E=0,k=x.length;E<k;E++)this.extend(x[E])}_e.prototype={extend:function(l){var h,x;if(!l)return this;if(l instanceof xe||typeof l[0]=="number"||"x"in l)h=x=We(l);else if(l=dt(l),h=l.min,x=l.max,!h||!x)return this;return!this.min&&!this.max?(this.min=h.clone(),this.max=x.clone()):(this.min.x=Math.min(h.x,this.min.x),this.max.x=Math.max(x.x,this.max.x),this.min.y=Math.min(h.y,this.min.y),this.max.y=Math.max(x.y,this.max.y)),this},getCenter:function(l){return We((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,l)},getBottomLeft:function(){return We(this.min.x,this.max.y)},getTopRight:function(){return We(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(l){var h,x;return typeof l[0]=="number"||l instanceof xe?l=We(l):l=dt(l),l instanceof _e?(h=l.min,x=l.max):h=x=l,h.x>=this.min.x&&x.x<=this.max.x&&h.y>=this.min.y&&x.y<=this.max.y},intersects:function(l){l=dt(l);var h=this.min,x=this.max,E=l.min,k=l.max,N=k.x>=h.x&&E.x<=x.x,ie=k.y>=h.y&&E.y<=x.y;return N&&ie},overlaps:function(l){l=dt(l);var h=this.min,x=this.max,E=l.min,k=l.max,N=k.x>h.x&&E.x<x.x,ie=k.y>h.y&&E.y<x.y;return N&&ie},isValid:function(){return!!(this.min&&this.max)},pad:function(l){var h=this.min,x=this.max,E=Math.abs(h.x-x.x)*l,k=Math.abs(h.y-x.y)*l;return dt(We(h.x-E,h.y-k),We(x.x+E,x.y+k))},equals:function(l){return l?(l=dt(l),this.min.equals(l.getTopLeft())&&this.max.equals(l.getBottomRight())):!1}};function dt(l,h){return!l||l instanceof _e?l:new _e(l,h)}function Wt(l,h){if(l)for(var x=h?[l,h]:l,E=0,k=x.length;E<k;E++)this.extend(x[E])}Wt.prototype={extend:function(l){var h=this._southWest,x=this._northEast,E,k;if(l instanceof kt)E=l,k=l;else if(l instanceof Wt){if(E=l._southWest,k=l._northEast,!E||!k)return this}else return l?this.extend(be(l)||tt(l)):this;return!h&&!x?(this._southWest=new kt(E.lat,E.lng),this._northEast=new kt(k.lat,k.lng)):(h.lat=Math.min(E.lat,h.lat),h.lng=Math.min(E.lng,h.lng),x.lat=Math.max(k.lat,x.lat),x.lng=Math.max(k.lng,x.lng)),this},pad:function(l){var h=this._southWest,x=this._northEast,E=Math.abs(h.lat-x.lat)*l,k=Math.abs(h.lng-x.lng)*l;return new Wt(new kt(h.lat-E,h.lng-k),new kt(x.lat+E,x.lng+k))},getCenter:function(){return new kt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new kt(this.getNorth(),this.getWest())},getSouthEast:function(){return new kt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(l){typeof l[0]=="number"||l instanceof kt||"lat"in l?l=be(l):l=tt(l);var h=this._southWest,x=this._northEast,E,k;return l instanceof Wt?(E=l.getSouthWest(),k=l.getNorthEast()):E=k=l,E.lat>=h.lat&&k.lat<=x.lat&&E.lng>=h.lng&&k.lng<=x.lng},intersects:function(l){l=tt(l);var h=this._southWest,x=this._northEast,E=l.getSouthWest(),k=l.getNorthEast(),N=k.lat>=h.lat&&E.lat<=x.lat,ie=k.lng>=h.lng&&E.lng<=x.lng;return N&&ie},overlaps:function(l){l=tt(l);var h=this._southWest,x=this._northEast,E=l.getSouthWest(),k=l.getNorthEast(),N=k.lat>h.lat&&E.lat<x.lat,ie=k.lng>h.lng&&E.lng<x.lng;return N&&ie},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(l,h){return l?(l=tt(l),this._southWest.equals(l.getSouthWest(),h)&&this._northEast.equals(l.getNorthEast(),h)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function tt(l,h){return l instanceof Wt?l:new Wt(l,h)}function kt(l,h,x){if(isNaN(l)||isNaN(h))throw new Error("Invalid LatLng object: ("+l+", "+h+")");this.lat=+l,this.lng=+h,x!==void 0&&(this.alt=+x)}kt.prototype={equals:function(l,h){if(!l)return!1;l=be(l);var x=Math.max(Math.abs(this.lat-l.lat),Math.abs(this.lng-l.lng));return x<=(h===void 0?1e-9:h)},toString:function(l){return"LatLng("+p(this.lat,l)+", "+p(this.lng,l)+")"},distanceTo:function(l){return ut.distance(this,be(l))},wrap:function(){return ut.wrapLatLng(this)},toBounds:function(l){var h=180*l/40075017,x=h/Math.cos(Math.PI/180*this.lat);return tt([this.lat-h,this.lng-x],[this.lat+h,this.lng+x])},clone:function(){return new kt(this.lat,this.lng,this.alt)}};function be(l,h,x){return l instanceof kt?l:M(l)&&typeof l[0]!="object"?l.length===3?new kt(l[0],l[1],l[2]):l.length===2?new kt(l[0],l[1]):null:l==null?l:typeof l=="object"&&"lat"in l?new kt(l.lat,"lng"in l?l.lng:l.lon,l.alt):h===void 0?null:new kt(l,h,x)}var Rt={latLngToPoint:function(l,h){var x=this.projection.project(l),E=this.scale(h);return this.transformation._transform(x,E)},pointToLatLng:function(l,h){var x=this.scale(h),E=this.transformation.untransform(l,x);return this.projection.unproject(E)},project:function(l){return this.projection.project(l)},unproject:function(l){return this.projection.unproject(l)},scale:function(l){return 256*Math.pow(2,l)},zoom:function(l){return Math.log(l/256)/Math.LN2},getProjectedBounds:function(l){if(this.infinite)return null;var h=this.projection.bounds,x=this.scale(l),E=this.transformation.transform(h.min,x),k=this.transformation.transform(h.max,x);return new _e(E,k)},infinite:!1,wrapLatLng:function(l){var h=this.wrapLng?f(l.lng,this.wrapLng,!0):l.lng,x=this.wrapLat?f(l.lat,this.wrapLat,!0):l.lat,E=l.alt;return new kt(x,h,E)},wrapLatLngBounds:function(l){var h=l.getCenter(),x=this.wrapLatLng(h),E=h.lat-x.lat,k=h.lng-x.lng;if(E===0&&k===0)return l;var N=l.getSouthWest(),ie=l.getNorthEast(),ve=new kt(N.lat-E,N.lng-k),Ce=new kt(ie.lat-E,ie.lng-k);return new Wt(ve,Ce)}},ut=n({},Rt,{wrapLng:[-180,180],R:6371e3,distance:function(l,h){var x=Math.PI/180,E=l.lat*x,k=h.lat*x,N=Math.sin((h.lat-l.lat)*x/2),ie=Math.sin((h.lng-l.lng)*x/2),ve=N*N+Math.cos(E)*Math.cos(k)*ie*ie,Ce=2*Math.atan2(Math.sqrt(ve),Math.sqrt(1-ve));return this.R*Ce}}),at=6378137,Ze={R:at,MAX_LATITUDE:85.0511287798,project:function(l){var h=Math.PI/180,x=this.MAX_LATITUDE,E=Math.max(Math.min(x,l.lat),-x),k=Math.sin(E*h);return new xe(this.R*l.lng*h,this.R*Math.log((1+k)/(1-k))/2)},unproject:function(l){var h=180/Math.PI;return new kt((2*Math.atan(Math.exp(l.y/this.R))-Math.PI/2)*h,l.x*h/this.R)},bounds:(function(){var l=at*Math.PI;return new _e([-l,-l],[l,l])})()};function Pt(l,h,x,E){if(M(l)){this._a=l[0],this._b=l[1],this._c=l[2],this._d=l[3];return}this._a=l,this._b=h,this._c=x,this._d=E}Pt.prototype={transform:function(l,h){return this._transform(l.clone(),h)},_transform:function(l,h){return h=h||1,l.x=h*(this._a*l.x+this._b),l.y=h*(this._c*l.y+this._d),l},untransform:function(l,h){return h=h||1,new xe((l.x/h-this._b)/this._a,(l.y/h-this._d)/this._c)}};function ui(l,h,x,E){return new Pt(l,h,x,E)}var wt=n({},ut,{code:"EPSG:3857",projection:Ze,transformation:(function(){var l=.5/(Math.PI*Ze.R);return ui(l,.5,-l,.5)})()}),Ft=n({},wt,{code:"EPSG:900913"});function Vt(l){return document.createElementNS("http://www.w3.org/2000/svg",l)}function zt(l,h){var x="",E,k,N,ie,ve,Ce;for(E=0,N=l.length;E<N;E++){for(ve=l[E],k=0,ie=ve.length;k<ie;k++)Ce=ve[k],x+=(k?"L":"M")+Ce.x+" "+Ce.y;x+=h?ye.svg?"z":"x":""}return x||"M0 0"}var Zt=document.documentElement.style,mt="ActiveXObject"in window,Mi=mt&&!document.addEventListener,Ri="msLaunchUri"in navigator&&!("documentMode"in document),Di=Ve("webkit"),Ui=Ve("android"),ji=Ve("android 2")||Ve("android 3"),Bi=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),fn=Ui&&Ve("Google")&&Bi<537&&!("AudioNode"in window),an=!!window.opera,Zi=!Ri&&Ve("chrome"),_n=Ve("gecko")&&!Di&&!an&&!mt,gt=!Zi&&Ve("safari"),Yt=Ve("phantom"),Ci="OTransition"in Zt,Wi=navigator.platform.indexOf("Win")===0,Pi=mt&&"transition"in Zt,Ti="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ji,Oi="MozPerspective"in Zt,Qi=!window.L_DISABLE_3D&&(Pi||Ti||Oi)&&!Ci&&!Yt,yi=typeof orientation<"u"||Ve("mobile"),Xe=yi&&Di,St=yi&&Ti,Ai=!window.PointerEvent&&window.MSPointerEvent,ki=!!(window.PointerEvent||Ai),fi="ontouchstart"in window||!!window.TouchEvent,Ii=!window.L_NO_TOUCH&&(fi||ki),X=yi&&an,Ae=yi&&_n,qe=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,nt=(function(){var l=!1;try{var h=Object.defineProperty({},"passive",{get:function(){l=!0}});window.addEventListener("testPassiveEventSupport",g,h),window.removeEventListener("testPassiveEventSupport",g,h)}catch{}return l})(),qt=(function(){return!!document.createElement("canvas").getContext})(),se=!!(document.createElementNS&&Vt("svg").createSVGRect),Ee=!!se&&(function(){var l=document.createElement("div");return l.innerHTML="<svg/>",(l.firstChild&&l.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Le=!se&&(function(){try{var l=document.createElement("div");l.innerHTML='<v:shape adj="1"/>';var h=l.firstChild;return h.style.behavior="url(#default#VML)",h&&typeof h.adj=="object"}catch{return!1}})(),Y=navigator.platform.indexOf("Mac")===0,Oe=navigator.platform.indexOf("Linux")===0;function Ve(l){return navigator.userAgent.toLowerCase().indexOf(l)>=0}var ye={ie:mt,ielt9:Mi,edge:Ri,webkit:Di,android:Ui,android23:ji,androidStock:fn,opera:an,chrome:Zi,gecko:_n,safari:gt,phantom:Yt,opera12:Ci,win:Wi,ie3d:Pi,webkit3d:Ti,gecko3d:Oi,any3d:Qi,mobile:yi,mobileWebkit:Xe,mobileWebkit3d:St,msPointer:Ai,pointer:ki,touch:Ii,touchNative:fi,mobileOpera:X,mobileGecko:Ae,retina:qe,passiveEvents:nt,canvas:qt,svg:se,vml:Le,inlineSvg:Ee,mac:Y,linux:Oe},At=ye.msPointer?"MSPointerDown":"pointerdown",Ot=ye.msPointer?"MSPointerMove":"pointermove",ri=ye.msPointer?"MSPointerUp":"pointerup",oi=ye.msPointer?"MSPointerCancel":"pointercancel",xi={touchstart:At,touchmove:Ot,touchend:ri,touchcancel:oi},Ut={touchstart:ot,touchmove:Ke,touchend:Ke,touchcancel:Ke},mi={},He=!1;function Ye(l,h,x){return h==="touchstart"&&fe(),Ut[h]?(x=Ut[h].bind(this,x),l.addEventListener(xi[h],x,!1),x):(console.warn("wrong event specified:",h),g)}function Qt(l,h,x){if(!xi[h]){console.warn("wrong event specified:",h);return}l.removeEventListener(xi[h],x,!1)}function Gt(l){mi[l.pointerId]=l}function gi(l){mi[l.pointerId]&&(mi[l.pointerId]=l)}function Jt(l){delete mi[l.pointerId]}function fe(){He||(document.addEventListener(At,Gt,!0),document.addEventListener(Ot,gi,!0),document.addEventListener(ri,Jt,!0),document.addEventListener(oi,Jt,!0),He=!0)}function Ke(l,h){if(h.pointerType!==(h.MSPOINTER_TYPE_MOUSE||"mouse")){h.touches=[];for(var x in mi)h.touches.push(mi[x]);h.changedTouches=[h],l(h)}}function ot(l,h){h.MSPOINTER_TYPE_TOUCH&&h.pointerType===h.MSPOINTER_TYPE_TOUCH&&Ji(h),Ke(l,h)}function rt(l){var h={},x,E;for(E in l)x=l[E],h[E]=x&&x.bind?x.bind(l):x;return l=h,h.type="dblclick",h.detail=2,h.isTrusted=!1,h._simulated=!0,h}var ht=200;function _t(l,h){l.addEventListener("dblclick",h);var x=0,E;function k(N){if(N.detail!==1){E=N.detail;return}if(!(N.pointerType==="mouse"||N.sourceCapabilities&&!N.sourceCapabilities.firesTouchEvents)){var ie=Jn(N);if(!(ie.some(function(Ce){return Ce instanceof HTMLLabelElement&&Ce.attributes.for})&&!ie.some(function(Ce){return Ce instanceof HTMLInputElement||Ce instanceof HTMLSelectElement}))){var ve=Date.now();ve-x<=ht?(E++,E===2&&h(rt(N))):E=1,x=ve}}}return l.addEventListener("click",k),{dblclick:h,simDblclick:k}}function Xt(l,h){l.removeEventListener("dblclick",h.dblclick),l.removeEventListener("click",h.simDblclick)}var F=it(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),H=it(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),K=H==="webkitTransition"||H==="OTransition"?H+"End":"transitionend";function le(l){return typeof l=="string"?document.getElementById(l):l}function Z(l,h){var x=l.style[h]||l.currentStyle&&l.currentStyle[h];if((!x||x==="auto")&&document.defaultView){var E=document.defaultView.getComputedStyle(l,null);x=E?E[h]:null}return x==="auto"?null:x}function J(l,h,x){var E=document.createElement(l);return E.className=h||"",x&&x.appendChild(E),E}function ce(l){var h=l.parentNode;h&&h.removeChild(l)}function Qe(l){for(;l.firstChild;)l.removeChild(l.firstChild)}function ae(l){var h=l.parentNode;h&&h.lastChild!==l&&h.appendChild(l)}function pe(l){var h=l.parentNode;h&&h.firstChild!==l&&h.insertBefore(l,h.firstChild)}function Te(l,h){if(l.classList!==void 0)return l.classList.contains(h);var x=G(l);return x.length>0&&new RegExp("(^|\\s)"+h+"(\\s|$)").test(x)}function me(l,h){if(l.classList!==void 0)for(var x=b(h),E=0,k=x.length;E<k;E++)l.classList.add(x[E]);else if(!Te(l,h)){var N=G(l);lt(l,(N?N+" ":"")+h)}}function Ie(l,h){l.classList!==void 0?l.classList.remove(h):lt(l,C((" "+G(l)+" ").replace(" "+h+" "," ")))}function lt(l,h){l.className.baseVal===void 0?l.className=h:l.className.baseVal=h}function G(l){return l.correspondingElement&&(l=l.correspondingElement),l.className.baseVal===void 0?l.className:l.className.baseVal}function re(l,h){"opacity"in l.style?l.style.opacity=h:"filter"in l.style&&Ne(l,h)}function Ne(l,h){var x=!1,E="DXImageTransform.Microsoft.Alpha";try{x=l.filters.item(E)}catch{if(h===1)return}h=Math.round(h*100),x?(x.Enabled=h!==100,x.Opacity=h):l.style.filter+=" progid:"+E+"(opacity="+h+")"}function it(l){for(var h=document.documentElement.style,x=0;x<l.length;x++)if(l[x]in h)return l[x];return!1}function Pe(l,h,x){var E=h||new xe(0,0);l.style[F]=(ye.ie3d?"translate("+E.x+"px,"+E.y+"px)":"translate3d("+E.x+"px,"+E.y+"px,0)")+(x?" scale("+x+")":"")}function ke(l,h){l._leaflet_pos=h,ye.any3d?Pe(l,h):(l.style.left=h.x+"px",l.style.top=h.y+"px")}function Ct(l){return l._leaflet_pos||new xe(0,0)}var vt,Fe,Dt;if("onselectstart"in document)vt=function(){pt(window,"selectstart",Ji)},Fe=function(){wi(window,"selectstart",Ji)};else{var Ge=it(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);vt=function(){if(Ge){var l=document.documentElement.style;Dt=l[Ge],l[Ge]="none"}},Fe=function(){Ge&&(document.documentElement.style[Ge]=Dt,Dt=void 0)}}function ze(){pt(window,"dragstart",Ji)}function Je(){wi(window,"dragstart",Ji)}var bt,$e;function It(l){for(;l.tabIndex===-1;)l=l.parentNode;l.style&&(Me(),bt=l,$e=l.style.outlineStyle,l.style.outlineStyle="none",pt(window,"keydown",Me))}function Me(){bt&&(bt.style.outlineStyle=$e,bt=void 0,$e=void 0,wi(window,"keydown",Me))}function st(l){do l=l.parentNode;while((!l.offsetWidth||!l.offsetHeight)&&l!==document.body);return l}function Lt(l){var h=l.getBoundingClientRect();return{x:h.width/l.offsetWidth||1,y:h.height/l.offsetHeight||1,boundingClientRect:h}}var Ht={__proto__:null,TRANSFORM:F,TRANSITION:H,TRANSITION_END:K,get:le,getStyle:Z,create:J,remove:ce,empty:Qe,toFront:ae,toBack:pe,hasClass:Te,addClass:me,removeClass:Ie,setClass:lt,getClass:G,setOpacity:re,testProp:it,setTransform:Pe,setPosition:ke,getPosition:Ct,get disableTextSelection(){return vt},get enableTextSelection(){return Fe},disableImageDrag:ze,enableImageDrag:Je,preventOutline:It,restoreOutline:Me,getSizedParentNode:st,getScale:Lt};function pt(l,h,x,E){if(h&&typeof h=="object")for(var k in h)Gi(l,k,h[k],x);else{h=b(h);for(var N=0,ie=h.length;N<ie;N++)Gi(l,h[N],x,E)}return this}var vi="_leaflet_events";function wi(l,h,x,E){if(arguments.length===1)qi(l),delete l[vi];else if(h&&typeof h=="object")for(var k in h)Li(l,k,h[k],x);else if(h=b(h),arguments.length===2)qi(l,function(ve){return R(h,ve)!==-1});else for(var N=0,ie=h.length;N<ie;N++)Li(l,h[N],x,E);return this}function qi(l,h){for(var x in l[vi]){var E=x.split(/\d/)[0];(!h||h(E))&&Li(l,E,null,null,x)}}var Fi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Gi(l,h,x,E){var k=h+d(x)+(E?"_"+d(E):"");if(l[vi]&&l[vi][k])return this;var N=function(ve){return x.call(E||l,ve||window.event)},ie=N;!ye.touchNative&&ye.pointer&&h.indexOf("touch")===0?N=Ye(l,h,N):ye.touch&&h==="dblclick"?N=_t(l,N):"addEventListener"in l?h==="touchstart"||h==="touchmove"||h==="wheel"||h==="mousewheel"?l.addEventListener(Fi[h]||h,N,ye.passiveEvents?{passive:!1}:!1):h==="mouseenter"||h==="mouseleave"?(N=function(ve){ve=ve||window.event,kn(l,ve)&&ie(ve)},l.addEventListener(Fi[h],N,!1)):l.addEventListener(h,ie,!1):l.attachEvent("on"+h,N),l[vi]=l[vi]||{},l[vi][k]=N}function Li(l,h,x,E,k){k=k||h+d(x)+(E?"_"+d(E):"");var N=l[vi]&&l[vi][k];if(!N)return this;!ye.touchNative&&ye.pointer&&h.indexOf("touch")===0?Qt(l,h,N):ye.touch&&h==="dblclick"?Xt(l,N):"removeEventListener"in l?l.removeEventListener(Fi[h]||h,N,!1):l.detachEvent("on"+h,N),l[vi][k]=null}function ni(l){return l.stopPropagation?l.stopPropagation():l.originalEvent?l.originalEvent._stopped=!0:l.cancelBubble=!0,this}function ii(l){return Gi(l,"wheel",ni),this}function Xi(l){return pt(l,"mousedown touchstart dblclick contextmenu",ni),l._leaflet_disable_click=!0,this}function Ji(l){return l.preventDefault?l.preventDefault():l.returnValue=!1,this}function Ln(l){return Ji(l),ni(l),this}function Jn(l){if(l.composedPath)return l.composedPath();for(var h=[],x=l.target;x;)h.push(x),x=x.parentNode;return h}function Ss(l,h){if(!h)return new xe(l.clientX,l.clientY);var x=Lt(h),E=x.boundingClientRect;return new xe((l.clientX-E.left)/x.x-h.clientLeft,(l.clientY-E.top)/x.y-h.clientTop)}var as=ye.linux&&ye.chrome?window.devicePixelRatio:ye.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Bs(l){return ye.edge?l.wheelDeltaY/2:l.deltaY&&l.deltaMode===0?-l.deltaY/as:l.deltaY&&l.deltaMode===1?-l.deltaY*20:l.deltaY&&l.deltaMode===2?-l.deltaY*60:l.deltaX||l.deltaZ?0:l.wheelDelta?(l.wheelDeltaY||l.wheelDelta)/2:l.detail&&Math.abs(l.detail)<32765?-l.detail*20:l.detail?l.detail/-32765*60:0}function kn(l,h){var x=h.relatedTarget;if(!x)return!0;try{for(;x&&x!==l;)x=x.parentNode}catch{return!1}return x!==l}var ss={__proto__:null,on:pt,off:wi,stopPropagation:ni,disableScrollPropagation:ii,disableClickPropagation:Xi,preventDefault:Ji,stop:Ln,getPropagationPath:Jn,getMousePosition:Ss,getWheelDelta:Bs,isExternalTarget:kn,addListener:pt,removeListener:wi},ps=Re.extend({run:function(l,h,x,E){this.stop(),this._el=l,this._inProgress=!0,this._duration=x||.25,this._easeOutPower=1/Math.max(E||.5,.2),this._startPos=Ct(l),this._offset=h.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=te(this._animate,this),this._step()},_step:function(l){var h=+new Date-this._startTime,x=this._duration*1e3;h<x?this._runFrame(this._easeOut(h/x),l):(this._runFrame(1),this._complete())},_runFrame:function(l,h){var x=this._startPos.add(this._offset.multiplyBy(l));h&&x._round(),ke(this._el,x),this.fire("step")},_complete:function(){he(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(l){return 1-Math.pow(1-l,this._easeOutPower)}}),zi=Re.extend({options:{crs:wt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(l,h){h=y(this,h),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(l),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),h.maxBounds&&this.setMaxBounds(h.maxBounds),h.zoom!==void 0&&(this._zoom=this._limitZoom(h.zoom)),h.center&&h.zoom!==void 0&&this.setView(be(h.center),h.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=H&&ye.any3d&&!ye.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),pt(this._proxy,K,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(l,h,x){if(h=h===void 0?this._zoom:this._limitZoom(h),l=this._limitCenter(be(l),h,this.options.maxBounds),x=x||{},this._stop(),this._loaded&&!x.reset&&x!==!0){x.animate!==void 0&&(x.zoom=n({animate:x.animate},x.zoom),x.pan=n({animate:x.animate,duration:x.duration},x.pan));var E=this._zoom!==h?this._tryAnimatedZoom&&this._tryAnimatedZoom(l,h,x.zoom):this._tryAnimatedPan(l,x.pan);if(E)return clearTimeout(this._sizeTimer),this}return this._resetView(l,h,x.pan&&x.pan.noMoveStart),this},setZoom:function(l,h){return this._loaded?this.setView(this.getCenter(),l,{zoom:h}):(this._zoom=l,this)},zoomIn:function(l,h){return l=l||(ye.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+l,h)},zoomOut:function(l,h){return l=l||(ye.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-l,h)},setZoomAround:function(l,h,x){var E=this.getZoomScale(h),k=this.getSize().divideBy(2),N=l instanceof xe?l:this.latLngToContainerPoint(l),ie=N.subtract(k).multiplyBy(1-1/E),ve=this.containerPointToLatLng(k.add(ie));return this.setView(ve,h,{zoom:x})},_getBoundsCenterZoom:function(l,h){h=h||{},l=l.getBounds?l.getBounds():tt(l);var x=We(h.paddingTopLeft||h.padding||[0,0]),E=We(h.paddingBottomRight||h.padding||[0,0]),k=this.getBoundsZoom(l,!1,x.add(E));if(k=typeof h.maxZoom=="number"?Math.min(h.maxZoom,k):k,k===1/0)return{center:l.getCenter(),zoom:k};var N=E.subtract(x).divideBy(2),ie=this.project(l.getSouthWest(),k),ve=this.project(l.getNorthEast(),k),Ce=this.unproject(ie.add(ve).divideBy(2).add(N),k);return{center:Ce,zoom:k}},fitBounds:function(l,h){if(l=tt(l),!l.isValid())throw new Error("Bounds are not valid.");var x=this._getBoundsCenterZoom(l,h);return this.setView(x.center,x.zoom,h)},fitWorld:function(l){return this.fitBounds([[-90,-180],[90,180]],l)},panTo:function(l,h){return this.setView(l,this._zoom,{pan:h})},panBy:function(l,h){if(l=We(l).round(),h=h||{},!l.x&&!l.y)return this.fire("moveend");if(h.animate!==!0&&!this.getSize().contains(l))return this._resetView(this.unproject(this.project(this.getCenter()).add(l)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ps,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),h.noMoveStart||this.fire("movestart"),h.animate!==!1){me(this._mapPane,"leaflet-pan-anim");var x=this._getMapPanePos().subtract(l).round();this._panAnim.run(this._mapPane,x,h.duration||.25,h.easeLinearity)}else this._rawPanBy(l),this.fire("move").fire("moveend");return this},flyTo:function(l,h,x){if(x=x||{},x.animate===!1||!ye.any3d)return this.setView(l,h,x);this._stop();var E=this.project(this.getCenter()),k=this.project(l),N=this.getSize(),ie=this._zoom;l=be(l),h=h===void 0?ie:h;var ve=Math.max(N.x,N.y),Ce=ve*this.getZoomScale(ie,h),Et=k.distanceTo(E)||1,li=1.42,Ki=li*li;function hi(As){var Jc=As?-1:1,$b=As?Ce:ve,Ub=Ce*Ce-ve*ve+Jc*Ki*Ki*Et*Et,qb=2*$b*Ki*Et,Gb=Ub/qb,wS=Math.sqrt(Gb*Gb+1)-Gb,jF=wS<1e-9?-18:Math.log(wS);return jF}function un(As){return(Math.exp(As)-Math.exp(-As))/2}function In(As){return(Math.exp(As)+Math.exp(-As))/2}function _s(As){return un(As)/In(As)}var Ns=hi(0);function Vr(As){return ve*(In(Ns)/In(Ns+li*As))}function Wb(As){return ve*(In(Ns)*_s(Ns+li*As)-un(Ns))/Ki}function zb(As){return 1-Math.pow(1-As,1.5)}var Vb=Date.now(),cx=(hi(1)-Ns)/li,jb=x.duration?1e3*x.duration:1e3*cx*.8;function rh(){var As=(Date.now()-Vb)/jb,Jc=zb(As)*cx;As<=1?(this._flyToFrame=te(rh,this),this._move(this.unproject(E.add(k.subtract(E).multiplyBy(Wb(Jc)/Et)),ie),this.getScaleZoom(ve/Vr(Jc),ie),{flyTo:!0})):this._move(l,h)._moveEnd(!0)}return this._moveStart(!0,x.noMoveStart),rh.call(this),this},flyToBounds:function(l,h){var x=this._getBoundsCenterZoom(l,h);return this.flyTo(x.center,x.zoom,h)},setMaxBounds:function(l){return l=tt(l),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),l.isValid()?(this.options.maxBounds=l,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(l){var h=this.options.minZoom;return this.options.minZoom=l,this._loaded&&h!==l&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(l):this},setMaxZoom:function(l){var h=this.options.maxZoom;return this.options.maxZoom=l,this._loaded&&h!==l&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(l):this},panInsideBounds:function(l,h){this._enforcingBounds=!0;var x=this.getCenter(),E=this._limitCenter(x,this._zoom,tt(l));return x.equals(E)||this.panTo(E,h),this._enforcingBounds=!1,this},panInside:function(l,h){h=h||{};var x=We(h.paddingTopLeft||h.padding||[0,0]),E=We(h.paddingBottomRight||h.padding||[0,0]),k=this.project(this.getCenter()),N=this.project(l),ie=this.getPixelBounds(),ve=dt([ie.min.add(x),ie.max.subtract(E)]),Ce=ve.getSize();if(!ve.contains(N)){this._enforcingBounds=!0;var Et=N.subtract(ve.getCenter()),li=ve.extend(N).getSize().subtract(Ce);k.x+=Et.x<0?-li.x:li.x,k.y+=Et.y<0?-li.y:li.y,this.panTo(this.unproject(k),h),this._enforcingBounds=!1}return this},invalidateSize:function(l){if(!this._loaded)return this;l=n({animate:!1,pan:!0},l===!0?{animate:!0}:l);var h=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var x=this.getSize(),E=h.divideBy(2).round(),k=x.divideBy(2).round(),N=E.subtract(k);return!N.x&&!N.y?this:(l.animate&&l.pan?this.panBy(N):(l.pan&&this._rawPanBy(N),this.fire("move"),l.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:h,newSize:x}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(l){if(l=this._locateOptions=n({timeout:1e4,watch:!1},l),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var h=r(this._handleGeolocationResponse,this),x=r(this._handleGeolocationError,this);return l.watch?this._locationWatchId=navigator.geolocation.watchPosition(h,x,l):navigator.geolocation.getCurrentPosition(h,x,l),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(l){if(this._container._leaflet_id){var h=l.code,x=l.message||(h===1?"permission denied":h===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:h,message:"Geolocation error: "+x+"."})}},_handleGeolocationResponse:function(l){if(this._container._leaflet_id){var h=l.coords.latitude,x=l.coords.longitude,E=new kt(h,x),k=E.toBounds(l.coords.accuracy*2),N=this._locateOptions;if(N.setView){var ie=this.getBoundsZoom(k);this.setView(E,N.maxZoom?Math.min(ie,N.maxZoom):ie)}var ve={latlng:E,bounds:k,timestamp:l.timestamp};for(var Ce in l.coords)typeof l.coords[Ce]=="number"&&(ve[Ce]=l.coords[Ce]);this.fire("locationfound",ve)}},addHandler:function(l,h){if(!h)return this;var x=this[l]=new h(this);return this._handlers.push(x),this.options[l]&&x.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ce(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(he(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var l;for(l in this._layers)this._layers[l].remove();for(l in this._panes)ce(this._panes[l]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(l,h){var x="leaflet-pane"+(l?" leaflet-"+l.replace("Pane","")+"-pane":""),E=J("div",x,h||this._mapPane);return l&&(this._panes[l]=E),E},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var l=this.getPixelBounds(),h=this.unproject(l.getBottomLeft()),x=this.unproject(l.getTopRight());return new Wt(h,x)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(l,h,x){l=tt(l),x=We(x||[0,0]);var E=this.getZoom()||0,k=this.getMinZoom(),N=this.getMaxZoom(),ie=l.getNorthWest(),ve=l.getSouthEast(),Ce=this.getSize().subtract(x),Et=dt(this.project(ve,E),this.project(ie,E)).getSize(),li=ye.any3d?this.options.zoomSnap:1,Ki=Ce.x/Et.x,hi=Ce.y/Et.y,un=h?Math.max(Ki,hi):Math.min(Ki,hi);return E=this.getScaleZoom(un,E),li&&(E=Math.round(E/(li/100))*(li/100),E=h?Math.ceil(E/li)*li:Math.floor(E/li)*li),Math.max(k,Math.min(N,E))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new xe(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(l,h){var x=this._getTopLeftPoint(l,h);return new _e(x,x.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(l){return this.options.crs.getProjectedBounds(l===void 0?this.getZoom():l)},getPane:function(l){return typeof l=="string"?this._panes[l]:l},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(l,h){var x=this.options.crs;return h=h===void 0?this._zoom:h,x.scale(l)/x.scale(h)},getScaleZoom:function(l,h){var x=this.options.crs;h=h===void 0?this._zoom:h;var E=x.zoom(l*x.scale(h));return isNaN(E)?1/0:E},project:function(l,h){return h=h===void 0?this._zoom:h,this.options.crs.latLngToPoint(be(l),h)},unproject:function(l,h){return h=h===void 0?this._zoom:h,this.options.crs.pointToLatLng(We(l),h)},layerPointToLatLng:function(l){var h=We(l).add(this.getPixelOrigin());return this.unproject(h)},latLngToLayerPoint:function(l){var h=this.project(be(l))._round();return h._subtract(this.getPixelOrigin())},wrapLatLng:function(l){return this.options.crs.wrapLatLng(be(l))},wrapLatLngBounds:function(l){return this.options.crs.wrapLatLngBounds(tt(l))},distance:function(l,h){return this.options.crs.distance(be(l),be(h))},containerPointToLayerPoint:function(l){return We(l).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(l){return We(l).add(this._getMapPanePos())},containerPointToLatLng:function(l){var h=this.containerPointToLayerPoint(We(l));return this.layerPointToLatLng(h)},latLngToContainerPoint:function(l){return this.layerPointToContainerPoint(this.latLngToLayerPoint(be(l)))},mouseEventToContainerPoint:function(l){return Ss(l,this._container)},mouseEventToLayerPoint:function(l){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(l))},mouseEventToLatLng:function(l){return this.layerPointToLatLng(this.mouseEventToLayerPoint(l))},_initContainer:function(l){var h=this._container=le(l);if(h){if(h._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");pt(h,"scroll",this._onScroll,this),this._containerId=d(h)},_initLayout:function(){var l=this._container;this._fadeAnimated=this.options.fadeAnimation&&ye.any3d,me(l,"leaflet-container"+(ye.touch?" leaflet-touch":"")+(ye.retina?" leaflet-retina":"")+(ye.ielt9?" leaflet-oldie":"")+(ye.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var h=Z(l,"position");h!=="absolute"&&h!=="relative"&&h!=="fixed"&&h!=="sticky"&&(l.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var l=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new xe(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(me(l.markerPane,"leaflet-zoom-hide"),me(l.shadowPane,"leaflet-zoom-hide"))},_resetView:function(l,h,x){ke(this._mapPane,new xe(0,0));var E=!this._loaded;this._loaded=!0,h=this._limitZoom(h),this.fire("viewprereset");var k=this._zoom!==h;this._moveStart(k,x)._move(l,h)._moveEnd(k),this.fire("viewreset"),E&&this.fire("load")},_moveStart:function(l,h){return l&&this.fire("zoomstart"),h||this.fire("movestart"),this},_move:function(l,h,x,E){h===void 0&&(h=this._zoom);var k=this._zoom!==h;return this._zoom=h,this._lastCenter=l,this._pixelOrigin=this._getNewPixelOrigin(l),E?x&&x.pinch&&this.fire("zoom",x):((k||x&&x.pinch)&&this.fire("zoom",x),this.fire("move",x)),this},_moveEnd:function(l){return l&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return he(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(l){ke(this._mapPane,this._getMapPanePos().subtract(l))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(l){this._targets={},this._targets[d(this._container)]=this;var h=l?wi:pt;h(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&h(window,"resize",this._onResize,this),ye.any3d&&this.options.transform3DLimit&&(l?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){he(this._resizeRequest),this._resizeRequest=te(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var l=this._getMapPanePos();Math.max(Math.abs(l.x),Math.abs(l.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(l,h){for(var x=[],E,k=h==="mouseout"||h==="mouseover",N=l.target||l.srcElement,ie=!1;N;){if(E=this._targets[d(N)],E&&(h==="click"||h==="preclick")&&this._draggableMoved(E)){ie=!0;break}if(E&&E.listens(h,!0)&&(k&&!kn(N,l)||(x.push(E),k))||N===this._container)break;N=N.parentNode}return!x.length&&!ie&&!k&&this.listens(h,!0)&&(x=[this]),x},_isClickDisabled:function(l){for(;l&&l!==this._container;){if(l._leaflet_disable_click)return!0;l=l.parentNode}},_handleDOMEvent:function(l){var h=l.target||l.srcElement;if(!(!this._loaded||h._leaflet_disable_events||l.type==="click"&&this._isClickDisabled(h))){var x=l.type;x==="mousedown"&&It(h),this._fireDOMEvent(l,x)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(l,h,x){if(l.type==="click"){var E=n({},l);E.type="preclick",this._fireDOMEvent(E,E.type,x)}var k=this._findEventTargets(l,h);if(x){for(var N=[],ie=0;ie<x.length;ie++)x[ie].listens(h,!0)&&N.push(x[ie]);k=N.concat(k)}if(k.length){h==="contextmenu"&&Ji(l);var ve=k[0],Ce={originalEvent:l};if(l.type!=="keypress"&&l.type!=="keydown"&&l.type!=="keyup"){var Et=ve.getLatLng&&(!ve._radius||ve._radius<=10);Ce.containerPoint=Et?this.latLngToContainerPoint(ve.getLatLng()):this.mouseEventToContainerPoint(l),Ce.layerPoint=this.containerPointToLayerPoint(Ce.containerPoint),Ce.latlng=Et?ve.getLatLng():this.layerPointToLatLng(Ce.layerPoint)}for(ie=0;ie<k.length;ie++)if(k[ie].fire(h,Ce,!0),Ce.originalEvent._stopped||k[ie].options.bubblingMouseEvents===!1&&R(this._mouseEvents,h)!==-1)return}},_draggableMoved:function(l){return l=l.dragging&&l.dragging.enabled()?l:this,l.dragging&&l.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var l=0,h=this._handlers.length;l<h;l++)this._handlers[l].disable()},whenReady:function(l,h){return this._loaded?l.call(h||this,{target:this}):this.on("load",l,h),this},_getMapPanePos:function(){return Ct(this._mapPane)||new xe(0,0)},_moved:function(){var l=this._getMapPanePos();return l&&!l.equals([0,0])},_getTopLeftPoint:function(l,h){var x=l&&h!==void 0?this._getNewPixelOrigin(l,h):this.getPixelOrigin();return x.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(l,h){var x=this.getSize()._divideBy(2);return this.project(l,h)._subtract(x)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(l,h,x){var E=this._getNewPixelOrigin(x,h);return this.project(l,h)._subtract(E)},_latLngBoundsToNewLayerBounds:function(l,h,x){var E=this._getNewPixelOrigin(x,h);return dt([this.project(l.getSouthWest(),h)._subtract(E),this.project(l.getNorthWest(),h)._subtract(E),this.project(l.getSouthEast(),h)._subtract(E),this.project(l.getNorthEast(),h)._subtract(E)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(l){return this.latLngToLayerPoint(l).subtract(this._getCenterLayerPoint())},_limitCenter:function(l,h,x){if(!x)return l;var E=this.project(l,h),k=this.getSize().divideBy(2),N=new _e(E.subtract(k),E.add(k)),ie=this._getBoundsOffset(N,x,h);return Math.abs(ie.x)<=1&&Math.abs(ie.y)<=1?l:this.unproject(E.add(ie),h)},_limitOffset:function(l,h){if(!h)return l;var x=this.getPixelBounds(),E=new _e(x.min.add(l),x.max.add(l));return l.add(this._getBoundsOffset(E,h))},_getBoundsOffset:function(l,h,x){var E=dt(this.project(h.getNorthEast(),x),this.project(h.getSouthWest(),x)),k=E.min.subtract(l.min),N=E.max.subtract(l.max),ie=this._rebound(k.x,-N.x),ve=this._rebound(k.y,-N.y);return new xe(ie,ve)},_rebound:function(l,h){return l+h>0?Math.round(l-h)/2:Math.max(0,Math.ceil(l))-Math.max(0,Math.floor(h))},_limitZoom:function(l){var h=this.getMinZoom(),x=this.getMaxZoom(),E=ye.any3d?this.options.zoomSnap:1;return E&&(l=Math.round(l/E)*E),Math.max(h,Math.min(x,l))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Ie(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(l,h){var x=this._getCenterOffset(l)._trunc();return(h&&h.animate)!==!0&&!this.getSize().contains(x)?!1:(this.panBy(x,h),!0)},_createAnimProxy:function(){var l=this._proxy=J("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(l),this.on("zoomanim",function(h){var x=F,E=this._proxy.style[x];Pe(this._proxy,this.project(h.center,h.zoom),this.getZoomScale(h.zoom,1)),E===this._proxy.style[x]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ce(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var l=this.getCenter(),h=this.getZoom();Pe(this._proxy,this.project(l,h),this.getZoomScale(h,1))},_catchTransitionEnd:function(l){this._animatingZoom&&l.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(l,h,x){if(this._animatingZoom)return!0;if(x=x||{},!this._zoomAnimated||x.animate===!1||this._nothingToAnimate()||Math.abs(h-this._zoom)>this.options.zoomAnimationThreshold)return!1;var E=this.getZoomScale(h),k=this._getCenterOffset(l)._divideBy(1-1/E);return x.animate!==!0&&!this.getSize().contains(k)?!1:(te(function(){this._moveStart(!0,x.noMoveStart||!1)._animateZoom(l,h,!0)},this),!0)},_animateZoom:function(l,h,x,E){this._mapPane&&(x&&(this._animatingZoom=!0,this._animateToCenter=l,this._animateToZoom=h,me(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:l,zoom:h,noUpdate:E}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Ie(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ys(l,h){return new zi(l,h)}var Pn=oe.extend({options:{position:"topright"},initialize:function(l){y(this,l)},getPosition:function(){return this.options.position},setPosition:function(l){var h=this._map;return h&&h.removeControl(this),this.options.position=l,h&&h.addControl(this),this},getContainer:function(){return this._container},addTo:function(l){this.remove(),this._map=l;var h=this._container=this.onAdd(l),x=this.getPosition(),E=l._controlCorners[x];return me(h,"leaflet-control"),x.indexOf("bottom")!==-1?E.insertBefore(h,E.firstChild):E.appendChild(h),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ce(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(l){this._map&&l&&l.screenX>0&&l.screenY>0&&this._map.getContainer().focus()}}),Vn=function(l){return new Pn(l)};zi.include({addControl:function(l){return l.addTo(this),this},removeControl:function(l){return l.remove(),this},_initControlPos:function(){var l=this._controlCorners={},h="leaflet-",x=this._controlContainer=J("div",h+"control-container",this._container);function E(k,N){var ie=h+k+" "+h+N;l[k+N]=J("div",ie,x)}E("top","left"),E("top","right"),E("bottom","left"),E("bottom","right")},_clearControlPos:function(){for(var l in this._controlCorners)ce(this._controlCorners[l]);ce(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ts=Pn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(l,h,x,E){return x<E?-1:E<x?1:0}},initialize:function(l,h,x){y(this,x),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var E in l)this._addLayer(l[E],E);for(E in h)this._addLayer(h[E],E,!0)},onAdd:function(l){this._initLayout(),this._update(),this._map=l,l.on("zoomend",this._checkDisabledLayers,this);for(var h=0;h<this._layers.length;h++)this._layers[h].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(l){return Pn.prototype.addTo.call(this,l),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(l,h){return this._addLayer(l,h),this._map?this._update():this},addOverlay:function(l,h){return this._addLayer(l,h,!0),this._map?this._update():this},removeLayer:function(l){l.off("add remove",this._onLayerChange,this);var h=this._getLayer(d(l));return h&&this._layers.splice(this._layers.indexOf(h),1),this._map?this._update():this},expand:function(){me(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var l=this._map.getSize().y-(this._container.offsetTop+50);return l<this._section.clientHeight?(me(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=l+"px"):Ie(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Ie(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var l="leaflet-control-layers",h=this._container=J("div",l),x=this.options.collapsed;h.setAttribute("aria-haspopup",!0),Xi(h),ii(h);var E=this._section=J("section",l+"-list");x&&(this._map.on("click",this.collapse,this),pt(h,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var k=this._layersLink=J("a",l+"-toggle",h);k.href="#",k.title="Layers",k.setAttribute("role","button"),pt(k,{keydown:function(N){N.keyCode===13&&this._expandSafely()},click:function(N){Ji(N),this._expandSafely()}},this),x||this.expand(),this._baseLayersList=J("div",l+"-base",E),this._separator=J("div",l+"-separator",E),this._overlaysList=J("div",l+"-overlays",E),h.appendChild(E)},_getLayer:function(l){for(var h=0;h<this._layers.length;h++)if(this._layers[h]&&d(this._layers[h].layer)===l)return this._layers[h]},_addLayer:function(l,h,x){this._map&&l.on("add remove",this._onLayerChange,this),this._layers.push({layer:l,name:h,overlay:x}),this.options.sortLayers&&this._layers.sort(r(function(E,k){return this.options.sortFunction(E.layer,k.layer,E.name,k.name)},this)),this.options.autoZIndex&&l.setZIndex&&(this._lastZIndex++,l.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Qe(this._baseLayersList),Qe(this._overlaysList),this._layerControlInputs=[];var l,h,x,E,k=0;for(x=0;x<this._layers.length;x++)E=this._layers[x],this._addItem(E),h=h||E.overlay,l=l||!E.overlay,k+=E.overlay?0:1;return this.options.hideSingleBase&&(l=l&&k>1,this._baseLayersList.style.display=l?"":"none"),this._separator.style.display=h&&l?"":"none",this},_onLayerChange:function(l){this._handlingClick||this._update();var h=this._getLayer(d(l.target)),x=h.overlay?l.type==="add"?"overlayadd":"overlayremove":l.type==="add"?"baselayerchange":null;x&&this._map.fire(x,h)},_createRadioElement:function(l,h){var x='<input type="radio" class="leaflet-control-layers-selector" name="'+l+'"'+(h?' checked="checked"':"")+"/>",E=document.createElement("div");return E.innerHTML=x,E.firstChild},_addItem:function(l){var h=document.createElement("label"),x=this._map.hasLayer(l.layer),E;l.overlay?(E=document.createElement("input"),E.type="checkbox",E.className="leaflet-control-layers-selector",E.defaultChecked=x):E=this._createRadioElement("leaflet-base-layers_"+d(this),x),this._layerControlInputs.push(E),E.layerId=d(l.layer),pt(E,"click",this._onInputClick,this);var k=document.createElement("span");k.innerHTML=" "+l.name;var N=document.createElement("span");h.appendChild(N),N.appendChild(E),N.appendChild(k);var ie=l.overlay?this._overlaysList:this._baseLayersList;return ie.appendChild(h),this._checkDisabledLayers(),h},_onInputClick:function(){if(!this._preventClick){var l=this._layerControlInputs,h,x,E=[],k=[];this._handlingClick=!0;for(var N=l.length-1;N>=0;N--)h=l[N],x=this._getLayer(h.layerId).layer,h.checked?E.push(x):h.checked||k.push(x);for(N=0;N<k.length;N++)this._map.hasLayer(k[N])&&this._map.removeLayer(k[N]);for(N=0;N<E.length;N++)this._map.hasLayer(E[N])||this._map.addLayer(E[N]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var l=this._layerControlInputs,h,x,E=this._map.getZoom(),k=l.length-1;k>=0;k--)h=l[k],x=this._getLayer(h.layerId).layer,h.disabled=x.options.minZoom!==void 0&&E<x.options.minZoom||x.options.maxZoom!==void 0&&E>x.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var l=this._section;this._preventClick=!0,pt(l,"click",Ji),this.expand();var h=this;setTimeout(function(){wi(l,"click",Ji),h._preventClick=!1})}}),dr=function(l,h,x){return new Ts(l,h,x)},Or=Pn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(l){var h="leaflet-control-zoom",x=J("div",h+" leaflet-bar"),E=this.options;return this._zoomInButton=this._createButton(E.zoomInText,E.zoomInTitle,h+"-in",x,this._zoomIn),this._zoomOutButton=this._createButton(E.zoomOutText,E.zoomOutTitle,h+"-out",x,this._zoomOut),this._updateDisabled(),l.on("zoomend zoomlevelschange",this._updateDisabled,this),x},onRemove:function(l){l.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(l){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(l.shiftKey?3:1))},_zoomOut:function(l){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(l.shiftKey?3:1))},_createButton:function(l,h,x,E,k){var N=J("a",x,E);return N.innerHTML=l,N.href="#",N.title=h,N.setAttribute("role","button"),N.setAttribute("aria-label",h),Xi(N),pt(N,"click",Ln),pt(N,"click",k,this),pt(N,"click",this._refocusOnMap,this),N},_updateDisabled:function(){var l=this._map,h="leaflet-disabled";Ie(this._zoomInButton,h),Ie(this._zoomOutButton,h),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||l._zoom===l.getMinZoom())&&(me(this._zoomOutButton,h),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||l._zoom===l.getMaxZoom())&&(me(this._zoomInButton,h),this._zoomInButton.setAttribute("aria-disabled","true"))}});zi.mergeOptions({zoomControl:!0}),zi.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Or,this.addControl(this.zoomControl))});var Za=function(l){return new Or(l)},Xa=Pn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(l){var h="leaflet-control-scale",x=J("div",h),E=this.options;return this._addScales(E,h+"-line",x),l.on(E.updateWhenIdle?"moveend":"move",this._update,this),l.whenReady(this._update,this),x},onRemove:function(l){l.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(l,h,x){l.metric&&(this._mScale=J("div",h,x)),l.imperial&&(this._iScale=J("div",h,x))},_update:function(){var l=this._map,h=l.getSize().y/2,x=l.distance(l.containerPointToLatLng([0,h]),l.containerPointToLatLng([this.options.maxWidth,h]));this._updateScales(x)},_updateScales:function(l){this.options.metric&&l&&this._updateMetric(l),this.options.imperial&&l&&this._updateImperial(l)},_updateMetric:function(l){var h=this._getRoundNum(l),x=h<1e3?h+" m":h/1e3+" km";this._updateScale(this._mScale,x,h/l)},_updateImperial:function(l){var h=l*3.2808399,x,E,k;h>5280?(x=h/5280,E=this._getRoundNum(x),this._updateScale(this._iScale,E+" mi",E/x)):(k=this._getRoundNum(h),this._updateScale(this._iScale,k+" ft",k/h))},_updateScale:function(l,h,x){l.style.width=Math.round(this.options.maxWidth*x)+"px",l.innerHTML=h},_getRoundNum:function(l){var h=Math.pow(10,(Math.floor(l)+"").length-1),x=l/h;return x=x>=10?10:x>=5?5:x>=3?3:x>=2?2:1,h*x}}),ur=function(l){return new Xa(l)},ga='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Hr=Pn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ye.inlineSvg?ga+" ":"")+"Leaflet</a>"},initialize:function(l){y(this,l),this._attributions={}},onAdd:function(l){l.attributionControl=this,this._container=J("div","leaflet-control-attribution"),Xi(this._container);for(var h in l._layers)l._layers[h].getAttribution&&this.addAttribution(l._layers[h].getAttribution());return this._update(),l.on("layeradd",this._addAttribution,this),this._container},onRemove:function(l){l.off("layeradd",this._addAttribution,this)},_addAttribution:function(l){l.layer.getAttribution&&(this.addAttribution(l.layer.getAttribution()),l.layer.once("remove",function(){this.removeAttribution(l.layer.getAttribution())},this))},setPrefix:function(l){return this.options.prefix=l,this._update(),this},addAttribution:function(l){return l?(this._attributions[l]||(this._attributions[l]=0),this._attributions[l]++,this._update(),this):this},removeAttribution:function(l){return l?(this._attributions[l]&&(this._attributions[l]--,this._update()),this):this},_update:function(){if(this._map){var l=[];for(var h in this._attributions)this._attributions[h]&&l.push(h);var x=[];this.options.prefix&&x.push(this.options.prefix),l.length&&x.push(l.join(", ")),this._container.innerHTML=x.join(' <span aria-hidden="true">|</span> ')}}});zi.mergeOptions({attributionControl:!0}),zi.addInitHook(function(){this.options.attributionControl&&new Hr().addTo(this)});var Fb=function(l){return new Hr(l)};Pn.Layers=Ts,Pn.Zoom=Or,Pn.Scale=Xa,Pn.Attribution=Hr,Vn.layers=dr,Vn.zoom=Za,Vn.scale=ur,Vn.attribution=Fb;var Oo=oe.extend({initialize:function(l){this._map=l},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Oo.addTo=function(l,h){return l.addHandler(h,this),this};var Lb={Events:Se},lf=ye.touch?"touchstart mousedown":"mousedown",Wr=Re.extend({options:{clickTolerance:3},initialize:function(l,h,x,E){y(this,E),this._element=l,this._dragStartTarget=h||l,this._preventOutline=x},enable:function(){this._enabled||(pt(this._dragStartTarget,lf,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Wr._dragging===this&&this.finishDrag(!0),wi(this._dragStartTarget,lf,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(l){if(this._enabled&&(this._moved=!1,!Te(this._element,"leaflet-zoom-anim"))){if(l.touches&&l.touches.length!==1){Wr._dragging===this&&this.finishDrag();return}if(!(Wr._dragging||l.shiftKey||l.which!==1&&l.button!==1&&!l.touches)&&(Wr._dragging=this,this._preventOutline&&It(this._element),ze(),vt(),!this._moving)){this.fire("down");var h=l.touches?l.touches[0]:l,x=st(this._element);this._startPoint=new xe(h.clientX,h.clientY),this._startPos=Ct(this._element),this._parentScale=Lt(x);var E=l.type==="mousedown";pt(document,E?"mousemove":"touchmove",this._onMove,this),pt(document,E?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(l){if(this._enabled){if(l.touches&&l.touches.length>1){this._moved=!0;return}var h=l.touches&&l.touches.length===1?l.touches[0]:l,x=new xe(h.clientX,h.clientY)._subtract(this._startPoint);!x.x&&!x.y||Math.abs(x.x)+Math.abs(x.y)<this.options.clickTolerance||(x.x/=this._parentScale.x,x.y/=this._parentScale.y,Ji(l),this._moved||(this.fire("dragstart"),this._moved=!0,me(document.body,"leaflet-dragging"),this._lastTarget=l.target||l.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),me(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(x),this._moving=!0,this._lastEvent=l,this._updatePosition())}},_updatePosition:function(){var l={originalEvent:this._lastEvent};this.fire("predrag",l),ke(this._element,this._newPos),this.fire("drag",l)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(l){Ie(document.body,"leaflet-dragging"),this._lastTarget&&(Ie(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),wi(document,"mousemove touchmove",this._onMove,this),wi(document,"mouseup touchend touchcancel",this._onUp,this),Je(),Fe();var h=this._moved&&this._moving;this._moving=!1,Wr._dragging=!1,h&&this.fire("dragend",{noInertia:l,distance:this._newPos.distanceTo(this._startPos)})}});function cf(l,h,x){var E,k=[1,4,2,8],N,ie,ve,Ce,Et,li,Ki,hi;for(N=0,li=l.length;N<li;N++)l[N]._code=Ya(l[N],h);for(ve=0;ve<4;ve++){for(Ki=k[ve],E=[],N=0,li=l.length,ie=li-1;N<li;ie=N++)Ce=l[N],Et=l[ie],Ce._code&Ki?Et._code&Ki||(hi=Wl(Et,Ce,Ki,h,x),hi._code=Ya(hi,h),E.push(hi)):(Et._code&Ki&&(hi=Wl(Et,Ce,Ki,h,x),hi._code=Ya(hi,h),E.push(hi)),E.push(Ce));l=E}return l}function df(l,h){var x,E,k,N,ie,ve,Ce,Et,li;if(!l||l.length===0)throw new Error("latlngs not passed");Ao(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var Ki=be([0,0]),hi=tt(l),un=hi.getNorthWest().distanceTo(hi.getSouthWest())*hi.getNorthEast().distanceTo(hi.getNorthWest());un<1700&&(Ki=Xu(l));var In=l.length,_s=[];for(x=0;x<In;x++){var Ns=be(l[x]);_s.push(h.project(be([Ns.lat-Ki.lat,Ns.lng-Ki.lng])))}for(ve=Ce=Et=0,x=0,E=In-1;x<In;E=x++)k=_s[x],N=_s[E],ie=k.y*N.x-N.y*k.x,Ce+=(k.x+N.x)*ie,Et+=(k.y+N.y)*ie,ve+=ie*3;ve===0?li=_s[0]:li=[Ce/ve,Et/ve];var Vr=h.unproject(We(li));return be([Vr.lat+Ki.lat,Vr.lng+Ki.lng])}function Xu(l){for(var h=0,x=0,E=0,k=0;k<l.length;k++){var N=be(l[k]);h+=N.lat,x+=N.lng,E++}return be([h/E,x/E])}var Ib={__proto__:null,clipPolygon:cf,polygonCenter:df,centroid:Xu};function uf(l,h){if(!h||!l.length)return l.slice();var x=h*h;return l=Zp(l,x),l=hf(l,x),l}function Gp(l,h,x){return Math.sqrt(Gc(l,h,x,!0))}function Kp(l,h,x){return Gc(l,h,x)}function hf(l,h){var x=l.length,E=typeof Uint8Array<"u"?Uint8Array:Array,k=new E(x);k[0]=k[x-1]=1,Yu(l,k,h,0,x-1);var N,ie=[];for(N=0;N<x;N++)k[N]&&ie.push(l[N]);return ie}function Yu(l,h,x,E,k){var N=0,ie,ve,Ce;for(ve=E+1;ve<=k-1;ve++)Ce=Gc(l[ve],l[E],l[k],!0),Ce>N&&(ie=ve,N=Ce);N>x&&(h[ie]=1,Yu(l,h,x,E,ie),Yu(l,h,x,ie,k))}function Zp(l,h){for(var x=[l[0]],E=1,k=0,N=l.length;E<N;E++)Xp(l[E],l[k])>h&&(x.push(l[E]),k=E);return k<N-1&&x.push(l[N-1]),x}var ff;function gf(l,h,x,E,k){var N=E?ff:Ya(l,x),ie=Ya(h,x),ve,Ce,Et;for(ff=ie;;){if(!(N|ie))return[l,h];if(N&ie)return!1;ve=N||ie,Ce=Wl(l,h,ve,x,k),Et=Ya(Ce,x),ve===N?(l=Ce,N=Et):(h=Ce,ie=Et)}}function Wl(l,h,x,E,k){var N=h.x-l.x,ie=h.y-l.y,ve=E.min,Ce=E.max,Et,li;return x&8?(Et=l.x+N*(Ce.y-l.y)/ie,li=Ce.y):x&4?(Et=l.x+N*(ve.y-l.y)/ie,li=ve.y):x&2?(Et=Ce.x,li=l.y+ie*(Ce.x-l.x)/N):x&1&&(Et=ve.x,li=l.y+ie*(ve.x-l.x)/N),new xe(Et,li,k)}function Ya(l,h){var x=0;return l.x<h.min.x?x|=1:l.x>h.max.x&&(x|=2),l.y<h.min.y?x|=4:l.y>h.max.y&&(x|=8),x}function Xp(l,h){var x=h.x-l.x,E=h.y-l.y;return x*x+E*E}function Gc(l,h,x,E){var k=h.x,N=h.y,ie=x.x-k,ve=x.y-N,Ce=ie*ie+ve*ve,Et;return Ce>0&&(Et=((l.x-k)*ie+(l.y-N)*ve)/Ce,Et>1?(k=x.x,N=x.y):Et>0&&(k+=ie*Et,N+=ve*Et)),ie=l.x-k,ve=l.y-N,E?ie*ie+ve*ve:new xe(k,N)}function Ao(l){return!M(l[0])||typeof l[0][0]!="object"&&typeof l[0][0]<"u"}function Yp(l){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ao(l)}function pf(l,h){var x,E,k,N,ie,ve,Ce,Et;if(!l||l.length===0)throw new Error("latlngs not passed");Ao(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var li=be([0,0]),Ki=tt(l),hi=Ki.getNorthWest().distanceTo(Ki.getSouthWest())*Ki.getNorthEast().distanceTo(Ki.getNorthWest());hi<1700&&(li=Xu(l));var un=l.length,In=[];for(x=0;x<un;x++){var _s=be(l[x]);In.push(h.project(be([_s.lat-li.lat,_s.lng-li.lng])))}for(x=0,E=0;x<un-1;x++)E+=In[x].distanceTo(In[x+1])/2;if(E===0)Et=In[0];else for(x=0,N=0;x<un-1;x++)if(ie=In[x],ve=In[x+1],k=ie.distanceTo(ve),N+=k,N>E){Ce=(N-E)/k,Et=[ve.x-Ce*(ve.x-ie.x),ve.y-Ce*(ve.y-ie.y)];break}var Ns=h.unproject(We(Et));return be([Ns.lat+li.lat,Ns.lng+li.lng])}var Kc={__proto__:null,simplify:uf,pointToSegmentDistance:Gp,closestPointOnSegment:Kp,clipSegment:gf,_getEdgeIntersection:Wl,_getBitCode:Ya,_sqClosestPointOnSegment:Gc,isFlat:Ao,_flat:Yp,polylineCenter:pf},xf={project:function(l){return new xe(l.lng,l.lat)},unproject:function(l){return new kt(l.y,l.x)},bounds:new _e([-180,-90],[180,90])},mf={R:6378137,R_MINOR:6356752314245179e-9,bounds:new _e([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(l){var h=Math.PI/180,x=this.R,E=l.lat*h,k=this.R_MINOR/x,N=Math.sqrt(1-k*k),ie=N*Math.sin(E),ve=Math.tan(Math.PI/4-E/2)/Math.pow((1-ie)/(1+ie),N/2);return E=-x*Math.log(Math.max(ve,1e-10)),new xe(l.lng*h*x,E)},unproject:function(l){for(var h=180/Math.PI,x=this.R,E=this.R_MINOR/x,k=Math.sqrt(1-E*E),N=Math.exp(-l.y/x),ie=Math.PI/2-2*Math.atan(N),ve=0,Ce=.1,Et;ve<15&&Math.abs(Ce)>1e-7;ve++)Et=k*Math.sin(ie),Et=Math.pow((1-Et)/(1+Et),k/2),Ce=Math.PI/2-2*Math.atan(N*Et)-ie,ie+=Ce;return new kt(ie*h,l.x*h/x)}},Pb={__proto__:null,LonLat:xf,Mercator:mf,SphericalMercator:Ze},Qp=n({},ut,{code:"EPSG:3395",projection:mf,transformation:(function(){var l=.5/(Math.PI*mf.R);return ui(l,.5,-l,.5)})()}),Jp=n({},ut,{code:"EPSG:4326",projection:xf,transformation:ui(1/180,1,-1/180,.5)}),ex=n({},Rt,{projection:xf,transformation:ui(1,0,-1,0),scale:function(l){return Math.pow(2,l)},zoom:function(l){return Math.log(l)/Math.LN2},distance:function(l,h){var x=h.lng-l.lng,E=h.lat-l.lat;return Math.sqrt(x*x+E*E)},infinite:!0});Rt.Earth=ut,Rt.EPSG3395=Qp,Rt.EPSG3857=wt,Rt.EPSG900913=Ft,Rt.EPSG4326=Jp,Rt.Simple=ex;var Qo=Re.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(l){return l.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(l){return l&&l.removeLayer(this),this},getPane:function(l){return this._map.getPane(l?this.options[l]||l:this.options.pane)},addInteractiveTarget:function(l){return this._map._targets[d(l)]=this,this},removeInteractiveTarget:function(l){return delete this._map._targets[d(l)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(l){var h=l.target;if(h.hasLayer(this)){if(this._map=h,this._zoomAnimated=h._zoomAnimated,this.getEvents){var x=this.getEvents();h.on(x,this),this.once("remove",function(){h.off(x,this)},this)}this.onAdd(h),this.fire("add"),h.fire("layeradd",{layer:this})}}});zi.include({addLayer:function(l){if(!l._layerAdd)throw new Error("The provided object is not a Layer.");var h=d(l);return this._layers[h]?this:(this._layers[h]=l,l._mapToAdd=this,l.beforeAdd&&l.beforeAdd(this),this.whenReady(l._layerAdd,l),this)},removeLayer:function(l){var h=d(l);return this._layers[h]?(this._loaded&&l.onRemove(this),delete this._layers[h],this._loaded&&(this.fire("layerremove",{layer:l}),l.fire("remove")),l._map=l._mapToAdd=null,this):this},hasLayer:function(l){return d(l)in this._layers},eachLayer:function(l,h){for(var x in this._layers)l.call(h,this._layers[x]);return this},_addLayers:function(l){l=l?M(l)?l:[l]:[];for(var h=0,x=l.length;h<x;h++)this.addLayer(l[h])},_addZoomLimit:function(l){(!isNaN(l.options.maxZoom)||!isNaN(l.options.minZoom))&&(this._zoomBoundLayers[d(l)]=l,this._updateZoomLevels())},_removeZoomLimit:function(l){var h=d(l);this._zoomBoundLayers[h]&&(delete this._zoomBoundLayers[h],this._updateZoomLevels())},_updateZoomLevels:function(){var l=1/0,h=-1/0,x=this._getZoomSpan();for(var E in this._zoomBoundLayers){var k=this._zoomBoundLayers[E].options;l=k.minZoom===void 0?l:Math.min(l,k.minZoom),h=k.maxZoom===void 0?h:Math.max(h,k.maxZoom)}this._layersMaxZoom=h===-1/0?void 0:h,this._layersMinZoom=l===1/0?void 0:l,x!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Qa=Qo.extend({initialize:function(l,h){y(this,h),this._layers={};var x,E;if(l)for(x=0,E=l.length;x<E;x++)this.addLayer(l[x])},addLayer:function(l){var h=this.getLayerId(l);return this._layers[h]=l,this._map&&this._map.addLayer(l),this},removeLayer:function(l){var h=l in this._layers?l:this.getLayerId(l);return this._map&&this._layers[h]&&this._map.removeLayer(this._layers[h]),delete this._layers[h],this},hasLayer:function(l){var h=typeof l=="number"?l:this.getLayerId(l);return h in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(l){var h=Array.prototype.slice.call(arguments,1),x,E;for(x in this._layers)E=this._layers[x],E[l]&&E[l].apply(E,h);return this},onAdd:function(l){this.eachLayer(l.addLayer,l)},onRemove:function(l){this.eachLayer(l.removeLayer,l)},eachLayer:function(l,h){for(var x in this._layers)l.call(h,this._layers[x]);return this},getLayer:function(l){return this._layers[l]},getLayers:function(){var l=[];return this.eachLayer(l.push,l),l},setZIndex:function(l){return this.invoke("setZIndex",l)},getLayerId:function(l){return d(l)}}),tx=function(l,h){return new Qa(l,h)},zr=Qa.extend({addLayer:function(l){return this.hasLayer(l)?this:(l.addEventParent(this),Qa.prototype.addLayer.call(this,l),this.fire("layeradd",{layer:l}))},removeLayer:function(l){return this.hasLayer(l)?(l in this._layers&&(l=this._layers[l]),l.removeEventParent(this),Qa.prototype.removeLayer.call(this,l),this.fire("layerremove",{layer:l})):this},setStyle:function(l){return this.invoke("setStyle",l)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var l=new Wt;for(var h in this._layers){var x=this._layers[h];l.extend(x.getBounds?x.getBounds():x.getLatLng())}return l}}),ix=function(l,h){return new zr(l,h)},zl=oe.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(l){y(this,l)},createIcon:function(l){return this._createIcon("icon",l)},createShadow:function(l){return this._createIcon("shadow",l)},_createIcon:function(l,h){var x=this._getIconUrl(l);if(!x){if(l==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var E=this._createImg(x,h&&h.tagName==="IMG"?h:null);return this._setIconStyles(E,l),(this.options.crossOrigin||this.options.crossOrigin==="")&&(E.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),E},_setIconStyles:function(l,h){var x=this.options,E=x[h+"Size"];typeof E=="number"&&(E=[E,E]);var k=We(E),N=We(h==="shadow"&&x.shadowAnchor||x.iconAnchor||k&&k.divideBy(2,!0));l.className="leaflet-marker-"+h+" "+(x.className||""),N&&(l.style.marginLeft=-N.x+"px",l.style.marginTop=-N.y+"px"),k&&(l.style.width=k.x+"px",l.style.height=k.y+"px")},_createImg:function(l,h){return h=h||document.createElement("img"),h.src=l,h},_getIconUrl:function(l){return ye.retina&&this.options[l+"RetinaUrl"]||this.options[l+"Url"]}});function nx(l){return new zl(l)}var Vl=zl.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(l){return typeof Vl.imagePath!="string"&&(Vl.imagePath=this._detectIconPath()),(this.options.imagePath||Vl.imagePath)+zl.prototype._getIconUrl.call(this,l)},_stripUrl:function(l){var h=function(x,E,k){var N=E.exec(x);return N&&N[k]};return l=h(l,/^url\((['"])?(.+)\1\)$/,2),l&&h(l,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var l=J("div","leaflet-default-icon-path",document.body),h=Z(l,"background-image")||Z(l,"backgroundImage");if(document.body.removeChild(l),h=this._stripUrl(h),h)return h;var x=document.querySelector('link[href$="leaflet.css"]');return x?x.href.substring(0,x.href.length-11-1):""}}),Zc=Oo.extend({initialize:function(l){this._marker=l},addHooks:function(){var l=this._marker._icon;this._draggable||(this._draggable=new Wr(l,l,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),me(l,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Ie(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(l){var h=this._marker,x=h._map,E=this._marker.options.autoPanSpeed,k=this._marker.options.autoPanPadding,N=Ct(h._icon),ie=x.getPixelBounds(),ve=x.getPixelOrigin(),Ce=dt(ie.min._subtract(ve).add(k),ie.max._subtract(ve).subtract(k));if(!Ce.contains(N)){var Et=We((Math.max(Ce.max.x,N.x)-Ce.max.x)/(ie.max.x-Ce.max.x)-(Math.min(Ce.min.x,N.x)-Ce.min.x)/(ie.min.x-Ce.min.x),(Math.max(Ce.max.y,N.y)-Ce.max.y)/(ie.max.y-Ce.max.y)-(Math.min(Ce.min.y,N.y)-Ce.min.y)/(ie.min.y-Ce.min.y)).multiplyBy(E);x.panBy(Et,{animate:!1}),this._draggable._newPos._add(Et),this._draggable._startPos._add(Et),ke(h._icon,this._draggable._newPos),this._onDrag(l),this._panRequest=te(this._adjustPan.bind(this,l))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(l){this._marker.options.autoPan&&(he(this._panRequest),this._panRequest=te(this._adjustPan.bind(this,l)))},_onDrag:function(l){var h=this._marker,x=h._shadow,E=Ct(h._icon),k=h._map.layerPointToLatLng(E);x&&ke(x,E),h._latlng=k,l.latlng=k,l.oldLatLng=this._oldLatLng,h.fire("move",l).fire("drag",l)},_onDragEnd:function(l){he(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",l)}}),Qu=Qo.extend({options:{icon:new Vl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(l,h){y(this,h),this._latlng=be(l)},onAdd:function(l){this._zoomAnimated=this._zoomAnimated&&l.options.markerZoomAnimation,this._zoomAnimated&&l.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(l){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&l.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(l){var h=this._latlng;return this._latlng=be(l),this.update(),this.fire("move",{oldLatLng:h,latlng:this._latlng})},setZIndexOffset:function(l){return this.options.zIndexOffset=l,this.update()},getIcon:function(){return this.options.icon},setIcon:function(l){return this.options.icon=l,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var l=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(l)}return this},_initIcon:function(){var l=this.options,h="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),x=l.icon.createIcon(this._icon),E=!1;x!==this._icon&&(this._icon&&this._removeIcon(),E=!0,l.title&&(x.title=l.title),x.tagName==="IMG"&&(x.alt=l.alt||"")),me(x,h),l.keyboard&&(x.tabIndex="0",x.setAttribute("role","button")),this._icon=x,l.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&pt(x,"focus",this._panOnFocus,this);var k=l.icon.createShadow(this._shadow),N=!1;k!==this._shadow&&(this._removeShadow(),N=!0),k&&(me(k,h),k.alt=""),this._shadow=k,l.opacity<1&&this._updateOpacity(),E&&this.getPane().appendChild(this._icon),this._initInteraction(),k&&N&&this.getPane(l.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&wi(this._icon,"focus",this._panOnFocus,this),ce(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ce(this._shadow),this._shadow=null},_setPos:function(l){this._icon&&ke(this._icon,l),this._shadow&&ke(this._shadow,l),this._zIndex=l.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(l){this._icon&&(this._icon.style.zIndex=this._zIndex+l)},_animateZoom:function(l){var h=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center).round();this._setPos(h)},_initInteraction:function(){if(this.options.interactive&&(me(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Zc)){var l=this.options.draggable;this.dragging&&(l=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Zc(this),l&&this.dragging.enable()}},setOpacity:function(l){return this.options.opacity=l,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var l=this.options.opacity;this._icon&&re(this._icon,l),this._shadow&&re(this._shadow,l)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var l=this._map;if(l){var h=this.options.icon.options,x=h.iconSize?We(h.iconSize):We(0,0),E=h.iconAnchor?We(h.iconAnchor):We(0,0);l.panInside(this._latlng,{paddingTopLeft:E,paddingBottomRight:x.subtract(E)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function sx(l,h){return new Qu(l,h)}var pa=Qo.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(l){this._renderer=l.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(l){return y(this,l),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&l&&Object.prototype.hasOwnProperty.call(l,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ju=pa.extend({options:{fill:!0,radius:10},initialize:function(l,h){y(this,h),this._latlng=be(l),this._radius=this.options.radius},setLatLng:function(l){var h=this._latlng;return this._latlng=be(l),this.redraw(),this.fire("move",{oldLatLng:h,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(l){return this.options.radius=this._radius=l,this.redraw()},getRadius:function(){return this._radius},setStyle:function(l){var h=l&&l.radius||this._radius;return pa.prototype.setStyle.call(this,l),this.setRadius(h),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var l=this._radius,h=this._radiusY||l,x=this._clickTolerance(),E=[l+x,h+x];this._pxBounds=new _e(this._point.subtract(E),this._point.add(E))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(l){return l.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ox(l,h){return new Ju(l,h)}var vf=Ju.extend({initialize:function(l,h,x){if(typeof h=="number"&&(h=n({},x,{radius:h})),y(this,h),this._latlng=be(l),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(l){return this._mRadius=l,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var l=[this._radius,this._radiusY||this._radius];return new Wt(this._map.layerPointToLatLng(this._point.subtract(l)),this._map.layerPointToLatLng(this._point.add(l)))},setStyle:pa.prototype.setStyle,_project:function(){var l=this._latlng.lng,h=this._latlng.lat,x=this._map,E=x.options.crs;if(E.distance===ut.distance){var k=Math.PI/180,N=this._mRadius/ut.R/k,ie=x.project([h+N,l]),ve=x.project([h-N,l]),Ce=ie.add(ve).divideBy(2),Et=x.unproject(Ce).lat,li=Math.acos((Math.cos(N*k)-Math.sin(h*k)*Math.sin(Et*k))/(Math.cos(h*k)*Math.cos(Et*k)))/k;(isNaN(li)||li===0)&&(li=N/Math.cos(Math.PI/180*h)),this._point=Ce.subtract(x.getPixelOrigin()),this._radius=isNaN(li)?0:Ce.x-x.project([Et,l-li]).x,this._radiusY=Ce.y-ie.y}else{var Ki=E.unproject(E.project(this._latlng).subtract([this._mRadius,0]));this._point=x.latLngToLayerPoint(this._latlng),this._radius=this._point.x-x.latLngToLayerPoint(Ki).x}this._updateBounds()}});function _f(l,h,x){return new vf(l,h,x)}var hr=pa.extend({options:{smoothFactor:1,noClip:!1},initialize:function(l,h){y(this,h),this._setLatLngs(l)},getLatLngs:function(){return this._latlngs},setLatLngs:function(l){return this._setLatLngs(l),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(l){for(var h=1/0,x=null,E=Gc,k,N,ie=0,ve=this._parts.length;ie<ve;ie++)for(var Ce=this._parts[ie],Et=1,li=Ce.length;Et<li;Et++){k=Ce[Et-1],N=Ce[Et];var Ki=E(l,k,N,!0);Ki<h&&(h=Ki,x=E(l,k,N))}return x&&(x.distance=Math.sqrt(h)),x},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return pf(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(l,h){return h=h||this._defaultShape(),l=be(l),h.push(l),this._bounds.extend(l),this.redraw()},_setLatLngs:function(l){this._bounds=new Wt,this._latlngs=this._convertLatLngs(l)},_defaultShape:function(){return Ao(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(l){for(var h=[],x=Ao(l),E=0,k=l.length;E<k;E++)x?(h[E]=be(l[E]),this._bounds.extend(h[E])):h[E]=this._convertLatLngs(l[E]);return h},_project:function(){var l=new _e;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,l),this._bounds.isValid()&&l.isValid()&&(this._rawPxBounds=l,this._updateBounds())},_updateBounds:function(){var l=this._clickTolerance(),h=new xe(l,l);this._rawPxBounds&&(this._pxBounds=new _e([this._rawPxBounds.min.subtract(h),this._rawPxBounds.max.add(h)]))},_projectLatlngs:function(l,h,x){var E=l[0]instanceof kt,k=l.length,N,ie;if(E){for(ie=[],N=0;N<k;N++)ie[N]=this._map.latLngToLayerPoint(l[N]),x.extend(ie[N]);h.push(ie)}else for(N=0;N<k;N++)this._projectLatlngs(l[N],h,x)},_clipPoints:function(){var l=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}var h=this._parts,x,E,k,N,ie,ve,Ce;for(x=0,k=0,N=this._rings.length;x<N;x++)for(Ce=this._rings[x],E=0,ie=Ce.length;E<ie-1;E++)ve=gf(Ce[E],Ce[E+1],l,E,!0),ve&&(h[k]=h[k]||[],h[k].push(ve[0]),(ve[1]!==Ce[E+1]||E===ie-2)&&(h[k].push(ve[1]),k++))}},_simplifyPoints:function(){for(var l=this._parts,h=this.options.smoothFactor,x=0,E=l.length;x<E;x++)l[x]=uf(l[x],h)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(l,h){var x,E,k,N,ie,ve,Ce=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(x=0,N=this._parts.length;x<N;x++)for(ve=this._parts[x],E=0,ie=ve.length,k=ie-1;E<ie;k=E++)if(!(!h&&E===0)&&Gp(l,ve[k],ve[E])<=Ce)return!0;return!1}});function Tb(l,h){return new hr(l,h)}hr._flat=Yp;var Ja=hr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return df(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(l){var h=hr.prototype._convertLatLngs.call(this,l),x=h.length;return x>=2&&h[0]instanceof kt&&h[0].equals(h[x-1])&&h.pop(),h},_setLatLngs:function(l){hr.prototype._setLatLngs.call(this,l),Ao(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ao(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var l=this._renderer._bounds,h=this.options.weight,x=new xe(h,h);if(l=new _e(l.min.subtract(x),l.max.add(x)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}for(var E=0,k=this._rings.length,N;E<k;E++)N=cf(this._rings[E],l,!0),N.length&&this._parts.push(N)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(l){var h=!1,x,E,k,N,ie,ve,Ce,Et;if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(N=0,Ce=this._parts.length;N<Ce;N++)for(x=this._parts[N],ie=0,Et=x.length,ve=Et-1;ie<Et;ve=ie++)E=x[ie],k=x[ve],E.y>l.y!=k.y>l.y&&l.x<(k.x-E.x)*(l.y-E.y)/(k.y-E.y)+E.x&&(h=!h);return h||hr.prototype._containsPoint.call(this,l,!0)}});function rx(l,h){return new Ja(l,h)}var fr=zr.extend({initialize:function(l,h){y(this,h),this._layers={},l&&this.addData(l)},addData:function(l){var h=M(l)?l:l.features,x,E,k;if(h){for(x=0,E=h.length;x<E;x++)k=h[x],(k.geometries||k.geometry||k.features||k.coordinates)&&this.addData(k);return this}var N=this.options;if(N.filter&&!N.filter(l))return this;var ie=Xc(l,N);return ie?(ie.feature=Yc(l),ie.defaultOptions=ie.options,this.resetStyle(ie),N.onEachFeature&&N.onEachFeature(l,ie),this.addLayer(ie)):this},resetStyle:function(l){return l===void 0?this.eachLayer(this.resetStyle,this):(l.options=n({},l.defaultOptions),this._setLayerStyle(l,this.options.style),this)},setStyle:function(l){return this.eachLayer(function(h){this._setLayerStyle(h,l)},this)},_setLayerStyle:function(l,h){l.setStyle&&(typeof h=="function"&&(h=h(l.feature)),l.setStyle(h))}});function Xc(l,h){var x=l.type==="Feature"?l.geometry:l,E=x?x.coordinates:null,k=[],N=h&&h.pointToLayer,ie=h&&h.coordsToLatLng||eh,ve,Ce,Et,li;if(!E&&!x)return null;switch(x.type){case"Point":return ve=ie(E),ax(N,l,ve,h);case"MultiPoint":for(Et=0,li=E.length;Et<li;Et++)ve=ie(E[Et]),k.push(ax(N,l,ve,h));return new zr(k);case"LineString":case"MultiLineString":return Ce=th(E,x.type==="LineString"?0:1,ie),new hr(Ce,h);case"Polygon":case"MultiPolygon":return Ce=th(E,x.type==="Polygon"?1:2,ie),new Ja(Ce,h);case"GeometryCollection":for(Et=0,li=x.geometries.length;Et<li;Et++){var Ki=Xc({geometry:x.geometries[Et],type:"Feature",properties:l.properties},h);Ki&&k.push(Ki)}return new zr(k);case"FeatureCollection":for(Et=0,li=x.features.length;Et<li;Et++){var hi=Xc(x.features[Et],h);hi&&k.push(hi)}return new zr(k);default:throw new Error("Invalid GeoJSON object.")}}function ax(l,h,x,E){return l?l(h,x):new Qu(x,E&&E.markersInheritOptions&&E)}function eh(l){return new kt(l[1],l[0],l[2])}function th(l,h,x){for(var E=[],k=0,N=l.length,ie;k<N;k++)ie=h?th(l[k],h-1,x):(x||eh)(l[k]),E.push(ie);return E}function bf(l,h){return l=be(l),l.alt!==void 0?[p(l.lng,h),p(l.lat,h),p(l.alt,h)]:[p(l.lng,h),p(l.lat,h)]}function ih(l,h,x,E){for(var k=[],N=0,ie=l.length;N<ie;N++)k.push(h?ih(l[N],Ao(l[N])?0:h-1,x,E):bf(l[N],E));return!h&&x&&k.length>0&&k.push(k[0].slice()),k}function xa(l,h){return l.feature?n({},l.feature,{geometry:h}):Yc(h)}function Yc(l){return l.type==="Feature"||l.type==="FeatureCollection"?l:{type:"Feature",properties:{},geometry:l}}var nh={toGeoJSON:function(l){return xa(this,{type:"Point",coordinates:bf(this.getLatLng(),l)})}};Qu.include(nh),vf.include(nh),Ju.include(nh),hr.include({toGeoJSON:function(l){var h=!Ao(this._latlngs),x=ih(this._latlngs,h?1:0,!1,l);return xa(this,{type:(h?"Multi":"")+"LineString",coordinates:x})}}),Ja.include({toGeoJSON:function(l){var h=!Ao(this._latlngs),x=h&&!Ao(this._latlngs[0]),E=ih(this._latlngs,x?2:h?1:0,!0,l);return h||(E=[E]),xa(this,{type:(x?"Multi":"")+"Polygon",coordinates:E})}}),Qa.include({toMultiPoint:function(l){var h=[];return this.eachLayer(function(x){h.push(x.toGeoJSON(l).geometry.coordinates)}),xa(this,{type:"MultiPoint",coordinates:h})},toGeoJSON:function(l){var h=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(h==="MultiPoint")return this.toMultiPoint(l);var x=h==="GeometryCollection",E=[];return this.eachLayer(function(k){if(k.toGeoJSON){var N=k.toGeoJSON(l);if(x)E.push(N.geometry);else{var ie=Yc(N);ie.type==="FeatureCollection"?E.push.apply(E,ie.features):E.push(ie)}}}),x?xa(this,{geometries:E,type:"GeometryCollection"}):{type:"FeatureCollection",features:E}}});function Cf(l,h){return new fr(l,h)}var Mb=Cf,Qc=Qo.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(l,h,x){this._url=l,this._bounds=tt(h),y(this,x)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(me(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ce(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(l){return this.options.opacity=l,this._image&&this._updateOpacity(),this},setStyle:function(l){return l.opacity&&this.setOpacity(l.opacity),this},bringToFront:function(){return this._map&&ae(this._image),this},bringToBack:function(){return this._map&&pe(this._image),this},setUrl:function(l){return this._url=l,this._image&&(this._image.src=l),this},setBounds:function(l){return this._bounds=tt(l),this._map&&this._reset(),this},getEvents:function(){var l={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var l=this._url.tagName==="IMG",h=this._image=l?this._url:J("img");if(me(h,"leaflet-image-layer"),this._zoomAnimated&&me(h,"leaflet-zoom-animated"),this.options.className&&me(h,this.options.className),h.onselectstart=g,h.onmousemove=g,h.onload=r(this.fire,this,"load"),h.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),l){this._url=h.src;return}h.src=this._url,h.alt=this.options.alt},_animateZoom:function(l){var h=this._map.getZoomScale(l.zoom),x=this._map._latLngBoundsToNewLayerBounds(this._bounds,l.zoom,l.center).min;Pe(this._image,x,h)},_reset:function(){var l=this._image,h=new _e(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),x=h.getSize();ke(l,h.min),l.style.width=x.x+"px",l.style.height=x.y+"px"},_updateOpacity:function(){re(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var l=this.options.errorOverlayUrl;l&&this._url!==l&&(this._url=l,this._image.src=l)},getCenter:function(){return this._bounds.getCenter()}}),Ef=function(l,h,x){return new Qc(l,h,x)},yf=Qc.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var l=this._url.tagName==="VIDEO",h=this._image=l?this._url:J("video");if(me(h,"leaflet-image-layer"),this._zoomAnimated&&me(h,"leaflet-zoom-animated"),this.options.className&&me(h,this.options.className),h.onselectstart=g,h.onmousemove=g,h.onloadeddata=r(this.fire,this,"load"),l){for(var x=h.getElementsByTagName("source"),E=[],k=0;k<x.length;k++)E.push(x[k].src);this._url=x.length>0?E:[h.src];return}M(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(h.style,"objectFit")&&(h.style.objectFit="fill"),h.autoplay=!!this.options.autoplay,h.loop=!!this.options.loop,h.muted=!!this.options.muted,h.playsInline=!!this.options.playsInline;for(var N=0;N<this._url.length;N++){var ie=J("source");ie.src=this._url[N],h.appendChild(ie)}}});function Rb(l,h,x){return new yf(l,h,x)}var lx=Qc.extend({_initImage:function(){var l=this._image=this._url;me(l,"leaflet-image-layer"),this._zoomAnimated&&me(l,"leaflet-zoom-animated"),this.options.className&&me(l,this.options.className),l.onselectstart=g,l.onmousemove=g}});function Nb(l,h,x){return new lx(l,h,x)}var gr=Qo.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(l,h){l&&(l instanceof kt||M(l))?(this._latlng=be(l),y(this,h)):(y(this,l),this._source=h),this.options.content&&(this._content=this.options.content)},openOn:function(l){return l=arguments.length?l:this._source._map,l.hasLayer(this)||l.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(l){return this._map?this.close():(arguments.length?this._source=l:l=this._source,this._prepareOpen(),this.openOn(l._map)),this},onAdd:function(l){this._zoomAnimated=l._zoomAnimated,this._container||this._initLayout(),l._fadeAnimated&&re(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),l._fadeAnimated&&re(this._container,1),this.bringToFront(),this.options.interactive&&(me(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(l){l._fadeAnimated?(re(this._container,0),this._removeTimeout=setTimeout(r(ce,void 0,this._container),200)):ce(this._container),this.options.interactive&&(Ie(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(l){return this._latlng=be(l),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(l){return this._content=l,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var l={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ae(this._container),this},bringToBack:function(){return this._map&&pe(this._container),this},_prepareOpen:function(l){var h=this._source;if(!h._map)return!1;if(h instanceof zr){h=null;var x=this._source._layers;for(var E in x)if(x[E]._map){h=x[E];break}if(!h)return!1;this._source=h}if(!l)if(h.getCenter)l=h.getCenter();else if(h.getLatLng)l=h.getLatLng();else if(h.getBounds)l=h.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(l),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var l=this._contentNode,h=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof h=="string")l.innerHTML=h;else{for(;l.hasChildNodes();)l.removeChild(l.firstChild);l.appendChild(h)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var l=this._map.latLngToLayerPoint(this._latlng),h=We(this.options.offset),x=this._getAnchor();this._zoomAnimated?ke(this._container,l.add(x)):h=h.add(l).add(x);var E=this._containerBottom=-h.y,k=this._containerLeft=-Math.round(this._containerWidth/2)+h.x;this._container.style.bottom=E+"px",this._container.style.left=k+"px"}},_getAnchor:function(){return[0,0]}});zi.include({_initOverlay:function(l,h,x,E){var k=h;return k instanceof l||(k=new l(E).setContent(h)),x&&k.setLatLng(x),k}}),Qo.include({_initOverlay:function(l,h,x,E){var k=x;return k instanceof l?(y(k,E),k._source=this):(k=h&&!E?h:new l(E,this),k.setContent(x)),k}});var sh=gr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(l){return l=arguments.length?l:this._source._map,!l.hasLayer(this)&&l._popup&&l._popup.options.autoClose&&l.removeLayer(l._popup),l._popup=this,gr.prototype.openOn.call(this,l)},onAdd:function(l){gr.prototype.onAdd.call(this,l),l.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof pa||this._source.on("preclick",ni))},onRemove:function(l){gr.prototype.onRemove.call(this,l),l.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof pa||this._source.off("preclick",ni))},getEvents:function(){var l=gr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(l.preclick=this.close),this.options.keepInView&&(l.moveend=this._adjustPan),l},_initLayout:function(){var l="leaflet-popup",h=this._container=J("div",l+" "+(this.options.className||"")+" leaflet-zoom-animated"),x=this._wrapper=J("div",l+"-content-wrapper",h);if(this._contentNode=J("div",l+"-content",x),Xi(h),ii(this._contentNode),pt(h,"contextmenu",ni),this._tipContainer=J("div",l+"-tip-container",h),this._tip=J("div",l+"-tip",this._tipContainer),this.options.closeButton){var E=this._closeButton=J("a",l+"-close-button",h);E.setAttribute("role","button"),E.setAttribute("aria-label","Close popup"),E.href="#close",E.innerHTML='<span aria-hidden="true">&#215;</span>',pt(E,"click",function(k){Ji(k),this.close()},this)}},_updateLayout:function(){var l=this._contentNode,h=l.style;h.width="",h.whiteSpace="nowrap";var x=l.offsetWidth;x=Math.min(x,this.options.maxWidth),x=Math.max(x,this.options.minWidth),h.width=x+1+"px",h.whiteSpace="",h.height="";var E=l.offsetHeight,k=this.options.maxHeight,N="leaflet-popup-scrolled";k&&E>k?(h.height=k+"px",me(l,N)):Ie(l,N),this._containerWidth=this._container.offsetWidth},_animateZoom:function(l){var h=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center),x=this._getAnchor();ke(this._container,h.add(x))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var l=this._map,h=parseInt(Z(this._container,"marginBottom"),10)||0,x=this._container.offsetHeight+h,E=this._containerWidth,k=new xe(this._containerLeft,-x-this._containerBottom);k._add(Ct(this._container));var N=l.layerPointToContainerPoint(k),ie=We(this.options.autoPanPadding),ve=We(this.options.autoPanPaddingTopLeft||ie),Ce=We(this.options.autoPanPaddingBottomRight||ie),Et=l.getSize(),li=0,Ki=0;N.x+E+Ce.x>Et.x&&(li=N.x+E-Et.x+Ce.x),N.x-li-ve.x<0&&(li=N.x-ve.x),N.y+x+Ce.y>Et.y&&(Ki=N.y+x-Et.y+Ce.y),N.y-Ki-ve.y<0&&(Ki=N.y-ve.y),(li||Ki)&&(this.options.keepInView&&(this._autopanning=!0),l.fire("autopanstart").panBy([li,Ki]))}},_getAnchor:function(){return We(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ob=function(l,h){return new sh(l,h)};zi.mergeOptions({closePopupOnClick:!0}),zi.include({openPopup:function(l,h,x){return this._initOverlay(sh,l,h,x).openOn(this),this},closePopup:function(l){return l=arguments.length?l:this._popup,l&&l.close(),this}}),Qo.include({bindPopup:function(l,h){return this._popup=this._initOverlay(sh,this._popup,l,h),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(l){return this._popup&&(this instanceof zr||(this._popup._source=this),this._popup._prepareOpen(l||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(l){return this._popup&&this._popup.setContent(l),this},getPopup:function(){return this._popup},_openPopup:function(l){if(!(!this._popup||!this._map)){Ln(l);var h=l.layer||l.target;if(this._popup._source===h&&!(h instanceof pa)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(l.latlng);return}this._popup._source=h,this.openPopup(l.latlng)}},_movePopup:function(l){this._popup.setLatLng(l.latlng)},_onKeyPress:function(l){l.originalEvent.keyCode===13&&this._openPopup(l)}});var oh=gr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(l){gr.prototype.onAdd.call(this,l),this.setOpacity(this.options.opacity),l.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(l){gr.prototype.onRemove.call(this,l),l.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var l=gr.prototype.getEvents.call(this);return this.options.permanent||(l.preclick=this.close),l},_initLayout:function(){var l="leaflet-tooltip",h=l+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=J("div",h),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+d(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(l){var h,x,E=this._map,k=this._container,N=E.latLngToContainerPoint(E.getCenter()),ie=E.layerPointToContainerPoint(l),ve=this.options.direction,Ce=k.offsetWidth,Et=k.offsetHeight,li=We(this.options.offset),Ki=this._getAnchor();ve==="top"?(h=Ce/2,x=Et):ve==="bottom"?(h=Ce/2,x=0):ve==="center"?(h=Ce/2,x=Et/2):ve==="right"?(h=0,x=Et/2):ve==="left"?(h=Ce,x=Et/2):ie.x<N.x?(ve="right",h=0,x=Et/2):(ve="left",h=Ce+(li.x+Ki.x)*2,x=Et/2),l=l.subtract(We(h,x,!0)).add(li).add(Ki),Ie(k,"leaflet-tooltip-right"),Ie(k,"leaflet-tooltip-left"),Ie(k,"leaflet-tooltip-top"),Ie(k,"leaflet-tooltip-bottom"),me(k,"leaflet-tooltip-"+ve),ke(k,l)},_updatePosition:function(){var l=this._map.latLngToLayerPoint(this._latlng);this._setPosition(l)},setOpacity:function(l){this.options.opacity=l,this._container&&re(this._container,l)},_animateZoom:function(l){var h=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center);this._setPosition(h)},_getAnchor:function(){return We(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Hb=function(l,h){return new oh(l,h)};zi.include({openTooltip:function(l,h,x){return this._initOverlay(oh,l,h,x).openOn(this),this},closeTooltip:function(l){return l.close(),this}}),Qo.include({bindTooltip:function(l,h){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(oh,this._tooltip,l,h),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(l){if(!(!l&&this._tooltipHandlersAdded)){var h=l?"off":"on",x={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?x.add=this._openTooltip:(x.mouseover=this._openTooltip,x.mouseout=this.closeTooltip,x.click=this._openTooltip,this._map?this._addFocusListeners():x.add=this._addFocusListeners),this._tooltip.options.sticky&&(x.mousemove=this._moveTooltip),this[h](x),this._tooltipHandlersAdded=!l}},openTooltip:function(l){return this._tooltip&&(this instanceof zr||(this._tooltip._source=this),this._tooltip._prepareOpen(l)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(l){return this._tooltip&&this._tooltip.setContent(l),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(l){var h=typeof l.getElement=="function"&&l.getElement();h&&(pt(h,"focus",function(){this._tooltip._source=l,this.openTooltip()},this),pt(h,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(l){var h=typeof l.getElement=="function"&&l.getElement();h&&h.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(l){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var h=this;this._map.once("moveend",function(){h._openOnceFlag=!1,h._openTooltip(l)});return}this._tooltip._source=l.layer||l.target,this.openTooltip(this._tooltip.options.sticky?l.latlng:void 0)}},_moveTooltip:function(l){var h=l.latlng,x,E;this._tooltip.options.sticky&&l.originalEvent&&(x=this._map.mouseEventToContainerPoint(l.originalEvent),E=this._map.containerPointToLayerPoint(x),h=this._map.layerPointToLatLng(E)),this._tooltip.setLatLng(h)}});var q=zl.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(l){var h=l&&l.tagName==="DIV"?l:document.createElement("div"),x=this.options;if(x.html instanceof Element?(Qe(h),h.appendChild(x.html)):h.innerHTML=x.html!==!1?x.html:"",x.bgPos){var E=We(x.bgPos);h.style.backgroundPosition=-E.x+"px "+-E.y+"px"}return this._setIconStyles(h,"icon"),h},createShadow:function(){return null}});function ue(l){return new q(l)}zl.Default=Vl;var ct=Qo.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ye.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(l){y(this,l)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(l){l._addZoomLimit(this)},onRemove:function(l){this._removeAllTiles(),ce(this._container),l._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ae(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(pe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(l){return this.options.opacity=l,this._updateOpacity(),this},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var l=this._clampZoom(this._map.getZoom());l!==this._tileZoom&&(this._tileZoom=l,this._updateLevels()),this._update()}return this},getEvents:function(){var l={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),l.move=this._onMove),this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},createTile:function(){return document.createElement("div")},getTileSize:function(){var l=this.options.tileSize;return l instanceof xe?l:new xe(l,l)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(l){for(var h=this.getPane().children,x=-l(-1/0,1/0),E=0,k=h.length,N;E<k;E++)N=h[E].style.zIndex,h[E]!==this._container&&N&&(x=l(x,+N));isFinite(x)&&(this.options.zIndex=x+l(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ye.ielt9){re(this._container,this.options.opacity);var l=+new Date,h=!1,x=!1;for(var E in this._tiles){var k=this._tiles[E];if(!(!k.current||!k.loaded)){var N=Math.min(1,(l-k.loaded)/200);re(k.el,N),N<1?h=!0:(k.active?x=!0:this._onOpaqueTile(k),k.active=!0)}}x&&!this._noPrune&&this._pruneTiles(),h&&(he(this._fadeFrame),this._fadeFrame=te(this._updateOpacity,this))}},_onOpaqueTile:g,_initContainer:function(){this._container||(this._container=J("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var l=this._tileZoom,h=this.options.maxZoom;if(l!==void 0){for(var x in this._levels)x=Number(x),this._levels[x].el.children.length||x===l?(this._levels[x].el.style.zIndex=h-Math.abs(l-x),this._onUpdateLevel(x)):(ce(this._levels[x].el),this._removeTilesAtZoom(x),this._onRemoveLevel(x),delete this._levels[x]);var E=this._levels[l],k=this._map;return E||(E=this._levels[l]={},E.el=J("div","leaflet-tile-container leaflet-zoom-animated",this._container),E.el.style.zIndex=h,E.origin=k.project(k.unproject(k.getPixelOrigin()),l).round(),E.zoom=l,this._setZoomTransform(E,k.getCenter(),k.getZoom()),g(E.el.offsetWidth),this._onCreateLevel(E)),this._level=E,E}},_onUpdateLevel:g,_onRemoveLevel:g,_onCreateLevel:g,_pruneTiles:function(){if(this._map){var l,h,x=this._map.getZoom();if(x>this.options.maxZoom||x<this.options.minZoom){this._removeAllTiles();return}for(l in this._tiles)h=this._tiles[l],h.retain=h.current;for(l in this._tiles)if(h=this._tiles[l],h.current&&!h.active){var E=h.coords;this._retainParent(E.x,E.y,E.z,E.z-5)||this._retainChildren(E.x,E.y,E.z,E.z+2)}for(l in this._tiles)this._tiles[l].retain||this._removeTile(l)}},_removeTilesAtZoom:function(l){for(var h in this._tiles)this._tiles[h].coords.z===l&&this._removeTile(h)},_removeAllTiles:function(){for(var l in this._tiles)this._removeTile(l)},_invalidateAll:function(){for(var l in this._levels)ce(this._levels[l].el),this._onRemoveLevel(Number(l)),delete this._levels[l];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(l,h,x,E){var k=Math.floor(l/2),N=Math.floor(h/2),ie=x-1,ve=new xe(+k,+N);ve.z=+ie;var Ce=this._tileCoordsToKey(ve),Et=this._tiles[Ce];return Et&&Et.active?(Et.retain=!0,!0):(Et&&Et.loaded&&(Et.retain=!0),ie>E?this._retainParent(k,N,ie,E):!1)},_retainChildren:function(l,h,x,E){for(var k=2*l;k<2*l+2;k++)for(var N=2*h;N<2*h+2;N++){var ie=new xe(k,N);ie.z=x+1;var ve=this._tileCoordsToKey(ie),Ce=this._tiles[ve];if(Ce&&Ce.active){Ce.retain=!0;continue}else Ce&&Ce.loaded&&(Ce.retain=!0);x+1<E&&this._retainChildren(k,N,x+1,E)}},_resetView:function(l){var h=l&&(l.pinch||l.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),h,h)},_animateZoom:function(l){this._setView(l.center,l.zoom,!0,l.noUpdate)},_clampZoom:function(l){var h=this.options;return h.minNativeZoom!==void 0&&l<h.minNativeZoom?h.minNativeZoom:h.maxNativeZoom!==void 0&&h.maxNativeZoom<l?h.maxNativeZoom:l},_setView:function(l,h,x,E){var k=Math.round(h);this.options.maxZoom!==void 0&&k>this.options.maxZoom||this.options.minZoom!==void 0&&k<this.options.minZoom?k=void 0:k=this._clampZoom(k);var N=this.options.updateWhenZooming&&k!==this._tileZoom;(!E||N)&&(this._tileZoom=k,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),k!==void 0&&this._update(l),x||this._pruneTiles(),this._noPrune=!!x),this._setZoomTransforms(l,h)},_setZoomTransforms:function(l,h){for(var x in this._levels)this._setZoomTransform(this._levels[x],l,h)},_setZoomTransform:function(l,h,x){var E=this._map.getZoomScale(x,l.zoom),k=l.origin.multiplyBy(E).subtract(this._map._getNewPixelOrigin(h,x)).round();ye.any3d?Pe(l.el,k,E):ke(l.el,k)},_resetGrid:function(){var l=this._map,h=l.options.crs,x=this._tileSize=this.getTileSize(),E=this._tileZoom,k=this._map.getPixelWorldBounds(this._tileZoom);k&&(this._globalTileRange=this._pxBoundsToTileRange(k)),this._wrapX=h.wrapLng&&!this.options.noWrap&&[Math.floor(l.project([0,h.wrapLng[0]],E).x/x.x),Math.ceil(l.project([0,h.wrapLng[1]],E).x/x.y)],this._wrapY=h.wrapLat&&!this.options.noWrap&&[Math.floor(l.project([h.wrapLat[0],0],E).y/x.x),Math.ceil(l.project([h.wrapLat[1],0],E).y/x.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(l){var h=this._map,x=h._animatingZoom?Math.max(h._animateToZoom,h.getZoom()):h.getZoom(),E=h.getZoomScale(x,this._tileZoom),k=h.project(l,this._tileZoom).floor(),N=h.getSize().divideBy(E*2);return new _e(k.subtract(N),k.add(N))},_update:function(l){var h=this._map;if(h){var x=this._clampZoom(h.getZoom());if(l===void 0&&(l=h.getCenter()),this._tileZoom!==void 0){var E=this._getTiledPixelBounds(l),k=this._pxBoundsToTileRange(E),N=k.getCenter(),ie=[],ve=this.options.keepBuffer,Ce=new _e(k.getBottomLeft().subtract([ve,-ve]),k.getTopRight().add([ve,-ve]));if(!(isFinite(k.min.x)&&isFinite(k.min.y)&&isFinite(k.max.x)&&isFinite(k.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Et in this._tiles){var li=this._tiles[Et].coords;(li.z!==this._tileZoom||!Ce.contains(new xe(li.x,li.y)))&&(this._tiles[Et].current=!1)}if(Math.abs(x-this._tileZoom)>1){this._setView(l,x);return}for(var Ki=k.min.y;Ki<=k.max.y;Ki++)for(var hi=k.min.x;hi<=k.max.x;hi++){var un=new xe(hi,Ki);if(un.z=this._tileZoom,!!this._isValidTile(un)){var In=this._tiles[this._tileCoordsToKey(un)];In?In.current=!0:ie.push(un)}}if(ie.sort(function(Ns,Vr){return Ns.distanceTo(N)-Vr.distanceTo(N)}),ie.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _s=document.createDocumentFragment();for(hi=0;hi<ie.length;hi++)this._addTile(ie[hi],_s);this._level.el.appendChild(_s)}}}},_isValidTile:function(l){var h=this._map.options.crs;if(!h.infinite){var x=this._globalTileRange;if(!h.wrapLng&&(l.x<x.min.x||l.x>x.max.x)||!h.wrapLat&&(l.y<x.min.y||l.y>x.max.y))return!1}if(!this.options.bounds)return!0;var E=this._tileCoordsToBounds(l);return tt(this.options.bounds).overlaps(E)},_keyToBounds:function(l){return this._tileCoordsToBounds(this._keyToTileCoords(l))},_tileCoordsToNwSe:function(l){var h=this._map,x=this.getTileSize(),E=l.scaleBy(x),k=E.add(x),N=h.unproject(E,l.z),ie=h.unproject(k,l.z);return[N,ie]},_tileCoordsToBounds:function(l){var h=this._tileCoordsToNwSe(l),x=new Wt(h[0],h[1]);return this.options.noWrap||(x=this._map.wrapLatLngBounds(x)),x},_tileCoordsToKey:function(l){return l.x+":"+l.y+":"+l.z},_keyToTileCoords:function(l){var h=l.split(":"),x=new xe(+h[0],+h[1]);return x.z=+h[2],x},_removeTile:function(l){var h=this._tiles[l];h&&(ce(h.el),delete this._tiles[l],this.fire("tileunload",{tile:h.el,coords:this._keyToTileCoords(l)}))},_initTile:function(l){me(l,"leaflet-tile");var h=this.getTileSize();l.style.width=h.x+"px",l.style.height=h.y+"px",l.onselectstart=g,l.onmousemove=g,ye.ielt9&&this.options.opacity<1&&re(l,this.options.opacity)},_addTile:function(l,h){var x=this._getTilePos(l),E=this._tileCoordsToKey(l),k=this.createTile(this._wrapCoords(l),r(this._tileReady,this,l));this._initTile(k),this.createTile.length<2&&te(r(this._tileReady,this,l,null,k)),ke(k,x),this._tiles[E]={el:k,coords:l,current:!0},h.appendChild(k),this.fire("tileloadstart",{tile:k,coords:l})},_tileReady:function(l,h,x){h&&this.fire("tileerror",{error:h,tile:x,coords:l});var E=this._tileCoordsToKey(l);x=this._tiles[E],x&&(x.loaded=+new Date,this._map._fadeAnimated?(re(x.el,0),he(this._fadeFrame),this._fadeFrame=te(this._updateOpacity,this)):(x.active=!0,this._pruneTiles()),h||(me(x.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:x.el,coords:l})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ye.ielt9||!this._map._fadeAnimated?te(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(l){return l.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(l){var h=new xe(this._wrapX?f(l.x,this._wrapX):l.x,this._wrapY?f(l.y,this._wrapY):l.y);return h.z=l.z,h},_pxBoundsToTileRange:function(l){var h=this.getTileSize();return new _e(l.min.unscaleBy(h).floor(),l.max.unscaleBy(h).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var l in this._tiles)if(!this._tiles[l].loaded)return!1;return!0}});function ft(l){return new ct(l)}var je=ct.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(l,h){this._url=l,h=y(this,h),h.detectRetina&&ye.retina&&h.maxZoom>0?(h.tileSize=Math.floor(h.tileSize/2),h.zoomReverse?(h.zoomOffset--,h.minZoom=Math.min(h.maxZoom,h.minZoom+1)):(h.zoomOffset++,h.maxZoom=Math.max(h.minZoom,h.maxZoom-1)),h.minZoom=Math.max(0,h.minZoom)):h.zoomReverse?h.minZoom=Math.min(h.maxZoom,h.minZoom):h.maxZoom=Math.max(h.minZoom,h.maxZoom),typeof h.subdomains=="string"&&(h.subdomains=h.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(l,h){return this._url===l&&h===void 0&&(h=!0),this._url=l,h||this.redraw(),this},createTile:function(l,h){var x=document.createElement("img");return pt(x,"load",r(this._tileOnLoad,this,h,x)),pt(x,"error",r(this._tileOnError,this,h,x)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(x.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(x.referrerPolicy=this.options.referrerPolicy),x.alt="",x.src=this.getTileUrl(l),x},getTileUrl:function(l){var h={r:ye.retina?"@2x":"",s:this._getSubdomain(l),x:l.x,y:l.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var x=this._globalTileRange.max.y-l.y;this.options.tms&&(h.y=x),h["-y"]=x}return P(this._url,n(h,this.options))},_tileOnLoad:function(l,h){ye.ielt9?setTimeout(r(l,this,null,h),0):l(null,h)},_tileOnError:function(l,h,x){var E=this.options.errorTileUrl;E&&h.getAttribute("src")!==E&&(h.src=E),l(x,h)},_onTileRemove:function(l){l.tile.onload=null},_getZoomForUrl:function(){var l=this._tileZoom,h=this.options.maxZoom,x=this.options.zoomReverse,E=this.options.zoomOffset;return x&&(l=h-l),l+E},_getSubdomain:function(l){var h=Math.abs(l.x+l.y)%this.options.subdomains.length;return this.options.subdomains[h]},_abortLoading:function(){var l,h;for(l in this._tiles)if(this._tiles[l].coords.z!==this._tileZoom&&(h=this._tiles[l].el,h.onload=g,h.onerror=g,!h.complete)){h.src=T;var x=this._tiles[l].coords;ce(h),delete this._tiles[l],this.fire("tileabort",{tile:h,coords:x})}},_removeTile:function(l){var h=this._tiles[l];if(h)return h.el.setAttribute("src",T),ct.prototype._removeTile.call(this,l)},_tileReady:function(l,h,x){if(!(!this._map||x&&x.getAttribute("src")===T))return ct.prototype._tileReady.call(this,l,h,x)}});function Kt(l,h){return new je(l,h)}var ai=je.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(l,h){this._url=l;var x=n({},this.defaultWmsParams);for(var E in h)E in this.options||(x[E]=h[E]);h=y(this,h);var k=h.detectRetina&&ye.retina?2:1,N=this.getTileSize();x.width=N.x*k,x.height=N.y*k,this.wmsParams=x},onAdd:function(l){this._crs=this.options.crs||l.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var h=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[h]=this._crs.code,je.prototype.onAdd.call(this,l)},getTileUrl:function(l){var h=this._tileCoordsToNwSe(l),x=this._crs,E=dt(x.project(h[0]),x.project(h[1])),k=E.min,N=E.max,ie=(this._wmsVersion>=1.3&&this._crs===Jp?[k.y,k.x,N.y,N.x]:[k.x,k.y,N.x,N.y]).join(","),ve=je.prototype.getTileUrl.call(this,l);return ve+w(this.wmsParams,ve,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ie},setParams:function(l,h){return n(this.wmsParams,l),h||this.redraw(),this}});function tn(l,h){return new ai(l,h)}je.WMS=ai,Kt.wms=tn;var Yi=Qo.extend({options:{padding:.1},initialize:function(l){y(this,l),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),me(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var l={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(l.zoomanim=this._onAnimZoom),l},_onAnimZoom:function(l){this._updateTransform(l.center,l.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(l,h){var x=this._map.getZoomScale(h,this._zoom),E=this._map.getSize().multiplyBy(.5+this.options.padding),k=this._map.project(this._center,h),N=E.multiplyBy(-x).add(k).subtract(this._map._getNewPixelOrigin(l,h));ye.any3d?Pe(this._container,N,x):ke(this._container,N)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var l in this._layers)this._layers[l]._reset()},_onZoomEnd:function(){for(var l in this._layers)this._layers[l]._project()},_updatePaths:function(){for(var l in this._layers)this._layers[l]._update()},_update:function(){var l=this.options.padding,h=this._map.getSize(),x=this._map.containerPointToLayerPoint(h.multiplyBy(-l)).round();this._bounds=new _e(x,x.add(h.multiplyBy(1+l*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),cn=Yi.extend({options:{tolerance:0},getEvents:function(){var l=Yi.prototype.getEvents.call(this);return l.viewprereset=this._onViewPreReset,l},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Yi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var l=this._container=document.createElement("canvas");pt(l,"mousemove",this._onMouseMove,this),pt(l,"click dblclick mousedown mouseup contextmenu",this._onClick,this),pt(l,"mouseout",this._handleMouseOut,this),l._leaflet_disable_events=!0,this._ctx=l.getContext("2d")},_destroyContainer:function(){he(this._redrawRequest),delete this._ctx,ce(this._container),wi(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var l;this._redrawBounds=null;for(var h in this._layers)l=this._layers[h],l._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Yi.prototype._update.call(this);var l=this._bounds,h=this._container,x=l.getSize(),E=ye.retina?2:1;ke(h,l.min),h.width=E*x.x,h.height=E*x.y,h.style.width=x.x+"px",h.style.height=x.y+"px",ye.retina&&this._ctx.scale(2,2),this._ctx.translate(-l.min.x,-l.min.y),this.fire("update")}},_reset:function(){Yi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(l){this._updateDashArray(l),this._layers[d(l)]=l;var h=l._order={layer:l,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=h),this._drawLast=h,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(l){this._requestRedraw(l)},_removePath:function(l){var h=l._order,x=h.next,E=h.prev;x?x.prev=E:this._drawLast=E,E?E.next=x:this._drawFirst=x,delete l._order,delete this._layers[d(l)],this._requestRedraw(l)},_updatePath:function(l){this._extendRedrawBounds(l),l._project(),l._update(),this._requestRedraw(l)},_updateStyle:function(l){this._updateDashArray(l),this._requestRedraw(l)},_updateDashArray:function(l){if(typeof l.options.dashArray=="string"){var h=l.options.dashArray.split(/[, ]+/),x=[],E,k;for(k=0;k<h.length;k++){if(E=Number(h[k]),isNaN(E))return;x.push(E)}l.options._dashArray=x}else l.options._dashArray=l.options.dashArray},_requestRedraw:function(l){this._map&&(this._extendRedrawBounds(l),this._redrawRequest=this._redrawRequest||te(this._redraw,this))},_extendRedrawBounds:function(l){if(l._pxBounds){var h=(l.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new _e,this._redrawBounds.extend(l._pxBounds.min.subtract([h,h])),this._redrawBounds.extend(l._pxBounds.max.add([h,h]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var l=this._redrawBounds;if(l){var h=l.getSize();this._ctx.clearRect(l.min.x,l.min.y,h.x,h.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var l,h=this._redrawBounds;if(this._ctx.save(),h){var x=h.getSize();this._ctx.beginPath(),this._ctx.rect(h.min.x,h.min.y,x.x,x.y),this._ctx.clip()}this._drawing=!0;for(var E=this._drawFirst;E;E=E.next)l=E.layer,(!h||l._pxBounds&&l._pxBounds.intersects(h))&&l._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(l,h){if(this._drawing){var x,E,k,N,ie=l._parts,ve=ie.length,Ce=this._ctx;if(ve){for(Ce.beginPath(),x=0;x<ve;x++){for(E=0,k=ie[x].length;E<k;E++)N=ie[x][E],Ce[E?"lineTo":"moveTo"](N.x,N.y);h&&Ce.closePath()}this._fillStroke(Ce,l)}}},_updateCircle:function(l){if(!(!this._drawing||l._empty())){var h=l._point,x=this._ctx,E=Math.max(Math.round(l._radius),1),k=(Math.max(Math.round(l._radiusY),1)||E)/E;k!==1&&(x.save(),x.scale(1,k)),x.beginPath(),x.arc(h.x,h.y/k,E,0,Math.PI*2,!1),k!==1&&x.restore(),this._fillStroke(x,l)}},_fillStroke:function(l,h){var x=h.options;x.fill&&(l.globalAlpha=x.fillOpacity,l.fillStyle=x.fillColor||x.color,l.fill(x.fillRule||"evenodd")),x.stroke&&x.weight!==0&&(l.setLineDash&&l.setLineDash(h.options&&h.options._dashArray||[]),l.globalAlpha=x.opacity,l.lineWidth=x.weight,l.strokeStyle=x.color,l.lineCap=x.lineCap,l.lineJoin=x.lineJoin,l.stroke())},_onClick:function(l){for(var h=this._map.mouseEventToLayerPoint(l),x,E,k=this._drawFirst;k;k=k.next)x=k.layer,x.options.interactive&&x._containsPoint(h)&&(!(l.type==="click"||l.type==="preclick")||!this._map._draggableMoved(x))&&(E=x);this._fireEvent(E?[E]:!1,l)},_onMouseMove:function(l){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var h=this._map.mouseEventToLayerPoint(l);this._handleMouseHover(l,h)}},_handleMouseOut:function(l){var h=this._hoveredLayer;h&&(Ie(this._container,"leaflet-interactive"),this._fireEvent([h],l,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(l,h){if(!this._mouseHoverThrottled){for(var x,E,k=this._drawFirst;k;k=k.next)x=k.layer,x.options.interactive&&x._containsPoint(h)&&(E=x);E!==this._hoveredLayer&&(this._handleMouseOut(l),E&&(me(this._container,"leaflet-interactive"),this._fireEvent([E],l,"mouseover"),this._hoveredLayer=E)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,l),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(l,h,x){this._map._fireDOMEvent(h,x||h.type,l)},_bringToFront:function(l){var h=l._order;if(h){var x=h.next,E=h.prev;if(x)x.prev=E;else return;E?E.next=x:x&&(this._drawFirst=x),h.prev=this._drawLast,this._drawLast.next=h,h.next=null,this._drawLast=h,this._requestRedraw(l)}},_bringToBack:function(l){var h=l._order;if(h){var x=h.next,E=h.prev;if(E)E.next=x;else return;x?x.prev=E:E&&(this._drawLast=E),h.prev=null,h.next=this._drawFirst,this._drawFirst.prev=h,this._drawFirst=h,this._requestRedraw(l)}}});function Cn(l){return ye.canvas?new cn(l):null}var gn=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(l){return document.createElement("<lvml:"+l+' class="lvml">')}}catch{}return function(l){return document.createElement("<"+l+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),En={_initContainer:function(){this._container=J("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Yi.prototype._update.call(this),this.fire("update"))},_initPath:function(l){var h=l._container=gn("shape");me(h,"leaflet-vml-shape "+(this.options.className||"")),h.coordsize="1 1",l._path=gn("path"),h.appendChild(l._path),this._updateStyle(l),this._layers[d(l)]=l},_addPath:function(l){var h=l._container;this._container.appendChild(h),l.options.interactive&&l.addInteractiveTarget(h)},_removePath:function(l){var h=l._container;ce(h),l.removeInteractiveTarget(h),delete this._layers[d(l)]},_updateStyle:function(l){var h=l._stroke,x=l._fill,E=l.options,k=l._container;k.stroked=!!E.stroke,k.filled=!!E.fill,E.stroke?(h||(h=l._stroke=gn("stroke")),k.appendChild(h),h.weight=E.weight+"px",h.color=E.color,h.opacity=E.opacity,E.dashArray?h.dashStyle=M(E.dashArray)?E.dashArray.join(" "):E.dashArray.replace(/( *, *)/g," "):h.dashStyle="",h.endcap=E.lineCap.replace("butt","flat"),h.joinstyle=E.lineJoin):h&&(k.removeChild(h),l._stroke=null),E.fill?(x||(x=l._fill=gn("fill")),k.appendChild(x),x.color=E.fillColor||E.color,x.opacity=E.fillOpacity):x&&(k.removeChild(x),l._fill=null)},_updateCircle:function(l){var h=l._point.round(),x=Math.round(l._radius),E=Math.round(l._radiusY||x);this._setPath(l,l._empty()?"M0 0":"AL "+h.x+","+h.y+" "+x+","+E+" 0,"+65535*360)},_setPath:function(l,h){l._path.v=h},_bringToFront:function(l){ae(l._container)},_bringToBack:function(l){pe(l._container)}},bn=ye.vml?gn:Vt,yn=Yi.extend({_initContainer:function(){this._container=bn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=bn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ce(this._container),wi(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Yi.prototype._update.call(this);var l=this._bounds,h=l.getSize(),x=this._container;(!this._svgSize||!this._svgSize.equals(h))&&(this._svgSize=h,x.setAttribute("width",h.x),x.setAttribute("height",h.y)),ke(x,l.min),x.setAttribute("viewBox",[l.min.x,l.min.y,h.x,h.y].join(" ")),this.fire("update")}},_initPath:function(l){var h=l._path=bn("path");l.options.className&&me(h,l.options.className),l.options.interactive&&me(h,"leaflet-interactive"),this._updateStyle(l),this._layers[d(l)]=l},_addPath:function(l){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(l._path),l.addInteractiveTarget(l._path)},_removePath:function(l){ce(l._path),l.removeInteractiveTarget(l._path),delete this._layers[d(l)]},_updatePath:function(l){l._project(),l._update()},_updateStyle:function(l){var h=l._path,x=l.options;h&&(x.stroke?(h.setAttribute("stroke",x.color),h.setAttribute("stroke-opacity",x.opacity),h.setAttribute("stroke-width",x.weight),h.setAttribute("stroke-linecap",x.lineCap),h.setAttribute("stroke-linejoin",x.lineJoin),x.dashArray?h.setAttribute("stroke-dasharray",x.dashArray):h.removeAttribute("stroke-dasharray"),x.dashOffset?h.setAttribute("stroke-dashoffset",x.dashOffset):h.removeAttribute("stroke-dashoffset")):h.setAttribute("stroke","none"),x.fill?(h.setAttribute("fill",x.fillColor||x.color),h.setAttribute("fill-opacity",x.fillOpacity),h.setAttribute("fill-rule",x.fillRule||"evenodd")):h.setAttribute("fill","none"))},_updatePoly:function(l,h){this._setPath(l,zt(l._parts,h))},_updateCircle:function(l){var h=l._point,x=Math.max(Math.round(l._radius),1),E=Math.max(Math.round(l._radiusY),1)||x,k="a"+x+","+E+" 0 1,0 ",N=l._empty()?"M0 0":"M"+(h.x-x)+","+h.y+k+x*2+",0 "+k+-x*2+",0 ";this._setPath(l,N)},_setPath:function(l,h){l._path.setAttribute("d",h)},_bringToFront:function(l){ae(l._path)},_bringToBack:function(l){pe(l._path)}});ye.vml&&yn.include(En);function ls(l){return ye.svg||ye.vml?new yn(l):null}zi.include({getRenderer:function(l){var h=l.options.renderer||this._getPaneRenderer(l.options.pane)||this.options.renderer||this._renderer;return h||(h=this._renderer=this._createRenderer()),this.hasLayer(h)||this.addLayer(h),h},_getPaneRenderer:function(l){if(l==="overlayPane"||l===void 0)return!1;var h=this._paneRenderers[l];return h===void 0&&(h=this._createRenderer({pane:l}),this._paneRenderers[l]=h),h},_createRenderer:function(l){return this.options.preferCanvas&&Cn(l)||ls(l)}});var pn=Ja.extend({initialize:function(l,h){Ja.prototype.initialize.call(this,this._boundsToLatLngs(l),h)},setBounds:function(l){return this.setLatLngs(this._boundsToLatLngs(l))},_boundsToLatLngs:function(l){return l=tt(l),[l.getSouthWest(),l.getNorthWest(),l.getNorthEast(),l.getSouthEast()]}});function Hn(l,h){return new pn(l,h)}yn.create=bn,yn.pointsToPath=zt,fr.geometryToLayer=Xc,fr.coordsToLatLng=eh,fr.coordsToLatLngs=th,fr.latLngToCoords=bf,fr.latLngsToCoords=ih,fr.getFeature=xa,fr.asFeature=Yc,zi.mergeOptions({boxZoom:!0});var Ms=Oo.extend({initialize:function(l){this._map=l,this._container=l._container,this._pane=l._panes.overlayPane,this._resetStateTimeout=0,l.on("unload",this._destroy,this)},addHooks:function(){pt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){wi(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ce(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(l){if(!l.shiftKey||l.which!==1&&l.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),vt(),ze(),this._startPoint=this._map.mouseEventToContainerPoint(l),pt(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(l){this._moved||(this._moved=!0,this._box=J("div","leaflet-zoom-box",this._container),me(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(l);var h=new _e(this._point,this._startPoint),x=h.getSize();ke(this._box,h.min),this._box.style.width=x.x+"px",this._box.style.height=x.y+"px"},_finish:function(){this._moved&&(ce(this._box),Ie(this._container,"leaflet-crosshair")),Fe(),Je(),wi(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(l){if(!(l.which!==1&&l.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var h=new Wt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(h).fire("boxzoomend",{boxZoomBounds:h})}},_onKeyDown:function(l){l.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});zi.addInitHook("addHandler","boxZoom",Ms),zi.mergeOptions({doubleClickZoom:!0});var mo=Oo.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(l){var h=this._map,x=h.getZoom(),E=h.options.zoomDelta,k=l.originalEvent.shiftKey?x-E:x+E;h.options.doubleClickZoom==="center"?h.setZoom(k):h.setZoomAround(l.containerPoint,k)}});zi.addInitHook("addHandler","doubleClickZoom",mo),zi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Rs=Oo.extend({addHooks:function(){if(!this._draggable){var l=this._map;this._draggable=new Wr(l._mapPane,l._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),l.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),l.on("zoomend",this._onZoomEnd,this),l.whenReady(this._onZoomEnd,this))}me(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Ie(this._map._container,"leaflet-grab"),Ie(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var l=this._map;if(l._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var h=tt(this._map.options.maxBounds);this._offsetLimit=dt(this._map.latLngToContainerPoint(h.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(h.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;l.fire("movestart").fire("dragstart"),l.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(l){if(this._map.options.inertia){var h=this._lastTime=+new Date,x=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(x),this._times.push(h),this._prunePositions(h)}this._map.fire("move",l).fire("drag",l)},_prunePositions:function(l){for(;this._positions.length>1&&l-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var l=this._map.getSize().divideBy(2),h=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=h.subtract(l).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(l,h){return l-(l-h)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var l=this._draggable._newPos.subtract(this._draggable._startPos),h=this._offsetLimit;l.x<h.min.x&&(l.x=this._viscousLimit(l.x,h.min.x)),l.y<h.min.y&&(l.y=this._viscousLimit(l.y,h.min.y)),l.x>h.max.x&&(l.x=this._viscousLimit(l.x,h.max.x)),l.y>h.max.y&&(l.y=this._viscousLimit(l.y,h.max.y)),this._draggable._newPos=this._draggable._startPos.add(l)}},_onPreDragWrap:function(){var l=this._worldWidth,h=Math.round(l/2),x=this._initialWorldOffset,E=this._draggable._newPos.x,k=(E-h+x)%l+h-x,N=(E+h+x)%l-h-x,ie=Math.abs(k+x)<Math.abs(N+x)?k:N;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ie},_onDragEnd:function(l){var h=this._map,x=h.options,E=!x.inertia||l.noInertia||this._times.length<2;if(h.fire("dragend",l),E)h.fire("moveend");else{this._prunePositions(+new Date);var k=this._lastPos.subtract(this._positions[0]),N=(this._lastTime-this._times[0])/1e3,ie=x.easeLinearity,ve=k.multiplyBy(ie/N),Ce=ve.distanceTo([0,0]),Et=Math.min(x.inertiaMaxSpeed,Ce),li=ve.multiplyBy(Et/Ce),Ki=Et/(x.inertiaDeceleration*ie),hi=li.multiplyBy(-Ki/2).round();!hi.x&&!hi.y?h.fire("moveend"):(hi=h._limitOffset(hi,h.options.maxBounds),te(function(){h.panBy(hi,{duration:Ki,easeLinearity:ie,noMoveStart:!0,animate:!0})}))}}});zi.addInitHook("addHandler","dragging",Rs),zi.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ds=Oo.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(l){this._map=l,this._setPanDelta(l.options.keyboardPanDelta),this._setZoomDelta(l.options.zoomDelta)},addHooks:function(){var l=this._map._container;l.tabIndex<=0&&(l.tabIndex="0"),pt(l,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),wi(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var l=document.body,h=document.documentElement,x=l.scrollTop||h.scrollTop,E=l.scrollLeft||h.scrollLeft;this._map._container.focus(),window.scrollTo(E,x)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(l){var h=this._panKeys={},x=this.keyCodes,E,k;for(E=0,k=x.left.length;E<k;E++)h[x.left[E]]=[-1*l,0];for(E=0,k=x.right.length;E<k;E++)h[x.right[E]]=[l,0];for(E=0,k=x.down.length;E<k;E++)h[x.down[E]]=[0,l];for(E=0,k=x.up.length;E<k;E++)h[x.up[E]]=[0,-1*l]},_setZoomDelta:function(l){var h=this._zoomKeys={},x=this.keyCodes,E,k;for(E=0,k=x.zoomIn.length;E<k;E++)h[x.zoomIn[E]]=l;for(E=0,k=x.zoomOut.length;E<k;E++)h[x.zoomOut[E]]=-l},_addHooks:function(){pt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){wi(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(l){if(!(l.altKey||l.ctrlKey||l.metaKey)){var h=l.keyCode,x=this._map,E;if(h in this._panKeys){if(!x._panAnim||!x._panAnim._inProgress)if(E=this._panKeys[h],l.shiftKey&&(E=We(E).multiplyBy(3)),x.options.maxBounds&&(E=x._limitOffset(We(E),x.options.maxBounds)),x.options.worldCopyJump){var k=x.wrapLatLng(x.unproject(x.project(x.getCenter()).add(E)));x.panTo(k)}else x.panBy(E)}else if(h in this._zoomKeys)x.setZoom(x.getZoom()+(l.shiftKey?3:1)*this._zoomKeys[h]);else if(h===27&&x._popup&&x._popup.options.closeOnEscapeKey)x.closePopup();else return;Ln(l)}}});zi.addInitHook("addHandler","keyboard",Ds),zi.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var cs=Oo.extend({addHooks:function(){pt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){wi(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(l){var h=Bs(l),x=this._map.options.wheelDebounceTime;this._delta+=h,this._lastMousePos=this._map.mouseEventToContainerPoint(l),this._startTime||(this._startTime=+new Date);var E=Math.max(x-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),E),Ln(l)},_performZoom:function(){var l=this._map,h=l.getZoom(),x=this._map.options.zoomSnap||0;l._stop();var E=this._delta/(this._map.options.wheelPxPerZoomLevel*4),k=4*Math.log(2/(1+Math.exp(-Math.abs(E))))/Math.LN2,N=x?Math.ceil(k/x)*x:k,ie=l._limitZoom(h+(this._delta>0?N:-N))-h;this._delta=0,this._startTime=null,ie&&(l.options.scrollWheelZoom==="center"?l.setZoom(h+ie):l.setZoomAround(this._lastMousePos,h+ie))}});zi.addInitHook("addHandler","scrollWheelZoom",cs);var ns=600;zi.mergeOptions({tapHold:ye.touchNative&&ye.safari&&ye.mobile,tapTolerance:15});var qs=Oo.extend({addHooks:function(){pt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){wi(this._map._container,"touchstart",this._onDown,this)},_onDown:function(l){if(clearTimeout(this._holdTimeout),l.touches.length===1){var h=l.touches[0];this._startPos=this._newPos=new xe(h.clientX,h.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(pt(document,"touchend",Ji),pt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",h))},this),ns),pt(document,"touchend touchcancel contextmenu",this._cancel,this),pt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function l(){wi(document,"touchend",Ji),wi(document,"touchend touchcancel",l)},_cancel:function(){clearTimeout(this._holdTimeout),wi(document,"touchend touchcancel contextmenu",this._cancel,this),wi(document,"touchmove",this._onMove,this)},_onMove:function(l){var h=l.touches[0];this._newPos=new xe(h.clientX,h.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(l,h){var x=new MouseEvent(l,{bubbles:!0,cancelable:!0,view:window,screenX:h.screenX,screenY:h.screenY,clientX:h.clientX,clientY:h.clientY});x._simulated=!0,h.target.dispatchEvent(x)}});zi.addInitHook("addHandler","tapHold",qs),zi.mergeOptions({touchZoom:ye.touch,bounceAtZoomLimits:!0});var Bn=Oo.extend({addHooks:function(){me(this._map._container,"leaflet-touch-zoom"),pt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Ie(this._map._container,"leaflet-touch-zoom"),wi(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(l){var h=this._map;if(!(!l.touches||l.touches.length!==2||h._animatingZoom||this._zooming)){var x=h.mouseEventToContainerPoint(l.touches[0]),E=h.mouseEventToContainerPoint(l.touches[1]);this._centerPoint=h.getSize()._divideBy(2),this._startLatLng=h.containerPointToLatLng(this._centerPoint),h.options.touchZoom!=="center"&&(this._pinchStartLatLng=h.containerPointToLatLng(x.add(E)._divideBy(2))),this._startDist=x.distanceTo(E),this._startZoom=h.getZoom(),this._moved=!1,this._zooming=!0,h._stop(),pt(document,"touchmove",this._onTouchMove,this),pt(document,"touchend touchcancel",this._onTouchEnd,this),Ji(l)}},_onTouchMove:function(l){if(!(!l.touches||l.touches.length!==2||!this._zooming)){var h=this._map,x=h.mouseEventToContainerPoint(l.touches[0]),E=h.mouseEventToContainerPoint(l.touches[1]),k=x.distanceTo(E)/this._startDist;if(this._zoom=h.getScaleZoom(k,this._startZoom),!h.options.bounceAtZoomLimits&&(this._zoom<h.getMinZoom()&&k<1||this._zoom>h.getMaxZoom()&&k>1)&&(this._zoom=h._limitZoom(this._zoom)),h.options.touchZoom==="center"){if(this._center=this._startLatLng,k===1)return}else{var N=x._add(E)._divideBy(2)._subtract(this._centerPoint);if(k===1&&N.x===0&&N.y===0)return;this._center=h.unproject(h.project(this._pinchStartLatLng,this._zoom).subtract(N),this._zoom)}this._moved||(h._moveStart(!0,!1),this._moved=!0),he(this._animRequest);var ie=r(h._move,h,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=te(ie,this,!0),Ji(l)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,he(this._animRequest),wi(document,"touchmove",this._onTouchMove,this),wi(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});zi.addInitHook("addHandler","touchZoom",Bn),zi.BoxZoom=Ms,zi.DoubleClickZoom=mo,zi.Drag=Rs,zi.Keyboard=Ds,zi.ScrollWheelZoom=cs,zi.TapHold=qs,zi.TouchZoom=Bn,t.Bounds=_e,t.Browser=ye,t.CRS=Rt,t.Canvas=cn,t.Circle=vf,t.CircleMarker=Ju,t.Class=oe,t.Control=Pn,t.DivIcon=q,t.DivOverlay=gr,t.DomEvent=ss,t.DomUtil=Ht,t.Draggable=Wr,t.Evented=Re,t.FeatureGroup=zr,t.GeoJSON=fr,t.GridLayer=ct,t.Handler=Oo,t.Icon=zl,t.ImageOverlay=Qc,t.LatLng=kt,t.LatLngBounds=Wt,t.Layer=Qo,t.LayerGroup=Qa,t.LineUtil=Kc,t.Map=zi,t.Marker=Qu,t.Mixin=Lb,t.Path=pa,t.Point=xe,t.PolyUtil=Ib,t.Polygon=Ja,t.Polyline=hr,t.Popup=sh,t.PosAnimation=ps,t.Projection=Pb,t.Rectangle=pn,t.Renderer=Yi,t.SVG=yn,t.SVGOverlay=lx,t.TileLayer=je,t.Tooltip=oh,t.Transformation=Pt,t.Util=De,t.VideoOverlay=yf,t.bind=r,t.bounds=dt,t.canvas=Cn,t.circle=_f,t.circleMarker=ox,t.control=Vn,t.divIcon=ue,t.extend=n,t.featureGroup=ix,t.geoJSON=Cf,t.geoJson=Mb,t.gridLayer=ft,t.icon=nx,t.imageOverlay=Ef,t.latLng=be,t.latLngBounds=tt,t.layerGroup=tx,t.map=Ys,t.marker=sx,t.point=We,t.polygon=rx,t.polyline=Tb,t.popup=Ob,t.rectangle=Hn,t.setOptions=y,t.stamp=d,t.svg=ls,t.svgOverlay=Nb,t.tileLayer=Kt,t.tooltip=Hb,t.transformation=ui,t.version=i,t.videoOverlay=Rb;var hs=window.L;t.noConflict=function(){return window.L=hs,this},window.L=t}))})(Qf,Qf.exports)),Qf.exports}var lZ=aZ();const Tf=cS(lZ),cZ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",dZ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",uZ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",jn=(o,e=tb)=>{var t=hZ(),i=v(_(t),2),n=_(i);j(()=>O(n,e())),D(o,t)};var hZ=B('<span class="tip svelte-767znw"><span class="tip-icon svelte-767znw">ℹ</span> <span class="tip-box svelte-767znw"> </span></span>'),fZ=B("<button> </button>"),gZ=B('<span class="err svelte-767znw"> </span>'),pZ=B('<span class="ok svelte-767znw"> </span>'),xZ=B('<div class="loading svelte-767znw">Loading…</div>'),mZ=B('<section id="sec-appearance" class="svelte-767znw"><h3 class="svelte-767znw">Appearance</h3> <div class="field svelte-767znw"><label for="theme-select" class="svelte-767znw">Color theme</label> <select id="theme-select" class="svelte-767znw"><option>Dark</option><option>Light</option><option>System (OS preference)</option></select></div></section>'),vZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">CA certificate <!></label> <textarea rows="4" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" spellcheck="false" class="svelte-767znw"></textarea></div> <div class="field svelte-767znw"><label class="svelte-767znw">Client certificate <!></label> <textarea rows="4" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" spellcheck="false" class="svelte-767znw"></textarea></div> <div class="field svelte-767znw"><label class="svelte-767znw">Client private key <!></label> <textarea rows="4" placeholder="-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----" spellcheck="false" class="svelte-767znw"></textarea></div>',1),_Z=B('<section id="sec-mqtt" class="svelte-767znw"><h3 class="svelte-767znw">MQTT</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Protocol <!></label> <select class="svelte-767znw"><option>mqtt (plain TCP)</option><option>mqtts (TLS)</option><option>ws (WebSocket)</option><option>wss (WebSocket + TLS)</option></select></div> <div class="field svelte-767znw"><label class="svelte-767znw">Broker address <!></label> <input type="text" placeholder="localhost:1883" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Username <!></label> <input type="text" placeholder="(optional)" autocomplete="off" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Password <!></label> <input type="password" placeholder="(optional)" autocomplete="new-password" class="svelte-767znw"/></div> <!> <div class="field svelte-767znw"><label class="svelte-767znw">MQTT protocol version <!></label> <select class="svelte-767znw"><option>3.1.1 (default)</option><option>5.0</option></select></div> <div class="field svelte-767znw"><label class="svelte-767znw">Client name <!></label> <input type="text" placeholder="she" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Variable prefix <!></label> <input type="text" placeholder="var" class="svelte-767znw"/></div> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Disable variable system <!></label></div></section>'),bZ=B('<div class="field svelte-767znw"><label class="svelte-767znw"> <!></label> <input type="password" placeholder="Enter new password" autocomplete="new-password" class="svelte-767znw"/></div>'),CZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">Proxy user header <!></label> <input type="text" placeholder="X-Remote-User" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Logout URL <!></label> <input type="text" placeholder="https://auth.example.com/…/end-session/" class="svelte-767znw"/></div>',1),EZ=B('<div class="field-error svelte-767znw"> </div>'),yZ=B('<div class="field-ok svelte-767znw"> </div>'),wZ=B('<section id="sec-auth" class="svelte-767znw"><h3 class="svelte-767znw">Authentication</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Mode <!></label> <select class="svelte-767znw"><option>None (open)</option><option>Password</option><option>Proxy header (nginx / authentik)</option></select></div> <!> <!> <!> <!> <div class="field svelte-767znw"><span></span> <button class="save-auth-btn svelte-767znw"> </button></div></section>'),SZ=B('<section id="sec-webserver" class="svelte-767znw"><h3 class="svelte-767znw">Web server</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Port <!></label> <input type="number" min="0" max="65535" placeholder="8080" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Bind address <!></label> <input type="text" placeholder="0.0.0.0 (default)" class="svelte-767znw"/></div></section>'),DZ=B('<section id="sec-scripts" class="svelte-767znw"><h3 class="svelte-767znw">Scripts</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Scripts directory <!></label> <input type="text" class="svelte-767znw"/></div> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Disable file watching <!></label></div></section>'),AZ=B('<section id="sec-git" class="svelte-767znw"><h3 class="svelte-767znw">Git</h3> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Auto-commit on save <!></label></div> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Auto-push after commit <!></label></div></section>'),TA=B("<option> </option>"),kZ=B('<div class="field svelte-767znw"><div class="map-label svelte-767znw">Map <span class="map-note svelte-767znw">(click or drag marker to set location — requires internet for tiles)</span></div> <div class="map-container svelte-767znw"></div></div>'),BZ=B('<section id="sec-solar" class="svelte-767znw"><h3 class="svelte-767znw">Location</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Timezone <!></label> <input type="text" list="tz-list" placeholder="(system default)" autocomplete="off" spellcheck="false" class="svelte-767znw"/> <datalist id="tz-list"></datalist></div> <div class="field svelte-767znw"><label class="svelte-767znw">Latitude <!></label> <input type="number" step="0.0001" placeholder="48.7408" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Longitude <!></label> <input type="number" step="0.0001" placeholder="9.1778" class="svelte-767znw"/></div> <div class="field geo-actions svelte-767znw"><span></span> <div class="geo-btns svelte-767znw"><button class="geo-btn svelte-767znw"><!></button> <button class="geo-btn svelte-767znw"> </button></div></div> <!></section>'),FZ=B('<section id="sec-logging" class="svelte-767znw"><h3 class="svelte-767znw">Logging</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Verbosity <!></label> <select class="svelte-767znw"><option>debug</option><option>info</option><option>warn</option><option>error</option></select></div></section>'),LZ=B('<div class="field field--check svelte-767znw"><span></span> <label><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Retain document messages <!></label></div>'),IZ=B('<section id="sec-shedb" class="svelte-767znw"><h3 class="svelte-767znw">sheDB</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Database path <!></label> <input type="text" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">MQTT topic prefix <!></label> <input type="text" placeholder="she/db/ (default)" class="svelte-767znw"/></div> <div class="field field--check svelte-767znw"><span></span> <label><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Publish documents to MQTT <!></label></div> <!></section>'),PZ=B('<section id="sec-redis" class="svelte-767znw"><h3 class="svelte-767znw">Redis</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Redis URL <!></label> <input type="text" placeholder="leave empty to disable" class="svelte-767znw"/></div></section>'),TZ=B('<span class="free-badge svelte-767znw">FREE</span> ',1),MZ=B('&nbsp;— <a target="_blank" rel="noreferrer" class="svelte-767znw">Get API key ↗</a>',1),RZ=B("<div><!> <!></div>"),NZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">Base URL <!></label> <input type="text" class="svelte-767znw"/></div>'),OZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">API key <!></label> <input type="password" placeholder="sk-…" autocomplete="off" class="svelte-767znw"/></div>'),HZ=B('<section id="sec-ai" class="svelte-767znw"><h3 class="svelte-767znw">AI Assistant</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Provider <!></label> <select class="svelte-767znw"></select></div> <!> <!> <div class="field svelte-767znw"><label class="svelte-767znw">Model <!></label> <input type="text" class="svelte-767znw"/></div> <!></section>'),WZ=B('<div class="config-form svelte-767znw"><!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!></div>'),zZ=B('<!> <div class="config-root svelte-767znw"><aside class="config-sidebar svelte-767znw"><div class="sidebar-search svelte-767znw"><svg class="search-icon svelte-767znw" width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="6.5" cy="6.5" r="4.5"></circle><line x1="10" y1="10" x2="14" y2="14"></line></svg> <input class="search-input svelte-767znw" type="search" placeholder="Filter settings…" autocomplete="off" spellcheck="false"/></div> <nav class="section-nav svelte-767znw"></nav></aside> <div class="config-main svelte-767znw"><div class="config-topbar svelte-767znw"><span class="topbar-title svelte-767znw">Settings</span> <!> <!> <button class="save-btn svelte-767znw"> </button></div> <!></div></div>',1);function VZ(o,e){Vs(e,!0),delete Tf.Icon.Default.prototype._getIconUrl,Tf.Icon.Default.mergeOptions({iconUrl:cZ,iconRetinaUrl:dZ,shadowUrl:uZ});let t=I(Ei(sZ())),i=I("~/.she"),n=I("mqtt"),s=I(""),r=I(""),a=I(""),d=I(""),u=I(""),f=I(""),g=I("logic"),p=I("var"),C=I(""),b=I(!1),y=I(8080),w=I(""),A=I("none"),P=I(""),M=I("X-Remote-User"),R=I(""),T=I(!1),V=I(""),W=I(""),Q=I(""),ne=I(!1),de=I(!1),te=I(!1),he=I(""),De=I(48.7408),oe=I(9.1778),ge=I(!1),Se=I(void 0),Re=I(!1),xe=I(null),et=I("info"),We=I(""),_e=I(""),dt=I(!1),Wt=I(!1),tt=I("");const kt=[{id:"ollama",label:"Ollama (local)",provider:"ollama",baseUrl:"",defaultModel:"",freeNote:"",apiKeyUrl:""},{id:"lmstudio",label:"LM Studio (local)",provider:"openai",baseUrl:"http://localhost:1234",defaultModel:"",freeNote:"",apiKeyUrl:""},{id:"groq",label:"Groq — Qwen 2.5 Coder 32B (free)",provider:"openai",baseUrl:"https://api.groq.com/openai/v1",defaultModel:"qwen-2.5-coder-32b",freeNote:"14 400 req/day · no credit card needed",apiKeyUrl:"https://console.groq.com/keys"},{id:"gemini",label:"Google Gemini 2.0 Flash (free)",provider:"openai",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",defaultModel:"gemini-2.0-flash",freeNote:"15 RPM · 1 000 000 tokens/day · no credit card",apiKeyUrl:"https://aistudio.google.com/apikey"},{id:"openai",label:"OpenAI (paid)",provider:"openai",baseUrl:"",defaultModel:"gpt-4o-mini",freeNote:"",apiKeyUrl:"https://platform.openai.com/api-keys"},{id:"anthropic",label:"Anthropic (paid)",provider:"anthropic",baseUrl:"",defaultModel:"claude-3-5-haiku-20241022",freeNote:"",apiKeyUrl:"https://console.anthropic.com/settings/keys"}];let be=I("ollama"),Rt=I("ollama"),ut=I(""),at=I(""),Ze=I("");const Pt={};let ui="ollama";function wt(se,Ee){return se==="anthropic"?"anthropic":se==="ollama"?"ollama":Ee?Ee.includes("localhost:1234")?"lmstudio":Ee.includes("groq.com")?"groq":Ee.includes("googleapis.com")?"gemini":"openai":"openai"}function Ft(){Pt[ui]={baseUrl:c(ut),model:c(at),apiKey:c(Ze)};const se=kt.find(Le=>Le.id===c(be));if(!se)return;m(Rt,se.provider,!0);const Ee=Pt[c(be)];m(ut,(Ee==null?void 0:Ee.baseUrl)??se.baseUrl,!0),m(at,(Ee==null?void 0:Ee.model)??se.defaultModel,!0),m(Ze,(Ee==null?void 0:Ee.apiKey)??"",!0),ui=c(be)}const Vt=Tt(()=>kt.find(se=>se.id===c(be)));let zt=I(Ei({}));const Zt=new Set(["url","name","variablePrefix","disableVariables","mqttUsername","mqttPassword","mqttCa","mqttCert","mqttKey","mqttVersion","port","bindAddress","auth","password","proxyHeader","proxyLogoutUrl","dir","disableWatch","gitAutoCommit","gitAutoPush","latitude","longitude","timezone","verbosity","dbPath","dbPrefix","dbPublish","dbRetain","redis","ai"]);$n(()=>{if(!c(Se))return;const se=typeof c(De)=="number"?c(De):48.7408,Ee=typeof c(oe)=="number"?c(oe):9.1778,Le=Tf.map(c(Se)).setView([se,Ee],10);Tf.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(Le);const Y=Tf.marker([se,Ee],{draggable:!0}).addTo(Le);m(xe,Y,!0);const Oe=Ve=>{m(De,+Ve.lat.toFixed(6)),m(oe,+Ve.lng.toFixed(6))};return Y.on("dragend",()=>Oe(Y.getLatLng())),Le.on("click",Ve=>{Y.setLatLng(Ve.latlng),Oe(Ve.latlng)}),()=>{m(xe,null),Le.remove()}}),$n(()=>{!c(xe)||c(De)===""||c(oe)===""||c(xe).setLatLng([Number(c(De)),Number(c(oe))])});let mt;function Mi(){if(!navigator.geolocation){mt.show("Geolocation is not supported by this browser.",{alert:!0});return}m(Re,!0),navigator.geolocation.getCurrentPosition(se=>{m(De,+se.coords.latitude.toFixed(6)),m(oe,+se.coords.longitude.toFixed(6)),m(Re,!1)},()=>{m(Re,!1)})}let Ri=I(!0),Di=I(!1),Ui=I(""),ji=I(""),Bi=I(""),fn=I("appearance");const an=[{id:"appearance",label:"Appearance",terms:["theme","color","dark","light"]},{id:"auth",label:"Authentication",terms:["auth","password","login","proxy","header","nginx","authentik","secure"]},{id:"mqtt",label:"MQTT",terms:["broker","url","client","name","variable","prefix","protocol","version","mqtt5"]},{id:"webserver",label:"Web server",terms:["port","http","server","bind","address"]},{id:"scripts",label:"Scripts",terms:["directory","watch","hot reload","dir"]},{id:"git",label:"Git",terms:["git","auto commit","auto push","commit","push","repository"]},{id:"solar",label:"Location",terms:["latitude","longitude","sunrise","sunset","geo","timezone","time zone","iana","schedule"]},{id:"logging",label:"Logging",terms:["verbosity","debug","info","warn","error"]},{id:"shedb",label:"sheDB",terms:["database","db","path","retain"]},{id:"redis",label:"Redis",terms:["redis","cache"]},{id:"ai",label:"AI Assistant",terms:["llm","ollama","openai","anthropic","model","provider","base url"]}];let Zi=Tt(()=>an.filter(se=>{const Ee=c(Bi).trim().toLowerCase();return!Ee||se.label.toLowerCase().includes(Ee)||se.terms.some(Le=>Le.includes(Ee))}));function _n(se){var Ee;m(fn,se,!0),(Ee=document.getElementById("sec-"+se))==null||Ee.scrollIntoView({behavior:"smooth",block:"start"})}Ks(async()=>{try{const se=await Xf();se.dataDir&&m(i,se.dataDir,!0)}catch{}try{const se=await Il();if(typeof se.url=="string"&&se.url)try{const Y=new URL(se.url);m(n,Y.protocol.replace(":",""),!0),m(s,Y.host,!0)}catch{m(s,se.url,!0)}typeof se.mqttUsername=="string"&&m(r,se.mqttUsername,!0),typeof se.mqttPassword=="string"&&m(a,se.mqttPassword,!0),typeof se.mqttCa=="string"&&m(d,se.mqttCa,!0),typeof se.mqttCert=="string"&&m(u,se.mqttCert,!0),typeof se.mqttKey=="string"&&m(f,se.mqttKey,!0),typeof se.mqttVersion=="string"&&m(C,se.mqttVersion,!0),typeof se.name=="string"&&m(g,se.name,!0),typeof se.variablePrefix=="string"&&m(p,se.variablePrefix,!0),typeof se.disableVariables=="boolean"&&m(b,se.disableVariables,!0),typeof se.port=="number"&&m(y,se.port,!0),typeof se.bindAddress=="string"&&m(w,se.bindAddress,!0),typeof se.auth=="string"&&m(A,se.auth,!0),typeof se.proxyHeader=="string"&&m(M,se.proxyHeader,!0),typeof se.proxyLogoutUrl=="string"&&m(R,se.proxyLogoutUrl,!0),typeof se.dir=="string"&&m(Q,se.dir,!0),typeof se.disableWatch=="boolean"&&m(ne,se.disableWatch,!0),typeof se.gitAutoCommit=="boolean"&&m(de,se.gitAutoCommit,!0),typeof se.gitAutoPush=="boolean"&&m(te,se.gitAutoPush,!0),typeof se.latitude=="number"&&m(De,se.latitude,!0),typeof se.longitude=="number"&&m(oe,se.longitude,!0),typeof se.timezone=="string"&&m(he,se.timezone,!0),typeof se.verbosity=="string"&&m(et,se.verbosity,!0),typeof se.dbPath=="string"&&m(We,se.dbPath,!0),typeof se.dbPrefix=="string"&&m(_e,se.dbPrefix,!0),typeof se.dbPublish=="boolean"&&m(dt,se.dbPublish,!0),typeof se.dbRetain=="boolean"&&m(Wt,se.dbRetain,!0);const Ee=se.redis;Ee!=null&&Ee.url&&m(tt,Ee.url,!0);const Le=se.ai;Le!=null&&Le.provider&&m(Rt,Le.provider,!0),Le!=null&&Le.baseUrl&&m(ut,Le.baseUrl,!0),Le!=null&&Le.model&&m(at,Le.model,!0),Le!=null&&Le.apiKey&&m(Ze,Le.apiKey,!0),m(be,wt(c(Rt),c(ut)),!0),ui=c(be),m(zt,Object.fromEntries(Object.entries(se).filter(([Y])=>!Zt.has(Y))),!0)}catch(se){m(ji,se.message,!0)}finally{m(Ri,!1)}});async function gt(){if(m(W,""),m(V,""),c(A)==="password"&&!c(P)){m(W,"A password is required to enable password authentication.");return}m(T,!0);try{await T$(c(A),c(A)==="password"?c(P):void 0,c(A)==="proxy"?c(M):void 0,c(A)==="proxy"?c(R):void 0),m(P,""),m(V,"Authentication settings saved.")}catch(se){m(W,se.message,!0)}finally{m(T,!1)}}async function Yt(){m(ji,""),m(Ui,"");const se={...c(zt)};c(s)&&(se.url=`${c(n)}://${c(s)}`),se.name=c(g),se.variablePrefix=c(p),c(C)&&(se.mqttVersion=c(C)),c(b)&&(se.disableVariables=!0),c(r)&&(se.mqttUsername=c(r)),c(a)&&(se.mqttPassword=c(a)),c(d)&&(se.mqttCa=c(d)),c(u)&&(se.mqttCert=c(u)),c(f)&&(se.mqttKey=c(f)),c(y)!==""&&(se.port=Number(c(y))),c(w)&&(se.bindAddress=c(w)),c(Q)&&(se.dir=c(Q)),c(ne)&&(se.disableWatch=!0),c(de)&&(se.gitAutoCommit=!0),c(te)&&(se.gitAutoPush=!0),c(De)!==""&&(se.latitude=Number(c(De))),c(oe)!==""&&(se.longitude=Number(c(oe))),c(he)&&(se.timezone=c(he)),se.verbosity=c(et),c(We)&&(se.dbPath=c(We),c(_e)&&(se.dbPrefix=c(_e)),c(dt)&&(se.dbPublish=!0,c(Wt)&&(se.dbRetain=!0))),c(tt)&&(se.redis={url:c(tt)}),c(Rt)&&(se.ai={provider:c(Rt),...c(ut)?{baseUrl:c(ut)}:{},...c(at)?{model:c(at)}:{},...c(Ze)?{apiKey:c(Ze)}:{}}),m(Di,!0);try{const Ee=await ap(se);window.dispatchEvent(new CustomEvent("she:config-changed")),m(Ui,Ee.restartRequired?"Saved — restart required to apply changes.":"Saved.",!0)}catch(Ee){m(ji,Ee.message,!0)}finally{m(Di,!1)}}var Ci=zZ(),Wi=yt(Ci);us(qc(Wi,{}),se=>mt=se,()=>mt);var Pi=v(Wi,2),Ti=_(Pi),Oi=_(Ti),Qi=v(_(Oi),2),yi=v(Oi,2);ei(yi,21,()=>an,se=>se.id,(se,Ee)=>{var Le=Es(),Y=yt(Le);{var Oe=ye=>{var At=fZ();let Ot;var ri=_(At);j(()=>{Ot=Bt(At,1,"section-link svelte-767znw",null,Ot,{active:c(fn)===c(Ee).id}),O(ri,c(Ee).label)}),$("click",At,()=>_n(c(Ee).id)),D(ye,At)},Ve=Tt(()=>c(Zi).some(ye=>ye.id===c(Ee).id));z(Y,ye=>{c(Ve)&&ye(Oe)})}D(se,Le)});var Xe=v(Ti,2),St=_(Xe),Ai=v(_(St),2);{var ki=se=>{var Ee=gZ(),Le=_(Ee);j(()=>O(Le,c(ji))),D(se,Ee)};z(Ai,se=>{c(ji)&&se(ki)})}var fi=v(Ai,2);{var Ii=se=>{var Ee=pZ(),Le=_(Ee);j(()=>O(Le,c(Ui))),D(se,Ee)};z(fi,se=>{c(Ui)&&se(Ii)})}var X=v(fi,2),Ae=_(X),qe=v(St,2);{var nt=se=>{var Ee=xZ();D(se,Ee)},qt=se=>{var Ee=WZ(),Le=_(Ee);{var Y=ae=>{var pe=mZ(),Te=v(_(pe),2),me=v(_(Te),2),Ie=_(me);Ie.value=Ie.__value="dark";var lt=v(Ie);lt.value=lt.__value="light";var G=v(lt);G.value=G.__value="system",$("change",me,()=>oZ(c(t))),Fs(me,()=>c(t),re=>m(t,re)),D(ae,pe)},Oe=Tt(()=>c(Zi).some(ae=>ae.id==="appearance"));z(Le,ae=>{c(Oe)&&ae(Y)})}var Ve=v(Le,2);{var ye=ae=>{var pe=_Z(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Transport protocol. Use mqtts or wss for TLS encryption.");var lt=v(me,2),G=_(lt);G.value=G.__value="mqtt";var re=v(G);re.value=re.__value="mqtts";var Ne=v(re);Ne.value=Ne.__value="ws";var it=v(Ne);it.value=it.__value="wss";var Pe=v(Te,2),ke=_(Pe),Ct=v(_(ke));jn(Ct,()=>"Hostname and optional port of the MQTT broker. Example: 192.168.1.1:1883. Leave empty to run without MQTT.");var vt=v(ke,2),Fe=v(Pe,2),Dt=_(Fe),Ge=v(_(Dt));jn(Ge,()=>"MQTT broker username. Leave empty if the broker does not require authentication.");var ze=v(Dt,2),Je=v(Fe,2),bt=_(Je),$e=v(_(bt));jn($e,()=>"MQTT broker password. Stored in plain text in config.json.");var It=v(bt,2),Me=v(Je,2);{var st=kn=>{var ss=vZ(),ps=yt(ss),zi=_(ps),Ys=v(_(zi));jn(Ys,()=>"PEM-encoded CA certificate to verify the broker's TLS certificate. Leave empty to use the system's default CA store.");var Pn=v(zi,2),Vn=v(ps,2),Ts=_(Vn),dr=v(_(Ts));jn(dr,()=>"PEM-encoded client certificate for mutual TLS authentication.");var Or=v(Ts,2),Za=v(Vn,2),Xa=_(Za),ur=v(_(Xa));jn(ur,()=>"PEM-encoded private key matching the client certificate.");var ga=v(Xa,2);jt(Pn,()=>c(d),Hr=>m(d,Hr)),jt(Or,()=>c(u),Hr=>m(u,Hr)),jt(ga,()=>c(f),Hr=>m(f,Hr)),D(kn,ss)};z(Me,kn=>{(c(n)==="mqtts"||c(n)==="wss")&&kn(st)})}var Lt=v(Me,2),Ht=_(Lt),pt=v(_(Ht));jn(pt,()=>"MQTT protocol version used when connecting to the broker. Choose 5 only if your broker supports MQTT 5.0. Default: 3.1.1 (mqtt.js default).");var vi=v(Ht,2),wi=_(vi);wi.value=wi.__value="";var qi=v(wi);qi.value=qi.__value="5";var Fi=v(Lt,2),Gi=_(Fi),Li=v(_(Gi));jn(Li,()=>'MQTT client ID and topic prefix used for the "connected" status message. Default: she');var ni=v(Gi,2),ii=v(Fi,2),Xi=_(ii),Ji=v(_(Xi));jn(Ji,()=>"Topic prefix for the variable system (var/set/name → var/status/name). Default: var");var Ln=v(Xi,2),Jn=v(ii,2),Ss=v(_(Jn),2),as=_(Ss),Bs=v(as,4);jn(Bs,()=>"When enabled, var/set/… messages are not processed and no var/status/… retained messages are published."),Fs(lt,()=>c(n),kn=>m(n,kn)),jt(vt,()=>c(s),kn=>m(s,kn)),jt(ze,()=>c(r),kn=>m(r,kn)),jt(It,()=>c(a),kn=>m(a,kn)),Fs(vi,()=>c(C),kn=>m(C,kn)),jt(ni,()=>c(g),kn=>m(g,kn)),jt(Ln,()=>c(p),kn=>m(p,kn)),Cs(as,()=>c(b),kn=>m(b,kn)),D(ae,pe)},At=Tt(()=>c(Zi).some(ae=>ae.id==="mqtt"));z(Ve,ae=>{c(At)&&ae(ye)})}var Ot=v(Ve,2);{var ri=ae=>{var pe=wZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"none: no authentication required. password: single-user password login. proxy: trust a header set by nginx/authentik.");var lt=v(me,2),G=_(lt);G.value=G.__value="none";var re=v(G);re.value=re.__value="password";var Ne=v(re);Ne.value=Ne.__value="proxy";var it=v(Te,2);{var Pe=$e=>{var It=bZ(),Me=_(It),st=_(Me),Lt=v(st);jn(Lt,()=>"Set a new password. Leave empty to keep the current password (if already set).");var Ht=v(Me,2);j(()=>O(st,`${c(P)?"New password":"Password"} `)),jt(Ht,()=>c(P),pt=>m(P,pt)),D($e,It)};z(it,$e=>{c(A)==="password"&&$e(Pe)})}var ke=v(it,2);{var Ct=$e=>{var It=CZ(),Me=yt(It),st=_(Me),Lt=v(_(st));jn(Lt,()=>"The HTTP header that nginx/authentik sets after successful authentication. Default: X-Remote-User");var Ht=v(st,2),pt=v(Me,2),vi=_(pt),wi=v(_(vi));jn(wi,()=>"URL to redirect to when the user clicks Logout (e.g. https://auth.example.com/application/o/she/end-session/ for Authentik). Leave empty to do nothing on logout.");var qi=v(vi,2);jt(Ht,()=>c(M),Fi=>m(M,Fi)),jt(qi,()=>c(R),Fi=>m(R,Fi)),D($e,It)};z(ke,$e=>{c(A)==="proxy"&&$e(Ct)})}var vt=v(ke,2);{var Fe=$e=>{var It=EZ(),Me=_(It);j(()=>O(Me,c(W))),D($e,It)};z(vt,$e=>{c(W)&&$e(Fe)})}var Dt=v(vt,2);{var Ge=$e=>{var It=yZ(),Me=_(It);j(()=>O(Me,c(V))),D($e,It)};z(Dt,$e=>{c(V)&&$e(Ge)})}var ze=v(Dt,2),Je=v(_(ze),2),bt=_(Je);j(()=>{Je.disabled=c(T)||c(A)==="password"&&!c(P),O(bt,c(T)?"Saving…":"Apply authentication settings")}),Fs(lt,()=>c(A),$e=>m(A,$e)),$("click",Je,gt),D(ae,pe)},oi=Tt(()=>c(Zi).some(ae=>ae.id==="auth"));z(Ot,ae=>{c(oi)&&ae(ri)})}var xi=v(Ot,2);{var Ut=ae=>{var pe=SZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"HTTP server port. Use 0 to let the OS pick a free port. Default: 8080");var lt=v(me,2),G=v(Te,2),re=_(G),Ne=v(_(re));jn(Ne,()=>"Interface she listens on. Use 127.0.0.1 when running behind nginx (recommended with proxy auth). Default: 0.0.0.0");var it=v(re,2);jt(lt,()=>c(y),Pe=>m(y,Pe)),jt(it,()=>c(w),Pe=>m(w,Pe)),D(ae,pe)},mi=Tt(()=>c(Zi).some(ae=>ae.id==="webserver"));z(xi,ae=>{c(mi)&&ae(Ut)})}var He=v(xi,2);{var Ye=ae=>{var pe=DZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Directory that is watched for .js script files. Defaults to {dataDir}/scripts");var lt=v(me,2),G=v(Te,2),re=v(_(G),2),Ne=_(re),it=v(Ne,4);jn(it,()=>"When enabled the daemon will not watch for file changes and will not hot-reload scripts."),j(()=>ln(lt,"placeholder",`${c(i)??""}/scripts (default)`)),jt(lt,()=>c(Q),Pe=>m(Q,Pe)),Cs(Ne,()=>c(ne),Pe=>m(ne,Pe)),D(ae,pe)},Qt=Tt(()=>c(Zi).some(ae=>ae.id==="scripts"));z(He,ae=>{c(Qt)&&ae(Ye)})}var Gt=v(He,2);{var gi=ae=>{var pe=AZ(),Te=v(_(pe),2),me=v(_(Te),2),Ie=_(me),lt=v(Ie,4);jn(lt,()=>"When enabled, saving or renaming/deleting a script automatically creates a git commit. Only effective when the scripts directory is inside a git repository.");var G=v(Te,2),re=v(_(G),2),Ne=_(re),it=v(Ne,4);jn(it,()=>"When enabled, every commit (manual or automatic) is immediately pushed to the remote."),Cs(Ie,()=>c(de),Pe=>m(de,Pe)),Cs(Ne,()=>c(te),Pe=>m(te,Pe)),D(ae,pe)},Jt=Tt(()=>c(Zi).some(ae=>ae.id==="git"));z(Gt,ae=>{c(Jt)&&ae(gi)})}var fe=v(Gt,2);{var Ke=ae=>{var pe=BZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"IANA timezone for cron scheduling (e.g. Europe/Berlin). Leave empty to use the system timezone. Requires daemon restart.");var lt=v(me,2),G=v(lt,2);ei(G,20,()=>{var Ht;return((Ht=Intl.supportedValuesOf)==null?void 0:Ht.call(Intl,"timeZone"))??[]},Ni,(Ht,pt)=>{var vi=TA(),wi=_(vi),qi={};j(()=>{O(wi,pt),qi!==(qi=pt)&&(vi.value=(vi.__value=pt)??"")}),D(Ht,vi)});var re=v(Te,2),Ne=_(re),it=v(_(Ne));jn(it,()=>"Geographic latitude used for sunrise/sunset calculations. Default: 48.7408 (Stuttgart)");var Pe=v(Ne,2),ke=v(re,2),Ct=_(ke),vt=v(_(Ct));jn(vt,()=>"Geographic longitude used for sunrise/sunset calculations. Default: 9.1778 (Stuttgart)");var Fe=v(Ct,2),Dt=v(ke,2),Ge=v(_(Dt),2),ze=_(Ge),Je=_(ze);{var bt=Ht=>{var pt=_o("…");D(Ht,pt)},$e=Ht=>{var pt=_o("📍 Use my location");D(Ht,pt)};z(Je,Ht=>{c(Re)?Ht(bt):Ht($e,-1)})}var It=v(ze,2),Me=_(It),st=v(Dt,2);{var Lt=Ht=>{var pt=kZ(),vi=v(_(pt),2);us(vi,wi=>m(Se,wi),()=>c(Se)),D(Ht,pt)};z(st,Ht=>{c(ge)&&Ht(Lt)})}j(()=>{ze.disabled=c(Re),O(Me,c(ge)?"Hide map":"Pick on map")}),jt(lt,()=>c(he),Ht=>m(he,Ht)),jt(Pe,()=>c(De),Ht=>m(De,Ht)),jt(Fe,()=>c(oe),Ht=>m(oe,Ht)),$("click",ze,Mi),$("click",It,()=>m(ge,!c(ge))),D(ae,pe)},ot=Tt(()=>c(Zi).some(ae=>ae.id==="solar"));z(fe,ae=>{c(ot)&&ae(Ke)})}var rt=v(fe,2);{var ht=ae=>{var pe=FZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Minimum log level. debug shows all messages including MQTT traffic details.");var lt=v(me,2),G=_(lt);G.value=G.__value="debug";var re=v(G);re.value=re.__value="info";var Ne=v(re);Ne.value=Ne.__value="warn";var it=v(Ne);it.value=it.__value="error",Fs(lt,()=>c(et),Pe=>m(et,Pe)),D(ae,pe)},_t=Tt(()=>c(Zi).some(ae=>ae.id==="logging"));z(rt,ae=>{c(_t)&&ae(ht)})}var Xt=v(rt,2);{var F=ae=>{var pe=IZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Path to the sheDB data directory. Defaults to {dataDir}/db. Leave empty to disable sheDB.");var lt=v(me,2),G=v(Te,2),re=_(G),Ne=v(_(re));jn(Ne,()=>"Prefix for all sheDB MQTT topics. Defaults to she/db/ — documents publish to {prefix}doc/{id}, views to {prefix}view/{id}, commands use {prefix}set/{id} etc.");var it=v(re,2),Pe=v(G,2),ke=v(_(Pe),2);let Ct;var vt=_(ke),Fe=v(vt,4);jn(Fe,()=>'When enabled, every document change is published to {dbPrefix}doc/{id}. Individual views can publish independently via their own "mqttpub" setting.');var Dt=v(Pe,2);{var Ge=ze=>{var Je=LZ(),bt=v(_(Je),2);let $e;var It=_(bt),Me=v(It,4);jn(Me,()=>"When enabled, MQTT messages for document changes are published as retained messages."),j(()=>{$e=Bt(bt,1,"check-label svelte-767znw",null,$e,{muted:!c(We)}),It.disabled=!c(We)}),Cs(It,()=>c(Wt),st=>m(Wt,st)),D(ze,Je)};z(Dt,ze=>{c(dt)&&ze(Ge)})}j(()=>{ln(lt,"placeholder",`defaults to ${c(i)??""}/db`),it.disabled=!c(We),Ct=Bt(ke,1,"check-label svelte-767znw",null,Ct,{muted:!c(We)}),vt.disabled=!c(We)}),jt(lt,()=>c(We),ze=>m(We,ze)),jt(it,()=>c(_e),ze=>m(_e,ze)),Cs(vt,()=>c(dt),ze=>m(dt,ze)),D(ae,pe)},H=Tt(()=>c(Zi).some(ae=>ae.id==="shedb"));z(Xt,ae=>{c(H)&&ae(F)})}var K=v(Xt,2);{var le=ae=>{var pe=PZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"redis:// URL for the optional Redis write-through cache. All state store changes are written to the she:state hash. Leave empty to disable.");var lt=v(me,2);jt(lt,()=>c(tt),G=>m(tt,G)),D(ae,pe)},Z=Tt(()=>c(Zi).some(ae=>ae.id==="redis"));z(K,ae=>{c(Z)&&ae(le)})}var J=v(K,2);{var ce=ae=>{var pe=HZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Choose a provider. Free options need a free API key from the provider's website — no credit card required.");var lt=v(me,2);ei(lt,21,()=>kt,Ni,(Ge,ze)=>{var Je=TA(),bt=_(Je),$e={};j(()=>{O(bt,c(ze).label),$e!==($e=c(ze).id)&&(Je.value=(Je.__value=c(ze).id)??"")}),D(Ge,Je)});var G=v(Te,2);{var re=Ge=>{var ze=RZ();let Je;var bt=_(ze);{var $e=st=>{var Lt=TZ(),Ht=v(yt(Lt));j(()=>O(Ht,` ${c(Vt).freeNote??""}`)),D(st,Lt)};z(bt,st=>{c(Vt).freeNote&&st($e)})}var It=v(bt,2);{var Me=st=>{var Lt=MZ(),Ht=v(yt(Lt));j(()=>ln(Ht,"href",c(Vt).apiKeyUrl)),D(st,Lt)};z(It,st=>{c(Vt).apiKeyUrl&&st(Me)})}j(()=>Je=Bt(ze,1,"preset-note svelte-767znw",null,Je,{free:!!c(Vt).freeNote})),D(Ge,ze)};z(G,Ge=>{var ze,Je;((ze=c(Vt))!=null&&ze.freeNote||(Je=c(Vt))!=null&&Je.apiKeyUrl)&&Ge(re)})}var Ne=v(G,2);{var it=Ge=>{var ze=NZ(),Je=_(ze),bt=v(_(Je));jn(bt,()=>"Base URL of the LLM API. Auto-filled for cloud presets. For Ollama: http://localhost:11434.");var $e=v(Je,2);j(()=>{var It;return ln($e,"placeholder",c(be)==="ollama"?"http://localhost:11434":c(be)==="lmstudio"?"http://localhost:1234":((It=c(Vt))==null?void 0:It.baseUrl)??"")}),jt($e,()=>c(ut),It=>m(ut,It)),D(Ge,ze)};z(Ne,Ge=>{c(be)!=="anthropic"&&Ge(it)})}var Pe=v(Ne,2),ke=_(Pe),Ct=v(_(ke));jn(Ct,()=>"Model identifier. Suggested default is filled in when you choose a preset.");var vt=v(ke,2),Fe=v(Pe,2);{var Dt=Ge=>{var ze=OZ(),Je=_(ze),bt=v(_(Je));jn(bt,()=>"Stored in config.json. Not needed for local providers.");var $e=v(Je,2);jt($e,()=>c(Ze),It=>m(Ze,It)),D(Ge,ze)};z(Fe,Ge=>{c(be)!=="ollama"&&c(be)!=="lmstudio"&&Ge(Dt)})}j(()=>{var Ge;return ln(vt,"placeholder",((Ge=c(Vt))==null?void 0:Ge.defaultModel)||"e.g. llama3.2")}),$("change",lt,Ft),Fs(lt,()=>c(be),Ge=>m(be,Ge)),jt(vt,()=>c(at),Ge=>m(at,Ge)),D(ae,pe)},Qe=Tt(()=>c(Zi).some(ae=>ae.id==="ai"));z(J,ae=>{c(Qe)&&ae(ce)})}D(se,Ee)};z(qe,se=>{c(Ri)?se(nt):se(qt,-1)})}j(()=>{X.disabled=c(Di),O(Ae,c(Di)?"Saving…":"Save")}),jt(Qi,()=>c(Bi),se=>m(Bi,se)),$("click",X,Yt),D(o,Ci),js()}Zs(["click","change"]);var jZ=B("<option> </option>"),$Z=B('<div><span class="ts svelte-18loop9"> </span> <span class="lvl svelte-18loop9"> </span> <span class="msg svelte-18loop9"> </span></div>'),UZ=B('<div class="page svelte-18loop9"><div class="toolbar svelte-18loop9"><h2 class="svelte-18loop9">Logs</h2> <select class="svelte-18loop9"></select> <input class="filter-in svelte-18loop9" type="search" placeholder="Filter messages…"/> <label class="check-label svelte-18loop9" title="Interpret filter as a regular expression"><input type="checkbox" class="svelte-18loop9"/> <span class="checkmark svelte-18loop9"></span> Regex</label> <label class="check-label svelte-18loop9"><input type="checkbox" class="svelte-18loop9"/> <span class="checkmark svelte-18loop9"></span> Auto-scroll</label> <button class="svelte-18loop9">Clear</button></div> <div class="log svelte-18loop9"></div></div>');function qZ(o,e){Vs(e,!0);let t=I(Ei(yF())),i,n=I(!0),s=I("all"),r=I(""),a=I(!1);const d=["all","debug","info","warn","error"],u={debug:0,info:1,warn:2,error:3};lS(W=>{m(t,[...c(t).slice(-1999),W],!0)}),Ks(()=>{i&&(i.scrollTop=i.scrollHeight)}),$n(()=>{c(t).length,c(n)&&i&&(i.scrollTop=i.scrollHeight)});function f(){m(t,[],!0)}function g(W){if(c(s)!=="all"&&u[W.level]<u[c(s)])return!1;if(!c(r))return!0;if(c(a))try{return new RegExp(c(r),"i").test(W.msg)}catch{}return W.msg.toLowerCase().includes(c(r).toLowerCase())}function p(W){return new Date(W).toLocaleTimeString()}var C=UZ(),b=_(C),y=v(_(b),2);ei(y,21,()=>d,Ni,(W,Q)=>{var ne=jZ(),de=_(ne),te={};j(()=>{O(de,c(Q)),te!==(te=c(Q))&&(ne.value=(ne.__value=c(Q))??"")}),D(W,ne)});var w=v(y,2),A=v(w,2),P=_(A),M=v(A,2),R=_(M),T=v(M,2),V=v(b,2);ei(V,21,()=>c(t).filter(g),W=>W.ts+W.msg,(W,Q)=>{var ne=$Z(),de=_(ne),te=_(de),he=v(de,2),De=_(he),oe=v(he,2),ge=_(oe);j((Se,Re)=>{Bt(ne,1,`line ${c(Q).level??""}`,"svelte-18loop9"),O(te,Se),O(De,Re),O(ge,c(Q).msg)},[()=>p(c(Q).ts),()=>c(Q).level.toUpperCase()]),D(W,ne)}),us(V,W=>i=W,()=>i),Fs(y,()=>c(s),W=>m(s,W)),jt(w,()=>c(r),W=>m(r,W)),Cs(P,()=>c(a),W=>m(a,W)),Cs(R,()=>c(n),W=>m(n,W)),$("click",T,f),D(o,C),js()}Zs(["click"]);var GZ=B('<span class="chat-model svelte-1twuiul"><!></span>'),KZ=B('<button class="clear-btn svelte-1twuiul" title="Clear conversation">✕</button>'),ZZ=B('<div class="unconfigured svelte-1twuiul">Configure an AI provider in the <strong class="svelte-1twuiul">Config</strong> tab to use the AI assistant.</div>'),XZ=B('Working on view <code class="svelte-1twuiul"> </code>',1),YZ=B('<button class="chip svelte-1twuiul"> </button>'),QZ=B('<div class="suggestions svelte-1twuiul"><p class="suggestions-hint svelte-1twuiul"><!></p> <!></div>'),JZ=B('<div class="msg-content user-text svelte-1twuiul"> </div>'),MA=B('<div class="tool-event tool-call svelte-1twuiul"><span class="tool-icon svelte-1twuiul">🔧</span><span class="tool-name svelte-1twuiul"> </span></div>'),RA=B('<div class="tool-event tool-result svelte-1twuiul"><span class="tool-icon svelte-1twuiul">✓</span><span class="tool-name svelte-1twuiul"> </span></div>'),NA=B('<div class="tool-events svelte-1twuiul"></div>'),OA=B('<div class="text-block svelte-1twuiul"></div>'),eX=B('<button class="expand-btn svelte-1twuiul"> </button>'),tX=B('<div class="code-block svelte-1twuiul"><div class="code-header svelte-1twuiul"><span class="code-lang svelte-1twuiul"> </span> <div class="code-actions svelte-1twuiul"><button class="svelte-1twuiul">Copy</button></div></div> <div><pre class="svelte-1twuiul"><code class="hljs svelte-1twuiul"></code></pre> <!></div></div>'),iX=B('<div class="apply-view-row svelte-1twuiul"><button class="apply-view-btn svelte-1twuiul"> </button></div>'),nX=B('<!> <div class="msg-content svelte-1twuiul"><!> <!></div>',1),sX=B("<div><!></div>"),oX=B('<div class="message assistant svelte-1twuiul"><div class="msg-content svelte-1twuiul"><span class="status-shimmer svelte-1twuiul"> </span></div></div>'),rX=B('<div class="code-block svelte-1twuiul"><div class="code-header svelte-1twuiul"><span class="code-lang svelte-1twuiul"> </span></div> <pre class="svelte-1twuiul"><code class="hljs svelte-1twuiul"></code></pre></div>'),aX=B('<div class="message assistant streaming svelte-1twuiul"><div class="msg-content svelte-1twuiul"></div></div>'),lX=B('<div class="chat-error svelte-1twuiul"> </div>'),cX=B('<span><span class="badge badge-db svelte-1twuiul">db</span> <span class="chip-name svelte-1twuiul"> </span> <button class="chip-remove svelte-1twuiul"> </button></span>'),dX=B('<span class="file-chip svelte-1twuiul"><span> </span> <span class="chip-name svelte-1twuiul"> </span> <button class="chip-remove svelte-1twuiul" title="Remove from context">×</button></span>'),uX=B('<button class="stop-btn svelte-1twuiul" title="Stop generation">■</button>'),hX=B('<button class="send-btn svelte-1twuiul">↑</button>'),fX=B('<option class="svelte-1twuiul"> </option>'),gX=B('<select class="model-select svelte-1twuiul"></select>'),pX=B('<span class="model-name svelte-1twuiul"> </span>'),xX=B('<button class="info-btn svelte-1twuiul" title="Model info">ℹ</button>'),mX=B('<div class="model-bar svelte-1twuiul"><span class="model-provider svelte-1twuiul"> </span> <!> <!></div>'),vX=B('<p class="info-status svelte-1twuiul">Loading…</p>'),_X=B('<p class="info-status info-err svelte-1twuiul"> </p>'),bX=B('<dt class="svelte-1twuiul">Ollama version</dt><dd class="svelte-1twuiul"> </dd>',1),CX=B('<dt class="svelte-1twuiul">Family</dt><dd class="svelte-1twuiul"> </dd>',1),EX=B('<dt class="svelte-1twuiul">Parameters</dt><dd class="svelte-1twuiul"> </dd>',1),yX=B('<dt class="svelte-1twuiul">Quantization</dt><dd class="svelte-1twuiul"> </dd>',1),wX=B('<div class="running-model svelte-1twuiul"> </div>'),SX=B('<dt class="svelte-1twuiul">Loaded</dt> <dd class="svelte-1twuiul"></dd>',1),DX=B('<dt class="svelte-1twuiul">Loaded</dt><dd class="dim svelte-1twuiul">Not in memory</dd>',1),AX=B('<dl class="svelte-1twuiul"><!> <!> <!> <!> <!></dl>'),kX=B('<div class="info-overlay svelte-1twuiul"><div class="info-popup svelte-1twuiul"><div class="info-popup-header svelte-1twuiul"><span class="svelte-1twuiul"> </span> <button title="Close" class="svelte-1twuiul">✕</button></div> <div class="info-popup-body svelte-1twuiul"><!></div></div></div>'),BX=B('<div class="chat-panel svelte-1twuiul"><div class="chat-header svelte-1twuiul"><span class="chat-title svelte-1twuiul">AI — View assistant</span> <!> <!></div> <div class="messages svelte-1twuiul"><!> <!> <!> <!> <!></div> <!> <div class="context-row svelte-1twuiul"><label title="Include sheDB document IDs in context" class="svelte-1twuiul"><input type="checkbox" class="svelte-1twuiul"/><span class="checkmark svelte-1twuiul"></span> Doc IDs</label> <label title="Include sample document content in context (first 10 docs)" class="svelte-1twuiul"><input type="checkbox" class="svelte-1twuiul"/><span class="checkmark svelte-1twuiul"></span> Sample docs</label> <label title="Let the AI query sheDB documents on demand. Disables real-time streaming." class="svelte-1twuiul"><input type="checkbox" class="svelte-1twuiul"/><span class="checkmark svelte-1twuiul"></span> 😎 Agent</label> <span class="req-size svelte-1twuiul"> </span></div> <div class="files-row svelte-1twuiul"><!> <!> <button class="add-file-btn svelte-1twuiul" title="Attach file to context">+</button> <input type="file" multiple="" class="file-input-hidden svelte-1twuiul"/></div> <div><div><textarea rows="3" class="svelte-1twuiul"></textarea></div> <!></div> <!></div> <!>',1);function FX(o,e){Vs(e,!0),Rv.registerLanguage("javascript",kF),es.use({breaks:!0,gfm:!0});let t=wu(e,"currentView",3,null);const i="she:viewchat:messages";let n=I(Ei(JSON.parse(localStorage.getItem(i)??"[]"))),s=I(null),r=I(""),a=I(!1),d=I(""),u=I(null),f=I(Ei([])),g=I(Ei(localStorage.getItem("she:selectedModel")??""));$n(()=>{localStorage.setItem(i,JSON.stringify(c(n)))});let p=I(Ei(new Set)),C=I(!1),b=I(null),y=I(!1),w=I(""),A=null,P=I(0);const M=["[core] reticulating splines…","[io] calibrating the flux capacitor…","[net] pinging the oracle (no response)…","[gpu] overclocking the neurons…","[fs] loading sarcasm module v4.2…","[mem] defragmenting the embedding space…","[sched] running gradient descent into madness…","[net] synchronizing with the hive mind…","[model] tickling the transformer…","[io] consulting rubber duck debugger…"];let R=I(!0),T=I(!0),V=I(!0),W=I(Ei([])),Q=I(!0),ne=I(!1),de,te=I(Ei([])),he=I(0),De,oe;const ge=Tt(()=>({apiref:!1,shedb:c(R),sampleDocs:c(T),tools:c(V)})),Se=Tt(()=>{var F;return((F=c(u))==null?void 0:F.configured)??!1}),Re=Tt(()=>c(he)+new TextEncoder().encode(c(r)).length),xe=Tt(()=>c(Q)?t():null);async function et(){try{const F=await xF();m(u,F,!0),F.configured&&!c(g)&&m(g,F.model,!0)}catch{}}$n(()=>(window.addEventListener("she:config-changed",et),()=>window.removeEventListener("she:config-changed",et))),Ks(()=>{et()}),$n(()=>{c(g)&&localStorage.setItem("she:selectedModel",c(g))}),$n(()=>{var F;(F=c(u))!=null&&F.provider&&mF().then(H=>{m(f,H.models,!0),!c(g)&&H.models.length>0&&m(g,H.models[0],!0)}).catch(()=>{})}),$n(()=>{c(g),m(b,null),m(w,"")}),$n(()=>{const F=c(ge),H=c(xe),K=c(W);c(Se)&&vF({context:F,currentView:H??null,extraFiles:K.length>0?K:void 0}).then(le=>{m(he,new TextEncoder().encode(le.prompt).length,!0)}).catch(()=>{})}),$n(()=>{if(!c(a))return;m(P,Math.floor(Math.random()*M.length),!0);const F=setInterval(()=>{m(P,(c(P)+1)%M.length)},1e4);return()=>clearInterval(F)}),$n(()=>{var F;oe&&(c(n).length+(((F=c(s))==null?void 0:F.length)??0),requestAnimationFrame(()=>{oe&&(oe.scrollTop=oe.scrollHeight)}))});function We(F){const H=[],K=/```(\w*)\n([\s\S]*?)```/g;let le=0,Z;for(;(Z=K.exec(F))!==null;)Z.index>le&&H.push({type:"text",text:F.slice(le,Z.index)}),H.push({type:"code",lang:Z[1]||"text",text:Z[2].trimEnd()}),le=Z.index+Z[0].length;return le<F.length&&H.push({type:"text",text:F.slice(le)}),H}function _e(F){const H=[],K=/```(\w*)\n([\s\S]*?)```/g;let le=0,Z;for(;(Z=K.exec(F))!==null;)Z.index>le&&H.push({type:"text",text:F.slice(le,Z.index)}),H.push({type:"code",lang:Z[1]||"text",text:Z[2].trimEnd()}),le=Z.index+Z[0].length;const J=F.slice(le),ce=J.match(/```(\w*)\n([\s\S]*)$/);return ce?(ce.index>0&&H.push({type:"text",text:J.slice(0,ce.index)}),H.push({type:"code",lang:ce[1]||"text",text:ce[2]})):J&&H.push({type:"text",text:J}),H}function dt(F){const H={};for(const K of F)if(K.type==="code"){if(K.lang==="filter")H.filter=K.text.trim();else if(Ze(K.lang)){const le=K.text.split(`
222
+ */var rZ=Qf.exports,PA;function aZ(){return PA||(PA=1,(function(o,e){(function(t,i){i(e)})(rZ,(function(t){var i="1.9.4";function n(l){var h,x,E,k;for(x=1,E=arguments.length;x<E;x++){k=arguments[x];for(h in k)l[h]=k[h]}return l}var s=Object.create||(function(){function l(){}return function(h){return l.prototype=h,new l}})();function r(l,h){var x=Array.prototype.slice;if(l.bind)return l.bind.apply(l,x.call(arguments,1));var E=x.call(arguments,2);return function(){return l.apply(h,E.length?E.concat(x.call(arguments)):arguments)}}var a=0;function d(l){return"_leaflet_id"in l||(l._leaflet_id=++a),l._leaflet_id}function u(l,h,x){var E,k,N,ie;return ie=function(){E=!1,k&&(N.apply(x,k),k=!1)},N=function(){E?k=arguments:(l.apply(x,arguments),setTimeout(ie,h),E=!0)},N}function f(l,h,x){var E=h[1],k=h[0],N=E-k;return l===E&&x?l:((l-k)%N+N)%N+k}function g(){return!1}function p(l,h){if(h===!1)return l;var x=Math.pow(10,h===void 0?6:h);return Math.round(l*x)/x}function C(l){return l.trim?l.trim():l.replace(/^\s+|\s+$/g,"")}function b(l){return C(l).split(/\s+/)}function y(l,h){Object.prototype.hasOwnProperty.call(l,"options")||(l.options=l.options?s(l.options):{});for(var x in h)l.options[x]=h[x];return l.options}function w(l,h,x){var E=[];for(var k in l)E.push(encodeURIComponent(x?k.toUpperCase():k)+"="+encodeURIComponent(l[k]));return(!h||h.indexOf("?")===-1?"?":"&")+E.join("&")}var A=/\{ *([\w_ -]+) *\}/g;function P(l,h){return l.replace(A,function(x,E){var k=h[E];if(k===void 0)throw new Error("No value provided for variable "+x);return typeof k=="function"&&(k=k(h)),k})}var M=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"};function R(l,h){for(var x=0;x<l.length;x++)if(l[x]===h)return x;return-1}var T="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function V(l){return window["webkit"+l]||window["moz"+l]||window["ms"+l]}var W=0;function Q(l){var h=+new Date,x=Math.max(0,16-(h-W));return W=h+x,window.setTimeout(l,x)}var ne=window.requestAnimationFrame||V("RequestAnimationFrame")||Q,de=window.cancelAnimationFrame||V("CancelAnimationFrame")||V("CancelRequestAnimationFrame")||function(l){window.clearTimeout(l)};function te(l,h,x){if(x&&ne===Q)l.call(h);else return ne.call(window,r(l,h))}function he(l){l&&de.call(window,l)}var De={__proto__:null,extend:n,create:s,bind:r,get lastId(){return a},stamp:d,throttle:u,wrapNum:f,falseFn:g,formatNum:p,trim:C,splitWords:b,setOptions:y,getParamString:w,template:P,isArray:M,indexOf:R,emptyImageUrl:T,requestFn:ne,cancelFn:de,requestAnimFrame:te,cancelAnimFrame:he};function oe(){}oe.extend=function(l){var h=function(){y(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},x=h.__super__=this.prototype,E=s(x);E.constructor=h,h.prototype=E;for(var k in this)Object.prototype.hasOwnProperty.call(this,k)&&k!=="prototype"&&k!=="__super__"&&(h[k]=this[k]);return l.statics&&n(h,l.statics),l.includes&&(ge(l.includes),n.apply(null,[E].concat(l.includes))),n(E,l),delete E.statics,delete E.includes,E.options&&(E.options=x.options?s(x.options):{},n(E.options,l.options)),E._initHooks=[],E.callInitHooks=function(){if(!this._initHooksCalled){x.callInitHooks&&x.callInitHooks.call(this),this._initHooksCalled=!0;for(var N=0,ie=E._initHooks.length;N<ie;N++)E._initHooks[N].call(this)}},h},oe.include=function(l){var h=this.prototype.options;return n(this.prototype,l),l.options&&(this.prototype.options=h,this.mergeOptions(l.options)),this},oe.mergeOptions=function(l){return n(this.prototype.options,l),this},oe.addInitHook=function(l){var h=Array.prototype.slice.call(arguments,1),x=typeof l=="function"?l:function(){this[l].apply(this,h)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(x),this};function ge(l){if(!(typeof L>"u"||!L||!L.Mixin)){l=M(l)?l:[l];for(var h=0;h<l.length;h++)l[h]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Se={on:function(l,h,x){if(typeof l=="object")for(var E in l)this._on(E,l[E],h);else{l=b(l);for(var k=0,N=l.length;k<N;k++)this._on(l[k],h,x)}return this},off:function(l,h,x){if(!arguments.length)delete this._events;else if(typeof l=="object")for(var E in l)this._off(E,l[E],h);else{l=b(l);for(var k=arguments.length===1,N=0,ie=l.length;N<ie;N++)k?this._off(l[N]):this._off(l[N],h,x)}return this},_on:function(l,h,x,E){if(typeof h!="function"){console.warn("wrong listener type: "+typeof h);return}if(this._listens(l,h,x)===!1){x===this&&(x=void 0);var k={fn:h,ctx:x};E&&(k.once=!0),this._events=this._events||{},this._events[l]=this._events[l]||[],this._events[l].push(k)}},_off:function(l,h,x){var E,k,N;if(this._events&&(E=this._events[l],!!E)){if(arguments.length===1){if(this._firingCount)for(k=0,N=E.length;k<N;k++)E[k].fn=g;delete this._events[l];return}if(typeof h!="function"){console.warn("wrong listener type: "+typeof h);return}var ie=this._listens(l,h,x);if(ie!==!1){var ve=E[ie];this._firingCount&&(ve.fn=g,this._events[l]=E=E.slice()),E.splice(ie,1)}}},fire:function(l,h,x){if(!this.listens(l,x))return this;var E=n({},h,{type:l,target:this,sourceTarget:h&&h.sourceTarget||this});if(this._events){var k=this._events[l];if(k){this._firingCount=this._firingCount+1||1;for(var N=0,ie=k.length;N<ie;N++){var ve=k[N],Ce=ve.fn;ve.once&&this.off(l,Ce,ve.ctx),Ce.call(ve.ctx||this,E)}this._firingCount--}}return x&&this._propagateEvent(E),this},listens:function(l,h,x,E){typeof l!="string"&&console.warn('"string" type argument expected');var k=h;typeof h!="function"&&(E=!!h,k=void 0,x=void 0);var N=this._events&&this._events[l];if(N&&N.length&&this._listens(l,k,x)!==!1)return!0;if(E){for(var ie in this._eventParents)if(this._eventParents[ie].listens(l,h,x,E))return!0}return!1},_listens:function(l,h,x){if(!this._events)return!1;var E=this._events[l]||[];if(!h)return!!E.length;x===this&&(x=void 0);for(var k=0,N=E.length;k<N;k++)if(E[k].fn===h&&E[k].ctx===x)return k;return!1},once:function(l,h,x){if(typeof l=="object")for(var E in l)this._on(E,l[E],h,!0);else{l=b(l);for(var k=0,N=l.length;k<N;k++)this._on(l[k],h,x,!0)}return this},addEventParent:function(l){return this._eventParents=this._eventParents||{},this._eventParents[d(l)]=l,this},removeEventParent:function(l){return this._eventParents&&delete this._eventParents[d(l)],this},_propagateEvent:function(l){for(var h in this._eventParents)this._eventParents[h].fire(l.type,n({layer:l.target,propagatedFrom:l.target},l),!0)}};Se.addEventListener=Se.on,Se.removeEventListener=Se.clearAllEventListeners=Se.off,Se.addOneTimeEventListener=Se.once,Se.fireEvent=Se.fire,Se.hasEventListeners=Se.listens;var Re=oe.extend(Se);function xe(l,h,x){this.x=x?Math.round(l):l,this.y=x?Math.round(h):h}var et=Math.trunc||function(l){return l>0?Math.floor(l):Math.ceil(l)};xe.prototype={clone:function(){return new xe(this.x,this.y)},add:function(l){return this.clone()._add(We(l))},_add:function(l){return this.x+=l.x,this.y+=l.y,this},subtract:function(l){return this.clone()._subtract(We(l))},_subtract:function(l){return this.x-=l.x,this.y-=l.y,this},divideBy:function(l){return this.clone()._divideBy(l)},_divideBy:function(l){return this.x/=l,this.y/=l,this},multiplyBy:function(l){return this.clone()._multiplyBy(l)},_multiplyBy:function(l){return this.x*=l,this.y*=l,this},scaleBy:function(l){return new xe(this.x*l.x,this.y*l.y)},unscaleBy:function(l){return new xe(this.x/l.x,this.y/l.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=et(this.x),this.y=et(this.y),this},distanceTo:function(l){l=We(l);var h=l.x-this.x,x=l.y-this.y;return Math.sqrt(h*h+x*x)},equals:function(l){return l=We(l),l.x===this.x&&l.y===this.y},contains:function(l){return l=We(l),Math.abs(l.x)<=Math.abs(this.x)&&Math.abs(l.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function We(l,h,x){return l instanceof xe?l:M(l)?new xe(l[0],l[1]):l==null?l:typeof l=="object"&&"x"in l&&"y"in l?new xe(l.x,l.y):new xe(l,h,x)}function _e(l,h){if(l)for(var x=h?[l,h]:l,E=0,k=x.length;E<k;E++)this.extend(x[E])}_e.prototype={extend:function(l){var h,x;if(!l)return this;if(l instanceof xe||typeof l[0]=="number"||"x"in l)h=x=We(l);else if(l=dt(l),h=l.min,x=l.max,!h||!x)return this;return!this.min&&!this.max?(this.min=h.clone(),this.max=x.clone()):(this.min.x=Math.min(h.x,this.min.x),this.max.x=Math.max(x.x,this.max.x),this.min.y=Math.min(h.y,this.min.y),this.max.y=Math.max(x.y,this.max.y)),this},getCenter:function(l){return We((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,l)},getBottomLeft:function(){return We(this.min.x,this.max.y)},getTopRight:function(){return We(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(l){var h,x;return typeof l[0]=="number"||l instanceof xe?l=We(l):l=dt(l),l instanceof _e?(h=l.min,x=l.max):h=x=l,h.x>=this.min.x&&x.x<=this.max.x&&h.y>=this.min.y&&x.y<=this.max.y},intersects:function(l){l=dt(l);var h=this.min,x=this.max,E=l.min,k=l.max,N=k.x>=h.x&&E.x<=x.x,ie=k.y>=h.y&&E.y<=x.y;return N&&ie},overlaps:function(l){l=dt(l);var h=this.min,x=this.max,E=l.min,k=l.max,N=k.x>h.x&&E.x<x.x,ie=k.y>h.y&&E.y<x.y;return N&&ie},isValid:function(){return!!(this.min&&this.max)},pad:function(l){var h=this.min,x=this.max,E=Math.abs(h.x-x.x)*l,k=Math.abs(h.y-x.y)*l;return dt(We(h.x-E,h.y-k),We(x.x+E,x.y+k))},equals:function(l){return l?(l=dt(l),this.min.equals(l.getTopLeft())&&this.max.equals(l.getBottomRight())):!1}};function dt(l,h){return!l||l instanceof _e?l:new _e(l,h)}function Wt(l,h){if(l)for(var x=h?[l,h]:l,E=0,k=x.length;E<k;E++)this.extend(x[E])}Wt.prototype={extend:function(l){var h=this._southWest,x=this._northEast,E,k;if(l instanceof kt)E=l,k=l;else if(l instanceof Wt){if(E=l._southWest,k=l._northEast,!E||!k)return this}else return l?this.extend(be(l)||tt(l)):this;return!h&&!x?(this._southWest=new kt(E.lat,E.lng),this._northEast=new kt(k.lat,k.lng)):(h.lat=Math.min(E.lat,h.lat),h.lng=Math.min(E.lng,h.lng),x.lat=Math.max(k.lat,x.lat),x.lng=Math.max(k.lng,x.lng)),this},pad:function(l){var h=this._southWest,x=this._northEast,E=Math.abs(h.lat-x.lat)*l,k=Math.abs(h.lng-x.lng)*l;return new Wt(new kt(h.lat-E,h.lng-k),new kt(x.lat+E,x.lng+k))},getCenter:function(){return new kt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new kt(this.getNorth(),this.getWest())},getSouthEast:function(){return new kt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(l){typeof l[0]=="number"||l instanceof kt||"lat"in l?l=be(l):l=tt(l);var h=this._southWest,x=this._northEast,E,k;return l instanceof Wt?(E=l.getSouthWest(),k=l.getNorthEast()):E=k=l,E.lat>=h.lat&&k.lat<=x.lat&&E.lng>=h.lng&&k.lng<=x.lng},intersects:function(l){l=tt(l);var h=this._southWest,x=this._northEast,E=l.getSouthWest(),k=l.getNorthEast(),N=k.lat>=h.lat&&E.lat<=x.lat,ie=k.lng>=h.lng&&E.lng<=x.lng;return N&&ie},overlaps:function(l){l=tt(l);var h=this._southWest,x=this._northEast,E=l.getSouthWest(),k=l.getNorthEast(),N=k.lat>h.lat&&E.lat<x.lat,ie=k.lng>h.lng&&E.lng<x.lng;return N&&ie},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(l,h){return l?(l=tt(l),this._southWest.equals(l.getSouthWest(),h)&&this._northEast.equals(l.getNorthEast(),h)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function tt(l,h){return l instanceof Wt?l:new Wt(l,h)}function kt(l,h,x){if(isNaN(l)||isNaN(h))throw new Error("Invalid LatLng object: ("+l+", "+h+")");this.lat=+l,this.lng=+h,x!==void 0&&(this.alt=+x)}kt.prototype={equals:function(l,h){if(!l)return!1;l=be(l);var x=Math.max(Math.abs(this.lat-l.lat),Math.abs(this.lng-l.lng));return x<=(h===void 0?1e-9:h)},toString:function(l){return"LatLng("+p(this.lat,l)+", "+p(this.lng,l)+")"},distanceTo:function(l){return ut.distance(this,be(l))},wrap:function(){return ut.wrapLatLng(this)},toBounds:function(l){var h=180*l/40075017,x=h/Math.cos(Math.PI/180*this.lat);return tt([this.lat-h,this.lng-x],[this.lat+h,this.lng+x])},clone:function(){return new kt(this.lat,this.lng,this.alt)}};function be(l,h,x){return l instanceof kt?l:M(l)&&typeof l[0]!="object"?l.length===3?new kt(l[0],l[1],l[2]):l.length===2?new kt(l[0],l[1]):null:l==null?l:typeof l=="object"&&"lat"in l?new kt(l.lat,"lng"in l?l.lng:l.lon,l.alt):h===void 0?null:new kt(l,h,x)}var Rt={latLngToPoint:function(l,h){var x=this.projection.project(l),E=this.scale(h);return this.transformation._transform(x,E)},pointToLatLng:function(l,h){var x=this.scale(h),E=this.transformation.untransform(l,x);return this.projection.unproject(E)},project:function(l){return this.projection.project(l)},unproject:function(l){return this.projection.unproject(l)},scale:function(l){return 256*Math.pow(2,l)},zoom:function(l){return Math.log(l/256)/Math.LN2},getProjectedBounds:function(l){if(this.infinite)return null;var h=this.projection.bounds,x=this.scale(l),E=this.transformation.transform(h.min,x),k=this.transformation.transform(h.max,x);return new _e(E,k)},infinite:!1,wrapLatLng:function(l){var h=this.wrapLng?f(l.lng,this.wrapLng,!0):l.lng,x=this.wrapLat?f(l.lat,this.wrapLat,!0):l.lat,E=l.alt;return new kt(x,h,E)},wrapLatLngBounds:function(l){var h=l.getCenter(),x=this.wrapLatLng(h),E=h.lat-x.lat,k=h.lng-x.lng;if(E===0&&k===0)return l;var N=l.getSouthWest(),ie=l.getNorthEast(),ve=new kt(N.lat-E,N.lng-k),Ce=new kt(ie.lat-E,ie.lng-k);return new Wt(ve,Ce)}},ut=n({},Rt,{wrapLng:[-180,180],R:6371e3,distance:function(l,h){var x=Math.PI/180,E=l.lat*x,k=h.lat*x,N=Math.sin((h.lat-l.lat)*x/2),ie=Math.sin((h.lng-l.lng)*x/2),ve=N*N+Math.cos(E)*Math.cos(k)*ie*ie,Ce=2*Math.atan2(Math.sqrt(ve),Math.sqrt(1-ve));return this.R*Ce}}),at=6378137,Ze={R:at,MAX_LATITUDE:85.0511287798,project:function(l){var h=Math.PI/180,x=this.MAX_LATITUDE,E=Math.max(Math.min(x,l.lat),-x),k=Math.sin(E*h);return new xe(this.R*l.lng*h,this.R*Math.log((1+k)/(1-k))/2)},unproject:function(l){var h=180/Math.PI;return new kt((2*Math.atan(Math.exp(l.y/this.R))-Math.PI/2)*h,l.x*h/this.R)},bounds:(function(){var l=at*Math.PI;return new _e([-l,-l],[l,l])})()};function Pt(l,h,x,E){if(M(l)){this._a=l[0],this._b=l[1],this._c=l[2],this._d=l[3];return}this._a=l,this._b=h,this._c=x,this._d=E}Pt.prototype={transform:function(l,h){return this._transform(l.clone(),h)},_transform:function(l,h){return h=h||1,l.x=h*(this._a*l.x+this._b),l.y=h*(this._c*l.y+this._d),l},untransform:function(l,h){return h=h||1,new xe((l.x/h-this._b)/this._a,(l.y/h-this._d)/this._c)}};function ui(l,h,x,E){return new Pt(l,h,x,E)}var wt=n({},ut,{code:"EPSG:3857",projection:Ze,transformation:(function(){var l=.5/(Math.PI*Ze.R);return ui(l,.5,-l,.5)})()}),Ft=n({},wt,{code:"EPSG:900913"});function Vt(l){return document.createElementNS("http://www.w3.org/2000/svg",l)}function zt(l,h){var x="",E,k,N,ie,ve,Ce;for(E=0,N=l.length;E<N;E++){for(ve=l[E],k=0,ie=ve.length;k<ie;k++)Ce=ve[k],x+=(k?"L":"M")+Ce.x+" "+Ce.y;x+=h?ye.svg?"z":"x":""}return x||"M0 0"}var Zt=document.documentElement.style,mt="ActiveXObject"in window,Mi=mt&&!document.addEventListener,Ri="msLaunchUri"in navigator&&!("documentMode"in document),Di=Ve("webkit"),Ui=Ve("android"),ji=Ve("android 2")||Ve("android 3"),Bi=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),fn=Ui&&Ve("Google")&&Bi<537&&!("AudioNode"in window),an=!!window.opera,Zi=!Ri&&Ve("chrome"),_n=Ve("gecko")&&!Di&&!an&&!mt,gt=!Zi&&Ve("safari"),Yt=Ve("phantom"),Ci="OTransition"in Zt,Wi=navigator.platform.indexOf("Win")===0,Pi=mt&&"transition"in Zt,Ti="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ji,Oi="MozPerspective"in Zt,Qi=!window.L_DISABLE_3D&&(Pi||Ti||Oi)&&!Ci&&!Yt,yi=typeof orientation<"u"||Ve("mobile"),Xe=yi&&Di,St=yi&&Ti,Ai=!window.PointerEvent&&window.MSPointerEvent,ki=!!(window.PointerEvent||Ai),fi="ontouchstart"in window||!!window.TouchEvent,Ii=!window.L_NO_TOUCH&&(fi||ki),X=yi&&an,Ae=yi&&_n,qe=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,nt=(function(){var l=!1;try{var h=Object.defineProperty({},"passive",{get:function(){l=!0}});window.addEventListener("testPassiveEventSupport",g,h),window.removeEventListener("testPassiveEventSupport",g,h)}catch{}return l})(),qt=(function(){return!!document.createElement("canvas").getContext})(),se=!!(document.createElementNS&&Vt("svg").createSVGRect),Ee=!!se&&(function(){var l=document.createElement("div");return l.innerHTML="<svg/>",(l.firstChild&&l.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Le=!se&&(function(){try{var l=document.createElement("div");l.innerHTML='<v:shape adj="1"/>';var h=l.firstChild;return h.style.behavior="url(#default#VML)",h&&typeof h.adj=="object"}catch{return!1}})(),Y=navigator.platform.indexOf("Mac")===0,Oe=navigator.platform.indexOf("Linux")===0;function Ve(l){return navigator.userAgent.toLowerCase().indexOf(l)>=0}var ye={ie:mt,ielt9:Mi,edge:Ri,webkit:Di,android:Ui,android23:ji,androidStock:fn,opera:an,chrome:Zi,gecko:_n,safari:gt,phantom:Yt,opera12:Ci,win:Wi,ie3d:Pi,webkit3d:Ti,gecko3d:Oi,any3d:Qi,mobile:yi,mobileWebkit:Xe,mobileWebkit3d:St,msPointer:Ai,pointer:ki,touch:Ii,touchNative:fi,mobileOpera:X,mobileGecko:Ae,retina:qe,passiveEvents:nt,canvas:qt,svg:se,vml:Le,inlineSvg:Ee,mac:Y,linux:Oe},At=ye.msPointer?"MSPointerDown":"pointerdown",Ot=ye.msPointer?"MSPointerMove":"pointermove",ri=ye.msPointer?"MSPointerUp":"pointerup",oi=ye.msPointer?"MSPointerCancel":"pointercancel",xi={touchstart:At,touchmove:Ot,touchend:ri,touchcancel:oi},Ut={touchstart:ot,touchmove:Ke,touchend:Ke,touchcancel:Ke},mi={},He=!1;function Ye(l,h,x){return h==="touchstart"&&fe(),Ut[h]?(x=Ut[h].bind(this,x),l.addEventListener(xi[h],x,!1),x):(console.warn("wrong event specified:",h),g)}function Qt(l,h,x){if(!xi[h]){console.warn("wrong event specified:",h);return}l.removeEventListener(xi[h],x,!1)}function Gt(l){mi[l.pointerId]=l}function gi(l){mi[l.pointerId]&&(mi[l.pointerId]=l)}function Jt(l){delete mi[l.pointerId]}function fe(){He||(document.addEventListener(At,Gt,!0),document.addEventListener(Ot,gi,!0),document.addEventListener(ri,Jt,!0),document.addEventListener(oi,Jt,!0),He=!0)}function Ke(l,h){if(h.pointerType!==(h.MSPOINTER_TYPE_MOUSE||"mouse")){h.touches=[];for(var x in mi)h.touches.push(mi[x]);h.changedTouches=[h],l(h)}}function ot(l,h){h.MSPOINTER_TYPE_TOUCH&&h.pointerType===h.MSPOINTER_TYPE_TOUCH&&Ji(h),Ke(l,h)}function rt(l){var h={},x,E;for(E in l)x=l[E],h[E]=x&&x.bind?x.bind(l):x;return l=h,h.type="dblclick",h.detail=2,h.isTrusted=!1,h._simulated=!0,h}var ht=200;function _t(l,h){l.addEventListener("dblclick",h);var x=0,E;function k(N){if(N.detail!==1){E=N.detail;return}if(!(N.pointerType==="mouse"||N.sourceCapabilities&&!N.sourceCapabilities.firesTouchEvents)){var ie=Jn(N);if(!(ie.some(function(Ce){return Ce instanceof HTMLLabelElement&&Ce.attributes.for})&&!ie.some(function(Ce){return Ce instanceof HTMLInputElement||Ce instanceof HTMLSelectElement}))){var ve=Date.now();ve-x<=ht?(E++,E===2&&h(rt(N))):E=1,x=ve}}}return l.addEventListener("click",k),{dblclick:h,simDblclick:k}}function Xt(l,h){l.removeEventListener("dblclick",h.dblclick),l.removeEventListener("click",h.simDblclick)}var F=it(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),H=it(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),K=H==="webkitTransition"||H==="OTransition"?H+"End":"transitionend";function le(l){return typeof l=="string"?document.getElementById(l):l}function Z(l,h){var x=l.style[h]||l.currentStyle&&l.currentStyle[h];if((!x||x==="auto")&&document.defaultView){var E=document.defaultView.getComputedStyle(l,null);x=E?E[h]:null}return x==="auto"?null:x}function J(l,h,x){var E=document.createElement(l);return E.className=h||"",x&&x.appendChild(E),E}function ce(l){var h=l.parentNode;h&&h.removeChild(l)}function Qe(l){for(;l.firstChild;)l.removeChild(l.firstChild)}function ae(l){var h=l.parentNode;h&&h.lastChild!==l&&h.appendChild(l)}function pe(l){var h=l.parentNode;h&&h.firstChild!==l&&h.insertBefore(l,h.firstChild)}function Te(l,h){if(l.classList!==void 0)return l.classList.contains(h);var x=G(l);return x.length>0&&new RegExp("(^|\\s)"+h+"(\\s|$)").test(x)}function me(l,h){if(l.classList!==void 0)for(var x=b(h),E=0,k=x.length;E<k;E++)l.classList.add(x[E]);else if(!Te(l,h)){var N=G(l);lt(l,(N?N+" ":"")+h)}}function Ie(l,h){l.classList!==void 0?l.classList.remove(h):lt(l,C((" "+G(l)+" ").replace(" "+h+" "," ")))}function lt(l,h){l.className.baseVal===void 0?l.className=h:l.className.baseVal=h}function G(l){return l.correspondingElement&&(l=l.correspondingElement),l.className.baseVal===void 0?l.className:l.className.baseVal}function re(l,h){"opacity"in l.style?l.style.opacity=h:"filter"in l.style&&Ne(l,h)}function Ne(l,h){var x=!1,E="DXImageTransform.Microsoft.Alpha";try{x=l.filters.item(E)}catch{if(h===1)return}h=Math.round(h*100),x?(x.Enabled=h!==100,x.Opacity=h):l.style.filter+=" progid:"+E+"(opacity="+h+")"}function it(l){for(var h=document.documentElement.style,x=0;x<l.length;x++)if(l[x]in h)return l[x];return!1}function Pe(l,h,x){var E=h||new xe(0,0);l.style[F]=(ye.ie3d?"translate("+E.x+"px,"+E.y+"px)":"translate3d("+E.x+"px,"+E.y+"px,0)")+(x?" scale("+x+")":"")}function ke(l,h){l._leaflet_pos=h,ye.any3d?Pe(l,h):(l.style.left=h.x+"px",l.style.top=h.y+"px")}function bt(l){return l._leaflet_pos||new xe(0,0)}var vt,Fe,Dt;if("onselectstart"in document)vt=function(){pt(window,"selectstart",Ji)},Fe=function(){wi(window,"selectstart",Ji)};else{var Ge=it(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);vt=function(){if(Ge){var l=document.documentElement.style;Dt=l[Ge],l[Ge]="none"}},Fe=function(){Ge&&(document.documentElement.style[Ge]=Dt,Dt=void 0)}}function ze(){pt(window,"dragstart",Ji)}function Je(){wi(window,"dragstart",Ji)}var Ct,$e;function It(l){for(;l.tabIndex===-1;)l=l.parentNode;l.style&&(Me(),Ct=l,$e=l.style.outlineStyle,l.style.outlineStyle="none",pt(window,"keydown",Me))}function Me(){Ct&&(Ct.style.outlineStyle=$e,Ct=void 0,$e=void 0,wi(window,"keydown",Me))}function st(l){do l=l.parentNode;while((!l.offsetWidth||!l.offsetHeight)&&l!==document.body);return l}function Lt(l){var h=l.getBoundingClientRect();return{x:h.width/l.offsetWidth||1,y:h.height/l.offsetHeight||1,boundingClientRect:h}}var Ht={__proto__:null,TRANSFORM:F,TRANSITION:H,TRANSITION_END:K,get:le,getStyle:Z,create:J,remove:ce,empty:Qe,toFront:ae,toBack:pe,hasClass:Te,addClass:me,removeClass:Ie,setClass:lt,getClass:G,setOpacity:re,testProp:it,setTransform:Pe,setPosition:ke,getPosition:bt,get disableTextSelection(){return vt},get enableTextSelection(){return Fe},disableImageDrag:ze,enableImageDrag:Je,preventOutline:It,restoreOutline:Me,getSizedParentNode:st,getScale:Lt};function pt(l,h,x,E){if(h&&typeof h=="object")for(var k in h)Gi(l,k,h[k],x);else{h=b(h);for(var N=0,ie=h.length;N<ie;N++)Gi(l,h[N],x,E)}return this}var vi="_leaflet_events";function wi(l,h,x,E){if(arguments.length===1)qi(l),delete l[vi];else if(h&&typeof h=="object")for(var k in h)Li(l,k,h[k],x);else if(h=b(h),arguments.length===2)qi(l,function(ve){return R(h,ve)!==-1});else for(var N=0,ie=h.length;N<ie;N++)Li(l,h[N],x,E);return this}function qi(l,h){for(var x in l[vi]){var E=x.split(/\d/)[0];(!h||h(E))&&Li(l,E,null,null,x)}}var Fi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Gi(l,h,x,E){var k=h+d(x)+(E?"_"+d(E):"");if(l[vi]&&l[vi][k])return this;var N=function(ve){return x.call(E||l,ve||window.event)},ie=N;!ye.touchNative&&ye.pointer&&h.indexOf("touch")===0?N=Ye(l,h,N):ye.touch&&h==="dblclick"?N=_t(l,N):"addEventListener"in l?h==="touchstart"||h==="touchmove"||h==="wheel"||h==="mousewheel"?l.addEventListener(Fi[h]||h,N,ye.passiveEvents?{passive:!1}:!1):h==="mouseenter"||h==="mouseleave"?(N=function(ve){ve=ve||window.event,kn(l,ve)&&ie(ve)},l.addEventListener(Fi[h],N,!1)):l.addEventListener(h,ie,!1):l.attachEvent("on"+h,N),l[vi]=l[vi]||{},l[vi][k]=N}function Li(l,h,x,E,k){k=k||h+d(x)+(E?"_"+d(E):"");var N=l[vi]&&l[vi][k];if(!N)return this;!ye.touchNative&&ye.pointer&&h.indexOf("touch")===0?Qt(l,h,N):ye.touch&&h==="dblclick"?Xt(l,N):"removeEventListener"in l?l.removeEventListener(Fi[h]||h,N,!1):l.detachEvent("on"+h,N),l[vi][k]=null}function ni(l){return l.stopPropagation?l.stopPropagation():l.originalEvent?l.originalEvent._stopped=!0:l.cancelBubble=!0,this}function ii(l){return Gi(l,"wheel",ni),this}function Xi(l){return pt(l,"mousedown touchstart dblclick contextmenu",ni),l._leaflet_disable_click=!0,this}function Ji(l){return l.preventDefault?l.preventDefault():l.returnValue=!1,this}function Ln(l){return Ji(l),ni(l),this}function Jn(l){if(l.composedPath)return l.composedPath();for(var h=[],x=l.target;x;)h.push(x),x=x.parentNode;return h}function Ss(l,h){if(!h)return new xe(l.clientX,l.clientY);var x=Lt(h),E=x.boundingClientRect;return new xe((l.clientX-E.left)/x.x-h.clientLeft,(l.clientY-E.top)/x.y-h.clientTop)}var as=ye.linux&&ye.chrome?window.devicePixelRatio:ye.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Bs(l){return ye.edge?l.wheelDeltaY/2:l.deltaY&&l.deltaMode===0?-l.deltaY/as:l.deltaY&&l.deltaMode===1?-l.deltaY*20:l.deltaY&&l.deltaMode===2?-l.deltaY*60:l.deltaX||l.deltaZ?0:l.wheelDelta?(l.wheelDeltaY||l.wheelDelta)/2:l.detail&&Math.abs(l.detail)<32765?-l.detail*20:l.detail?l.detail/-32765*60:0}function kn(l,h){var x=h.relatedTarget;if(!x)return!0;try{for(;x&&x!==l;)x=x.parentNode}catch{return!1}return x!==l}var ss={__proto__:null,on:pt,off:wi,stopPropagation:ni,disableScrollPropagation:ii,disableClickPropagation:Xi,preventDefault:Ji,stop:Ln,getPropagationPath:Jn,getMousePosition:Ss,getWheelDelta:Bs,isExternalTarget:kn,addListener:pt,removeListener:wi},ps=Re.extend({run:function(l,h,x,E){this.stop(),this._el=l,this._inProgress=!0,this._duration=x||.25,this._easeOutPower=1/Math.max(E||.5,.2),this._startPos=bt(l),this._offset=h.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=te(this._animate,this),this._step()},_step:function(l){var h=+new Date-this._startTime,x=this._duration*1e3;h<x?this._runFrame(this._easeOut(h/x),l):(this._runFrame(1),this._complete())},_runFrame:function(l,h){var x=this._startPos.add(this._offset.multiplyBy(l));h&&x._round(),ke(this._el,x),this.fire("step")},_complete:function(){he(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(l){return 1-Math.pow(1-l,this._easeOutPower)}}),zi=Re.extend({options:{crs:wt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(l,h){h=y(this,h),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(l),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),h.maxBounds&&this.setMaxBounds(h.maxBounds),h.zoom!==void 0&&(this._zoom=this._limitZoom(h.zoom)),h.center&&h.zoom!==void 0&&this.setView(be(h.center),h.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=H&&ye.any3d&&!ye.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),pt(this._proxy,K,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(l,h,x){if(h=h===void 0?this._zoom:this._limitZoom(h),l=this._limitCenter(be(l),h,this.options.maxBounds),x=x||{},this._stop(),this._loaded&&!x.reset&&x!==!0){x.animate!==void 0&&(x.zoom=n({animate:x.animate},x.zoom),x.pan=n({animate:x.animate,duration:x.duration},x.pan));var E=this._zoom!==h?this._tryAnimatedZoom&&this._tryAnimatedZoom(l,h,x.zoom):this._tryAnimatedPan(l,x.pan);if(E)return clearTimeout(this._sizeTimer),this}return this._resetView(l,h,x.pan&&x.pan.noMoveStart),this},setZoom:function(l,h){return this._loaded?this.setView(this.getCenter(),l,{zoom:h}):(this._zoom=l,this)},zoomIn:function(l,h){return l=l||(ye.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+l,h)},zoomOut:function(l,h){return l=l||(ye.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-l,h)},setZoomAround:function(l,h,x){var E=this.getZoomScale(h),k=this.getSize().divideBy(2),N=l instanceof xe?l:this.latLngToContainerPoint(l),ie=N.subtract(k).multiplyBy(1-1/E),ve=this.containerPointToLatLng(k.add(ie));return this.setView(ve,h,{zoom:x})},_getBoundsCenterZoom:function(l,h){h=h||{},l=l.getBounds?l.getBounds():tt(l);var x=We(h.paddingTopLeft||h.padding||[0,0]),E=We(h.paddingBottomRight||h.padding||[0,0]),k=this.getBoundsZoom(l,!1,x.add(E));if(k=typeof h.maxZoom=="number"?Math.min(h.maxZoom,k):k,k===1/0)return{center:l.getCenter(),zoom:k};var N=E.subtract(x).divideBy(2),ie=this.project(l.getSouthWest(),k),ve=this.project(l.getNorthEast(),k),Ce=this.unproject(ie.add(ve).divideBy(2).add(N),k);return{center:Ce,zoom:k}},fitBounds:function(l,h){if(l=tt(l),!l.isValid())throw new Error("Bounds are not valid.");var x=this._getBoundsCenterZoom(l,h);return this.setView(x.center,x.zoom,h)},fitWorld:function(l){return this.fitBounds([[-90,-180],[90,180]],l)},panTo:function(l,h){return this.setView(l,this._zoom,{pan:h})},panBy:function(l,h){if(l=We(l).round(),h=h||{},!l.x&&!l.y)return this.fire("moveend");if(h.animate!==!0&&!this.getSize().contains(l))return this._resetView(this.unproject(this.project(this.getCenter()).add(l)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ps,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),h.noMoveStart||this.fire("movestart"),h.animate!==!1){me(this._mapPane,"leaflet-pan-anim");var x=this._getMapPanePos().subtract(l).round();this._panAnim.run(this._mapPane,x,h.duration||.25,h.easeLinearity)}else this._rawPanBy(l),this.fire("move").fire("moveend");return this},flyTo:function(l,h,x){if(x=x||{},x.animate===!1||!ye.any3d)return this.setView(l,h,x);this._stop();var E=this.project(this.getCenter()),k=this.project(l),N=this.getSize(),ie=this._zoom;l=be(l),h=h===void 0?ie:h;var ve=Math.max(N.x,N.y),Ce=ve*this.getZoomScale(ie,h),Et=k.distanceTo(E)||1,li=1.42,Ki=li*li;function hi(As){var Jc=As?-1:1,$b=As?Ce:ve,Ub=Ce*Ce-ve*ve+Jc*Ki*Ki*Et*Et,qb=2*$b*Ki*Et,Gb=Ub/qb,wS=Math.sqrt(Gb*Gb+1)-Gb,jF=wS<1e-9?-18:Math.log(wS);return jF}function un(As){return(Math.exp(As)-Math.exp(-As))/2}function In(As){return(Math.exp(As)+Math.exp(-As))/2}function _s(As){return un(As)/In(As)}var Ns=hi(0);function Vr(As){return ve*(In(Ns)/In(Ns+li*As))}function Wb(As){return ve*(In(Ns)*_s(Ns+li*As)-un(Ns))/Ki}function zb(As){return 1-Math.pow(1-As,1.5)}var Vb=Date.now(),cx=(hi(1)-Ns)/li,jb=x.duration?1e3*x.duration:1e3*cx*.8;function rh(){var As=(Date.now()-Vb)/jb,Jc=zb(As)*cx;As<=1?(this._flyToFrame=te(rh,this),this._move(this.unproject(E.add(k.subtract(E).multiplyBy(Wb(Jc)/Et)),ie),this.getScaleZoom(ve/Vr(Jc),ie),{flyTo:!0})):this._move(l,h)._moveEnd(!0)}return this._moveStart(!0,x.noMoveStart),rh.call(this),this},flyToBounds:function(l,h){var x=this._getBoundsCenterZoom(l,h);return this.flyTo(x.center,x.zoom,h)},setMaxBounds:function(l){return l=tt(l),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),l.isValid()?(this.options.maxBounds=l,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(l){var h=this.options.minZoom;return this.options.minZoom=l,this._loaded&&h!==l&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(l):this},setMaxZoom:function(l){var h=this.options.maxZoom;return this.options.maxZoom=l,this._loaded&&h!==l&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(l):this},panInsideBounds:function(l,h){this._enforcingBounds=!0;var x=this.getCenter(),E=this._limitCenter(x,this._zoom,tt(l));return x.equals(E)||this.panTo(E,h),this._enforcingBounds=!1,this},panInside:function(l,h){h=h||{};var x=We(h.paddingTopLeft||h.padding||[0,0]),E=We(h.paddingBottomRight||h.padding||[0,0]),k=this.project(this.getCenter()),N=this.project(l),ie=this.getPixelBounds(),ve=dt([ie.min.add(x),ie.max.subtract(E)]),Ce=ve.getSize();if(!ve.contains(N)){this._enforcingBounds=!0;var Et=N.subtract(ve.getCenter()),li=ve.extend(N).getSize().subtract(Ce);k.x+=Et.x<0?-li.x:li.x,k.y+=Et.y<0?-li.y:li.y,this.panTo(this.unproject(k),h),this._enforcingBounds=!1}return this},invalidateSize:function(l){if(!this._loaded)return this;l=n({animate:!1,pan:!0},l===!0?{animate:!0}:l);var h=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var x=this.getSize(),E=h.divideBy(2).round(),k=x.divideBy(2).round(),N=E.subtract(k);return!N.x&&!N.y?this:(l.animate&&l.pan?this.panBy(N):(l.pan&&this._rawPanBy(N),this.fire("move"),l.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:h,newSize:x}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(l){if(l=this._locateOptions=n({timeout:1e4,watch:!1},l),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var h=r(this._handleGeolocationResponse,this),x=r(this._handleGeolocationError,this);return l.watch?this._locationWatchId=navigator.geolocation.watchPosition(h,x,l):navigator.geolocation.getCurrentPosition(h,x,l),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(l){if(this._container._leaflet_id){var h=l.code,x=l.message||(h===1?"permission denied":h===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:h,message:"Geolocation error: "+x+"."})}},_handleGeolocationResponse:function(l){if(this._container._leaflet_id){var h=l.coords.latitude,x=l.coords.longitude,E=new kt(h,x),k=E.toBounds(l.coords.accuracy*2),N=this._locateOptions;if(N.setView){var ie=this.getBoundsZoom(k);this.setView(E,N.maxZoom?Math.min(ie,N.maxZoom):ie)}var ve={latlng:E,bounds:k,timestamp:l.timestamp};for(var Ce in l.coords)typeof l.coords[Ce]=="number"&&(ve[Ce]=l.coords[Ce]);this.fire("locationfound",ve)}},addHandler:function(l,h){if(!h)return this;var x=this[l]=new h(this);return this._handlers.push(x),this.options[l]&&x.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ce(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(he(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var l;for(l in this._layers)this._layers[l].remove();for(l in this._panes)ce(this._panes[l]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(l,h){var x="leaflet-pane"+(l?" leaflet-"+l.replace("Pane","")+"-pane":""),E=J("div",x,h||this._mapPane);return l&&(this._panes[l]=E),E},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var l=this.getPixelBounds(),h=this.unproject(l.getBottomLeft()),x=this.unproject(l.getTopRight());return new Wt(h,x)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(l,h,x){l=tt(l),x=We(x||[0,0]);var E=this.getZoom()||0,k=this.getMinZoom(),N=this.getMaxZoom(),ie=l.getNorthWest(),ve=l.getSouthEast(),Ce=this.getSize().subtract(x),Et=dt(this.project(ve,E),this.project(ie,E)).getSize(),li=ye.any3d?this.options.zoomSnap:1,Ki=Ce.x/Et.x,hi=Ce.y/Et.y,un=h?Math.max(Ki,hi):Math.min(Ki,hi);return E=this.getScaleZoom(un,E),li&&(E=Math.round(E/(li/100))*(li/100),E=h?Math.ceil(E/li)*li:Math.floor(E/li)*li),Math.max(k,Math.min(N,E))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new xe(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(l,h){var x=this._getTopLeftPoint(l,h);return new _e(x,x.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(l){return this.options.crs.getProjectedBounds(l===void 0?this.getZoom():l)},getPane:function(l){return typeof l=="string"?this._panes[l]:l},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(l,h){var x=this.options.crs;return h=h===void 0?this._zoom:h,x.scale(l)/x.scale(h)},getScaleZoom:function(l,h){var x=this.options.crs;h=h===void 0?this._zoom:h;var E=x.zoom(l*x.scale(h));return isNaN(E)?1/0:E},project:function(l,h){return h=h===void 0?this._zoom:h,this.options.crs.latLngToPoint(be(l),h)},unproject:function(l,h){return h=h===void 0?this._zoom:h,this.options.crs.pointToLatLng(We(l),h)},layerPointToLatLng:function(l){var h=We(l).add(this.getPixelOrigin());return this.unproject(h)},latLngToLayerPoint:function(l){var h=this.project(be(l))._round();return h._subtract(this.getPixelOrigin())},wrapLatLng:function(l){return this.options.crs.wrapLatLng(be(l))},wrapLatLngBounds:function(l){return this.options.crs.wrapLatLngBounds(tt(l))},distance:function(l,h){return this.options.crs.distance(be(l),be(h))},containerPointToLayerPoint:function(l){return We(l).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(l){return We(l).add(this._getMapPanePos())},containerPointToLatLng:function(l){var h=this.containerPointToLayerPoint(We(l));return this.layerPointToLatLng(h)},latLngToContainerPoint:function(l){return this.layerPointToContainerPoint(this.latLngToLayerPoint(be(l)))},mouseEventToContainerPoint:function(l){return Ss(l,this._container)},mouseEventToLayerPoint:function(l){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(l))},mouseEventToLatLng:function(l){return this.layerPointToLatLng(this.mouseEventToLayerPoint(l))},_initContainer:function(l){var h=this._container=le(l);if(h){if(h._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");pt(h,"scroll",this._onScroll,this),this._containerId=d(h)},_initLayout:function(){var l=this._container;this._fadeAnimated=this.options.fadeAnimation&&ye.any3d,me(l,"leaflet-container"+(ye.touch?" leaflet-touch":"")+(ye.retina?" leaflet-retina":"")+(ye.ielt9?" leaflet-oldie":"")+(ye.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var h=Z(l,"position");h!=="absolute"&&h!=="relative"&&h!=="fixed"&&h!=="sticky"&&(l.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var l=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new xe(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(me(l.markerPane,"leaflet-zoom-hide"),me(l.shadowPane,"leaflet-zoom-hide"))},_resetView:function(l,h,x){ke(this._mapPane,new xe(0,0));var E=!this._loaded;this._loaded=!0,h=this._limitZoom(h),this.fire("viewprereset");var k=this._zoom!==h;this._moveStart(k,x)._move(l,h)._moveEnd(k),this.fire("viewreset"),E&&this.fire("load")},_moveStart:function(l,h){return l&&this.fire("zoomstart"),h||this.fire("movestart"),this},_move:function(l,h,x,E){h===void 0&&(h=this._zoom);var k=this._zoom!==h;return this._zoom=h,this._lastCenter=l,this._pixelOrigin=this._getNewPixelOrigin(l),E?x&&x.pinch&&this.fire("zoom",x):((k||x&&x.pinch)&&this.fire("zoom",x),this.fire("move",x)),this},_moveEnd:function(l){return l&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return he(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(l){ke(this._mapPane,this._getMapPanePos().subtract(l))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(l){this._targets={},this._targets[d(this._container)]=this;var h=l?wi:pt;h(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&h(window,"resize",this._onResize,this),ye.any3d&&this.options.transform3DLimit&&(l?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){he(this._resizeRequest),this._resizeRequest=te(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var l=this._getMapPanePos();Math.max(Math.abs(l.x),Math.abs(l.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(l,h){for(var x=[],E,k=h==="mouseout"||h==="mouseover",N=l.target||l.srcElement,ie=!1;N;){if(E=this._targets[d(N)],E&&(h==="click"||h==="preclick")&&this._draggableMoved(E)){ie=!0;break}if(E&&E.listens(h,!0)&&(k&&!kn(N,l)||(x.push(E),k))||N===this._container)break;N=N.parentNode}return!x.length&&!ie&&!k&&this.listens(h,!0)&&(x=[this]),x},_isClickDisabled:function(l){for(;l&&l!==this._container;){if(l._leaflet_disable_click)return!0;l=l.parentNode}},_handleDOMEvent:function(l){var h=l.target||l.srcElement;if(!(!this._loaded||h._leaflet_disable_events||l.type==="click"&&this._isClickDisabled(h))){var x=l.type;x==="mousedown"&&It(h),this._fireDOMEvent(l,x)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(l,h,x){if(l.type==="click"){var E=n({},l);E.type="preclick",this._fireDOMEvent(E,E.type,x)}var k=this._findEventTargets(l,h);if(x){for(var N=[],ie=0;ie<x.length;ie++)x[ie].listens(h,!0)&&N.push(x[ie]);k=N.concat(k)}if(k.length){h==="contextmenu"&&Ji(l);var ve=k[0],Ce={originalEvent:l};if(l.type!=="keypress"&&l.type!=="keydown"&&l.type!=="keyup"){var Et=ve.getLatLng&&(!ve._radius||ve._radius<=10);Ce.containerPoint=Et?this.latLngToContainerPoint(ve.getLatLng()):this.mouseEventToContainerPoint(l),Ce.layerPoint=this.containerPointToLayerPoint(Ce.containerPoint),Ce.latlng=Et?ve.getLatLng():this.layerPointToLatLng(Ce.layerPoint)}for(ie=0;ie<k.length;ie++)if(k[ie].fire(h,Ce,!0),Ce.originalEvent._stopped||k[ie].options.bubblingMouseEvents===!1&&R(this._mouseEvents,h)!==-1)return}},_draggableMoved:function(l){return l=l.dragging&&l.dragging.enabled()?l:this,l.dragging&&l.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var l=0,h=this._handlers.length;l<h;l++)this._handlers[l].disable()},whenReady:function(l,h){return this._loaded?l.call(h||this,{target:this}):this.on("load",l,h),this},_getMapPanePos:function(){return bt(this._mapPane)||new xe(0,0)},_moved:function(){var l=this._getMapPanePos();return l&&!l.equals([0,0])},_getTopLeftPoint:function(l,h){var x=l&&h!==void 0?this._getNewPixelOrigin(l,h):this.getPixelOrigin();return x.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(l,h){var x=this.getSize()._divideBy(2);return this.project(l,h)._subtract(x)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(l,h,x){var E=this._getNewPixelOrigin(x,h);return this.project(l,h)._subtract(E)},_latLngBoundsToNewLayerBounds:function(l,h,x){var E=this._getNewPixelOrigin(x,h);return dt([this.project(l.getSouthWest(),h)._subtract(E),this.project(l.getNorthWest(),h)._subtract(E),this.project(l.getSouthEast(),h)._subtract(E),this.project(l.getNorthEast(),h)._subtract(E)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(l){return this.latLngToLayerPoint(l).subtract(this._getCenterLayerPoint())},_limitCenter:function(l,h,x){if(!x)return l;var E=this.project(l,h),k=this.getSize().divideBy(2),N=new _e(E.subtract(k),E.add(k)),ie=this._getBoundsOffset(N,x,h);return Math.abs(ie.x)<=1&&Math.abs(ie.y)<=1?l:this.unproject(E.add(ie),h)},_limitOffset:function(l,h){if(!h)return l;var x=this.getPixelBounds(),E=new _e(x.min.add(l),x.max.add(l));return l.add(this._getBoundsOffset(E,h))},_getBoundsOffset:function(l,h,x){var E=dt(this.project(h.getNorthEast(),x),this.project(h.getSouthWest(),x)),k=E.min.subtract(l.min),N=E.max.subtract(l.max),ie=this._rebound(k.x,-N.x),ve=this._rebound(k.y,-N.y);return new xe(ie,ve)},_rebound:function(l,h){return l+h>0?Math.round(l-h)/2:Math.max(0,Math.ceil(l))-Math.max(0,Math.floor(h))},_limitZoom:function(l){var h=this.getMinZoom(),x=this.getMaxZoom(),E=ye.any3d?this.options.zoomSnap:1;return E&&(l=Math.round(l/E)*E),Math.max(h,Math.min(x,l))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Ie(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(l,h){var x=this._getCenterOffset(l)._trunc();return(h&&h.animate)!==!0&&!this.getSize().contains(x)?!1:(this.panBy(x,h),!0)},_createAnimProxy:function(){var l=this._proxy=J("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(l),this.on("zoomanim",function(h){var x=F,E=this._proxy.style[x];Pe(this._proxy,this.project(h.center,h.zoom),this.getZoomScale(h.zoom,1)),E===this._proxy.style[x]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ce(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var l=this.getCenter(),h=this.getZoom();Pe(this._proxy,this.project(l,h),this.getZoomScale(h,1))},_catchTransitionEnd:function(l){this._animatingZoom&&l.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(l,h,x){if(this._animatingZoom)return!0;if(x=x||{},!this._zoomAnimated||x.animate===!1||this._nothingToAnimate()||Math.abs(h-this._zoom)>this.options.zoomAnimationThreshold)return!1;var E=this.getZoomScale(h),k=this._getCenterOffset(l)._divideBy(1-1/E);return x.animate!==!0&&!this.getSize().contains(k)?!1:(te(function(){this._moveStart(!0,x.noMoveStart||!1)._animateZoom(l,h,!0)},this),!0)},_animateZoom:function(l,h,x,E){this._mapPane&&(x&&(this._animatingZoom=!0,this._animateToCenter=l,this._animateToZoom=h,me(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:l,zoom:h,noUpdate:E}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Ie(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ys(l,h){return new zi(l,h)}var Pn=oe.extend({options:{position:"topright"},initialize:function(l){y(this,l)},getPosition:function(){return this.options.position},setPosition:function(l){var h=this._map;return h&&h.removeControl(this),this.options.position=l,h&&h.addControl(this),this},getContainer:function(){return this._container},addTo:function(l){this.remove(),this._map=l;var h=this._container=this.onAdd(l),x=this.getPosition(),E=l._controlCorners[x];return me(h,"leaflet-control"),x.indexOf("bottom")!==-1?E.insertBefore(h,E.firstChild):E.appendChild(h),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ce(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(l){this._map&&l&&l.screenX>0&&l.screenY>0&&this._map.getContainer().focus()}}),Vn=function(l){return new Pn(l)};zi.include({addControl:function(l){return l.addTo(this),this},removeControl:function(l){return l.remove(),this},_initControlPos:function(){var l=this._controlCorners={},h="leaflet-",x=this._controlContainer=J("div",h+"control-container",this._container);function E(k,N){var ie=h+k+" "+h+N;l[k+N]=J("div",ie,x)}E("top","left"),E("top","right"),E("bottom","left"),E("bottom","right")},_clearControlPos:function(){for(var l in this._controlCorners)ce(this._controlCorners[l]);ce(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ts=Pn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(l,h,x,E){return x<E?-1:E<x?1:0}},initialize:function(l,h,x){y(this,x),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var E in l)this._addLayer(l[E],E);for(E in h)this._addLayer(h[E],E,!0)},onAdd:function(l){this._initLayout(),this._update(),this._map=l,l.on("zoomend",this._checkDisabledLayers,this);for(var h=0;h<this._layers.length;h++)this._layers[h].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(l){return Pn.prototype.addTo.call(this,l),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(l,h){return this._addLayer(l,h),this._map?this._update():this},addOverlay:function(l,h){return this._addLayer(l,h,!0),this._map?this._update():this},removeLayer:function(l){l.off("add remove",this._onLayerChange,this);var h=this._getLayer(d(l));return h&&this._layers.splice(this._layers.indexOf(h),1),this._map?this._update():this},expand:function(){me(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var l=this._map.getSize().y-(this._container.offsetTop+50);return l<this._section.clientHeight?(me(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=l+"px"):Ie(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Ie(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var l="leaflet-control-layers",h=this._container=J("div",l),x=this.options.collapsed;h.setAttribute("aria-haspopup",!0),Xi(h),ii(h);var E=this._section=J("section",l+"-list");x&&(this._map.on("click",this.collapse,this),pt(h,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var k=this._layersLink=J("a",l+"-toggle",h);k.href="#",k.title="Layers",k.setAttribute("role","button"),pt(k,{keydown:function(N){N.keyCode===13&&this._expandSafely()},click:function(N){Ji(N),this._expandSafely()}},this),x||this.expand(),this._baseLayersList=J("div",l+"-base",E),this._separator=J("div",l+"-separator",E),this._overlaysList=J("div",l+"-overlays",E),h.appendChild(E)},_getLayer:function(l){for(var h=0;h<this._layers.length;h++)if(this._layers[h]&&d(this._layers[h].layer)===l)return this._layers[h]},_addLayer:function(l,h,x){this._map&&l.on("add remove",this._onLayerChange,this),this._layers.push({layer:l,name:h,overlay:x}),this.options.sortLayers&&this._layers.sort(r(function(E,k){return this.options.sortFunction(E.layer,k.layer,E.name,k.name)},this)),this.options.autoZIndex&&l.setZIndex&&(this._lastZIndex++,l.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Qe(this._baseLayersList),Qe(this._overlaysList),this._layerControlInputs=[];var l,h,x,E,k=0;for(x=0;x<this._layers.length;x++)E=this._layers[x],this._addItem(E),h=h||E.overlay,l=l||!E.overlay,k+=E.overlay?0:1;return this.options.hideSingleBase&&(l=l&&k>1,this._baseLayersList.style.display=l?"":"none"),this._separator.style.display=h&&l?"":"none",this},_onLayerChange:function(l){this._handlingClick||this._update();var h=this._getLayer(d(l.target)),x=h.overlay?l.type==="add"?"overlayadd":"overlayremove":l.type==="add"?"baselayerchange":null;x&&this._map.fire(x,h)},_createRadioElement:function(l,h){var x='<input type="radio" class="leaflet-control-layers-selector" name="'+l+'"'+(h?' checked="checked"':"")+"/>",E=document.createElement("div");return E.innerHTML=x,E.firstChild},_addItem:function(l){var h=document.createElement("label"),x=this._map.hasLayer(l.layer),E;l.overlay?(E=document.createElement("input"),E.type="checkbox",E.className="leaflet-control-layers-selector",E.defaultChecked=x):E=this._createRadioElement("leaflet-base-layers_"+d(this),x),this._layerControlInputs.push(E),E.layerId=d(l.layer),pt(E,"click",this._onInputClick,this);var k=document.createElement("span");k.innerHTML=" "+l.name;var N=document.createElement("span");h.appendChild(N),N.appendChild(E),N.appendChild(k);var ie=l.overlay?this._overlaysList:this._baseLayersList;return ie.appendChild(h),this._checkDisabledLayers(),h},_onInputClick:function(){if(!this._preventClick){var l=this._layerControlInputs,h,x,E=[],k=[];this._handlingClick=!0;for(var N=l.length-1;N>=0;N--)h=l[N],x=this._getLayer(h.layerId).layer,h.checked?E.push(x):h.checked||k.push(x);for(N=0;N<k.length;N++)this._map.hasLayer(k[N])&&this._map.removeLayer(k[N]);for(N=0;N<E.length;N++)this._map.hasLayer(E[N])||this._map.addLayer(E[N]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var l=this._layerControlInputs,h,x,E=this._map.getZoom(),k=l.length-1;k>=0;k--)h=l[k],x=this._getLayer(h.layerId).layer,h.disabled=x.options.minZoom!==void 0&&E<x.options.minZoom||x.options.maxZoom!==void 0&&E>x.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var l=this._section;this._preventClick=!0,pt(l,"click",Ji),this.expand();var h=this;setTimeout(function(){wi(l,"click",Ji),h._preventClick=!1})}}),dr=function(l,h,x){return new Ts(l,h,x)},Or=Pn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(l){var h="leaflet-control-zoom",x=J("div",h+" leaflet-bar"),E=this.options;return this._zoomInButton=this._createButton(E.zoomInText,E.zoomInTitle,h+"-in",x,this._zoomIn),this._zoomOutButton=this._createButton(E.zoomOutText,E.zoomOutTitle,h+"-out",x,this._zoomOut),this._updateDisabled(),l.on("zoomend zoomlevelschange",this._updateDisabled,this),x},onRemove:function(l){l.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(l){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(l.shiftKey?3:1))},_zoomOut:function(l){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(l.shiftKey?3:1))},_createButton:function(l,h,x,E,k){var N=J("a",x,E);return N.innerHTML=l,N.href="#",N.title=h,N.setAttribute("role","button"),N.setAttribute("aria-label",h),Xi(N),pt(N,"click",Ln),pt(N,"click",k,this),pt(N,"click",this._refocusOnMap,this),N},_updateDisabled:function(){var l=this._map,h="leaflet-disabled";Ie(this._zoomInButton,h),Ie(this._zoomOutButton,h),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||l._zoom===l.getMinZoom())&&(me(this._zoomOutButton,h),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||l._zoom===l.getMaxZoom())&&(me(this._zoomInButton,h),this._zoomInButton.setAttribute("aria-disabled","true"))}});zi.mergeOptions({zoomControl:!0}),zi.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Or,this.addControl(this.zoomControl))});var Za=function(l){return new Or(l)},Xa=Pn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(l){var h="leaflet-control-scale",x=J("div",h),E=this.options;return this._addScales(E,h+"-line",x),l.on(E.updateWhenIdle?"moveend":"move",this._update,this),l.whenReady(this._update,this),x},onRemove:function(l){l.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(l,h,x){l.metric&&(this._mScale=J("div",h,x)),l.imperial&&(this._iScale=J("div",h,x))},_update:function(){var l=this._map,h=l.getSize().y/2,x=l.distance(l.containerPointToLatLng([0,h]),l.containerPointToLatLng([this.options.maxWidth,h]));this._updateScales(x)},_updateScales:function(l){this.options.metric&&l&&this._updateMetric(l),this.options.imperial&&l&&this._updateImperial(l)},_updateMetric:function(l){var h=this._getRoundNum(l),x=h<1e3?h+" m":h/1e3+" km";this._updateScale(this._mScale,x,h/l)},_updateImperial:function(l){var h=l*3.2808399,x,E,k;h>5280?(x=h/5280,E=this._getRoundNum(x),this._updateScale(this._iScale,E+" mi",E/x)):(k=this._getRoundNum(h),this._updateScale(this._iScale,k+" ft",k/h))},_updateScale:function(l,h,x){l.style.width=Math.round(this.options.maxWidth*x)+"px",l.innerHTML=h},_getRoundNum:function(l){var h=Math.pow(10,(Math.floor(l)+"").length-1),x=l/h;return x=x>=10?10:x>=5?5:x>=3?3:x>=2?2:1,h*x}}),ur=function(l){return new Xa(l)},ga='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Hr=Pn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ye.inlineSvg?ga+" ":"")+"Leaflet</a>"},initialize:function(l){y(this,l),this._attributions={}},onAdd:function(l){l.attributionControl=this,this._container=J("div","leaflet-control-attribution"),Xi(this._container);for(var h in l._layers)l._layers[h].getAttribution&&this.addAttribution(l._layers[h].getAttribution());return this._update(),l.on("layeradd",this._addAttribution,this),this._container},onRemove:function(l){l.off("layeradd",this._addAttribution,this)},_addAttribution:function(l){l.layer.getAttribution&&(this.addAttribution(l.layer.getAttribution()),l.layer.once("remove",function(){this.removeAttribution(l.layer.getAttribution())},this))},setPrefix:function(l){return this.options.prefix=l,this._update(),this},addAttribution:function(l){return l?(this._attributions[l]||(this._attributions[l]=0),this._attributions[l]++,this._update(),this):this},removeAttribution:function(l){return l?(this._attributions[l]&&(this._attributions[l]--,this._update()),this):this},_update:function(){if(this._map){var l=[];for(var h in this._attributions)this._attributions[h]&&l.push(h);var x=[];this.options.prefix&&x.push(this.options.prefix),l.length&&x.push(l.join(", ")),this._container.innerHTML=x.join(' <span aria-hidden="true">|</span> ')}}});zi.mergeOptions({attributionControl:!0}),zi.addInitHook(function(){this.options.attributionControl&&new Hr().addTo(this)});var Fb=function(l){return new Hr(l)};Pn.Layers=Ts,Pn.Zoom=Or,Pn.Scale=Xa,Pn.Attribution=Hr,Vn.layers=dr,Vn.zoom=Za,Vn.scale=ur,Vn.attribution=Fb;var Oo=oe.extend({initialize:function(l){this._map=l},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Oo.addTo=function(l,h){return l.addHandler(h,this),this};var Lb={Events:Se},lf=ye.touch?"touchstart mousedown":"mousedown",Wr=Re.extend({options:{clickTolerance:3},initialize:function(l,h,x,E){y(this,E),this._element=l,this._dragStartTarget=h||l,this._preventOutline=x},enable:function(){this._enabled||(pt(this._dragStartTarget,lf,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Wr._dragging===this&&this.finishDrag(!0),wi(this._dragStartTarget,lf,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(l){if(this._enabled&&(this._moved=!1,!Te(this._element,"leaflet-zoom-anim"))){if(l.touches&&l.touches.length!==1){Wr._dragging===this&&this.finishDrag();return}if(!(Wr._dragging||l.shiftKey||l.which!==1&&l.button!==1&&!l.touches)&&(Wr._dragging=this,this._preventOutline&&It(this._element),ze(),vt(),!this._moving)){this.fire("down");var h=l.touches?l.touches[0]:l,x=st(this._element);this._startPoint=new xe(h.clientX,h.clientY),this._startPos=bt(this._element),this._parentScale=Lt(x);var E=l.type==="mousedown";pt(document,E?"mousemove":"touchmove",this._onMove,this),pt(document,E?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(l){if(this._enabled){if(l.touches&&l.touches.length>1){this._moved=!0;return}var h=l.touches&&l.touches.length===1?l.touches[0]:l,x=new xe(h.clientX,h.clientY)._subtract(this._startPoint);!x.x&&!x.y||Math.abs(x.x)+Math.abs(x.y)<this.options.clickTolerance||(x.x/=this._parentScale.x,x.y/=this._parentScale.y,Ji(l),this._moved||(this.fire("dragstart"),this._moved=!0,me(document.body,"leaflet-dragging"),this._lastTarget=l.target||l.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),me(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(x),this._moving=!0,this._lastEvent=l,this._updatePosition())}},_updatePosition:function(){var l={originalEvent:this._lastEvent};this.fire("predrag",l),ke(this._element,this._newPos),this.fire("drag",l)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(l){Ie(document.body,"leaflet-dragging"),this._lastTarget&&(Ie(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),wi(document,"mousemove touchmove",this._onMove,this),wi(document,"mouseup touchend touchcancel",this._onUp,this),Je(),Fe();var h=this._moved&&this._moving;this._moving=!1,Wr._dragging=!1,h&&this.fire("dragend",{noInertia:l,distance:this._newPos.distanceTo(this._startPos)})}});function cf(l,h,x){var E,k=[1,4,2,8],N,ie,ve,Ce,Et,li,Ki,hi;for(N=0,li=l.length;N<li;N++)l[N]._code=Ya(l[N],h);for(ve=0;ve<4;ve++){for(Ki=k[ve],E=[],N=0,li=l.length,ie=li-1;N<li;ie=N++)Ce=l[N],Et=l[ie],Ce._code&Ki?Et._code&Ki||(hi=Wl(Et,Ce,Ki,h,x),hi._code=Ya(hi,h),E.push(hi)):(Et._code&Ki&&(hi=Wl(Et,Ce,Ki,h,x),hi._code=Ya(hi,h),E.push(hi)),E.push(Ce));l=E}return l}function df(l,h){var x,E,k,N,ie,ve,Ce,Et,li;if(!l||l.length===0)throw new Error("latlngs not passed");Ao(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var Ki=be([0,0]),hi=tt(l),un=hi.getNorthWest().distanceTo(hi.getSouthWest())*hi.getNorthEast().distanceTo(hi.getNorthWest());un<1700&&(Ki=Xu(l));var In=l.length,_s=[];for(x=0;x<In;x++){var Ns=be(l[x]);_s.push(h.project(be([Ns.lat-Ki.lat,Ns.lng-Ki.lng])))}for(ve=Ce=Et=0,x=0,E=In-1;x<In;E=x++)k=_s[x],N=_s[E],ie=k.y*N.x-N.y*k.x,Ce+=(k.x+N.x)*ie,Et+=(k.y+N.y)*ie,ve+=ie*3;ve===0?li=_s[0]:li=[Ce/ve,Et/ve];var Vr=h.unproject(We(li));return be([Vr.lat+Ki.lat,Vr.lng+Ki.lng])}function Xu(l){for(var h=0,x=0,E=0,k=0;k<l.length;k++){var N=be(l[k]);h+=N.lat,x+=N.lng,E++}return be([h/E,x/E])}var Ib={__proto__:null,clipPolygon:cf,polygonCenter:df,centroid:Xu};function uf(l,h){if(!h||!l.length)return l.slice();var x=h*h;return l=Zp(l,x),l=hf(l,x),l}function Gp(l,h,x){return Math.sqrt(Gc(l,h,x,!0))}function Kp(l,h,x){return Gc(l,h,x)}function hf(l,h){var x=l.length,E=typeof Uint8Array<"u"?Uint8Array:Array,k=new E(x);k[0]=k[x-1]=1,Yu(l,k,h,0,x-1);var N,ie=[];for(N=0;N<x;N++)k[N]&&ie.push(l[N]);return ie}function Yu(l,h,x,E,k){var N=0,ie,ve,Ce;for(ve=E+1;ve<=k-1;ve++)Ce=Gc(l[ve],l[E],l[k],!0),Ce>N&&(ie=ve,N=Ce);N>x&&(h[ie]=1,Yu(l,h,x,E,ie),Yu(l,h,x,ie,k))}function Zp(l,h){for(var x=[l[0]],E=1,k=0,N=l.length;E<N;E++)Xp(l[E],l[k])>h&&(x.push(l[E]),k=E);return k<N-1&&x.push(l[N-1]),x}var ff;function gf(l,h,x,E,k){var N=E?ff:Ya(l,x),ie=Ya(h,x),ve,Ce,Et;for(ff=ie;;){if(!(N|ie))return[l,h];if(N&ie)return!1;ve=N||ie,Ce=Wl(l,h,ve,x,k),Et=Ya(Ce,x),ve===N?(l=Ce,N=Et):(h=Ce,ie=Et)}}function Wl(l,h,x,E,k){var N=h.x-l.x,ie=h.y-l.y,ve=E.min,Ce=E.max,Et,li;return x&8?(Et=l.x+N*(Ce.y-l.y)/ie,li=Ce.y):x&4?(Et=l.x+N*(ve.y-l.y)/ie,li=ve.y):x&2?(Et=Ce.x,li=l.y+ie*(Ce.x-l.x)/N):x&1&&(Et=ve.x,li=l.y+ie*(ve.x-l.x)/N),new xe(Et,li,k)}function Ya(l,h){var x=0;return l.x<h.min.x?x|=1:l.x>h.max.x&&(x|=2),l.y<h.min.y?x|=4:l.y>h.max.y&&(x|=8),x}function Xp(l,h){var x=h.x-l.x,E=h.y-l.y;return x*x+E*E}function Gc(l,h,x,E){var k=h.x,N=h.y,ie=x.x-k,ve=x.y-N,Ce=ie*ie+ve*ve,Et;return Ce>0&&(Et=((l.x-k)*ie+(l.y-N)*ve)/Ce,Et>1?(k=x.x,N=x.y):Et>0&&(k+=ie*Et,N+=ve*Et)),ie=l.x-k,ve=l.y-N,E?ie*ie+ve*ve:new xe(k,N)}function Ao(l){return!M(l[0])||typeof l[0][0]!="object"&&typeof l[0][0]<"u"}function Yp(l){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ao(l)}function pf(l,h){var x,E,k,N,ie,ve,Ce,Et;if(!l||l.length===0)throw new Error("latlngs not passed");Ao(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var li=be([0,0]),Ki=tt(l),hi=Ki.getNorthWest().distanceTo(Ki.getSouthWest())*Ki.getNorthEast().distanceTo(Ki.getNorthWest());hi<1700&&(li=Xu(l));var un=l.length,In=[];for(x=0;x<un;x++){var _s=be(l[x]);In.push(h.project(be([_s.lat-li.lat,_s.lng-li.lng])))}for(x=0,E=0;x<un-1;x++)E+=In[x].distanceTo(In[x+1])/2;if(E===0)Et=In[0];else for(x=0,N=0;x<un-1;x++)if(ie=In[x],ve=In[x+1],k=ie.distanceTo(ve),N+=k,N>E){Ce=(N-E)/k,Et=[ve.x-Ce*(ve.x-ie.x),ve.y-Ce*(ve.y-ie.y)];break}var Ns=h.unproject(We(Et));return be([Ns.lat+li.lat,Ns.lng+li.lng])}var Kc={__proto__:null,simplify:uf,pointToSegmentDistance:Gp,closestPointOnSegment:Kp,clipSegment:gf,_getEdgeIntersection:Wl,_getBitCode:Ya,_sqClosestPointOnSegment:Gc,isFlat:Ao,_flat:Yp,polylineCenter:pf},xf={project:function(l){return new xe(l.lng,l.lat)},unproject:function(l){return new kt(l.y,l.x)},bounds:new _e([-180,-90],[180,90])},mf={R:6378137,R_MINOR:6356752314245179e-9,bounds:new _e([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(l){var h=Math.PI/180,x=this.R,E=l.lat*h,k=this.R_MINOR/x,N=Math.sqrt(1-k*k),ie=N*Math.sin(E),ve=Math.tan(Math.PI/4-E/2)/Math.pow((1-ie)/(1+ie),N/2);return E=-x*Math.log(Math.max(ve,1e-10)),new xe(l.lng*h*x,E)},unproject:function(l){for(var h=180/Math.PI,x=this.R,E=this.R_MINOR/x,k=Math.sqrt(1-E*E),N=Math.exp(-l.y/x),ie=Math.PI/2-2*Math.atan(N),ve=0,Ce=.1,Et;ve<15&&Math.abs(Ce)>1e-7;ve++)Et=k*Math.sin(ie),Et=Math.pow((1-Et)/(1+Et),k/2),Ce=Math.PI/2-2*Math.atan(N*Et)-ie,ie+=Ce;return new kt(ie*h,l.x*h/x)}},Pb={__proto__:null,LonLat:xf,Mercator:mf,SphericalMercator:Ze},Qp=n({},ut,{code:"EPSG:3395",projection:mf,transformation:(function(){var l=.5/(Math.PI*mf.R);return ui(l,.5,-l,.5)})()}),Jp=n({},ut,{code:"EPSG:4326",projection:xf,transformation:ui(1/180,1,-1/180,.5)}),ex=n({},Rt,{projection:xf,transformation:ui(1,0,-1,0),scale:function(l){return Math.pow(2,l)},zoom:function(l){return Math.log(l)/Math.LN2},distance:function(l,h){var x=h.lng-l.lng,E=h.lat-l.lat;return Math.sqrt(x*x+E*E)},infinite:!0});Rt.Earth=ut,Rt.EPSG3395=Qp,Rt.EPSG3857=wt,Rt.EPSG900913=Ft,Rt.EPSG4326=Jp,Rt.Simple=ex;var Qo=Re.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(l){return l.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(l){return l&&l.removeLayer(this),this},getPane:function(l){return this._map.getPane(l?this.options[l]||l:this.options.pane)},addInteractiveTarget:function(l){return this._map._targets[d(l)]=this,this},removeInteractiveTarget:function(l){return delete this._map._targets[d(l)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(l){var h=l.target;if(h.hasLayer(this)){if(this._map=h,this._zoomAnimated=h._zoomAnimated,this.getEvents){var x=this.getEvents();h.on(x,this),this.once("remove",function(){h.off(x,this)},this)}this.onAdd(h),this.fire("add"),h.fire("layeradd",{layer:this})}}});zi.include({addLayer:function(l){if(!l._layerAdd)throw new Error("The provided object is not a Layer.");var h=d(l);return this._layers[h]?this:(this._layers[h]=l,l._mapToAdd=this,l.beforeAdd&&l.beforeAdd(this),this.whenReady(l._layerAdd,l),this)},removeLayer:function(l){var h=d(l);return this._layers[h]?(this._loaded&&l.onRemove(this),delete this._layers[h],this._loaded&&(this.fire("layerremove",{layer:l}),l.fire("remove")),l._map=l._mapToAdd=null,this):this},hasLayer:function(l){return d(l)in this._layers},eachLayer:function(l,h){for(var x in this._layers)l.call(h,this._layers[x]);return this},_addLayers:function(l){l=l?M(l)?l:[l]:[];for(var h=0,x=l.length;h<x;h++)this.addLayer(l[h])},_addZoomLimit:function(l){(!isNaN(l.options.maxZoom)||!isNaN(l.options.minZoom))&&(this._zoomBoundLayers[d(l)]=l,this._updateZoomLevels())},_removeZoomLimit:function(l){var h=d(l);this._zoomBoundLayers[h]&&(delete this._zoomBoundLayers[h],this._updateZoomLevels())},_updateZoomLevels:function(){var l=1/0,h=-1/0,x=this._getZoomSpan();for(var E in this._zoomBoundLayers){var k=this._zoomBoundLayers[E].options;l=k.minZoom===void 0?l:Math.min(l,k.minZoom),h=k.maxZoom===void 0?h:Math.max(h,k.maxZoom)}this._layersMaxZoom=h===-1/0?void 0:h,this._layersMinZoom=l===1/0?void 0:l,x!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Qa=Qo.extend({initialize:function(l,h){y(this,h),this._layers={};var x,E;if(l)for(x=0,E=l.length;x<E;x++)this.addLayer(l[x])},addLayer:function(l){var h=this.getLayerId(l);return this._layers[h]=l,this._map&&this._map.addLayer(l),this},removeLayer:function(l){var h=l in this._layers?l:this.getLayerId(l);return this._map&&this._layers[h]&&this._map.removeLayer(this._layers[h]),delete this._layers[h],this},hasLayer:function(l){var h=typeof l=="number"?l:this.getLayerId(l);return h in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(l){var h=Array.prototype.slice.call(arguments,1),x,E;for(x in this._layers)E=this._layers[x],E[l]&&E[l].apply(E,h);return this},onAdd:function(l){this.eachLayer(l.addLayer,l)},onRemove:function(l){this.eachLayer(l.removeLayer,l)},eachLayer:function(l,h){for(var x in this._layers)l.call(h,this._layers[x]);return this},getLayer:function(l){return this._layers[l]},getLayers:function(){var l=[];return this.eachLayer(l.push,l),l},setZIndex:function(l){return this.invoke("setZIndex",l)},getLayerId:function(l){return d(l)}}),tx=function(l,h){return new Qa(l,h)},zr=Qa.extend({addLayer:function(l){return this.hasLayer(l)?this:(l.addEventParent(this),Qa.prototype.addLayer.call(this,l),this.fire("layeradd",{layer:l}))},removeLayer:function(l){return this.hasLayer(l)?(l in this._layers&&(l=this._layers[l]),l.removeEventParent(this),Qa.prototype.removeLayer.call(this,l),this.fire("layerremove",{layer:l})):this},setStyle:function(l){return this.invoke("setStyle",l)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var l=new Wt;for(var h in this._layers){var x=this._layers[h];l.extend(x.getBounds?x.getBounds():x.getLatLng())}return l}}),ix=function(l,h){return new zr(l,h)},zl=oe.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(l){y(this,l)},createIcon:function(l){return this._createIcon("icon",l)},createShadow:function(l){return this._createIcon("shadow",l)},_createIcon:function(l,h){var x=this._getIconUrl(l);if(!x){if(l==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var E=this._createImg(x,h&&h.tagName==="IMG"?h:null);return this._setIconStyles(E,l),(this.options.crossOrigin||this.options.crossOrigin==="")&&(E.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),E},_setIconStyles:function(l,h){var x=this.options,E=x[h+"Size"];typeof E=="number"&&(E=[E,E]);var k=We(E),N=We(h==="shadow"&&x.shadowAnchor||x.iconAnchor||k&&k.divideBy(2,!0));l.className="leaflet-marker-"+h+" "+(x.className||""),N&&(l.style.marginLeft=-N.x+"px",l.style.marginTop=-N.y+"px"),k&&(l.style.width=k.x+"px",l.style.height=k.y+"px")},_createImg:function(l,h){return h=h||document.createElement("img"),h.src=l,h},_getIconUrl:function(l){return ye.retina&&this.options[l+"RetinaUrl"]||this.options[l+"Url"]}});function nx(l){return new zl(l)}var Vl=zl.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(l){return typeof Vl.imagePath!="string"&&(Vl.imagePath=this._detectIconPath()),(this.options.imagePath||Vl.imagePath)+zl.prototype._getIconUrl.call(this,l)},_stripUrl:function(l){var h=function(x,E,k){var N=E.exec(x);return N&&N[k]};return l=h(l,/^url\((['"])?(.+)\1\)$/,2),l&&h(l,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var l=J("div","leaflet-default-icon-path",document.body),h=Z(l,"background-image")||Z(l,"backgroundImage");if(document.body.removeChild(l),h=this._stripUrl(h),h)return h;var x=document.querySelector('link[href$="leaflet.css"]');return x?x.href.substring(0,x.href.length-11-1):""}}),Zc=Oo.extend({initialize:function(l){this._marker=l},addHooks:function(){var l=this._marker._icon;this._draggable||(this._draggable=new Wr(l,l,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),me(l,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Ie(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(l){var h=this._marker,x=h._map,E=this._marker.options.autoPanSpeed,k=this._marker.options.autoPanPadding,N=bt(h._icon),ie=x.getPixelBounds(),ve=x.getPixelOrigin(),Ce=dt(ie.min._subtract(ve).add(k),ie.max._subtract(ve).subtract(k));if(!Ce.contains(N)){var Et=We((Math.max(Ce.max.x,N.x)-Ce.max.x)/(ie.max.x-Ce.max.x)-(Math.min(Ce.min.x,N.x)-Ce.min.x)/(ie.min.x-Ce.min.x),(Math.max(Ce.max.y,N.y)-Ce.max.y)/(ie.max.y-Ce.max.y)-(Math.min(Ce.min.y,N.y)-Ce.min.y)/(ie.min.y-Ce.min.y)).multiplyBy(E);x.panBy(Et,{animate:!1}),this._draggable._newPos._add(Et),this._draggable._startPos._add(Et),ke(h._icon,this._draggable._newPos),this._onDrag(l),this._panRequest=te(this._adjustPan.bind(this,l))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(l){this._marker.options.autoPan&&(he(this._panRequest),this._panRequest=te(this._adjustPan.bind(this,l)))},_onDrag:function(l){var h=this._marker,x=h._shadow,E=bt(h._icon),k=h._map.layerPointToLatLng(E);x&&ke(x,E),h._latlng=k,l.latlng=k,l.oldLatLng=this._oldLatLng,h.fire("move",l).fire("drag",l)},_onDragEnd:function(l){he(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",l)}}),Qu=Qo.extend({options:{icon:new Vl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(l,h){y(this,h),this._latlng=be(l)},onAdd:function(l){this._zoomAnimated=this._zoomAnimated&&l.options.markerZoomAnimation,this._zoomAnimated&&l.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(l){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&l.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(l){var h=this._latlng;return this._latlng=be(l),this.update(),this.fire("move",{oldLatLng:h,latlng:this._latlng})},setZIndexOffset:function(l){return this.options.zIndexOffset=l,this.update()},getIcon:function(){return this.options.icon},setIcon:function(l){return this.options.icon=l,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var l=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(l)}return this},_initIcon:function(){var l=this.options,h="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),x=l.icon.createIcon(this._icon),E=!1;x!==this._icon&&(this._icon&&this._removeIcon(),E=!0,l.title&&(x.title=l.title),x.tagName==="IMG"&&(x.alt=l.alt||"")),me(x,h),l.keyboard&&(x.tabIndex="0",x.setAttribute("role","button")),this._icon=x,l.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&pt(x,"focus",this._panOnFocus,this);var k=l.icon.createShadow(this._shadow),N=!1;k!==this._shadow&&(this._removeShadow(),N=!0),k&&(me(k,h),k.alt=""),this._shadow=k,l.opacity<1&&this._updateOpacity(),E&&this.getPane().appendChild(this._icon),this._initInteraction(),k&&N&&this.getPane(l.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&wi(this._icon,"focus",this._panOnFocus,this),ce(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ce(this._shadow),this._shadow=null},_setPos:function(l){this._icon&&ke(this._icon,l),this._shadow&&ke(this._shadow,l),this._zIndex=l.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(l){this._icon&&(this._icon.style.zIndex=this._zIndex+l)},_animateZoom:function(l){var h=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center).round();this._setPos(h)},_initInteraction:function(){if(this.options.interactive&&(me(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Zc)){var l=this.options.draggable;this.dragging&&(l=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Zc(this),l&&this.dragging.enable()}},setOpacity:function(l){return this.options.opacity=l,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var l=this.options.opacity;this._icon&&re(this._icon,l),this._shadow&&re(this._shadow,l)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var l=this._map;if(l){var h=this.options.icon.options,x=h.iconSize?We(h.iconSize):We(0,0),E=h.iconAnchor?We(h.iconAnchor):We(0,0);l.panInside(this._latlng,{paddingTopLeft:E,paddingBottomRight:x.subtract(E)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function sx(l,h){return new Qu(l,h)}var pa=Qo.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(l){this._renderer=l.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(l){return y(this,l),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&l&&Object.prototype.hasOwnProperty.call(l,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ju=pa.extend({options:{fill:!0,radius:10},initialize:function(l,h){y(this,h),this._latlng=be(l),this._radius=this.options.radius},setLatLng:function(l){var h=this._latlng;return this._latlng=be(l),this.redraw(),this.fire("move",{oldLatLng:h,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(l){return this.options.radius=this._radius=l,this.redraw()},getRadius:function(){return this._radius},setStyle:function(l){var h=l&&l.radius||this._radius;return pa.prototype.setStyle.call(this,l),this.setRadius(h),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var l=this._radius,h=this._radiusY||l,x=this._clickTolerance(),E=[l+x,h+x];this._pxBounds=new _e(this._point.subtract(E),this._point.add(E))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(l){return l.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ox(l,h){return new Ju(l,h)}var vf=Ju.extend({initialize:function(l,h,x){if(typeof h=="number"&&(h=n({},x,{radius:h})),y(this,h),this._latlng=be(l),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(l){return this._mRadius=l,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var l=[this._radius,this._radiusY||this._radius];return new Wt(this._map.layerPointToLatLng(this._point.subtract(l)),this._map.layerPointToLatLng(this._point.add(l)))},setStyle:pa.prototype.setStyle,_project:function(){var l=this._latlng.lng,h=this._latlng.lat,x=this._map,E=x.options.crs;if(E.distance===ut.distance){var k=Math.PI/180,N=this._mRadius/ut.R/k,ie=x.project([h+N,l]),ve=x.project([h-N,l]),Ce=ie.add(ve).divideBy(2),Et=x.unproject(Ce).lat,li=Math.acos((Math.cos(N*k)-Math.sin(h*k)*Math.sin(Et*k))/(Math.cos(h*k)*Math.cos(Et*k)))/k;(isNaN(li)||li===0)&&(li=N/Math.cos(Math.PI/180*h)),this._point=Ce.subtract(x.getPixelOrigin()),this._radius=isNaN(li)?0:Ce.x-x.project([Et,l-li]).x,this._radiusY=Ce.y-ie.y}else{var Ki=E.unproject(E.project(this._latlng).subtract([this._mRadius,0]));this._point=x.latLngToLayerPoint(this._latlng),this._radius=this._point.x-x.latLngToLayerPoint(Ki).x}this._updateBounds()}});function _f(l,h,x){return new vf(l,h,x)}var hr=pa.extend({options:{smoothFactor:1,noClip:!1},initialize:function(l,h){y(this,h),this._setLatLngs(l)},getLatLngs:function(){return this._latlngs},setLatLngs:function(l){return this._setLatLngs(l),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(l){for(var h=1/0,x=null,E=Gc,k,N,ie=0,ve=this._parts.length;ie<ve;ie++)for(var Ce=this._parts[ie],Et=1,li=Ce.length;Et<li;Et++){k=Ce[Et-1],N=Ce[Et];var Ki=E(l,k,N,!0);Ki<h&&(h=Ki,x=E(l,k,N))}return x&&(x.distance=Math.sqrt(h)),x},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return pf(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(l,h){return h=h||this._defaultShape(),l=be(l),h.push(l),this._bounds.extend(l),this.redraw()},_setLatLngs:function(l){this._bounds=new Wt,this._latlngs=this._convertLatLngs(l)},_defaultShape:function(){return Ao(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(l){for(var h=[],x=Ao(l),E=0,k=l.length;E<k;E++)x?(h[E]=be(l[E]),this._bounds.extend(h[E])):h[E]=this._convertLatLngs(l[E]);return h},_project:function(){var l=new _e;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,l),this._bounds.isValid()&&l.isValid()&&(this._rawPxBounds=l,this._updateBounds())},_updateBounds:function(){var l=this._clickTolerance(),h=new xe(l,l);this._rawPxBounds&&(this._pxBounds=new _e([this._rawPxBounds.min.subtract(h),this._rawPxBounds.max.add(h)]))},_projectLatlngs:function(l,h,x){var E=l[0]instanceof kt,k=l.length,N,ie;if(E){for(ie=[],N=0;N<k;N++)ie[N]=this._map.latLngToLayerPoint(l[N]),x.extend(ie[N]);h.push(ie)}else for(N=0;N<k;N++)this._projectLatlngs(l[N],h,x)},_clipPoints:function(){var l=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}var h=this._parts,x,E,k,N,ie,ve,Ce;for(x=0,k=0,N=this._rings.length;x<N;x++)for(Ce=this._rings[x],E=0,ie=Ce.length;E<ie-1;E++)ve=gf(Ce[E],Ce[E+1],l,E,!0),ve&&(h[k]=h[k]||[],h[k].push(ve[0]),(ve[1]!==Ce[E+1]||E===ie-2)&&(h[k].push(ve[1]),k++))}},_simplifyPoints:function(){for(var l=this._parts,h=this.options.smoothFactor,x=0,E=l.length;x<E;x++)l[x]=uf(l[x],h)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(l,h){var x,E,k,N,ie,ve,Ce=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(x=0,N=this._parts.length;x<N;x++)for(ve=this._parts[x],E=0,ie=ve.length,k=ie-1;E<ie;k=E++)if(!(!h&&E===0)&&Gp(l,ve[k],ve[E])<=Ce)return!0;return!1}});function Tb(l,h){return new hr(l,h)}hr._flat=Yp;var Ja=hr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return df(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(l){var h=hr.prototype._convertLatLngs.call(this,l),x=h.length;return x>=2&&h[0]instanceof kt&&h[0].equals(h[x-1])&&h.pop(),h},_setLatLngs:function(l){hr.prototype._setLatLngs.call(this,l),Ao(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ao(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var l=this._renderer._bounds,h=this.options.weight,x=new xe(h,h);if(l=new _e(l.min.subtract(x),l.max.add(x)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}for(var E=0,k=this._rings.length,N;E<k;E++)N=cf(this._rings[E],l,!0),N.length&&this._parts.push(N)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(l){var h=!1,x,E,k,N,ie,ve,Ce,Et;if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(N=0,Ce=this._parts.length;N<Ce;N++)for(x=this._parts[N],ie=0,Et=x.length,ve=Et-1;ie<Et;ve=ie++)E=x[ie],k=x[ve],E.y>l.y!=k.y>l.y&&l.x<(k.x-E.x)*(l.y-E.y)/(k.y-E.y)+E.x&&(h=!h);return h||hr.prototype._containsPoint.call(this,l,!0)}});function rx(l,h){return new Ja(l,h)}var fr=zr.extend({initialize:function(l,h){y(this,h),this._layers={},l&&this.addData(l)},addData:function(l){var h=M(l)?l:l.features,x,E,k;if(h){for(x=0,E=h.length;x<E;x++)k=h[x],(k.geometries||k.geometry||k.features||k.coordinates)&&this.addData(k);return this}var N=this.options;if(N.filter&&!N.filter(l))return this;var ie=Xc(l,N);return ie?(ie.feature=Yc(l),ie.defaultOptions=ie.options,this.resetStyle(ie),N.onEachFeature&&N.onEachFeature(l,ie),this.addLayer(ie)):this},resetStyle:function(l){return l===void 0?this.eachLayer(this.resetStyle,this):(l.options=n({},l.defaultOptions),this._setLayerStyle(l,this.options.style),this)},setStyle:function(l){return this.eachLayer(function(h){this._setLayerStyle(h,l)},this)},_setLayerStyle:function(l,h){l.setStyle&&(typeof h=="function"&&(h=h(l.feature)),l.setStyle(h))}});function Xc(l,h){var x=l.type==="Feature"?l.geometry:l,E=x?x.coordinates:null,k=[],N=h&&h.pointToLayer,ie=h&&h.coordsToLatLng||eh,ve,Ce,Et,li;if(!E&&!x)return null;switch(x.type){case"Point":return ve=ie(E),ax(N,l,ve,h);case"MultiPoint":for(Et=0,li=E.length;Et<li;Et++)ve=ie(E[Et]),k.push(ax(N,l,ve,h));return new zr(k);case"LineString":case"MultiLineString":return Ce=th(E,x.type==="LineString"?0:1,ie),new hr(Ce,h);case"Polygon":case"MultiPolygon":return Ce=th(E,x.type==="Polygon"?1:2,ie),new Ja(Ce,h);case"GeometryCollection":for(Et=0,li=x.geometries.length;Et<li;Et++){var Ki=Xc({geometry:x.geometries[Et],type:"Feature",properties:l.properties},h);Ki&&k.push(Ki)}return new zr(k);case"FeatureCollection":for(Et=0,li=x.features.length;Et<li;Et++){var hi=Xc(x.features[Et],h);hi&&k.push(hi)}return new zr(k);default:throw new Error("Invalid GeoJSON object.")}}function ax(l,h,x,E){return l?l(h,x):new Qu(x,E&&E.markersInheritOptions&&E)}function eh(l){return new kt(l[1],l[0],l[2])}function th(l,h,x){for(var E=[],k=0,N=l.length,ie;k<N;k++)ie=h?th(l[k],h-1,x):(x||eh)(l[k]),E.push(ie);return E}function bf(l,h){return l=be(l),l.alt!==void 0?[p(l.lng,h),p(l.lat,h),p(l.alt,h)]:[p(l.lng,h),p(l.lat,h)]}function ih(l,h,x,E){for(var k=[],N=0,ie=l.length;N<ie;N++)k.push(h?ih(l[N],Ao(l[N])?0:h-1,x,E):bf(l[N],E));return!h&&x&&k.length>0&&k.push(k[0].slice()),k}function xa(l,h){return l.feature?n({},l.feature,{geometry:h}):Yc(h)}function Yc(l){return l.type==="Feature"||l.type==="FeatureCollection"?l:{type:"Feature",properties:{},geometry:l}}var nh={toGeoJSON:function(l){return xa(this,{type:"Point",coordinates:bf(this.getLatLng(),l)})}};Qu.include(nh),vf.include(nh),Ju.include(nh),hr.include({toGeoJSON:function(l){var h=!Ao(this._latlngs),x=ih(this._latlngs,h?1:0,!1,l);return xa(this,{type:(h?"Multi":"")+"LineString",coordinates:x})}}),Ja.include({toGeoJSON:function(l){var h=!Ao(this._latlngs),x=h&&!Ao(this._latlngs[0]),E=ih(this._latlngs,x?2:h?1:0,!0,l);return h||(E=[E]),xa(this,{type:(x?"Multi":"")+"Polygon",coordinates:E})}}),Qa.include({toMultiPoint:function(l){var h=[];return this.eachLayer(function(x){h.push(x.toGeoJSON(l).geometry.coordinates)}),xa(this,{type:"MultiPoint",coordinates:h})},toGeoJSON:function(l){var h=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(h==="MultiPoint")return this.toMultiPoint(l);var x=h==="GeometryCollection",E=[];return this.eachLayer(function(k){if(k.toGeoJSON){var N=k.toGeoJSON(l);if(x)E.push(N.geometry);else{var ie=Yc(N);ie.type==="FeatureCollection"?E.push.apply(E,ie.features):E.push(ie)}}}),x?xa(this,{geometries:E,type:"GeometryCollection"}):{type:"FeatureCollection",features:E}}});function Cf(l,h){return new fr(l,h)}var Mb=Cf,Qc=Qo.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(l,h,x){this._url=l,this._bounds=tt(h),y(this,x)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(me(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ce(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(l){return this.options.opacity=l,this._image&&this._updateOpacity(),this},setStyle:function(l){return l.opacity&&this.setOpacity(l.opacity),this},bringToFront:function(){return this._map&&ae(this._image),this},bringToBack:function(){return this._map&&pe(this._image),this},setUrl:function(l){return this._url=l,this._image&&(this._image.src=l),this},setBounds:function(l){return this._bounds=tt(l),this._map&&this._reset(),this},getEvents:function(){var l={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var l=this._url.tagName==="IMG",h=this._image=l?this._url:J("img");if(me(h,"leaflet-image-layer"),this._zoomAnimated&&me(h,"leaflet-zoom-animated"),this.options.className&&me(h,this.options.className),h.onselectstart=g,h.onmousemove=g,h.onload=r(this.fire,this,"load"),h.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),l){this._url=h.src;return}h.src=this._url,h.alt=this.options.alt},_animateZoom:function(l){var h=this._map.getZoomScale(l.zoom),x=this._map._latLngBoundsToNewLayerBounds(this._bounds,l.zoom,l.center).min;Pe(this._image,x,h)},_reset:function(){var l=this._image,h=new _e(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),x=h.getSize();ke(l,h.min),l.style.width=x.x+"px",l.style.height=x.y+"px"},_updateOpacity:function(){re(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var l=this.options.errorOverlayUrl;l&&this._url!==l&&(this._url=l,this._image.src=l)},getCenter:function(){return this._bounds.getCenter()}}),Ef=function(l,h,x){return new Qc(l,h,x)},yf=Qc.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var l=this._url.tagName==="VIDEO",h=this._image=l?this._url:J("video");if(me(h,"leaflet-image-layer"),this._zoomAnimated&&me(h,"leaflet-zoom-animated"),this.options.className&&me(h,this.options.className),h.onselectstart=g,h.onmousemove=g,h.onloadeddata=r(this.fire,this,"load"),l){for(var x=h.getElementsByTagName("source"),E=[],k=0;k<x.length;k++)E.push(x[k].src);this._url=x.length>0?E:[h.src];return}M(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(h.style,"objectFit")&&(h.style.objectFit="fill"),h.autoplay=!!this.options.autoplay,h.loop=!!this.options.loop,h.muted=!!this.options.muted,h.playsInline=!!this.options.playsInline;for(var N=0;N<this._url.length;N++){var ie=J("source");ie.src=this._url[N],h.appendChild(ie)}}});function Rb(l,h,x){return new yf(l,h,x)}var lx=Qc.extend({_initImage:function(){var l=this._image=this._url;me(l,"leaflet-image-layer"),this._zoomAnimated&&me(l,"leaflet-zoom-animated"),this.options.className&&me(l,this.options.className),l.onselectstart=g,l.onmousemove=g}});function Nb(l,h,x){return new lx(l,h,x)}var gr=Qo.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(l,h){l&&(l instanceof kt||M(l))?(this._latlng=be(l),y(this,h)):(y(this,l),this._source=h),this.options.content&&(this._content=this.options.content)},openOn:function(l){return l=arguments.length?l:this._source._map,l.hasLayer(this)||l.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(l){return this._map?this.close():(arguments.length?this._source=l:l=this._source,this._prepareOpen(),this.openOn(l._map)),this},onAdd:function(l){this._zoomAnimated=l._zoomAnimated,this._container||this._initLayout(),l._fadeAnimated&&re(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),l._fadeAnimated&&re(this._container,1),this.bringToFront(),this.options.interactive&&(me(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(l){l._fadeAnimated?(re(this._container,0),this._removeTimeout=setTimeout(r(ce,void 0,this._container),200)):ce(this._container),this.options.interactive&&(Ie(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(l){return this._latlng=be(l),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(l){return this._content=l,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var l={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ae(this._container),this},bringToBack:function(){return this._map&&pe(this._container),this},_prepareOpen:function(l){var h=this._source;if(!h._map)return!1;if(h instanceof zr){h=null;var x=this._source._layers;for(var E in x)if(x[E]._map){h=x[E];break}if(!h)return!1;this._source=h}if(!l)if(h.getCenter)l=h.getCenter();else if(h.getLatLng)l=h.getLatLng();else if(h.getBounds)l=h.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(l),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var l=this._contentNode,h=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof h=="string")l.innerHTML=h;else{for(;l.hasChildNodes();)l.removeChild(l.firstChild);l.appendChild(h)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var l=this._map.latLngToLayerPoint(this._latlng),h=We(this.options.offset),x=this._getAnchor();this._zoomAnimated?ke(this._container,l.add(x)):h=h.add(l).add(x);var E=this._containerBottom=-h.y,k=this._containerLeft=-Math.round(this._containerWidth/2)+h.x;this._container.style.bottom=E+"px",this._container.style.left=k+"px"}},_getAnchor:function(){return[0,0]}});zi.include({_initOverlay:function(l,h,x,E){var k=h;return k instanceof l||(k=new l(E).setContent(h)),x&&k.setLatLng(x),k}}),Qo.include({_initOverlay:function(l,h,x,E){var k=x;return k instanceof l?(y(k,E),k._source=this):(k=h&&!E?h:new l(E,this),k.setContent(x)),k}});var sh=gr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(l){return l=arguments.length?l:this._source._map,!l.hasLayer(this)&&l._popup&&l._popup.options.autoClose&&l.removeLayer(l._popup),l._popup=this,gr.prototype.openOn.call(this,l)},onAdd:function(l){gr.prototype.onAdd.call(this,l),l.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof pa||this._source.on("preclick",ni))},onRemove:function(l){gr.prototype.onRemove.call(this,l),l.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof pa||this._source.off("preclick",ni))},getEvents:function(){var l=gr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(l.preclick=this.close),this.options.keepInView&&(l.moveend=this._adjustPan),l},_initLayout:function(){var l="leaflet-popup",h=this._container=J("div",l+" "+(this.options.className||"")+" leaflet-zoom-animated"),x=this._wrapper=J("div",l+"-content-wrapper",h);if(this._contentNode=J("div",l+"-content",x),Xi(h),ii(this._contentNode),pt(h,"contextmenu",ni),this._tipContainer=J("div",l+"-tip-container",h),this._tip=J("div",l+"-tip",this._tipContainer),this.options.closeButton){var E=this._closeButton=J("a",l+"-close-button",h);E.setAttribute("role","button"),E.setAttribute("aria-label","Close popup"),E.href="#close",E.innerHTML='<span aria-hidden="true">&#215;</span>',pt(E,"click",function(k){Ji(k),this.close()},this)}},_updateLayout:function(){var l=this._contentNode,h=l.style;h.width="",h.whiteSpace="nowrap";var x=l.offsetWidth;x=Math.min(x,this.options.maxWidth),x=Math.max(x,this.options.minWidth),h.width=x+1+"px",h.whiteSpace="",h.height="";var E=l.offsetHeight,k=this.options.maxHeight,N="leaflet-popup-scrolled";k&&E>k?(h.height=k+"px",me(l,N)):Ie(l,N),this._containerWidth=this._container.offsetWidth},_animateZoom:function(l){var h=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center),x=this._getAnchor();ke(this._container,h.add(x))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var l=this._map,h=parseInt(Z(this._container,"marginBottom"),10)||0,x=this._container.offsetHeight+h,E=this._containerWidth,k=new xe(this._containerLeft,-x-this._containerBottom);k._add(bt(this._container));var N=l.layerPointToContainerPoint(k),ie=We(this.options.autoPanPadding),ve=We(this.options.autoPanPaddingTopLeft||ie),Ce=We(this.options.autoPanPaddingBottomRight||ie),Et=l.getSize(),li=0,Ki=0;N.x+E+Ce.x>Et.x&&(li=N.x+E-Et.x+Ce.x),N.x-li-ve.x<0&&(li=N.x-ve.x),N.y+x+Ce.y>Et.y&&(Ki=N.y+x-Et.y+Ce.y),N.y-Ki-ve.y<0&&(Ki=N.y-ve.y),(li||Ki)&&(this.options.keepInView&&(this._autopanning=!0),l.fire("autopanstart").panBy([li,Ki]))}},_getAnchor:function(){return We(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ob=function(l,h){return new sh(l,h)};zi.mergeOptions({closePopupOnClick:!0}),zi.include({openPopup:function(l,h,x){return this._initOverlay(sh,l,h,x).openOn(this),this},closePopup:function(l){return l=arguments.length?l:this._popup,l&&l.close(),this}}),Qo.include({bindPopup:function(l,h){return this._popup=this._initOverlay(sh,this._popup,l,h),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(l){return this._popup&&(this instanceof zr||(this._popup._source=this),this._popup._prepareOpen(l||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(l){return this._popup&&this._popup.setContent(l),this},getPopup:function(){return this._popup},_openPopup:function(l){if(!(!this._popup||!this._map)){Ln(l);var h=l.layer||l.target;if(this._popup._source===h&&!(h instanceof pa)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(l.latlng);return}this._popup._source=h,this.openPopup(l.latlng)}},_movePopup:function(l){this._popup.setLatLng(l.latlng)},_onKeyPress:function(l){l.originalEvent.keyCode===13&&this._openPopup(l)}});var oh=gr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(l){gr.prototype.onAdd.call(this,l),this.setOpacity(this.options.opacity),l.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(l){gr.prototype.onRemove.call(this,l),l.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var l=gr.prototype.getEvents.call(this);return this.options.permanent||(l.preclick=this.close),l},_initLayout:function(){var l="leaflet-tooltip",h=l+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=J("div",h),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+d(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(l){var h,x,E=this._map,k=this._container,N=E.latLngToContainerPoint(E.getCenter()),ie=E.layerPointToContainerPoint(l),ve=this.options.direction,Ce=k.offsetWidth,Et=k.offsetHeight,li=We(this.options.offset),Ki=this._getAnchor();ve==="top"?(h=Ce/2,x=Et):ve==="bottom"?(h=Ce/2,x=0):ve==="center"?(h=Ce/2,x=Et/2):ve==="right"?(h=0,x=Et/2):ve==="left"?(h=Ce,x=Et/2):ie.x<N.x?(ve="right",h=0,x=Et/2):(ve="left",h=Ce+(li.x+Ki.x)*2,x=Et/2),l=l.subtract(We(h,x,!0)).add(li).add(Ki),Ie(k,"leaflet-tooltip-right"),Ie(k,"leaflet-tooltip-left"),Ie(k,"leaflet-tooltip-top"),Ie(k,"leaflet-tooltip-bottom"),me(k,"leaflet-tooltip-"+ve),ke(k,l)},_updatePosition:function(){var l=this._map.latLngToLayerPoint(this._latlng);this._setPosition(l)},setOpacity:function(l){this.options.opacity=l,this._container&&re(this._container,l)},_animateZoom:function(l){var h=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center);this._setPosition(h)},_getAnchor:function(){return We(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Hb=function(l,h){return new oh(l,h)};zi.include({openTooltip:function(l,h,x){return this._initOverlay(oh,l,h,x).openOn(this),this},closeTooltip:function(l){return l.close(),this}}),Qo.include({bindTooltip:function(l,h){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(oh,this._tooltip,l,h),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(l){if(!(!l&&this._tooltipHandlersAdded)){var h=l?"off":"on",x={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?x.add=this._openTooltip:(x.mouseover=this._openTooltip,x.mouseout=this.closeTooltip,x.click=this._openTooltip,this._map?this._addFocusListeners():x.add=this._addFocusListeners),this._tooltip.options.sticky&&(x.mousemove=this._moveTooltip),this[h](x),this._tooltipHandlersAdded=!l}},openTooltip:function(l){return this._tooltip&&(this instanceof zr||(this._tooltip._source=this),this._tooltip._prepareOpen(l)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(l){return this._tooltip&&this._tooltip.setContent(l),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(l){var h=typeof l.getElement=="function"&&l.getElement();h&&(pt(h,"focus",function(){this._tooltip._source=l,this.openTooltip()},this),pt(h,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(l){var h=typeof l.getElement=="function"&&l.getElement();h&&h.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(l){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var h=this;this._map.once("moveend",function(){h._openOnceFlag=!1,h._openTooltip(l)});return}this._tooltip._source=l.layer||l.target,this.openTooltip(this._tooltip.options.sticky?l.latlng:void 0)}},_moveTooltip:function(l){var h=l.latlng,x,E;this._tooltip.options.sticky&&l.originalEvent&&(x=this._map.mouseEventToContainerPoint(l.originalEvent),E=this._map.containerPointToLayerPoint(x),h=this._map.layerPointToLatLng(E)),this._tooltip.setLatLng(h)}});var q=zl.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(l){var h=l&&l.tagName==="DIV"?l:document.createElement("div"),x=this.options;if(x.html instanceof Element?(Qe(h),h.appendChild(x.html)):h.innerHTML=x.html!==!1?x.html:"",x.bgPos){var E=We(x.bgPos);h.style.backgroundPosition=-E.x+"px "+-E.y+"px"}return this._setIconStyles(h,"icon"),h},createShadow:function(){return null}});function ue(l){return new q(l)}zl.Default=Vl;var ct=Qo.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ye.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(l){y(this,l)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(l){l._addZoomLimit(this)},onRemove:function(l){this._removeAllTiles(),ce(this._container),l._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ae(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(pe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(l){return this.options.opacity=l,this._updateOpacity(),this},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var l=this._clampZoom(this._map.getZoom());l!==this._tileZoom&&(this._tileZoom=l,this._updateLevels()),this._update()}return this},getEvents:function(){var l={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),l.move=this._onMove),this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},createTile:function(){return document.createElement("div")},getTileSize:function(){var l=this.options.tileSize;return l instanceof xe?l:new xe(l,l)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(l){for(var h=this.getPane().children,x=-l(-1/0,1/0),E=0,k=h.length,N;E<k;E++)N=h[E].style.zIndex,h[E]!==this._container&&N&&(x=l(x,+N));isFinite(x)&&(this.options.zIndex=x+l(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ye.ielt9){re(this._container,this.options.opacity);var l=+new Date,h=!1,x=!1;for(var E in this._tiles){var k=this._tiles[E];if(!(!k.current||!k.loaded)){var N=Math.min(1,(l-k.loaded)/200);re(k.el,N),N<1?h=!0:(k.active?x=!0:this._onOpaqueTile(k),k.active=!0)}}x&&!this._noPrune&&this._pruneTiles(),h&&(he(this._fadeFrame),this._fadeFrame=te(this._updateOpacity,this))}},_onOpaqueTile:g,_initContainer:function(){this._container||(this._container=J("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var l=this._tileZoom,h=this.options.maxZoom;if(l!==void 0){for(var x in this._levels)x=Number(x),this._levels[x].el.children.length||x===l?(this._levels[x].el.style.zIndex=h-Math.abs(l-x),this._onUpdateLevel(x)):(ce(this._levels[x].el),this._removeTilesAtZoom(x),this._onRemoveLevel(x),delete this._levels[x]);var E=this._levels[l],k=this._map;return E||(E=this._levels[l]={},E.el=J("div","leaflet-tile-container leaflet-zoom-animated",this._container),E.el.style.zIndex=h,E.origin=k.project(k.unproject(k.getPixelOrigin()),l).round(),E.zoom=l,this._setZoomTransform(E,k.getCenter(),k.getZoom()),g(E.el.offsetWidth),this._onCreateLevel(E)),this._level=E,E}},_onUpdateLevel:g,_onRemoveLevel:g,_onCreateLevel:g,_pruneTiles:function(){if(this._map){var l,h,x=this._map.getZoom();if(x>this.options.maxZoom||x<this.options.minZoom){this._removeAllTiles();return}for(l in this._tiles)h=this._tiles[l],h.retain=h.current;for(l in this._tiles)if(h=this._tiles[l],h.current&&!h.active){var E=h.coords;this._retainParent(E.x,E.y,E.z,E.z-5)||this._retainChildren(E.x,E.y,E.z,E.z+2)}for(l in this._tiles)this._tiles[l].retain||this._removeTile(l)}},_removeTilesAtZoom:function(l){for(var h in this._tiles)this._tiles[h].coords.z===l&&this._removeTile(h)},_removeAllTiles:function(){for(var l in this._tiles)this._removeTile(l)},_invalidateAll:function(){for(var l in this._levels)ce(this._levels[l].el),this._onRemoveLevel(Number(l)),delete this._levels[l];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(l,h,x,E){var k=Math.floor(l/2),N=Math.floor(h/2),ie=x-1,ve=new xe(+k,+N);ve.z=+ie;var Ce=this._tileCoordsToKey(ve),Et=this._tiles[Ce];return Et&&Et.active?(Et.retain=!0,!0):(Et&&Et.loaded&&(Et.retain=!0),ie>E?this._retainParent(k,N,ie,E):!1)},_retainChildren:function(l,h,x,E){for(var k=2*l;k<2*l+2;k++)for(var N=2*h;N<2*h+2;N++){var ie=new xe(k,N);ie.z=x+1;var ve=this._tileCoordsToKey(ie),Ce=this._tiles[ve];if(Ce&&Ce.active){Ce.retain=!0;continue}else Ce&&Ce.loaded&&(Ce.retain=!0);x+1<E&&this._retainChildren(k,N,x+1,E)}},_resetView:function(l){var h=l&&(l.pinch||l.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),h,h)},_animateZoom:function(l){this._setView(l.center,l.zoom,!0,l.noUpdate)},_clampZoom:function(l){var h=this.options;return h.minNativeZoom!==void 0&&l<h.minNativeZoom?h.minNativeZoom:h.maxNativeZoom!==void 0&&h.maxNativeZoom<l?h.maxNativeZoom:l},_setView:function(l,h,x,E){var k=Math.round(h);this.options.maxZoom!==void 0&&k>this.options.maxZoom||this.options.minZoom!==void 0&&k<this.options.minZoom?k=void 0:k=this._clampZoom(k);var N=this.options.updateWhenZooming&&k!==this._tileZoom;(!E||N)&&(this._tileZoom=k,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),k!==void 0&&this._update(l),x||this._pruneTiles(),this._noPrune=!!x),this._setZoomTransforms(l,h)},_setZoomTransforms:function(l,h){for(var x in this._levels)this._setZoomTransform(this._levels[x],l,h)},_setZoomTransform:function(l,h,x){var E=this._map.getZoomScale(x,l.zoom),k=l.origin.multiplyBy(E).subtract(this._map._getNewPixelOrigin(h,x)).round();ye.any3d?Pe(l.el,k,E):ke(l.el,k)},_resetGrid:function(){var l=this._map,h=l.options.crs,x=this._tileSize=this.getTileSize(),E=this._tileZoom,k=this._map.getPixelWorldBounds(this._tileZoom);k&&(this._globalTileRange=this._pxBoundsToTileRange(k)),this._wrapX=h.wrapLng&&!this.options.noWrap&&[Math.floor(l.project([0,h.wrapLng[0]],E).x/x.x),Math.ceil(l.project([0,h.wrapLng[1]],E).x/x.y)],this._wrapY=h.wrapLat&&!this.options.noWrap&&[Math.floor(l.project([h.wrapLat[0],0],E).y/x.x),Math.ceil(l.project([h.wrapLat[1],0],E).y/x.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(l){var h=this._map,x=h._animatingZoom?Math.max(h._animateToZoom,h.getZoom()):h.getZoom(),E=h.getZoomScale(x,this._tileZoom),k=h.project(l,this._tileZoom).floor(),N=h.getSize().divideBy(E*2);return new _e(k.subtract(N),k.add(N))},_update:function(l){var h=this._map;if(h){var x=this._clampZoom(h.getZoom());if(l===void 0&&(l=h.getCenter()),this._tileZoom!==void 0){var E=this._getTiledPixelBounds(l),k=this._pxBoundsToTileRange(E),N=k.getCenter(),ie=[],ve=this.options.keepBuffer,Ce=new _e(k.getBottomLeft().subtract([ve,-ve]),k.getTopRight().add([ve,-ve]));if(!(isFinite(k.min.x)&&isFinite(k.min.y)&&isFinite(k.max.x)&&isFinite(k.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Et in this._tiles){var li=this._tiles[Et].coords;(li.z!==this._tileZoom||!Ce.contains(new xe(li.x,li.y)))&&(this._tiles[Et].current=!1)}if(Math.abs(x-this._tileZoom)>1){this._setView(l,x);return}for(var Ki=k.min.y;Ki<=k.max.y;Ki++)for(var hi=k.min.x;hi<=k.max.x;hi++){var un=new xe(hi,Ki);if(un.z=this._tileZoom,!!this._isValidTile(un)){var In=this._tiles[this._tileCoordsToKey(un)];In?In.current=!0:ie.push(un)}}if(ie.sort(function(Ns,Vr){return Ns.distanceTo(N)-Vr.distanceTo(N)}),ie.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _s=document.createDocumentFragment();for(hi=0;hi<ie.length;hi++)this._addTile(ie[hi],_s);this._level.el.appendChild(_s)}}}},_isValidTile:function(l){var h=this._map.options.crs;if(!h.infinite){var x=this._globalTileRange;if(!h.wrapLng&&(l.x<x.min.x||l.x>x.max.x)||!h.wrapLat&&(l.y<x.min.y||l.y>x.max.y))return!1}if(!this.options.bounds)return!0;var E=this._tileCoordsToBounds(l);return tt(this.options.bounds).overlaps(E)},_keyToBounds:function(l){return this._tileCoordsToBounds(this._keyToTileCoords(l))},_tileCoordsToNwSe:function(l){var h=this._map,x=this.getTileSize(),E=l.scaleBy(x),k=E.add(x),N=h.unproject(E,l.z),ie=h.unproject(k,l.z);return[N,ie]},_tileCoordsToBounds:function(l){var h=this._tileCoordsToNwSe(l),x=new Wt(h[0],h[1]);return this.options.noWrap||(x=this._map.wrapLatLngBounds(x)),x},_tileCoordsToKey:function(l){return l.x+":"+l.y+":"+l.z},_keyToTileCoords:function(l){var h=l.split(":"),x=new xe(+h[0],+h[1]);return x.z=+h[2],x},_removeTile:function(l){var h=this._tiles[l];h&&(ce(h.el),delete this._tiles[l],this.fire("tileunload",{tile:h.el,coords:this._keyToTileCoords(l)}))},_initTile:function(l){me(l,"leaflet-tile");var h=this.getTileSize();l.style.width=h.x+"px",l.style.height=h.y+"px",l.onselectstart=g,l.onmousemove=g,ye.ielt9&&this.options.opacity<1&&re(l,this.options.opacity)},_addTile:function(l,h){var x=this._getTilePos(l),E=this._tileCoordsToKey(l),k=this.createTile(this._wrapCoords(l),r(this._tileReady,this,l));this._initTile(k),this.createTile.length<2&&te(r(this._tileReady,this,l,null,k)),ke(k,x),this._tiles[E]={el:k,coords:l,current:!0},h.appendChild(k),this.fire("tileloadstart",{tile:k,coords:l})},_tileReady:function(l,h,x){h&&this.fire("tileerror",{error:h,tile:x,coords:l});var E=this._tileCoordsToKey(l);x=this._tiles[E],x&&(x.loaded=+new Date,this._map._fadeAnimated?(re(x.el,0),he(this._fadeFrame),this._fadeFrame=te(this._updateOpacity,this)):(x.active=!0,this._pruneTiles()),h||(me(x.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:x.el,coords:l})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ye.ielt9||!this._map._fadeAnimated?te(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(l){return l.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(l){var h=new xe(this._wrapX?f(l.x,this._wrapX):l.x,this._wrapY?f(l.y,this._wrapY):l.y);return h.z=l.z,h},_pxBoundsToTileRange:function(l){var h=this.getTileSize();return new _e(l.min.unscaleBy(h).floor(),l.max.unscaleBy(h).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var l in this._tiles)if(!this._tiles[l].loaded)return!1;return!0}});function ft(l){return new ct(l)}var je=ct.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(l,h){this._url=l,h=y(this,h),h.detectRetina&&ye.retina&&h.maxZoom>0?(h.tileSize=Math.floor(h.tileSize/2),h.zoomReverse?(h.zoomOffset--,h.minZoom=Math.min(h.maxZoom,h.minZoom+1)):(h.zoomOffset++,h.maxZoom=Math.max(h.minZoom,h.maxZoom-1)),h.minZoom=Math.max(0,h.minZoom)):h.zoomReverse?h.minZoom=Math.min(h.maxZoom,h.minZoom):h.maxZoom=Math.max(h.minZoom,h.maxZoom),typeof h.subdomains=="string"&&(h.subdomains=h.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(l,h){return this._url===l&&h===void 0&&(h=!0),this._url=l,h||this.redraw(),this},createTile:function(l,h){var x=document.createElement("img");return pt(x,"load",r(this._tileOnLoad,this,h,x)),pt(x,"error",r(this._tileOnError,this,h,x)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(x.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(x.referrerPolicy=this.options.referrerPolicy),x.alt="",x.src=this.getTileUrl(l),x},getTileUrl:function(l){var h={r:ye.retina?"@2x":"",s:this._getSubdomain(l),x:l.x,y:l.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var x=this._globalTileRange.max.y-l.y;this.options.tms&&(h.y=x),h["-y"]=x}return P(this._url,n(h,this.options))},_tileOnLoad:function(l,h){ye.ielt9?setTimeout(r(l,this,null,h),0):l(null,h)},_tileOnError:function(l,h,x){var E=this.options.errorTileUrl;E&&h.getAttribute("src")!==E&&(h.src=E),l(x,h)},_onTileRemove:function(l){l.tile.onload=null},_getZoomForUrl:function(){var l=this._tileZoom,h=this.options.maxZoom,x=this.options.zoomReverse,E=this.options.zoomOffset;return x&&(l=h-l),l+E},_getSubdomain:function(l){var h=Math.abs(l.x+l.y)%this.options.subdomains.length;return this.options.subdomains[h]},_abortLoading:function(){var l,h;for(l in this._tiles)if(this._tiles[l].coords.z!==this._tileZoom&&(h=this._tiles[l].el,h.onload=g,h.onerror=g,!h.complete)){h.src=T;var x=this._tiles[l].coords;ce(h),delete this._tiles[l],this.fire("tileabort",{tile:h,coords:x})}},_removeTile:function(l){var h=this._tiles[l];if(h)return h.el.setAttribute("src",T),ct.prototype._removeTile.call(this,l)},_tileReady:function(l,h,x){if(!(!this._map||x&&x.getAttribute("src")===T))return ct.prototype._tileReady.call(this,l,h,x)}});function Kt(l,h){return new je(l,h)}var ai=je.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(l,h){this._url=l;var x=n({},this.defaultWmsParams);for(var E in h)E in this.options||(x[E]=h[E]);h=y(this,h);var k=h.detectRetina&&ye.retina?2:1,N=this.getTileSize();x.width=N.x*k,x.height=N.y*k,this.wmsParams=x},onAdd:function(l){this._crs=this.options.crs||l.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var h=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[h]=this._crs.code,je.prototype.onAdd.call(this,l)},getTileUrl:function(l){var h=this._tileCoordsToNwSe(l),x=this._crs,E=dt(x.project(h[0]),x.project(h[1])),k=E.min,N=E.max,ie=(this._wmsVersion>=1.3&&this._crs===Jp?[k.y,k.x,N.y,N.x]:[k.x,k.y,N.x,N.y]).join(","),ve=je.prototype.getTileUrl.call(this,l);return ve+w(this.wmsParams,ve,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ie},setParams:function(l,h){return n(this.wmsParams,l),h||this.redraw(),this}});function tn(l,h){return new ai(l,h)}je.WMS=ai,Kt.wms=tn;var Yi=Qo.extend({options:{padding:.1},initialize:function(l){y(this,l),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),me(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var l={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(l.zoomanim=this._onAnimZoom),l},_onAnimZoom:function(l){this._updateTransform(l.center,l.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(l,h){var x=this._map.getZoomScale(h,this._zoom),E=this._map.getSize().multiplyBy(.5+this.options.padding),k=this._map.project(this._center,h),N=E.multiplyBy(-x).add(k).subtract(this._map._getNewPixelOrigin(l,h));ye.any3d?Pe(this._container,N,x):ke(this._container,N)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var l in this._layers)this._layers[l]._reset()},_onZoomEnd:function(){for(var l in this._layers)this._layers[l]._project()},_updatePaths:function(){for(var l in this._layers)this._layers[l]._update()},_update:function(){var l=this.options.padding,h=this._map.getSize(),x=this._map.containerPointToLayerPoint(h.multiplyBy(-l)).round();this._bounds=new _e(x,x.add(h.multiplyBy(1+l*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),cn=Yi.extend({options:{tolerance:0},getEvents:function(){var l=Yi.prototype.getEvents.call(this);return l.viewprereset=this._onViewPreReset,l},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Yi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var l=this._container=document.createElement("canvas");pt(l,"mousemove",this._onMouseMove,this),pt(l,"click dblclick mousedown mouseup contextmenu",this._onClick,this),pt(l,"mouseout",this._handleMouseOut,this),l._leaflet_disable_events=!0,this._ctx=l.getContext("2d")},_destroyContainer:function(){he(this._redrawRequest),delete this._ctx,ce(this._container),wi(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var l;this._redrawBounds=null;for(var h in this._layers)l=this._layers[h],l._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Yi.prototype._update.call(this);var l=this._bounds,h=this._container,x=l.getSize(),E=ye.retina?2:1;ke(h,l.min),h.width=E*x.x,h.height=E*x.y,h.style.width=x.x+"px",h.style.height=x.y+"px",ye.retina&&this._ctx.scale(2,2),this._ctx.translate(-l.min.x,-l.min.y),this.fire("update")}},_reset:function(){Yi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(l){this._updateDashArray(l),this._layers[d(l)]=l;var h=l._order={layer:l,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=h),this._drawLast=h,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(l){this._requestRedraw(l)},_removePath:function(l){var h=l._order,x=h.next,E=h.prev;x?x.prev=E:this._drawLast=E,E?E.next=x:this._drawFirst=x,delete l._order,delete this._layers[d(l)],this._requestRedraw(l)},_updatePath:function(l){this._extendRedrawBounds(l),l._project(),l._update(),this._requestRedraw(l)},_updateStyle:function(l){this._updateDashArray(l),this._requestRedraw(l)},_updateDashArray:function(l){if(typeof l.options.dashArray=="string"){var h=l.options.dashArray.split(/[, ]+/),x=[],E,k;for(k=0;k<h.length;k++){if(E=Number(h[k]),isNaN(E))return;x.push(E)}l.options._dashArray=x}else l.options._dashArray=l.options.dashArray},_requestRedraw:function(l){this._map&&(this._extendRedrawBounds(l),this._redrawRequest=this._redrawRequest||te(this._redraw,this))},_extendRedrawBounds:function(l){if(l._pxBounds){var h=(l.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new _e,this._redrawBounds.extend(l._pxBounds.min.subtract([h,h])),this._redrawBounds.extend(l._pxBounds.max.add([h,h]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var l=this._redrawBounds;if(l){var h=l.getSize();this._ctx.clearRect(l.min.x,l.min.y,h.x,h.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var l,h=this._redrawBounds;if(this._ctx.save(),h){var x=h.getSize();this._ctx.beginPath(),this._ctx.rect(h.min.x,h.min.y,x.x,x.y),this._ctx.clip()}this._drawing=!0;for(var E=this._drawFirst;E;E=E.next)l=E.layer,(!h||l._pxBounds&&l._pxBounds.intersects(h))&&l._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(l,h){if(this._drawing){var x,E,k,N,ie=l._parts,ve=ie.length,Ce=this._ctx;if(ve){for(Ce.beginPath(),x=0;x<ve;x++){for(E=0,k=ie[x].length;E<k;E++)N=ie[x][E],Ce[E?"lineTo":"moveTo"](N.x,N.y);h&&Ce.closePath()}this._fillStroke(Ce,l)}}},_updateCircle:function(l){if(!(!this._drawing||l._empty())){var h=l._point,x=this._ctx,E=Math.max(Math.round(l._radius),1),k=(Math.max(Math.round(l._radiusY),1)||E)/E;k!==1&&(x.save(),x.scale(1,k)),x.beginPath(),x.arc(h.x,h.y/k,E,0,Math.PI*2,!1),k!==1&&x.restore(),this._fillStroke(x,l)}},_fillStroke:function(l,h){var x=h.options;x.fill&&(l.globalAlpha=x.fillOpacity,l.fillStyle=x.fillColor||x.color,l.fill(x.fillRule||"evenodd")),x.stroke&&x.weight!==0&&(l.setLineDash&&l.setLineDash(h.options&&h.options._dashArray||[]),l.globalAlpha=x.opacity,l.lineWidth=x.weight,l.strokeStyle=x.color,l.lineCap=x.lineCap,l.lineJoin=x.lineJoin,l.stroke())},_onClick:function(l){for(var h=this._map.mouseEventToLayerPoint(l),x,E,k=this._drawFirst;k;k=k.next)x=k.layer,x.options.interactive&&x._containsPoint(h)&&(!(l.type==="click"||l.type==="preclick")||!this._map._draggableMoved(x))&&(E=x);this._fireEvent(E?[E]:!1,l)},_onMouseMove:function(l){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var h=this._map.mouseEventToLayerPoint(l);this._handleMouseHover(l,h)}},_handleMouseOut:function(l){var h=this._hoveredLayer;h&&(Ie(this._container,"leaflet-interactive"),this._fireEvent([h],l,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(l,h){if(!this._mouseHoverThrottled){for(var x,E,k=this._drawFirst;k;k=k.next)x=k.layer,x.options.interactive&&x._containsPoint(h)&&(E=x);E!==this._hoveredLayer&&(this._handleMouseOut(l),E&&(me(this._container,"leaflet-interactive"),this._fireEvent([E],l,"mouseover"),this._hoveredLayer=E)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,l),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(l,h,x){this._map._fireDOMEvent(h,x||h.type,l)},_bringToFront:function(l){var h=l._order;if(h){var x=h.next,E=h.prev;if(x)x.prev=E;else return;E?E.next=x:x&&(this._drawFirst=x),h.prev=this._drawLast,this._drawLast.next=h,h.next=null,this._drawLast=h,this._requestRedraw(l)}},_bringToBack:function(l){var h=l._order;if(h){var x=h.next,E=h.prev;if(E)E.next=x;else return;x?x.prev=E:E&&(this._drawLast=E),h.prev=null,h.next=this._drawFirst,this._drawFirst.prev=h,this._drawFirst=h,this._requestRedraw(l)}}});function Cn(l){return ye.canvas?new cn(l):null}var gn=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(l){return document.createElement("<lvml:"+l+' class="lvml">')}}catch{}return function(l){return document.createElement("<"+l+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),En={_initContainer:function(){this._container=J("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Yi.prototype._update.call(this),this.fire("update"))},_initPath:function(l){var h=l._container=gn("shape");me(h,"leaflet-vml-shape "+(this.options.className||"")),h.coordsize="1 1",l._path=gn("path"),h.appendChild(l._path),this._updateStyle(l),this._layers[d(l)]=l},_addPath:function(l){var h=l._container;this._container.appendChild(h),l.options.interactive&&l.addInteractiveTarget(h)},_removePath:function(l){var h=l._container;ce(h),l.removeInteractiveTarget(h),delete this._layers[d(l)]},_updateStyle:function(l){var h=l._stroke,x=l._fill,E=l.options,k=l._container;k.stroked=!!E.stroke,k.filled=!!E.fill,E.stroke?(h||(h=l._stroke=gn("stroke")),k.appendChild(h),h.weight=E.weight+"px",h.color=E.color,h.opacity=E.opacity,E.dashArray?h.dashStyle=M(E.dashArray)?E.dashArray.join(" "):E.dashArray.replace(/( *, *)/g," "):h.dashStyle="",h.endcap=E.lineCap.replace("butt","flat"),h.joinstyle=E.lineJoin):h&&(k.removeChild(h),l._stroke=null),E.fill?(x||(x=l._fill=gn("fill")),k.appendChild(x),x.color=E.fillColor||E.color,x.opacity=E.fillOpacity):x&&(k.removeChild(x),l._fill=null)},_updateCircle:function(l){var h=l._point.round(),x=Math.round(l._radius),E=Math.round(l._radiusY||x);this._setPath(l,l._empty()?"M0 0":"AL "+h.x+","+h.y+" "+x+","+E+" 0,"+65535*360)},_setPath:function(l,h){l._path.v=h},_bringToFront:function(l){ae(l._container)},_bringToBack:function(l){pe(l._container)}},bn=ye.vml?gn:Vt,yn=Yi.extend({_initContainer:function(){this._container=bn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=bn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ce(this._container),wi(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Yi.prototype._update.call(this);var l=this._bounds,h=l.getSize(),x=this._container;(!this._svgSize||!this._svgSize.equals(h))&&(this._svgSize=h,x.setAttribute("width",h.x),x.setAttribute("height",h.y)),ke(x,l.min),x.setAttribute("viewBox",[l.min.x,l.min.y,h.x,h.y].join(" ")),this.fire("update")}},_initPath:function(l){var h=l._path=bn("path");l.options.className&&me(h,l.options.className),l.options.interactive&&me(h,"leaflet-interactive"),this._updateStyle(l),this._layers[d(l)]=l},_addPath:function(l){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(l._path),l.addInteractiveTarget(l._path)},_removePath:function(l){ce(l._path),l.removeInteractiveTarget(l._path),delete this._layers[d(l)]},_updatePath:function(l){l._project(),l._update()},_updateStyle:function(l){var h=l._path,x=l.options;h&&(x.stroke?(h.setAttribute("stroke",x.color),h.setAttribute("stroke-opacity",x.opacity),h.setAttribute("stroke-width",x.weight),h.setAttribute("stroke-linecap",x.lineCap),h.setAttribute("stroke-linejoin",x.lineJoin),x.dashArray?h.setAttribute("stroke-dasharray",x.dashArray):h.removeAttribute("stroke-dasharray"),x.dashOffset?h.setAttribute("stroke-dashoffset",x.dashOffset):h.removeAttribute("stroke-dashoffset")):h.setAttribute("stroke","none"),x.fill?(h.setAttribute("fill",x.fillColor||x.color),h.setAttribute("fill-opacity",x.fillOpacity),h.setAttribute("fill-rule",x.fillRule||"evenodd")):h.setAttribute("fill","none"))},_updatePoly:function(l,h){this._setPath(l,zt(l._parts,h))},_updateCircle:function(l){var h=l._point,x=Math.max(Math.round(l._radius),1),E=Math.max(Math.round(l._radiusY),1)||x,k="a"+x+","+E+" 0 1,0 ",N=l._empty()?"M0 0":"M"+(h.x-x)+","+h.y+k+x*2+",0 "+k+-x*2+",0 ";this._setPath(l,N)},_setPath:function(l,h){l._path.setAttribute("d",h)},_bringToFront:function(l){ae(l._path)},_bringToBack:function(l){pe(l._path)}});ye.vml&&yn.include(En);function ls(l){return ye.svg||ye.vml?new yn(l):null}zi.include({getRenderer:function(l){var h=l.options.renderer||this._getPaneRenderer(l.options.pane)||this.options.renderer||this._renderer;return h||(h=this._renderer=this._createRenderer()),this.hasLayer(h)||this.addLayer(h),h},_getPaneRenderer:function(l){if(l==="overlayPane"||l===void 0)return!1;var h=this._paneRenderers[l];return h===void 0&&(h=this._createRenderer({pane:l}),this._paneRenderers[l]=h),h},_createRenderer:function(l){return this.options.preferCanvas&&Cn(l)||ls(l)}});var pn=Ja.extend({initialize:function(l,h){Ja.prototype.initialize.call(this,this._boundsToLatLngs(l),h)},setBounds:function(l){return this.setLatLngs(this._boundsToLatLngs(l))},_boundsToLatLngs:function(l){return l=tt(l),[l.getSouthWest(),l.getNorthWest(),l.getNorthEast(),l.getSouthEast()]}});function Hn(l,h){return new pn(l,h)}yn.create=bn,yn.pointsToPath=zt,fr.geometryToLayer=Xc,fr.coordsToLatLng=eh,fr.coordsToLatLngs=th,fr.latLngToCoords=bf,fr.latLngsToCoords=ih,fr.getFeature=xa,fr.asFeature=Yc,zi.mergeOptions({boxZoom:!0});var Ms=Oo.extend({initialize:function(l){this._map=l,this._container=l._container,this._pane=l._panes.overlayPane,this._resetStateTimeout=0,l.on("unload",this._destroy,this)},addHooks:function(){pt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){wi(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ce(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(l){if(!l.shiftKey||l.which!==1&&l.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),vt(),ze(),this._startPoint=this._map.mouseEventToContainerPoint(l),pt(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(l){this._moved||(this._moved=!0,this._box=J("div","leaflet-zoom-box",this._container),me(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(l);var h=new _e(this._point,this._startPoint),x=h.getSize();ke(this._box,h.min),this._box.style.width=x.x+"px",this._box.style.height=x.y+"px"},_finish:function(){this._moved&&(ce(this._box),Ie(this._container,"leaflet-crosshair")),Fe(),Je(),wi(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(l){if(!(l.which!==1&&l.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var h=new Wt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(h).fire("boxzoomend",{boxZoomBounds:h})}},_onKeyDown:function(l){l.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});zi.addInitHook("addHandler","boxZoom",Ms),zi.mergeOptions({doubleClickZoom:!0});var mo=Oo.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(l){var h=this._map,x=h.getZoom(),E=h.options.zoomDelta,k=l.originalEvent.shiftKey?x-E:x+E;h.options.doubleClickZoom==="center"?h.setZoom(k):h.setZoomAround(l.containerPoint,k)}});zi.addInitHook("addHandler","doubleClickZoom",mo),zi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Rs=Oo.extend({addHooks:function(){if(!this._draggable){var l=this._map;this._draggable=new Wr(l._mapPane,l._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),l.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),l.on("zoomend",this._onZoomEnd,this),l.whenReady(this._onZoomEnd,this))}me(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Ie(this._map._container,"leaflet-grab"),Ie(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var l=this._map;if(l._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var h=tt(this._map.options.maxBounds);this._offsetLimit=dt(this._map.latLngToContainerPoint(h.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(h.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;l.fire("movestart").fire("dragstart"),l.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(l){if(this._map.options.inertia){var h=this._lastTime=+new Date,x=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(x),this._times.push(h),this._prunePositions(h)}this._map.fire("move",l).fire("drag",l)},_prunePositions:function(l){for(;this._positions.length>1&&l-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var l=this._map.getSize().divideBy(2),h=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=h.subtract(l).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(l,h){return l-(l-h)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var l=this._draggable._newPos.subtract(this._draggable._startPos),h=this._offsetLimit;l.x<h.min.x&&(l.x=this._viscousLimit(l.x,h.min.x)),l.y<h.min.y&&(l.y=this._viscousLimit(l.y,h.min.y)),l.x>h.max.x&&(l.x=this._viscousLimit(l.x,h.max.x)),l.y>h.max.y&&(l.y=this._viscousLimit(l.y,h.max.y)),this._draggable._newPos=this._draggable._startPos.add(l)}},_onPreDragWrap:function(){var l=this._worldWidth,h=Math.round(l/2),x=this._initialWorldOffset,E=this._draggable._newPos.x,k=(E-h+x)%l+h-x,N=(E+h+x)%l-h-x,ie=Math.abs(k+x)<Math.abs(N+x)?k:N;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ie},_onDragEnd:function(l){var h=this._map,x=h.options,E=!x.inertia||l.noInertia||this._times.length<2;if(h.fire("dragend",l),E)h.fire("moveend");else{this._prunePositions(+new Date);var k=this._lastPos.subtract(this._positions[0]),N=(this._lastTime-this._times[0])/1e3,ie=x.easeLinearity,ve=k.multiplyBy(ie/N),Ce=ve.distanceTo([0,0]),Et=Math.min(x.inertiaMaxSpeed,Ce),li=ve.multiplyBy(Et/Ce),Ki=Et/(x.inertiaDeceleration*ie),hi=li.multiplyBy(-Ki/2).round();!hi.x&&!hi.y?h.fire("moveend"):(hi=h._limitOffset(hi,h.options.maxBounds),te(function(){h.panBy(hi,{duration:Ki,easeLinearity:ie,noMoveStart:!0,animate:!0})}))}}});zi.addInitHook("addHandler","dragging",Rs),zi.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ds=Oo.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(l){this._map=l,this._setPanDelta(l.options.keyboardPanDelta),this._setZoomDelta(l.options.zoomDelta)},addHooks:function(){var l=this._map._container;l.tabIndex<=0&&(l.tabIndex="0"),pt(l,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),wi(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var l=document.body,h=document.documentElement,x=l.scrollTop||h.scrollTop,E=l.scrollLeft||h.scrollLeft;this._map._container.focus(),window.scrollTo(E,x)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(l){var h=this._panKeys={},x=this.keyCodes,E,k;for(E=0,k=x.left.length;E<k;E++)h[x.left[E]]=[-1*l,0];for(E=0,k=x.right.length;E<k;E++)h[x.right[E]]=[l,0];for(E=0,k=x.down.length;E<k;E++)h[x.down[E]]=[0,l];for(E=0,k=x.up.length;E<k;E++)h[x.up[E]]=[0,-1*l]},_setZoomDelta:function(l){var h=this._zoomKeys={},x=this.keyCodes,E,k;for(E=0,k=x.zoomIn.length;E<k;E++)h[x.zoomIn[E]]=l;for(E=0,k=x.zoomOut.length;E<k;E++)h[x.zoomOut[E]]=-l},_addHooks:function(){pt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){wi(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(l){if(!(l.altKey||l.ctrlKey||l.metaKey)){var h=l.keyCode,x=this._map,E;if(h in this._panKeys){if(!x._panAnim||!x._panAnim._inProgress)if(E=this._panKeys[h],l.shiftKey&&(E=We(E).multiplyBy(3)),x.options.maxBounds&&(E=x._limitOffset(We(E),x.options.maxBounds)),x.options.worldCopyJump){var k=x.wrapLatLng(x.unproject(x.project(x.getCenter()).add(E)));x.panTo(k)}else x.panBy(E)}else if(h in this._zoomKeys)x.setZoom(x.getZoom()+(l.shiftKey?3:1)*this._zoomKeys[h]);else if(h===27&&x._popup&&x._popup.options.closeOnEscapeKey)x.closePopup();else return;Ln(l)}}});zi.addInitHook("addHandler","keyboard",Ds),zi.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var cs=Oo.extend({addHooks:function(){pt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){wi(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(l){var h=Bs(l),x=this._map.options.wheelDebounceTime;this._delta+=h,this._lastMousePos=this._map.mouseEventToContainerPoint(l),this._startTime||(this._startTime=+new Date);var E=Math.max(x-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),E),Ln(l)},_performZoom:function(){var l=this._map,h=l.getZoom(),x=this._map.options.zoomSnap||0;l._stop();var E=this._delta/(this._map.options.wheelPxPerZoomLevel*4),k=4*Math.log(2/(1+Math.exp(-Math.abs(E))))/Math.LN2,N=x?Math.ceil(k/x)*x:k,ie=l._limitZoom(h+(this._delta>0?N:-N))-h;this._delta=0,this._startTime=null,ie&&(l.options.scrollWheelZoom==="center"?l.setZoom(h+ie):l.setZoomAround(this._lastMousePos,h+ie))}});zi.addInitHook("addHandler","scrollWheelZoom",cs);var ns=600;zi.mergeOptions({tapHold:ye.touchNative&&ye.safari&&ye.mobile,tapTolerance:15});var qs=Oo.extend({addHooks:function(){pt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){wi(this._map._container,"touchstart",this._onDown,this)},_onDown:function(l){if(clearTimeout(this._holdTimeout),l.touches.length===1){var h=l.touches[0];this._startPos=this._newPos=new xe(h.clientX,h.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(pt(document,"touchend",Ji),pt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",h))},this),ns),pt(document,"touchend touchcancel contextmenu",this._cancel,this),pt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function l(){wi(document,"touchend",Ji),wi(document,"touchend touchcancel",l)},_cancel:function(){clearTimeout(this._holdTimeout),wi(document,"touchend touchcancel contextmenu",this._cancel,this),wi(document,"touchmove",this._onMove,this)},_onMove:function(l){var h=l.touches[0];this._newPos=new xe(h.clientX,h.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(l,h){var x=new MouseEvent(l,{bubbles:!0,cancelable:!0,view:window,screenX:h.screenX,screenY:h.screenY,clientX:h.clientX,clientY:h.clientY});x._simulated=!0,h.target.dispatchEvent(x)}});zi.addInitHook("addHandler","tapHold",qs),zi.mergeOptions({touchZoom:ye.touch,bounceAtZoomLimits:!0});var Bn=Oo.extend({addHooks:function(){me(this._map._container,"leaflet-touch-zoom"),pt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Ie(this._map._container,"leaflet-touch-zoom"),wi(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(l){var h=this._map;if(!(!l.touches||l.touches.length!==2||h._animatingZoom||this._zooming)){var x=h.mouseEventToContainerPoint(l.touches[0]),E=h.mouseEventToContainerPoint(l.touches[1]);this._centerPoint=h.getSize()._divideBy(2),this._startLatLng=h.containerPointToLatLng(this._centerPoint),h.options.touchZoom!=="center"&&(this._pinchStartLatLng=h.containerPointToLatLng(x.add(E)._divideBy(2))),this._startDist=x.distanceTo(E),this._startZoom=h.getZoom(),this._moved=!1,this._zooming=!0,h._stop(),pt(document,"touchmove",this._onTouchMove,this),pt(document,"touchend touchcancel",this._onTouchEnd,this),Ji(l)}},_onTouchMove:function(l){if(!(!l.touches||l.touches.length!==2||!this._zooming)){var h=this._map,x=h.mouseEventToContainerPoint(l.touches[0]),E=h.mouseEventToContainerPoint(l.touches[1]),k=x.distanceTo(E)/this._startDist;if(this._zoom=h.getScaleZoom(k,this._startZoom),!h.options.bounceAtZoomLimits&&(this._zoom<h.getMinZoom()&&k<1||this._zoom>h.getMaxZoom()&&k>1)&&(this._zoom=h._limitZoom(this._zoom)),h.options.touchZoom==="center"){if(this._center=this._startLatLng,k===1)return}else{var N=x._add(E)._divideBy(2)._subtract(this._centerPoint);if(k===1&&N.x===0&&N.y===0)return;this._center=h.unproject(h.project(this._pinchStartLatLng,this._zoom).subtract(N),this._zoom)}this._moved||(h._moveStart(!0,!1),this._moved=!0),he(this._animRequest);var ie=r(h._move,h,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=te(ie,this,!0),Ji(l)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,he(this._animRequest),wi(document,"touchmove",this._onTouchMove,this),wi(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});zi.addInitHook("addHandler","touchZoom",Bn),zi.BoxZoom=Ms,zi.DoubleClickZoom=mo,zi.Drag=Rs,zi.Keyboard=Ds,zi.ScrollWheelZoom=cs,zi.TapHold=qs,zi.TouchZoom=Bn,t.Bounds=_e,t.Browser=ye,t.CRS=Rt,t.Canvas=cn,t.Circle=vf,t.CircleMarker=Ju,t.Class=oe,t.Control=Pn,t.DivIcon=q,t.DivOverlay=gr,t.DomEvent=ss,t.DomUtil=Ht,t.Draggable=Wr,t.Evented=Re,t.FeatureGroup=zr,t.GeoJSON=fr,t.GridLayer=ct,t.Handler=Oo,t.Icon=zl,t.ImageOverlay=Qc,t.LatLng=kt,t.LatLngBounds=Wt,t.Layer=Qo,t.LayerGroup=Qa,t.LineUtil=Kc,t.Map=zi,t.Marker=Qu,t.Mixin=Lb,t.Path=pa,t.Point=xe,t.PolyUtil=Ib,t.Polygon=Ja,t.Polyline=hr,t.Popup=sh,t.PosAnimation=ps,t.Projection=Pb,t.Rectangle=pn,t.Renderer=Yi,t.SVG=yn,t.SVGOverlay=lx,t.TileLayer=je,t.Tooltip=oh,t.Transformation=Pt,t.Util=De,t.VideoOverlay=yf,t.bind=r,t.bounds=dt,t.canvas=Cn,t.circle=_f,t.circleMarker=ox,t.control=Vn,t.divIcon=ue,t.extend=n,t.featureGroup=ix,t.geoJSON=Cf,t.geoJson=Mb,t.gridLayer=ft,t.icon=nx,t.imageOverlay=Ef,t.latLng=be,t.latLngBounds=tt,t.layerGroup=tx,t.map=Ys,t.marker=sx,t.point=We,t.polygon=rx,t.polyline=Tb,t.popup=Ob,t.rectangle=Hn,t.setOptions=y,t.stamp=d,t.svg=ls,t.svgOverlay=Nb,t.tileLayer=Kt,t.tooltip=Hb,t.transformation=ui,t.version=i,t.videoOverlay=Rb;var hs=window.L;t.noConflict=function(){return window.L=hs,this},window.L=t}))})(Qf,Qf.exports)),Qf.exports}var lZ=aZ();const Tf=cS(lZ),cZ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",dZ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",uZ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",jn=(o,e=tb)=>{var t=hZ(),i=v(_(t),2),n=_(i);j(()=>O(n,e())),D(o,t)};var hZ=B('<span class="tip svelte-767znw"><span class="tip-icon svelte-767znw">ℹ</span> <span class="tip-box svelte-767znw"> </span></span>'),fZ=B("<button> </button>"),gZ=B('<span class="err svelte-767znw"> </span>'),pZ=B('<span class="ok svelte-767znw"> </span>'),xZ=B('<div class="loading svelte-767znw">Loading…</div>'),mZ=B('<section id="sec-appearance" class="svelte-767znw"><h3 class="svelte-767znw">Appearance</h3> <div class="field svelte-767znw"><label for="theme-select" class="svelte-767znw">Color theme</label> <select id="theme-select" class="svelte-767znw"><option>Dark</option><option>Light</option><option>System (OS preference)</option></select></div></section>'),vZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">CA certificate <!></label> <textarea rows="4" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" spellcheck="false" class="svelte-767znw"></textarea></div> <div class="field svelte-767znw"><label class="svelte-767znw">Client certificate <!></label> <textarea rows="4" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" spellcheck="false" class="svelte-767znw"></textarea></div> <div class="field svelte-767znw"><label class="svelte-767znw">Client private key <!></label> <textarea rows="4" placeholder="-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----" spellcheck="false" class="svelte-767znw"></textarea></div>',1),_Z=B('<section id="sec-mqtt" class="svelte-767znw"><h3 class="svelte-767znw">MQTT</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Protocol <!></label> <select class="svelte-767znw"><option>mqtt (plain TCP)</option><option>mqtts (TLS)</option><option>ws (WebSocket)</option><option>wss (WebSocket + TLS)</option></select></div> <div class="field svelte-767znw"><label class="svelte-767znw">Broker address <!></label> <input type="text" placeholder="localhost:1883" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Username <!></label> <input type="text" placeholder="(optional)" autocomplete="off" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Password <!></label> <input type="password" placeholder="(optional)" autocomplete="new-password" class="svelte-767znw"/></div> <!> <div class="field svelte-767znw"><label class="svelte-767znw">MQTT protocol version <!></label> <select class="svelte-767znw"><option>3.1.1 (default)</option><option>5.0</option></select></div> <div class="field svelte-767znw"><label class="svelte-767znw">Client name <!></label> <input type="text" placeholder="she" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Variable prefix <!></label> <input type="text" placeholder="var" class="svelte-767znw"/></div> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Disable variable system <!></label></div></section>'),bZ=B('<div class="field svelte-767znw"><label class="svelte-767znw"> <!></label> <input type="password" placeholder="Enter new password" autocomplete="new-password" class="svelte-767znw"/></div>'),CZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">Proxy user header <!></label> <input type="text" placeholder="X-Remote-User" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Logout URL <!></label> <input type="text" placeholder="https://auth.example.com/…/end-session/" class="svelte-767znw"/></div>',1),EZ=B('<div class="field-error svelte-767znw"> </div>'),yZ=B('<div class="field-ok svelte-767znw"> </div>'),wZ=B('<section id="sec-auth" class="svelte-767znw"><h3 class="svelte-767znw">Authentication</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Mode <!></label> <select class="svelte-767znw"><option>None (open)</option><option>Password</option><option>Proxy header (nginx / authentik)</option></select></div> <!> <!> <!> <!> <div class="field svelte-767znw"><span></span> <button class="save-auth-btn svelte-767znw"> </button></div></section>'),SZ=B('<section id="sec-webserver" class="svelte-767znw"><h3 class="svelte-767znw">Web server</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Port <!></label> <input type="number" min="0" max="65535" placeholder="8080" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Bind address <!></label> <input type="text" placeholder="0.0.0.0 (default)" class="svelte-767znw"/></div></section>'),DZ=B('<section id="sec-scripts" class="svelte-767znw"><h3 class="svelte-767znw">Scripts</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Scripts directory <!></label> <input type="text" class="svelte-767znw"/></div> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Disable file watching <!></label></div></section>'),AZ=B('<section id="sec-git" class="svelte-767znw"><h3 class="svelte-767znw">Git</h3> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Auto-commit on save <!></label></div> <div class="field field--check svelte-767znw"><span></span> <label class="check-label svelte-767znw"><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Auto-push after commit <!></label></div></section>'),TA=B("<option> </option>"),kZ=B('<div class="field svelte-767znw"><div class="map-label svelte-767znw">Map <span class="map-note svelte-767znw">(click or drag marker to set location — requires internet for tiles)</span></div> <div class="map-container svelte-767znw"></div></div>'),BZ=B('<section id="sec-solar" class="svelte-767znw"><h3 class="svelte-767znw">Location</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Timezone <!></label> <input type="text" list="tz-list" placeholder="(system default)" autocomplete="off" spellcheck="false" class="svelte-767znw"/> <datalist id="tz-list"></datalist></div> <div class="field svelte-767znw"><label class="svelte-767znw">Latitude <!></label> <input type="number" step="0.0001" placeholder="48.7408" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">Longitude <!></label> <input type="number" step="0.0001" placeholder="9.1778" class="svelte-767znw"/></div> <div class="field geo-actions svelte-767znw"><span></span> <div class="geo-btns svelte-767znw"><button class="geo-btn svelte-767znw"><!></button> <button class="geo-btn svelte-767znw"> </button></div></div> <!></section>'),FZ=B('<section id="sec-logging" class="svelte-767znw"><h3 class="svelte-767znw">Logging</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Verbosity <!></label> <select class="svelte-767znw"><option>debug</option><option>info</option><option>warn</option><option>error</option></select></div></section>'),LZ=B('<div class="field field--check svelte-767znw"><span></span> <label><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Retain document messages <!></label></div>'),IZ=B('<section id="sec-shedb" class="svelte-767znw"><h3 class="svelte-767znw">sheDB</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Database path <!></label> <input type="text" class="svelte-767znw"/></div> <div class="field svelte-767znw"><label class="svelte-767znw">MQTT topic prefix <!></label> <input type="text" placeholder="she/db/ (default)" class="svelte-767znw"/></div> <div class="field field--check svelte-767znw"><span></span> <label><input type="checkbox" class="svelte-767znw"/> <span class="checkmark svelte-767znw"></span> Publish documents to MQTT <!></label></div> <!></section>'),PZ=B('<section id="sec-redis" class="svelte-767znw"><h3 class="svelte-767znw">Redis</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Redis URL <!></label> <input type="text" placeholder="leave empty to disable" class="svelte-767znw"/></div></section>'),TZ=B('<span class="free-badge svelte-767znw">FREE</span> ',1),MZ=B('&nbsp;— <a target="_blank" rel="noreferrer" class="svelte-767znw">Get API key ↗</a>',1),RZ=B("<div><!> <!></div>"),NZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">Base URL <!></label> <input type="text" class="svelte-767znw"/></div>'),OZ=B('<div class="field svelte-767znw"><label class="svelte-767znw">API key <!></label> <input type="password" placeholder="sk-…" autocomplete="off" class="svelte-767znw"/></div>'),HZ=B('<section id="sec-ai" class="svelte-767znw"><h3 class="svelte-767znw">AI Assistant</h3> <div class="field svelte-767znw"><label class="svelte-767znw">Provider <!></label> <select class="svelte-767znw"></select></div> <!> <!> <div class="field svelte-767znw"><label class="svelte-767znw">Model <!></label> <input type="text" class="svelte-767znw"/></div> <!></section>'),WZ=B('<div class="config-form svelte-767znw"><!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!></div>'),zZ=B('<!> <div class="config-root svelte-767znw"><aside class="config-sidebar svelte-767znw"><div class="sidebar-search svelte-767znw"><svg class="search-icon svelte-767znw" width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="6.5" cy="6.5" r="4.5"></circle><line x1="10" y1="10" x2="14" y2="14"></line></svg> <input class="search-input svelte-767znw" type="search" placeholder="Filter settings…" autocomplete="off" spellcheck="false"/></div> <nav class="section-nav svelte-767znw"></nav></aside> <div class="config-main svelte-767znw"><div class="config-topbar svelte-767znw"><span class="topbar-title svelte-767znw">Settings</span> <!> <!> <button class="save-btn svelte-767znw"> </button></div> <!></div></div>',1);function VZ(o,e){Vs(e,!0),delete Tf.Icon.Default.prototype._getIconUrl,Tf.Icon.Default.mergeOptions({iconUrl:cZ,iconRetinaUrl:dZ,shadowUrl:uZ});let t=I(Ei(sZ())),i=I("~/.she"),n=I("mqtt"),s=I(""),r=I(""),a=I(""),d=I(""),u=I(""),f=I(""),g=I("logic"),p=I("var"),C=I(""),b=I(!1),y=I(8080),w=I(""),A=I("none"),P=I(""),M=I("X-Remote-User"),R=I(""),T=I(!1),V=I(""),W=I(""),Q=I(""),ne=I(!1),de=I(!1),te=I(!1),he=I(""),De=I(48.7408),oe=I(9.1778),ge=I(!1),Se=I(void 0),Re=I(!1),xe=I(null),et=I("info"),We=I(""),_e=I(""),dt=I(!1),Wt=I(!1),tt=I("");const kt=[{id:"ollama",label:"Ollama (local)",provider:"ollama",baseUrl:"",defaultModel:"",freeNote:"",apiKeyUrl:""},{id:"lmstudio",label:"LM Studio (local)",provider:"openai",baseUrl:"http://localhost:1234",defaultModel:"",freeNote:"",apiKeyUrl:""},{id:"groq",label:"Groq — Qwen 2.5 Coder 32B (free)",provider:"openai",baseUrl:"https://api.groq.com/openai/v1",defaultModel:"qwen-2.5-coder-32b",freeNote:"14 400 req/day · no credit card needed",apiKeyUrl:"https://console.groq.com/keys"},{id:"gemini",label:"Google Gemini 2.0 Flash (free)",provider:"openai",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",defaultModel:"gemini-2.0-flash",freeNote:"15 RPM · 1 000 000 tokens/day · no credit card",apiKeyUrl:"https://aistudio.google.com/apikey"},{id:"openai",label:"OpenAI (paid)",provider:"openai",baseUrl:"",defaultModel:"gpt-4o-mini",freeNote:"",apiKeyUrl:"https://platform.openai.com/api-keys"},{id:"anthropic",label:"Anthropic (paid)",provider:"anthropic",baseUrl:"",defaultModel:"claude-3-5-haiku-20241022",freeNote:"",apiKeyUrl:"https://console.anthropic.com/settings/keys"}];let be=I("ollama"),Rt=I("ollama"),ut=I(""),at=I(""),Ze=I("");const Pt={};let ui="ollama";function wt(se,Ee){return se==="anthropic"?"anthropic":se==="ollama"?"ollama":Ee?Ee.includes("localhost:1234")?"lmstudio":Ee.includes("groq.com")?"groq":Ee.includes("googleapis.com")?"gemini":"openai":"openai"}function Ft(){Pt[ui]={baseUrl:c(ut),model:c(at),apiKey:c(Ze)};const se=kt.find(Le=>Le.id===c(be));if(!se)return;m(Rt,se.provider,!0);const Ee=Pt[c(be)];m(ut,(Ee==null?void 0:Ee.baseUrl)??se.baseUrl,!0),m(at,(Ee==null?void 0:Ee.model)??se.defaultModel,!0),m(Ze,(Ee==null?void 0:Ee.apiKey)??"",!0),ui=c(be)}const Vt=Tt(()=>kt.find(se=>se.id===c(be)));let zt=I(Ei({}));const Zt=new Set(["url","name","variablePrefix","disableVariables","mqttUsername","mqttPassword","mqttCa","mqttCert","mqttKey","mqttVersion","port","bindAddress","auth","password","proxyHeader","proxyLogoutUrl","dir","disableWatch","gitAutoCommit","gitAutoPush","latitude","longitude","timezone","verbosity","dbPath","dbPrefix","dbPublish","dbRetain","redis","ai"]);$n(()=>{if(!c(Se))return;const se=typeof c(De)=="number"?c(De):48.7408,Ee=typeof c(oe)=="number"?c(oe):9.1778,Le=Tf.map(c(Se)).setView([se,Ee],10);Tf.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(Le);const Y=Tf.marker([se,Ee],{draggable:!0}).addTo(Le);m(xe,Y,!0);const Oe=Ve=>{m(De,+Ve.lat.toFixed(6)),m(oe,+Ve.lng.toFixed(6))};return Y.on("dragend",()=>Oe(Y.getLatLng())),Le.on("click",Ve=>{Y.setLatLng(Ve.latlng),Oe(Ve.latlng)}),()=>{m(xe,null),Le.remove()}}),$n(()=>{!c(xe)||c(De)===""||c(oe)===""||c(xe).setLatLng([Number(c(De)),Number(c(oe))])});let mt;function Mi(){if(!navigator.geolocation){mt.show("Geolocation is not supported by this browser.",{alert:!0});return}m(Re,!0),navigator.geolocation.getCurrentPosition(se=>{m(De,+se.coords.latitude.toFixed(6)),m(oe,+se.coords.longitude.toFixed(6)),m(Re,!1)},()=>{m(Re,!1)})}let Ri=I(!0),Di=I(!1),Ui=I(""),ji=I(""),Bi=I(""),fn=I("appearance");const an=[{id:"appearance",label:"Appearance",terms:["theme","color","dark","light"]},{id:"auth",label:"Authentication",terms:["auth","password","login","proxy","header","nginx","authentik","secure"]},{id:"mqtt",label:"MQTT",terms:["broker","url","client","name","variable","prefix","protocol","version","mqtt5"]},{id:"webserver",label:"Web server",terms:["port","http","server","bind","address"]},{id:"scripts",label:"Scripts",terms:["directory","watch","hot reload","dir"]},{id:"git",label:"Git",terms:["git","auto commit","auto push","commit","push","repository"]},{id:"solar",label:"Location",terms:["latitude","longitude","sunrise","sunset","geo","timezone","time zone","iana","schedule"]},{id:"logging",label:"Logging",terms:["verbosity","debug","info","warn","error"]},{id:"shedb",label:"sheDB",terms:["database","db","path","retain"]},{id:"redis",label:"Redis",terms:["redis","cache"]},{id:"ai",label:"AI Assistant",terms:["llm","ollama","openai","anthropic","model","provider","base url"]}];let Zi=Tt(()=>an.filter(se=>{const Ee=c(Bi).trim().toLowerCase();return!Ee||se.label.toLowerCase().includes(Ee)||se.terms.some(Le=>Le.includes(Ee))}));function _n(se){var Ee;m(fn,se,!0),(Ee=document.getElementById("sec-"+se))==null||Ee.scrollIntoView({behavior:"smooth",block:"start"})}Ks(async()=>{try{const se=await Xf();se.dataDir&&m(i,se.dataDir,!0)}catch{}try{const se=await Il();if(typeof se.url=="string"&&se.url)try{const Y=new URL(se.url);m(n,Y.protocol.replace(":",""),!0),m(s,Y.host,!0)}catch{m(s,se.url,!0)}typeof se.mqttUsername=="string"&&m(r,se.mqttUsername,!0),typeof se.mqttPassword=="string"&&m(a,se.mqttPassword,!0),typeof se.mqttCa=="string"&&m(d,se.mqttCa,!0),typeof se.mqttCert=="string"&&m(u,se.mqttCert,!0),typeof se.mqttKey=="string"&&m(f,se.mqttKey,!0),typeof se.mqttVersion=="string"&&m(C,se.mqttVersion,!0),typeof se.name=="string"&&m(g,se.name,!0),typeof se.variablePrefix=="string"&&m(p,se.variablePrefix,!0),typeof se.disableVariables=="boolean"&&m(b,se.disableVariables,!0),typeof se.port=="number"&&m(y,se.port,!0),typeof se.bindAddress=="string"&&m(w,se.bindAddress,!0),typeof se.auth=="string"&&m(A,se.auth,!0),typeof se.proxyHeader=="string"&&m(M,se.proxyHeader,!0),typeof se.proxyLogoutUrl=="string"&&m(R,se.proxyLogoutUrl,!0),typeof se.dir=="string"&&m(Q,se.dir,!0),typeof se.disableWatch=="boolean"&&m(ne,se.disableWatch,!0),typeof se.gitAutoCommit=="boolean"&&m(de,se.gitAutoCommit,!0),typeof se.gitAutoPush=="boolean"&&m(te,se.gitAutoPush,!0),typeof se.latitude=="number"&&m(De,se.latitude,!0),typeof se.longitude=="number"&&m(oe,se.longitude,!0),typeof se.timezone=="string"&&m(he,se.timezone,!0),typeof se.verbosity=="string"&&m(et,se.verbosity,!0),typeof se.dbPath=="string"&&m(We,se.dbPath,!0),typeof se.dbPrefix=="string"&&m(_e,se.dbPrefix,!0),typeof se.dbPublish=="boolean"&&m(dt,se.dbPublish,!0),typeof se.dbRetain=="boolean"&&m(Wt,se.dbRetain,!0);const Ee=se.redis;Ee!=null&&Ee.url&&m(tt,Ee.url,!0);const Le=se.ai;Le!=null&&Le.provider&&m(Rt,Le.provider,!0),Le!=null&&Le.baseUrl&&m(ut,Le.baseUrl,!0),Le!=null&&Le.model&&m(at,Le.model,!0),Le!=null&&Le.apiKey&&m(Ze,Le.apiKey,!0),m(be,wt(c(Rt),c(ut)),!0),ui=c(be),m(zt,Object.fromEntries(Object.entries(se).filter(([Y])=>!Zt.has(Y))),!0)}catch(se){m(ji,se.message,!0)}finally{m(Ri,!1)}});async function gt(){if(m(W,""),m(V,""),c(A)==="password"&&!c(P)){m(W,"A password is required to enable password authentication.");return}m(T,!0);try{await T$(c(A),c(A)==="password"?c(P):void 0,c(A)==="proxy"?c(M):void 0,c(A)==="proxy"?c(R):void 0),m(P,""),m(V,"Authentication settings saved.")}catch(se){m(W,se.message,!0)}finally{m(T,!1)}}async function Yt(){m(ji,""),m(Ui,"");const se={...c(zt)};c(s)&&(se.url=`${c(n)}://${c(s)}`),se.name=c(g),se.variablePrefix=c(p),c(C)&&(se.mqttVersion=c(C)),c(b)&&(se.disableVariables=!0),c(r)&&(se.mqttUsername=c(r)),c(a)&&(se.mqttPassword=c(a)),c(d)&&(se.mqttCa=c(d)),c(u)&&(se.mqttCert=c(u)),c(f)&&(se.mqttKey=c(f)),c(y)!==""&&(se.port=Number(c(y))),c(w)&&(se.bindAddress=c(w)),c(Q)&&(se.dir=c(Q)),c(ne)&&(se.disableWatch=!0),c(de)&&(se.gitAutoCommit=!0),c(te)&&(se.gitAutoPush=!0),c(De)!==""&&(se.latitude=Number(c(De))),c(oe)!==""&&(se.longitude=Number(c(oe))),c(he)&&(se.timezone=c(he)),se.verbosity=c(et),c(We)&&(se.dbPath=c(We),c(_e)&&(se.dbPrefix=c(_e)),c(dt)&&(se.dbPublish=!0,c(Wt)&&(se.dbRetain=!0))),c(tt)&&(se.redis={url:c(tt)}),c(Rt)&&(se.ai={provider:c(Rt),...c(ut)?{baseUrl:c(ut)}:{},...c(at)?{model:c(at)}:{},...c(Ze)?{apiKey:c(Ze)}:{}}),m(Di,!0);try{const Ee=await ap(se);window.dispatchEvent(new CustomEvent("she:config-changed")),m(Ui,Ee.restartRequired?"Saved — restart required to apply changes.":"Saved.",!0)}catch(Ee){m(ji,Ee.message,!0)}finally{m(Di,!1)}}var Ci=zZ(),Wi=yt(Ci);us(qc(Wi,{}),se=>mt=se,()=>mt);var Pi=v(Wi,2),Ti=_(Pi),Oi=_(Ti),Qi=v(_(Oi),2),yi=v(Oi,2);ei(yi,21,()=>an,se=>se.id,(se,Ee)=>{var Le=Es(),Y=yt(Le);{var Oe=ye=>{var At=fZ();let Ot;var ri=_(At);j(()=>{Ot=Bt(At,1,"section-link svelte-767znw",null,Ot,{active:c(fn)===c(Ee).id}),O(ri,c(Ee).label)}),$("click",At,()=>_n(c(Ee).id)),D(ye,At)},Ve=Tt(()=>c(Zi).some(ye=>ye.id===c(Ee).id));z(Y,ye=>{c(Ve)&&ye(Oe)})}D(se,Le)});var Xe=v(Ti,2),St=_(Xe),Ai=v(_(St),2);{var ki=se=>{var Ee=gZ(),Le=_(Ee);j(()=>O(Le,c(ji))),D(se,Ee)};z(Ai,se=>{c(ji)&&se(ki)})}var fi=v(Ai,2);{var Ii=se=>{var Ee=pZ(),Le=_(Ee);j(()=>O(Le,c(Ui))),D(se,Ee)};z(fi,se=>{c(Ui)&&se(Ii)})}var X=v(fi,2),Ae=_(X),qe=v(St,2);{var nt=se=>{var Ee=xZ();D(se,Ee)},qt=se=>{var Ee=WZ(),Le=_(Ee);{var Y=ae=>{var pe=mZ(),Te=v(_(pe),2),me=v(_(Te),2),Ie=_(me);Ie.value=Ie.__value="dark";var lt=v(Ie);lt.value=lt.__value="light";var G=v(lt);G.value=G.__value="system",$("change",me,()=>oZ(c(t))),Fs(me,()=>c(t),re=>m(t,re)),D(ae,pe)},Oe=Tt(()=>c(Zi).some(ae=>ae.id==="appearance"));z(Le,ae=>{c(Oe)&&ae(Y)})}var Ve=v(Le,2);{var ye=ae=>{var pe=_Z(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Transport protocol. Use mqtts or wss for TLS encryption.");var lt=v(me,2),G=_(lt);G.value=G.__value="mqtt";var re=v(G);re.value=re.__value="mqtts";var Ne=v(re);Ne.value=Ne.__value="ws";var it=v(Ne);it.value=it.__value="wss";var Pe=v(Te,2),ke=_(Pe),bt=v(_(ke));jn(bt,()=>"Hostname and optional port of the MQTT broker. Example: 192.168.1.1:1883. Leave empty to run without MQTT.");var vt=v(ke,2),Fe=v(Pe,2),Dt=_(Fe),Ge=v(_(Dt));jn(Ge,()=>"MQTT broker username. Leave empty if the broker does not require authentication.");var ze=v(Dt,2),Je=v(Fe,2),Ct=_(Je),$e=v(_(Ct));jn($e,()=>"MQTT broker password. Stored in plain text in config.json.");var It=v(Ct,2),Me=v(Je,2);{var st=kn=>{var ss=vZ(),ps=yt(ss),zi=_(ps),Ys=v(_(zi));jn(Ys,()=>"PEM-encoded CA certificate to verify the broker's TLS certificate. Leave empty to use the system's default CA store.");var Pn=v(zi,2),Vn=v(ps,2),Ts=_(Vn),dr=v(_(Ts));jn(dr,()=>"PEM-encoded client certificate for mutual TLS authentication.");var Or=v(Ts,2),Za=v(Vn,2),Xa=_(Za),ur=v(_(Xa));jn(ur,()=>"PEM-encoded private key matching the client certificate.");var ga=v(Xa,2);jt(Pn,()=>c(d),Hr=>m(d,Hr)),jt(Or,()=>c(u),Hr=>m(u,Hr)),jt(ga,()=>c(f),Hr=>m(f,Hr)),D(kn,ss)};z(Me,kn=>{(c(n)==="mqtts"||c(n)==="wss")&&kn(st)})}var Lt=v(Me,2),Ht=_(Lt),pt=v(_(Ht));jn(pt,()=>"MQTT protocol version used when connecting to the broker. Choose 5 only if your broker supports MQTT 5.0. Default: 3.1.1 (mqtt.js default).");var vi=v(Ht,2),wi=_(vi);wi.value=wi.__value="";var qi=v(wi);qi.value=qi.__value="5";var Fi=v(Lt,2),Gi=_(Fi),Li=v(_(Gi));jn(Li,()=>'MQTT client ID and topic prefix used for the "connected" status message. Default: she');var ni=v(Gi,2),ii=v(Fi,2),Xi=_(ii),Ji=v(_(Xi));jn(Ji,()=>"Topic prefix for the variable system (var/set/name → var/status/name). Default: var");var Ln=v(Xi,2),Jn=v(ii,2),Ss=v(_(Jn),2),as=_(Ss),Bs=v(as,4);jn(Bs,()=>"When enabled, var/set/… messages are not processed and no var/status/… retained messages are published."),Fs(lt,()=>c(n),kn=>m(n,kn)),jt(vt,()=>c(s),kn=>m(s,kn)),jt(ze,()=>c(r),kn=>m(r,kn)),jt(It,()=>c(a),kn=>m(a,kn)),Fs(vi,()=>c(C),kn=>m(C,kn)),jt(ni,()=>c(g),kn=>m(g,kn)),jt(Ln,()=>c(p),kn=>m(p,kn)),Cs(as,()=>c(b),kn=>m(b,kn)),D(ae,pe)},At=Tt(()=>c(Zi).some(ae=>ae.id==="mqtt"));z(Ve,ae=>{c(At)&&ae(ye)})}var Ot=v(Ve,2);{var ri=ae=>{var pe=wZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"none: no authentication required. password: single-user password login. proxy: trust a header set by nginx/authentik.");var lt=v(me,2),G=_(lt);G.value=G.__value="none";var re=v(G);re.value=re.__value="password";var Ne=v(re);Ne.value=Ne.__value="proxy";var it=v(Te,2);{var Pe=$e=>{var It=bZ(),Me=_(It),st=_(Me),Lt=v(st);jn(Lt,()=>"Set a new password. Leave empty to keep the current password (if already set).");var Ht=v(Me,2);j(()=>O(st,`${c(P)?"New password":"Password"} `)),jt(Ht,()=>c(P),pt=>m(P,pt)),D($e,It)};z(it,$e=>{c(A)==="password"&&$e(Pe)})}var ke=v(it,2);{var bt=$e=>{var It=CZ(),Me=yt(It),st=_(Me),Lt=v(_(st));jn(Lt,()=>"The HTTP header that nginx/authentik sets after successful authentication. Default: X-Remote-User");var Ht=v(st,2),pt=v(Me,2),vi=_(pt),wi=v(_(vi));jn(wi,()=>"URL to redirect to when the user clicks Logout (e.g. https://auth.example.com/application/o/she/end-session/ for Authentik). Leave empty to do nothing on logout.");var qi=v(vi,2);jt(Ht,()=>c(M),Fi=>m(M,Fi)),jt(qi,()=>c(R),Fi=>m(R,Fi)),D($e,It)};z(ke,$e=>{c(A)==="proxy"&&$e(bt)})}var vt=v(ke,2);{var Fe=$e=>{var It=EZ(),Me=_(It);j(()=>O(Me,c(W))),D($e,It)};z(vt,$e=>{c(W)&&$e(Fe)})}var Dt=v(vt,2);{var Ge=$e=>{var It=yZ(),Me=_(It);j(()=>O(Me,c(V))),D($e,It)};z(Dt,$e=>{c(V)&&$e(Ge)})}var ze=v(Dt,2),Je=v(_(ze),2),Ct=_(Je);j(()=>{Je.disabled=c(T)||c(A)==="password"&&!c(P),O(Ct,c(T)?"Saving…":"Apply authentication settings")}),Fs(lt,()=>c(A),$e=>m(A,$e)),$("click",Je,gt),D(ae,pe)},oi=Tt(()=>c(Zi).some(ae=>ae.id==="auth"));z(Ot,ae=>{c(oi)&&ae(ri)})}var xi=v(Ot,2);{var Ut=ae=>{var pe=SZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"HTTP server port. Use 0 to let the OS pick a free port. Default: 8080");var lt=v(me,2),G=v(Te,2),re=_(G),Ne=v(_(re));jn(Ne,()=>"Interface she listens on. Use 127.0.0.1 when running behind nginx (recommended with proxy auth). Default: 0.0.0.0");var it=v(re,2);jt(lt,()=>c(y),Pe=>m(y,Pe)),jt(it,()=>c(w),Pe=>m(w,Pe)),D(ae,pe)},mi=Tt(()=>c(Zi).some(ae=>ae.id==="webserver"));z(xi,ae=>{c(mi)&&ae(Ut)})}var He=v(xi,2);{var Ye=ae=>{var pe=DZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Directory that is watched for .js script files. Defaults to {dataDir}/scripts");var lt=v(me,2),G=v(Te,2),re=v(_(G),2),Ne=_(re),it=v(Ne,4);jn(it,()=>"When enabled the daemon will not watch for file changes and will not hot-reload scripts."),j(()=>ln(lt,"placeholder",`${c(i)??""}/scripts (default)`)),jt(lt,()=>c(Q),Pe=>m(Q,Pe)),Cs(Ne,()=>c(ne),Pe=>m(ne,Pe)),D(ae,pe)},Qt=Tt(()=>c(Zi).some(ae=>ae.id==="scripts"));z(He,ae=>{c(Qt)&&ae(Ye)})}var Gt=v(He,2);{var gi=ae=>{var pe=AZ(),Te=v(_(pe),2),me=v(_(Te),2),Ie=_(me),lt=v(Ie,4);jn(lt,()=>"When enabled, saving or renaming/deleting a script automatically creates a git commit. Only effective when the scripts directory is inside a git repository.");var G=v(Te,2),re=v(_(G),2),Ne=_(re),it=v(Ne,4);jn(it,()=>"When enabled, every commit (manual or automatic) is immediately pushed to the remote."),Cs(Ie,()=>c(de),Pe=>m(de,Pe)),Cs(Ne,()=>c(te),Pe=>m(te,Pe)),D(ae,pe)},Jt=Tt(()=>c(Zi).some(ae=>ae.id==="git"));z(Gt,ae=>{c(Jt)&&ae(gi)})}var fe=v(Gt,2);{var Ke=ae=>{var pe=BZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"IANA timezone for cron scheduling (e.g. Europe/Berlin). Leave empty to use the system timezone. Requires daemon restart.");var lt=v(me,2),G=v(lt,2);ei(G,20,()=>{var Ht;return((Ht=Intl.supportedValuesOf)==null?void 0:Ht.call(Intl,"timeZone"))??[]},Ni,(Ht,pt)=>{var vi=TA(),wi=_(vi),qi={};j(()=>{O(wi,pt),qi!==(qi=pt)&&(vi.value=(vi.__value=pt)??"")}),D(Ht,vi)});var re=v(Te,2),Ne=_(re),it=v(_(Ne));jn(it,()=>"Geographic latitude used for sunrise/sunset calculations. Default: 48.7408 (Stuttgart)");var Pe=v(Ne,2),ke=v(re,2),bt=_(ke),vt=v(_(bt));jn(vt,()=>"Geographic longitude used for sunrise/sunset calculations. Default: 9.1778 (Stuttgart)");var Fe=v(bt,2),Dt=v(ke,2),Ge=v(_(Dt),2),ze=_(Ge),Je=_(ze);{var Ct=Ht=>{var pt=_o("…");D(Ht,pt)},$e=Ht=>{var pt=_o("📍 Use my location");D(Ht,pt)};z(Je,Ht=>{c(Re)?Ht(Ct):Ht($e,-1)})}var It=v(ze,2),Me=_(It),st=v(Dt,2);{var Lt=Ht=>{var pt=kZ(),vi=v(_(pt),2);us(vi,wi=>m(Se,wi),()=>c(Se)),D(Ht,pt)};z(st,Ht=>{c(ge)&&Ht(Lt)})}j(()=>{ze.disabled=c(Re),O(Me,c(ge)?"Hide map":"Pick on map")}),jt(lt,()=>c(he),Ht=>m(he,Ht)),jt(Pe,()=>c(De),Ht=>m(De,Ht)),jt(Fe,()=>c(oe),Ht=>m(oe,Ht)),$("click",ze,Mi),$("click",It,()=>m(ge,!c(ge))),D(ae,pe)},ot=Tt(()=>c(Zi).some(ae=>ae.id==="solar"));z(fe,ae=>{c(ot)&&ae(Ke)})}var rt=v(fe,2);{var ht=ae=>{var pe=FZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Minimum log level. debug shows all messages including MQTT traffic details.");var lt=v(me,2),G=_(lt);G.value=G.__value="debug";var re=v(G);re.value=re.__value="info";var Ne=v(re);Ne.value=Ne.__value="warn";var it=v(Ne);it.value=it.__value="error",Fs(lt,()=>c(et),Pe=>m(et,Pe)),D(ae,pe)},_t=Tt(()=>c(Zi).some(ae=>ae.id==="logging"));z(rt,ae=>{c(_t)&&ae(ht)})}var Xt=v(rt,2);{var F=ae=>{var pe=IZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Path to the sheDB data directory. Defaults to {dataDir}/db. Leave empty to disable sheDB.");var lt=v(me,2),G=v(Te,2),re=_(G),Ne=v(_(re));jn(Ne,()=>"Prefix for all sheDB MQTT topics. Defaults to she/db/ — documents publish to {prefix}doc/{id}, views to {prefix}view/{id}, commands use {prefix}set/{id} etc.");var it=v(re,2),Pe=v(G,2),ke=v(_(Pe),2);let bt;var vt=_(ke),Fe=v(vt,4);jn(Fe,()=>'When enabled, every document change is published to {dbPrefix}doc/{id}. Individual views can publish independently via their own "mqttpub" setting.');var Dt=v(Pe,2);{var Ge=ze=>{var Je=LZ(),Ct=v(_(Je),2);let $e;var It=_(Ct),Me=v(It,4);jn(Me,()=>"When enabled, MQTT messages for document changes are published as retained messages."),j(()=>{$e=Bt(Ct,1,"check-label svelte-767znw",null,$e,{muted:!c(We)}),It.disabled=!c(We)}),Cs(It,()=>c(Wt),st=>m(Wt,st)),D(ze,Je)};z(Dt,ze=>{c(dt)&&ze(Ge)})}j(()=>{ln(lt,"placeholder",`defaults to ${c(i)??""}/db`),it.disabled=!c(We),bt=Bt(ke,1,"check-label svelte-767znw",null,bt,{muted:!c(We)}),vt.disabled=!c(We)}),jt(lt,()=>c(We),ze=>m(We,ze)),jt(it,()=>c(_e),ze=>m(_e,ze)),Cs(vt,()=>c(dt),ze=>m(dt,ze)),D(ae,pe)},H=Tt(()=>c(Zi).some(ae=>ae.id==="shedb"));z(Xt,ae=>{c(H)&&ae(F)})}var K=v(Xt,2);{var le=ae=>{var pe=PZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"redis:// URL for the optional Redis write-through cache. All state store changes are written to the she:state hash. Leave empty to disable.");var lt=v(me,2);jt(lt,()=>c(tt),G=>m(tt,G)),D(ae,pe)},Z=Tt(()=>c(Zi).some(ae=>ae.id==="redis"));z(K,ae=>{c(Z)&&ae(le)})}var J=v(K,2);{var ce=ae=>{var pe=HZ(),Te=v(_(pe),2),me=_(Te),Ie=v(_(me));jn(Ie,()=>"Choose a provider. Free options need a free API key from the provider's website — no credit card required.");var lt=v(me,2);ei(lt,21,()=>kt,Ni,(Ge,ze)=>{var Je=TA(),Ct=_(Je),$e={};j(()=>{O(Ct,c(ze).label),$e!==($e=c(ze).id)&&(Je.value=(Je.__value=c(ze).id)??"")}),D(Ge,Je)});var G=v(Te,2);{var re=Ge=>{var ze=RZ();let Je;var Ct=_(ze);{var $e=st=>{var Lt=TZ(),Ht=v(yt(Lt));j(()=>O(Ht,` ${c(Vt).freeNote??""}`)),D(st,Lt)};z(Ct,st=>{c(Vt).freeNote&&st($e)})}var It=v(Ct,2);{var Me=st=>{var Lt=MZ(),Ht=v(yt(Lt));j(()=>ln(Ht,"href",c(Vt).apiKeyUrl)),D(st,Lt)};z(It,st=>{c(Vt).apiKeyUrl&&st(Me)})}j(()=>Je=Bt(ze,1,"preset-note svelte-767znw",null,Je,{free:!!c(Vt).freeNote})),D(Ge,ze)};z(G,Ge=>{var ze,Je;((ze=c(Vt))!=null&&ze.freeNote||(Je=c(Vt))!=null&&Je.apiKeyUrl)&&Ge(re)})}var Ne=v(G,2);{var it=Ge=>{var ze=NZ(),Je=_(ze),Ct=v(_(Je));jn(Ct,()=>"Base URL of the LLM API. Auto-filled for cloud presets. For Ollama: http://localhost:11434.");var $e=v(Je,2);j(()=>{var It;return ln($e,"placeholder",c(be)==="ollama"?"http://localhost:11434":c(be)==="lmstudio"?"http://localhost:1234":((It=c(Vt))==null?void 0:It.baseUrl)??"")}),jt($e,()=>c(ut),It=>m(ut,It)),D(Ge,ze)};z(Ne,Ge=>{c(be)!=="anthropic"&&Ge(it)})}var Pe=v(Ne,2),ke=_(Pe),bt=v(_(ke));jn(bt,()=>"Model identifier. Suggested default is filled in when you choose a preset.");var vt=v(ke,2),Fe=v(Pe,2);{var Dt=Ge=>{var ze=OZ(),Je=_(ze),Ct=v(_(Je));jn(Ct,()=>"Stored in config.json. Not needed for local providers.");var $e=v(Je,2);jt($e,()=>c(Ze),It=>m(Ze,It)),D(Ge,ze)};z(Fe,Ge=>{c(be)!=="ollama"&&c(be)!=="lmstudio"&&Ge(Dt)})}j(()=>{var Ge;return ln(vt,"placeholder",((Ge=c(Vt))==null?void 0:Ge.defaultModel)||"e.g. llama3.2")}),$("change",lt,Ft),Fs(lt,()=>c(be),Ge=>m(be,Ge)),jt(vt,()=>c(at),Ge=>m(at,Ge)),D(ae,pe)},Qe=Tt(()=>c(Zi).some(ae=>ae.id==="ai"));z(J,ae=>{c(Qe)&&ae(ce)})}D(se,Ee)};z(qe,se=>{c(Ri)?se(nt):se(qt,-1)})}j(()=>{X.disabled=c(Di),O(Ae,c(Di)?"Saving…":"Save")}),jt(Qi,()=>c(Bi),se=>m(Bi,se)),$("click",X,Yt),D(o,Ci),js()}Zs(["click","change"]);var jZ=B("<option> </option>"),$Z=B('<div><span class="ts svelte-18loop9"> </span> <span class="lvl svelte-18loop9"> </span> <span class="msg svelte-18loop9"> </span></div>'),UZ=B('<div class="page svelte-18loop9"><div class="toolbar svelte-18loop9"><h2 class="svelte-18loop9">Logs</h2> <select class="svelte-18loop9"></select> <input class="filter-in svelte-18loop9" type="search" placeholder="Filter messages…"/> <label class="check-label svelte-18loop9" title="Interpret filter as a regular expression"><input type="checkbox" class="svelte-18loop9"/> <span class="checkmark svelte-18loop9"></span> Regex</label> <label class="check-label svelte-18loop9"><input type="checkbox" class="svelte-18loop9"/> <span class="checkmark svelte-18loop9"></span> Auto-scroll</label> <button class="svelte-18loop9">Clear</button></div> <div class="log svelte-18loop9"></div></div>');function qZ(o,e){Vs(e,!0);let t=I(Ei(yF())),i,n=I(!0),s=I("all"),r=I(""),a=I(!1);const d=["all","debug","info","warn","error"],u={debug:0,info:1,warn:2,error:3};lS(W=>{m(t,[...c(t).slice(-1999),W],!0)}),Ks(()=>{i&&(i.scrollTop=i.scrollHeight)}),$n(()=>{c(t).length,c(n)&&i&&(i.scrollTop=i.scrollHeight)});function f(){m(t,[],!0)}function g(W){if(c(s)!=="all"&&u[W.level]<u[c(s)])return!1;if(!c(r))return!0;if(c(a))try{return new RegExp(c(r),"i").test(W.msg)}catch{}return W.msg.toLowerCase().includes(c(r).toLowerCase())}function p(W){return new Date(W).toLocaleTimeString()}var C=UZ(),b=_(C),y=v(_(b),2);ei(y,21,()=>d,Ni,(W,Q)=>{var ne=jZ(),de=_(ne),te={};j(()=>{O(de,c(Q)),te!==(te=c(Q))&&(ne.value=(ne.__value=c(Q))??"")}),D(W,ne)});var w=v(y,2),A=v(w,2),P=_(A),M=v(A,2),R=_(M),T=v(M,2),V=v(b,2);ei(V,21,()=>c(t).filter(g),W=>W.ts+W.msg,(W,Q)=>{var ne=$Z(),de=_(ne),te=_(de),he=v(de,2),De=_(he),oe=v(he,2),ge=_(oe);j((Se,Re)=>{Bt(ne,1,`line ${c(Q).level??""}`,"svelte-18loop9"),O(te,Se),O(De,Re),O(ge,c(Q).msg)},[()=>p(c(Q).ts),()=>c(Q).level.toUpperCase()]),D(W,ne)}),us(V,W=>i=W,()=>i),Fs(y,()=>c(s),W=>m(s,W)),jt(w,()=>c(r),W=>m(r,W)),Cs(P,()=>c(a),W=>m(a,W)),Cs(R,()=>c(n),W=>m(n,W)),$("click",T,f),D(o,C),js()}Zs(["click"]);var GZ=B('<span class="chat-model svelte-1twuiul"><!></span>'),KZ=B('<button class="clear-btn svelte-1twuiul" title="Clear conversation">✕</button>'),ZZ=B('<div class="unconfigured svelte-1twuiul">Configure an AI provider in the <strong class="svelte-1twuiul">Config</strong> tab to use the AI assistant.</div>'),XZ=B('Working on view <code class="svelte-1twuiul"> </code>',1),YZ=B('<button class="chip svelte-1twuiul"> </button>'),QZ=B('<div class="suggestions svelte-1twuiul"><p class="suggestions-hint svelte-1twuiul"><!></p> <!></div>'),JZ=B('<div class="msg-content user-text svelte-1twuiul"> </div>'),MA=B('<div class="tool-event tool-call svelte-1twuiul"><span class="tool-icon svelte-1twuiul">🔧</span><span class="tool-name svelte-1twuiul"> </span></div>'),RA=B('<div class="tool-event tool-result svelte-1twuiul"><span class="tool-icon svelte-1twuiul">✓</span><span class="tool-name svelte-1twuiul"> </span></div>'),NA=B('<div class="tool-events svelte-1twuiul"></div>'),OA=B('<div class="text-block svelte-1twuiul"></div>'),eX=B('<button class="expand-btn svelte-1twuiul"> </button>'),tX=B('<div class="code-block svelte-1twuiul"><div class="code-header svelte-1twuiul"><span class="code-lang svelte-1twuiul"> </span> <div class="code-actions svelte-1twuiul"><button class="svelte-1twuiul">Copy</button></div></div> <div><pre class="svelte-1twuiul"><code class="hljs svelte-1twuiul"></code></pre> <!></div></div>'),iX=B('<div class="apply-view-row svelte-1twuiul"><button class="apply-view-btn svelte-1twuiul"> </button></div>'),nX=B('<!> <div class="msg-content svelte-1twuiul"><!> <!></div>',1),sX=B("<div><!></div>"),oX=B('<div class="message assistant svelte-1twuiul"><div class="msg-content svelte-1twuiul"><span class="status-shimmer svelte-1twuiul"> </span></div></div>'),rX=B('<div class="code-block svelte-1twuiul"><div class="code-header svelte-1twuiul"><span class="code-lang svelte-1twuiul"> </span></div> <pre class="svelte-1twuiul"><code class="hljs svelte-1twuiul"></code></pre></div>'),aX=B('<div class="message assistant streaming svelte-1twuiul"><div class="msg-content svelte-1twuiul"></div></div>'),lX=B('<div class="chat-error svelte-1twuiul"> </div>'),cX=B('<span><span class="badge badge-db svelte-1twuiul">db</span> <span class="chip-name svelte-1twuiul"> </span> <button class="chip-remove svelte-1twuiul"> </button></span>'),dX=B('<span class="file-chip svelte-1twuiul"><span> </span> <span class="chip-name svelte-1twuiul"> </span> <button class="chip-remove svelte-1twuiul" title="Remove from context">×</button></span>'),uX=B('<button class="stop-btn svelte-1twuiul" title="Stop generation">■</button>'),hX=B('<button class="send-btn svelte-1twuiul">↑</button>'),fX=B('<option class="svelte-1twuiul"> </option>'),gX=B('<select class="model-select svelte-1twuiul"></select>'),pX=B('<span class="model-name svelte-1twuiul"> </span>'),xX=B('<button class="info-btn svelte-1twuiul" title="Model info">ℹ</button>'),mX=B('<div class="model-bar svelte-1twuiul"><span class="model-provider svelte-1twuiul"> </span> <!> <!></div>'),vX=B('<p class="info-status svelte-1twuiul">Loading…</p>'),_X=B('<p class="info-status info-err svelte-1twuiul"> </p>'),bX=B('<dt class="svelte-1twuiul">Ollama version</dt><dd class="svelte-1twuiul"> </dd>',1),CX=B('<dt class="svelte-1twuiul">Family</dt><dd class="svelte-1twuiul"> </dd>',1),EX=B('<dt class="svelte-1twuiul">Parameters</dt><dd class="svelte-1twuiul"> </dd>',1),yX=B('<dt class="svelte-1twuiul">Quantization</dt><dd class="svelte-1twuiul"> </dd>',1),wX=B('<div class="running-model svelte-1twuiul"> </div>'),SX=B('<dt class="svelte-1twuiul">Loaded</dt> <dd class="svelte-1twuiul"></dd>',1),DX=B('<dt class="svelte-1twuiul">Loaded</dt><dd class="dim svelte-1twuiul">Not in memory</dd>',1),AX=B('<dl class="svelte-1twuiul"><!> <!> <!> <!> <!></dl>'),kX=B('<div class="info-overlay svelte-1twuiul"><div class="info-popup svelte-1twuiul"><div class="info-popup-header svelte-1twuiul"><span class="svelte-1twuiul"> </span> <button title="Close" class="svelte-1twuiul">✕</button></div> <div class="info-popup-body svelte-1twuiul"><!></div></div></div>'),BX=B('<div class="chat-panel svelte-1twuiul"><div class="chat-header svelte-1twuiul"><span class="chat-title svelte-1twuiul">AI — View assistant</span> <!> <!></div> <div class="messages svelte-1twuiul"><!> <!> <!> <!> <!></div> <!> <div class="context-row svelte-1twuiul"><label title="Include sheDB document IDs in context" class="svelte-1twuiul"><input type="checkbox" class="svelte-1twuiul"/><span class="checkmark svelte-1twuiul"></span> Doc IDs</label> <label title="Include sample document content in context (first 10 docs)" class="svelte-1twuiul"><input type="checkbox" class="svelte-1twuiul"/><span class="checkmark svelte-1twuiul"></span> Sample docs</label> <label title="Let the AI query sheDB documents on demand. Disables real-time streaming." class="svelte-1twuiul"><input type="checkbox" class="svelte-1twuiul"/><span class="checkmark svelte-1twuiul"></span> 😎 Agent</label> <span class="req-size svelte-1twuiul"> </span></div> <div class="files-row svelte-1twuiul"><!> <!> <button class="add-file-btn svelte-1twuiul" title="Attach file to context">+</button> <input type="file" multiple="" class="file-input-hidden svelte-1twuiul"/></div> <div><div><textarea rows="3" class="svelte-1twuiul"></textarea></div> <!></div> <!></div> <!>',1);function FX(o,e){Vs(e,!0),Rv.registerLanguage("javascript",kF),es.use({breaks:!0,gfm:!0});let t=wu(e,"currentView",3,null);const i="she:viewchat:messages";let n=I(Ei(JSON.parse(localStorage.getItem(i)??"[]"))),s=I(null),r=I(""),a=I(!1),d=I(""),u=I(null),f=I(Ei([])),g=I(Ei(localStorage.getItem("she:selectedModel")??""));$n(()=>{localStorage.setItem(i,JSON.stringify(c(n)))});let p=I(Ei(new Set)),C=I(!1),b=I(null),y=I(!1),w=I(""),A=null,P=I(0);const M=["[core] reticulating splines…","[io] calibrating the flux capacitor…","[net] pinging the oracle (no response)…","[gpu] overclocking the neurons…","[fs] loading sarcasm module v4.2…","[mem] defragmenting the embedding space…","[sched] running gradient descent into madness…","[net] synchronizing with the hive mind…","[model] tickling the transformer…","[io] consulting rubber duck debugger…"];let R=I(!0),T=I(!0),V=I(!0),W=I(Ei([])),Q=I(!0),ne=I(!1),de,te=I(Ei([])),he=I(0),De,oe;const ge=Tt(()=>({apiref:!1,shedb:c(R),sampleDocs:c(T),tools:c(V)})),Se=Tt(()=>{var F;return((F=c(u))==null?void 0:F.configured)??!1}),Re=Tt(()=>c(he)+new TextEncoder().encode(c(r)).length),xe=Tt(()=>c(Q)?t():null);async function et(){try{const F=await xF();m(u,F,!0),F.configured&&!c(g)&&m(g,F.model,!0)}catch{}}$n(()=>(window.addEventListener("she:config-changed",et),()=>window.removeEventListener("she:config-changed",et))),Ks(()=>{et()}),$n(()=>{c(g)&&localStorage.setItem("she:selectedModel",c(g))}),$n(()=>{var F;(F=c(u))!=null&&F.provider&&mF().then(H=>{m(f,H.models,!0),!c(g)&&H.models.length>0&&m(g,H.models[0],!0)}).catch(()=>{})}),$n(()=>{c(g),m(b,null),m(w,"")}),$n(()=>{const F=c(ge),H=c(xe),K=c(W);c(Se)&&vF({context:F,currentView:H??null,extraFiles:K.length>0?K:void 0}).then(le=>{m(he,new TextEncoder().encode(le.prompt).length,!0)}).catch(()=>{})}),$n(()=>{if(!c(a))return;m(P,Math.floor(Math.random()*M.length),!0);const F=setInterval(()=>{m(P,(c(P)+1)%M.length)},1e4);return()=>clearInterval(F)}),$n(()=>{var F;oe&&(c(n).length+(((F=c(s))==null?void 0:F.length)??0),requestAnimationFrame(()=>{oe&&(oe.scrollTop=oe.scrollHeight)}))});function We(F){const H=[],K=/```(\w*)\n([\s\S]*?)```/g;let le=0,Z;for(;(Z=K.exec(F))!==null;)Z.index>le&&H.push({type:"text",text:F.slice(le,Z.index)}),H.push({type:"code",lang:Z[1]||"text",text:Z[2].trimEnd()}),le=Z.index+Z[0].length;return le<F.length&&H.push({type:"text",text:F.slice(le)}),H}function _e(F){const H=[],K=/```(\w*)\n([\s\S]*?)```/g;let le=0,Z;for(;(Z=K.exec(F))!==null;)Z.index>le&&H.push({type:"text",text:F.slice(le,Z.index)}),H.push({type:"code",lang:Z[1]||"text",text:Z[2].trimEnd()}),le=Z.index+Z[0].length;const J=F.slice(le),ce=J.match(/```(\w*)\n([\s\S]*)$/);return ce?(ce.index>0&&H.push({type:"text",text:J.slice(0,ce.index)}),H.push({type:"code",lang:ce[1]||"text",text:ce[2]})):J&&H.push({type:"text",text:J}),H}function dt(F){const H={};for(const K of F)if(K.type==="code"){if(K.lang==="filter")H.filter=K.text.trim();else if(Ze(K.lang)){const le=K.text.split(`
223
223
  `)[0].trim();le==="// @view-map"?H.map=K.text.split(`
224
224
  `).slice(1).join(`
225
225
  `).trim():le==="// @view-reduce"&&(H.reduce=K.text.split(`
@@ -227,4 +227,4 @@ declare const she: {
227
227
  `).trim())}}return H}function Wt(F){return F.filter!==void 0||F.map!==void 0||F.reduce!==void 0}function tt(F){const H=[];return F.filter!==void 0&&H.push("filter"),F.map!==void 0&&H.push("map"),F.reduce!==void 0&&H.push("reduce"),`Apply ${H.join(" + ")}`}const kt=15;function be(F){return F.split(`
228
228
  `).length>kt}function Rt(F){const H=new Set(c(p));H.has(F)?H.delete(F):H.add(F),m(p,H,!0)}function ut(F,H){if(Ze(H))try{return Rv.highlight(F,{language:"javascript"}).value}catch{}return F.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function at(F){return es.parse(F)}function Ze(F){return!F||F==="js"||F==="javascript"}function Pt(F){navigator.clipboard.writeText(F).catch(()=>{})}async function ui(){if(m(C,!0),!(c(b)||c(y))){m(y,!0),m(w,"");try{m(b,await fw(c(g)||c(u).model),!0)}catch(F){m(w,F.message,!0)}m(y,!1)}}function wt(F){return F>=1e9?`${(F/1e9).toFixed(1)} GB`:F>=1e6?`${(F/1e6).toFixed(0)} MB`:`${F} B`}function Ft(F){const H=F.match(/\.([^.]+)$/);return H?H[1].toUpperCase():"?"}function Vt(F){switch(F){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"↓";case"JSON":case"JSONC":return"{}";default:return F}}function zt(F){m(W,c(W).filter((H,K)=>K!==F),!0)}function Zt(){de.click()}async function mt(F){if(!(!F||F.length===0))for(const H of Array.from(F)){const K=await H.text();m(W,[...c(W),{name:H.name,content:K}],!0)}}function Mi(F){const H=F.target;mt(H.files),H.value=""}function Ri(F){var H;F.preventDefault(),m(ne,!1),mt(((H=F.dataTransfer)==null?void 0:H.files)??null)}function Di(F){var H;(H=F.dataTransfer)!=null&&H.types.includes("Files")&&(F.preventDefault(),m(ne,!0))}function Ui(){m(ne,!1)}async function ji(){const F=c(r).trim();if(!(!F||c(a))){m(r,""),m(d,""),m(a,!0),m(n,[...c(n),{role:"user",content:F}],!0),A=new AbortController,m(te,[],!0);try{await _F({messages:c(n),currentView:c(xe),context:c(ge),modelOverride:c(g)||void 0,extraFiles:c(W).length>0?c(W):void 0},H=>{m(s,(c(s)??"")+H)},A.signal,H=>{m(te,[...c(te),H],!0)}),m(n,[...c(n),{role:"assistant",content:c(s)??"",toolEvents:c(te).length>0?[...c(te)]:void 0}],!0),m(te,[],!0)}catch(H){if(H.name==="AbortError"){const K=c(s);K!=null&&K.trim()&&m(n,[...c(n),{role:"assistant",content:K+`
229
229
 
230
- *[stopped]*`,toolEvents:c(te).length>0?[...c(te)]:void 0}],!0)}else m(d,H.message,!0)}finally{A=null,m(s,null),m(te,[],!0),m(a,!1)}}}function Bi(){A==null||A.abort()}function fn(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),ji())}function an(){m(n,[],!0),m(d,"")}const Zi=["Write a view to list all document IDs","Write a view to sum a numeric property across all documents","Write a view that filters to a specific prefix and emits a field","Write a reduce that returns the maximum value","Explain how the current view works"];function _n(F){m(r,F,!0),De==null||De.focus()}var gt=BX(),Yt=yt(gt),Ci=_(Yt),Wi=v(_(Ci),2);{var Pi=F=>{var H=GZ(),K=_(H);{var le=J=>{var ce=_o();j(()=>O(ce,`${c(u).provider??""} · ${(c(g)||c(u).model)??""}`)),D(J,ce)},Z=J=>{var ce=_o("Not configured");D(J,ce)};z(K,J=>{c(Se)?J(le):J(Z,-1)})}j(()=>ln(H,"title",`Provider: ${c(u).provider??""}`)),D(F,H)};z(Wi,F=>{c(u)&&F(Pi)})}var Ti=v(Wi,2);{var Oi=F=>{var H=KZ();$("click",H,an),D(F,H)};z(Ti,F=>{c(n).length>0&&F(Oi)})}var Qi=v(Ci,2),yi=_(Qi);{var Xe=F=>{var H=ZZ();D(F,H)},St=F=>{var H=QZ(),K=_(H),le=_(K);{var Z=Qe=>{var ae=XZ(),pe=v(yt(ae)),Te=_(pe);j(()=>O(Te,t().id)),D(Qe,ae)},J=Qe=>{var ae=_o("No view selected. Ask a general sheDB view question.");D(Qe,ae)};z(le,Qe=>{t()?Qe(Z):Qe(J,-1)})}var ce=v(K,2);ei(ce,17,()=>Zi,Ni,(Qe,ae)=>{var pe=YZ(),Te=_(pe);j(()=>O(Te,c(ae))),$("click",pe,()=>_n(c(ae))),D(Qe,pe)}),D(F,H)};z(yi,F=>{c(Se)?c(n).length===0&&c(s)===null&&F(St,1):F(Xe)})}var Ai=v(yi,2);ei(Ai,17,()=>c(n),Ni,(F,H,K)=>{var le=sX(),Z=_(le);{var J=Qe=>{var ae=JZ(),pe=_(ae);j(()=>O(pe,c(H).content)),D(Qe,ae)},ce=Qe=>{const ae=Tt(()=>We(c(H).content)),pe=Tt(()=>dt(c(ae)));var Te=nX(),me=yt(Te);{var Ie=Pe=>{var ke=NA();ei(ke,21,()=>c(H).toolEvents,Ni,(Ct,vt)=>{var Fe=Es(),Dt=yt(Fe);{var Ge=Je=>{var bt=MA(),$e=v(_(bt)),It=_($e);j(Me=>O(It,Me),[()=>c(vt).name.replace(/_/g," ")]),D(Je,bt)},ze=Je=>{var bt=RA(),$e=v(_(bt)),It=_($e);j(Me=>O(It,Me),[()=>c(vt).name.replace(/_/g," ")]),D(Je,bt)};z(Dt,Je=>{c(vt).type==="tool_call"?Je(Ge):Je(ze,-1)})}D(Ct,Fe)}),D(Pe,ke)};z(me,Pe=>{var ke;(ke=c(H).toolEvents)!=null&&ke.length&&Pe(Ie)})}var lt=v(me,2),G=_(lt);ei(G,17,()=>c(ae),Ni,(Pe,ke,Ct)=>{var vt=Es(),Fe=yt(vt);{var Dt=ze=>{var Je=OA();ac(Je,()=>at(c(ke).text),!0),D(ze,Je)},Ge=ze=>{const Je=Tt(()=>`${K}:${Ct}`),bt=Tt(()=>be(c(ke).text)),$e=Tt(()=>c(p).has(c(Je))),It=Tt(()=>c(ke).lang==="filter");var Me=tX(),st=_(Me),Lt=_(st),Ht=_(Lt),pt=v(Lt,2),vi=_(pt),wi=v(st,2);let qi;var Fi=_(wi),Gi=_(Fi);ac(Gi,()=>ut(c(ke).text,c(ke).lang??""),!0);var Li=v(Fi,2);{var ni=ii=>{var Xi=eX(),Ji=_(Xi);j(()=>O(Ji,c($e)?"▲ collapse":"▼ expand")),$("click",Xi,()=>Rt(c(Je))),D(ii,Xi)};z(Li,ii=>{c(bt)&&ii(ni)})}j(()=>{O(Ht,c(It)?"filter":c(ke).lang),qi=Bt(wi,1,"code-body svelte-1twuiul",null,qi,{collapsed:c(bt)&&!c($e)})}),$("click",vi,()=>Pt(c(ke).text)),D(ze,Me)};z(Fe,ze=>{c(ke).type==="text"?ze(Dt):ze(Ge,-1)})}D(Pe,vt)});var re=v(G,2);{var Ne=Pe=>{var ke=iX(),Ct=_(ke),vt=_(Ct);j(Fe=>O(vt,Fe),[()=>tt(c(pe))]),$("click",Ct,()=>e.onApplyView(c(pe))),D(Pe,ke)},it=Tt(()=>Wt(c(pe))&&e.onApplyView);z(re,Pe=>{c(it)&&Pe(Ne)})}D(Qe,Te)};z(Z,Qe=>{c(H).role==="user"?Qe(J):Qe(ce,-1)})}j(()=>Bt(le,1,`message ${c(H).role??""}`,"svelte-1twuiul")),D(F,le)});var ki=v(Ai,2);{var fi=F=>{var H=NA();ei(H,21,()=>c(te),Ni,(K,le)=>{var Z=Es(),J=yt(Z);{var ce=ae=>{var pe=MA(),Te=v(_(pe)),me=_(Te);j(Ie=>O(me,Ie),[()=>c(le).name.replace(/_/g," ")]),D(ae,pe)},Qe=ae=>{var pe=RA(),Te=v(_(pe)),me=_(Te);j(Ie=>O(me,Ie),[()=>c(le).name.replace(/_/g," ")]),D(ae,pe)};z(J,ae=>{c(le).type==="tool_call"?ae(ce):ae(Qe,-1)})}D(K,Z)}),D(F,H)};z(ki,F=>{c(te).length>0&&F(fi)})}var Ii=v(ki,2);{var X=F=>{var H=oX(),K=_(H),le=_(K),Z=_(le);j(()=>O(Z,M[c(P)])),D(F,H)};z(Ii,F=>{c(a)&&c(s)===null&&c(te).length===0&&F(X)})}var Ae=v(Ii,2);{var qe=F=>{var H=aX(),K=_(H);ei(K,21,()=>_e(c(s)),Ni,(le,Z)=>{var J=Es(),ce=yt(J);{var Qe=pe=>{var Te=OA();ac(Te,()=>at(c(Z).text),!0),D(pe,Te)},ae=pe=>{var Te=rX(),me=_(Te),Ie=_(me),lt=_(Ie),G=v(me,2),re=_(G);ac(re,()=>ut(c(Z).text,c(Z).lang??""),!0),j(()=>O(lt,c(Z).lang)),D(pe,Te)};z(ce,pe=>{c(Z).type==="text"?pe(Qe):pe(ae,-1)})}D(le,J)}),D(F,H)};z(Ae,F=>{c(s)!==null&&F(qe)})}us(Qi,F=>oe=F,()=>oe);var nt=v(Qi,2);{var qt=F=>{var H=lX(),K=_(H);j(()=>O(K,c(d))),D(F,H)};z(nt,F=>{c(d)&&F(qt)})}var se=v(nt,2),Ee=_(se),Le=_(Ee),Y=v(Ee,2),Oe=_(Y),Ve=v(Y,2),ye=_(Ve),At=v(Ve,2),Ot=_(At),ri=v(se,2),oi=_(ri);{var xi=F=>{var H=cX();let K;var le=v(_(H),2),Z=_(le),J=v(le,2),ce=_(J);j(()=>{K=Bt(H,1,"file-chip svelte-1twuiul",null,K,{inactive:!c(Q)}),O(Z,t().id),ln(J,"title",c(Q)?"Remove from context":"Re-add to context"),O(ce,c(Q)?"×":"+")}),$("click",J,()=>m(Q,!c(Q))),D(F,H)};z(oi,F=>{t()&&F(xi)})}var Ut=v(oi,2);ei(Ut,17,()=>c(W),Ni,(F,H,K)=>{const le=Tt(()=>Ft(c(H).name));var Z=dX(),J=_(Z),ce=_(J),Qe=v(J,2),ae=_(Qe),pe=v(Qe,2);j((Te,me)=>{Bt(J,1,`badge badge-${Te??""}`,"svelte-1twuiul"),O(ce,me),O(ae,c(H).name)},[()=>c(le).toLowerCase(),()=>Vt(c(le))]),$("click",pe,()=>zt(K)),D(F,Z)});var mi=v(Ut,2),He=v(mi,2);us(He,F=>de=F,()=>de);var Ye=v(ri,2);let Qt;var Gt=_(Ye);let gi;var Jt=_(Gt);us(Jt,F=>De=F,()=>De);var fe=v(Gt,2);{var Ke=F=>{var H=uX();$("click",H,Bi),D(F,H)},ot=F=>{var H=hX();j(K=>H.disabled=K,[()=>!c(r).trim()||!c(Se)]),$("click",H,ji),D(F,H)};z(fe,F=>{c(a)?F(Ke):F(ot,-1)})}var rt=v(Ye,2);{var ht=F=>{var H=mX(),K=_(H),le=_(K),Z=v(K,2);{var J=pe=>{var Te=gX();ei(Te,21,()=>c(f),Ni,(me,Ie)=>{var lt=fX(),G=_(lt),re={};j(()=>{O(G,c(Ie)),re!==(re=c(Ie))&&(lt.value=(lt.__value=c(Ie))??"")}),D(me,lt)}),j(()=>Te.disabled=c(a)),Fs(Te,()=>c(g),me=>m(g,me)),D(pe,Te)},ce=pe=>{var Te=pX(),me=_(Te);j(()=>O(me,c(g)||c(u).model)),D(pe,Te)};z(Z,pe=>{c(f).length>0?pe(J):pe(ce,-1)})}var Qe=v(Z,2);{var ae=pe=>{var Te=xX();$("click",Te,ui),D(pe,Te)};z(Qe,pe=>{c(u).provider==="ollama"&&pe(ae)})}j(()=>O(le,c(u).provider)),D(F,H)};z(rt,F=>{c(Se)&&c(u)&&F(ht)})}var _t=v(Yt,2);{var Xt=F=>{var H=kX(),K=_(H),le=_(K),Z=_(le),J=_(Z),ce=v(Z,2),Qe=v(le,2),ae=_(Qe);{var pe=Ie=>{var lt=vX();D(Ie,lt)},Te=Ie=>{var lt=_X(),G=_(lt);j(()=>O(G,c(w))),D(Ie,lt)},me=Ie=>{var lt=AX(),G=_(lt);{var re=ze=>{var Je=bX(),bt=v(yt(Je)),$e=_(bt);j(()=>O($e,c(b).version)),D(ze,Je)};z(G,ze=>{c(b).version&&ze(re)})}var Ne=v(G,2);{var it=ze=>{var Je=CX(),bt=v(yt(Je)),$e=_(bt);j(()=>O($e,c(b).details.family)),D(ze,Je)};z(Ne,ze=>{var Je;(Je=c(b).details)!=null&&Je.family&&ze(it)})}var Pe=v(Ne,2);{var ke=ze=>{var Je=EX(),bt=v(yt(Je)),$e=_(bt);j(()=>O($e,c(b).details.parameter_size)),D(ze,Je)};z(Pe,ze=>{var Je;(Je=c(b).details)!=null&&Je.parameter_size&&ze(ke)})}var Ct=v(Pe,2);{var vt=ze=>{var Je=yX(),bt=v(yt(Je)),$e=_(bt);j(()=>O($e,c(b).details.quantization_level)),D(ze,Je)};z(Ct,ze=>{var Je;(Je=c(b).details)!=null&&Je.quantization_level&&ze(vt)})}var Fe=v(Ct,2);{var Dt=ze=>{var Je=SX(),bt=v(yt(Je),2);ei(bt,21,()=>c(b).running,Ni,($e,It)=>{var Me=wX(),st=_(Me);j(Lt=>O(st,`${c(It).name??""} · ${Lt??""} VRAM`),[()=>wt(c(It).size_vram)]),D($e,Me)}),D(ze,Je)},Ge=ze=>{var Je=DX();D(ze,Je)};z(Fe,ze=>{c(b).running&&c(b).running.length>0?ze(Dt):c(b).running!==null&&ze(Ge,1)})}D(Ie,lt)};z(ae,Ie=>{c(y)?Ie(pe):c(w)?Ie(Te,1):c(b)&&Ie(me,2)})}j(()=>{var Ie;return O(J,`Ollama · ${(c(g)||((Ie=c(u))==null?void 0:Ie.model))??""}`)}),$("click",H,()=>m(C,!1)),$("click",K,Ie=>Ie.stopPropagation()),$("click",ce,()=>m(C,!1)),D(F,H)};z(_t,F=>{c(C)&&F(Xt)})}j(F=>{O(Ot,F),Qt=Bt(Ye,1,"input-row svelte-1twuiul",null,Qt,{"drag-over":c(ne)}),gi=Bt(Gt,1,"textarea-wrap svelte-1twuiul",null,gi,{loading:c(a)}),ln(Jt,"placeholder",c(Se)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),Jt.disabled=c(a)||!c(Se)},[()=>wt(c(Re))]),Cs(Le,()=>c(R),F=>m(R,F)),Cs(Oe,()=>c(T),F=>m(T,F)),Cs(ye,()=>c(V),F=>m(V,F)),$("click",mi,Zt),$("change",He,Mi),fs("dragover",Ye,Di),fs("dragleave",Ye,Ui),fs("drop",Ye,Ri),$("keydown",Jt,fn),jt(Jt,()=>c(r),F=>m(r,F)),D(o,gt),js()}Zs(["click","change","keydown"]);var LX=B('<div class="me svelte-1pxdb1"></div>');function qC(o,e){Vs(e,!0);let t=wu(e,"value",15,""),i=wu(e,"language",3,"javascript"),n,s,r=!1;Ks(()=>{const d=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=xr.create(n,{value:t(),language:i(),theme:"vs-dark",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', monospace",automaticLayout:!0,wordWrap:"on",lineNumbers:"on",renderLineHighlight:"none",overviewRulerLanes:0,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6},...d}),s.onDidChangeModelContent(()=>{r||t(s.getValue())})}),Tp(()=>s==null?void 0:s.dispose()),$n(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=LX();us(a,d=>n=d,()=>n),D(o,a),js()}var IX=B('<!> <div class="welcome svelte-rrt0o"><div class="welcome-inner svelte-rrt0o"><div class="welcome-logo svelte-rrt0o">db</div> <p class="welcome-sub svelte-rrt0o">sheDB — embedded JSON document store with MapReduce views</p> <div class="welcome-hint svelte-rrt0o"><strong>In scripts:</strong> use <code class="svelte-rrt0o">she.db.get(id)</code>, <code class="svelte-rrt0o">she.db.set(id, doc)</code>, <code class="svelte-rrt0o">she.db.extend(id, partial)</code>, <code class="svelte-rrt0o">she.db.sub(pattern, cb)</code>.<br/> <strong>Views:</strong> <code class="svelte-rrt0o">this</code> = current document &mdash; call <code class="svelte-rrt0o">emit(value)</code> to add to result.</div> <div class="welcome-links svelte-rrt0o"><a href="https://github.com/hobbyquaker/she/blob/main/doc/db/README.md" target="_blank" rel="noopener" class="svelte-rrt0o">sheDB docs</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/db/view-examples.md" target="_blank" rel="noopener" class="svelte-rrt0o">View examples</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-rrt0o">GitHub</a></div></div></div>',1),PX=B('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button>'),HA=B('<div class="form-error svelte-rrt0o"> </div>'),TX=B('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),WA=B("<li> </li>"),zA=B('<div class="error-bar svelte-rrt0o"> </div>'),VA=B('<div class="loading svelte-rrt0o">Loading…</div>'),MX=B('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),RX=B('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),NX=B('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ Doc</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main></div>'),OX=B('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),HX=B('<label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Retain <span class="section-hint svelte-rrt0o">— send as retained MQTT message</span></label>'),WX=B('<span class="badge-error svelte-rrt0o">error</span>'),zX=B('<span class="badge-ok svelte-rrt0o"> </span>'),VX=B('<pre class="result-error svelte-rrt0o"> </pre>'),jX=B('<pre class="result-json svelte-rrt0o"> </pre>'),$X=B('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),UX=B('<div class="view-sections svelte-rrt0o"><div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Description <span class="section-hint svelte-rrt0o">— optional, shown in sidebar</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="(optional description)"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Filter <span class="section-hint svelte-rrt0o">— MQTT wildcard, optional</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="#"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Map <span class="section-hint svelte-rrt0o">— <code>this</code> = document &nbsp;·&nbsp; call <code>emit(this)</code> to include in result</span></div> <div class="monaco-view-wrap monaco-view-wrap--map svelte-rrt0o"><!></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Reduce <span class="section-hint svelte-rrt0o">— receives <code>result</code> array, must <code>return</code> new value (optional)</span></div> <div class="monaco-view-wrap monaco-view-wrap--reduce svelte-rrt0o"><!></div></div> <div class="view-section view-section--options svelte-rrt0o"><label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Publish to MQTT <span class="section-hint svelte-rrt0o">— publish view to MQTT topic <code> </code></span></label> <!></div> <!></div>'),qX=B('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button title="Re-run view" class="svelte-rrt0o">Refresh</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),GX=B('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),KX=B('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ View</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main> <!></div>'),ZX=B('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function XX(o,e){Vs(e,!0);const t=Xe=>{var St=IX(),Ai=yt(St);us(qc(Ai,{}),ki=>Vt=ki,()=>Vt),D(Xe,St)};let i=I(Ei([])),n=I(null),s=I("{}"),r=I(!1),a=I(null);const d="she-db-selected-view";let u=I(Ei([])),f=I(Ei(localStorage.getItem(d))),g=I("#"),p=I("// emit(this.someProperty)"),C=I(""),b=I(""),y=I(!1),w=I(!1),A=I(null),P=I(!1),M=I(null),R=I("she/db/view/");const T="she-db-panel";let V=I(Ei(localStorage.getItem(T)??"docs")),W=I(""),Q=I(!1),ne=I(null),de=I(""),te=I(!1),he=I(null);const De="she-db-sidebar-width";let oe=I(Ei(parseInt(localStorage.getItem(De)??"220",10))),ge=!1,Se=0,Re=0;const xe="she-db-chat-width",et="she-db-chat-open";let We=I(localStorage.getItem(et)==="true"),_e=I(Ei(parseInt(localStorage.getItem(xe)??"320",10))),dt=!1,Wt=0,tt=0;const kt=Tt(()=>c(f)?{id:c(f),filter:c(g),map:c(p),reduce:c(C)}:null);function be(Xe){Xe.filter!==void 0&&m(g,Xe.filter,!0),Xe.map!==void 0&&m(p,Xe.map,!0),Xe.reduce!==void 0&&m(C,Xe.reduce,!0)}$n(()=>{localStorage.setItem(et,String(c(We)))}),$n(()=>{localStorage.setItem(T,c(V))}),$n(()=>{c(f)?localStorage.setItem(d,c(f)):localStorage.removeItem(d)});function Rt(Xe){ge=!0,Se=Xe.clientX,Re=c(oe),Xe.preventDefault()}function ut(Xe){ge&&m(oe,Math.max(140,Math.min(500,Re+Xe.clientX-Se)),!0),dt&&m(_e,Math.max(240,Math.min(600,tt-(Xe.clientX-Wt))),!0)}function at(){ge&&(ge=!1,localStorage.setItem(De,String(c(oe)))),dt&&(dt=!1,localStorage.setItem(xe,String(c(_e))))}function Ze(Xe){dt=!0,Wt=Xe.clientX,tt=c(_e),Xe.preventDefault()}async function Pt(){try{m(i,await uF(),!0)}catch{}}async function ui(){try{m(u,await hF(),!0)}catch{}}async function wt(Xe){m(n,Xe,!0),m(a,null),m(r,!0);try{const St=await j$(Xe);m(s,JSON.stringify(St,null,2),!0)}catch(St){m(a,St instanceof Error?St.message:String(St),!0)}finally{m(r,!1)}}async function Ft(){if(c(n)){m(a,null);try{const Xe=JSON.parse(c(s));await aA(c(n),Xe)}catch(Xe){m(a,Xe instanceof Error?Xe.message:String(Xe),!0)}}}let Vt;async function zt(){if(c(n)&&await Vt.show(`Delete document "${c(n)}"?`,{confirm:"Delete",danger:!0}))try{await $$(c(n)),m(n,null),m(s,"{}")}catch(Xe){m(a,Xe instanceof Error?Xe.message:String(Xe),!0)}}async function Zt(){const Xe=c(W).trim();if(Xe){m(ne,null);try{await aA(Xe,{}),m(Q,!1),m(W,""),await wt(Xe)}catch(St){m(ne,St instanceof Error?St.message:String(St),!0)}}}async function mt(Xe){m(f,Xe,!0),m(M,null),m(P,!0),m(A,null);try{const St=await U$(Xe);m(g,St.filter??"",!0),m(p,St.map,!0),m(C,St.reduce??"",!0),m(b,St.description??"",!0),m(y,St.mqttpub??!1,!0),m(w,St.retain??!1,!0),m(A,await VC(Xe).catch(()=>null),!0)}catch(St){m(M,St instanceof Error?St.message:String(St),!0)}finally{m(P,!1)}}async function Mi(){if(c(f)){m(M,null);try{const Xe={map:c(p)};c(g).trim()&&(Xe.filter=c(g).trim()),c(C).trim()&&(Xe.reduce=c(C).trim()),c(b).trim()&&(Xe.description=c(b).trim()),c(y)&&(Xe.mqttpub=!0),c(w)&&(Xe.retain=!0),await lA(c(f),Xe)}catch(Xe){m(M,Xe instanceof Error?Xe.message:String(Xe),!0)}}}async function Ri(){if(c(f))try{m(A,await VC(c(f)),!0)}catch(Xe){m(M,Xe instanceof Error?Xe.message:String(Xe),!0)}}async function Di(){if(c(f)&&await Vt.show(`Delete view "${c(f)}"?`,{confirm:"Delete",danger:!0}))try{await q$(c(f)),m(f,null),m(g,""),m(p,"// emit(this.someProperty)"),m(C,""),m(b,""),m(y,!1),m(w,!1),m(A,null)}catch(Xe){m(M,Xe instanceof Error?Xe.message:String(Xe),!0)}}async function Ui(){if(!c(de).trim())return;const Xe=c(de).trim();m(he,null);try{await lA(Xe,{map:"// emit(this.someProperty)"}),m(te,!1),m(de,""),await ui(),await mt(Xe)}catch(St){m(he,St instanceof Error?St.message:String(St),!0)}}let ji=I(""),Bi=I(""),fn=Tt(()=>[...c(i)].filter(Xe=>!c(ji)||Xe.toLowerCase().includes(c(ji).toLowerCase())).sort()),an=Tt(()=>[...c(u)].filter(Xe=>!c(Bi)||Xe.toLowerCase().includes(c(Bi).toLowerCase())).sort());Ks(()=>{Pt(),ui().then(()=>{c(f)&&c(u).includes(c(f))?mt(c(f)):m(f,null)}),Il().then(fi=>{const Ii=fi.dbPrefix||"she/db/",X=Ii.endsWith("/")?Ii:Ii+"/";m(R,X+"view/")}).catch(()=>{});const Xe=ar("db:ids",fi=>{m(i,fi.ids??[],!0)}),St=ar("db:viewIds",fi=>{m(u,fi.ids??[],!0)}),Ai=ar("db:change",async fi=>{const Ii=fi.id;c(n)===Ii&&(fi.doc===null?(m(n,null),m(s,"{}")):m(s,JSON.stringify(fi.doc,null,2),!0))}),ki=ar("db:viewUpdate",async fi=>{const Ii=fi.id;c(f)===Ii&&m(A,await VC(Ii).catch(()=>null),!0)});return()=>{Xe(),St(),Ai(),ki()}});var Zi=ZX(),_n=_(Zi),gt=_(_n);let Yt;var Ci=v(gt,2);let Wi;var Pi=v(Ci,2);{var Ti=Xe=>{var St=PX();let Ai;j(()=>{Ai=Bt(St,1,"ai-toggle svelte-rrt0o",null,Ai,{"ai-open":c(We)}),ln(St,"title",c(We)?"Close AI assistant":"Open AI assistant")}),$("click",St,()=>m(We,!c(We))),D(Xe,St)};z(Pi,Xe=>{c(V)==="views"&&Xe(Ti)})}var Oi=v(_n,2);{var Qi=Xe=>{var St=NX(),Ai=_(St);let ki;var fi=_(Ai),Ii=_(fi),X=v(fi,2);{var Ae=Ve=>{var ye=TX(),At=yt(ye),Ot=_(At),ri=v(Ot,2),oi=v(At,2);{var xi=Ut=>{var mi=HA(),He=_(mi);j(()=>O(He,c(ne))),D(Ut,mi)};z(oi,Ut=>{c(ne)&&Ut(xi)})}$("keydown",Ot,Ut=>Ut.key==="Enter"&&Zt()),jt(Ot,()=>c(W),Ut=>m(W,Ut)),$("click",ri,Zt),D(Ve,ye)};z(X,Ve=>{c(Q)&&Ve(Ae)})}var qe=v(X,2),nt=_(qe),qt=v(qe,2);ei(qt,20,()=>c(fn),Ve=>Ve,(Ve,ye)=>{var At=WA();let Ot;var ri=_(At);j(()=>{Ot=Bt(At,1,"flat-item svelte-rrt0o",null,Ot,{"active-item":c(n)===ye}),O(ri,ye)}),$("click",At,()=>wt(ye)),D(Ve,At)});var se=v(Ai,2),Ee=v(se,2),Le=_(Ee);{var Y=Ve=>{var ye=RX(),At=yt(ye),Ot=_(At),ri=_(Ot),oi=v(Ot,2),xi=v(oi,2),Ut=v(At,2);{var mi=Gt=>{var gi=zA(),Jt=_(gi);j(()=>O(Jt,c(a))),D(Gt,gi)};z(Ut,Gt=>{c(a)&&Gt(mi)})}var He=v(Ut,2);{var Ye=Gt=>{var gi=VA();D(Gt,gi)},Qt=Gt=>{var gi=MX(),Jt=_(gi);qC(Jt,{language:"json",get value(){return c(s)},set value(fe){m(s,fe,!0)}}),D(Gt,gi)};z(He,Gt=>{c(r)?Gt(Ye):Gt(Qt,-1)})}j(()=>O(ri,c(n))),$("click",oi,Ft),$("click",xi,zt),D(Ve,ye)},Oe=Ve=>{t(Ve)};z(Le,Ve=>{c(n)?Ve(Y):Ve(Oe,-1)})}j(()=>ki=$o(Ai,"",ki,{width:`${c(oe)??""}px`})),$("click",Ii,()=>{m(Q,!c(Q)),m(ne,null)}),jt(nt,()=>c(ji),Ve=>m(ji,Ve)),$("mousedown",se,Rt),D(Xe,St)},yi=Xe=>{var St=KX(),Ai=_(St);let ki;var fi=_(Ai),Ii=_(fi),X=v(fi,2);{var Ae=At=>{var Ot=OX(),ri=yt(Ot),oi=_(ri),xi=v(oi,2),Ut=v(ri,2);{var mi=He=>{var Ye=HA(),Qt=_(Ye);j(()=>O(Qt,c(he))),D(He,Ye)};z(Ut,He=>{c(he)&&He(mi)})}$("keydown",oi,He=>He.key==="Enter"&&Ui()),jt(oi,()=>c(de),He=>m(de,He)),$("click",xi,Ui),D(At,Ot)};z(X,At=>{c(te)&&At(Ae)})}var qe=v(X,2),nt=_(qe),qt=v(qe,2);ei(qt,20,()=>c(an),At=>At,(At,Ot)=>{var ri=WA();let oi;var xi=_(ri);j(()=>{oi=Bt(ri,1,"flat-item svelte-rrt0o",null,oi,{"active-item":c(f)===Ot}),O(xi,Ot)}),$("click",ri,()=>mt(Ot)),D(At,ri)});var se=v(Ai,2),Ee=v(se,2),Le=_(Ee);{var Y=At=>{var Ot=qX(),ri=yt(Ot),oi=_(ri),xi=_(oi),Ut=v(oi,2),mi=v(Ut,2),He=v(mi,2),Ye=v(ri,2);{var Qt=fe=>{var Ke=zA(),ot=_(Ke);j(()=>O(ot,c(M))),D(fe,Ke)};z(Ye,fe=>{c(M)&&fe(Qt)})}var Gt=v(Ye,2);{var gi=fe=>{var Ke=VA();D(fe,Ke)},Jt=fe=>{var Ke=UX(),ot=_(Ke),rt=v(_(ot),2),ht=_(rt),_t=v(ot,2),Xt=v(_(_t),2),F=_(Xt),H=v(_t,2),K=v(_(H),2),le=_(K);qC(le,{language:"javascript",get value(){return c(p)},set value(it){m(p,it,!0)}});var Z=v(H,2),J=v(_(Z),2),ce=_(J);qC(ce,{language:"javascript",get value(){return c(C)},set value(it){m(C,it,!0)}});var Qe=v(Z,2),ae=_(Qe),pe=_(ae),Te=v(pe,4),me=v(_(Te)),Ie=_(me),lt=v(ae,2);{var G=it=>{var Pe=HX(),ke=_(Pe);Cs(ke,()=>c(w),Ct=>m(w,Ct)),D(it,Pe)};z(lt,it=>{c(y)&&it(G)})}var re=v(Qe,2);{var Ne=it=>{var Pe=$X(),ke=_(Pe),Ct=v(_(ke));{var vt=Je=>{var bt=WX();D(Je,bt)},Fe=Je=>{var bt=zX(),$e=_(bt);j(()=>O($e,`${c(A).length??0??""} items · rev ${c(A)._rev??""}`)),D(Je,bt)};z(Ct,Je=>{c(A).error?Je(vt):Je(Fe,-1)})}var Dt=v(ke,2);{var Ge=Je=>{var bt=VX(),$e=_(bt);j(()=>O($e,c(A).error)),D(Je,bt)},ze=Je=>{var bt=jX(),$e=_(bt);j(It=>O($e,It),[()=>JSON.stringify(c(A).result,null,2)]),D(Je,bt)};z(Dt,Je=>{c(A).error?Je(Ge):Je(ze,-1)})}D(it,Pe)};z(re,it=>{c(A)&&it(Ne)})}j(()=>O(Ie,`${c(R)??""}${c(f)??""} on every update`)),jt(ht,()=>c(b),it=>m(b,it)),jt(F,()=>c(g),it=>m(g,it)),Cs(pe,()=>c(y),it=>m(y,it)),D(fe,Ke)};z(Gt,fe=>{c(P)?fe(gi):fe(Jt,-1)})}j(()=>O(xi,c(f))),$("click",Ut,Mi),$("click",mi,Ri),$("click",He,Di),D(At,Ot)},Oe=At=>{t(At)};z(Le,At=>{c(f)?At(Y):At(Oe,-1)})}var Ve=v(Ee,2);{var ye=At=>{var Ot=GX(),ri=yt(Ot),oi=v(ri,2);let xi;var Ut=_(oi);FX(Ut,{get currentView(){return c(kt)},onApplyView:be}),j(()=>xi=$o(oi,"",xi,{width:`${c(_e)??""}px`})),$("mousedown",ri,Ze),D(At,Ot)};z(Ve,At=>{c(We)&&At(ye)})}j(()=>ki=$o(Ai,"",ki,{width:`${c(oe)??""}px`})),$("click",Ii,()=>{m(te,!c(te)),m(he,null)}),jt(nt,()=>c(Bi),At=>m(Bi,At)),$("mousedown",se,Rt),D(Xe,St)};z(Oi,Xe=>{c(V)==="docs"?Xe(Qi):Xe(yi,-1)})}j(()=>{Yt=Bt(gt,1,"svelte-rrt0o",null,Yt,{active:c(V)==="docs"}),Wi=Bt(Ci,1,"svelte-rrt0o",null,Wi,{active:c(V)==="views"})}),$("mousemove",Zi,ut),$("mouseup",Zi,at),fs("mouseleave",Zi,at),$("click",gt,()=>m(V,"docs")),$("click",Ci,()=>m(V,"views")),D(o,Zi),js()}Zs(["mousemove","mouseup","click","keydown","mousedown"]);var mm={exports:{}},YX=mm.exports,jA;function QX(){return jA||(jA=1,(function(o,e){(function(i,n){o.exports=n()})(typeof self<"u"?self:YX,function(){return(function(t){var i={};function n(s){if(i[s])return i[s].exports;var r=i[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=i,n.d=function(s,r,a){n.o(s,r)||Object.defineProperty(s,r,{configurable:!1,enumerable:!0,get:a})},n.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(r,"a",r),r},n.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},n.p="",n(n.s=3)})([(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=(function(){function r(a,d){this.width=d,this.height=a.length/d,this.data=a}return r.createEmpty=function(a,d){return new r(new Uint8ClampedArray(a*d),a)},r.prototype.get=function(a,d){return a<0||a>=this.width||d<0||d>=this.height?!1:!!this.data[d*this.width+a]},r.prototype.set=function(a,d,u){this.data[d*this.width+a]=u?1:0},r.prototype.setRegion=function(a,d,u,f,g){for(var p=d;p<d+f;p++)for(var C=a;C<a+u;C++)this.set(C,p,!!g)},r})();i.BitMatrix=s}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(2);function r(d,u){return d^u}i.addOrSubtractGF=r;var a=(function(){function d(u,f,g){this.primitive=u,this.size=f,this.generatorBase=g,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var p=1,C=0;C<this.size;C++)this.expTable[C]=p,p=p*2,p>=this.size&&(p=(p^this.primitive)&this.size-1);for(var C=0;C<this.size-1;C++)this.logTable[this.expTable[C]]=C;this.zero=new s.default(this,Uint8ClampedArray.from([0])),this.one=new s.default(this,Uint8ClampedArray.from([1]))}return d.prototype.multiply=function(u,f){return u===0||f===0?0:this.expTable[(this.logTable[u]+this.logTable[f])%(this.size-1)]},d.prototype.inverse=function(u){if(u===0)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[u]-1]},d.prototype.buildMonomial=function(u,f){if(u<0)throw new Error("Invalid monomial degree less than 0");if(f===0)return this.zero;var g=new Uint8ClampedArray(u+1);return g[0]=f,new s.default(this,g)},d.prototype.log=function(u){if(u===0)throw new Error("Can't take log(0)");return this.logTable[u]},d.prototype.exp=function(u){return this.expTable[u]},d})();i.default=a}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(1),r=(function(){function a(d,u){if(u.length===0)throw new Error("No coefficients.");this.field=d;var f=u.length;if(f>1&&u[0]===0){for(var g=1;g<f&&u[g]===0;)g++;if(g===f)this.coefficients=d.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(f-g);for(var p=0;p<this.coefficients.length;p++)this.coefficients[p]=u[g+p]}}else this.coefficients=u}return a.prototype.degree=function(){return this.coefficients.length-1},a.prototype.isZero=function(){return this.coefficients[0]===0},a.prototype.getCoefficient=function(d){return this.coefficients[this.coefficients.length-1-d]},a.prototype.addOrSubtract=function(d){var u;if(this.isZero())return d;if(d.isZero())return this;var f=this.coefficients,g=d.coefficients;f.length>g.length&&(u=[g,f],f=u[0],g=u[1]);for(var p=new Uint8ClampedArray(g.length),C=g.length-f.length,b=0;b<C;b++)p[b]=g[b];for(var b=C;b<g.length;b++)p[b]=s.addOrSubtractGF(f[b-C],g[b]);return new a(this.field,p)},a.prototype.multiply=function(d){if(d===0)return this.field.zero;if(d===1)return this;for(var u=this.coefficients.length,f=new Uint8ClampedArray(u),g=0;g<u;g++)f[g]=this.field.multiply(this.coefficients[g],d);return new a(this.field,f)},a.prototype.multiplyPoly=function(d){if(this.isZero()||d.isZero())return this.field.zero;for(var u=this.coefficients,f=u.length,g=d.coefficients,p=g.length,C=new Uint8ClampedArray(f+p-1),b=0;b<f;b++)for(var y=u[b],w=0;w<p;w++)C[b+w]=s.addOrSubtractGF(C[b+w],this.field.multiply(y,g[w]));return new a(this.field,C)},a.prototype.multiplyByMonomial=function(d,u){if(d<0)throw new Error("Invalid degree less than 0");if(u===0)return this.field.zero;for(var f=this.coefficients.length,g=new Uint8ClampedArray(f+d),p=0;p<f;p++)g[p]=this.field.multiply(this.coefficients[p],u);return new a(this.field,g)},a.prototype.evaluateAt=function(d){var u=0;if(d===0)return this.getCoefficient(0);var f=this.coefficients.length;if(d===1)return this.coefficients.forEach(function(p){u=s.addOrSubtractGF(u,p)}),u;u=this.coefficients[0];for(var g=1;g<f;g++)u=s.addOrSubtractGF(this.field.multiply(d,u),this.coefficients[g]);return u},a})();i.default=r}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(4),r=n(5),a=n(11),d=n(12);function u(p){var C=d.locate(p);if(!C)return null;for(var b=0,y=C;b<y.length;b++){var w=y[b],A=a.extract(p,w),P=r.decode(A.matrix);if(P)return{binaryData:P.bytes,data:P.text,chunks:P.chunks,version:P.version,location:{topRightCorner:A.mappingFunction(w.dimension,0),topLeftCorner:A.mappingFunction(0,0),bottomRightCorner:A.mappingFunction(w.dimension,w.dimension),bottomLeftCorner:A.mappingFunction(0,w.dimension),topRightFinderPattern:w.topRight,topLeftFinderPattern:w.topLeft,bottomLeftFinderPattern:w.bottomLeft,bottomRightAlignmentPattern:w.alignmentPattern}}}return null}var f={inversionAttempts:"attemptBoth"};function g(p,C,b,y){y===void 0&&(y={});var w=f;Object.keys(w||{}).forEach(function(W){w[W]=y[W]||w[W]});var A=w.inversionAttempts==="attemptBoth"||w.inversionAttempts==="invertFirst",P=w.inversionAttempts==="onlyInvert"||w.inversionAttempts==="invertFirst",M=s.binarize(p,C,b,A),R=M.binarized,T=M.inverted,V=u(P?T:R);return!V&&(w.inversionAttempts==="attemptBoth"||w.inversionAttempts==="invertFirst")&&(V=u(P?R:T)),V}g.default=g,i.default=g}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(0),r=8,a=24;function d(g,p,C){return g<p?p:g>C?C:g}var u=(function(){function g(p,C){this.width=p,this.data=new Uint8ClampedArray(p*C)}return g.prototype.get=function(p,C){return this.data[C*this.width+p]},g.prototype.set=function(p,C,b){this.data[C*this.width+p]=b},g})();function f(g,p,C,b){if(g.length!==p*C*4)throw new Error("Malformed data passed to binarizer.");for(var y=new u(p,C),w=0;w<p;w++)for(var A=0;A<C;A++){var P=g[(A*p+w)*4+0],M=g[(A*p+w)*4+1],R=g[(A*p+w)*4+2];y.set(w,A,.2126*P+.7152*M+.0722*R)}for(var T=Math.ceil(p/r),V=Math.ceil(C/r),W=new u(T,V),Q=0;Q<V;Q++)for(var ne=0;ne<T;ne++){for(var de=0,te=1/0,he=0,A=0;A<r;A++)for(var w=0;w<r;w++){var De=y.get(ne*r+w,Q*r+A);de+=De,te=Math.min(te,De),he=Math.max(he,De)}var oe=de/Math.pow(r,2);if(he-te<=a&&(oe=te/2,Q>0&&ne>0)){var ge=(W.get(ne,Q-1)+2*W.get(ne-1,Q)+W.get(ne-1,Q-1))/4;te<ge&&(oe=ge)}W.set(ne,Q,oe)}var Se=s.BitMatrix.createEmpty(p,C),Re=null;b&&(Re=s.BitMatrix.createEmpty(p,C));for(var Q=0;Q<V;Q++)for(var ne=0;ne<T;ne++){for(var xe=d(ne,2,T-3),et=d(Q,2,V-3),de=0,We=-2;We<=2;We++)for(var _e=-2;_e<=2;_e++)de+=W.get(xe+We,et+_e);for(var dt=de/25,We=0;We<r;We++)for(var _e=0;_e<r;_e++){var w=ne*r+We,A=Q*r+_e,Wt=y.get(w,A);Se.set(w,A,Wt<=dt),b&&Re.set(w,A,!(Wt<=dt))}}return b?{binarized:Se,inverted:Re}:{binarized:Se}}i.binarize=f}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(0),r=n(6),a=n(9),d=n(10);function u(R,T){for(var V=R^T,W=0;V;)W++,V&=V-1;return W}function f(R,T){return T<<1|R}var g=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],p=[function(R){return(R.y+R.x)%2===0},function(R){return R.y%2===0},function(R){return R.x%3===0},function(R){return(R.y+R.x)%3===0},function(R){return(Math.floor(R.y/2)+Math.floor(R.x/3))%2===0},function(R){return R.x*R.y%2+R.x*R.y%3===0},function(R){return(R.y*R.x%2+R.y*R.x%3)%2===0},function(R){return((R.y+R.x)%2+R.y*R.x%3)%2===0}];function C(R){var T=17+4*R.versionNumber,V=s.BitMatrix.createEmpty(T,T);V.setRegion(0,0,9,9,!0),V.setRegion(T-8,0,8,9,!0),V.setRegion(0,T-8,9,8,!0);for(var W=0,Q=R.alignmentPatternCenters;W<Q.length;W++)for(var ne=Q[W],de=0,te=R.alignmentPatternCenters;de<te.length;de++){var he=te[de];ne===6&&he===6||ne===6&&he===T-7||ne===T-7&&he===6||V.setRegion(ne-2,he-2,5,5,!0)}return V.setRegion(6,9,1,T-17,!0),V.setRegion(9,6,T-17,1,!0),R.versionNumber>6&&(V.setRegion(T-11,0,3,6,!0),V.setRegion(0,T-11,6,3,!0)),V}function b(R,T,V){for(var W=p[V.dataMask],Q=R.height,ne=C(T),de=[],te=0,he=0,De=!0,oe=Q-1;oe>0;oe-=2){oe===6&&oe--;for(var ge=0;ge<Q;ge++)for(var Se=De?Q-1-ge:ge,Re=0;Re<2;Re++){var xe=oe-Re;if(!ne.get(xe,Se)){he++;var et=R.get(xe,Se);W({y:Se,x:xe})&&(et=!et),te=f(et,te),he===8&&(de.push(te),he=0,te=0)}}De=!De}return de}function y(R){var T=R.height,V=Math.floor((T-17)/4);if(V<=6)return d.VERSIONS[V-1];for(var W=0,Q=5;Q>=0;Q--)for(var ne=T-9;ne>=T-11;ne--)W=f(R.get(ne,Q),W);for(var de=0,ne=5;ne>=0;ne--)for(var Q=T-9;Q>=T-11;Q--)de=f(R.get(ne,Q),de);for(var te=1/0,he,De=0,oe=d.VERSIONS;De<oe.length;De++){var ge=oe[De];if(ge.infoBits===W||ge.infoBits===de)return ge;var Se=u(W,ge.infoBits);Se<te&&(he=ge,te=Se),Se=u(de,ge.infoBits),Se<te&&(he=ge,te=Se)}if(te<=3)return he}function w(R){for(var T=0,V=0;V<=8;V++)V!==6&&(T=f(R.get(V,8),T));for(var W=7;W>=0;W--)W!==6&&(T=f(R.get(8,W),T));for(var Q=R.height,ne=0,W=Q-1;W>=Q-7;W--)ne=f(R.get(8,W),ne);for(var V=Q-8;V<Q;V++)ne=f(R.get(V,8),ne);for(var de=1/0,te=null,he=0,De=g;he<De.length;he++){var oe=De[he],ge=oe.bits,Se=oe.formatInfo;if(ge===T||ge===ne)return Se;var Re=u(T,ge);Re<de&&(te=Se,de=Re),T!==ne&&(Re=u(ne,ge),Re<de&&(te=Se,de=Re))}return de<=3?te:null}function A(R,T,V){var W=T.errorCorrectionLevels[V],Q=[],ne=0;if(W.ecBlocks.forEach(function(et){for(var We=0;We<et.numBlocks;We++)Q.push({numDataCodewords:et.dataCodewordsPerBlock,codewords:[]}),ne+=et.dataCodewordsPerBlock+W.ecCodewordsPerBlock}),R.length<ne)return null;R=R.slice(0,ne);for(var de=W.ecBlocks[0].dataCodewordsPerBlock,te=0;te<de;te++)for(var he=0,De=Q;he<De.length;he++){var oe=De[he];oe.codewords.push(R.shift())}if(W.ecBlocks.length>1)for(var ge=W.ecBlocks[0].numBlocks,Se=W.ecBlocks[1].numBlocks,te=0;te<Se;te++)Q[ge+te].codewords.push(R.shift());for(;R.length>0;)for(var Re=0,xe=Q;Re<xe.length;Re++){var oe=xe[Re];oe.codewords.push(R.shift())}return Q}function P(R){var T=y(R);if(!T)return null;var V=w(R);if(!V)return null;var W=b(R,T,V),Q=A(W,T,V.errorCorrectionLevel);if(!Q)return null;for(var ne=Q.reduce(function(Re,xe){return Re+xe.numDataCodewords},0),de=new Uint8ClampedArray(ne),te=0,he=0,De=Q;he<De.length;he++){var oe=De[he],ge=a.decode(oe.codewords,oe.codewords.length-oe.numDataCodewords);if(!ge)return null;for(var Se=0;Se<oe.numDataCodewords;Se++)de[te++]=ge[Se]}try{return r.decode(de,T.versionNumber)}catch{return null}}function M(R){if(R==null)return null;var T=P(R);if(T)return T;for(var V=0;V<R.width;V++)for(var W=V+1;W<R.height;W++)R.get(V,W)!==R.get(W,V)&&(R.set(V,W,!R.get(V,W)),R.set(W,V,!R.get(W,V)));return P(R)}i.decode=M}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(7),r=n(8),a;(function(y){y.Numeric="numeric",y.Alphanumeric="alphanumeric",y.Byte="byte",y.Kanji="kanji",y.ECI="eci"})(a=i.Mode||(i.Mode={}));var d;(function(y){y[y.Terminator=0]="Terminator",y[y.Numeric=1]="Numeric",y[y.Alphanumeric=2]="Alphanumeric",y[y.Byte=4]="Byte",y[y.Kanji=8]="Kanji",y[y.ECI=7]="ECI"})(d||(d={}));function u(y,w){for(var A=[],P="",M=[10,12,14][w],R=y.readBits(M);R>=3;){var T=y.readBits(10);if(T>=1e3)throw new Error("Invalid numeric value above 999");var V=Math.floor(T/100),W=Math.floor(T/10)%10,Q=T%10;A.push(48+V,48+W,48+Q),P+=V.toString()+W.toString()+Q.toString(),R-=3}if(R===2){var T=y.readBits(7);if(T>=100)throw new Error("Invalid numeric value above 99");var V=Math.floor(T/10),W=T%10;A.push(48+V,48+W),P+=V.toString()+W.toString()}else if(R===1){var T=y.readBits(4);if(T>=10)throw new Error("Invalid numeric value above 9");A.push(48+T),P+=T.toString()}return{bytes:A,text:P}}var f=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function g(y,w){for(var A=[],P="",M=[9,11,13][w],R=y.readBits(M);R>=2;){var T=y.readBits(11),V=Math.floor(T/45),W=T%45;A.push(f[V].charCodeAt(0),f[W].charCodeAt(0)),P+=f[V]+f[W],R-=2}if(R===1){var V=y.readBits(6);A.push(f[V].charCodeAt(0)),P+=f[V]}return{bytes:A,text:P}}function p(y,w){for(var A=[],P="",M=[8,16,16][w],R=y.readBits(M),T=0;T<R;T++){var V=y.readBits(8);A.push(V)}try{P+=decodeURIComponent(A.map(function(W){return"%"+("0"+W.toString(16)).substr(-2)}).join(""))}catch{}return{bytes:A,text:P}}function C(y,w){for(var A=[],P="",M=[8,10,12][w],R=y.readBits(M),T=0;T<R;T++){var V=y.readBits(13),W=Math.floor(V/192)<<8|V%192;W<7936?W+=33088:W+=49472,A.push(W>>8,W&255),P+=String.fromCharCode(r.shiftJISTable[W])}return{bytes:A,text:P}}function b(y,w){for(var A,P,M,R,T=new s.BitStream(y),V=w<=9?0:w<=26?1:2,W={text:"",bytes:[],chunks:[],version:w};T.available()>=4;){var Q=T.readBits(4);if(Q===d.Terminator)return W;if(Q===d.ECI)T.readBits(1)===0?W.chunks.push({type:a.ECI,assignmentNumber:T.readBits(7)}):T.readBits(1)===0?W.chunks.push({type:a.ECI,assignmentNumber:T.readBits(14)}):T.readBits(1)===0?W.chunks.push({type:a.ECI,assignmentNumber:T.readBits(21)}):W.chunks.push({type:a.ECI,assignmentNumber:-1});else if(Q===d.Numeric){var ne=u(T,V);W.text+=ne.text,(A=W.bytes).push.apply(A,ne.bytes),W.chunks.push({type:a.Numeric,text:ne.text})}else if(Q===d.Alphanumeric){var de=g(T,V);W.text+=de.text,(P=W.bytes).push.apply(P,de.bytes),W.chunks.push({type:a.Alphanumeric,text:de.text})}else if(Q===d.Byte){var te=p(T,V);W.text+=te.text,(M=W.bytes).push.apply(M,te.bytes),W.chunks.push({type:a.Byte,bytes:te.bytes,text:te.text})}else if(Q===d.Kanji){var he=C(T,V);W.text+=he.text,(R=W.bytes).push.apply(R,he.bytes),W.chunks.push({type:a.Kanji,bytes:he.bytes,text:he.text})}}if(T.available()===0||T.readBits(T.available())===0)return W}i.decode=b}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=(function(){function r(a){this.byteOffset=0,this.bitOffset=0,this.bytes=a}return r.prototype.readBits=function(a){if(a<1||a>32||a>this.available())throw new Error("Cannot read "+a.toString()+" bits");var d=0;if(this.bitOffset>0){var u=8-this.bitOffset,f=a<u?a:u,g=u-f,p=255>>8-f<<g;d=(this.bytes[this.byteOffset]&p)>>g,a-=f,this.bitOffset+=f,this.bitOffset===8&&(this.bitOffset=0,this.byteOffset++)}if(a>0){for(;a>=8;)d=d<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;if(a>0){var g=8-a,p=255>>g<<g;d=d<<a|(this.bytes[this.byteOffset]&p)>>g,this.bitOffset+=a}}return d},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r})();i.BitStream=s}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0}),i.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(1),r=n(2);function a(g,p,C,b){var y;p.degree()<C.degree()&&(y=[C,p],p=y[0],C=y[1]);for(var w=p,A=C,P=g.zero,M=g.one;A.degree()>=b/2;){var R=w,T=P;if(w=A,P=M,w.isZero())return null;A=R;for(var V=g.zero,W=w.getCoefficient(w.degree()),Q=g.inverse(W);A.degree()>=w.degree()&&!A.isZero();){var ne=A.degree()-w.degree(),de=g.multiply(A.getCoefficient(A.degree()),Q);V=V.addOrSubtract(g.buildMonomial(ne,de)),A=A.addOrSubtract(w.multiplyByMonomial(ne,de))}if(M=V.multiplyPoly(P).addOrSubtract(T),A.degree()>=w.degree())return null}var te=M.getCoefficient(0);if(te===0)return null;var he=g.inverse(te);return[M.multiply(he),A.multiply(he)]}function d(g,p){var C=p.degree();if(C===1)return[p.getCoefficient(1)];for(var b=new Array(C),y=0,w=1;w<g.size&&y<C;w++)p.evaluateAt(w)===0&&(b[y]=g.inverse(w),y++);return y!==C?null:b}function u(g,p,C){for(var b=C.length,y=new Array(b),w=0;w<b;w++){for(var A=g.inverse(C[w]),P=1,M=0;M<b;M++)w!==M&&(P=g.multiply(P,s.addOrSubtractGF(1,g.multiply(C[M],A))));y[w]=g.multiply(p.evaluateAt(A),g.inverse(P)),g.generatorBase!==0&&(y[w]=g.multiply(y[w],A))}return y}function f(g,p){var C=new Uint8ClampedArray(g.length);C.set(g);for(var b=new s.default(285,256,0),y=new r.default(b,C),w=new Uint8ClampedArray(p),A=!1,P=0;P<p;P++){var M=y.evaluateAt(b.exp(P+b.generatorBase));w[w.length-1-P]=M,M!==0&&(A=!0)}if(!A)return C;var R=new r.default(b,w),T=a(b,b.buildMonomial(p,1),R,p);if(T===null)return null;var V=d(b,T[0]);if(V==null)return null;for(var W=u(b,T[1],V),Q=0;Q<V.length;Q++){var ne=C.length-1-b.log(V[Q]);if(ne<0)return null;C[ne]=s.addOrSubtractGF(C[ne],W[Q])}return C}i.decode=f}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0}),i.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(0);function r(f,g,p,C){var b=f.x-g.x+p.x-C.x,y=f.y-g.y+p.y-C.y;if(b===0&&y===0)return{a11:g.x-f.x,a12:g.y-f.y,a13:0,a21:p.x-g.x,a22:p.y-g.y,a23:0,a31:f.x,a32:f.y,a33:1};var w=g.x-p.x,A=C.x-p.x,P=g.y-p.y,M=C.y-p.y,R=w*M-A*P,T=(b*M-A*y)/R,V=(w*y-b*P)/R;return{a11:g.x-f.x+T*g.x,a12:g.y-f.y+T*g.y,a13:T,a21:C.x-f.x+V*C.x,a22:C.y-f.y+V*C.y,a23:V,a31:f.x,a32:f.y,a33:1}}function a(f,g,p,C){var b=r(f,g,p,C);return{a11:b.a22*b.a33-b.a23*b.a32,a12:b.a13*b.a32-b.a12*b.a33,a13:b.a12*b.a23-b.a13*b.a22,a21:b.a23*b.a31-b.a21*b.a33,a22:b.a11*b.a33-b.a13*b.a31,a23:b.a13*b.a21-b.a11*b.a23,a31:b.a21*b.a32-b.a22*b.a31,a32:b.a12*b.a31-b.a11*b.a32,a33:b.a11*b.a22-b.a12*b.a21}}function d(f,g){return{a11:f.a11*g.a11+f.a21*g.a12+f.a31*g.a13,a12:f.a12*g.a11+f.a22*g.a12+f.a32*g.a13,a13:f.a13*g.a11+f.a23*g.a12+f.a33*g.a13,a21:f.a11*g.a21+f.a21*g.a22+f.a31*g.a23,a22:f.a12*g.a21+f.a22*g.a22+f.a32*g.a23,a23:f.a13*g.a21+f.a23*g.a22+f.a33*g.a23,a31:f.a11*g.a31+f.a21*g.a32+f.a31*g.a33,a32:f.a12*g.a31+f.a22*g.a32+f.a32*g.a33,a33:f.a13*g.a31+f.a23*g.a32+f.a33*g.a33}}function u(f,g){for(var p=a({x:3.5,y:3.5},{x:g.dimension-3.5,y:3.5},{x:g.dimension-6.5,y:g.dimension-6.5},{x:3.5,y:g.dimension-3.5}),C=r(g.topLeft,g.topRight,g.alignmentPattern,g.bottomLeft),b=d(C,p),y=s.BitMatrix.createEmpty(g.dimension,g.dimension),w=function(V,W){var Q=b.a13*V+b.a23*W+b.a33;return{x:(b.a11*V+b.a21*W+b.a31)/Q,y:(b.a12*V+b.a22*W+b.a32)/Q}},A=0;A<g.dimension;A++)for(var P=0;P<g.dimension;P++){var M=P+.5,R=A+.5,T=w(M,R);y.set(P,A,f.get(Math.floor(T.x),Math.floor(T.y)))}return{matrix:y,mappingFunction:w}}i.extract=u}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=4,r=.5,a=1.5,d=function(M,R){return Math.sqrt(Math.pow(R.x-M.x,2)+Math.pow(R.y-M.y,2))};function u(M){return M.reduce(function(R,T){return R+T})}function f(M,R,T){var V,W,Q,ne,de=d(M,R),te=d(R,T),he=d(M,T),De,oe,ge;return te>=de&&te>=he?(V=[R,M,T],De=V[0],oe=V[1],ge=V[2]):he>=te&&he>=de?(W=[M,R,T],De=W[0],oe=W[1],ge=W[2]):(Q=[M,T,R],De=Q[0],oe=Q[1],ge=Q[2]),(ge.x-oe.x)*(De.y-oe.y)-(ge.y-oe.y)*(De.x-oe.x)<0&&(ne=[ge,De],De=ne[0],ge=ne[1]),{bottomLeft:De,topLeft:oe,topRight:ge}}function g(M,R,T,V){var W=(u(C(M,T,V,5))/7+u(C(M,R,V,5))/7+u(C(T,M,V,5))/7+u(C(R,M,V,5))/7)/4;if(W<1)throw new Error("Invalid module size");var Q=Math.round(d(M,R)/W),ne=Math.round(d(M,T)/W),de=Math.floor((Q+ne)/2)+7;switch(de%4){case 0:de++;break;case 2:de--;break}return{dimension:de,moduleSize:W}}function p(M,R,T,V){var W=[{x:Math.floor(M.x),y:Math.floor(M.y)}],Q=Math.abs(R.y-M.y)>Math.abs(R.x-M.x),ne,de,te,he;Q?(ne=Math.floor(M.y),de=Math.floor(M.x),te=Math.floor(R.y),he=Math.floor(R.x)):(ne=Math.floor(M.x),de=Math.floor(M.y),te=Math.floor(R.x),he=Math.floor(R.y));for(var De=Math.abs(te-ne),oe=Math.abs(he-de),ge=Math.floor(-De/2),Se=ne<te?1:-1,Re=de<he?1:-1,xe=!0,et=ne,We=de;et!==te+Se;et+=Se){var _e=Q?We:et,dt=Q?et:We;if(T.get(_e,dt)!==xe&&(xe=!xe,W.push({x:_e,y:dt}),W.length===V+1))break;if(ge+=oe,ge>0){if(We===he)break;We+=Re,ge-=De}}for(var Wt=[],tt=0;tt<V;tt++)W[tt]&&W[tt+1]?Wt.push(d(W[tt],W[tt+1])):Wt.push(0);return Wt}function C(M,R,T,V){var W,Q=R.y-M.y,ne=R.x-M.x,de=p(M,R,T,Math.ceil(V/2)),te=p(M,{x:M.x-ne,y:M.y-Q},T,Math.ceil(V/2)),he=de.shift()+te.shift()-1;return(W=te.concat(he)).concat.apply(W,de)}function b(M,R){var T=u(M)/u(R),V=0;return R.forEach(function(W,Q){V+=Math.pow(M[Q]-W*T,2)}),{averageSize:T,error:V}}function y(M,R,T){try{var V=C(M,{x:-1,y:M.y},T,R.length),W=C(M,{x:M.x,y:-1},T,R.length),Q={x:Math.max(0,M.x-M.y)-1,y:Math.max(0,M.y-M.x)-1},ne=C(M,Q,T,R.length),de={x:Math.min(T.width,M.x+M.y)+1,y:Math.min(T.height,M.y+M.x)+1},te=C(M,de,T,R.length),he=b(V,R),De=b(W,R),oe=b(ne,R),ge=b(te,R),Se=Math.sqrt(he.error*he.error+De.error*De.error+oe.error*oe.error+ge.error*ge.error),Re=(he.averageSize+De.averageSize+oe.averageSize+ge.averageSize)/4,xe=(Math.pow(he.averageSize-Re,2)+Math.pow(De.averageSize-Re,2)+Math.pow(oe.averageSize-Re,2)+Math.pow(ge.averageSize-Re,2))/Re;return Se+xe}catch{return 1/0}}function w(M,R){for(var T=Math.round(R.x);M.get(T,Math.round(R.y));)T--;for(var V=Math.round(R.x);M.get(V,Math.round(R.y));)V++;for(var W=(T+V)/2,Q=Math.round(R.y);M.get(Math.round(W),Q);)Q--;for(var ne=Math.round(R.y);M.get(Math.round(W),ne);)ne++;var de=(Q+ne)/2;return{x:W,y:de}}function A(M){for(var R=[],T=[],V=[],W=[],Q=function(_e){for(var dt=0,Wt=!1,tt=[0,0,0,0,0],kt=function(Rt){var ut=M.get(Rt,_e);if(ut===Wt)dt++;else{tt=[tt[1],tt[2],tt[3],tt[4],dt],dt=1,Wt=ut;var at=u(tt)/7,Ze=Math.abs(tt[0]-at)<at&&Math.abs(tt[1]-at)<at&&Math.abs(tt[2]-3*at)<3*at&&Math.abs(tt[3]-at)<at&&Math.abs(tt[4]-at)<at&&!ut,Pt=u(tt.slice(-3))/3,ui=Math.abs(tt[2]-Pt)<Pt&&Math.abs(tt[3]-Pt)<Pt&&Math.abs(tt[4]-Pt)<Pt&&ut;if(Ze){var wt=Rt-tt[3]-tt[4],Ft=wt-tt[2],Vt={startX:Ft,endX:wt,y:_e},zt=T.filter(function(Mi){return Ft>=Mi.bottom.startX&&Ft<=Mi.bottom.endX||wt>=Mi.bottom.startX&&Ft<=Mi.bottom.endX||Ft<=Mi.bottom.startX&&wt>=Mi.bottom.endX&&tt[2]/(Mi.bottom.endX-Mi.bottom.startX)<a&&tt[2]/(Mi.bottom.endX-Mi.bottom.startX)>r});zt.length>0?zt[0].bottom=Vt:T.push({top:Vt,bottom:Vt})}if(ui){var Zt=Rt-tt[4],mt=Zt-tt[3],Vt={startX:mt,y:_e,endX:Zt},zt=W.filter(function(Di){return mt>=Di.bottom.startX&&mt<=Di.bottom.endX||Zt>=Di.bottom.startX&&mt<=Di.bottom.endX||mt<=Di.bottom.startX&&Zt>=Di.bottom.endX&&tt[2]/(Di.bottom.endX-Di.bottom.startX)<a&&tt[2]/(Di.bottom.endX-Di.bottom.startX)>r});zt.length>0?zt[0].bottom=Vt:W.push({top:Vt,bottom:Vt})}}},be=-1;be<=M.width;be++)kt(be);R.push.apply(R,T.filter(function(Rt){return Rt.bottom.y!==_e&&Rt.bottom.y-Rt.top.y>=2})),T=T.filter(function(Rt){return Rt.bottom.y===_e}),V.push.apply(V,W.filter(function(Rt){return Rt.bottom.y!==_e})),W=W.filter(function(Rt){return Rt.bottom.y===_e})},ne=0;ne<=M.height;ne++)Q(ne);R.push.apply(R,T.filter(function(_e){return _e.bottom.y-_e.top.y>=2})),V.push.apply(V,W);var de=R.filter(function(_e){return _e.bottom.y-_e.top.y>=2}).map(function(_e){var dt=(_e.top.startX+_e.top.endX+_e.bottom.startX+_e.bottom.endX)/4,Wt=(_e.top.y+_e.bottom.y+1)/2;if(M.get(Math.round(dt),Math.round(Wt))){var tt=[_e.top.endX-_e.top.startX,_e.bottom.endX-_e.bottom.startX,_e.bottom.y-_e.top.y+1],kt=u(tt)/tt.length,be=y({x:Math.round(dt),y:Math.round(Wt)},[1,1,3,1,1],M);return{score:be,x:dt,y:Wt,size:kt}}}).filter(function(_e){return!!_e}).sort(function(_e,dt){return _e.score-dt.score}).map(function(_e,dt,Wt){if(dt>s)return null;var tt=Wt.filter(function(be,Rt){return dt!==Rt}).map(function(be){return{x:be.x,y:be.y,score:be.score+Math.pow(be.size-_e.size,2)/_e.size,size:be.size}}).sort(function(be,Rt){return be.score-Rt.score});if(tt.length<2)return null;var kt=_e.score+tt[0].score+tt[1].score;return{points:[_e].concat(tt.slice(0,2)),score:kt}}).filter(function(_e){return!!_e}).sort(function(_e,dt){return _e.score-dt.score});if(de.length===0)return null;var te=f(de[0].points[0],de[0].points[1],de[0].points[2]),he=te.topRight,De=te.topLeft,oe=te.bottomLeft,ge=P(M,V,he,De,oe),Se=[];ge&&Se.push({alignmentPattern:{x:ge.alignmentPattern.x,y:ge.alignmentPattern.y},bottomLeft:{x:oe.x,y:oe.y},dimension:ge.dimension,topLeft:{x:De.x,y:De.y},topRight:{x:he.x,y:he.y}});var Re=w(M,he),xe=w(M,De),et=w(M,oe),We=P(M,V,Re,xe,et);return We&&Se.push({alignmentPattern:{x:We.alignmentPattern.x,y:We.alignmentPattern.y},bottomLeft:{x:et.x,y:et.y},topLeft:{x:xe.x,y:xe.y},topRight:{x:Re.x,y:Re.y},dimension:We.dimension}),Se.length===0?null:Se}i.locate=A;function P(M,R,T,V,W){var Q,ne,de;try{Q=g(V,T,W,M),ne=Q.dimension,de=Q.moduleSize}catch{return null}var te={x:T.x-V.x+W.x,y:T.y-V.y+W.y},he=(d(V,W)+d(V,T))/2/de,De=1-3/he,oe={x:V.x+De*(te.x-V.x),y:V.y+De*(te.y-V.y)},ge=R.map(function(Re){var xe=(Re.top.startX+Re.top.endX+Re.bottom.startX+Re.bottom.endX)/4,et=(Re.top.y+Re.bottom.y+1)/2;if(M.get(Math.floor(xe),Math.floor(et))){var We=[Re.top.endX-Re.top.startX,Re.bottom.endX-Re.bottom.startX,Re.bottom.y-Re.top.y+1];u(We)/We.length;var _e=y({x:Math.floor(xe),y:Math.floor(et)},[1,1,1],M),dt=_e+d({x:xe,y:et},oe);return{x:xe,y:et,score:dt}}}).filter(function(Re){return!!Re}).sort(function(Re,xe){return Re.score-xe.score}),Se=he>=15&&ge.length?ge[0]:oe;return{alignmentPattern:Se,dimension:ne}}})]).default})})(mm)),mm.exports}var JX=QX();const eY=cS(JX);var tY=B('<label class="svelte-1ua3isv">Passcode <input type="number" placeholder="20202021" class="svelte-1ua3isv"/></label> <label class="svelte-1ua3isv">Discriminator (optional) <input type="number" placeholder="3840" class="svelte-1ua3isv"/></label>',1),iY=B('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label> <div class="scan-row svelte-1ua3isv"><button class="scan-btn svelte-1ua3isv" title="Scan QR code with camera"><svg width="13" height="13" viewBox="0 0 16 16" fill="currentColor"><path d="M1 1h5v5H1V1zm1 1v3h3V2H2zm7-1h5v5h-5V1zm1 1v3h3V2h-3zM1 9h5v5H1V9zm1 1v3h3v-3H2zm7 0h2v2H9v-2zm2 0h2v2h-2v-2zm0 2h2v2h-2v-2zm-2 2h2v2H9v-2zm2 0h2v2h-2v-2z"></path></svg> Camera</button> <label class="scan-btn scan-file-btn svelte-1ua3isv" title="Decode QR from image file"><svg width="13" height="13" viewBox="0 0 16 16" fill="currentColor"><path d="M13 4H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1zM3 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H3zm5 2.5a.5.5 0 0 1 .5.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1V6a.5.5 0 0 1 .5-.5z"></path></svg> Image… <input type="file" accept="image/*" style="display:none" class="svelte-1ua3isv"/></label></div>',1),$A=B('<p class="err svelte-1ua3isv"> </p>'),nY=B('<div class="wizard svelte-1ua3isv"><div class="wizard-tabs svelte-1ua3isv"><button>Passcode</button> <button>QR / Code</button></div> <!> <label class="svelte-1ua3isv">IP Address (optional, bypasses mDNS) <input type="text" placeholder="192.168.1.100 or 192.168.1.100:5540" class="svelte-1ua3isv"/></label> <!> <button class="commission-btn svelte-1ua3isv"> </button></div>'),sY=B('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),oY=B('<span class="device-name svelte-1ua3isv"> </span>'),rY=B('<li><button class="device-select-btn svelte-1ua3isv"><span></span> <span class="device-label svelte-1ua3isv"><!></span></button> <button class="unpair-btn svelte-1ua3isv" title="Unpair">✕</button></li>'),aY=B('<li class="empty svelte-1ua3isv">No paired devices</li>'),lY=B('<p class="info svelte-1ua3isv">Loading…</p>'),cY=B('<p class="device-subtitle svelte-1ua3isv"> </p>'),dY=B('<span class="ep-chip svelte-1ua3isv"> </span>'),uY=B('<span class="attr-id svelte-1ua3isv"> </span>'),hY=B('<button class="attr-action-btn svelte-1ua3isv"> </button>'),fY=B('<div class="attr-actions svelte-1ua3isv"></div>'),gY=B('<span class="cmd-sep svelte-1ua3isv">,</span>'),pY=B('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),xY=B('<span class="cmd-id svelte-1ua3isv"> </span>'),mY=B("<!> <!>",1),vY=B('<span class="cmd-list svelte-1ua3isv"></span>'),_Y=B(' <span class="cmd-id svelte-1ua3isv"> </span>',1),bY=B('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),CY=B('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"><th class="svelte-1ua3isv">deviceType</th><th class="svelte-1ua3isv">revision</th></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),EY=B('<th class="svelte-1ua3isv"> </th>'),yY=B('<td class="svelte-1ua3isv"> </td>'),wY=B('<tr class="svelte-1ua3isv"></tr>'),SY=B('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),DY=B('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),AY=B('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),kY=B('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),BY=B('<span class="attr-val svelte-1ua3isv"> </span>'),FY=B('<tr class="svelte-1ua3isv"><td class="attr-name-cell svelte-1ua3isv"><span class="attr-key svelte-1ua3isv"> </span><!></td><td class="attr-actions-cell svelte-1ua3isv"><!></td><td class="attr-val-cell svelte-1ua3isv"><!></td></tr>'),LY=B('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),IY=B('<table class="cluster-table svelte-1ua3isv"><colgroup><col class="col-attr-name svelte-1ua3isv"/><col class="col-attr-actions svelte-1ua3isv"/><col class="col-attr-val"/></colgroup><tbody class="svelte-1ua3isv"></tbody></table>'),PY=B('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),TY=B('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),MY=B('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),RY=B('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),NY=B('<span class="stream-badge svelte-1ua3isv"> </span>'),OY=B('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),GC=B('&nbsp;<span class="e-sub svelte-1ua3isv"> </span>',1),HY=B('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),WY=B('<span class="e-badge e-badge-attr svelte-1ua3isv">attr</span> <span class="e-node svelte-1ua3isv"> <!></span> <span class="e-ep svelte-1ua3isv"> <!></span> <span class="e-cluster svelte-1ua3isv"> </span> <span class="e-attr svelte-1ua3isv"> </span> <span class="e-val svelte-1ua3isv"> </span>',1),zY=B('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),VY=B('<div class="stream-body svelte-1ua3isv"><!></div>'),jY=B('<p class="scan-err svelte-1ua3isv"> </p>'),$Y=B('<div class="scan-preview svelte-1ua3isv"><video playsinline="" class="scan-video svelte-1ua3isv"></video> <div class="scan-reticle svelte-1ua3isv"></div></div> <p class="scan-hint svelte-1ua3isv">Point camera at the QR code on the device</p>',3),UY=B('<div class="scan-backdrop svelte-1ua3isv"></div> <div class="scan-modal svelte-1ua3isv"><div class="scan-modal-hdr svelte-1ua3isv"><span>Scan Matter QR Code</span> <button class="scan-close svelte-1ua3isv">✕</button></div> <!> <canvas style="display:none"></canvas></div>',1),qY=B('<!> <div class="matter-page svelte-1ua3isv"><div class="matter-main svelte-1ua3isv"><div class="sidebar svelte-1ua3isv"><div class="sidebar-header svelte-1ua3isv"><span class="sidebar-title svelte-1ua3isv">Matter Devices</span> <button class="add-btn svelte-1ua3isv" title="Commission new device">+</button></div> <!> <ul class="device-list svelte-1ua3isv"><!> <!></ul></div> <div class="detail svelte-1ua3isv"><!></div></div> <div class="stream-panel svelte-1ua3isv"><div class="stream-resize svelte-1ua3isv"></div> <div class="stream-hdr-row svelte-1ua3isv"><span class="stream-title svelte-1ua3isv">Matter Events</span> <!> <button class="stream-toggle svelte-1ua3isv" title="Toggle event feed"> </button></div> <!></div></div> <!>',1);function GY(o,e){Vs(e,!0);const t={onOff:{onOff:[{label:"On",command:"on"},{label:"Off",command:"off"},{label:"Toggle",command:"toggle"}]},levelControl:{currentLevel:[{label:"Step ▲",command:"stepWithOnOff",args:{stepMode:0,stepSize:25,transitionTime:5}},{label:"Step ▼",command:"stepWithOnOff",args:{stepMode:1,stepSize:25,transitionTime:5}}]},windowCovering:{currentPositionLiftPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}],currentPositionTiltPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}]}};async function i(Y,Oe,Ve,ye,At){try{await sU(Y,Oe,Ve,ye,At)}catch(Ot){console.error("matter command failed",Ot)}}const n={identify:{0:"identify",1:"triggerEffect"},groups:{0:"addGroup",1:"viewGroup",2:"getGroupMembership",3:"removeGroup",4:"removeAllGroups",5:"addGroupIfIdentifying"},scenes:{0:"addScene",1:"viewScene",2:"removeScene",3:"removeAllScenes",4:"storeScene",5:"recallScene",6:"getSceneMembership",64:"enhancedAddScene",65:"enhancedViewScene",66:"copyScene"},onOff:{0:"off",1:"on",2:"toggle",64:"offWithEffect",65:"onWithRecallGlobalScene",66:"onWithTimedOff"},levelControl:{0:"moveToLevel",1:"move",2:"step",3:"stop",4:"moveToLevelWithOnOff",5:"moveWithOnOff",6:"stepWithOnOff",7:"stopWithOnOff",8:"moveToClosestFrequency"},colorControl:{0:"moveToHue",1:"moveHue",2:"stepHue",3:"moveToSaturation",4:"moveSaturation",5:"stepSaturation",6:"moveToHueAndSaturation",7:"moveToColor",8:"moveColor",9:"stepColor",10:"moveToColorTemperature",64:"enhancedMoveToHue",65:"enhancedMoveHue",66:"enhancedStepHue",67:"enhancedMoveToHueAndSaturation",68:"colorLoopSet",71:"stopMoveStep",75:"moveColorTemperature",76:"stepColorTemperature"},thermostat:{0:"setpointRaiseLower",1:"setWeeklySchedule",2:"getWeeklySchedule",3:"clearWeeklySchedule"},doorLock:{0:"lockDoor",1:"unlockDoor",3:"unlockWithTimeout",11:"setWeekDaySchedule",12:"getWeekDaySchedule",13:"clearWeekDaySchedule",14:"setYearDaySchedule",15:"getYearDaySchedule",16:"clearYearDaySchedule",17:"setHolidaySchedule",18:"getHolidaySchedule",19:"clearHolidaySchedule",26:"setUser",27:"getUser",28:"clearUser",34:"setCredential",36:"getCredential",38:"clearCredential"},windowCovering:{0:"upOrOpen",1:"downOrClose",2:"stopMotion",4:"goToLiftValue",5:"goToLiftPercentage",7:"goToTiltValue",8:"goToTiltPercentage"},fanControl:{0:"step"}};function s(Y,Oe){const Ve=n[Y];return Oe.map(ye=>{const At=typeof ye=="number"?ye:Number(ye);return{id:At,name:(Ve==null?void 0:Ve[At])??null}})}const r={10:"Door Lock",11:"Door Lock Controller",14:"Aggregator",15:"Generic Switch",17:"On/Off Plug-In Unit",18:"Dimmable Plug-In Unit",19:"Pump",20:"On/Off Light Switch",21:"Dimmer Switch",22:"Color Dimmer Switch",23:"Control Bridge",24:"Pump Controller",256:"On/Off Light",257:"Dimmable Light",268:"Extended Color Light",269:"Color Temperature Light",262:"Light Sensor",263:"Occupancy Sensor",514:"Window Covering",515:"Window Covering Controller",768:"Heating/Cooling Unit",769:"Thermostat",770:"Temperature Sensor",771:"Pressure Sensor",772:"Flow Sensor",773:"Humidity Sensor",774:"On/Off Sensor",2112:"Air Quality Sensor"},a={generatedCommandList:65528,acceptedCommandList:65529,eventList:65530,attributeList:65531,featureMap:65532,clusterRevision:65533},d={descriptor:{deviceTypeList:0,serverList:1,clientList:2,partsList:3,tagList:4},basicInformation:{dataModelRevision:0,vendorName:1,vendorID:2,vendorId:2,productName:3,productID:4,productId:4,nodeLabel:5,location:6,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,localConfigDisabled:16,reachable:17,uniqueID:18,uniqueId:18,capabilityMinima:19,productAppearance:20,specificationVersion:21,maxPathsPerInvoke:22},bridgedDeviceBasicInformation:{vendorName:1,vendorID:2,vendorId:2,productName:3,productId:4,nodeLabel:5,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,reachable:17,uniqueID:18,uniqueId:18,productAppearance:20},identify:{identifyTime:0,identifyType:1},groups:{nameSupport:0},onOff:{onOff:0,globalSceneControl:16384,onTime:16385,offWaitTime:16386,startUpOnOff:16387},levelControl:{currentLevel:0,remainingTime:1,minLevel:2,maxLevel:3,currentFrequency:4,minFrequency:5,maxFrequency:6,options:15,onOffTransitionTime:16,onLevel:17,onTransitionTime:18,offTransitionTime:19,defaultMoveRate:20,startUpCurrentLevel:16384},colorControl:{currentHue:0,currentSaturation:1,remainingTime:2,currentX:3,currentY:4,colorTemperatureMireds:7,colorMode:8,options:15,enhancedCurrentHue:16384,enhancedColorMode:16385,colorLoopActive:16386,colorLoopDirection:16387,colorLoopTime:16388,colorCapabilities:16394,colorTempPhysicalMinMireds:16395,colorTempPhysicalMaxMireds:16396,coupleColorTempToLevelMinMireds:16397,startUpColorTemperatureMireds:16400},thermostat:{localTemperature:0,outdoorTemperature:1,occupancy:2,absMinHeatSetpointLimit:3,absMaxHeatSetpointLimit:4,absMinCoolSetpointLimit:5,absMaxCoolSetpointLimit:6,piCoolingDemand:7,piHeatingDemand:8,localTemperatureCalibration:16,occupiedCoolingSetpoint:17,occupiedHeatingSetpoint:18,unoccupiedCoolingSetpoint:19,unoccupiedHeatingSetpoint:20,minHeatSetpointLimit:21,maxHeatSetpointLimit:22,minCoolSetpointLimit:23,maxCoolSetpointLimit:24,minSetpointDeadBand:25,remoteSensing:26,controlSequenceOfOperation:27,systemMode:28,thermostatRunningMode:30,startOfWeek:32,numberOfWeeklyTransitions:33,numberOfDailyTransitions:34,temperatureSetpointHold:35,temperatureSetpointHoldDuration:36,thermostatProgrammingOperationMode:37,thermostatRunningState:41,setpointChangeSource:48,setpointChangeAmount:49,setpointChangeSourceTimestamp:50,occupiedSetback:52,unoccupiedSetback:55,emergencyHeatDelta:58},windowCovering:{type:0,physicalClosedLimitLift:1,physicalClosedLimitTilt:2,currentPositionLift:3,currentPositionTilt:4,numberOfActuationsLift:5,numberOfActuationsTilt:6,configStatus:7,currentPositionLiftPercentage:8,currentPositionTiltPercentage:9,operationalStatus:10,targetPositionLiftPercent100ths:11,targetPositionTiltPercent100ths:12,endProductType:13,currentPositionLiftPercent100ths:14,currentPositionTiltPercent100ths:15,installedOpenLimitLift:16,installedClosedLimitLift:17,installedOpenLimitTilt:18,installedClosedLimitTilt:19,mode:23,safetyStatus:26},doorLock:{lockState:0,lockType:1,actuatorEnabled:2,doorState:3,numberOfTotalUsersSupported:17,numberOfPINUsersSupported:18,maxPINCodeLength:23,minPINCodeLength:24,language:33,autoRelockTime:35,soundVolume:36,operatingMode:37,supportedOperatingModes:38,wrongCodeEntryLimit:48},fanControl:{fanMode:0,fanModeSequence:1,percentSetting:2,percentCurrent:3,speedMax:4,speedSetting:5,speedCurrent:6,rockSupport:7,rockSetting:8,windSupport:9,windSetting:10,airflowDirectionSupport:11,airflowDirection:12},occupancySensing:{occupancy:0,occupancySensorType:1,occupancySensorTypeBitmap:2,holdTime:3,pirOccupiedToUnoccupiedDelay:16,pirUnoccupiedToOccupiedDelay:17},illuminanceMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,lightSensorType:4},temperatureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},pressureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,scaledValue:16,minScaledValue:17,maxScaledValue:18,scale:20},flowMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},relativeHumidityMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},powerSource:{status:0,order:1,description:2,batVoltage:11,batPercentRemaining:12,batTimeRemaining:13,batChargeLevel:14,batReplacementNeeded:15,batReplaceability:16,batPresent:17,activeBatFaults:18,batChargeState:26}};function u(Y){return"0x"+Y.toString(16).toUpperCase().padStart(4,"0")}let f=I(Ei([])),g=Ei(new Map);function p(Y){if(Y==null)return"—";if(typeof Y=="boolean"||typeof Y=="number")return String(Y);if(typeof Y=="string")return Y.length>50?Y.slice(0,47)+"…":Y;const Oe=JSON.stringify(Y);return Oe.length>60?Oe.slice(0,57)+"…":Oe}function C(Y){return Y==null?"—":typeof Y=="boolean"||typeof Y=="number"?String(Y):typeof Y=="string"?Y:JSON.stringify(Y)}function b(Y){return Y!==null&&typeof Y=="object"&&!Array.isArray(Y)}function y(Y){return Array.isArray(Y)&&Y.length>0&&Y.every(b)}function w(Y,Oe){return!!(Oe==="attributeList"||Array.isArray(Y)&&Y.length===0||b(Y)&&Object.keys(Y).length===0)}function A(Y){return new Date(Y).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const P=500,M=20,R=32;let T=0,V=I(Ei([])),W=I(!0),Q=I(180),ne=Tt(()=>{const Y=Math.max(1,Math.floor((c(Q)-R)/M)+1);return c(V).slice(0,Y)});function de(Y){Y.preventDefault();const Oe=Y.clientY,Ve=c(Q);function ye(Ot){m(Q,Math.max(60,Math.min(600,Ve+Oe-Ot.clientY)),!0)}function At(){document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",At)}document.addEventListener("mousemove",ye),document.addEventListener("mouseup",At)}let te=I(null),he=I(!1),De=I(null),oe=I(!1),ge=I("passcode"),Se=I(""),Re=I(""),xe=I(""),et=I(!1),We=I(null),_e=I(""),dt=I(!1),Wt=I(""),tt=I(void 0),kt=I(void 0),be=null,Rt=null;function ut(){Rt!==null&&(cancelAnimationFrame(Rt),Rt=null),be&&(be.getTracks().forEach(Y=>Y.stop()),be=null),m(dt,!1),m(Wt,"")}function at(Y){ut(),m(ge,"pairingCode"),m(xe,Y,!0)}function Ze(){if(!c(kt))return null;const Y=c(kt).getContext("2d",{willReadFrequently:!0}),{width:Oe,height:Ve}=c(kt);if(!Oe||!Ve)return null;const ye=Y.getImageData(0,0,Oe,Ve);return eY(ye.data,ye.width,ye.height,{inversionAttempts:"dontInvert"})}async function Pt(){if(m(dt,!0),m(Wt,""),await ul(),!c(tt)||!c(kt))return;try{be=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}),c(tt).srcObject=be,await c(tt).play()}catch(Oe){m(Wt,"Camera unavailable: "+(Oe instanceof Error?Oe.message:String(Oe)));return}const Y=()=>{var Oe;if(!(!c(tt)||!c(kt)||!be)){if(c(tt).readyState===c(tt).HAVE_ENOUGH_DATA){c(kt).width=c(tt).videoWidth,c(kt).height=c(tt).videoHeight,c(kt).getContext("2d",{willReadFrequently:!0}).drawImage(c(tt),0,0);const ye=Ze();if((Oe=ye==null?void 0:ye.data)!=null&&Oe.startsWith("MT:")){at(ye.data);return}}Rt=requestAnimationFrame(Y)}};Rt=requestAnimationFrame(Y)}function ui(Y){var ye;const Oe=(ye=Y.target.files)==null?void 0:ye[0];if(!Oe)return;const Ve=new FileReader;Ve.onload=At=>{const Ot=new Image;Ot.onload=()=>{var xi;if(!c(kt))return;c(kt).width=Ot.width,c(kt).height=Ot.height,c(kt).getContext("2d",{willReadFrequently:!0}).drawImage(Ot,0,0);const oi=Ze();(xi=oi==null?void 0:oi.data)!=null&&xi.startsWith("MT:")?at(oi.data):m(Wt,"No Matter QR code found in image.")},Ot.src=At.target.result},Ve.readAsDataURL(Oe)}const wt="she:matter:selectedNodeId";async function Ft(){try{m(f,await gF(),!0);for(const Y of c(f))gm(Y.nodeId).then(Oe=>{g.set(Y.nodeId,Oe)}).catch(()=>{});if(c(f).length>0&&!c(te)){const Y=localStorage.getItem(wt),Oe=Y&&c(f).find(Ve=>Ve.nodeId===Y)?Y:c(f)[0].nodeId;Vt(Oe)}}catch{m(f,[],!0)}}async function Vt(Y){m(he,!0),m(De,null);try{m(te,await gm(Y),!0),g.set(Y,c(te)),localStorage.setItem(wt,Y)}catch(Oe){m(De,Oe instanceof Error?Oe.message:String(Oe),!0)}finally{m(he,!1)}}let zt;async function Zt(Y){var Oe;if(await zt.show(`Unpair device ${Y}?`,{confirm:"Unpair",danger:!0}))try{await nU(Y),((Oe=c(te))==null?void 0:Oe.nodeId)===Y&&m(te,null),await Ft()}catch(Ve){m(De,Ve instanceof Error?Ve.message:String(Ve),!0)}}async function mt(){m(et,!0),m(We,null);try{let Y;c(ge)==="passcode"?(Y={passcode:Number(c(Se))},c(Re)&&(Y={...Y,discriminator:Number(c(Re))})):Y={pairingCode:c(xe).trim()},c(_e).trim()&&(Y={...Y,discoveryAddress:c(_e).trim()}),await iU(Y),m(oe,!1),m(Se,""),m(Re,""),m(xe,""),m(_e,""),await Ft()}catch(Y){m(We,Y instanceof Error?Y.message:String(Y),!0)}finally{m(et,!1)}}Ks(()=>{Ft()});const Mi=ar("matter:deviceList",Y=>{if(!Array.isArray(Y.devices))return;const Oe=Y.devices;for(const Ve of Oe)g.has(Ve.nodeId)||gm(Ve.nodeId).then(ye=>{g.set(Ve.nodeId,ye)}).catch(()=>{});m(f,Oe,!0)}),Ri=ar("matter:deviceStatus",Y=>{if(Y.nodeId===void 0)return;const Oe=String(Y.nodeId),Ve=!!Y.online;m(f,c(f).map(ye=>ye.nodeId===Oe?{...ye,online:Ve}:ye),!0),m(V,[{id:T++,kind:"status",nodeId:Oe,online:Ve,ts:Date.now()},...c(V).slice(0,P-1)],!0)}),Di=ar("matter:attr",Y=>{const Oe=String(Y.nodeId),Ve=Y.endpointId,ye=String(Y.clusterName),At=String(Y.attrName),Ot=Y.value;if(c(te)&&c(te).nodeId===Oe){const oi=c(te).endpoints.find(Ut=>Ut.endpointId===Ve),xi=oi==null?void 0:oi.clusters.find(Ut=>Ut.name===ye);xi&&(xi.attrs[At]=Ot)}const ri=g.get(Oe);if(ri){const oi=ri.endpoints.find(Ut=>Ut.endpointId===Ve),xi=oi==null?void 0:oi.clusters.find(Ut=>Ut.name===ye);xi&&(xi.attrs[At]=Ot)}m(V,[{id:T++,kind:"attr",nodeId:Oe,endpointId:Ve,clusterName:ye,attrName:At,value:Ot,ts:Y.ts??Date.now()},...c(V).slice(0,P-1)],!0)});Tp(()=>{Mi(),Ri(),Di(),ut()});var Ui=qY(),ji=yt(Ui);us(qc(ji,{}),Y=>zt=Y,()=>zt);var Bi=v(ji,2),fn=_(Bi),an=_(fn),Zi=_(an),_n=v(_(Zi),2),gt=v(Zi,2);{var Yt=Y=>{var Oe=nY(),Ve=_(Oe),ye=_(Ve);let At;var Ot=v(ye,2);let ri;var oi=v(Ve,2);{var xi=Jt=>{var fe=tY(),Ke=yt(fe),ot=v(_(Ke)),rt=v(Ke,2),ht=v(_(rt));jt(ot,()=>c(Se),_t=>m(Se,_t)),jt(ht,()=>c(Re),_t=>m(Re,_t)),D(Jt,fe)},Ut=Jt=>{var fe=iY(),Ke=yt(fe),ot=v(_(Ke)),rt=v(Ke,2),ht=_(rt),_t=v(ht,2),Xt=v(_(_t),2);jt(ot,()=>c(xe),F=>m(xe,F)),$("click",ht,Pt),$("change",Xt,ui),D(Jt,fe)};z(oi,Jt=>{c(ge)==="passcode"?Jt(xi):Jt(Ut,-1)})}var mi=v(oi,2),He=v(_(mi)),Ye=v(mi,2);{var Qt=Jt=>{var fe=$A(),Ke=_(fe);j(()=>O(Ke,c(We))),D(Jt,fe)};z(Ye,Jt=>{c(We)&&Jt(Qt)})}var Gt=v(Ye,2),gi=_(Gt);j(()=>{At=Bt(ye,1,"svelte-1ua3isv",null,At,{active:c(ge)==="passcode"}),ri=Bt(Ot,1,"svelte-1ua3isv",null,ri,{active:c(ge)==="pairingCode"}),Gt.disabled=c(et),O(gi,c(et)?"Commissioning…":"Commission")}),$("click",ye,()=>m(ge,"passcode")),$("click",Ot,()=>m(ge,"pairingCode")),jt(He,()=>c(_e),Jt=>m(_e,Jt)),$("click",Gt,mt),D(Y,Oe)};z(gt,Y=>{c(oe)&&Y(Yt)})}var Ci=v(gt,2),Wi=_(Ci);ei(Wi,17,()=>c(f),Y=>Y.nodeId,(Y,Oe)=>{var Ve=rY();let ye;var At=_(Ve),Ot=_(At);let ri;var oi=v(Ot,2),xi=_(oi);{var Ut=Ye=>{var Qt=sY(),Gt=yt(Qt),gi=_(Gt),Jt=v(Gt,2),fe=_(Jt);j(()=>{O(gi,c(Oe).name),O(fe,`#${c(Oe).nodeId??""}`)}),D(Ye,Qt)},mi=Ye=>{var Qt=oY(),Gt=_(Qt);j(()=>O(Gt,`Node ${c(Oe).nodeId??""}`)),D(Ye,Qt)};z(xi,Ye=>{c(Oe).name?Ye(Ut):Ye(mi,-1)})}var He=v(At,2);j(()=>{var Ye;ye=Bt(Ve,1,"svelte-1ua3isv",null,ye,{selected:((Ye=c(te))==null?void 0:Ye.nodeId)===c(Oe).nodeId}),ri=Bt(Ot,1,"status-dot svelte-1ua3isv",null,ri,{online:c(Oe).online})}),$("click",At,()=>Vt(c(Oe).nodeId)),$("click",He,()=>Zt(c(Oe).nodeId)),D(Y,Ve)});var Pi=v(Wi,2);{var Ti=Y=>{var Oe=aY();D(Y,Oe)};z(Pi,Y=>{c(f).length===0&&Y(Ti)})}var Oi=v(an,2),Qi=_(Oi);{var yi=Y=>{var Oe=lY();D(Y,Oe)},Xe=Y=>{var Oe=$A(),Ve=_(Oe);j(()=>O(Ve,c(De))),D(Y,Oe)},St=Y=>{var Oe=MY(),Ve=yt(Oe),ye=_(Ve),At=_(ye),Ot=v(ye,2);{var ri=mi=>{var He=cY(),Ye=_(He);j(()=>O(Ye,c(te).subtitle)),D(mi,He)};z(Ot,mi=>{c(te).subtitle&&mi(ri)})}var oi=v(Ot,2),xi=_(oi),Ut=v(Ve,2);ei(Ut,17,()=>c(te).endpoints,mi=>mi.endpointId,(mi,He)=>{var Ye=TY(),Qt=_(Ye),Gt=_(Qt),gi=v(Gt),Jt=_(gi),fe=v(gi,2);ei(fe,21,()=>c(He).clusters,Ni,(ht,_t)=>{var Xt=dY(),F=_(Xt);j(()=>O(F,c(_t).name)),D(ht,Xt)});var Ke=v(Qt,2);{var ot=ht=>{var _t=IY(),Xt=v(_(_t));ei(Xt,21,()=>c(He).clusters,Ni,(F,H)=>{var K=LY(),le=yt(K),Z=_(le),J=_(Z),ce=v(le,2);ei(ce,17,()=>Object.entries(c(H).attrs),Ni,(Qe,ae)=>{var pe=Tt(()=>o8(c(ae),2));let Te=()=>c(pe)[0],me=()=>c(pe)[1];var Ie=Es(),lt=yt(Ie);{var G=Ne=>{const it=Tt(()=>{var Li;return(Li=t[c(H).name])==null?void 0:Li[Te()]}),Pe=Tt(()=>(Te()==="acceptedCommandList"||Te()==="generatedCommandList")&&Array.isArray(me())),ke=Tt(()=>{var Li;return((Li=d[c(H).name])==null?void 0:Li[Te()])??a[Te()]});var Ct=FY(),vt=_(Ct),Fe=_(vt),Dt=_(Fe),Ge=v(Fe);{var ze=Li=>{var ni=uY(),ii=_(ni);j(Xi=>O(ii,`(${Xi??""})`),[()=>u(c(ke))]),D(Li,ni)};z(Ge,Li=>{c(ke)!==void 0&&Li(ze)})}var Je=v(vt),bt=_(Je);{var $e=Li=>{var ni=fY();ei(ni,21,()=>c(it),Ni,(ii,Xi)=>{var Ji=hY(),Ln=_(Ji);j(()=>O(Ln,c(Xi).label)),$("click",Ji,()=>i(c(te).nodeId,c(He).endpointId,c(H).name,c(Xi).command,c(Xi).args)),D(ii,Ji)}),D(Li,ni)};z(bt,Li=>{c(it)&&Li($e)})}var It=v(Je),Me=_(It);{var st=Li=>{var ni=vY();ei(ni,21,()=>s(c(H).name,me()),Ni,(ii,Xi,Ji)=>{var Ln=mY(),Jn=yt(Ln);{var Ss=ss=>{var ps=gY();D(ss,ps)};z(Jn,ss=>{Ji>0&&ss(Ss)})}var as=v(Jn,2);{var Bs=ss=>{var ps=pY(),zi=yt(ps),Ys=_(zi),Pn=v(zi),Vn=_(Pn);j(()=>{O(Ys,c(Xi).name),O(Vn,`(${c(Xi).id??""})`)}),D(ss,ps)},kn=ss=>{var ps=xY(),zi=_(ps);j(()=>O(zi,c(Xi).id)),D(ss,ps)};z(as,ss=>{c(Xi).name?ss(Bs):ss(kn,-1)})}D(ii,Ln)}),D(Li,ni)},Lt=Li=>{var ni=CY(),ii=v(_(ni));ei(ii,21,me,Ni,(Xi,Ji)=>{const Ln=Tt(()=>c(Ji)),Jn=Tt(()=>c(Ln).deviceType),Ss=Tt(()=>r[c(Jn)]);var as=bY(),Bs=_(as),kn=_(Bs);{var ss=Pn=>{var Vn=_Y(),Ts=yt(Vn),dr=v(Ts),Or=_(dr);j(Za=>{O(Ts,`${c(Ss)??""} `),O(Or,`(${Za??""})`)},[()=>u(c(Jn))]),D(Pn,Vn)},ps=Pn=>{var Vn=_o();j(Ts=>O(Vn,Ts),[()=>u(c(Jn))]),D(Pn,Vn)};z(kn,Pn=>{c(Ss)?Pn(ss):Pn(ps,-1)})}var zi=v(Bs),Ys=_(zi);j(Pn=>O(Ys,Pn),[()=>C(c(Ln).revision)]),D(Xi,as)}),D(Li,ni)},Ht=Tt(()=>Te()==="deviceTypeList"&&Array.isArray(me())),pt=Li=>{const ni=Tt(()=>[...new Set(me().flatMap(Jn=>Object.keys(Jn)))]);var ii=SY(),Xi=_(ii),Ji=_(Xi);ei(Ji,21,()=>c(ni),Ni,(Jn,Ss)=>{var as=EY(),Bs=_(as);j(()=>O(Bs,c(Ss))),D(Jn,as)});var Ln=v(Xi);ei(Ln,21,me,Ni,(Jn,Ss)=>{var as=wY();ei(as,21,()=>c(ni),Ni,(Bs,kn)=>{var ss=yY(),ps=_(ss);j(zi=>O(ps,zi),[()=>C(c(Ss)[c(kn)])]),D(Bs,ss)}),D(Jn,as)}),D(Li,ii)},vi=Tt(()=>y(me())),wi=Li=>{var ni=AY(),ii=_(ni);ei(ii,21,()=>Object.entries(me()),Ni,(Xi,Ji)=>{var Ln=Tt(()=>o8(c(Ji),2));let Jn=()=>c(Ln)[0],Ss=()=>c(Ln)[1];var as=DY(),Bs=_(as),kn=_(Bs),ss=v(Bs),ps=_(ss);j(zi=>{O(kn,Jn()),O(ps,zi)},[()=>C(Ss())]),D(Xi,as)}),D(Li,ni)},qi=Tt(()=>b(me())),Fi=Li=>{var ni=kY(),ii=_(ni);j(()=>{ln(ni,"href",me()),O(ii,me())}),D(Li,ni)},Gi=Li=>{var ni=BY(),ii=_(ni);j(Xi=>O(ii,Xi),[()=>C(me())]),D(Li,ni)};z(Me,Li=>{c(Pe)?Li(st):c(Ht)?Li(Lt,1):c(vi)?Li(pt,2):c(qi)?Li(wi,3):(Te()==="productUrl"||Te()==="productURL")&&typeof me()=="string"?Li(Fi,4):Li(Gi,-1)})}j(()=>{ln(vt,"title",Te()),O(Dt,Te())}),D(Ne,Ct)},re=Tt(()=>!w(me(),Te()));z(lt,Ne=>{c(re)&&Ne(G)})}D(Qe,Ie)}),j(()=>O(J,c(H).name)),D(F,K)}),D(ht,_t)},rt=ht=>{var _t=PY();D(ht,_t)};z(Ke,ht=>{c(He).clusters.length>0?ht(ot):ht(rt,-1)})}j(()=>{O(Gt,`${c(He).name??`Endpoint ${c(He).endpointId}`??""} `),O(Jt,`ep${c(He).endpointId??""}`)}),D(mi,Ye)}),j(()=>{O(At,c(te).name??`Node ${c(te).nodeId}`),O(xi,`Node ID: ${c(te).nodeId??""}`)}),D(Y,Oe)},Ai=Y=>{var Oe=RY();D(Y,Oe)};z(Qi,Y=>{c(he)?Y(yi):c(De)?Y(Xe,1):c(te)?Y(St,2):Y(Ai,-1)})}var ki=v(fn,2),fi=_(ki),Ii=v(fi,2),X=v(_(Ii),2);{var Ae=Y=>{var Oe=NY(),Ve=_(Oe);j(()=>O(Ve,c(V).length)),D(Y,Oe)};z(X,Y=>{!c(W)&&c(V).length>0&&Y(Ae)})}var qe=v(X,2),nt=_(qe),qt=v(Ii,2);{var se=Y=>{var Oe=VY(),Ve=_(Oe);{var ye=Ot=>{var ri=OY();D(Ot,ri)},At=Ot=>{var ri=Es(),oi=yt(ri);ei(oi,17,()=>c(ne),xi=>xi.id,(xi,Ut)=>{const mi=Tt(()=>{var ot,rt;return((ot=g.get(c(Ut).nodeId))==null?void 0:ot.name)??((rt=c(f).find(ht=>ht.nodeId===c(Ut).nodeId))==null?void 0:rt.name)??null}),He=Tt(()=>{var ot,rt;return c(Ut).endpointId!==void 0?((rt=(ot=g.get(c(Ut).nodeId))==null?void 0:ot.endpoints.find(ht=>ht.endpointId===c(Ut).endpointId))==null?void 0:rt.name)??null:null}),Ye=Tt(()=>c(Ut).attrName??c(Ut).clusterName);var Qt=zY(),Gt=_(Qt),gi=_(Gt),Jt=v(Gt,2);{var fe=ot=>{var rt=HY(),ht=v(yt(rt),2),_t=_(ht),Xt=v(_t);{var F=Z=>{var J=GC(),ce=v(yt(J)),Qe=_(ce);j(()=>O(Qe,`(#${c(Ut).nodeId??""})`)),D(Z,J)};z(Xt,Z=>{c(mi)&&Z(F)})}var H=v(ht,2);let K;var le=_(H);j(()=>{O(_t,c(mi)??`#${c(Ut).nodeId}`),K=Bt(H,1,"e-val svelte-1ua3isv",null,K,{"e-online":c(Ut).online,"e-offline":!c(Ut).online}),O(le,c(Ut).online?"online":"offline")}),D(ot,rt)},Ke=ot=>{var rt=WY(),ht=v(yt(rt),2),_t=_(ht),Xt=v(_t);{var F=me=>{var Ie=GC(),lt=v(yt(Ie)),G=_(lt);j(()=>O(G,`(#${c(Ut).nodeId??""})`)),D(me,Ie)};z(Xt,me=>{c(mi)&&me(F)})}var H=v(ht,2),K=_(H),le=v(K);{var Z=me=>{var Ie=GC(),lt=v(yt(Ie)),G=_(lt);j(()=>O(G,`(ep ${c(Ut).endpointId??""})`)),D(me,Ie)};z(le,me=>{c(He)&&me(Z)})}var J=v(H,2),ce=_(J),Qe=v(J,2),ae=_(Qe),pe=v(Qe,2),Te=_(pe);j(me=>{O(_t,c(mi)??`#${c(Ut).nodeId}`),O(K,c(He)??`ep${c(Ut).endpointId}`),O(ce,c(Ut).clusterName),O(ae,c(Ye)),O(Te,me)},[()=>p(c(Ut).value)]),D(ot,rt)};z(Jt,ot=>{c(Ut).kind==="status"?ot(fe):ot(Ke,-1)})}j(ot=>O(gi,ot),[()=>A(c(Ut).ts)]),D(xi,Qt)}),D(Ot,ri)};z(Ve,Ot=>{c(ne).length===0?Ot(ye):Ot(At,-1)})}D(Y,Oe)};z(qt,Y=>{c(W)&&Y(se)})}var Ee=v(Bi,2);{var Le=Y=>{var Oe=UY(),Ve=yt(Oe),ye=v(Ve,2),At=_(ye),Ot=v(_(At),2),ri=v(At,2);{var oi=mi=>{var He=jY(),Ye=_(He);j(()=>O(Ye,c(Wt))),D(mi,He)},xi=mi=>{var He=$Y(),Ye=yt(He),Qt=_(Ye);us(Qt,Gt=>m(tt,Gt),()=>c(tt)),D(mi,He)};z(ri,mi=>{c(Wt)?mi(oi):mi(xi,-1)})}var Ut=v(ri,2);us(Ut,mi=>m(kt,mi),()=>c(kt)),$("click",Ve,ut),$("click",Ot,ut),D(Y,Oe)};z(Ee,Y=>{c(dt)&&Y(Le)})}j(()=>{$o(ki,c(W)?`height: ${c(Q)}px;`:""),O(nt,c(W)?"▾":"▸")}),$("click",_n,()=>m(oe,!c(oe))),$("mousedown",fi,de),$("click",qe,()=>{m(W,!c(W))}),D(o,Ui),js()}Zs(["click","change","mousedown"]);var KY=B("<button>›</button>"),ZY=B('<span class="chev-ph svelte-1vejtrc"></span>'),XY=B('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),YY=B("<button>🔒</button>"),QY=B('<span class="acl-loading">Loading…</span>'),JY=B("<span> </span>"),eQ=B('<span class="acl-dyn svelte-1vejtrc" title="per-user/client pattern — cannot evaluate statically">⚠%u/%c</span>'),tQ=B('<span class="acl-members svelte-1vejtrc"> </span>'),iQ=B('<span class="acl-group svelte-1vejtrc"> </span>'),nQ=B('<span> <strong class="svelte-1vejtrc"> </strong> <!> <!> <!></span>'),sQ=B('<div class="acl-sec svelte-1vejtrc"><span class="acl-sec-hdr svelte-1vejtrc"> </span> <!></div>'),oQ=B('<div class="acl-panel svelte-1vejtrc"><!></div>'),rQ=B('<div class="tc svelte-1vejtrc"></div>'),aQ=B('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!> <!></div> <!> <!></div>'),lQ=B('<button class="acl-refresh svelte-1vejtrc" title="Refresh ACL data">↺</button>'),cQ=B('<button title="Show ACL coverage for topics"><svg width="11" height="11" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><rect x="3" y="7" width="10" height="8" rx="1.5"></rect><path d="M5 7V5a3 3 0 0 1 6 0v2" fill="none" stroke="currentColor" stroke-width="1.8"></path></svg> ACL<!></button> <!>',1),dQ=B("<option></option>"),uQ=B('<span class="pub-ok svelte-1vejtrc">✓</span>'),hQ=B('<span class="pub-err svelte-1vejtrc"> </span>'),fQ=B('<div class="info svelte-1vejtrc">Loading…</div>'),gQ=B('<div class="info err svelte-1vejtrc"> </div>'),pQ=B('<div class="info svelte-1vejtrc">No topics match.</div>'),xQ=B('<div class="vr svelte-1vejtrc"><span class="v-topic svelte-1vejtrc"> </span> <span class="v-val svelte-1vejtrc"> </span> <span class="v-ts svelte-1vejtrc"> </span></div>'),mQ=B('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),vQ=B('<div class="info svelte-1vejtrc">No topics yet.</div>'),_Q=B('<div class="tree-wrap svelte-1vejtrc"><!></div>'),bQ=B('<span class="stream-badge"> </span>'),CQ=B('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),EQ=B('<span class="s-ret svelte-1vejtrc" title="retained snapshot">&#x229B;</span>'),yQ=B('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),wQ=B('<div class="stream-body svelte-1vejtrc"><!></div>'),SQ=B('<div class="ctx-bd svelte-1vejtrc"></div> <div class="ctx-menu svelte-1vejtrc"><button class="svelte-1vejtrc">Copy topic</button> <button class="svelte-1vejtrc">Clear retained</button></div>',1),DQ=B('<label class="modal-check svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> Recursive — also clear all child topics</label>'),AQ=B('<div class="modal-bd svelte-1vejtrc"></div> <div class="modal svelte-1vejtrc"><div class="modal-title svelte-1vejtrc">Clear retained</div> <div class="modal-body svelte-1vejtrc"><p class="svelte-1vejtrc">Clear retained value for <code class="svelte-1vejtrc"> </code>?</p> <!></div> <div class="modal-footer svelte-1vejtrc"><button class="btn-cancel svelte-1vejtrc">Cancel</button> <button class="btn-confirm svelte-1vejtrc">Clear</button></div></div>',1),kQ=B('<div class="page svelte-1vejtrc"><div class="toolbar svelte-1vejtrc"><h2 class="svelte-1vejtrc">MQTT</h2> <!></div> <div class="main-group svelte-1vejtrc"><div class="pub-bar svelte-1vejtrc"><input class="pt svelte-1vejtrc" type="text" placeholder="topic" list="pub-topic-list" autocomplete="off"/> <datalist id="pub-topic-list"></datalist> <input class="pp svelte-1vejtrc" type="text" placeholder="payload"/> <label class="rl svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> retain</label> <select class="svelte-1vejtrc"><option>QoS 0</option><option>QoS 1</option><option>QoS 2</option></select> <button class="svelte-1vejtrc">Publish</button> <!> <!></div> <div class="tree-filter-bar svelte-1vejtrc"><input class="filter-in svelte-1vejtrc" type="search" placeholder="Filter topics…"/> <span class="count svelte-1vejtrc"><!> </span></div> <!></div> <div class="stream-panel svelte-1vejtrc"><div class="stream-resize svelte-1vejtrc"></div> <div class="stream-hdr-row svelte-1vejtrc"><input class="filter-in stream-filter-in svelte-1vejtrc" type="search" placeholder="Live stream filter (MQTT wildcard, default: #)"/> <!> <button class="stream-toggle svelte-1vejtrc" title="Toggle live stream"> </button></div> <!></div> <!> <!></div>');function BQ(o,e){Vs(e,!0);const t=(F,H=tb)=>{const K=Tt(()=>c(g).has(H().path)),le=Tt(()=>c(a)>=0&&H().children.size>0),Z=Tt(()=>c(a)>=0&&H().isLeaf&&!n.has(H().path));var J=aQ(),ce=_(J);let Qe;var ae=_(ce);{var pe=Fe=>{var Dt=KY();let Ge;j(()=>{Ge=Bt(Dt,1,"chev svelte-1vejtrc",null,Ge,{open:c(K)}),ln(Dt,"aria-label",c(K)?"Collapse":"Expand")}),$("click",Dt,()=>p(H().path)),D(Fe,Dt)},Te=Fe=>{var Dt=ZY();D(Fe,Dt)};z(ae,Fe=>{c(le)?Fe(pe):Fe(Te,-1)})}var me=v(ae,2),Ie=_(me),lt=v(me,2);{var G=Fe=>{var Dt=XY(),Ge=yt(Dt),ze=_(Ge),Je=v(Ge,2),bt=_(Je);j(($e,It,Me)=>{ln(Ge,"title",$e),O(ze,It),O(bt,Me)},[()=>{var $e;return wt(($e=zt(H().path))==null?void 0:$e.val)},()=>{var $e;return wt(($e=zt(H().path))==null?void 0:$e.val)},()=>{var $e;return(($e=zt(H().path))==null?void 0:$e.ts)!=null?Ft(zt(H().path).ts):""}]),D(Fe,Dt)},re=Tt(()=>H().isLeaf&&i.has(H().path));z(lt,Fe=>{c(re)&&Fe(G)})}var Ne=v(lt,2);{var it=Fe=>{const Dt=Tt(()=>!!c(Ui)&&Zi(H().path));var Ge=YY();let ze;j(()=>{ze=Bt(Ge,1,"acl-badge svelte-1vejtrc",null,ze,{matched:c(Dt)}),ln(Ge,"title",c(Dt)?"Has explicit ACL — click to inspect":"No explicit ACL — click to inspect defaults")}),$("click",Ge,Je=>{Je.stopPropagation(),gt(H().path)}),D(Fe,Ge)};z(Ne,Fe=>{c(Ri)&&H().isLeaf&&Fe(it)})}var Pe=v(ce,2);{var ke=Fe=>{var Dt=oQ(),Ge=_(Dt);{var ze=bt=>{var $e=QY();D(bt,$e)},Je=bt=>{var $e=Es(),It=yt($e);ei(It,17,()=>[{label:"Send",section:c(Bi).send},{label:"Subscribe",section:c(Bi).subscribe},{label:"Receive",section:c(Bi).receive}],Ni,(Me,st)=>{var Lt=sQ(),Ht=_(Lt),pt=_(Ht),vi=v(Ht,2);{var wi=Fi=>{var Gi=JY();let Li;var ni=_(Gi);j(()=>{Li=Bt(Gi,1,"acl-def svelte-1vejtrc",null,Li,{allow:c(st).section.default,deny:!c(st).section.default}),O(ni,`${c(st).section.default?"allow":"deny"} (default)`)}),D(Fi,Gi)},qi=Fi=>{var Gi=Es(),Li=yt(Gi);ei(Li,17,()=>c(st).section.roles,Ni,(ni,ii)=>{var Xi=nQ();let Ji;var Ln=_(Xi),Jn=v(Ln),Ss=_(Jn),as=v(Jn,2);{var Bs=zi=>{var Ys=eQ();D(zi,Ys)};z(as,zi=>{c(ii).dynamic&&zi(Bs)})}var kn=v(as,2);{var ss=zi=>{var Ys=tQ(),Pn=_(Ys);j(Vn=>O(Pn,Vn),[()=>c(ii).users.join(", ")]),D(zi,Ys)};z(kn,zi=>{c(ii).users.length>0&&zi(ss)})}var ps=v(kn,2);ei(ps,17,()=>c(ii).groups,Ni,(zi,Ys)=>{var Pn=iQ(),Vn=_(Pn);j(()=>O(Vn,c(Ys).groupname)),D(zi,Pn)}),j(()=>{Ji=Bt(Xi,1,"acl-role svelte-1vejtrc",null,Ji,{allow:c(ii).allow,deny:!c(ii).allow}),O(Ln,`${c(ii).allow?"✓":"✗"} `),O(Ss,c(ii).rolename)}),D(ni,Xi)}),D(Fi,Gi)};z(vi,Fi=>{c(st).section.roles.length===0?Fi(wi):Fi(qi,-1)})}j(()=>O(pt,c(st).label)),D(Me,Lt)}),D(bt,$e)};z(Ge,bt=>{c(fn)?bt(ze):c(Bi)&&bt(Je,1)})}D(Fe,Dt)};z(Pe,Fe=>{c(Ri)&&H().isLeaf&&c(ji)===H().path&&Fe(ke)})}var Ct=v(Pe,2);{var vt=Fe=>{var Dt=rQ();ei(Dt,21,()=>[...H().children.values()].sort((Ge,ze)=>Ge.seg.localeCompare(ze.seg)),Ge=>Ge.path,(Ge,ze)=>{t(Ge,()=>c(ze))}),D(Fe,Dt)};z(Ct,Fe=>{c(le)&&c(K)&&Fe(vt)})}j(()=>{Qe=Bt(ce,1,"tr svelte-1vejtrc",null,Qe,{stale:c(Z)}),O(Ie,H().seg)}),$("click",ce,()=>{m(he,H().path+"/#")}),$("contextmenu",ce,Fe=>{Fe.preventDefault(),m(_e,{x:Fe.clientX,y:Fe.clientY,topic:H().path},!0)}),D(F,J)},i=new Map,n=new Set,s=new Set;let r=null,a=I(0);function d(){r===null&&(r=requestAnimationFrame(()=>{r=null;for(const F of s)f(F);s.clear(),l8(a)}))}const u=new Map;function f(F){const H=F.split("/");let K=u,le="";for(let Z=0;Z<H.length;Z++){const J=H[Z];le=Z===0?J:`${le}/${J}`,K.has(J)||K.set(J,{seg:J,path:le,children:new Map,isLeaf:!1});const ce=K.get(J);Z===H.length-1&&(ce.isLeaf=!0),K=ce.children}}let g=I(Ei(new Set));function p(F){const H=new Set(c(g));H.has(F)?H.delete(F):H.add(F),m(g,H,!0)}let C=I("");const b=24,y=5;let w=I(0),A=I(300),P=Tt(()=>{if(c(a),!c(C))return[];const F=c(C).toLowerCase().split(/\s+/).filter(Boolean),H=[];for(const[K,le]of i){const Z=K.toLowerCase();F.every(J=>Z.includes(J))&&H.push({topic:K,...le})}return H.sort((K,le)=>K.topic.localeCompare(le.topic))}),M=Tt(()=>{const F=c(P).length,H=Math.max(0,Math.floor(c(w)/b)-y),K=Math.min(F,Math.ceil((c(w)+c(A))/b)+y);return{start:H,end:K,totalH:F*b,top:H*b}});const R=1e3,T=200,V=20,W=36;let Q=0,ne=I(Ei([])),de=I(Ei([])),te=I(!0),he=I("#"),De=I(200);$n(()=>{const F=c(he).trim(),H=Ol(()=>c(ne)),K=!F||F==="#"?H.slice(0,T):H.filter(le=>oe(F,le.topic)).slice(0,T);if(F&&F!=="#"){const le=new Set(K.map(J=>J.topic)),Z=[];for(const[J,ce]of i)le.has(J)||oe(F,J)&&Z.push({id:-(Z.length+1),topic:J,val:ce.val,ts:ce.ts,retained:!0});Z.sort((J,ce)=>J.topic.localeCompare(ce.topic)),m(de,[...K,...Z],!0)}else m(de,K,!0)});function oe(F,H){if(F==="#")return!0;const K=F.split("/"),le=H.split("/");for(let Z=0;Z<K.length;Z++){if(K[Z]==="#")return!0;if(Z>=le.length||K[Z]!=="+"&&K[Z]!==le[Z])return!1}return K.length===le.length}function ge(F){F.preventDefault();const H=F.clientY,K=c(De);function le(J){m(De,Math.max(60,Math.min(800,K+H-J.clientY)),!0)}function Z(){document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",Z)}document.addEventListener("mousemove",le),document.addEventListener("mouseup",Z)}let Se=Tt(()=>{const F=Math.max(1,Math.floor((c(De)-W)/V)+1);return c(de).slice(0,F)}),Re=I(!0),xe=I(null);async function et(){m(Re,!0),m(xe,null);try{const F=await pF();for(const H of F)i.set(H.topic,{val:H.val,ts:H.ts}),f(H.topic)}catch(F){m(xe,F instanceof Error?F.message:String(F),!0)}finally{m(Re,!1),l8(a)}}const We=ar("mqtt",F=>{const{topic:H,val:K,ts:le}=F;i.set(H,{val:K,ts:le}),n.add(H),s.add(H),d();const Z={id:Q++,topic:H,val:K,ts:le};m(ne,[Z,...c(ne).slice(0,R-1)],!0);const J=c(he).trim();(!J||J==="#"||oe(J,H))&&m(de,[Z,...c(de).filter(ce=>!(ce.retained&&ce.topic===H)).slice(0,T-1)],!0)});let _e=I(null),dt=I(null);async function Wt(F,H){const K=[F];if(H){const le=F+"/";for(const Z of i.keys())Z.startsWith(le)&&K.push(Z)}for(const le of K)await dA(le,"",!0,0)}let tt=Tt(()=>(c(a),[...i.keys()].sort())),kt=I(""),be=I(""),Rt=I(!1),ut=I(0),at=I(!1),Ze=I(null),Pt=I(!1);async function ui(){if(c(kt)){m(at,!0),m(Ze,null),m(Pt,!1);try{await dA(c(kt),c(be),c(Rt),c(ut)),m(Pt,!0),setTimeout(()=>{m(Pt,!1)},2e3)}catch(F){m(Ze,F instanceof Error?F.message:String(F),!0)}finally{m(at,!1)}}}function wt(F){return F==null?"":typeof F=="object"?JSON.stringify(F):String(F)}function Ft(F){return new Date(F).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Vt(F){return new Date(F).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function zt(F){return c(a),i.get(F)}let Zt=Tt(()=>(c(a),[...u.values()].sort((F,H)=>F.seg.localeCompare(H.seg)))),mt=Tt(()=>(c(a),i.size)),Mi=I(!1),Ri=I(!1),Di=I(!1),Ui=I(null),ji=I(null),Bi=I(null),fn=I(!1);function an(F,H,K){return H.includes("%u")||H.includes("%c")?"dynamic":F==="subscribeLiteral"||F==="unsubscribeLiteral"?H===K?"match":"no-match":oe(H,K)?"match":"no-match"}function Zi(F){if(!c(Ui))return!1;for(const H of c(Ui).roles)if(H.acls){for(const K of H.acls)if(an(K.acltype,K.topic,F)!=="no-match")return!0}return!1}async function _n(){m(Di,!0);try{const F=await EF();m(Ui,{roles:F.roles},!0)}catch{m(Ui,null),m(Ri,!1)}finally{m(Di,!1)}}async function gt(F){if(c(ji)===F){m(ji,null),m(Bi,null);return}m(ji,F,!0),m(Bi,null),m(fn,!0);try{m(Bi,await BU(F),!0)}catch{m(Bi,null)}finally{m(fn,!1)}}async function Yt(){c(Ri)?(m(Ri,!1),m(ji,null),m(Bi,null)):(m(Ri,!0),m(ji,null),m(Bi,null),c(Ui)||await _n())}Ks(et),Ks(async()=>{var F;try{const H=await oS();m(Mi,!!((F=H.dynsec)!=null&&F.dynsecReady),!0)}catch{m(Mi,!1)}}),Tp(()=>{We(),r!==null&&cancelAnimationFrame(r)});var Ci=kQ(),Wi=_(Ci),Pi=v(_(Wi),2);{var Ti=F=>{var H=cQ(),K=yt(H);let le;var Z=v(_(K),2);{var J=ae=>{var pe=_o("…");D(ae,pe)};z(Z,ae=>{c(Di)&&ae(J)})}var ce=v(K,2);{var Qe=ae=>{var pe=lQ();j(()=>pe.disabled=c(Di)),$("click",pe,_n),D(ae,pe)};z(ce,ae=>{c(Ri)&&ae(Qe)})}j(()=>{le=Bt(K,1,"acl-btn svelte-1vejtrc",null,le,{active:c(Ri)}),K.disabled=c(Di)}),$("click",K,Yt),D(F,H)};z(Pi,F=>{c(Mi)&&F(Ti)})}var Oi=v(Wi,2),Qi=_(Oi),yi=_(Qi),Xe=v(yi,2);ei(Xe,20,()=>c(tt),F=>F,(F,H)=>{var K=dQ(),le={};j(()=>{le!==(le=H)&&(K.value=(K.__value=H)??"")}),D(F,K)});var St=v(Xe,2),Ai=v(St,2),ki=_(Ai),fi=v(Ai,2),Ii=_(fi);Ii.value=Ii.__value=0;var X=v(Ii);X.value=X.__value=1;var Ae=v(X);Ae.value=Ae.__value=2;var qe=v(fi,2),nt=v(qe,2);{var qt=F=>{var H=uQ();D(F,H)};z(nt,F=>{c(Pt)&&F(qt)})}var se=v(nt,2);{var Ee=F=>{var H=hQ(),K=_(H);j(()=>O(K,c(Ze))),D(F,H)};z(se,F=>{c(Ze)&&F(Ee)})}var Le=v(Qi,2),Y=_(Le),Oe=v(Y,2),Ve=_(Oe);{var ye=F=>{var H=_o();j(()=>O(H,`${c(P).length??""} /`)),D(F,H)};z(Ve,F=>{c(C)&&F(ye)})}var At=v(Ve),Ot=v(Le,2);{var ri=F=>{var H=fQ();D(F,H)},oi=F=>{var H=gQ(),K=_(H);j(()=>O(K,c(xe))),D(F,H)},xi=F=>{var H=Es(),K=yt(H);{var le=J=>{var ce=pQ();D(J,ce)},Z=J=>{var ce=mQ(),Qe=_(ce),ae=_(Qe);ei(ae,21,()=>c(P).slice(c(M).start,c(M).end),pe=>pe.topic,(pe,Te)=>{var me=xQ(),Ie=_(me),lt=_(Ie),G=v(Ie,2),re=_(G),Ne=v(G,2),it=_(Ne);j((Pe,ke,Ct)=>{O(lt,c(Te).topic),ln(G,"title",Pe),O(re,ke),O(it,Ct)},[()=>wt(c(Te).val),()=>wt(c(Te).val),()=>Ft(c(Te).ts)]),D(pe,me)}),j(()=>{$o(Qe,`height: ${c(M).totalH??""}px; position: relative;`),$o(ae,`top: ${c(M).top??""}px;`)}),fs("scroll",ce,pe=>{m(w,pe.currentTarget.scrollTop,!0)}),dP(ce,"clientHeight",pe=>m(A,pe)),D(J,ce)};z(K,J=>{c(P).length===0?J(le):J(Z,-1)})}D(F,H)},Ut=F=>{var H=_Q(),K=_(H);{var le=J=>{var ce=vQ();D(J,ce)},Z=J=>{var ce=Es(),Qe=yt(ce);ei(Qe,17,()=>c(Zt),ae=>ae.path,(ae,pe)=>{t(ae,()=>c(pe))}),D(J,ce)};z(K,J=>{c(Zt).length===0?J(le):J(Z,-1)})}D(F,H)};z(Ot,F=>{c(Re)?F(ri):c(xe)?F(oi,1):c(C)?F(xi,2):F(Ut,-1)})}var mi=v(Oi,2),He=_(mi),Ye=v(He,2),Qt=_(Ye),Gt=v(Qt,2);{var gi=F=>{var H=bQ(),K=_(H);j(()=>O(K,c(de).length)),D(F,H)};z(Gt,F=>{!c(te)&&c(de).length>0&&F(gi)})}var Jt=v(Gt,2),fe=_(Jt),Ke=v(Ye,2);{var ot=F=>{var H=wQ(),K=_(H);{var le=J=>{var ce=CQ();D(J,ce)},Z=J=>{var ce=Es(),Qe=yt(ce);ei(Qe,17,()=>c(Se),ae=>ae.id,(ae,pe)=>{var Te=yQ();let me;var Ie=_(Te),lt=_(Ie),G=v(Ie,2);{var re=Ct=>{var vt=EQ();D(Ct,vt)};z(G,Ct=>{c(pe).retained&&Ct(re)})}var Ne=v(G,2),it=_(Ne),Pe=v(Ne,2),ke=_(Pe);j((Ct,vt,Fe)=>{me=Bt(Te,1,"sr svelte-1vejtrc",null,me,{retained:c(pe).retained}),O(lt,Ct),O(it,c(pe).topic),ln(Pe,"title",vt),O(ke,Fe)},[()=>Vt(c(pe).ts),()=>wt(c(pe).val),()=>wt(c(pe).val)]),D(ae,Te)}),D(J,ce)};z(K,J=>{c(Se).length===0?J(le):J(Z,-1)})}D(F,H)};z(Ke,F=>{c(te)&&F(ot)})}var rt=v(mi,2);{var ht=F=>{var H=SQ(),K=yt(H),le=v(K,2);let Z;var J=_(le),ce=v(J,2);j(()=>Z=$o(le,"",Z,{left:`${c(_e).x??""}px`,top:`${c(_e).y??""}px`})),$("click",K,()=>m(_e,null)),$("contextmenu",K,Qe=>{Qe.preventDefault(),m(_e,null)}),$("click",J,()=>{navigator.clipboard.writeText(c(_e).topic),m(_e,null)}),$("click",ce,()=>{const Qe=c(_e).topic,ae=Qe+"/",pe=[...i.keys()].some(Te=>Te.startsWith(ae));m(dt,{topic:Qe,hasChildren:pe,recursive:!1},!0),m(_e,null)}),D(F,H)};z(rt,F=>{c(_e)&&F(ht)})}var _t=v(rt,2);{var Xt=F=>{var H=AQ(),K=yt(H),le=v(K,2),Z=v(_(le),2),J=_(Z),ce=v(_(J)),Qe=_(ce),ae=v(J,2);{var pe=lt=>{var G=DQ(),re=_(G);Cs(re,()=>c(dt).recursive,Ne=>c(dt).recursive=Ne),D(lt,G)};z(ae,lt=>{c(dt).hasChildren&&lt(pe)})}var Te=v(Z,2),me=_(Te),Ie=v(me,2);j(()=>O(Qe,c(dt).topic)),$("click",K,()=>m(dt,null)),$("click",me,()=>m(dt,null)),$("click",Ie,()=>{const{topic:lt,recursive:G}=c(dt);m(dt,null),Wt(lt,G)}),D(F,H)};z(_t,F=>{c(dt)&&F(Xt)})}j(()=>{qe.disabled=c(at)||!c(kt),O(At,` ${c(mt)??""}`),$o(mi,c(te)?`height: ${c(De)}px;`:""),O(fe,c(te)?"▾":"▸")}),jt(yi,()=>c(kt),F=>m(kt,F)),jt(St,()=>c(be),F=>m(be,F)),Cs(ki,()=>c(Rt),F=>m(Rt,F)),Fs(fi,()=>c(ut),F=>m(ut,F)),$("click",qe,ui),jt(Y,()=>c(C),F=>m(C,F)),$("mousedown",He,ge),jt(Qt,()=>c(he),F=>m(he,F)),$("click",Jt,()=>{m(te,!c(te))}),D(o,Ci),js()}Zs(["click","contextmenu","mousedown"]);var FQ=B('<div class="restart-banner restart-banner--restarting svelte-twakcj">Restarting daemon…</div>'),LQ=B('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. <button class="restart-btn svelte-twakcj">Restart now</button></div>'),IQ=B('<div class="err svelte-twakcj"> </div>'),PQ=B('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),TQ=B('<p class="empty svelte-twakcj">No packages installed.</p>'),MQ=B('<p class="empty svelte-twakcj">No match.</p>'),RQ=B("<span> </span>"),NQ=b6('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="8" cy="8" r="6" stroke-dasharray="18" stroke-dashoffset="4"></circle></svg>'),OQ=b6('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg>'),HQ=B('<div><div class="dep-info svelte-twakcj"><a class="dep-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="dep-ver svelte-twakcj"> </span> <!></div> <div class="dep-btns svelte-twakcj"><button><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4"></path><line x1="9" y1="15" x2="4.5" y2="19.5"></line><line x1="14.5" y1="4" x2="20" y2="9.5"></line></svg></button> <button><!></button> <button class="icon-btn icon-btn--danger svelte-twakcj" title="Uninstall"><svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"></line><line x1="14" y1="2" x2="2" y2="14"></line></svg></button></div></div>'),WQ=B('<span class="result-author svelte-twakcj"> </span>'),zQ=B('<span class="result-date svelte-twakcj"> </span>'),VQ=B('<span class="result-desc svelte-twakcj"> </span>'),jQ=B('<div class="result-row svelte-twakcj"><div class="result-info svelte-twakcj"><a class="result-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="result-ver svelte-twakcj"> </span> <!> <!> <!></div> <button class="install-btn svelte-twakcj"> </button></div>'),$Q=B('<div class="results-list svelte-twakcj"></div>'),UQ=B('<pre class="npm-output svelte-twakcj"> </pre>'),qQ=B(`<p class="hint svelte-twakcj">Install npm packages into <code class="svelte-twakcj">~/.she/</code>. Scripts can then <code class="svelte-twakcj">require('package-name')</code> directly.</p>`),GQ=B('<!> <div class="pkg-shell svelte-twakcj"><!> <!> <div class="pkg-body svelte-twakcj"><div class="pkg-left svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Installed</span> <span class="pane-count svelte-twakcj"> </span> <!> <button class="icon-btn check-outdated-btn svelte-twakcj" title="Check for package updates"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg></button></div> <div class="filter-row svelte-twakcj"><input class="filter-in svelte-twakcj" type="search" placeholder="Filter…"/></div> <div class="installed-list svelte-twakcj"><!></div></div> <div class="pkg-right svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Search npm</span></div> <div class="search-row svelte-twakcj"><input class="search-in svelte-twakcj" type="text" placeholder="Package name, e.g. axios, lodash…"/> <button class="search-btn svelte-twakcj"> </button></div> <!> <!> <!></div></div></div>',1);function KQ(o,e){Vs(e,!0);let t=I(Ei([])),i=I(""),n=I(Ei({})),s=I(Ei([])),r=I(!1),a=I(""),d=I(Ei([])),u=I(!1),f=I(!1),g=I(!1),p=I(""),C=I(""),b=Ei({});const y=Tt(()=>c(i).trim()?c(t).filter(gt=>gt.name.toLowerCase().includes(c(i).toLowerCase())):c(t)),w=Tt(()=>Object.keys(c(n)).filter(gt=>!c(s).includes(gt)).length);Ks(async()=>{await Promise.all([A(),P(),M()])});async function A(){try{m(t,await G$(),!0),m(p,"")}catch(gt){m(p,gt.message,!0)}}async function P(){try{m(n,await fF(),!0)}catch{}}async function M(){try{const gt=await Il();m(s,Array.isArray(gt.pinnedPackages)?gt.pinnedPackages:[],!0)}catch{}}async function R(gt){const Yt=c(s).includes(gt)?c(s).filter(Ci=>Ci!==gt):[...c(s),gt];m(s,Yt,!0);try{const Ci=await Il();await ap({...Ci,pinnedPackages:Yt})}catch{}}async function T(){m(r,!0);try{m(n,await Q$(),!0)}catch{}finally{m(r,!1)}}async function V(){const gt=c(a).trim();if(!gt){m(d,[],!0);return}m(g,!0),m(p,"");try{m(d,await K$(gt),!0)}catch(Yt){m(p,Yt.message,!0)}finally{m(g,!1)}}function W(gt){if(!gt)return"";try{return new Date(gt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}async function Q(gt,Yt){b[gt]=!0,m(p,""),m(C,"");try{const Ci=await Z$(gt,Yt);m(C,Ci.stdout||Ci.stderr||"Done.",!0),m(u,!0),await A()}catch(Ci){m(p,Ci.message,!0)}finally{b[gt]=!1}}async function ne(gt){b[gt]=!0,m(p,""),m(C,"");try{const Yt=await X$(gt);m(C,Yt.stdout||Yt.stderr||"Done.",!0),m(u,!0);const Ci={...c(n)};delete Ci[gt],m(n,Ci,!0),await A()}catch(Yt){m(p,Yt.message,!0)}finally{b[gt]=!1}}async function de(gt){b[gt]=!0,m(p,""),m(C,"");try{const Yt=await Y$(gt);m(C,Yt.stdout||Yt.stderr||"Done.",!0),m(u,!0);const Ci={...c(n)};delete Ci[gt],m(n,Ci,!0),await A()}catch(Yt){m(p,Yt.message,!0)}finally{b[gt]=!1}}let te;async function he(){if(await te.show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"})){m(f,!0);try{await dF()}catch{}setTimeout(()=>{window.location.reload()},3e3)}}var De=GQ(),oe=yt(De);us(qc(oe,{}),gt=>te=gt,()=>te);var ge=v(oe,2),Se=_(ge);{var Re=gt=>{var Yt=FQ();D(gt,Yt)},xe=gt=>{var Yt=LQ(),Ci=v(_(Yt));$("click",Ci,he),D(gt,Yt)};z(Se,gt=>{c(f)?gt(Re):c(u)&&gt(xe,1)})}var et=v(Se,2);{var We=gt=>{var Yt=IQ(),Ci=_(Yt);j(()=>O(Ci,c(p))),D(gt,Yt)};z(et,gt=>{c(p)&&gt(We)})}var _e=v(et,2),dt=_(_e),Wt=_(dt),tt=v(_(Wt),2),kt=_(tt),be=v(tt,2);{var Rt=gt=>{var Yt=PQ(),Ci=_(Yt);j(()=>O(Ci,`${c(w)??""} outdated`)),D(gt,Yt)};z(be,gt=>{c(w)>0&&gt(Rt)})}var ut=v(be,2),at=_(ut);let Ze;var Pt=v(Wt,2),ui=_(Pt),wt=v(Pt,2),Ft=_(wt);{var Vt=gt=>{var Yt=TQ();D(gt,Yt)},zt=gt=>{var Yt=MQ();D(gt,Yt)},Zt=gt=>{var Yt=Es(),Ci=yt(Yt);ei(Ci,17,()=>c(y),Wi=>Wi.name,(Wi,Pi)=>{var Ti=HQ();let Oi;var Qi=_(Ti),yi=_(Qi),Xe=_(yi),St=v(yi,2),Ai=_(St),ki=v(St,2);{var fi=Y=>{var Oe=RQ();let Ve;var ye=_(Oe);j(At=>{Ve=Bt(Oe,1,"dep-latest svelte-twakcj",null,Ve,At),O(ye,`→ v${c(n)[c(Pi).name].latest??""}`)},[()=>({"dep-latest--pinned":c(s).includes(c(Pi).name)})]),D(Y,Oe)};z(ki,Y=>{c(n)[c(Pi).name]&&Y(fi)})}var Ii=v(Qi,2),X=_(Ii);let Ae;var qe=v(X,2);let nt;var qt=_(qe);{var se=Y=>{var Oe=NQ();D(Y,Oe)},Ee=Y=>{var Oe=OQ();D(Y,Oe)};z(qt,Y=>{b[c(Pi).name]?Y(se):Y(Ee,-1)})}var Le=v(qe,2);j((Y,Oe,Ve)=>{Oi=Bt(Ti,1,"dep-row svelte-twakcj",null,Oi,{"dep-busy":!!b[c(Pi).name]}),ln(yi,"href",c(Pi).url??`https://www.npmjs.com/package/${c(Pi).name}`),O(Xe,c(Pi).name),O(Ai,c(Pi).installedVersion??c(Pi).version),Ae=Bt(X,1,"icon-btn svelte-twakcj",null,Ae,Y),ln(X,"title",Oe),nt=Bt(qe,1,"icon-btn svelte-twakcj",null,nt,Ve),qe.disabled=!!b[c(Pi).name],ln(qe,"title",c(n)[c(Pi).name]?`Update to v${c(n)[c(Pi).name].latest}`:"Update to latest"),Le.disabled=!!b[c(Pi).name]},[()=>({"icon-btn--pinned":c(s).includes(c(Pi).name)}),()=>c(s).includes(c(Pi).name)?"Unpin package":"Pin package (suppress update dot)",()=>({"icon-btn--update":!!c(n)[c(Pi).name]&&!c(s).includes(c(Pi).name)})]),$("click",X,()=>R(c(Pi).name)),$("click",qe,()=>de(c(Pi).name)),$("click",Le,()=>ne(c(Pi).name)),D(Wi,Ti)}),D(gt,Yt)};z(Ft,gt=>{c(t).length===0?gt(Vt):c(y).length===0?gt(zt,1):gt(Zt,-1)})}var mt=v(dt,2),Mi=v(_(mt),2),Ri=_(Mi),Di=v(Ri,2),Ui=_(Di),ji=v(Mi,2);{var Bi=gt=>{var Yt=$Q();ei(Yt,21,()=>c(d),Ci=>Ci.name,(Ci,Wi)=>{var Pi=jQ(),Ti=_(Pi),Oi=_(Ti),Qi=_(Oi),yi=v(Oi,2),Xe=_(yi),St=v(yi,2);{var Ai=nt=>{var qt=WQ(),se=_(qt);j(()=>O(se,c(Wi).author)),D(nt,qt)};z(St,nt=>{c(Wi).author&&nt(Ai)})}var ki=v(St,2);{var fi=nt=>{var qt=zQ(),se=_(qt);j(Ee=>{ln(qt,"title",c(Wi).date),O(se,Ee)},[()=>W(c(Wi).date)]),D(nt,qt)};z(ki,nt=>{c(Wi).date&&nt(fi)})}var Ii=v(ki,2);{var X=nt=>{var qt=VQ(),se=_(qt);j(()=>O(se,c(Wi).description)),D(nt,qt)};z(Ii,nt=>{c(Wi).description&&nt(X)})}var Ae=v(Ti,2),qe=_(Ae);j(()=>{ln(Oi,"href",c(Wi).url??`https://www.npmjs.com/package/${c(Wi).name}`),O(Qi,c(Wi).name),O(Xe,c(Wi).version),Ae.disabled=!!b[c(Wi).name],O(qe,b[c(Wi).name]?"Installing…":"Install")}),$("click",Ae,()=>Q(c(Wi).name)),D(Ci,Pi)}),D(gt,Yt)};z(ji,gt=>{c(d).length>0&&gt(Bi)})}var fn=v(ji,2);{var an=gt=>{var Yt=UQ(),Ci=_(Yt);j(()=>O(Ci,c(C))),D(gt,Yt)};z(fn,gt=>{c(C)&&gt(an)})}var Zi=v(fn,2);{var _n=gt=>{var Yt=qQ();D(gt,Yt)};z(Zi,gt=>{!c(d).length&&!c(C)&&gt(_n)})}j(()=>{O(kt,c(t).length),ut.disabled=c(r),Ze=Bt(at,0,"svelte-twakcj",null,Ze,{spinning:c(r)}),Di.disabled=c(g),O(Ui,c(g)?"Searching…":"Search")}),$("click",ut,T),jt(ui,()=>c(i),gt=>m(i,gt)),$("keydown",Ri,gt=>gt.key==="Enter"&&V()),jt(Ri,()=>c(a),gt=>m(a,gt)),$("click",Di,V),D(o,De),js()}Zs(["click","keydown"]);var ZQ=B('<div class="plugin-warning svelte-3itf14">⚠ The dynamic-security plugin is not responding. Add <code class="svelte-3itf14">plugin …/mosquitto_dynamic_security.so</code> and <code class="svelte-3itf14">plugin_opt_config_file …/dynamic-security.json</code> to your mosquitto.conf and restart mosquitto. Operations below will time out until the plugin is active.</div>'),ba=B('<div class="err svelte-3itf14"> </div>'),XQ=B('<div class="empty svelte-3itf14">No users found.</div>'),YQ=B('<span class="tag svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove role">×</button></span>'),yh=B("<option> </option>"),zx=B('<div class="inline-err svelte-3itf14"> </div>'),UA=B('<div class="inline-add svelte-3itf14"><select class="svelte-3itf14"><option>— role —</option><!></select> <button class="inline-confirm svelte-3itf14">Add</button> <button class="inline-cancel svelte-3itf14">×</button></div> <!>',1),QQ=B('<span class="tag tag--group svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove from group">×</button></span>'),JQ=B('<div class="inline-add svelte-3itf14"><select class="svelte-3itf14"><option>— group —</option><!></select> <button class="inline-confirm svelte-3itf14">Add</button> <button class="inline-cancel svelte-3itf14">×</button></div> <!>',1),eJ=B('<tr class="svelte-3itf14"><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus svelte-3itf14" title="Add role">+</button></div> <!></div></td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus tag-plus--group svelte-3itf14" title="Add to group">+</button></div> <!></div></td><td class="cell-actions svelte-3itf14"><div class="actions svelte-3itf14"><button title="Set password" class="svelte-3itf14">🔑</button> <button class="danger svelte-3itf14" title="Delete">✕</button></div></td></tr>'),tJ=B('<table class="svelte-3itf14"><thead><tr><th class="svelte-3itf14">Username</th><th class="svelte-3itf14">Roles</th><th class="svelte-3itf14">Groups</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),iJ=B('<div class="panel svelte-3itf14"><div class="panel-header svelte-3itf14"><h3 class="svelte-3itf14">Users</h3> <button class="btn-add svelte-3itf14">+ Add user</button></div> <!> <!></div>'),nJ=B('<div class="empty svelte-3itf14">No roles found.</div>'),sJ=B('<tr class="svelte-3itf14"><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"> </td><td class="cell-actions svelte-3itf14"><div class="actions svelte-3itf14"><button title="Edit ACLs" class="svelte-3itf14">Edit ACLs</button> <button class="danger svelte-3itf14" title="Delete">✕</button></div></td></tr>'),oJ=B('<table class="svelte-3itf14"><thead><tr><th class="svelte-3itf14">Role</th><th class="svelte-3itf14">ACLs</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),rJ=B('<div class="panel svelte-3itf14"><div class="panel-header svelte-3itf14"><h3 class="svelte-3itf14">Roles</h3> <button class="btn-add svelte-3itf14">+ Add role</button></div> <!> <!></div>'),aJ=B('<div class="empty svelte-3itf14">No groups found.</div>'),lJ=B('<span class="tag svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove member">×</button></span>'),cJ=B('<div class="inline-add svelte-3itf14"><select class="svelte-3itf14"><option>— user —</option><!></select> <button class="inline-confirm svelte-3itf14">Add</button> <button class="inline-cancel svelte-3itf14">×</button></div> <!>',1),dJ=B('<span class="tag tag--group svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove role">×</button></span>'),uJ=B('<tr class="svelte-3itf14"><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus svelte-3itf14" title="Add member">+</button></div> <!></div></td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus tag-plus--group svelte-3itf14" title="Add role">+</button></div> <!></div></td><td class="cell-actions svelte-3itf14"><div class="actions svelte-3itf14"><button class="danger svelte-3itf14" title="Delete">✕</button></div></td></tr>'),hJ=B('<table class="svelte-3itf14"><thead><tr><th class="svelte-3itf14">Group</th><th class="svelte-3itf14">Members</th><th class="svelte-3itf14">Roles</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),fJ=B('<div class="panel svelte-3itf14"><div class="panel-header svelte-3itf14"><h3 class="svelte-3itf14">Groups</h3> <button class="btn-add svelte-3itf14">+ Add group</button></div> <!> <!></div>'),qA=B('<div class="empty svelte-3itf14">Loading…</div>'),gJ=B('<tr><td class="mono small svelte-3itf14"> </td><td class="acl-radio svelte-3itf14"><input type="radio" value="allow"/></td><td class="acl-radio svelte-3itf14"><input type="radio" value="deny"/></td></tr>'),pJ=B('<table class="acl-defaults-table svelte-3itf14"><thead><tr><th class="svelte-3itf14">Operation</th><th class="svelte-3itf14">Allow</th><th class="svelte-3itf14">Deny</th></tr></thead><tbody></tbody></table>'),xJ=B('<div class="anon-current svelte-3itf14">Current: <span class="mono svelte-3itf14"> </span></div>'),mJ=B('<div class="anon-current muted svelte-3itf14">No anonymous group configured.</div>'),vJ=B('<div class="anon-row svelte-3itf14"><select class="svelte-3itf14"><option>— none —</option><!></select> <button class="svelte-3itf14"> </button></div> <!>',1),_J=B('<div class="panel svelte-3itf14"><div class="settings-section svelte-3itf14"><h3 class="settings-heading svelte-3itf14">Default ACL Access</h3> <p class="settings-hint svelte-3itf14">Broker-wide defaults applied when no role ACL matches. Role ACLs always take precedence over these defaults.</p> <!> <!></div> <div class="settings-section svelte-3itf14"><h3 class="settings-heading svelte-3itf14">Anonymous Group</h3> <p class="settings-hint svelte-3itf14">Clients connecting without credentials are treated as members of this group. Requires <code class="svelte-3itf14">allow_anonymous true</code> in mosquitto.conf.</p> <!> <!></div></div>'),bJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Add user</h3> <label class="svelte-3itf14">Username<input autocomplete="off" class="svelte-3itf14"/></label> <label class="svelte-3itf14">Password <div class="pw-row svelte-3itf14"><input autocomplete="new-password" class="svelte-3itf14"/> <button class="toggle-pw svelte-3itf14"> </button></div></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),CJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Set password for <em class="svelte-3itf14"> </em></h3> <label class="svelte-3itf14">New password <input type="password" autocomplete="new-password" class="svelte-3itf14"/></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),EJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Add role</h3> <label class="svelte-3itf14">Role name<input autocomplete="off" class="svelte-3itf14"/></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),yJ=B('<tr class="svelte-3itf14"><td class="mono small svelte-3itf14"> </td><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"> </td><td class="svelte-3itf14"><button class="danger">✕</button></td></tr>'),wJ=B('<table class="acl-table svelte-3itf14"><thead><tr><th class="svelte-3itf14">Type</th><th class="svelte-3itf14">Topic</th><th class="svelte-3itf14">Allow</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),SJ=B('<div class="empty svelte-3itf14">No ACL rules yet.</div>'),DJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-3itf14"><h3 class="svelte-3itf14">ACLs for role <em class="svelte-3itf14"> </em></h3> <!> <div class="acl-add-row svelte-3itf14"><select class="svelte-3itf14"></select> <input placeholder="topic or pattern" class="svelte-3itf14"/> <label class="allow-toggle svelte-3itf14"><input type="checkbox" class="svelte-3itf14"/> Allow</label> <button class="svelte-3itf14">Add</button></div> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Close</button></div></div></div>'),AJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Add group</h3> <label class="svelte-3itf14">Group name<input autocomplete="off" class="svelte-3itf14"/></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),kJ=B('<div class="users-page svelte-3itf14"><!> <div class="panel-tabs svelte-3itf14"><button>Users</button> <button>Roles</button> <button>Groups</button> <button>Settings</button> <button class="reload-btn svelte-3itf14" title="Refresh">↺</button></div> <!> <!> <!> <!></div> <!> <!> <!> <!> <!> <!>',1);function BJ(o,e){Vs(e,!0);let t=wu(e,"dynsecReady",3,!1),i,n=I(Ei([])),s=I(Ei([])),r=I(Ei([])),a=I(""),d=I(""),u=I(""),f=I("users"),g=I(null),p=I(""),C=I(""),b=I(!1);const y=Tt(()=>c(g)?c(g).kind==="user-roles"?c(s).map(fe=>fe.rolename).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(n).find(rt=>rt.username===c(g).target))==null?void 0:Ke.roles)!=null&&ot.some(rt=>rt.rolename===fe))}):c(g).kind==="user-groups"?c(r).map(fe=>fe.groupname).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(n).find(rt=>rt.username===c(g).target))==null?void 0:Ke.groups)!=null&&ot.some(rt=>rt.groupname===fe))}):c(g).kind==="group-members"?c(n).map(fe=>fe.username).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(r).find(rt=>rt.groupname===c(g).target))==null?void 0:Ke.clients)!=null&&ot.some(rt=>rt.username===fe))}):c(s).map(fe=>fe.rolename).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(r).find(rt=>rt.groupname===c(g).target))==null?void 0:Ke.roles)!=null&&ot.some(rt=>rt.rolename===fe))}):[]);function w(fe,Ke){m(g,{kind:fe,target:Ke},!0),m(p,""),m(C,"")}async function A(){if(!(!c(g)||!c(p))){m(b,!0),m(C,"");try{const{kind:fe,target:Ke}=c(g);fe==="user-roles"?await xU(Ke,c(p)):fe==="user-groups"?await uA(c(p),Ke):fe==="group-members"?await uA(Ke,c(p)):await SU(Ke,c(p)),m(g,null),m(p,""),await Bi()}catch(fe){m(C,fe.message,!0)}finally{m(b,!1)}}}async function P(fe,Ke){try{await mU(fe,Ke),await Bi()}catch(ot){m(a,ot.message,!0)}}async function M(fe,Ke){try{await hA(Ke,fe),await Bi()}catch(ot){m(a,ot.message,!0)}}async function R(fe,Ke){try{await hA(fe,Ke),await Bi()}catch(ot){m(u,ot.message,!0)}}async function T(fe,Ke){try{await DU(fe,Ke),await Bi()}catch(ot){m(u,ot.message,!0)}}let V=I(!1),W=I(""),Q=I(""),ne=I(!1),de=I(""),te=I(!1),he=I(!1),De=I(""),oe=I(""),ge=I(""),Se=I(!1),Re=I(!1),xe=I(""),et=I(""),We=I(!1),_e=I(null),dt=I(!1),Wt=I("publishClientSend"),tt=I(""),kt=I(!0),be=I(""),Rt=I(!1),ut=I(""),at=I(""),Ze=I(!1),Pt=I(Ei([])),ui=I(""),wt=I(!1),Ft=I(null),Vt=I(""),zt=I(""),Zt=I(!1),mt=I(!1);const Mi=[{acltype:"publishClientSend",label:"Publish (send)"},{acltype:"publishClientReceive",label:"Publish (receive)"},{acltype:"subscribe",label:"Subscribe"},{acltype:"unsubscribe",label:"Unsubscribe"}];async function Ri(){var fe,Ke;m(mt,!1),m(ui,""),m(zt,"");try{const[ot,rt]=await Promise.allSettled([AU(),FU()]);if(ot.status==="fulfilled"){const ht=Object.fromEntries(ot.value.acls.map(_t=>[_t.acltype,_t.allow]));m(Pt,Mi.map(({acltype:_t})=>({acltype:_t,allow:ht[_t]??(_t==="publishClientReceive"||_t==="unsubscribe")})),!0)}else m(ui,((fe=ot.reason)==null?void 0:fe.message)??"Failed to load default ACLs",!0);rt.status==="fulfilled"?(m(Ft,rt.value.group,!0),m(Vt,rt.value.group??"",!0)):m(zt,((Ke=rt.reason)==null?void 0:Ke.message)??"Failed to load anonymous group",!0)}finally{m(mt,!0)}}async function Di(fe,Ke){m(Pt,c(Pt).map(ot=>ot.acltype===fe?{...ot,allow:Ke}:ot),!0),m(wt,!0),m(ui,"");try{await kU(c(Pt))}catch(ot){m(ui,ot.message,!0)}finally{m(wt,!1)}}async function Ui(){m(Zt,!0),m(zt,"");try{await LU(c(Vt)||null),m(Ft,c(Vt)||null,!0)}catch(fe){m(zt,fe.message,!0)}finally{m(Zt,!1)}}const ji=["publishClientSend","publishClientReceive","subscribeLiteral","subscribePattern","unsubscribeLiteral","unsubscribePattern"];async function Bi(){var fe,Ke,ot;try{const[rt,ht,_t]=await Promise.allSettled([hU(),EF(),EU()]);rt.status==="fulfilled"?(m(n,rt.value.users,!0),m(a,"")):m(a,((fe=rt.reason)==null?void 0:fe.message)??"Failed to load users",!0),ht.status==="fulfilled"?(m(s,ht.value.roles,!0),m(d,"")):m(d,((Ke=ht.reason)==null?void 0:Ke.message)??"Failed to load roles",!0),_t.status==="fulfilled"?(m(r,_t.value.groups,!0),m(u,"")):m(u,((ot=_t.reason)==null?void 0:ot.message)??"Failed to load groups",!0)}catch{}}Ks(()=>{Bi()});async function fn(){m(de,""),m(te,!0);try{await fU(c(W),c(Q)),m(W,""),m(Q,""),m(V,!1),await Bi()}catch(fe){m(de,fe.message??"Failed to create user",!0)}finally{m(te,!1)}}async function an(fe){if(await i.show(`Delete user “${fe}”?`,{confirm:"Delete",danger:!0}))try{await gU(fe),await Bi()}catch(Ke){m(a,Ke.message,!0)}}async function Zi(fe){m(De,fe,!0),m(oe,""),m(ge,""),m(he,!0)}async function _n(){m(ge,""),m(Se,!0);try{await pU(c(De),c(oe)),m(he,!1)}catch(fe){m(ge,fe.message,!0)}finally{m(Se,!1)}}async function gt(){m(et,""),m(We,!0);try{await vU(c(xe)),m(xe,""),m(Re,!1),await Bi()}catch(fe){m(et,fe.message??"Failed to create role",!0)}finally{m(We,!1)}}async function Yt(fe){var Ke;if(await i.show(`Delete role “${fe}”?`,{confirm:"Delete",danger:!0}))try{await _U(fe),((Ke=c(_e))==null?void 0:Ke.rolename)===fe&&(m(_e,null),m(dt,!1)),await Bi()}catch(ot){m(d,ot.message,!0)}}function Ci(fe){m(_e,fe,!0),m(dt,!0),m(Wt,"publishClientSend"),m(tt,""),m(kt,!0),m(be,"")}async function Wi(){if(c(_e)){m(be,"");try{await bU(c(_e).rolename,{acltype:c(Wt),topic:c(tt),allow:c(kt)}),m(tt,""),await Bi(),m(_e,c(s).find(fe=>fe.rolename===c(_e).rolename)??c(_e),!0)}catch(fe){m(be,fe.message,!0)}}}async function Pi(fe,Ke,ot){try{await CU(fe,Ke,ot),await Bi(),m(_e,c(s).find(rt=>rt.rolename===fe)??c(_e),!0)}catch(rt){m(be,rt.message,!0)}}async function Ti(){m(at,""),m(Ze,!0);try{await yU(c(ut)),m(ut,""),m(Rt,!1),await Bi()}catch(fe){m(at,fe.message??"Failed to create group",!0)}finally{m(Ze,!1)}}async function Oi(fe){if(await i.show(`Delete group “${fe}”?`,{confirm:"Delete",danger:!0}))try{await wU(fe),await Bi()}catch(Ke){m(u,Ke.message,!0)}}var Qi=kJ(),yi=yt(Qi),Xe=_(yi);{var St=fe=>{var Ke=ZQ();D(fe,Ke)};z(Xe,fe=>{t()||fe(St)})}var Ai=v(Xe,2),ki=_(Ai);let fi;var Ii=v(ki,2);let X;var Ae=v(Ii,2);let qe;var nt=v(Ae,2);let qt;var se=v(nt,2),Ee=v(Ai,2);{var Le=fe=>{var Ke=iJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(ot,2);{var _t=K=>{var le=ba(),Z=_(le);j(()=>O(Z,c(a))),D(K,le)};z(ht,K=>{c(a)&&K(_t)})}var Xt=v(ht,2);{var F=K=>{var le=XQ();D(K,le)},H=K=>{var le=tJ(),Z=v(_(le));ei(Z,21,()=>c(n),Ni,(J,ce)=>{var Qe=eJ(),ae=_(Qe),pe=_(ae),Te=v(ae),me=_(Te),Ie=_(me),lt=_(Ie);ei(lt,17,()=>c(ce).roles??[],Ni,($e,It)=>{var Me=YQ(),st=_(Me),Lt=v(st);j(()=>O(st,c(It).rolename)),$("click",Lt,()=>P(c(ce).username,c(It).rolename)),D($e,Me)});var G=v(lt,2),re=v(Ie,2);{var Ne=$e=>{var It=UA(),Me=yt(It),st=_(Me),Lt=_(st);Lt.value=Lt.__value="";var Ht=v(Lt);ei(Ht,17,()=>c(y),Ni,(Fi,Gi)=>{var Li=yh(),ni=_(Li),ii={};j(()=>{O(ni,c(Gi)),ii!==(ii=c(Gi))&&(Li.value=(Li.__value=c(Gi))??"")}),D(Fi,Li)});var pt=v(st,2),vi=v(pt,2),wi=v(Me,2);{var qi=Fi=>{var Gi=zx(),Li=_(Gi);j(()=>O(Li,c(C))),D(Fi,Gi)};z(wi,Fi=>{c(C)&&Fi(qi)})}j(()=>pt.disabled=!c(p)||c(b)),Fs(st,()=>c(p),Fi=>m(p,Fi)),$("click",pt,A),$("click",vi,()=>m(g,null)),D($e,It)};z(re,$e=>{var It;((It=c(g))==null?void 0:It.kind)==="user-roles"&&c(g).target===c(ce).username&&$e(Ne)})}var it=v(Te),Pe=_(it),ke=_(Pe),Ct=_(ke);ei(Ct,17,()=>c(ce).groups??[],Ni,($e,It)=>{var Me=QQ(),st=_(Me),Lt=v(st);j(()=>O(st,c(It).groupname)),$("click",Lt,()=>M(c(ce).username,c(It).groupname)),D($e,Me)});var vt=v(Ct,2),Fe=v(ke,2);{var Dt=$e=>{var It=JQ(),Me=yt(It),st=_(Me),Lt=_(st);Lt.value=Lt.__value="";var Ht=v(Lt);ei(Ht,17,()=>c(y),Ni,(Fi,Gi)=>{var Li=yh(),ni=_(Li),ii={};j(()=>{O(ni,c(Gi)),ii!==(ii=c(Gi))&&(Li.value=(Li.__value=c(Gi))??"")}),D(Fi,Li)});var pt=v(st,2),vi=v(pt,2),wi=v(Me,2);{var qi=Fi=>{var Gi=zx(),Li=_(Gi);j(()=>O(Li,c(C))),D(Fi,Gi)};z(wi,Fi=>{c(C)&&Fi(qi)})}j(()=>pt.disabled=!c(p)||c(b)),Fs(st,()=>c(p),Fi=>m(p,Fi)),$("click",pt,A),$("click",vi,()=>m(g,null)),D($e,It)};z(Fe,$e=>{var It;((It=c(g))==null?void 0:It.kind)==="user-groups"&&c(g).target===c(ce).username&&$e(Dt)})}var Ge=v(it),ze=_(Ge),Je=_(ze),bt=v(Je,2);j(()=>O(pe,c(ce).username)),$("click",G,()=>w("user-roles",c(ce).username)),$("click",vt,()=>w("user-groups",c(ce).username)),$("click",Je,()=>Zi(c(ce).username)),$("click",bt,()=>an(c(ce).username)),D(J,Qe)}),D(K,le)};z(Xt,K=>{c(n).length===0?K(F):K(H,-1)})}$("click",rt,()=>{m(V,!0),m(de,"")}),D(fe,Ke)};z(Ee,fe=>{c(f)==="users"&&fe(Le)})}var Y=v(Ee,2);{var Oe=fe=>{var Ke=rJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(ot,2);{var _t=K=>{var le=ba(),Z=_(le);j(()=>O(Z,c(d))),D(K,le)};z(ht,K=>{c(d)&&K(_t)})}var Xt=v(ht,2);{var F=K=>{var le=nJ();D(K,le)},H=K=>{var le=oJ(),Z=v(_(le));ei(Z,21,()=>c(s),Ni,(J,ce)=>{var Qe=sJ(),ae=_(Qe),pe=_(ae),Te=v(ae),me=_(Te),Ie=v(Te),lt=_(Ie),G=_(lt),re=v(G,2);j(()=>{var Ne;O(pe,c(ce).rolename),O(me,((Ne=c(ce).acls)==null?void 0:Ne.length)??0)}),$("click",G,()=>Ci(c(ce))),$("click",re,()=>Yt(c(ce).rolename)),D(J,Qe)}),D(K,le)};z(Xt,K=>{c(s).length===0?K(F):K(H,-1)})}$("click",rt,()=>{m(Re,!0),m(et,""),m(xe,"")}),D(fe,Ke)};z(Y,fe=>{c(f)==="roles"&&fe(Oe)})}var Ve=v(Y,2);{var ye=fe=>{var Ke=fJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(ot,2);{var _t=K=>{var le=ba(),Z=_(le);j(()=>O(Z,c(u))),D(K,le)};z(ht,K=>{c(u)&&K(_t)})}var Xt=v(ht,2);{var F=K=>{var le=aJ();D(K,le)},H=K=>{var le=hJ(),Z=v(_(le));ei(Z,21,()=>c(r),Ni,(J,ce)=>{var Qe=uJ(),ae=_(Qe),pe=_(ae),Te=v(ae),me=_(Te),Ie=_(me),lt=_(Ie);ei(lt,17,()=>c(ce).clients??[],Ni,(bt,$e)=>{var It=lJ(),Me=_(It),st=v(Me);j(()=>O(Me,c($e).username)),$("click",st,()=>R(c(ce).groupname,c($e).username)),D(bt,It)});var G=v(lt,2),re=v(Ie,2);{var Ne=bt=>{var $e=cJ(),It=yt($e),Me=_(It),st=_(Me);st.value=st.__value="";var Lt=v(st);ei(Lt,17,()=>c(y),Ni,(qi,Fi)=>{var Gi=yh(),Li=_(Gi),ni={};j(()=>{O(Li,c(Fi)),ni!==(ni=c(Fi))&&(Gi.value=(Gi.__value=c(Fi))??"")}),D(qi,Gi)});var Ht=v(Me,2),pt=v(Ht,2),vi=v(It,2);{var wi=qi=>{var Fi=zx(),Gi=_(Fi);j(()=>O(Gi,c(C))),D(qi,Fi)};z(vi,qi=>{c(C)&&qi(wi)})}j(()=>Ht.disabled=!c(p)||c(b)),Fs(Me,()=>c(p),qi=>m(p,qi)),$("click",Ht,A),$("click",pt,()=>m(g,null)),D(bt,$e)};z(re,bt=>{var $e;(($e=c(g))==null?void 0:$e.kind)==="group-members"&&c(g).target===c(ce).groupname&&bt(Ne)})}var it=v(Te),Pe=_(it),ke=_(Pe),Ct=_(ke);ei(Ct,17,()=>c(ce).roles??[],Ni,(bt,$e)=>{var It=dJ(),Me=_(It),st=v(Me);j(()=>O(Me,c($e).rolename)),$("click",st,()=>T(c(ce).groupname,c($e).rolename)),D(bt,It)});var vt=v(Ct,2),Fe=v(ke,2);{var Dt=bt=>{var $e=UA(),It=yt($e),Me=_(It),st=_(Me);st.value=st.__value="";var Lt=v(st);ei(Lt,17,()=>c(y),Ni,(qi,Fi)=>{var Gi=yh(),Li=_(Gi),ni={};j(()=>{O(Li,c(Fi)),ni!==(ni=c(Fi))&&(Gi.value=(Gi.__value=c(Fi))??"")}),D(qi,Gi)});var Ht=v(Me,2),pt=v(Ht,2),vi=v(It,2);{var wi=qi=>{var Fi=zx(),Gi=_(Fi);j(()=>O(Gi,c(C))),D(qi,Fi)};z(vi,qi=>{c(C)&&qi(wi)})}j(()=>Ht.disabled=!c(p)||c(b)),Fs(Me,()=>c(p),qi=>m(p,qi)),$("click",Ht,A),$("click",pt,()=>m(g,null)),D(bt,$e)};z(Fe,bt=>{var $e;(($e=c(g))==null?void 0:$e.kind)==="group-roles"&&c(g).target===c(ce).groupname&&bt(Dt)})}var Ge=v(it),ze=_(Ge),Je=_(ze);j(()=>O(pe,c(ce).groupname)),$("click",G,()=>w("group-members",c(ce).groupname)),$("click",vt,()=>w("group-roles",c(ce).groupname)),$("click",Je,()=>Oi(c(ce).groupname)),D(J,Qe)}),D(K,le)};z(Xt,K=>{c(r).length===0?K(F):K(H,-1)})}$("click",rt,()=>{m(Rt,!0),m(at,""),m(ut,"")}),D(fe,Ke)};z(Ve,fe=>{c(f)==="groups"&&fe(ye)})}var At=v(Ve,2);{var Ot=fe=>{var Ke=_J(),ot=_(Ke),rt=v(_(ot),4);{var ht=Qe=>{var ae=ba(),pe=_(ae);j(()=>O(pe,c(ui))),D(Qe,ae)};z(rt,Qe=>{c(ui)&&Qe(ht)})}var _t=v(rt,2);{var Xt=Qe=>{var ae=qA();D(Qe,ae)},F=Qe=>{var ae=pJ(),pe=v(_(ae));ei(pe,21,()=>Mi,Ni,(Te,me)=>{let Ie=()=>c(me).acltype,lt=()=>c(me).label;const G=Tt(()=>c(Pt).find(Dt=>Dt.acltype===Ie()));var re=gJ();let Ne;var it=_(re),Pe=_(it),ke=v(it),Ct=_(ke),vt=v(ke),Fe=_(vt);j(()=>{var Dt,Ge;Ne=Bt(re,1,"svelte-3itf14",null,Ne,{saving:c(wt)}),O(Pe,lt()),ln(Ct,"name",Ie()),oa(Ct,((Dt=c(G))==null?void 0:Dt.allow)===!0),ln(Fe,"name",Ie()),oa(Fe,((Ge=c(G))==null?void 0:Ge.allow)===!1)}),$("change",Ct,()=>Di(Ie(),!0)),$("change",Fe,()=>Di(Ie(),!1)),D(Te,re)}),D(Qe,ae)};z(_t,Qe=>{c(mt)?Qe(F,-1):Qe(Xt)})}var H=v(ot,2),K=v(_(H),4);{var le=Qe=>{var ae=ba(),pe=_(ae);j(()=>O(pe,c(zt))),D(Qe,ae)};z(K,Qe=>{c(zt)&&Qe(le)})}var Z=v(K,2);{var J=Qe=>{var ae=qA();D(Qe,ae)},ce=Qe=>{var ae=vJ(),pe=yt(ae),Te=_(pe),me=_(Te);me.value=me.__value="";var Ie=v(me);ei(Ie,17,()=>c(r),Ni,(Pe,ke)=>{var Ct=yh(),vt=_(Ct),Fe={};j(()=>{O(vt,c(ke).groupname),Fe!==(Fe=c(ke).groupname)&&(Ct.value=(Ct.__value=c(ke).groupname)??"")}),D(Pe,Ct)});var lt=v(Te,2),G=_(lt),re=v(pe,2);{var Ne=Pe=>{var ke=xJ(),Ct=v(_(ke)),vt=_(Ct);j(()=>O(vt,c(Ft))),D(Pe,ke)},it=Pe=>{var ke=mJ();D(Pe,ke)};z(re,Pe=>{c(Ft)?Pe(Ne):Pe(it,-1)})}j(()=>{lt.disabled=c(Zt)||c(Vt)===(c(Ft)??""),O(G,c(Zt)?"Saving…":"Save")}),Fs(Te,()=>c(Vt),Pe=>m(Vt,Pe)),$("click",lt,Ui),D(Qe,ae)};z(Z,Qe=>{c(mt)?Qe(ce,-1):Qe(J)})}D(fe,Ke)};z(At,fe=>{c(f)==="settings"&&fe(Ot)})}var ri=v(yi,2);{var oi=fe=>{var Ke=bJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(_(rt)),_t=v(rt,2),Xt=v(_(_t)),F=_(Xt),H=v(F,2),K=_(H),le=v(_t,2);{var Z=pe=>{var Te=ba(),me=_(Te);j(()=>O(me,c(de))),D(pe,Te)};z(le,pe=>{c(de)&&pe(Z)})}var J=v(le,2),ce=_(J),Qe=v(ce,2),ae=_(Qe);j(()=>{ln(F,"type",c(ne)?"text":"password"),O(K,c(ne)?"Hide":"Show"),Qe.disabled=c(te)||!c(W)||!c(Q),O(ae,c(te)?"Creating…":"Create")}),jt(ht,()=>c(W),pe=>m(W,pe)),jt(F,()=>c(Q),pe=>m(Q,pe)),$("click",H,()=>m(ne,!c(ne))),$("click",ce,()=>m(V,!1)),$("click",Qe,fn),D(fe,Ke)};z(ri,fe=>{c(V)&&fe(oi)})}var xi=v(ri,2);{var Ut=fe=>{var Ke=CJ(),ot=_(Ke),rt=_(ot),ht=v(_(rt)),_t=_(ht),Xt=v(rt,2),F=v(_(Xt)),H=v(Xt,2);{var K=Qe=>{var ae=ba(),pe=_(ae);j(()=>O(pe,c(ge))),D(Qe,ae)};z(H,Qe=>{c(ge)&&Qe(K)})}var le=v(H,2),Z=_(le),J=v(Z,2),ce=_(J);j(()=>{O(_t,c(De)),J.disabled=c(Se)||!c(oe),O(ce,c(Se)?"Saving…":"Set password")}),jt(F,()=>c(oe),Qe=>m(oe,Qe)),$("click",Z,()=>m(he,!1)),$("click",J,_n),D(fe,Ke)};z(xi,fe=>{c(he)&&fe(Ut)})}var mi=v(xi,2);{var He=fe=>{var Ke=EJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(_(rt)),_t=v(rt,2);{var Xt=Z=>{var J=ba(),ce=_(J);j(()=>O(ce,c(et))),D(Z,J)};z(_t,Z=>{c(et)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2),le=_(K);j(()=>{K.disabled=c(We)||!c(xe),O(le,c(We)?"Creating…":"Create")}),jt(ht,()=>c(xe),Z=>m(xe,Z)),$("click",H,()=>m(Re,!1)),$("click",K,gt),D(fe,Ke)};z(mi,fe=>{c(Re)&&fe(He)})}var Ye=v(mi,2);{var Qt=fe=>{var Ke=DJ(),ot=_(Ke),rt=_(ot),ht=v(_(rt)),_t=_(ht),Xt=v(rt,2);{var F=Ie=>{var lt=wJ(),G=v(_(lt));ei(G,21,()=>c(_e).acls??[],Ni,(re,Ne)=>{var it=yJ(),Pe=_(it),ke=_(Pe),Ct=v(Pe),vt=_(Ct),Fe=v(Ct),Dt=_(Fe),Ge=v(Fe),ze=_(Ge);j(()=>{O(ke,c(Ne).acltype),O(vt,c(Ne).topic),O(Dt,c(Ne).allow?"✓":"✗")}),$("click",ze,()=>Pi(c(_e).rolename,c(Ne).acltype,c(Ne).topic)),D(re,it)}),D(Ie,lt)},H=Ie=>{var lt=SJ();D(Ie,lt)};z(Xt,Ie=>{var lt;(((lt=c(_e).acls)==null?void 0:lt.length)??0)>0?Ie(F):Ie(H,-1)})}var K=v(Xt,2),le=_(K);ei(le,21,()=>ji,Ni,(Ie,lt)=>{var G=yh(),re=_(G),Ne={};j(()=>{O(re,c(lt)),Ne!==(Ne=c(lt))&&(G.value=(G.__value=c(lt))??"")}),D(Ie,G)});var Z=v(le,2),J=v(Z,2),ce=_(J),Qe=v(J,2),ae=v(K,2);{var pe=Ie=>{var lt=ba(),G=_(lt);j(()=>O(G,c(be))),D(Ie,lt)};z(ae,Ie=>{c(be)&&Ie(pe)})}var Te=v(ae,2),me=_(Te);j(()=>{O(_t,c(_e).rolename),Qe.disabled=!c(tt)}),Fs(le,()=>c(Wt),Ie=>m(Wt,Ie)),jt(Z,()=>c(tt),Ie=>m(tt,Ie)),Cs(ce,()=>c(kt),Ie=>m(kt,Ie)),$("click",Qe,Wi),$("click",me,()=>m(dt,!1)),D(fe,Ke)};z(Ye,fe=>{c(dt)&&c(_e)&&fe(Qt)})}var Gt=v(Ye,2);{var gi=fe=>{var Ke=AJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(_(rt)),_t=v(rt,2);{var Xt=Z=>{var J=ba(),ce=_(J);j(()=>O(ce,c(at))),D(Z,J)};z(_t,Z=>{c(at)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2),le=_(K);j(()=>{K.disabled=c(Ze)||!c(ut),O(le,c(Ze)?"Creating…":"Create")}),jt(ht,()=>c(ut),Z=>m(ut,Z)),$("click",H,()=>m(Rt,!1)),$("click",K,Ti),D(fe,Ke)};z(Gt,fe=>{c(Rt)&&fe(gi)})}var Jt=v(Gt,2);us(qc(Jt,{}),fe=>i=fe,()=>i),j(()=>{fi=Bt(ki,1,"svelte-3itf14",null,fi,{active:c(f)==="users"}),X=Bt(Ii,1,"svelte-3itf14",null,X,{active:c(f)==="roles"}),qe=Bt(Ae,1,"svelte-3itf14",null,qe,{active:c(f)==="groups"}),qt=Bt(nt,1,"svelte-3itf14",null,qt,{active:c(f)==="settings"})}),$("click",ki,()=>m(f,"users")),$("click",Ii,()=>m(f,"roles")),$("click",Ae,()=>m(f,"groups")),$("click",nt,()=>{m(f,"settings"),c(mt)||Ri()}),$("click",se,Bi),D(o,Qi),js()}Zs(["click","change"]);var GA=B('<div class="err svelte-9i68x"> </div>'),FJ=B('<div class="ok svelte-9i68x">Saved.</div>'),LJ=B('<div class="reload-msg svelte-9i68x"> </div>'),IJ=B('<div class="loading svelte-9i68x">Loading…</div>'),PJ=B('<div class="anon-row svelte-9i68x"><span class="field-label svelte-9i68x"><code class="svelte-9i68x">allow_anonymous</code></span> <select class="svelte-9i68x"><option>auto (broker default)</option><option>true — allow unauthenticated clients</option><option>false — require authentication</option></select></div>'),TJ=B("<option></option>"),MJ=B('<div class="tls-section svelte-9i68x"><div class="field-row svelte-9i68x"><label class="svelte-9i68x">Certificate file (certfile) <input placeholder="/etc/mosquitto/certs/server.crt" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Key file (keyfile) <input placeholder="/etc/mosquitto/certs/server.key" class="svelte-9i68x"/></label></div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">CA file (cafile) — single CA cert <input placeholder="/etc/mosquitto/ca.crt" class="svelte-9i68x"/></label> <label class="svelte-9i68x">CA path (capath) — CA cert directory <input placeholder="/etc/mosquitto/ca-certs/" class="svelte-9i68x"/></label></div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">CRL file (crlfile) <input placeholder="/etc/mosquitto/crl.pem" class="svelte-9i68x"/></label> <label class="svelte-9i68x">TLS version <select class="svelte-9i68x"><option>Default</option><option>tlsv1.3</option><option>tlsv1.2</option></select></label></div> <div class="field-row svelte-9i68x"><label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> Require client certificate (require_certificate)</label> <label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> Use cert CN as username (use_identity_as_username)</label></div></div>'),RJ=B('<div class="field-row svelte-9i68x"><label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> Use cert Subject as username (use_subject_as_username)</label></div>'),NJ=B('<div class="advanced-section svelte-9i68x"><div class="field-row svelte-9i68x"><label class="svelte-9i68x">Mount point <input placeholder="(none)" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Max connections <input type="number" min="-1" placeholder="-1 (unlimited)" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Max QoS <select class="svelte-9i68x"><option>default</option><option>0 — fire and forget</option><option>1 — at least once</option><option>2 — exactly once</option></select></label></div> <!></div>'),OJ=B('<div class="auth-section svelte-9i68x"><div class="auth-section-title svelte-9i68x">Authentication</div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">allow_anonymous <select class="svelte-9i68x"><option>auto (broker default)</option><option>true — allow unauthenticated</option><option>false — require auth</option></select></label> <label class="svelte-9i68x">password_file <input placeholder="/etc/mosquitto/passwd" class="svelte-9i68x"/></label> <label class="svelte-9i68x">acl_file <input placeholder="/etc/mosquitto/acl" class="svelte-9i68x"/></label></div></div>'),HJ=B('<div class="listener-card svelte-9i68x"><div class="card-title svelte-9i68x"><span> </span> <button class="remove-btn svelte-9i68x" title="Remove listener">✕</button></div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">Port <input type="number" min="1" max="65535" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Protocol <select class="svelte-9i68x"><option>mqtt</option><option>websockets</option></select></label> <label class="svelte-9i68x">Bind address <input placeholder="(all interfaces)" class="svelte-9i68x"/></label> <label class="toggle-label tls-inline svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> TLS</label></div> <datalist></datalist> <!> <button class="advanced-btn svelte-9i68x"> </button> <!> <!></div>'),WJ=B('<div class="empty svelte-9i68x">No listeners configured. Click "+ Add listener" to create one.</div>'),zJ=B('<div class="global-settings svelte-9i68x"><label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> <span><code>per_listener_settings</code> — independent auth per listener</span> <span class="info-icon svelte-9i68x" title="Not recommended when using the dynamic-security plugin — dynsec credentials only apply to the default listener. See mosquitto documentation.">ℹ</span></label> <!></div> <div class="cards svelte-9i68x"><!> <!></div>',1),VJ=B('<div class="listeners-page svelte-9i68x"><div class="page-header svelte-9i68x"><h3 class="svelte-9i68x">Listeners</h3> <div class="header-actions svelte-9i68x"><button class="svelte-9i68x">+ Add listener</button> <button class="btn-save svelte-9i68x"> </button> <button class="btn-reload svelte-9i68x" title="Apply &amp; Reload mosquitto"> </button></div></div> <!> <!> <!> <!> <!></div>');function jJ(o,e){Vs(e,!0);let t=I(null),i=I(""),n=I(!1),s=I(""),r=I(!1),a=I(!1),d=I(""),u=I(Ei([])),f=I(null),g=I(!1),p=I(""),C=I(Ei([])),b=I(Ei(new Set));Ks(()=>{y(),rU().then(be=>{m(C,be.addresses,!0)}).catch(()=>{})});async function y(){try{m(t,await rS(),!0),m(u,JSON.parse(JSON.stringify(c(t).listeners)),!0),m(f,c(t).checksum,!0);const be=c(t).managed.allow_anonymous;m(p,be==="true"||be==="false"?be:"",!0),m(g,c(t).managed.per_listener_settings==="true"),m(i,"")}catch(be){m(i,be.message??"Failed to load broker config",!0)}}function w(){m(u,[...c(u),{port:1883,bindAddress:"",protocol:"mqtt",tls:{}}],!0),m(b,new Set(c(b)),!0)}function A(be){const Rt=new Set(c(b));Rt.has(be)?Rt.delete(be):Rt.add(be),m(b,Rt,!0)}function P(be){m(u,c(u).filter((Rt,ut)=>ut!==be),!0)}async function M(){if(c(t)){m(n,!0),m(s,""),m(r,!1);try{const be={...c(t).managed};c(g)?(be.per_listener_settings="true",delete be.allow_anonymous):(delete be.per_listener_settings,c(p)?be.allow_anonymous=c(p):delete be.allow_anonymous),await bF({listeners:c(u),managed:be,passthrough:c(t).passthrough,checksum:c(f)}),m(r,!0),setTimeout(()=>m(r,!1),3e3),await y()}catch(be){m(s,be.message??"Save failed",!0)}finally{m(n,!1)}}}async function R(){m(a,!0),m(d,"");try{const be=await CF();m(d,be.stderr||be.stdout||"Reloaded",!0)}catch(be){m(d,"Error: "+(be.message??"reload failed"))}finally{m(a,!1)}}function T(be){var Rt,ut,at,Ze;return!!((Rt=be.tls)!=null&&Rt.certfile||(ut=be.tls)!=null&&ut.keyfile||(at=be.tls)!=null&&at.capath||(Ze=be.tls)!=null&&Ze.cafile)}function V(be,Rt){Rt||(be.tls={}),m(u,[...c(u)],!0)}var W=VJ(),Q=_(W),ne=v(_(Q),2),de=_(ne),te=v(de,2),he=_(te),De=v(te,2),oe=_(De),ge=v(Q,2);{var Se=be=>{var Rt=GA(),ut=_(Rt);j(()=>O(ut,c(i))),D(be,Rt)};z(ge,be=>{c(i)&&be(Se)})}var Re=v(ge,2);{var xe=be=>{var Rt=GA(),ut=_(Rt);j(()=>O(ut,c(s))),D(be,Rt)};z(Re,be=>{c(s)&&be(xe)})}var et=v(Re,2);{var We=be=>{var Rt=FJ();D(be,Rt)};z(et,be=>{c(r)&&be(We)})}var _e=v(et,2);{var dt=be=>{var Rt=LJ(),ut=_(Rt);j(()=>O(ut,c(d))),D(be,Rt)};z(_e,be=>{c(d)&&be(dt)})}var Wt=v(_e,2);{var tt=be=>{var Rt=IJ();D(be,Rt)},kt=be=>{var Rt=zJ(),ut=yt(Rt),at=_(ut),Ze=_(at),Pt=v(at,2);{var ui=Zt=>{var mt=PJ(),Mi=v(_(mt),2),Ri=_(Mi);Ri.value=Ri.__value="";var Di=v(Ri);Di.value=Di.__value="true";var Ui=v(Di);Ui.value=Ui.__value="false",Fs(Mi,()=>c(p),ji=>m(p,ji)),D(Zt,mt)};z(Pt,Zt=>{c(g)||Zt(ui)})}var wt=v(ut,2),Ft=_(wt);ei(Ft,17,()=>c(u),Ni,(Zt,mt,Mi)=>{var Ri=HJ(),Di=_(Ri),Ui=_(Di),ji=_(Ui),Bi=v(Ui,2),fn=v(Di,2),an=_(fn),Zi=v(_(an)),_n=v(an,2),gt=v(_(_n)),Yt=_(gt);Yt.value=Yt.__value="mqtt";var Ci=v(Yt);Ci.value=Ci.__value="websockets";var Wi=v(_n,2),Pi=v(_(Wi));ln(Pi,"list",`bind-addr-list-${Mi}`);var Ti=v(Wi,2),Oi=_(Ti),Qi=v(fn,2);ln(Qi,"id",`bind-addr-list-${Mi}`),ei(Qi,21,()=>c(C),Ni,(nt,qt)=>{var se=TJ(),Ee={};j(()=>{Ee!==(Ee=c(qt))&&(se.value=(se.__value=c(qt))??"")}),D(nt,se)});var yi=v(Qi,2);{var Xe=nt=>{var qt=MJ(),se=_(qt),Ee=_(se),Le=v(_(Ee)),Y=v(Ee,2),Oe=v(_(Y)),Ve=v(se,2),ye=_(Ve),At=v(_(ye)),Ot=v(ye,2),ri=v(_(Ot)),oi=v(Ve,2),xi=_(oi),Ut=v(_(xi)),mi=v(xi,2),He=v(_(mi)),Ye=_(He);Ye.value=Ye.__value="";var Qt=v(Ye);Qt.value=Qt.__value="tlsv1.3";var Gt=v(Qt);Gt.value=Gt.__value="tlsv1.2";var gi=v(oi,2),Jt=_(gi),fe=_(Jt),Ke=v(Jt,2),ot=_(Ke);jt(Le,()=>c(mt).tls.certfile,rt=>c(mt).tls.certfile=rt),jt(Oe,()=>c(mt).tls.keyfile,rt=>c(mt).tls.keyfile=rt),jt(At,()=>c(mt).tls.cafile,rt=>c(mt).tls.cafile=rt),jt(ri,()=>c(mt).tls.capath,rt=>c(mt).tls.capath=rt),jt(Ut,()=>c(mt).tls.crlfile,rt=>c(mt).tls.crlfile=rt),Fs(He,()=>c(mt).tls.tls_version,rt=>c(mt).tls.tls_version=rt),Cs(fe,()=>c(mt).tls.require_certificate,rt=>c(mt).tls.require_certificate=rt),Cs(ot,()=>c(mt).tls.use_identity_as_username,rt=>c(mt).tls.use_identity_as_username=rt),D(nt,qt)},St=Tt(()=>T(c(mt)));z(yi,nt=>{c(St)&&nt(Xe)})}var Ai=v(yi,2),ki=_(Ai),fi=v(Ai,2);{var Ii=nt=>{var qt=NJ(),se=_(qt),Ee=_(se),Le=v(_(Ee)),Y=v(Ee,2),Oe=v(_(Y)),Ve=v(Y,2),ye=v(_(Ve)),At=_(ye);At.value=At.__value="";var Ot=v(At);Ot.value=Ot.__value="0";var ri=v(Ot);ri.value=ri.__value="1";var oi=v(ri);oi.value=oi.__value="2";var xi;w1(ye);var Ut=v(se,2);{var mi=Ye=>{var Qt=RJ(),Gt=_(Qt),gi=_(Gt);Cs(gi,()=>c(mt).tls.use_subject_as_username,Jt=>c(mt).tls.use_subject_as_username=Jt),D(Ye,Qt)},He=Tt(()=>T(c(mt)));z(Ut,Ye=>{c(He)&&Ye(mi)})}j(Ye=>{xi!==(xi=Ye)&&(ye.value=(ye.__value=Ye)??"",Tm(ye,Ye))},[()=>c(mt).max_qos!==void 0?String(c(mt).max_qos):""]),jt(Le,()=>c(mt).mount_point,Ye=>c(mt).mount_point=Ye),jt(Oe,()=>c(mt).max_connections,Ye=>c(mt).max_connections=Ye),$("change",ye,Ye=>{const Qt=Ye.target.value;c(mt).max_qos=Qt===""?void 0:Number(Qt),m(u,[...c(u)],!0)}),D(nt,qt)},X=Tt(()=>c(b).has(Mi));z(fi,nt=>{c(X)&&nt(Ii)})}var Ae=v(fi,2);{var qe=nt=>{var qt=OJ(),se=v(_(qt),2),Ee=_(se),Le=v(_(Ee)),Y=_(Le);Y.value=Y.__value="";var Oe=v(Y);Oe.value=Oe.__value="true";var Ve=v(Oe);Ve.value=Ve.__value="false";var ye;w1(Le);var At=v(Ee,2),Ot=v(_(At)),ri=v(At,2),oi=v(_(ri));j(()=>{ye!==(ye=c(mt).allow_anonymous===void 0?"":c(mt).allow_anonymous?"true":"false")&&(Le.value=Le.__value=c(mt).allow_anonymous===void 0?"":c(mt).allow_anonymous?"true":"false",Tm(Le,c(mt).allow_anonymous===void 0?"":c(mt).allow_anonymous?"true":"false"))}),$("change",Le,xi=>{const Ut=xi.target.value;c(mt).allow_anonymous=Ut===""?void 0:Ut==="true",m(u,[...c(u)],!0)}),jt(Ot,()=>c(mt).password_file,xi=>c(mt).password_file=xi),jt(oi,()=>c(mt).acl_file,xi=>c(mt).acl_file=xi),D(nt,qt)};z(Ae,nt=>{c(g)&&nt(qe)})}j((nt,qt)=>{O(ji,`Port ${c(mt).port??""}`),oa(Oi,nt),O(ki,`${qt??""} Advanced`)},[()=>T(c(mt)),()=>c(b).has(Mi)?"▾":"▸"]),$("click",Bi,()=>P(Mi)),jt(Zi,()=>c(mt).port,nt=>c(mt).port=nt),Fs(gt,()=>c(mt).protocol,nt=>c(mt).protocol=nt),jt(Pi,()=>c(mt).bindAddress,nt=>c(mt).bindAddress=nt),$("change",Oi,nt=>V(c(mt),nt.target.checked)),$("click",Ai,()=>A(Mi)),D(Zt,Ri)});var Vt=v(Ft,2);{var zt=Zt=>{var mt=WJ();D(Zt,mt)};z(Vt,Zt=>{c(u).length===0&&Zt(zt)})}Cs(Ze,()=>c(g),Zt=>m(g,Zt)),D(be,Rt)};z(Wt,be=>{c(t)===null&&!c(i)?be(tt):be(kt,-1)})}j(()=>{te.disabled=c(n),O(he,c(n)?"Saving…":"Save"),De.disabled=c(a),O(oe,c(a)?"Reloading…":"Apply & Reload")}),$("click",de,w),$("click",te,M),$("click",De,R),D(o,W),js()}Zs(["click","change"]);var KA=B('<div class="err svelte-1by6o5t"> </div>'),$J=B('<div class="ok svelte-1by6o5t">Saved.</div>'),UJ=B('<div class="reload-msg svelte-1by6o5t"> </div>'),KC=B('<label class="check-label svelte-1by6o5t"><input type="checkbox" class="svelte-1by6o5t"/> <span class="checkmark svelte-1by6o5t"></span> </label>'),qJ=B('<label class="check-label svelte-1by6o5t"><input type="checkbox" class="svelte-1by6o5t"/> <span class="checkmark svelte-1by6o5t"></span> <strong> </strong></label>'),GJ=B(`<div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Logging</h4> <div class="field svelte-1by6o5t"><span class="field-key svelte-1by6o5t">log_dest</span> <div class="checkbox-group svelte-1by6o5t"></div> <p class="hint svelte-1by6o5t">Log destinations. Enable <code class="svelte-1by6o5t">topic</code> to stream logs to <code class="svelte-1by6o5t">$SYS/broker/log/*</code> and view them in the Logs tab. <code class="svelte-1by6o5t">none</code> disables logging entirely.</p></div> <div class="field svelte-1by6o5t"><span class="field-key svelte-1by6o5t">log_type</span> <div class="log-type-grid svelte-1by6o5t"><div class="log-type-group svelte-1by6o5t"><span class="log-type-group-label svelte-1by6o5t">Severity</span> <!></div> <div class="log-type-group svelte-1by6o5t"><span class="log-type-group-label svelte-1by6o5t">Events</span> <!></div> <div class="log-type-group log-type-group--other svelte-1by6o5t"><!> <span class="all-hint svelte-1by6o5t">enables all types above</span></div></div> <p class="hint svelte-1by6o5t">Types of messages to log. Leave all unchecked to use the broker default.</p></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Connection limits</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_connections</span> <input placeholder="−1 (unlimited)" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum simultaneous client connections. <code class="svelte-1by6o5t">-1</code> = unlimited.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_keepalive</span> <input placeholder="65535" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum keepalive value (seconds) a client may request. <code class="svelte-1by6o5t">0</code> = unlimited.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_inflight_messages</span> <input placeholder="20" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Max simultaneous unacknowledged QoS 1/2 messages per client.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_queued_messages</span> <input placeholder="100" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Max messages queued for a disconnected persistent client.</p></div></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Packet &amp; payload size</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_packet_size</span> <input placeholder="0 (no limit)" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum MQTT packet size in bytes (MQTT v5 only). <code class="svelte-1by6o5t">0</code> = no limit.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">message_size_limit</span> <input placeholder="0 (no limit)" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum payload size in bytes for published messages. <code class="svelte-1by6o5t">0</code> = no limit.</p></div></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Sessions &amp; persistence</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">persistent_client_expiration</span> <input placeholder="e.g. 7d, 2h, 30m" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Expire persistent sessions after this duration. Suffix: <code class="svelte-1by6o5t">d</code>/<code class="svelte-1by6o5t">h</code>/<code class="svelte-1by6o5t">m</code>/<code class="svelte-1by6o5t">s</code>. Empty = never expire.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">retain_available</span> <select class="svelte-1by6o5t"><option>auto (broker default)</option><option>true — allow retained messages</option><option>false — disable retained messages globally</option></select></label> <p class="hint svelte-1by6o5t">Disable retained messages broker-wide.</p></div></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Performance</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">set_tcp_nodelay</span> <select class="svelte-1by6o5t"><option>auto (broker default)</option><option>true — disable Nagle (lower latency)</option><option>false — enable Nagle</option></select></label> <p class="hint svelte-1by6o5t">Disable Nagle's algorithm to reduce latency at the cost of slightly more packets.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">connection_messages</span> <select class="svelte-1by6o5t"><option>auto (broker default)</option><option>true — log connect/disconnect</option><option>false — suppress</option></select></label> <p class="hint svelte-1by6o5t">Log a message on every client connect and disconnect.</p></div></div></div>`,1),KJ=B('<div class="config-page svelte-1by6o5t"><div class="page-header svelte-1by6o5t"><h3 class="svelte-1by6o5t">Global config</h3> <div class="header-actions svelte-1by6o5t"><button class="btn-save svelte-1by6o5t"> </button> <button class="btn-reload svelte-1by6o5t"> </button></div></div> <!> <!> <!> <!> <!></div>');function ZJ(o,e){Vs(e,!0);let t=I(null),i=I(""),n=I(!1),s=I(""),r=I(!1),a=I(!1),d=I(""),u=I(null),f=I(""),g=I(""),p=I(""),C=I(""),b=I(""),y=I(""),w=I(""),A=I(""),P=I(""),M=I("");const R=["file","stdout","stderr","syslog","topic","none"],T=["error","warning","notice","information","debug"],V=["connect","disconnect","subscribe","unsubscribe","publish","receive","websockets"],W=["all"];[...T,...V,...W];let Q=I(Ei(new Set)),ne=I(Ei(new Set));function de(wt,Ft){const Vt=new Set(wt);return Vt.has(Ft)?Vt.delete(Ft):Vt.add(Ft),Vt}function te(wt){if(!c(t))return"";const Ft=c(t).managed[wt];return Array.isArray(Ft)?Ft[0]:Ft??""}function he(wt){if(!c(t))return new Set;const Ft=c(t).managed[wt];return Ft?new Set(Array.isArray(Ft)?Ft:[Ft]):new Set}Ks(()=>De());async function De(){try{m(t,await rS(),!0),m(u,c(t).checksum,!0),m(f,te("max_connections"),!0),m(g,te("max_inflight_messages"),!0),m(p,te("max_queued_messages"),!0),m(C,te("max_packet_size"),!0),m(b,te("message_size_limit"),!0),m(y,te("max_keepalive"),!0),m(w,te("persistent_client_expiration"),!0),m(A,te("retain_available"),!0),m(P,te("set_tcp_nodelay"),!0),m(M,te("connection_messages"),!0),m(Q,he("log_dest"),!0),m(ne,he("log_type"),!0),m(i,"")}catch(wt){m(i,wt.message??"Failed to load config",!0)}}async function oe(){if(c(t)){m(n,!0),m(s,""),m(r,!1);try{let Ft=function(Vt,zt){zt!==""?wt[Vt]=zt:delete wt[Vt]};const wt={...c(t).managed};Ft("max_connections",c(f)),Ft("max_inflight_messages",c(g)),Ft("max_queued_messages",c(p)),Ft("max_packet_size",c(C)),Ft("message_size_limit",c(b)),Ft("max_keepalive",c(y)),Ft("persistent_client_expiration",c(w)),Ft("retain_available",c(A)),Ft("set_tcp_nodelay",c(P)),Ft("connection_messages",c(M)),c(Q).size>0?wt.log_dest=c(Q).size===1?[...c(Q)][0]:[...c(Q)]:delete wt.log_dest,c(ne).size>0?wt.log_type=c(ne).size===1?[...c(ne)][0]:[...c(ne)]:delete wt.log_type,await bF({listeners:c(t).listeners,managed:wt,passthrough:c(t).passthrough,checksum:c(u)}),m(r,!0),setTimeout(()=>m(r,!1),3e3),await De()}catch(wt){m(s,wt.message??"Save failed",!0)}finally{m(n,!1)}}}async function ge(){m(a,!0),m(d,"");try{const wt=await CF();m(d,wt.stderr||wt.stdout||"Reloaded",!0)}catch(wt){m(d,"Error: "+(wt.message??"reload failed"))}finally{m(a,!1)}}var Se=KJ(),Re=_(Se),xe=v(_(Re),2),et=_(xe),We=_(et),_e=v(et,2),dt=_(_e),Wt=v(Re,2);{var tt=wt=>{var Ft=KA(),Vt=_(Ft);j(()=>O(Vt,c(i))),D(wt,Ft)};z(Wt,wt=>{c(i)&&wt(tt)})}var kt=v(Wt,2);{var be=wt=>{var Ft=KA(),Vt=_(Ft);j(()=>O(Vt,c(s))),D(wt,Ft)};z(kt,wt=>{c(s)&&wt(be)})}var Rt=v(kt,2);{var ut=wt=>{var Ft=$J();D(wt,Ft)};z(Rt,wt=>{c(r)&&wt(ut)})}var at=v(Rt,2);{var Ze=wt=>{var Ft=UJ(),Vt=_(Ft);j(()=>O(Vt,c(d))),D(wt,Ft)};z(at,wt=>{c(d)&&wt(Ze)})}var Pt=v(at,2);{var ui=wt=>{var Ft=GJ(),Vt=yt(Ft),zt=v(_(Vt),2),Zt=v(_(zt),2);ei(Zt,21,()=>R,Ni,(ht,_t)=>{var Xt=KC(),F=_(Xt),H=v(F,3);j(K=>{oa(F,K),O(H,` ${c(_t)??""}`)},[()=>c(Q).has(c(_t))]),$("change",F,()=>{m(Q,de(c(Q),c(_t)),!0)}),D(ht,Xt)});var mt=v(zt,2),Mi=v(_(mt),2),Ri=_(Mi),Di=v(_(Ri),2);ei(Di,17,()=>T,Ni,(ht,_t)=>{var Xt=KC(),F=_(Xt),H=v(F,3);j(K=>{oa(F,K),O(H,` ${c(_t)??""}`)},[()=>c(ne).has(c(_t))]),$("change",F,()=>{m(ne,de(c(ne),c(_t)),!0)}),D(ht,Xt)});var Ui=v(Ri,2),ji=v(_(Ui),2);ei(ji,17,()=>V,Ni,(ht,_t)=>{var Xt=KC(),F=_(Xt),H=v(F,3);j(K=>{oa(F,K),O(H,` ${c(_t)??""}`)},[()=>c(ne).has(c(_t))]),$("change",F,()=>{m(ne,de(c(ne),c(_t)),!0)}),D(ht,Xt)});var Bi=v(Ui,2),fn=_(Bi);ei(fn,17,()=>W,Ni,(ht,_t)=>{var Xt=qJ(),F=_(Xt),H=v(F,4),K=_(H);j(le=>{oa(F,le),O(K,c(_t))},[()=>c(ne).has(c(_t))]),$("change",F,()=>{m(ne,de(c(ne),c(_t)),!0)}),D(ht,Xt)});var an=v(Vt,2),Zi=v(_(an),2),_n=_(Zi),gt=_(_n),Yt=v(_(gt),2),Ci=v(_n,2),Wi=_(Ci),Pi=v(_(Wi),2),Ti=v(Ci,2),Oi=_(Ti),Qi=v(_(Oi),2),yi=v(Ti,2),Xe=_(yi),St=v(_(Xe),2),Ai=v(an,2),ki=v(_(Ai),2),fi=_(ki),Ii=_(fi),X=v(_(Ii),2),Ae=v(fi,2),qe=_(Ae),nt=v(_(qe),2),qt=v(Ai,2),se=v(_(qt),2),Ee=_(se),Le=_(Ee),Y=v(_(Le),2),Oe=v(Ee,2),Ve=_(Oe),ye=v(_(Ve),2),At=_(ye);At.value=At.__value="";var Ot=v(At);Ot.value=Ot.__value="true";var ri=v(Ot);ri.value=ri.__value="false";var oi=v(qt,2),xi=v(_(oi),2),Ut=_(xi),mi=_(Ut),He=v(_(mi),2),Ye=_(He);Ye.value=Ye.__value="";var Qt=v(Ye);Qt.value=Qt.__value="true";var Gt=v(Qt);Gt.value=Gt.__value="false";var gi=v(Ut,2),Jt=_(gi),fe=v(_(Jt),2),Ke=_(fe);Ke.value=Ke.__value="";var ot=v(Ke);ot.value=ot.__value="true";var rt=v(ot);rt.value=rt.__value="false",jt(Yt,()=>c(f),ht=>m(f,ht)),jt(Pi,()=>c(y),ht=>m(y,ht)),jt(Qi,()=>c(g),ht=>m(g,ht)),jt(St,()=>c(p),ht=>m(p,ht)),jt(X,()=>c(C),ht=>m(C,ht)),jt(nt,()=>c(b),ht=>m(b,ht)),jt(Y,()=>c(w),ht=>m(w,ht)),Fs(ye,()=>c(A),ht=>m(A,ht)),Fs(He,()=>c(P),ht=>m(P,ht)),Fs(fe,()=>c(M),ht=>m(M,ht)),D(wt,Ft)};z(Pt,wt=>{c(t)&&wt(ui)})}j(()=>{et.disabled=c(n),O(We,c(n)?"Saving…":"Save"),_e.disabled=c(a),O(dt,c(a)?"Reloading…":"Apply & Reload")}),$("click",et,oe),$("click",_e,ge),D(o,Se),js()}Zs(["click","change"]);var il=B('<div class="err svelte-9auejo"> </div>'),XJ=B('<div class="info-card svelte-9auejo"><dl class="svelte-9auejo"><dt class="svelte-9auejo">CN</dt><dd class="svelte-9auejo"> </dd> <dt class="svelte-9auejo">Fingerprint (SHA-256)</dt><dd class="mono small svelte-9auejo"> </dd> <dt class="svelte-9auejo">Expires</dt><dd> </dd></dl></div>'),YJ=B('<div class="empty svelte-9auejo">No managed server certificate. Use one of the options above, or configure <code>certfile</code>/<code>keyfile</code> manually in the Listeners tab.</div>'),QJ=B('<div class="empty svelte-9auejo">No trusted CA certs. Add one to enable client certificate authentication.</div>'),JJ=B('<tr><td class="mono svelte-9auejo"> </td><td class="mono small svelte-9auejo"> </td><td> </td><td class="actions svelte-9auejo"><button class="danger svelte-9auejo">✕</button></td></tr>'),eee=B('<table class="svelte-9auejo"><thead><tr><th class="svelte-9auejo">CN</th><th class="svelte-9auejo">Fingerprint</th><th class="svelte-9auejo">Expires</th><th class="svelte-9auejo"></th></tr></thead><tbody></tbody></table>'),tee=B('<div class="result-box svelte-9auejo"><p class="svelte-9auejo">✓ Certificate installed.</p> <dl class="svelte-9auejo"><dt class="svelte-9auejo">Fingerprint</dt><dd class="mono small svelte-9auejo"> </dd><dt class="svelte-9auejo">Expires</dt><dd class="svelte-9auejo"> </dd></dl></div>'),ZA=B('<button class="btn-primary svelte-9auejo"> </button>'),iee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal svelte-9auejo"><h3 class="svelte-9auejo">Generate self-signed server certificate</h3> <label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Validity (days)<input type="number" min="1" max="3650" class="svelte-9auejo"/></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div></div></div>'),nee=B('<label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <p class="hint svelte-9auejo">A private key and CSR are generated on the server. Copy the CSR, have it signed by your CA, then paste the signed cert below.</p> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),see=B('<div class="ok svelte-9auejo">✓ Certificate installed.</div>'),oee=B('<p class="hint svelte-9auejo">Key stored on server. Copy the CSR, get it signed, then paste the signed certificate to complete installation.</p> <label class="svelte-9auejo">Certificate Signing Request<textarea readonly="" rows="8" class="svelte-9auejo"></textarea></label> <div class="csr-actions svelte-9auejo"><button class="svelte-9auejo">Copy CSR</button> <a class="btn-download svelte-9auejo" download="server.csr">Download .csr</a></div> <hr class="svelte-9auejo"/> <label class="svelte-9auejo">Upload signed certificate (PEM)<textarea rows="6" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div>',1),ree=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Generate key + CSR for server certificate</h3> <!></div></div>'),aee=B('<label class="svelte-9auejo">Certificate (PEM)<textarea rows="5" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <label class="svelte-9auejo">Private key (PEM — leave blank if key is already on disk from a prior CSR)<textarea rows="4" placeholder="-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----" class="svelte-9auejo"></textarea></label>',1),lee=B('<span class="file-name mono small svelte-9auejo"> </span>'),cee=B('<label class="svelte-9auejo">PKCS#12 file <div class="file-row svelte-9auejo"><input type="file" accept=".p12,.pfx" class="svelte-9auejo"/> <!></div></label> <label class="svelte-9auejo">Passphrase <div class="pw-row svelte-9auejo"><input autocomplete="off" class="svelte-9auejo"/> <button class="toggle-pw svelte-9auejo"> </button></div></label>',1),dee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Import server certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>PEM files</button> <button>PKCS#12 (.p12 / .pfx)</button></div> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),ZC=B("<option></option>"),uee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Use existing certificate files</h3> <p class="hint svelte-9auejo">Enter absolute paths on the broker host. Tab-completion is available for paths starting with /.</p> <label class="svelte-9auejo">Certificate file path <input list="set-cert-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/fullchain.pem" class="svelte-9auejo"/> <datalist id="set-cert-path-list"></datalist></label> <label class="svelte-9auejo">Private key file path <input list="set-key-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/privkey.pem" class="svelte-9auejo"/> <datalist id="set-key-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),hee=B('<label class="svelte-9auejo">CA certificate (PEM)<textarea rows="8" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),fee=B('<p class="hint svelte-9auejo">Enter the absolute path to the CA certificate file on the broker host.</p> <label class="svelte-9auejo">CA certificate path <input list="trusted-path-list" placeholder="/etc/ssl/certs/my-ca.pem" class="svelte-9auejo"/> <datalist id="trusted-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),gee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Add trusted CA certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>Paste PEM</button> <button>From path</button></div> <!></div></div>'),pee=B('<div class="certs-page svelte-9auejo"><div class="page-toolbar svelte-9auejo"><button class="reload-btn svelte-9auejo" title="Refresh">↺</button></div> <!> <!> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Server Certificate</h3> <button class="svelte-9auejo">Self-signed</button> <button class="svelte-9auejo">Generate CSR</button> <button class="svelte-9auejo">Import cert</button> <button class="svelte-9auejo">Use path</button></div> <!></div> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Trusted CA Certificates</h3> <button class="svelte-9auejo">+ Add CA cert</button></div> <!></div></div> <!> <!> <!> <!> <!>',1);function xee(o,e){Vs(e,!0);let t=I(null),i=I(Ei([])),n=I(""),s=I(""),r=I(!1),a=I(""),d=I(""),u=I(365),f=I(!1),g=I(""),p=I(null),C=I(!1),b=I(""),y=I(""),w=I(!1),A=I(""),P=I(""),M=I(""),R=I(!1),T=I(""),V=I(!1),W=I(!1),Q=I("pem"),ne=I(""),de=I(""),te=I(""),he=I(""),De=I(""),oe=I(!1),ge=I(!1),Se=I(""),Re=I(!1),xe=I(""),et=I(""),We=I(!1),_e=I(""),dt=I(Ei([])),Wt=I(Ei([])),tt=I(!1),kt=I("pem"),be=I(""),Rt=I(!1),ut=I(""),at=I(""),Ze=I(Ei([])),Pt=I(!1),ui=I("");async function wt(){try{const[He,Ye]=await Promise.allSettled([IU(),MU()]);He.status==="fulfilled"&&m(t,He.value.server,!0),Ye.status==="fulfilled"&&m(i,Ye.value.certs,!0),m(n,"")}catch(He){m(n,He.message,!0)}}Ks(()=>{wt()});async function Ft(){m(g,""),m(f,!0),m(p,null);try{const He=c(d).split(",").map(Qt=>Qt.trim()).filter(Boolean),Ye=await PU({cn:c(a),san:He,days:c(u)});m(p,{fingerprint:Ye.fingerprint,expires:Ye.expires},!0),await wt()}catch(He){m(g,He.message,!0)}finally{m(f,!1)}}async function Vt(){m(A,""),m(w,!0),m(P,"");try{const He=c(y).split(",").map(Qt=>Qt.trim()).filter(Boolean),Ye=await TU({cn:c(b),san:He});m(P,Ye.csrPem,!0)}catch(He){m(A,He.message,!0)}finally{m(w,!1)}}async function zt(){m(T,""),m(R,!0),m(V,!1);try{if(!c(M).trim())throw new Error("Paste the signed certificate PEM");await jC({cert:c(M)}),m(V,!0),await wt()}catch(He){m(T,He.message,!0)}finally{m(R,!1)}}function Zt(){navigator.clipboard.writeText(c(P)).catch(()=>{})}function mt(He){var Gt;const Ye=(Gt=He.target.files)==null?void 0:Gt[0];if(!Ye)return;m(he,Ye.name,!0);const Qt=new FileReader;Qt.onload=()=>{const gi=Qt.result;m(te,btoa(String.fromCharCode(...new Uint8Array(gi))),!0)},Qt.readAsArrayBuffer(Ye)}async function Mi(){m(Se,""),m(ge,!0);try{if(c(Q)==="p12"){if(!c(te))throw new Error("Select a .p12 / .pfx file");await jC({p12base64:c(te),passphrase:c(De)})}else{if(!c(ne).trim())throw new Error("Certificate PEM is required");await jC({cert:c(ne),key:c(de)||void 0})}m(W,!1),await wt()}catch(He){m(Se,He.message,!0)}finally{m(ge,!1)}}function Ri(He){let Ye;return Qt=>{const Gt=Qt.target.value;clearTimeout(Ye),Ye=setTimeout(async()=>{if(!Gt.startsWith("/")||Gt.length<2){He([]);return}try{He((await OU(Gt)).suggestions)}catch{He([])}},280)}}const Di=Ri(He=>{m(dt,He,!0)}),Ui=Ri(He=>{m(Wt,He,!0)}),ji=Ri(He=>{m(Ze,He,!0)});async function Bi(){m(_e,""),m(We,!0);try{await HU({certPath:c(xe),keyPath:c(et)}),m(Re,!1),await wt()}catch(He){m(_e,He.message,!0)}finally{m(We,!1)}}async function fn(){m(ut,""),m(Rt,!0);try{await RU(c(be)),m(be,""),m(tt,!1),await wt()}catch(He){m(ut,He.message,!0)}finally{m(Rt,!1)}}async function an(){m(ui,""),m(Pt,!0);try{await WU(c(at)),m(at,""),m(tt,!1),await wt()}catch(He){m(ui,He.message,!0)}finally{m(Pt,!1)}}async function Zi(He){if(confirm("Remove this trusted CA cert?"))try{await NU(He),await wt()}catch(Ye){m(s,Ye.message,!0)}}function _n(He){const Ye=new Date(He).getTime()-Date.now();return Ye<0?"expired":Ye<30*864e5?"expiring":""}function gt(He){return new Date(He).toLocaleDateString()}var Yt=pee(),Ci=yt(Yt),Wi=_(Ci),Pi=_(Wi),Ti=v(Wi,2);{var Oi=He=>{var Ye=il(),Qt=_(Ye);j(()=>O(Qt,c(n))),D(He,Ye)};z(Ti,He=>{c(n)&&He(Oi)})}var Qi=v(Ti,2);{var yi=He=>{var Ye=il(),Qt=_(Ye);j(()=>O(Qt,c(s))),D(He,Ye)};z(Qi,He=>{c(s)&&He(yi)})}var Xe=v(Qi,2),St=_(Xe),Ai=v(_(St),2),ki=v(Ai,2),fi=v(ki,2),Ii=v(fi,2),X=v(St,2);{var Ae=He=>{var Ye=XJ(),Qt=_(Ye),Gt=v(_(Qt)),gi=_(Gt),Jt=v(Gt,3),fe=_(Jt),Ke=v(Jt,3),ot=_(Ke);j((rt,ht)=>{O(gi,c(t).cn),O(fe,c(t).fingerprint),Bt(Ke,1,rt,"svelte-9auejo"),O(ot,ht)},[()=>sg(_n(c(t).expires)),()=>gt(c(t).expires)]),D(He,Ye)},qe=He=>{var Ye=YJ();D(He,Ye)};z(X,He=>{c(t)?He(Ae):He(qe,-1)})}var nt=v(Xe,2),qt=_(nt),se=v(_(qt),2),Ee=v(qt,2);{var Le=He=>{var Ye=QJ();D(He,Ye)},Y=He=>{var Ye=eee(),Qt=v(_(Ye));ei(Qt,21,()=>c(i),Ni,(Gt,gi)=>{var Jt=JJ(),fe=_(Jt),Ke=_(fe),ot=v(fe),rt=_(ot),ht=v(ot),_t=_(ht),Xt=v(ht),F=_(Xt);j((H,K,le)=>{O(Ke,c(gi).cn),O(rt,`${H??""}…`),Bt(ht,1,K,"svelte-9auejo"),O(_t,le)},[()=>c(gi).fingerprint.slice(0,29),()=>sg(_n(c(gi).expires)),()=>gt(c(gi).expires)]),$("click",F,()=>Zi(c(gi).fingerprint)),D(Gt,Jt)}),D(He,Ye)};z(Ee,He=>{c(i).length===0?He(Le):He(Y,-1)})}var Oe=v(Ci,2);{var Ve=He=>{var Ye=iee(),Qt=_(Ye),Gt=v(_(Qt),2),gi=v(_(Gt)),Jt=v(Gt,2),fe=v(_(Jt)),Ke=v(Jt,2),ot=v(_(Ke)),rt=v(Ke,2);{var ht=Z=>{var J=il(),ce=_(J);j(()=>O(ce,c(g))),D(Z,J)};z(rt,Z=>{c(g)&&Z(ht)})}var _t=v(rt,2);{var Xt=Z=>{var J=tee(),ce=v(_(J),2),Qe=v(_(ce)),ae=_(Qe),pe=v(Qe,2),Te=_(pe);j(me=>{O(ae,c(p).fingerprint),O(Te,me)},[()=>gt(c(p).expires)]),D(Z,J)};z(_t,Z=>{c(p)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2);{var le=Z=>{var J=ZA(),ce=_(J);j(()=>{J.disabled=c(f),O(ce,c(f)?"Generating…":"Generate")}),$("click",J,Ft),D(Z,J)};z(K,Z=>{c(p)||Z(le)})}jt(gi,()=>c(a),Z=>m(a,Z)),jt(fe,()=>c(d),Z=>m(d,Z)),jt(ot,()=>c(u),Z=>m(u,Z)),$("click",H,()=>m(r,!1)),D(He,Ye)};z(Oe,He=>{c(r)&&He(Ve)})}var ye=v(Oe,2);{var At=He=>{var Ye=ree(),Qt=_(Ye),Gt=v(_(Qt),2);{var gi=fe=>{var Ke=nee(),ot=yt(Ke),rt=v(_(ot)),ht=v(ot,2),_t=v(_(ht)),Xt=v(ht,4);{var F=J=>{var ce=il(),Qe=_(ce);j(()=>O(Qe,c(A))),D(J,ce)};z(Xt,J=>{c(A)&&J(F)})}var H=v(Xt,2),K=_(H),le=v(K,2),Z=_(le);j(()=>{le.disabled=c(w),O(Z,c(w)?"Generating…":"Generate key + CSR")}),jt(rt,()=>c(b),J=>m(b,J)),jt(_t,()=>c(y),J=>m(y,J)),$("click",K,()=>m(C,!1)),$("click",le,Vt),D(fe,Ke)},Jt=fe=>{var Ke=oee(),ot=v(yt(Ke),2),rt=v(_(ot)),ht=v(ot,2),_t=_(ht),Xt=v(_t,2),F=v(ht,4),H=v(_(F)),K=v(F,2);{var le=Te=>{var me=il(),Ie=_(me);j(()=>O(Ie,c(T))),D(Te,me)};z(K,Te=>{c(T)&&Te(le)})}var Z=v(K,2);{var J=Te=>{var me=see();D(Te,me)};z(Z,Te=>{c(V)&&Te(J)})}var ce=v(Z,2),Qe=_(ce),ae=v(Qe,2);{var pe=Te=>{var me=ZA(),Ie=_(me);j(lt=>{me.disabled=lt,O(Ie,c(R)?"Uploading…":"Upload signed cert")},[()=>c(R)||!c(M).trim()]),$("click",me,zt),D(Te,me)};z(ae,Te=>{c(V)||Te(pe)})}j(Te=>{S1(rt,c(P)),ln(Xt,"href",`data:application/pkcs10;charset=utf-8,${Te??""}`)},[()=>encodeURIComponent(c(P))]),$("click",_t,Zt),jt(H,()=>c(M),Te=>m(M,Te)),$("click",Qe,()=>m(C,!1)),D(fe,Ke)};z(Gt,fe=>{c(P)?fe(Jt,-1):fe(gi)})}D(He,Ye)};z(ye,He=>{c(C)&&He(At)})}var Ot=v(ye,2);{var ri=He=>{var Ye=dee(),Qt=_(Ye),Gt=v(_(Qt),2),gi=_(Gt);let Jt;var fe=v(gi,2);let Ke;var ot=v(Gt,2);{var rt=Z=>{var J=aee(),ce=yt(J),Qe=v(_(ce)),ae=v(ce,2),pe=v(_(ae));jt(Qe,()=>c(ne),Te=>m(ne,Te)),jt(pe,()=>c(de),Te=>m(de,Te)),D(Z,J)},ht=Z=>{var J=cee(),ce=yt(J),Qe=v(_(ce)),ae=_(Qe),pe=v(ae,2);{var Te=Ne=>{var it=lee(),Pe=_(it);j(()=>O(Pe,c(he))),D(Ne,it)};z(pe,Ne=>{c(he)&&Ne(Te)})}var me=v(ce,2),Ie=v(_(me)),lt=_(Ie),G=v(lt,2),re=_(G);j(()=>{ln(lt,"type",c(oe)?"text":"password"),O(re,c(oe)?"Hide":"Show")}),$("change",ae,mt),jt(lt,()=>c(De),Ne=>m(De,Ne)),$("click",G,()=>m(oe,!c(oe))),D(Z,J)};z(ot,Z=>{c(Q)==="pem"?Z(rt):Z(ht,-1)})}var _t=v(ot,2);{var Xt=Z=>{var J=il(),ce=_(J);j(()=>O(ce,c(Se))),D(Z,J)};z(_t,Z=>{c(Se)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2),le=_(K);j(()=>{Jt=Bt(gi,1,"svelte-9auejo",null,Jt,{active:c(Q)==="pem"}),Ke=Bt(fe,1,"svelte-9auejo",null,Ke,{active:c(Q)==="p12"}),K.disabled=c(ge),O(le,c(ge)?"Importing…":"Import")}),$("click",gi,()=>m(Q,"pem")),$("click",fe,()=>m(Q,"p12")),$("click",H,()=>m(W,!1)),$("click",K,Mi),D(He,Ye)};z(Ot,He=>{c(W)&&He(ri)})}var oi=v(Ot,2);{var xi=He=>{var Ye=uee(),Qt=_(Ye),Gt=v(_(Qt),4),gi=v(_(Gt)),Jt=v(gi,2);ei(Jt,21,()=>c(dt),Ni,(K,le)=>{var Z=ZC(),J={};j(()=>{J!==(J=c(le))&&(Z.value=(Z.__value=c(le))??"")}),D(K,Z)});var fe=v(Gt,2),Ke=v(_(fe)),ot=v(Ke,2);ei(ot,21,()=>c(Wt),Ni,(K,le)=>{var Z=ZC(),J={};j(()=>{J!==(J=c(le))&&(Z.value=(Z.__value=c(le))??"")}),D(K,Z)});var rt=v(fe,2);{var ht=K=>{var le=il(),Z=_(le);j(()=>O(Z,c(_e))),D(K,le)};z(rt,K=>{c(_e)&&K(ht)})}var _t=v(rt,2),Xt=_(_t),F=v(Xt,2),H=_(F);j(K=>{F.disabled=K,O(H,c(We)?"Installing…":"Install")},[()=>c(We)||!c(xe).trim()||!c(et).trim()]),$("input",gi,Di),jt(gi,()=>c(xe),K=>m(xe,K)),$("input",Ke,Ui),jt(Ke,()=>c(et),K=>m(et,K)),$("click",Xt,()=>m(Re,!1)),$("click",F,Bi),D(He,Ye)};z(oi,He=>{c(Re)&&He(xi)})}var Ut=v(oi,2);{var mi=He=>{var Ye=gee(),Qt=_(Ye),Gt=v(_(Qt),2),gi=_(Gt);let Jt;var fe=v(gi,2);let Ke;var ot=v(Gt,2);{var rt=_t=>{var Xt=hee(),F=yt(Xt),H=v(_(F)),K=v(F,2);{var le=ae=>{var pe=il(),Te=_(pe);j(()=>O(Te,c(ut))),D(ae,pe)};z(K,ae=>{c(ut)&&ae(le)})}var Z=v(K,2),J=_(Z),ce=v(J,2),Qe=_(ce);j(ae=>{ce.disabled=ae,O(Qe,c(Rt)?"Adding…":"Add CA cert")},[()=>c(Rt)||!c(be).trim()]),jt(H,()=>c(be),ae=>m(be,ae)),$("click",J,()=>m(tt,!1)),$("click",ce,fn),D(_t,Xt)},ht=_t=>{var Xt=fee(),F=v(yt(Xt),2),H=v(_(F)),K=v(H,2);ei(K,21,()=>c(Ze),Ni,(pe,Te)=>{var me=ZC(),Ie={};j(()=>{Ie!==(Ie=c(Te))&&(me.value=(me.__value=c(Te))??"")}),D(pe,me)});var le=v(F,2);{var Z=pe=>{var Te=il(),me=_(Te);j(()=>O(me,c(ui))),D(pe,Te)};z(le,pe=>{c(ui)&&pe(Z)})}var J=v(le,2),ce=_(J),Qe=v(ce,2),ae=_(Qe);j(pe=>{Qe.disabled=pe,O(ae,c(Pt)?"Adding…":"Add CA cert")},[()=>c(Pt)||!c(at).trim()]),$("input",H,ji),jt(H,()=>c(at),pe=>m(at,pe)),$("click",ce,()=>m(tt,!1)),$("click",Qe,an),D(_t,Xt)};z(ot,_t=>{c(kt)==="pem"?_t(rt):_t(ht,-1)})}j(()=>{Jt=Bt(gi,1,"svelte-9auejo",null,Jt,{active:c(kt)==="pem"}),Ke=Bt(fe,1,"svelte-9auejo",null,Ke,{active:c(kt)==="path"})}),$("click",gi,()=>m(kt,"pem")),$("click",fe,()=>m(kt,"path")),D(He,Ye)};z(Ut,He=>{c(tt)&&He(mi)})}$("click",Pi,wt),$("click",Ai,()=>{m(r,!0),m(g,""),m(p,null)}),$("click",ki,()=>{m(C,!0),m(A,""),m(P,""),m(M,""),m(V,!1),m(T,"")}),$("click",fi,()=>{m(W,!0),m(Se,""),m(Q,"pem"),m(ne,""),m(de,""),m(te,""),m(he,""),m(De,""),m(oe,!1)}),$("click",Ii,()=>{m(Re,!0),m(_e,""),m(xe,""),m(et,""),m(dt,[],!0),m(Wt,[],!0)}),$("click",se,()=>{m(tt,!0),m(ut,""),m(be,""),m(kt,"pem"),m(ui,""),m(at,""),m(Ze,[],!0)}),D(o,Yt),js()}Zs(["click","change","input"]);var Vx=B('<div class="err svelte-17yczfe"> </div>'),mee=B('<div class="check-list svelte-17yczfe"><div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto_ctrl</code> <span> </span></div> <div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto</code> <span> </span></div></div>'),vee=B('<div class="checking svelte-17yczfe">Checking…</div>'),_ee=B('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Tool availability</h3> <p class="hint svelte-17yczfe">These tools must be installed and in the PATH of the she process. They are used by the Setup Wizard and cert installation.</p> <!> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div></div>'),bee=B('<label class="svelte-17yczfe">Install command (run locally) <div class="pubkey-row svelte-17yczfe"><input readonly="" class="svelte-17yczfe"/> <button class="copy-btn svelte-17yczfe">Copy</button></div></label>'),Cee=B('<label class="svelte-17yczfe">Public key <div class="pubkey-row svelte-17yczfe"><textarea readonly="" rows="3" class="svelte-17yczfe"></textarea> <button class="copy-btn svelte-17yczfe">Copy</button></div></label> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>',1),Eee=B('<div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>'),yee=B("<span> </span>"),wee=B('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH connection</h3> <p class="hint svelte-17yczfe">Used for file operations: reading/writing mosquitto.conf and installing certificates on the broker host. User/ACL management always uses the MQTT port directly.</p> <div class="fields svelte-17yczfe"><label class="svelte-17yczfe">Host<input placeholder="192.168.1.10 or broker.local" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Port<input type="number" min="1" max="65535" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">SSH user<input placeholder="root" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Identity file (private key)<input class="svelte-17yczfe"/></label></div></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH keypair</h3> <p class="hint svelte-17yczfe">Dedicated Ed25519 keypair for she to authenticate to the broker host. Private key stored at <code class="svelte-17yczfe"> </code>.</p> <!> <!></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Test connection</h3> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button> <!></div></div>',1),See=B('<div class="ok svelte-17yczfe">Saved.</div>'),Dee=B('<div class="mosquitto-page svelte-17yczfe"><!> <div class="mode-bar svelte-17yczfe"><span class="mode-label svelte-17yczfe">Connection mode</span> <div class="mode-toggle svelte-17yczfe"><button>Local</button> <button>SSH / Remote</button></div> <span class="mode-desc svelte-17yczfe"> </span></div> <!> <!> <!> <!> <div class="row svelte-17yczfe"><button class="btn-primary svelte-17yczfe"> </button></div></div>');function Aee(o,e){Vs(e,!0);let t=I(Ei({})),i=I(""),n=I(!1),s=I(!1),r=I(""),a=I("~/.she/ssh/broker_id_ed25519"),d=I("local"),u=I(null),f=I(!1),g=I(""),p=I(""),C=I(!1),b=I(""),y=I(!1),w=I(""),A=I(Ei({}));Ks(async()=>{try{const[Ze,Pt,ui]=await Promise.all([Il(),oS(),fetch("/she/broker/ssh/pubkey").then(Ft=>Ft.json()).catch(()=>({publicKey:null}))]);m(A,Ze,!0),Pt.sshKeyDefault&&m(a,Pt.sshKeyDefault,!0);const wt=c(A).broker??{};m(t,wt.ssh??{},!0),c(t).port||(c(t).port=22),c(t).identityFile||(c(t).identityFile=c(a)),ui.publicKey&&m(p,ui.publicKey,!0),m(d,c(t).host?"ssh":"local",!0),c(d)==="local"&&P()}catch(Ze){m(i,Ze.message,!0)}});async function P(){m(f,!0),m(g,"");try{m(u,await oU(),!0)}catch(Ze){m(g,Ze.message??"Check failed",!0)}finally{m(f,!1)}}async function M(){m(n,!0),m(r,""),m(s,!1);try{const Ze=c(A).broker??{},Pt=c(d)==="local"?{...c(t),host:""}:c(t),ui={...c(A),broker:{...Ze,ssh:Pt}};await ap(ui),m(s,!0),setTimeout(()=>m(s,!1),3e3)}catch(Ze){m(r,Ze.message,!0)}finally{m(n,!1)}}async function R(){m(C,!0),m(b,"");try{const Ze=await fetch("/she/broker/ssh/keygen",{method:"POST",headers:{"Content-Type":"application/json"}}),Pt=await Ze.json();if(!Ze.ok)throw new Error(Pt.error??Ze.statusText);m(p,Pt.publicKey,!0)}catch(Ze){m(b,Ze.message,!0)}finally{m(C,!1)}}async function T(){m(y,!0),m(w,"");try{const Ze=await fetch("/she/broker/ssh/test",{method:"POST",headers:{"Content-Type":"application/json"}}),Pt=await Ze.json();if(!Ze.ok)throw new Error(Pt.error??Ze.statusText);m(w,Pt.ok?"✓ Connection successful":"✗ "+(Pt.error??"Failed"),!0)}catch(Ze){m(w,"✗ "+Ze.message)}finally{m(y,!1)}}function V(Ze){navigator.clipboard.writeText(Ze).catch(()=>{})}const W=Tt(()=>c(t).identityFile&&c(t).user&&c(t).host?`ssh-copy-id -i ${c(t).identityFile}.pub ${c(t).user}@${c(t).host}`:"");var Q=Dee(),ne=_(Q);{var de=Ze=>{var Pt=Vx(),ui=_(Pt);j(()=>O(ui,c(i))),D(Ze,Pt)};z(ne,Ze=>{c(i)&&Ze(de)})}var te=v(ne,2),he=v(_(te),2),De=_(he);let oe;var ge=v(De,2);let Se;var Re=v(he,2),xe=_(Re),et=v(te,2);{var We=Ze=>{var Pt=_ee(),ui=v(_(Pt),4);{var wt=Ri=>{var Di=Vx(),Ui=_(Di);j(()=>O(Ui,c(g))),D(Ri,Di)};z(ui,Ri=>{c(g)&&Ri(wt)})}var Ft=v(ui,2);{var Vt=Ri=>{var Di=mee(),Ui=_(Di),ji=_(Ui);let Bi;var fn=_(ji),an=v(ji,4);let Zi;var _n=_(an),gt=v(Ui,2),Yt=_(gt);let Ci;var Wi=_(Yt),Pi=v(Yt,4);let Ti;var Oi=_(Pi);j(()=>{Bi=Bt(ji,1,"check-icon svelte-17yczfe",null,Bi,{ok:c(u).mosquittoCtrl,fail:!c(u).mosquittoCtrl}),O(fn,c(u).mosquittoCtrl?"✓":"✗"),Zi=Bt(an,1,"check-note svelte-17yczfe",null,Zi,{ok:c(u).mosquittoCtrl,fail:!c(u).mosquittoCtrl}),O(_n,c(u).mosquittoCtrl?"found in PATH":"not found — install the mosquitto or mosquitto-clients package"),Ci=Bt(Yt,1,"check-icon svelte-17yczfe",null,Ci,{ok:c(u).mosquitto,fail:!c(u).mosquitto}),O(Wi,c(u).mosquitto?"✓":"✗"),Ti=Bt(Pi,1,"check-note svelte-17yczfe",null,Ti,{ok:c(u).mosquitto,fail:!c(u).mosquitto}),O(Oi,c(u).mosquitto?"found in PATH":"not found — install the mosquitto package")}),D(Ri,Di)},zt=Ri=>{var Di=vee();D(Ri,Di)};z(Ft,Ri=>{c(u)?Ri(Vt):c(f)&&Ri(zt,1)})}var Zt=v(Ft,2),mt=_(Zt),Mi=_(mt);j(()=>{mt.disabled=c(f),O(Mi,c(f)?"Checking…":c(u)?"Re-check":"Check tools")}),$("click",mt,P),D(Ze,Pt)};z(et,Ze=>{c(d)==="local"&&Ze(We)})}var _e=v(et,2);{var dt=Ze=>{var Pt=wee(),ui=yt(Pt),wt=v(_(ui),4),Ft=_(wt),Vt=v(_(Ft)),zt=v(Ft,2),Zt=v(_(zt)),mt=v(zt,2),Mi=v(_(mt)),Ri=v(mt,2),Di=v(_(Ri)),Ui=v(ui,2),ji=v(_(Ui),2),Bi=v(_(ji)),fn=_(Bi),an=v(ji,2);{var Zi=yi=>{var Xe=Cee(),St=yt(Xe),Ai=v(_(St)),ki=_(Ai),fi=v(ki,2),Ii=v(St,2);{var X=qt=>{var se=bee(),Ee=v(_(se)),Le=_(Ee),Y=v(Le,2);j(()=>S1(Le,c(W))),$("click",Y,()=>V(c(W))),D(qt,se)};z(Ii,qt=>{c(W)&&qt(X)})}var Ae=v(Ii,2),qe=_(Ae),nt=_(qe);j(()=>{S1(ki,c(p)),qe.disabled=c(C),O(nt,c(C)?"Generating…":"Regenerate keypair")}),$("click",fi,()=>V(c(p))),$("click",qe,R),D(yi,Xe)},_n=yi=>{var Xe=Eee(),St=_(Xe),Ai=_(St);j(()=>{St.disabled=c(C),O(Ai,c(C)?"Generating…":"Generate keypair")}),$("click",St,R),D(yi,Xe)};z(an,yi=>{c(p)?yi(Zi):yi(_n,-1)})}var gt=v(an,2);{var Yt=yi=>{var Xe=Vx(),St=_(Xe);j(()=>O(St,c(b))),D(yi,Xe)};z(gt,yi=>{c(b)&&yi(Yt)})}var Ci=v(Ui,2),Wi=v(_(Ci),2),Pi=_(Wi),Ti=_(Pi),Oi=v(Pi,2);{var Qi=yi=>{var Xe=yee();let St;var Ai=_(Xe);j(ki=>{St=Bt(Xe,1,"test-result svelte-17yczfe",null,St,ki),O(Ai,c(w))},[()=>({ok:c(w).startsWith("✓"),fail:c(w).startsWith("✗")})]),D(yi,Xe)};z(Oi,yi=>{c(w)&&yi(Qi)})}j(()=>{ln(Di,"placeholder",c(a)),O(fn,c(t).identityFile||c(a)),Pi.disabled=c(y)||!c(t).host,O(Ti,c(y)?"Testing…":"Test SSH connection")}),jt(Vt,()=>c(t).host,yi=>c(t).host=yi),jt(Zt,()=>c(t).port,yi=>c(t).port=yi),jt(Mi,()=>c(t).user,yi=>c(t).user=yi),jt(Di,()=>c(t).identityFile,yi=>c(t).identityFile=yi),$("click",Pi,T),D(Ze,Pt)};z(_e,Ze=>{c(d)==="ssh"&&Ze(dt)})}var Wt=v(_e,2);{var tt=Ze=>{var Pt=Vx(),ui=_(Pt);j(()=>O(ui,c(r))),D(Ze,Pt)};z(Wt,Ze=>{c(r)&&Ze(tt)})}var kt=v(Wt,2);{var be=Ze=>{var Pt=See();D(Ze,Pt)};z(kt,Ze=>{c(s)&&Ze(be)})}var Rt=v(kt,2),ut=_(Rt),at=_(ut);j(()=>{oe=Bt(De,1,"svelte-17yczfe",null,oe,{active:c(d)==="local"}),Se=Bt(ge,1,"svelte-17yczfe",null,Se,{active:c(d)==="ssh"}),O(xe,c(d)==="local"?"she and mosquitto run on the same machine — local filesystem access":"mosquitto runs on a remote host — file operations go through SSH"),ut.disabled=c(n),O(at,c(n)?"Saving…":"Save")}),$("click",De,()=>{m(d,"local"),c(u)||P()}),$("click",ge,()=>m(d,"ssh")),$("click",ut,M),D(o,Q),js()}Zs(["click"]);var kee=B("<button> </button>"),Bee=B('<code>log_dest topic</code> is not enabled in mosquitto.conf.<br/> <span class="hint svelte-1yc29ow">Enable it in the <strong>Config</strong> tab, then click <em>Apply &amp; Reload</em>.</span>',1),Fee=B('<code>log_dest topic</code> is configured — waiting for messages&hellip;<br/> <span class="hint svelte-1yc29ow">If nothing appears, mosquitto may need a full restart for the change to take effect.</span>',1),Lee=B('Waiting for log messages&hellip;<br/> <span class="hint svelte-1yc29ow">Make sure <code class="svelte-1yc29ow">log_dest topic</code> is set in mosquitto.conf.</span>',1),Iee=B('<div class="empty svelte-1yc29ow"><!></div>'),Pee=B('<div class="entry svelte-1yc29ow"><span class="ts svelte-1yc29ow"> </span> <span> </span> <span class="msg svelte-1yc29ow"> </span></div>'),Tee=B('<div class="logs-page svelte-1yc29ow"><div class="toolbar svelte-1yc29ow"><div class="level-filters svelte-1yc29ow"></div> <div class="spacer svelte-1yc29ow"></div> <label class="autoscroll-label svelte-1yc29ow"><input type="checkbox" class="svelte-1yc29ow"/> <span class="checkmark svelte-1yc29ow"></span> Auto-scroll</label> <button class="btn-clear svelte-1yc29ow">Clear</button></div> <div class="log-container svelte-1yc29ow"><!></div></div>');function Mee(o,e){Vs(e,!0);const t={D:"DBG",I:"INF",N:"NTC",W:"WRN",E:"ERR"},i={D:"lvl-d",I:"lvl-i",N:"lvl-n",W:"lvl-w",E:"lvl-e"},n=new Set(["D","I","N","W","E"]);let s=I(Ei([])),r=I(!0),a=I(Ei(new Set(["D","I","N","W","E"]))),d=I(void 0),u=I(!1),f=I(null),g=null;Ks(async()=>{const te=await aU().catch(()=>[]),he=jU(),De=new Set,oe=[...te,...he].filter(ge=>n.has(ge.level)).map(ge=>({ts:ge.ts,level:ge.level,msg:ge.msg}));oe.sort((ge,Se)=>ge.ts-Se.ts),m(s,oe.filter(ge=>{const Se=`${ge.ts}\0${ge.msg}`;return De.has(Se)?!1:(De.add(Se),!0)}).slice(-500),!0),c(s).length>0&&(m(u,!0),ul().then(p)),g=ar("brokerLog",ge=>{n.has(ge.level)&&(m(u,!0),m(s,[...c(s).slice(-499),{ts:ge.ts,level:ge.level,msg:ge.msg}],!0),c(r)&&ul().then(p))}),rS().then(ge=>{const Se=ge.managed.log_dest,Re=Array.isArray(Se)?Se:Se?[Se]:[];m(f,Re.includes("topic"),!0)}).catch(()=>{m(f,null)})}),Tp(()=>{g==null||g()});function p(){c(d)&&(c(d).scrollTop=c(d).scrollHeight)}function C(te){const he=new Set(c(a));he.has(te)?he.delete(te):he.add(te),m(a,he,!0)}function b(){m(s,[],!0),m(u,!1)}let y=Tt(()=>c(s).filter(te=>c(a).has(te.level)));function w(te){const he=new Date(te);return he.toTimeString().slice(0,8)+"."+String(he.getMilliseconds()).padStart(3,"0")}var A=Tee(),P=_(A),M=_(P);ei(M,20,()=>["D","I","N","W","E"],Ni,(te,he)=>{var De=kee();let oe;var ge=_(De);j(Se=>{oe=Bt(De,1,`lvl-btn ${i[he]??""}`,"svelte-1yc29ow",oe,Se),ln(De,"title",`Toggle ${he??""} messages`),O(ge,t[he])},[()=>({active:c(a).has(he)})]),$("click",De,()=>C(he)),D(te,De)});var R=v(M,4),T=_(R),V=v(R,2),W=v(P,2),Q=_(W);{var ne=te=>{var he=Iee(),De=_(he);{var oe=Se=>{var Re=Es(),xe=yt(Re);{var et=dt=>{var Wt=Bee();D(dt,Wt)},We=dt=>{var Wt=Fee();D(dt,Wt)},_e=dt=>{var Wt=Lee();D(dt,Wt)};z(xe,dt=>{c(f)===!1?dt(et):c(f)===!0?dt(We,1):dt(_e,-1)})}D(Se,Re)},ge=Se=>{var Re=_o("No messages match the current filter.");D(Se,Re)};z(De,Se=>{c(u)?Se(ge,-1):Se(oe)})}D(te,he)},de=te=>{var he=Es(),De=yt(he);ei(De,17,()=>c(y),oe=>oe.ts+oe.msg,(oe,ge)=>{var Se=Pee(),Re=_(Se),xe=_(Re),et=v(Re,2),We=_(et),_e=v(et,2),dt=_(_e);j(Wt=>{O(xe,Wt),Bt(et,1,`badge ${i[c(ge).level]??""}`,"svelte-1yc29ow"),O(We,t[c(ge).level]),O(dt,c(ge).msg)},[()=>w(c(ge).ts)]),D(oe,Se)}),D(te,he)};z(Q,te=>{c(y).length===0?te(ne):te(de,-1)})}us(W,te=>m(d,te),()=>c(d)),Cs(T,()=>c(r),te=>m(r,te)),$("click",V,b),D(o,A),js()}Zs(["click"]);var Ree=B('<div class="err svelte-d31be1"> </div>'),Nee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1">This wizard will configure the <strong>Mosquitto Dynamic Security plugin</strong> for use with she. It will:</p> <ul class="svelte-d31be1"><li>Create a <code class="svelte-d31be1">she-admin</code> service account with a random strong password.</li> <li>Write <code class="svelte-d31be1">dynamic-security.json</code> to your mosquitto config directory.</li> <li>Add the <code class="svelte-d31be1">plugin</code> line to <code class="svelte-d31be1">mosquitto.conf</code>.</li> <li>Ask you to restart mosquitto to activate the plugin.</li></ul> <p class="hint svelte-d31be1">In <strong>remote mode</strong> (SSH host configured), <code class="svelte-d31be1">mosquitto_ctrl</code> is invoked on the broker host via SSH. In local mode, it must be installed on this machine. <code class="svelte-d31be1">mosquitto_ctrl</code> is part of the <code class="svelte-d31be1">mosquitto</code> package.</p> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Start</button></div></div>'),Oee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1"> </p></div>'),Hee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1">dynsec is not yet active. Configure bootstrap settings:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" placeholder="(leave blank to auto-generate)" class="svelte-d31be1"/></label> <label class="svelte-d31be1">Mosquitto config directory<input class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1"> </button></div></div>'),Wee=B('<p class="hint svelte-d31be1">Restarting mosquitto… this may take a few seconds.</p>'),zee=B(`<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec files written and credentials saved.</div> <p class="svelte-d31be1">The <code class="svelte-d31be1">plugin</code> line has been added to <code class="svelte-d31be1"> </code>.</p> <p class="svelte-d31be1">Enabling a new plugin requires a <strong>full mosquitto restart</strong> (not just SIGHUP):</p> <div class="actions svelte-d31be1"><button class="btn-warn svelte-d31be1"> </button> <button class="skip-step svelte-d31be1">Skip (I'll restart manually)</button></div> <!></div>`),Vee=B('<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec is configured and connected.</div> <p class="svelte-d31be1">she is now managing broker users and ACLs via the Dynamic Security plugin. You can use the <strong>Users & Roles</strong> tab to add users, create roles, and define ACL rules.</p> <div class="actions svelte-d31be1"><button class="btn-primary svelte-d31be1">Done</button></div></div>'),jee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1">Enter the credentials of an existing dynsec admin account:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Back</button> <button class="btn-primary svelte-d31be1"> </button></div></div>'),$ee=B('<div class="wizard svelte-d31be1"><div class="wizard-header svelte-d31be1"><h3 class="svelte-d31be1">dynsec Setup Wizard</h3> <button class="skip-btn svelte-d31be1">Manual setup instead</button></div> <!> <!></div>');function Uee(o,e){Vs(e,!0);let t=I("intro"),i=I(""),n=I(!1),s=I("she-admin"),r=I(""),a=I("/etc/mosquitto"),d=I(null),u=I(!1),f=I(!1),g=I("she-admin"),p=I(""),C=I(!1);async function b(){m(n,!0),m(i,"");try{(await(await fetch("/she/broker/wizard/probe",{method:"POST",headers:{"Content-Type":"application/json"}})).json()).active?m(t,"done"):m(t,"config")}catch(oe){m(i,oe.message,!0)}finally{m(n,!1)}}async function y(){m(n,!0),m(i,"");try{const oe=await fetch("/she/broker/wizard/bootstrap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminUsername:c(s),adminPassword:c(r)||void 0,configDir:c(a)})}),ge=await oe.json();if(!oe.ok||!ge.ok)throw new Error(ge.error??"Bootstrap failed");m(d,ge,!0);const Se=await Il(),Re=Se.broker??{};await ap({...Se,broker:{...Re,dynsec:{adminUsername:ge.adminUsername,adminPassword:ge.adminPassword}}}),await dU().catch(()=>{}),m(t,"restart")}catch(oe){m(i,oe.message,!0)}finally{m(n,!1)}}async function w(){m(f,!0),m(i,"");try{await lU(),await new Promise(oe=>setTimeout(oe,2e3)),m(u,!0),m(t,"done")}catch(oe){m(i,oe.message,!0)}finally{m(f,!1)}}async function A(){m(C,!0),m(i,"");try{const oe=await Il(),ge=oe.broker??{};await ap({...oe,broker:{...ge,dynsec:{adminUsername:c(g),adminPassword:c(p)}}}),m(t,"done")}catch(oe){m(i,oe.message,!0)}finally{m(C,!1)}}var P=$ee(),M=_(P),R=v(_(M),2),T=v(M,2);{var V=oe=>{var ge=Ree(),Se=_(ge);j(()=>O(Se,c(i))),D(oe,ge)};z(T,oe=>{c(i)&&oe(V)})}var W=v(T,2);{var Q=oe=>{var ge=Nee(),Se=v(_(ge),6),Re=_(Se);j(()=>Re.disabled=c(n)),$("click",Re,()=>{m(t,"probe"),b()}),D(oe,ge)},ne=oe=>{var ge=Oee(),Se=_(ge),Re=_(Se);j(()=>O(Re,c(n)?"Probing dynsec…":"Checking dynsec status…")),D(oe,ge)},de=oe=>{var ge=Hee(),Se=v(_(ge),2),Re=v(_(Se)),xe=v(Se,2),et=v(_(xe)),We=v(xe,2),_e=v(_(We)),dt=v(We,2),Wt=_(dt),tt=_(Wt);j(()=>{Wt.disabled=c(n)||!c(s),O(tt,c(n)?"Bootstrapping…":"Bootstrap dynsec")}),jt(Re,()=>c(s),kt=>m(s,kt)),jt(et,()=>c(r),kt=>m(r,kt)),jt(_e,()=>c(a),kt=>m(a,kt)),$("click",Wt,y),D(oe,ge)},te=oe=>{var ge=zee(),Se=v(_(ge),2),Re=v(_(Se),3),xe=_(Re),et=v(Se,4),We=_(et),_e=_(We),dt=v(We,2),Wt=v(et,2);{var tt=kt=>{var be=Wee();D(kt,be)};z(Wt,kt=>{c(f)&&kt(tt)})}j(()=>{O(xe,c(d).confFilePath),We.disabled=c(f),O(_e,c(f)?"Restarting…":"Restart mosquitto now")}),$("click",We,w),$("click",dt,()=>{m(t,"done")}),D(oe,ge)},he=oe=>{var ge=Vee(),Se=v(_(ge),4),Re=_(Se);$("click",Re,function(...xe){var et;(et=e.onDone)==null||et.apply(this,xe)}),D(oe,ge)},De=oe=>{var ge=jee(),Se=v(_(ge),2),Re=v(_(Se)),xe=v(Se,2),et=v(_(xe)),We=v(xe,2),_e=_(We),dt=v(_e,2),Wt=_(dt);j(()=>{dt.disabled=c(C)||!c(g)||!c(p),O(Wt,c(C)?"Saving…":"Save credentials")}),jt(Re,()=>c(g),tt=>m(g,tt)),jt(et,()=>c(p),tt=>m(p,tt)),$("click",_e,()=>m(t,"intro")),$("click",dt,A),D(oe,ge)};z(W,oe=>{c(t)==="intro"?oe(Q):c(t)==="probe"?oe(ne,1):c(t)==="config"?oe(de,2):c(t)==="restart"&&c(d)?oe(te,3):c(t)==="done"?oe(he,4):c(t)==="manual"&&oe(De,5)})}$("click",R,()=>m(t,"manual")),D(o,P),js()}Zs(["click"]);var qee=B('<div class="loading svelte-zuhcpo">Loading…</div>'),Gee=B('<div class="error-banner svelte-zuhcpo"> </div>'),Kee=B('<div class="conn-row svelte-zuhcpo"><span></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span><!></span> <button class="btn-deactivate svelte-zuhcpo"> </button></div>'),Zee=B('<button class="btn-wizard-inline svelte-zuhcpo">Setup Wizard ↗</button>'),Xee=B('<div class="conn-row svelte-zuhcpo"><span class="dot dot-off svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span class="conn-detail muted svelte-zuhcpo">not configured</span> <!></div>'),Yee=B('<div class="error-inline svelte-zuhcpo"> </div>'),Qee=B('<button class="diag-btn svelte-zuhcpo"> </button>'),XA=B('<p class="diag-issue svelte-zuhcpo"> </p>'),Jee=B('<p class="diag-ok-msg svelte-zuhcpo">✓ dynamic-security.json looks correct. Verify mosquitto restarted with the plugin loaded.</p>'),ete=B('<p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">File</span><code class="svelte-zuhcpo"> </code></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Admin user exists</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Has admin role</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">$CONTROL publish ACL</span><span> </span></p> <!> <!>',1),tte=B('<div><!></div> <button class="diag-btn svelte-zuhcpo" style="margin-top:6px"> </button>',1),ite=B('<button class="wizard-btn svelte-zuhcpo">Run Setup Wizard</button>'),nte=B('<div class="diag-area svelte-zuhcpo"><!> <!></div>'),ste=B('<div class="stats-block svelte-zuhcpo"><dl class="svelte-zuhcpo"><dt class="svelte-zuhcpo">Version</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Uptime</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Clients</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Messages</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Topics</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Traffic</dt><dd class="svelte-zuhcpo"> </dd></dl></div>'),ote=B('<div style="margin-top: 20px;"><!></div>'),rte=B('<div class="status-layout svelte-zuhcpo"><div class="conn-block svelte-zuhcpo"><div class="conn-row svelte-zuhcpo"><span class="dot ok svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">mosquitto</span> <span class="conn-detail svelte-zuhcpo"> </span></div> <!> <!></div> <!> <!></div> <!>',1),ate=B('<div class="tab-content svelte-zuhcpo"><!></div>'),lte=B('<div class="broker-page svelte-zuhcpo"><div class="sub-nav svelte-zuhcpo"><button>Status</button> <button>Directory</button> <button>Config</button> <button>Listeners</button> <button>Certificates</button> <button>Connection</button> <button>Logs</button></div> <!></div> <!>',1);function cte(o,e){Vs(e,!0);let t=I(!1),i,n=I(!1),s=I(""),r=I(!1),a=I(null);const d="she-broker-tab";let u=I(Ei(localStorage.getItem(d)??"status"));$n(()=>{localStorage.setItem(d,c(u))});let f=I(null),g=I(""),p=I(!0);async function C(){try{m(f,await oS(),!0),m(g,"")}catch(at){m(g,at.message??"Failed to load broker status",!0)}finally{m(p,!1)}}Ks(()=>{C();const at=setInterval(C,1e4);return()=>clearInterval(at)});async function b(){m(r,!0),m(a,null);try{m(a,await uU(),!0)}catch(at){m(a,{ok:!1,dynSecPath:"",issues:[at.message??"Diagnose request failed"]},!0)}finally{m(r,!1)}}async function y(){if(await i.show("Remove dynsec plugin lines from mosquitto.conf and clear credentials? You will need to restart mosquitto afterwards.",{confirm:"Deactivate",danger:!0})){m(n,!0),m(s,"");try{await cU(),await C()}catch(at){m(s,at.message??"Deactivate failed",!0)}finally{m(n,!1)}}}function w(at){var Pt;if(!((Pt=c(f))!=null&&Pt.sys))return"—";const Ze=c(f).sys[at];return Ze?String(Ze.val??"—"):"—"}function A(at){if(at==="—")return at;const Ze=at.match(/^(\d+)/),Pt=Ze?parseInt(Ze[1]):NaN;if(isNaN(Pt))return at;const ui=Math.floor(Pt/86400),wt=Math.floor(Pt%86400/3600),Ft=Math.floor(Pt%3600/60),Vt=Pt%60,zt=Zt=>String(Zt).padStart(2,"0");return ui>0?`${ui}d ${zt(wt)}:${zt(Ft)}:${zt(Vt)}`:`${zt(wt)}:${zt(Ft)}:${zt(Vt)}`}function P(at){if(at==="—")return at;const Ze=parseInt(at);return isNaN(Ze)?at:Ze<1024?`${Ze} B`:Ze<1048576?`${(Ze/1024).toFixed(1)} KB`:Ze<1073741824?`${(Ze/1048576).toFixed(1)} MB`:`${(Ze/1073741824).toFixed(1)} GB`}var M=lte(),R=yt(M),T=_(R),V=_(T);let W;var Q=v(V,2);let ne;var de=v(Q,2);let te;var he=v(de,2);let De;var oe=v(he,2);let ge;var Se=v(oe,2);let Re;var xe=v(Se,2);let et;var We=v(T,2);{var _e=at=>{var Ze=ate(),Pt=_(Ze);{var ui=Vt=>{var zt=qee();D(Vt,zt)},wt=Vt=>{var zt=Gee(),Zt=_(zt);j(()=>O(Zt,c(g))),D(Vt,zt)},Ft=Vt=>{var zt=rte(),Zt=yt(zt),mt=_(Zt),Mi=_(mt),Ri=v(_(Mi),4),Di=_(Ri),Ui=v(Mi,2);{var ji=Ti=>{var Oi=Kee(),Qi=_(Oi);let yi;var Xe=v(Qi,4);let St;var Ai=_(Xe);{var ki=qe=>{var nt=_o("plugin active");D(qe,nt)},fi=qe=>{var nt=_o("connected — plugin not responding");D(qe,nt)},Ii=qe=>{var nt=_o("disconnected");D(qe,nt)};z(Ai,qe=>{c(f).dynsec.dynsecReady?qe(ki):c(f).dynsec.connected?qe(fi,1):qe(Ii,-1)})}var X=v(Xe,2),Ae=_(X);j(()=>{yi=Bt(Qi,1,"dot svelte-zuhcpo",null,yi,{ok:c(f).dynsec.dynsecReady,warn:c(f).dynsec.connected&&!c(f).dynsec.dynsecReady,"dot-err":!c(f).dynsec.connected}),St=Bt(Xe,1,"conn-detail svelte-zuhcpo",null,St,{ok:c(f).dynsec.dynsecReady,warn:c(f).dynsec.connected&&!c(f).dynsec.dynsecReady,err:!c(f).dynsec.connected}),X.disabled=c(n),O(Ae,c(n)?"…":"deactivate")}),$("click",X,y),D(Ti,Oi)},Bi=Ti=>{var Oi=Xee(),Qi=v(_(Oi),6);{var yi=Xe=>{var St=Zee();$("click",St,()=>m(t,!0)),D(Xe,St)};z(Qi,Xe=>{c(t)||Xe(yi)})}D(Ti,Oi)};z(Ui,Ti=>{c(f).dynsec.configured?Ti(ji):Ti(Bi,-1)})}var fn=v(Ui,2);{var an=Ti=>{var Oi=Yee(),Qi=_(Oi);j(()=>O(Qi,c(s))),D(Ti,Oi)};z(fn,Ti=>{c(s)&&Ti(an)})}var Zi=v(mt,2);{var _n=Ti=>{var Oi=nte(),Qi=_(Oi);{var yi=ki=>{var fi=Qee(),Ii=_(fi);j(()=>{fi.disabled=c(r),O(Ii,c(r)?"Running diagnostics…":"Run diagnostics")}),$("click",fi,b),D(ki,fi)},Xe=ki=>{var fi=tte(),Ii=yt(fi);let X;var Ae=_(Ii);{var qe=Ee=>{var Le=XA(),Y=_(Le);j(()=>O(Y,`⚠ ${c(a).error??""}`)),D(Ee,Le)},nt=Ee=>{var Le=ete(),Y=yt(Le),Oe=v(_(Y)),Ve=_(Oe),ye=v(Y,2),At=v(_(ye)),Ot=_(At),ri=v(ye,2),oi=v(_(ri)),xi=_(oi),Ut=v(ri,2),mi=v(_(Ut)),He=_(mi),Ye=v(Ut,2);ei(Ye,17,()=>c(a).issues,Ni,(gi,Jt)=>{var fe=XA(),Ke=_(fe);j(()=>O(Ke,`⚠ ${c(Jt)??""}`)),D(gi,fe)});var Qt=v(Ye,2);{var Gt=gi=>{var Jt=Jee();D(gi,Jt)};z(Qt,gi=>{c(a).ok&&gi(Gt)})}j(()=>{O(Ve,c(a).dynSecPath),Bt(At,1,sg(c(a).adminClientExists?"ok":"fail"),"svelte-zuhcpo"),O(Ot,c(a).adminClientExists?"✓ yes":"✗ no"),Bt(oi,1,sg(c(a).hasAdminRole?"ok":"fail"),"svelte-zuhcpo"),O(xi,c(a).hasAdminRole?"✓ yes":"✗ no"),Bt(mi,1,sg(c(a).hasControlSendAcl?"ok":"fail"),"svelte-zuhcpo"),O(He,c(a).hasControlSendAcl?"✓ present":"✗ missing")}),D(Ee,Le)};z(Ae,Ee=>{c(a).error?Ee(qe):Ee(nt,-1)})}var qt=v(Ii,2),se=_(qt);j(()=>{X=Bt(Ii,1,"diag-card svelte-zuhcpo",null,X,{"diag-ok":c(a).ok,"diag-fail":!c(a).ok}),qt.disabled=c(r),O(se,c(r)?"Running…":"Re-run")}),$("click",qt,b),D(ki,fi)};z(Qi,ki=>{c(a)?ki(Xe,-1):ki(yi)})}var St=v(Qi,2);{var Ai=ki=>{var fi=ite();$("click",fi,()=>m(t,!0)),D(ki,fi)};z(St,ki=>{c(t)||ki(Ai)})}D(Ti,Oi)};z(Zi,Ti=>{c(f).dynsec.configured&&c(f).dynsec.connected&&!c(f).dynsec.dynsecReady&&Ti(_n)})}var gt=v(Zi,2);{var Yt=Ti=>{var Oi=ste(),Qi=_(Oi),yi=v(_(Qi)),Xe=_(yi),St=v(yi,3),Ai=_(St),ki=v(St,3),fi=_(ki),Ii=v(ki,3),X=_(Ii),Ae=v(Ii,3),qe=_(Ae),nt=v(Ae,3),qt=_(nt);j((se,Ee,Le,Y,Oe,Ve,ye,At,Ot,ri,oi,xi)=>{O(Xe,se),O(Ai,Ee),O(fi,`${Le??""} connected · ${Y??""} max · ${Oe??""} total`),O(X,`${Ve??""} rcv · ${ye??""} sent · ${At??""} stored`),O(qe,`${Ot??""} retained · ${ri??""} subscriptions`),O(qt,`${oi??""} in · ${xi??""} out`)},[()=>w("$SYS/broker/version"),()=>A(w("$SYS/broker/uptime")),()=>w("$SYS/broker/clients/connected"),()=>w("$SYS/broker/clients/maximum"),()=>w("$SYS/broker/clients/total"),()=>w("$SYS/broker/messages/received"),()=>w("$SYS/broker/messages/sent"),()=>w("$SYS/broker/messages/stored"),()=>w("$SYS/broker/retained messages/count"),()=>w("$SYS/broker/subscriptions/count"),()=>P(w("$SYS/broker/bytes/received")),()=>P(w("$SYS/broker/bytes/sent"))]),D(Ti,Oi)},Ci=Tt(()=>Object.keys(c(f).sys).length>0);z(gt,Ti=>{c(Ci)&&Ti(Yt)})}var Wi=v(Zt,2);{var Pi=Ti=>{var Oi=ote(),Qi=_(Oi);Uee(Qi,{onDone:()=>{m(t,!1),C()}}),D(Ti,Oi)};z(Wi,Ti=>{c(t)&&(!c(f).dynsec.configured||!c(f).dynsec.dynsecReady)&&Ti(Pi)})}j(()=>O(Di,c(f).sshConfigured?`ssh — ${c(f).sshHost}`:"local")),D(Vt,zt)};z(Pt,Vt=>{c(p)?Vt(ui):c(g)?Vt(wt,1):c(f)&&Vt(Ft,2)})}D(at,Ze)},dt=at=>{{let Ze=Tt(()=>{var Pt;return((Pt=c(f))==null?void 0:Pt.dynsec.dynsecReady)??!1});BJ(at,{get dynsecReady(){return c(Ze)}})}},Wt=at=>{ZJ(at,{})},tt=at=>{jJ(at,{})},kt=at=>{xee(at,{})},be=at=>{Aee(at,{})},Rt=at=>{Mee(at,{})};z(We,at=>{c(u)==="status"?at(_e):c(u)==="users"?at(dt,1):c(u)==="brokerconfig"?at(Wt,2):c(u)==="listeners"?at(tt,3):c(u)==="certs"?at(kt,4):c(u)==="ssh"?at(be,5):c(u)==="logs"&&at(Rt,6)})}var ut=v(R,2);us(qc(ut,{}),at=>i=at,()=>i),j(()=>{W=Bt(V,1,"svelte-zuhcpo",null,W,{active:c(u)==="status"}),ne=Bt(Q,1,"svelte-zuhcpo",null,ne,{active:c(u)==="users"}),te=Bt(de,1,"svelte-zuhcpo",null,te,{active:c(u)==="brokerconfig"}),De=Bt(he,1,"svelte-zuhcpo",null,De,{active:c(u)==="listeners"}),ge=Bt(oe,1,"svelte-zuhcpo",null,ge,{active:c(u)==="certs"}),Re=Bt(Se,1,"svelte-zuhcpo",null,Re,{active:c(u)==="ssh"}),et=Bt(xe,1,"svelte-zuhcpo",null,et,{active:c(u)==="logs"})}),$("click",V,()=>m(u,"status")),$("click",Q,()=>m(u,"users")),$("click",de,()=>m(u,"brokerconfig")),$("click",he,()=>m(u,"listeners")),$("click",oe,()=>m(u,"certs")),$("click",Se,()=>m(u,"ssh")),$("click",xe,()=>m(u,"logs")),D(o,M),js()}Zs(["click"]);var dte=B('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),ute=B('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),hte=B('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),fte=B('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),gte=B('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),pte=B('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),xte=B('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),mte=B('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),vte=B('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),_te=B('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),bte=B('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Cte=B('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),Ete=B('<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>'),yte=B('<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>'),wte=B('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Ste=B('<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),Dte=B('<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),Ate=B('<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></dl>'),kte=B('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Bte=B('<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>'),Fte=B('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Lte=B('<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>'),Ite=B('<div class="shell svelte-1n46o8q"><nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><circle cx="8" cy="10" r="2" class="svelte-1n46o8q"></circle><path d="M5,7 A4,4 0,0,1 11,7" class="svelte-1n46o8q"></path><path d="M3,5 A6.5,6.5 0,0,1 13,5" class="svelte-1n46o8q"></path><line x1="8" y1="12" x2="8" y2="15" class="svelte-1n46o8q"></line></svg> Broker</button> <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> <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> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),Pte=B('<div class="login-error svelte-1n46o8q"> </div>'),Tte=B('<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>'),Mte=B('<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>'),Rte=B('<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>'),Nte=B("<!> <!> <!> <!>",1);function Ote(o,e){Vs(e,!0);const t=["scripts","mqtt","matter","security","db","logs","config","packages"];function i(){const ut=location.hash.slice(1);return t.includes(ut)?ut:"scripts"}let n=I(Ei(i())),s=I(null),r=I(!1),a=I(!1),d=I(!1),u=I(!1),f=I("none"),g=I(""),p=I(!1),C=I(""),b=I(""),y=I(!1),w=I(!1);B$(()=>{m(p,!0)});async function A(){m(b,""),m(y,!0);try{await I$(c(C)),m(C,""),m(p,!1)}catch(ut){m(b,ut.message??"Login failed",!0)}finally{m(y,!1)}}async function P(){if(c(f)==="proxy"&&c(g)){window.location.href=c(g);return}await P$(),m(p,!0)}let M=I(null),R=I(!1),T=I(!1),V=I(!1),W=I(!1),Q=I(Ei([])),ne=I(0),de=I(Ei([]));const te=Tt(()=>c(de).filter(ut=>ut.online).length),he=Tt(()=>c(de).length===0?"none":c(te)===c(de).length?"all":c(te)>0?"some":"offline");let De=I(!1),oe=I(!1);async function ge(){if(!await c(M).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;m(R,!0);let ut;try{ut=(await Xf()).startedAt}catch{}try{await dF()}catch{}const at=Date.now()+6e4;for(;Date.now()<at;){await new Promise(Ze=>setTimeout(Ze,250));try{const Ze=await Xf();if(ut===void 0||Ze.startedAt!==ut){location.reload();return}}catch{}}location.reload()}async function Se(){m(d,!0);try{const ut=await H$();c(s)&&m(s,{...c(s),latestVersion:ut.latestVersion??void 0},!0)}catch{}finally{m(d,!1)}}async function Re(){var Ze,Pt;if(!await c(M).show(`Update to v${(Ze=c(s))==null?void 0:Ze.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;m(a,!1),m(u,!0);const ut=(Pt=c(s))==null?void 0:Pt.startedAt;try{await O$()}catch{}const at=Date.now()+18e4;for(;Date.now()<at;){await new Promise(ui=>setTimeout(ui,1e3));try{const ui=await Xf();if(ut===void 0||ui.startedAt!==ut){location.reload();return}}catch{m(u,!1),m(R,!0)}}location.reload()}function xe(ut){m(n,ut,!0),location.hash=ut}Ks(async()=>{location.hash||(location.hash=c(n));const ut=()=>{m(n,i(),!0)};window.addEventListener("hashchange",ut);try{const zt=await L$();m(f,zt.mode,!0),m(g,zt.proxyLogoutUrl??"",!0),c(f)==="password"&&(await fetch("/she/scripts")).status===401&&m(p,!0)}catch{}m(w,!0);async function at(){try{m(s,await Xf(),!0)}catch{}try{const[zt,Zt]=await Promise.all([fF(),Il()]);m(Q,Array.isArray(Zt.pinnedPackages)?Zt.pinnedPackages:[],!0),m(ne,Object.keys(zt).filter(mt=>!c(Q).includes(mt)).length,!0)}catch{}}at();const Ze=setInterval(at,5e3),Pt=ar("mqtt:status",zt=>{zt.connected===!1?(m(W,!0),m(T,!1),m(V,!1)):(m(W,!1),m(T,zt.ready===!1),m(V,zt.ready===!0))}),ui=ar("matter:deviceList",zt=>{Array.isArray(zt.devices)&&m(de,zt.devices.map(Zt=>({nodeId:String(Zt.nodeId),online:!!Zt.online})),!0)}),wt=ar("matter:deviceStatus",zt=>{if(zt.nodeId===void 0)return;const Zt=String(zt.nodeId),mt=!!zt.online;m(de,c(de).map(Mi=>Mi.nodeId===Zt?{...Mi,online:mt}:Mi),!0)}),Ft=yF();m(De,Ft.some(zt=>zt.level==="error"),!0),m(oe,!c(De)&&Ft.some(zt=>zt.level==="warn"),!0);const Vt=lS(zt=>{zt.level==="error"?(m(De,!0),m(oe,!1)):zt.level==="warn"&&!c(De)&&m(oe,!0)});return()=>{window.removeEventListener("hashchange",ut),clearInterval(Ze),Pt(),ui(),wt(),Vt()}});var et=Nte();fs("click",Jk,()=>{c(r)&&m(r,!1),c(a)&&m(a,!1)});var We=yt(et);{var _e=ut=>{var at=Ite(),Ze=_(at),Pt=v(_(Ze),2);let ui;var wt=v(Pt,2);let Ft;var Vt=v(_(wt),2);{var zt=Z=>{var J=dte();j(()=>ln(J,"title",`${c(ne)??""} package update${c(ne)===1?"":"s"} available`)),D(Z,J)};z(Vt,Z=>{c(ne)>0&&Z(zt)})}var Zt=v(wt,2);let mt;var Mi=v(_(Zt),2);{var Ri=Z=>{var J=ute();D(Z,J)},Di=Z=>{var J=hte();D(Z,J)},Ui=Z=>{var J=fte();D(Z,J)};z(Mi,Z=>{c(W)?Z(Ri):c(T)?Z(Di,1):c(V)&&Z(Ui,2)})}var ji=v(Zt,2);let Bi;var fn=v(ji,2);let an;var Zi=v(_(fn),2);{var _n=Z=>{var J=gte();D(Z,J)},gt=Z=>{var J=pte();D(Z,J)},Yt=Z=>{var J=xte();D(Z,J)};z(Zi,Z=>{c(he)==="all"?Z(_n):c(he)==="some"?Z(gt,1):c(he)==="offline"&&Z(Yt,2)})}var Ci=v(fn,2);let Wi;var Pi=v(Ci,2);let Ti;var Oi=v(_(Pi),2);{var Qi=Z=>{var J=mte();D(Z,J)},yi=Z=>{var J=vte();D(Z,J)};z(Oi,Z=>{c(De)?Z(Qi):c(oe)&&Z(yi,1)})}var Xe=v(Pi,4),St=v(_(Xe),2),Ai=_(St),ki=_(Ai);ki.nodeValue="v1.10.1 ";var fi=v(ki);{var Ii=Z=>{var J=_te();D(Z,J)};z(fi,Z=>{var J,ce;(J=c(s))!=null&&J.latestVersion&&!((ce=c(s))!=null&&ce.docker)&&Z(Ii)})}var X=v(Ai,2);{var Ae=Z=>{var J=yte(),ce=_(J),Qe=v(_(ce));Qe.textContent="v1.10.1";var ae=v(Qe,2);{var pe=Pe=>{var ke=bte(),Ct=v(yt(ke)),vt=_(Ct);j(()=>O(vt,`v${c(s).latestVersion??""}`)),D(Pe,ke)},Te=Pe=>{var ke=Cte();D(Pe,ke)};z(ae,Pe=>{var ke;(ke=c(s))!=null&&ke.latestVersion?Pe(pe):Pe(Te,-1)})}var me=v(ce,2),Ie=_(me);{var lt=Pe=>{var ke=Ete(),Ct=v(_(ke));j(()=>O(Ct,` Update to v${c(s).latestVersion??""}`)),$("click",ke,Re),D(Pe,ke)};z(Ie,Pe=>{var ke;(ke=c(s))!=null&&ke.latestVersion&&Pe(lt)})}var G=v(Ie,2),re=_(G);let Ne;var it=v(re);j(()=>{G.disabled=c(d),Ne=Bt(re,0,"svelte-1n46o8q",null,Ne,{spinning:c(d)}),O(it,` ${c(d)?"Checking…":"Check for updates"}`)}),$("click",J,Pe=>Pe.stopPropagation()),$("click",G,Se),D(Z,J)};z(X,Z=>{var J;c(a)&&!((J=c(s))!=null&&J.docker)&&Z(Ae)})}var qe=v(St,2),nt=_(qe),qt=v(nt,2);{var se=Z=>{var J=Fte(),ce=_(J);{var Qe=Ie=>{var lt=Ate(),G=_(lt);{var re=Lt=>{const Ht=Tt(()=>Math.floor((Date.now()-c(s).startedAt)/1e3)),pt=Tt(()=>Math.floor(c(Ht)/86400)),vi=Tt(()=>Math.floor(c(Ht)%86400/3600)),wi=Tt(()=>Math.floor(c(Ht)%3600/60));var qi=wte(),Fi=v(yt(qi)),Gi=_(Fi);j(()=>O(Gi,`${c(pt)>0?c(pt)+"d ":""}${c(vi)>0||c(pt)>0?c(vi)+"h ":""}${c(wi)??""}m`)),D(Lt,qi)};z(G,Lt=>{c(s).startedAt&&Lt(re)})}var Ne=v(G,3),it=_(Ne),Pe=v(Ne,3),ke=_(Pe),Ct=v(Pe,3),vt=_(Ct),Fe=v(Ct,2);{var Dt=Lt=>{var Ht=Ste(),pt=v(yt(Ht)),vi=_(pt),wi=v(pt,3),qi=_(wi);j(()=>{O(vi,c(s).matterNodes??0),O(qi,c(s).matterEndpoints??0)}),D(Lt,Ht)};z(Fe,Lt=>{c(s).matterEnabled&&Lt(Dt)})}var Ge=v(Fe,2);{var ze=Lt=>{var Ht=Dte(),pt=v(yt(Ht)),vi=_(pt),wi=v(pt,3),qi=_(wi);j(()=>{O(vi,c(s).dbDocs??"—"),O(qi,c(s).dbViews??"—")}),D(Lt,Ht)};z(Ge,Lt=>{c(s).dbEnabled&&Lt(ze)})}var Je=v(Ge,3),bt=_(Je),$e=v(Je,3),It=_($e),Me=v($e,3),st=_(Me);j(()=>{O(it,c(s).scripts),O(ke,c(s).topics),O(vt,c(s).mqttMsgPerSec??"—"),O(bt,c(s).handlers??"—"),O(It,c(s).memMb!=null?c(s).memMb+" MB":"—"),O(st,c(s).cpuPercent!=null?c(s).cpuPercent+" %":"—")}),D(Ie,lt)},ae=Ie=>{var lt=kte();D(Ie,lt)};z(ce,Ie=>{c(s)?Ie(Qe):Ie(ae,-1)})}var pe=v(ce,2),Te=_(pe);{var me=Ie=>{var lt=Bte();$("click",lt,()=>{m(r,!1),ge()}),D(Ie,lt)};z(Te,Ie=>{var lt;(lt=c(s))!=null&&lt.docker||Ie(me)})}$("click",J,Ie=>Ie.stopPropagation()),D(Z,J)};z(qt,Z=>{c(r)&&Z(se)})}var Ee=v(qe,2);let Le;var Y=v(Ee,2);{var Oe=Z=>{var J=Lte();$("click",J,P),D(Z,J)};z(Y,Z=>{c(f)==="password"&&Z(Oe)})}var Ve=v(Ze,2),ye=_(Ve);us(qc(ye,{}),Z=>m(M,Z,!0),()=>c(M));var At=v(ye,2);let Ot;var ri=_(At);{let Z=Tt(()=>c(n)==="scripts");nZ(ri,{get active(){return c(Z)}})}var oi=v(At,2);let xi;var Ut=_(oi);KQ(Ut,{});var mi=v(oi,2);let He;var Ye=_(mi);BQ(Ye,{});var Qt=v(mi,2);let Gt;var gi=_(Qt);GY(gi,{});var Jt=v(Qt,2);let fe;var Ke=_(Jt);cte(Ke,{});var ot=v(Jt,2);let rt;var ht=_(ot);XX(ht,{});var _t=v(ot,2);let Xt;var F=_(_t);VZ(F,{});var H=v(_t,2);let K;var le=_(H);qZ(le,{}),j(()=>{ui=Bt(Pt,1,"svelte-1n46o8q",null,ui,{active:c(n)==="scripts"}),Ft=Bt(wt,1,"svelte-1n46o8q",null,Ft,{active:c(n)==="packages"}),mt=Bt(Zt,1,"svelte-1n46o8q",null,mt,{active:c(n)==="mqtt"}),Bi=Bt(ji,1,"svelte-1n46o8q",null,Bi,{active:c(n)==="security"}),an=Bt(fn,1,"svelte-1n46o8q",null,an,{active:c(n)==="matter"}),Wi=Bt(Ci,1,"svelte-1n46o8q",null,Wi,{active:c(n)==="db"}),Ti=Bt(Pi,1,"svelte-1n46o8q",null,Ti,{active:c(n)==="logs"}),Le=Bt(Ee,1,"nav-settings svelte-1n46o8q",null,Le,{active:c(n)==="config"}),Ot=Bt(At,1,"page-wrap svelte-1n46o8q",null,Ot,{hidden:c(n)!=="scripts"}),xi=Bt(oi,1,"page-wrap svelte-1n46o8q",null,xi,{hidden:c(n)!=="packages"}),He=Bt(mi,1,"page-wrap svelte-1n46o8q",null,He,{hidden:c(n)!=="mqtt"}),Gt=Bt(Qt,1,"page-wrap svelte-1n46o8q",null,Gt,{hidden:c(n)!=="matter"}),fe=Bt(Jt,1,"page-wrap svelte-1n46o8q",null,fe,{hidden:c(n)!=="security"}),rt=Bt(ot,1,"page-wrap svelte-1n46o8q",null,rt,{hidden:c(n)!=="db"}),Xt=Bt(_t,1,"page-wrap svelte-1n46o8q",null,Xt,{hidden:c(n)!=="config"}),K=Bt(H,1,"page-wrap svelte-1n46o8q",null,K,{hidden:c(n)!=="logs"})}),$("click",Pt,()=>xe("scripts")),$("click",wt,()=>xe("packages")),$("click",Zt,()=>xe("mqtt")),$("click",ji,()=>xe("security")),$("click",fn,()=>xe("matter")),$("click",Ci,()=>xe("db")),$("click",Pi,()=>{xe("logs"),m(De,!1),m(oe,!1)}),$("click",Ai,Z=>{Z.stopPropagation(),m(a,!c(a)),m(r,!1)}),$("click",nt,Z=>{Z.stopPropagation(),m(r,!c(r)),m(a,!1)}),$("click",Ee,()=>xe("config")),D(ut,at)};z(We,ut=>{c(w)&&!c(p)&&ut(_e)})}var dt=v(We,2);{var Wt=ut=>{var at=Tte(),Ze=_(at),Pt=v(_(Ze),4),ui=v(_(Pt),2),wt=v(Pt,2);{var Ft=Zt=>{var mt=Pte(),Mi=_(mt);j(()=>O(Mi,c(b))),D(Zt,mt)};z(wt,Zt=>{c(b)&&Zt(Ft)})}var Vt=v(wt,2),zt=_(Vt);j(()=>{ui.disabled=c(y),Vt.disabled=c(y)||!c(C),O(zt,c(y)?"Signing in…":"Sign in")}),fs("submit",Ze,Zt=>{Zt.preventDefault(),A()}),jt(ui,()=>c(C),Zt=>m(C,Zt)),D(ut,at)};z(dt,ut=>{c(p)&&ut(Wt)})}var tt=v(dt,2);{var kt=ut=>{var at=Mte();D(ut,at)};z(tt,ut=>{c(R)&&ut(kt)})}var be=v(tt,2);{var Rt=ut=>{var at=Rte();D(ut,at)};z(be,ut=>{c(u)&&ut(Rt)})}D(o,et),js()}Zs(["click"]);ZI(Ote,{target:document.getElementById("app")});export{I6 as t};
230
+ *[stopped]*`,toolEvents:c(te).length>0?[...c(te)]:void 0}],!0)}else m(d,H.message,!0)}finally{A=null,m(s,null),m(te,[],!0),m(a,!1)}}}function Bi(){A==null||A.abort()}function fn(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),ji())}function an(){m(n,[],!0),m(d,"")}const Zi=["Write a view to list all document IDs","Write a view to sum a numeric property across all documents","Write a view that filters to a specific prefix and emits a field","Write a reduce that returns the maximum value","Explain how the current view works"];function _n(F){m(r,F,!0),De==null||De.focus()}var gt=BX(),Yt=yt(gt),Ci=_(Yt),Wi=v(_(Ci),2);{var Pi=F=>{var H=GZ(),K=_(H);{var le=J=>{var ce=_o();j(()=>O(ce,`${c(u).provider??""} · ${(c(g)||c(u).model)??""}`)),D(J,ce)},Z=J=>{var ce=_o("Not configured");D(J,ce)};z(K,J=>{c(Se)?J(le):J(Z,-1)})}j(()=>ln(H,"title",`Provider: ${c(u).provider??""}`)),D(F,H)};z(Wi,F=>{c(u)&&F(Pi)})}var Ti=v(Wi,2);{var Oi=F=>{var H=KZ();$("click",H,an),D(F,H)};z(Ti,F=>{c(n).length>0&&F(Oi)})}var Qi=v(Ci,2),yi=_(Qi);{var Xe=F=>{var H=ZZ();D(F,H)},St=F=>{var H=QZ(),K=_(H),le=_(K);{var Z=Qe=>{var ae=XZ(),pe=v(yt(ae)),Te=_(pe);j(()=>O(Te,t().id)),D(Qe,ae)},J=Qe=>{var ae=_o("No view selected. Ask a general sheDB view question.");D(Qe,ae)};z(le,Qe=>{t()?Qe(Z):Qe(J,-1)})}var ce=v(K,2);ei(ce,17,()=>Zi,Ni,(Qe,ae)=>{var pe=YZ(),Te=_(pe);j(()=>O(Te,c(ae))),$("click",pe,()=>_n(c(ae))),D(Qe,pe)}),D(F,H)};z(yi,F=>{c(Se)?c(n).length===0&&c(s)===null&&F(St,1):F(Xe)})}var Ai=v(yi,2);ei(Ai,17,()=>c(n),Ni,(F,H,K)=>{var le=sX(),Z=_(le);{var J=Qe=>{var ae=JZ(),pe=_(ae);j(()=>O(pe,c(H).content)),D(Qe,ae)},ce=Qe=>{const ae=Tt(()=>We(c(H).content)),pe=Tt(()=>dt(c(ae)));var Te=nX(),me=yt(Te);{var Ie=Pe=>{var ke=NA();ei(ke,21,()=>c(H).toolEvents,Ni,(bt,vt)=>{var Fe=Es(),Dt=yt(Fe);{var Ge=Je=>{var Ct=MA(),$e=v(_(Ct)),It=_($e);j(Me=>O(It,Me),[()=>c(vt).name.replace(/_/g," ")]),D(Je,Ct)},ze=Je=>{var Ct=RA(),$e=v(_(Ct)),It=_($e);j(Me=>O(It,Me),[()=>c(vt).name.replace(/_/g," ")]),D(Je,Ct)};z(Dt,Je=>{c(vt).type==="tool_call"?Je(Ge):Je(ze,-1)})}D(bt,Fe)}),D(Pe,ke)};z(me,Pe=>{var ke;(ke=c(H).toolEvents)!=null&&ke.length&&Pe(Ie)})}var lt=v(me,2),G=_(lt);ei(G,17,()=>c(ae),Ni,(Pe,ke,bt)=>{var vt=Es(),Fe=yt(vt);{var Dt=ze=>{var Je=OA();ac(Je,()=>at(c(ke).text),!0),D(ze,Je)},Ge=ze=>{const Je=Tt(()=>`${K}:${bt}`),Ct=Tt(()=>be(c(ke).text)),$e=Tt(()=>c(p).has(c(Je))),It=Tt(()=>c(ke).lang==="filter");var Me=tX(),st=_(Me),Lt=_(st),Ht=_(Lt),pt=v(Lt,2),vi=_(pt),wi=v(st,2);let qi;var Fi=_(wi),Gi=_(Fi);ac(Gi,()=>ut(c(ke).text,c(ke).lang??""),!0);var Li=v(Fi,2);{var ni=ii=>{var Xi=eX(),Ji=_(Xi);j(()=>O(Ji,c($e)?"▲ collapse":"▼ expand")),$("click",Xi,()=>Rt(c(Je))),D(ii,Xi)};z(Li,ii=>{c(Ct)&&ii(ni)})}j(()=>{O(Ht,c(It)?"filter":c(ke).lang),qi=Bt(wi,1,"code-body svelte-1twuiul",null,qi,{collapsed:c(Ct)&&!c($e)})}),$("click",vi,()=>Pt(c(ke).text)),D(ze,Me)};z(Fe,ze=>{c(ke).type==="text"?ze(Dt):ze(Ge,-1)})}D(Pe,vt)});var re=v(G,2);{var Ne=Pe=>{var ke=iX(),bt=_(ke),vt=_(bt);j(Fe=>O(vt,Fe),[()=>tt(c(pe))]),$("click",bt,()=>e.onApplyView(c(pe))),D(Pe,ke)},it=Tt(()=>Wt(c(pe))&&e.onApplyView);z(re,Pe=>{c(it)&&Pe(Ne)})}D(Qe,Te)};z(Z,Qe=>{c(H).role==="user"?Qe(J):Qe(ce,-1)})}j(()=>Bt(le,1,`message ${c(H).role??""}`,"svelte-1twuiul")),D(F,le)});var ki=v(Ai,2);{var fi=F=>{var H=NA();ei(H,21,()=>c(te),Ni,(K,le)=>{var Z=Es(),J=yt(Z);{var ce=ae=>{var pe=MA(),Te=v(_(pe)),me=_(Te);j(Ie=>O(me,Ie),[()=>c(le).name.replace(/_/g," ")]),D(ae,pe)},Qe=ae=>{var pe=RA(),Te=v(_(pe)),me=_(Te);j(Ie=>O(me,Ie),[()=>c(le).name.replace(/_/g," ")]),D(ae,pe)};z(J,ae=>{c(le).type==="tool_call"?ae(ce):ae(Qe,-1)})}D(K,Z)}),D(F,H)};z(ki,F=>{c(te).length>0&&F(fi)})}var Ii=v(ki,2);{var X=F=>{var H=oX(),K=_(H),le=_(K),Z=_(le);j(()=>O(Z,M[c(P)])),D(F,H)};z(Ii,F=>{c(a)&&c(s)===null&&c(te).length===0&&F(X)})}var Ae=v(Ii,2);{var qe=F=>{var H=aX(),K=_(H);ei(K,21,()=>_e(c(s)),Ni,(le,Z)=>{var J=Es(),ce=yt(J);{var Qe=pe=>{var Te=OA();ac(Te,()=>at(c(Z).text),!0),D(pe,Te)},ae=pe=>{var Te=rX(),me=_(Te),Ie=_(me),lt=_(Ie),G=v(me,2),re=_(G);ac(re,()=>ut(c(Z).text,c(Z).lang??""),!0),j(()=>O(lt,c(Z).lang)),D(pe,Te)};z(ce,pe=>{c(Z).type==="text"?pe(Qe):pe(ae,-1)})}D(le,J)}),D(F,H)};z(Ae,F=>{c(s)!==null&&F(qe)})}us(Qi,F=>oe=F,()=>oe);var nt=v(Qi,2);{var qt=F=>{var H=lX(),K=_(H);j(()=>O(K,c(d))),D(F,H)};z(nt,F=>{c(d)&&F(qt)})}var se=v(nt,2),Ee=_(se),Le=_(Ee),Y=v(Ee,2),Oe=_(Y),Ve=v(Y,2),ye=_(Ve),At=v(Ve,2),Ot=_(At),ri=v(se,2),oi=_(ri);{var xi=F=>{var H=cX();let K;var le=v(_(H),2),Z=_(le),J=v(le,2),ce=_(J);j(()=>{K=Bt(H,1,"file-chip svelte-1twuiul",null,K,{inactive:!c(Q)}),O(Z,t().id),ln(J,"title",c(Q)?"Remove from context":"Re-add to context"),O(ce,c(Q)?"×":"+")}),$("click",J,()=>m(Q,!c(Q))),D(F,H)};z(oi,F=>{t()&&F(xi)})}var Ut=v(oi,2);ei(Ut,17,()=>c(W),Ni,(F,H,K)=>{const le=Tt(()=>Ft(c(H).name));var Z=dX(),J=_(Z),ce=_(J),Qe=v(J,2),ae=_(Qe),pe=v(Qe,2);j((Te,me)=>{Bt(J,1,`badge badge-${Te??""}`,"svelte-1twuiul"),O(ce,me),O(ae,c(H).name)},[()=>c(le).toLowerCase(),()=>Vt(c(le))]),$("click",pe,()=>zt(K)),D(F,Z)});var mi=v(Ut,2),He=v(mi,2);us(He,F=>de=F,()=>de);var Ye=v(ri,2);let Qt;var Gt=_(Ye);let gi;var Jt=_(Gt);us(Jt,F=>De=F,()=>De);var fe=v(Gt,2);{var Ke=F=>{var H=uX();$("click",H,Bi),D(F,H)},ot=F=>{var H=hX();j(K=>H.disabled=K,[()=>!c(r).trim()||!c(Se)]),$("click",H,ji),D(F,H)};z(fe,F=>{c(a)?F(Ke):F(ot,-1)})}var rt=v(Ye,2);{var ht=F=>{var H=mX(),K=_(H),le=_(K),Z=v(K,2);{var J=pe=>{var Te=gX();ei(Te,21,()=>c(f),Ni,(me,Ie)=>{var lt=fX(),G=_(lt),re={};j(()=>{O(G,c(Ie)),re!==(re=c(Ie))&&(lt.value=(lt.__value=c(Ie))??"")}),D(me,lt)}),j(()=>Te.disabled=c(a)),Fs(Te,()=>c(g),me=>m(g,me)),D(pe,Te)},ce=pe=>{var Te=pX(),me=_(Te);j(()=>O(me,c(g)||c(u).model)),D(pe,Te)};z(Z,pe=>{c(f).length>0?pe(J):pe(ce,-1)})}var Qe=v(Z,2);{var ae=pe=>{var Te=xX();$("click",Te,ui),D(pe,Te)};z(Qe,pe=>{c(u).provider==="ollama"&&pe(ae)})}j(()=>O(le,c(u).provider)),D(F,H)};z(rt,F=>{c(Se)&&c(u)&&F(ht)})}var _t=v(Yt,2);{var Xt=F=>{var H=kX(),K=_(H),le=_(K),Z=_(le),J=_(Z),ce=v(Z,2),Qe=v(le,2),ae=_(Qe);{var pe=Ie=>{var lt=vX();D(Ie,lt)},Te=Ie=>{var lt=_X(),G=_(lt);j(()=>O(G,c(w))),D(Ie,lt)},me=Ie=>{var lt=AX(),G=_(lt);{var re=ze=>{var Je=bX(),Ct=v(yt(Je)),$e=_(Ct);j(()=>O($e,c(b).version)),D(ze,Je)};z(G,ze=>{c(b).version&&ze(re)})}var Ne=v(G,2);{var it=ze=>{var Je=CX(),Ct=v(yt(Je)),$e=_(Ct);j(()=>O($e,c(b).details.family)),D(ze,Je)};z(Ne,ze=>{var Je;(Je=c(b).details)!=null&&Je.family&&ze(it)})}var Pe=v(Ne,2);{var ke=ze=>{var Je=EX(),Ct=v(yt(Je)),$e=_(Ct);j(()=>O($e,c(b).details.parameter_size)),D(ze,Je)};z(Pe,ze=>{var Je;(Je=c(b).details)!=null&&Je.parameter_size&&ze(ke)})}var bt=v(Pe,2);{var vt=ze=>{var Je=yX(),Ct=v(yt(Je)),$e=_(Ct);j(()=>O($e,c(b).details.quantization_level)),D(ze,Je)};z(bt,ze=>{var Je;(Je=c(b).details)!=null&&Je.quantization_level&&ze(vt)})}var Fe=v(bt,2);{var Dt=ze=>{var Je=SX(),Ct=v(yt(Je),2);ei(Ct,21,()=>c(b).running,Ni,($e,It)=>{var Me=wX(),st=_(Me);j(Lt=>O(st,`${c(It).name??""} · ${Lt??""} VRAM`),[()=>wt(c(It).size_vram)]),D($e,Me)}),D(ze,Je)},Ge=ze=>{var Je=DX();D(ze,Je)};z(Fe,ze=>{c(b).running&&c(b).running.length>0?ze(Dt):c(b).running!==null&&ze(Ge,1)})}D(Ie,lt)};z(ae,Ie=>{c(y)?Ie(pe):c(w)?Ie(Te,1):c(b)&&Ie(me,2)})}j(()=>{var Ie;return O(J,`Ollama · ${(c(g)||((Ie=c(u))==null?void 0:Ie.model))??""}`)}),$("click",H,()=>m(C,!1)),$("click",K,Ie=>Ie.stopPropagation()),$("click",ce,()=>m(C,!1)),D(F,H)};z(_t,F=>{c(C)&&F(Xt)})}j(F=>{O(Ot,F),Qt=Bt(Ye,1,"input-row svelte-1twuiul",null,Qt,{"drag-over":c(ne)}),gi=Bt(Gt,1,"textarea-wrap svelte-1twuiul",null,gi,{loading:c(a)}),ln(Jt,"placeholder",c(Se)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),Jt.disabled=c(a)||!c(Se)},[()=>wt(c(Re))]),Cs(Le,()=>c(R),F=>m(R,F)),Cs(Oe,()=>c(T),F=>m(T,F)),Cs(ye,()=>c(V),F=>m(V,F)),$("click",mi,Zt),$("change",He,Mi),fs("dragover",Ye,Di),fs("dragleave",Ye,Ui),fs("drop",Ye,Ri),$("keydown",Jt,fn),jt(Jt,()=>c(r),F=>m(r,F)),D(o,gt),js()}Zs(["click","change","keydown"]);var LX=B('<div class="me svelte-1pxdb1"></div>');function qC(o,e){Vs(e,!0);let t=wu(e,"value",15,""),i=wu(e,"language",3,"javascript"),n,s,r=!1;Ks(()=>{const d=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=xr.create(n,{value:t(),language:i(),theme:"vs-dark",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', monospace",automaticLayout:!0,wordWrap:"on",lineNumbers:"on",renderLineHighlight:"none",overviewRulerLanes:0,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6},...d}),s.onDidChangeModelContent(()=>{r||t(s.getValue())})}),Tp(()=>s==null?void 0:s.dispose()),$n(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=LX();us(a,d=>n=d,()=>n),D(o,a),js()}var IX=B('<!> <div class="welcome svelte-rrt0o"><div class="welcome-inner svelte-rrt0o"><div class="welcome-logo svelte-rrt0o">db</div> <p class="welcome-sub svelte-rrt0o">sheDB — embedded JSON document store with MapReduce views</p> <div class="welcome-hint svelte-rrt0o"><strong>In scripts:</strong> use <code class="svelte-rrt0o">she.db.get(id)</code>, <code class="svelte-rrt0o">she.db.set(id, doc)</code>, <code class="svelte-rrt0o">she.db.extend(id, partial)</code>, <code class="svelte-rrt0o">she.db.sub(pattern, cb)</code>.<br/> <strong>Views:</strong> <code class="svelte-rrt0o">this</code> = current document &mdash; call <code class="svelte-rrt0o">emit(value)</code> to add to result.</div> <div class="welcome-links svelte-rrt0o"><a href="https://github.com/hobbyquaker/she/blob/main/doc/db/README.md" target="_blank" rel="noopener" class="svelte-rrt0o">sheDB docs</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/db/view-examples.md" target="_blank" rel="noopener" class="svelte-rrt0o">View examples</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-rrt0o">GitHub</a></div></div></div>',1),PX=B('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button>'),HA=B('<div class="form-error svelte-rrt0o"> </div>'),TX=B('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),WA=B("<li> </li>"),zA=B('<div class="error-bar svelte-rrt0o"> </div>'),VA=B('<div class="loading svelte-rrt0o">Loading…</div>'),MX=B('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),RX=B('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),NX=B('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ Doc</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main></div>'),OX=B('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),HX=B('<label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Retain <span class="section-hint svelte-rrt0o">— send as retained MQTT message</span></label>'),WX=B('<span class="badge-error svelte-rrt0o">error</span>'),zX=B('<span class="badge-ok svelte-rrt0o"> </span>'),VX=B('<pre class="result-error svelte-rrt0o"> </pre>'),jX=B('<pre class="result-json svelte-rrt0o"> </pre>'),$X=B('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),UX=B('<div class="view-sections svelte-rrt0o"><div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Description <span class="section-hint svelte-rrt0o">— optional, shown in sidebar</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="(optional description)"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Filter <span class="section-hint svelte-rrt0o">— MQTT wildcard, optional</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="#"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Map <span class="section-hint svelte-rrt0o">— <code>this</code> = document &nbsp;·&nbsp; call <code>emit(this)</code> to include in result</span></div> <div class="monaco-view-wrap monaco-view-wrap--map svelte-rrt0o"><!></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Reduce <span class="section-hint svelte-rrt0o">— receives <code>result</code> array, must <code>return</code> new value (optional)</span></div> <div class="monaco-view-wrap monaco-view-wrap--reduce svelte-rrt0o"><!></div></div> <div class="view-section view-section--options svelte-rrt0o"><label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Publish to MQTT <span class="section-hint svelte-rrt0o">— publish view to MQTT topic <code> </code></span></label> <!></div> <!></div>'),qX=B('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button title="Re-run view" class="svelte-rrt0o">Refresh</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),GX=B('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),KX=B('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ View</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main> <!></div>'),ZX=B('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function XX(o,e){Vs(e,!0);const t=Xe=>{var St=IX(),Ai=yt(St);us(qc(Ai,{}),ki=>Vt=ki,()=>Vt),D(Xe,St)};let i=I(Ei([])),n=I(null),s=I("{}"),r=I(!1),a=I(null);const d="she-db-selected-view";let u=I(Ei([])),f=I(Ei(localStorage.getItem(d))),g=I("#"),p=I("// emit(this.someProperty)"),C=I(""),b=I(""),y=I(!1),w=I(!1),A=I(null),P=I(!1),M=I(null),R=I("she/db/view/");const T="she-db-panel";let V=I(Ei(localStorage.getItem(T)??"docs")),W=I(""),Q=I(!1),ne=I(null),de=I(""),te=I(!1),he=I(null);const De="she-db-sidebar-width";let oe=I(Ei(parseInt(localStorage.getItem(De)??"220",10))),ge=!1,Se=0,Re=0;const xe="she-db-chat-width",et="she-db-chat-open";let We=I(localStorage.getItem(et)==="true"),_e=I(Ei(parseInt(localStorage.getItem(xe)??"320",10))),dt=!1,Wt=0,tt=0;const kt=Tt(()=>c(f)?{id:c(f),filter:c(g),map:c(p),reduce:c(C)}:null);function be(Xe){Xe.filter!==void 0&&m(g,Xe.filter,!0),Xe.map!==void 0&&m(p,Xe.map,!0),Xe.reduce!==void 0&&m(C,Xe.reduce,!0)}$n(()=>{localStorage.setItem(et,String(c(We)))}),$n(()=>{localStorage.setItem(T,c(V))}),$n(()=>{c(f)?localStorage.setItem(d,c(f)):localStorage.removeItem(d)});function Rt(Xe){ge=!0,Se=Xe.clientX,Re=c(oe),Xe.preventDefault()}function ut(Xe){ge&&m(oe,Math.max(140,Math.min(500,Re+Xe.clientX-Se)),!0),dt&&m(_e,Math.max(240,Math.min(600,tt-(Xe.clientX-Wt))),!0)}function at(){ge&&(ge=!1,localStorage.setItem(De,String(c(oe)))),dt&&(dt=!1,localStorage.setItem(xe,String(c(_e))))}function Ze(Xe){dt=!0,Wt=Xe.clientX,tt=c(_e),Xe.preventDefault()}async function Pt(){try{m(i,await uF(),!0)}catch{}}async function ui(){try{m(u,await hF(),!0)}catch{}}async function wt(Xe){m(n,Xe,!0),m(a,null),m(r,!0);try{const St=await j$(Xe);m(s,JSON.stringify(St,null,2),!0)}catch(St){m(a,St instanceof Error?St.message:String(St),!0)}finally{m(r,!1)}}async function Ft(){if(c(n)){m(a,null);try{const Xe=JSON.parse(c(s));await aA(c(n),Xe)}catch(Xe){m(a,Xe instanceof Error?Xe.message:String(Xe),!0)}}}let Vt;async function zt(){if(c(n)&&await Vt.show(`Delete document "${c(n)}"?`,{confirm:"Delete",danger:!0}))try{await $$(c(n)),m(n,null),m(s,"{}")}catch(Xe){m(a,Xe instanceof Error?Xe.message:String(Xe),!0)}}async function Zt(){const Xe=c(W).trim();if(Xe){m(ne,null);try{await aA(Xe,{}),m(Q,!1),m(W,""),await wt(Xe)}catch(St){m(ne,St instanceof Error?St.message:String(St),!0)}}}async function mt(Xe){m(f,Xe,!0),m(M,null),m(P,!0),m(A,null);try{const St=await U$(Xe);m(g,St.filter??"",!0),m(p,St.map,!0),m(C,St.reduce??"",!0),m(b,St.description??"",!0),m(y,St.mqttpub??!1,!0),m(w,St.retain??!1,!0),m(A,await VC(Xe).catch(()=>null),!0)}catch(St){m(M,St instanceof Error?St.message:String(St),!0)}finally{m(P,!1)}}async function Mi(){if(c(f)){m(M,null);try{const Xe={map:c(p)};c(g).trim()&&(Xe.filter=c(g).trim()),c(C).trim()&&(Xe.reduce=c(C).trim()),c(b).trim()&&(Xe.description=c(b).trim()),c(y)&&(Xe.mqttpub=!0),c(w)&&(Xe.retain=!0),await lA(c(f),Xe)}catch(Xe){m(M,Xe instanceof Error?Xe.message:String(Xe),!0)}}}async function Ri(){if(c(f))try{m(A,await VC(c(f)),!0)}catch(Xe){m(M,Xe instanceof Error?Xe.message:String(Xe),!0)}}async function Di(){if(c(f)&&await Vt.show(`Delete view "${c(f)}"?`,{confirm:"Delete",danger:!0}))try{await q$(c(f)),m(f,null),m(g,""),m(p,"// emit(this.someProperty)"),m(C,""),m(b,""),m(y,!1),m(w,!1),m(A,null)}catch(Xe){m(M,Xe instanceof Error?Xe.message:String(Xe),!0)}}async function Ui(){if(!c(de).trim())return;const Xe=c(de).trim();m(he,null);try{await lA(Xe,{map:"// emit(this.someProperty)"}),m(te,!1),m(de,""),await ui(),await mt(Xe)}catch(St){m(he,St instanceof Error?St.message:String(St),!0)}}let ji=I(""),Bi=I(""),fn=Tt(()=>[...c(i)].filter(Xe=>!c(ji)||Xe.toLowerCase().includes(c(ji).toLowerCase())).sort()),an=Tt(()=>[...c(u)].filter(Xe=>!c(Bi)||Xe.toLowerCase().includes(c(Bi).toLowerCase())).sort());Ks(()=>{Pt(),ui().then(()=>{c(f)&&c(u).includes(c(f))?mt(c(f)):m(f,null)}),Il().then(fi=>{const Ii=fi.dbPrefix||"she/db/",X=Ii.endsWith("/")?Ii:Ii+"/";m(R,X+"view/")}).catch(()=>{});const Xe=ar("db:ids",fi=>{m(i,fi.ids??[],!0)}),St=ar("db:viewIds",fi=>{m(u,fi.ids??[],!0)}),Ai=ar("db:change",async fi=>{const Ii=fi.id;c(n)===Ii&&(fi.doc===null?(m(n,null),m(s,"{}")):m(s,JSON.stringify(fi.doc,null,2),!0))}),ki=ar("db:viewUpdate",async fi=>{const Ii=fi.id;c(f)===Ii&&m(A,await VC(Ii).catch(()=>null),!0)});return()=>{Xe(),St(),Ai(),ki()}});var Zi=ZX(),_n=_(Zi),gt=_(_n);let Yt;var Ci=v(gt,2);let Wi;var Pi=v(Ci,2);{var Ti=Xe=>{var St=PX();let Ai;j(()=>{Ai=Bt(St,1,"ai-toggle svelte-rrt0o",null,Ai,{"ai-open":c(We)}),ln(St,"title",c(We)?"Close AI assistant":"Open AI assistant")}),$("click",St,()=>m(We,!c(We))),D(Xe,St)};z(Pi,Xe=>{c(V)==="views"&&Xe(Ti)})}var Oi=v(_n,2);{var Qi=Xe=>{var St=NX(),Ai=_(St);let ki;var fi=_(Ai),Ii=_(fi),X=v(fi,2);{var Ae=Ve=>{var ye=TX(),At=yt(ye),Ot=_(At),ri=v(Ot,2),oi=v(At,2);{var xi=Ut=>{var mi=HA(),He=_(mi);j(()=>O(He,c(ne))),D(Ut,mi)};z(oi,Ut=>{c(ne)&&Ut(xi)})}$("keydown",Ot,Ut=>Ut.key==="Enter"&&Zt()),jt(Ot,()=>c(W),Ut=>m(W,Ut)),$("click",ri,Zt),D(Ve,ye)};z(X,Ve=>{c(Q)&&Ve(Ae)})}var qe=v(X,2),nt=_(qe),qt=v(qe,2);ei(qt,20,()=>c(fn),Ve=>Ve,(Ve,ye)=>{var At=WA();let Ot;var ri=_(At);j(()=>{Ot=Bt(At,1,"flat-item svelte-rrt0o",null,Ot,{"active-item":c(n)===ye}),O(ri,ye)}),$("click",At,()=>wt(ye)),D(Ve,At)});var se=v(Ai,2),Ee=v(se,2),Le=_(Ee);{var Y=Ve=>{var ye=RX(),At=yt(ye),Ot=_(At),ri=_(Ot),oi=v(Ot,2),xi=v(oi,2),Ut=v(At,2);{var mi=Gt=>{var gi=zA(),Jt=_(gi);j(()=>O(Jt,c(a))),D(Gt,gi)};z(Ut,Gt=>{c(a)&&Gt(mi)})}var He=v(Ut,2);{var Ye=Gt=>{var gi=VA();D(Gt,gi)},Qt=Gt=>{var gi=MX(),Jt=_(gi);qC(Jt,{language:"json",get value(){return c(s)},set value(fe){m(s,fe,!0)}}),D(Gt,gi)};z(He,Gt=>{c(r)?Gt(Ye):Gt(Qt,-1)})}j(()=>O(ri,c(n))),$("click",oi,Ft),$("click",xi,zt),D(Ve,ye)},Oe=Ve=>{t(Ve)};z(Le,Ve=>{c(n)?Ve(Y):Ve(Oe,-1)})}j(()=>ki=$o(Ai,"",ki,{width:`${c(oe)??""}px`})),$("click",Ii,()=>{m(Q,!c(Q)),m(ne,null)}),jt(nt,()=>c(ji),Ve=>m(ji,Ve)),$("mousedown",se,Rt),D(Xe,St)},yi=Xe=>{var St=KX(),Ai=_(St);let ki;var fi=_(Ai),Ii=_(fi),X=v(fi,2);{var Ae=At=>{var Ot=OX(),ri=yt(Ot),oi=_(ri),xi=v(oi,2),Ut=v(ri,2);{var mi=He=>{var Ye=HA(),Qt=_(Ye);j(()=>O(Qt,c(he))),D(He,Ye)};z(Ut,He=>{c(he)&&He(mi)})}$("keydown",oi,He=>He.key==="Enter"&&Ui()),jt(oi,()=>c(de),He=>m(de,He)),$("click",xi,Ui),D(At,Ot)};z(X,At=>{c(te)&&At(Ae)})}var qe=v(X,2),nt=_(qe),qt=v(qe,2);ei(qt,20,()=>c(an),At=>At,(At,Ot)=>{var ri=WA();let oi;var xi=_(ri);j(()=>{oi=Bt(ri,1,"flat-item svelte-rrt0o",null,oi,{"active-item":c(f)===Ot}),O(xi,Ot)}),$("click",ri,()=>mt(Ot)),D(At,ri)});var se=v(Ai,2),Ee=v(se,2),Le=_(Ee);{var Y=At=>{var Ot=qX(),ri=yt(Ot),oi=_(ri),xi=_(oi),Ut=v(oi,2),mi=v(Ut,2),He=v(mi,2),Ye=v(ri,2);{var Qt=fe=>{var Ke=zA(),ot=_(Ke);j(()=>O(ot,c(M))),D(fe,Ke)};z(Ye,fe=>{c(M)&&fe(Qt)})}var Gt=v(Ye,2);{var gi=fe=>{var Ke=VA();D(fe,Ke)},Jt=fe=>{var Ke=UX(),ot=_(Ke),rt=v(_(ot),2),ht=_(rt),_t=v(ot,2),Xt=v(_(_t),2),F=_(Xt),H=v(_t,2),K=v(_(H),2),le=_(K);qC(le,{language:"javascript",get value(){return c(p)},set value(it){m(p,it,!0)}});var Z=v(H,2),J=v(_(Z),2),ce=_(J);qC(ce,{language:"javascript",get value(){return c(C)},set value(it){m(C,it,!0)}});var Qe=v(Z,2),ae=_(Qe),pe=_(ae),Te=v(pe,4),me=v(_(Te)),Ie=_(me),lt=v(ae,2);{var G=it=>{var Pe=HX(),ke=_(Pe);Cs(ke,()=>c(w),bt=>m(w,bt)),D(it,Pe)};z(lt,it=>{c(y)&&it(G)})}var re=v(Qe,2);{var Ne=it=>{var Pe=$X(),ke=_(Pe),bt=v(_(ke));{var vt=Je=>{var Ct=WX();D(Je,Ct)},Fe=Je=>{var Ct=zX(),$e=_(Ct);j(()=>O($e,`${c(A).length??0??""} items · rev ${c(A)._rev??""}`)),D(Je,Ct)};z(bt,Je=>{c(A).error?Je(vt):Je(Fe,-1)})}var Dt=v(ke,2);{var Ge=Je=>{var Ct=VX(),$e=_(Ct);j(()=>O($e,c(A).error)),D(Je,Ct)},ze=Je=>{var Ct=jX(),$e=_(Ct);j(It=>O($e,It),[()=>JSON.stringify(c(A).result,null,2)]),D(Je,Ct)};z(Dt,Je=>{c(A).error?Je(Ge):Je(ze,-1)})}D(it,Pe)};z(re,it=>{c(A)&&it(Ne)})}j(()=>O(Ie,`${c(R)??""}${c(f)??""} on every update`)),jt(ht,()=>c(b),it=>m(b,it)),jt(F,()=>c(g),it=>m(g,it)),Cs(pe,()=>c(y),it=>m(y,it)),D(fe,Ke)};z(Gt,fe=>{c(P)?fe(gi):fe(Jt,-1)})}j(()=>O(xi,c(f))),$("click",Ut,Mi),$("click",mi,Ri),$("click",He,Di),D(At,Ot)},Oe=At=>{t(At)};z(Le,At=>{c(f)?At(Y):At(Oe,-1)})}var Ve=v(Ee,2);{var ye=At=>{var Ot=GX(),ri=yt(Ot),oi=v(ri,2);let xi;var Ut=_(oi);FX(Ut,{get currentView(){return c(kt)},onApplyView:be}),j(()=>xi=$o(oi,"",xi,{width:`${c(_e)??""}px`})),$("mousedown",ri,Ze),D(At,Ot)};z(Ve,At=>{c(We)&&At(ye)})}j(()=>ki=$o(Ai,"",ki,{width:`${c(oe)??""}px`})),$("click",Ii,()=>{m(te,!c(te)),m(he,null)}),jt(nt,()=>c(Bi),At=>m(Bi,At)),$("mousedown",se,Rt),D(Xe,St)};z(Oi,Xe=>{c(V)==="docs"?Xe(Qi):Xe(yi,-1)})}j(()=>{Yt=Bt(gt,1,"svelte-rrt0o",null,Yt,{active:c(V)==="docs"}),Wi=Bt(Ci,1,"svelte-rrt0o",null,Wi,{active:c(V)==="views"})}),$("mousemove",Zi,ut),$("mouseup",Zi,at),fs("mouseleave",Zi,at),$("click",gt,()=>m(V,"docs")),$("click",Ci,()=>m(V,"views")),D(o,Zi),js()}Zs(["mousemove","mouseup","click","keydown","mousedown"]);var mm={exports:{}},YX=mm.exports,jA;function QX(){return jA||(jA=1,(function(o,e){(function(i,n){o.exports=n()})(typeof self<"u"?self:YX,function(){return(function(t){var i={};function n(s){if(i[s])return i[s].exports;var r=i[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=i,n.d=function(s,r,a){n.o(s,r)||Object.defineProperty(s,r,{configurable:!1,enumerable:!0,get:a})},n.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(r,"a",r),r},n.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},n.p="",n(n.s=3)})([(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=(function(){function r(a,d){this.width=d,this.height=a.length/d,this.data=a}return r.createEmpty=function(a,d){return new r(new Uint8ClampedArray(a*d),a)},r.prototype.get=function(a,d){return a<0||a>=this.width||d<0||d>=this.height?!1:!!this.data[d*this.width+a]},r.prototype.set=function(a,d,u){this.data[d*this.width+a]=u?1:0},r.prototype.setRegion=function(a,d,u,f,g){for(var p=d;p<d+f;p++)for(var C=a;C<a+u;C++)this.set(C,p,!!g)},r})();i.BitMatrix=s}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(2);function r(d,u){return d^u}i.addOrSubtractGF=r;var a=(function(){function d(u,f,g){this.primitive=u,this.size=f,this.generatorBase=g,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var p=1,C=0;C<this.size;C++)this.expTable[C]=p,p=p*2,p>=this.size&&(p=(p^this.primitive)&this.size-1);for(var C=0;C<this.size-1;C++)this.logTable[this.expTable[C]]=C;this.zero=new s.default(this,Uint8ClampedArray.from([0])),this.one=new s.default(this,Uint8ClampedArray.from([1]))}return d.prototype.multiply=function(u,f){return u===0||f===0?0:this.expTable[(this.logTable[u]+this.logTable[f])%(this.size-1)]},d.prototype.inverse=function(u){if(u===0)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[u]-1]},d.prototype.buildMonomial=function(u,f){if(u<0)throw new Error("Invalid monomial degree less than 0");if(f===0)return this.zero;var g=new Uint8ClampedArray(u+1);return g[0]=f,new s.default(this,g)},d.prototype.log=function(u){if(u===0)throw new Error("Can't take log(0)");return this.logTable[u]},d.prototype.exp=function(u){return this.expTable[u]},d})();i.default=a}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(1),r=(function(){function a(d,u){if(u.length===0)throw new Error("No coefficients.");this.field=d;var f=u.length;if(f>1&&u[0]===0){for(var g=1;g<f&&u[g]===0;)g++;if(g===f)this.coefficients=d.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(f-g);for(var p=0;p<this.coefficients.length;p++)this.coefficients[p]=u[g+p]}}else this.coefficients=u}return a.prototype.degree=function(){return this.coefficients.length-1},a.prototype.isZero=function(){return this.coefficients[0]===0},a.prototype.getCoefficient=function(d){return this.coefficients[this.coefficients.length-1-d]},a.prototype.addOrSubtract=function(d){var u;if(this.isZero())return d;if(d.isZero())return this;var f=this.coefficients,g=d.coefficients;f.length>g.length&&(u=[g,f],f=u[0],g=u[1]);for(var p=new Uint8ClampedArray(g.length),C=g.length-f.length,b=0;b<C;b++)p[b]=g[b];for(var b=C;b<g.length;b++)p[b]=s.addOrSubtractGF(f[b-C],g[b]);return new a(this.field,p)},a.prototype.multiply=function(d){if(d===0)return this.field.zero;if(d===1)return this;for(var u=this.coefficients.length,f=new Uint8ClampedArray(u),g=0;g<u;g++)f[g]=this.field.multiply(this.coefficients[g],d);return new a(this.field,f)},a.prototype.multiplyPoly=function(d){if(this.isZero()||d.isZero())return this.field.zero;for(var u=this.coefficients,f=u.length,g=d.coefficients,p=g.length,C=new Uint8ClampedArray(f+p-1),b=0;b<f;b++)for(var y=u[b],w=0;w<p;w++)C[b+w]=s.addOrSubtractGF(C[b+w],this.field.multiply(y,g[w]));return new a(this.field,C)},a.prototype.multiplyByMonomial=function(d,u){if(d<0)throw new Error("Invalid degree less than 0");if(u===0)return this.field.zero;for(var f=this.coefficients.length,g=new Uint8ClampedArray(f+d),p=0;p<f;p++)g[p]=this.field.multiply(this.coefficients[p],u);return new a(this.field,g)},a.prototype.evaluateAt=function(d){var u=0;if(d===0)return this.getCoefficient(0);var f=this.coefficients.length;if(d===1)return this.coefficients.forEach(function(p){u=s.addOrSubtractGF(u,p)}),u;u=this.coefficients[0];for(var g=1;g<f;g++)u=s.addOrSubtractGF(this.field.multiply(d,u),this.coefficients[g]);return u},a})();i.default=r}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(4),r=n(5),a=n(11),d=n(12);function u(p){var C=d.locate(p);if(!C)return null;for(var b=0,y=C;b<y.length;b++){var w=y[b],A=a.extract(p,w),P=r.decode(A.matrix);if(P)return{binaryData:P.bytes,data:P.text,chunks:P.chunks,version:P.version,location:{topRightCorner:A.mappingFunction(w.dimension,0),topLeftCorner:A.mappingFunction(0,0),bottomRightCorner:A.mappingFunction(w.dimension,w.dimension),bottomLeftCorner:A.mappingFunction(0,w.dimension),topRightFinderPattern:w.topRight,topLeftFinderPattern:w.topLeft,bottomLeftFinderPattern:w.bottomLeft,bottomRightAlignmentPattern:w.alignmentPattern}}}return null}var f={inversionAttempts:"attemptBoth"};function g(p,C,b,y){y===void 0&&(y={});var w=f;Object.keys(w||{}).forEach(function(W){w[W]=y[W]||w[W]});var A=w.inversionAttempts==="attemptBoth"||w.inversionAttempts==="invertFirst",P=w.inversionAttempts==="onlyInvert"||w.inversionAttempts==="invertFirst",M=s.binarize(p,C,b,A),R=M.binarized,T=M.inverted,V=u(P?T:R);return!V&&(w.inversionAttempts==="attemptBoth"||w.inversionAttempts==="invertFirst")&&(V=u(P?R:T)),V}g.default=g,i.default=g}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(0),r=8,a=24;function d(g,p,C){return g<p?p:g>C?C:g}var u=(function(){function g(p,C){this.width=p,this.data=new Uint8ClampedArray(p*C)}return g.prototype.get=function(p,C){return this.data[C*this.width+p]},g.prototype.set=function(p,C,b){this.data[C*this.width+p]=b},g})();function f(g,p,C,b){if(g.length!==p*C*4)throw new Error("Malformed data passed to binarizer.");for(var y=new u(p,C),w=0;w<p;w++)for(var A=0;A<C;A++){var P=g[(A*p+w)*4+0],M=g[(A*p+w)*4+1],R=g[(A*p+w)*4+2];y.set(w,A,.2126*P+.7152*M+.0722*R)}for(var T=Math.ceil(p/r),V=Math.ceil(C/r),W=new u(T,V),Q=0;Q<V;Q++)for(var ne=0;ne<T;ne++){for(var de=0,te=1/0,he=0,A=0;A<r;A++)for(var w=0;w<r;w++){var De=y.get(ne*r+w,Q*r+A);de+=De,te=Math.min(te,De),he=Math.max(he,De)}var oe=de/Math.pow(r,2);if(he-te<=a&&(oe=te/2,Q>0&&ne>0)){var ge=(W.get(ne,Q-1)+2*W.get(ne-1,Q)+W.get(ne-1,Q-1))/4;te<ge&&(oe=ge)}W.set(ne,Q,oe)}var Se=s.BitMatrix.createEmpty(p,C),Re=null;b&&(Re=s.BitMatrix.createEmpty(p,C));for(var Q=0;Q<V;Q++)for(var ne=0;ne<T;ne++){for(var xe=d(ne,2,T-3),et=d(Q,2,V-3),de=0,We=-2;We<=2;We++)for(var _e=-2;_e<=2;_e++)de+=W.get(xe+We,et+_e);for(var dt=de/25,We=0;We<r;We++)for(var _e=0;_e<r;_e++){var w=ne*r+We,A=Q*r+_e,Wt=y.get(w,A);Se.set(w,A,Wt<=dt),b&&Re.set(w,A,!(Wt<=dt))}}return b?{binarized:Se,inverted:Re}:{binarized:Se}}i.binarize=f}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(0),r=n(6),a=n(9),d=n(10);function u(R,T){for(var V=R^T,W=0;V;)W++,V&=V-1;return W}function f(R,T){return T<<1|R}var g=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],p=[function(R){return(R.y+R.x)%2===0},function(R){return R.y%2===0},function(R){return R.x%3===0},function(R){return(R.y+R.x)%3===0},function(R){return(Math.floor(R.y/2)+Math.floor(R.x/3))%2===0},function(R){return R.x*R.y%2+R.x*R.y%3===0},function(R){return(R.y*R.x%2+R.y*R.x%3)%2===0},function(R){return((R.y+R.x)%2+R.y*R.x%3)%2===0}];function C(R){var T=17+4*R.versionNumber,V=s.BitMatrix.createEmpty(T,T);V.setRegion(0,0,9,9,!0),V.setRegion(T-8,0,8,9,!0),V.setRegion(0,T-8,9,8,!0);for(var W=0,Q=R.alignmentPatternCenters;W<Q.length;W++)for(var ne=Q[W],de=0,te=R.alignmentPatternCenters;de<te.length;de++){var he=te[de];ne===6&&he===6||ne===6&&he===T-7||ne===T-7&&he===6||V.setRegion(ne-2,he-2,5,5,!0)}return V.setRegion(6,9,1,T-17,!0),V.setRegion(9,6,T-17,1,!0),R.versionNumber>6&&(V.setRegion(T-11,0,3,6,!0),V.setRegion(0,T-11,6,3,!0)),V}function b(R,T,V){for(var W=p[V.dataMask],Q=R.height,ne=C(T),de=[],te=0,he=0,De=!0,oe=Q-1;oe>0;oe-=2){oe===6&&oe--;for(var ge=0;ge<Q;ge++)for(var Se=De?Q-1-ge:ge,Re=0;Re<2;Re++){var xe=oe-Re;if(!ne.get(xe,Se)){he++;var et=R.get(xe,Se);W({y:Se,x:xe})&&(et=!et),te=f(et,te),he===8&&(de.push(te),he=0,te=0)}}De=!De}return de}function y(R){var T=R.height,V=Math.floor((T-17)/4);if(V<=6)return d.VERSIONS[V-1];for(var W=0,Q=5;Q>=0;Q--)for(var ne=T-9;ne>=T-11;ne--)W=f(R.get(ne,Q),W);for(var de=0,ne=5;ne>=0;ne--)for(var Q=T-9;Q>=T-11;Q--)de=f(R.get(ne,Q),de);for(var te=1/0,he,De=0,oe=d.VERSIONS;De<oe.length;De++){var ge=oe[De];if(ge.infoBits===W||ge.infoBits===de)return ge;var Se=u(W,ge.infoBits);Se<te&&(he=ge,te=Se),Se=u(de,ge.infoBits),Se<te&&(he=ge,te=Se)}if(te<=3)return he}function w(R){for(var T=0,V=0;V<=8;V++)V!==6&&(T=f(R.get(V,8),T));for(var W=7;W>=0;W--)W!==6&&(T=f(R.get(8,W),T));for(var Q=R.height,ne=0,W=Q-1;W>=Q-7;W--)ne=f(R.get(8,W),ne);for(var V=Q-8;V<Q;V++)ne=f(R.get(V,8),ne);for(var de=1/0,te=null,he=0,De=g;he<De.length;he++){var oe=De[he],ge=oe.bits,Se=oe.formatInfo;if(ge===T||ge===ne)return Se;var Re=u(T,ge);Re<de&&(te=Se,de=Re),T!==ne&&(Re=u(ne,ge),Re<de&&(te=Se,de=Re))}return de<=3?te:null}function A(R,T,V){var W=T.errorCorrectionLevels[V],Q=[],ne=0;if(W.ecBlocks.forEach(function(et){for(var We=0;We<et.numBlocks;We++)Q.push({numDataCodewords:et.dataCodewordsPerBlock,codewords:[]}),ne+=et.dataCodewordsPerBlock+W.ecCodewordsPerBlock}),R.length<ne)return null;R=R.slice(0,ne);for(var de=W.ecBlocks[0].dataCodewordsPerBlock,te=0;te<de;te++)for(var he=0,De=Q;he<De.length;he++){var oe=De[he];oe.codewords.push(R.shift())}if(W.ecBlocks.length>1)for(var ge=W.ecBlocks[0].numBlocks,Se=W.ecBlocks[1].numBlocks,te=0;te<Se;te++)Q[ge+te].codewords.push(R.shift());for(;R.length>0;)for(var Re=0,xe=Q;Re<xe.length;Re++){var oe=xe[Re];oe.codewords.push(R.shift())}return Q}function P(R){var T=y(R);if(!T)return null;var V=w(R);if(!V)return null;var W=b(R,T,V),Q=A(W,T,V.errorCorrectionLevel);if(!Q)return null;for(var ne=Q.reduce(function(Re,xe){return Re+xe.numDataCodewords},0),de=new Uint8ClampedArray(ne),te=0,he=0,De=Q;he<De.length;he++){var oe=De[he],ge=a.decode(oe.codewords,oe.codewords.length-oe.numDataCodewords);if(!ge)return null;for(var Se=0;Se<oe.numDataCodewords;Se++)de[te++]=ge[Se]}try{return r.decode(de,T.versionNumber)}catch{return null}}function M(R){if(R==null)return null;var T=P(R);if(T)return T;for(var V=0;V<R.width;V++)for(var W=V+1;W<R.height;W++)R.get(V,W)!==R.get(W,V)&&(R.set(V,W,!R.get(V,W)),R.set(W,V,!R.get(W,V)));return P(R)}i.decode=M}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(7),r=n(8),a;(function(y){y.Numeric="numeric",y.Alphanumeric="alphanumeric",y.Byte="byte",y.Kanji="kanji",y.ECI="eci"})(a=i.Mode||(i.Mode={}));var d;(function(y){y[y.Terminator=0]="Terminator",y[y.Numeric=1]="Numeric",y[y.Alphanumeric=2]="Alphanumeric",y[y.Byte=4]="Byte",y[y.Kanji=8]="Kanji",y[y.ECI=7]="ECI"})(d||(d={}));function u(y,w){for(var A=[],P="",M=[10,12,14][w],R=y.readBits(M);R>=3;){var T=y.readBits(10);if(T>=1e3)throw new Error("Invalid numeric value above 999");var V=Math.floor(T/100),W=Math.floor(T/10)%10,Q=T%10;A.push(48+V,48+W,48+Q),P+=V.toString()+W.toString()+Q.toString(),R-=3}if(R===2){var T=y.readBits(7);if(T>=100)throw new Error("Invalid numeric value above 99");var V=Math.floor(T/10),W=T%10;A.push(48+V,48+W),P+=V.toString()+W.toString()}else if(R===1){var T=y.readBits(4);if(T>=10)throw new Error("Invalid numeric value above 9");A.push(48+T),P+=T.toString()}return{bytes:A,text:P}}var f=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function g(y,w){for(var A=[],P="",M=[9,11,13][w],R=y.readBits(M);R>=2;){var T=y.readBits(11),V=Math.floor(T/45),W=T%45;A.push(f[V].charCodeAt(0),f[W].charCodeAt(0)),P+=f[V]+f[W],R-=2}if(R===1){var V=y.readBits(6);A.push(f[V].charCodeAt(0)),P+=f[V]}return{bytes:A,text:P}}function p(y,w){for(var A=[],P="",M=[8,16,16][w],R=y.readBits(M),T=0;T<R;T++){var V=y.readBits(8);A.push(V)}try{P+=decodeURIComponent(A.map(function(W){return"%"+("0"+W.toString(16)).substr(-2)}).join(""))}catch{}return{bytes:A,text:P}}function C(y,w){for(var A=[],P="",M=[8,10,12][w],R=y.readBits(M),T=0;T<R;T++){var V=y.readBits(13),W=Math.floor(V/192)<<8|V%192;W<7936?W+=33088:W+=49472,A.push(W>>8,W&255),P+=String.fromCharCode(r.shiftJISTable[W])}return{bytes:A,text:P}}function b(y,w){for(var A,P,M,R,T=new s.BitStream(y),V=w<=9?0:w<=26?1:2,W={text:"",bytes:[],chunks:[],version:w};T.available()>=4;){var Q=T.readBits(4);if(Q===d.Terminator)return W;if(Q===d.ECI)T.readBits(1)===0?W.chunks.push({type:a.ECI,assignmentNumber:T.readBits(7)}):T.readBits(1)===0?W.chunks.push({type:a.ECI,assignmentNumber:T.readBits(14)}):T.readBits(1)===0?W.chunks.push({type:a.ECI,assignmentNumber:T.readBits(21)}):W.chunks.push({type:a.ECI,assignmentNumber:-1});else if(Q===d.Numeric){var ne=u(T,V);W.text+=ne.text,(A=W.bytes).push.apply(A,ne.bytes),W.chunks.push({type:a.Numeric,text:ne.text})}else if(Q===d.Alphanumeric){var de=g(T,V);W.text+=de.text,(P=W.bytes).push.apply(P,de.bytes),W.chunks.push({type:a.Alphanumeric,text:de.text})}else if(Q===d.Byte){var te=p(T,V);W.text+=te.text,(M=W.bytes).push.apply(M,te.bytes),W.chunks.push({type:a.Byte,bytes:te.bytes,text:te.text})}else if(Q===d.Kanji){var he=C(T,V);W.text+=he.text,(R=W.bytes).push.apply(R,he.bytes),W.chunks.push({type:a.Kanji,bytes:he.bytes,text:he.text})}}if(T.available()===0||T.readBits(T.available())===0)return W}i.decode=b}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=(function(){function r(a){this.byteOffset=0,this.bitOffset=0,this.bytes=a}return r.prototype.readBits=function(a){if(a<1||a>32||a>this.available())throw new Error("Cannot read "+a.toString()+" bits");var d=0;if(this.bitOffset>0){var u=8-this.bitOffset,f=a<u?a:u,g=u-f,p=255>>8-f<<g;d=(this.bytes[this.byteOffset]&p)>>g,a-=f,this.bitOffset+=f,this.bitOffset===8&&(this.bitOffset=0,this.byteOffset++)}if(a>0){for(;a>=8;)d=d<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;if(a>0){var g=8-a,p=255>>g<<g;d=d<<a|(this.bytes[this.byteOffset]&p)>>g,this.bitOffset+=a}}return d},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r})();i.BitStream=s}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0}),i.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(1),r=n(2);function a(g,p,C,b){var y;p.degree()<C.degree()&&(y=[C,p],p=y[0],C=y[1]);for(var w=p,A=C,P=g.zero,M=g.one;A.degree()>=b/2;){var R=w,T=P;if(w=A,P=M,w.isZero())return null;A=R;for(var V=g.zero,W=w.getCoefficient(w.degree()),Q=g.inverse(W);A.degree()>=w.degree()&&!A.isZero();){var ne=A.degree()-w.degree(),de=g.multiply(A.getCoefficient(A.degree()),Q);V=V.addOrSubtract(g.buildMonomial(ne,de)),A=A.addOrSubtract(w.multiplyByMonomial(ne,de))}if(M=V.multiplyPoly(P).addOrSubtract(T),A.degree()>=w.degree())return null}var te=M.getCoefficient(0);if(te===0)return null;var he=g.inverse(te);return[M.multiply(he),A.multiply(he)]}function d(g,p){var C=p.degree();if(C===1)return[p.getCoefficient(1)];for(var b=new Array(C),y=0,w=1;w<g.size&&y<C;w++)p.evaluateAt(w)===0&&(b[y]=g.inverse(w),y++);return y!==C?null:b}function u(g,p,C){for(var b=C.length,y=new Array(b),w=0;w<b;w++){for(var A=g.inverse(C[w]),P=1,M=0;M<b;M++)w!==M&&(P=g.multiply(P,s.addOrSubtractGF(1,g.multiply(C[M],A))));y[w]=g.multiply(p.evaluateAt(A),g.inverse(P)),g.generatorBase!==0&&(y[w]=g.multiply(y[w],A))}return y}function f(g,p){var C=new Uint8ClampedArray(g.length);C.set(g);for(var b=new s.default(285,256,0),y=new r.default(b,C),w=new Uint8ClampedArray(p),A=!1,P=0;P<p;P++){var M=y.evaluateAt(b.exp(P+b.generatorBase));w[w.length-1-P]=M,M!==0&&(A=!0)}if(!A)return C;var R=new r.default(b,w),T=a(b,b.buildMonomial(p,1),R,p);if(T===null)return null;var V=d(b,T[0]);if(V==null)return null;for(var W=u(b,T[1],V),Q=0;Q<V.length;Q++){var ne=C.length-1-b.log(V[Q]);if(ne<0)return null;C[ne]=s.addOrSubtractGF(C[ne],W[Q])}return C}i.decode=f}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0}),i.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=n(0);function r(f,g,p,C){var b=f.x-g.x+p.x-C.x,y=f.y-g.y+p.y-C.y;if(b===0&&y===0)return{a11:g.x-f.x,a12:g.y-f.y,a13:0,a21:p.x-g.x,a22:p.y-g.y,a23:0,a31:f.x,a32:f.y,a33:1};var w=g.x-p.x,A=C.x-p.x,P=g.y-p.y,M=C.y-p.y,R=w*M-A*P,T=(b*M-A*y)/R,V=(w*y-b*P)/R;return{a11:g.x-f.x+T*g.x,a12:g.y-f.y+T*g.y,a13:T,a21:C.x-f.x+V*C.x,a22:C.y-f.y+V*C.y,a23:V,a31:f.x,a32:f.y,a33:1}}function a(f,g,p,C){var b=r(f,g,p,C);return{a11:b.a22*b.a33-b.a23*b.a32,a12:b.a13*b.a32-b.a12*b.a33,a13:b.a12*b.a23-b.a13*b.a22,a21:b.a23*b.a31-b.a21*b.a33,a22:b.a11*b.a33-b.a13*b.a31,a23:b.a13*b.a21-b.a11*b.a23,a31:b.a21*b.a32-b.a22*b.a31,a32:b.a12*b.a31-b.a11*b.a32,a33:b.a11*b.a22-b.a12*b.a21}}function d(f,g){return{a11:f.a11*g.a11+f.a21*g.a12+f.a31*g.a13,a12:f.a12*g.a11+f.a22*g.a12+f.a32*g.a13,a13:f.a13*g.a11+f.a23*g.a12+f.a33*g.a13,a21:f.a11*g.a21+f.a21*g.a22+f.a31*g.a23,a22:f.a12*g.a21+f.a22*g.a22+f.a32*g.a23,a23:f.a13*g.a21+f.a23*g.a22+f.a33*g.a23,a31:f.a11*g.a31+f.a21*g.a32+f.a31*g.a33,a32:f.a12*g.a31+f.a22*g.a32+f.a32*g.a33,a33:f.a13*g.a31+f.a23*g.a32+f.a33*g.a33}}function u(f,g){for(var p=a({x:3.5,y:3.5},{x:g.dimension-3.5,y:3.5},{x:g.dimension-6.5,y:g.dimension-6.5},{x:3.5,y:g.dimension-3.5}),C=r(g.topLeft,g.topRight,g.alignmentPattern,g.bottomLeft),b=d(C,p),y=s.BitMatrix.createEmpty(g.dimension,g.dimension),w=function(V,W){var Q=b.a13*V+b.a23*W+b.a33;return{x:(b.a11*V+b.a21*W+b.a31)/Q,y:(b.a12*V+b.a22*W+b.a32)/Q}},A=0;A<g.dimension;A++)for(var P=0;P<g.dimension;P++){var M=P+.5,R=A+.5,T=w(M,R);y.set(P,A,f.get(Math.floor(T.x),Math.floor(T.y)))}return{matrix:y,mappingFunction:w}}i.extract=u}),(function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var s=4,r=.5,a=1.5,d=function(M,R){return Math.sqrt(Math.pow(R.x-M.x,2)+Math.pow(R.y-M.y,2))};function u(M){return M.reduce(function(R,T){return R+T})}function f(M,R,T){var V,W,Q,ne,de=d(M,R),te=d(R,T),he=d(M,T),De,oe,ge;return te>=de&&te>=he?(V=[R,M,T],De=V[0],oe=V[1],ge=V[2]):he>=te&&he>=de?(W=[M,R,T],De=W[0],oe=W[1],ge=W[2]):(Q=[M,T,R],De=Q[0],oe=Q[1],ge=Q[2]),(ge.x-oe.x)*(De.y-oe.y)-(ge.y-oe.y)*(De.x-oe.x)<0&&(ne=[ge,De],De=ne[0],ge=ne[1]),{bottomLeft:De,topLeft:oe,topRight:ge}}function g(M,R,T,V){var W=(u(C(M,T,V,5))/7+u(C(M,R,V,5))/7+u(C(T,M,V,5))/7+u(C(R,M,V,5))/7)/4;if(W<1)throw new Error("Invalid module size");var Q=Math.round(d(M,R)/W),ne=Math.round(d(M,T)/W),de=Math.floor((Q+ne)/2)+7;switch(de%4){case 0:de++;break;case 2:de--;break}return{dimension:de,moduleSize:W}}function p(M,R,T,V){var W=[{x:Math.floor(M.x),y:Math.floor(M.y)}],Q=Math.abs(R.y-M.y)>Math.abs(R.x-M.x),ne,de,te,he;Q?(ne=Math.floor(M.y),de=Math.floor(M.x),te=Math.floor(R.y),he=Math.floor(R.x)):(ne=Math.floor(M.x),de=Math.floor(M.y),te=Math.floor(R.x),he=Math.floor(R.y));for(var De=Math.abs(te-ne),oe=Math.abs(he-de),ge=Math.floor(-De/2),Se=ne<te?1:-1,Re=de<he?1:-1,xe=!0,et=ne,We=de;et!==te+Se;et+=Se){var _e=Q?We:et,dt=Q?et:We;if(T.get(_e,dt)!==xe&&(xe=!xe,W.push({x:_e,y:dt}),W.length===V+1))break;if(ge+=oe,ge>0){if(We===he)break;We+=Re,ge-=De}}for(var Wt=[],tt=0;tt<V;tt++)W[tt]&&W[tt+1]?Wt.push(d(W[tt],W[tt+1])):Wt.push(0);return Wt}function C(M,R,T,V){var W,Q=R.y-M.y,ne=R.x-M.x,de=p(M,R,T,Math.ceil(V/2)),te=p(M,{x:M.x-ne,y:M.y-Q},T,Math.ceil(V/2)),he=de.shift()+te.shift()-1;return(W=te.concat(he)).concat.apply(W,de)}function b(M,R){var T=u(M)/u(R),V=0;return R.forEach(function(W,Q){V+=Math.pow(M[Q]-W*T,2)}),{averageSize:T,error:V}}function y(M,R,T){try{var V=C(M,{x:-1,y:M.y},T,R.length),W=C(M,{x:M.x,y:-1},T,R.length),Q={x:Math.max(0,M.x-M.y)-1,y:Math.max(0,M.y-M.x)-1},ne=C(M,Q,T,R.length),de={x:Math.min(T.width,M.x+M.y)+1,y:Math.min(T.height,M.y+M.x)+1},te=C(M,de,T,R.length),he=b(V,R),De=b(W,R),oe=b(ne,R),ge=b(te,R),Se=Math.sqrt(he.error*he.error+De.error*De.error+oe.error*oe.error+ge.error*ge.error),Re=(he.averageSize+De.averageSize+oe.averageSize+ge.averageSize)/4,xe=(Math.pow(he.averageSize-Re,2)+Math.pow(De.averageSize-Re,2)+Math.pow(oe.averageSize-Re,2)+Math.pow(ge.averageSize-Re,2))/Re;return Se+xe}catch{return 1/0}}function w(M,R){for(var T=Math.round(R.x);M.get(T,Math.round(R.y));)T--;for(var V=Math.round(R.x);M.get(V,Math.round(R.y));)V++;for(var W=(T+V)/2,Q=Math.round(R.y);M.get(Math.round(W),Q);)Q--;for(var ne=Math.round(R.y);M.get(Math.round(W),ne);)ne++;var de=(Q+ne)/2;return{x:W,y:de}}function A(M){for(var R=[],T=[],V=[],W=[],Q=function(_e){for(var dt=0,Wt=!1,tt=[0,0,0,0,0],kt=function(Rt){var ut=M.get(Rt,_e);if(ut===Wt)dt++;else{tt=[tt[1],tt[2],tt[3],tt[4],dt],dt=1,Wt=ut;var at=u(tt)/7,Ze=Math.abs(tt[0]-at)<at&&Math.abs(tt[1]-at)<at&&Math.abs(tt[2]-3*at)<3*at&&Math.abs(tt[3]-at)<at&&Math.abs(tt[4]-at)<at&&!ut,Pt=u(tt.slice(-3))/3,ui=Math.abs(tt[2]-Pt)<Pt&&Math.abs(tt[3]-Pt)<Pt&&Math.abs(tt[4]-Pt)<Pt&&ut;if(Ze){var wt=Rt-tt[3]-tt[4],Ft=wt-tt[2],Vt={startX:Ft,endX:wt,y:_e},zt=T.filter(function(Mi){return Ft>=Mi.bottom.startX&&Ft<=Mi.bottom.endX||wt>=Mi.bottom.startX&&Ft<=Mi.bottom.endX||Ft<=Mi.bottom.startX&&wt>=Mi.bottom.endX&&tt[2]/(Mi.bottom.endX-Mi.bottom.startX)<a&&tt[2]/(Mi.bottom.endX-Mi.bottom.startX)>r});zt.length>0?zt[0].bottom=Vt:T.push({top:Vt,bottom:Vt})}if(ui){var Zt=Rt-tt[4],mt=Zt-tt[3],Vt={startX:mt,y:_e,endX:Zt},zt=W.filter(function(Di){return mt>=Di.bottom.startX&&mt<=Di.bottom.endX||Zt>=Di.bottom.startX&&mt<=Di.bottom.endX||mt<=Di.bottom.startX&&Zt>=Di.bottom.endX&&tt[2]/(Di.bottom.endX-Di.bottom.startX)<a&&tt[2]/(Di.bottom.endX-Di.bottom.startX)>r});zt.length>0?zt[0].bottom=Vt:W.push({top:Vt,bottom:Vt})}}},be=-1;be<=M.width;be++)kt(be);R.push.apply(R,T.filter(function(Rt){return Rt.bottom.y!==_e&&Rt.bottom.y-Rt.top.y>=2})),T=T.filter(function(Rt){return Rt.bottom.y===_e}),V.push.apply(V,W.filter(function(Rt){return Rt.bottom.y!==_e})),W=W.filter(function(Rt){return Rt.bottom.y===_e})},ne=0;ne<=M.height;ne++)Q(ne);R.push.apply(R,T.filter(function(_e){return _e.bottom.y-_e.top.y>=2})),V.push.apply(V,W);var de=R.filter(function(_e){return _e.bottom.y-_e.top.y>=2}).map(function(_e){var dt=(_e.top.startX+_e.top.endX+_e.bottom.startX+_e.bottom.endX)/4,Wt=(_e.top.y+_e.bottom.y+1)/2;if(M.get(Math.round(dt),Math.round(Wt))){var tt=[_e.top.endX-_e.top.startX,_e.bottom.endX-_e.bottom.startX,_e.bottom.y-_e.top.y+1],kt=u(tt)/tt.length,be=y({x:Math.round(dt),y:Math.round(Wt)},[1,1,3,1,1],M);return{score:be,x:dt,y:Wt,size:kt}}}).filter(function(_e){return!!_e}).sort(function(_e,dt){return _e.score-dt.score}).map(function(_e,dt,Wt){if(dt>s)return null;var tt=Wt.filter(function(be,Rt){return dt!==Rt}).map(function(be){return{x:be.x,y:be.y,score:be.score+Math.pow(be.size-_e.size,2)/_e.size,size:be.size}}).sort(function(be,Rt){return be.score-Rt.score});if(tt.length<2)return null;var kt=_e.score+tt[0].score+tt[1].score;return{points:[_e].concat(tt.slice(0,2)),score:kt}}).filter(function(_e){return!!_e}).sort(function(_e,dt){return _e.score-dt.score});if(de.length===0)return null;var te=f(de[0].points[0],de[0].points[1],de[0].points[2]),he=te.topRight,De=te.topLeft,oe=te.bottomLeft,ge=P(M,V,he,De,oe),Se=[];ge&&Se.push({alignmentPattern:{x:ge.alignmentPattern.x,y:ge.alignmentPattern.y},bottomLeft:{x:oe.x,y:oe.y},dimension:ge.dimension,topLeft:{x:De.x,y:De.y},topRight:{x:he.x,y:he.y}});var Re=w(M,he),xe=w(M,De),et=w(M,oe),We=P(M,V,Re,xe,et);return We&&Se.push({alignmentPattern:{x:We.alignmentPattern.x,y:We.alignmentPattern.y},bottomLeft:{x:et.x,y:et.y},topLeft:{x:xe.x,y:xe.y},topRight:{x:Re.x,y:Re.y},dimension:We.dimension}),Se.length===0?null:Se}i.locate=A;function P(M,R,T,V,W){var Q,ne,de;try{Q=g(V,T,W,M),ne=Q.dimension,de=Q.moduleSize}catch{return null}var te={x:T.x-V.x+W.x,y:T.y-V.y+W.y},he=(d(V,W)+d(V,T))/2/de,De=1-3/he,oe={x:V.x+De*(te.x-V.x),y:V.y+De*(te.y-V.y)},ge=R.map(function(Re){var xe=(Re.top.startX+Re.top.endX+Re.bottom.startX+Re.bottom.endX)/4,et=(Re.top.y+Re.bottom.y+1)/2;if(M.get(Math.floor(xe),Math.floor(et))){var We=[Re.top.endX-Re.top.startX,Re.bottom.endX-Re.bottom.startX,Re.bottom.y-Re.top.y+1];u(We)/We.length;var _e=y({x:Math.floor(xe),y:Math.floor(et)},[1,1,1],M),dt=_e+d({x:xe,y:et},oe);return{x:xe,y:et,score:dt}}}).filter(function(Re){return!!Re}).sort(function(Re,xe){return Re.score-xe.score}),Se=he>=15&&ge.length?ge[0]:oe;return{alignmentPattern:Se,dimension:ne}}})]).default})})(mm)),mm.exports}var JX=QX();const eY=cS(JX);var tY=B('<label class="svelte-1ua3isv">Passcode <input type="number" placeholder="20202021" class="svelte-1ua3isv"/></label> <label class="svelte-1ua3isv">Discriminator (optional) <input type="number" placeholder="3840" class="svelte-1ua3isv"/></label>',1),iY=B('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label> <div class="scan-row svelte-1ua3isv"><button class="scan-btn svelte-1ua3isv" title="Scan QR code with camera"><svg width="13" height="13" viewBox="0 0 16 16" fill="currentColor"><path d="M1 1h5v5H1V1zm1 1v3h3V2H2zm7-1h5v5h-5V1zm1 1v3h3V2h-3zM1 9h5v5H1V9zm1 1v3h3v-3H2zm7 0h2v2H9v-2zm2 0h2v2h-2v-2zm0 2h2v2h-2v-2zm-2 2h2v2H9v-2zm2 0h2v2h-2v-2z"></path></svg> Camera</button> <label class="scan-btn scan-file-btn svelte-1ua3isv" title="Decode QR from image file"><svg width="13" height="13" viewBox="0 0 16 16" fill="currentColor"><path d="M13 4H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1zM3 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H3zm5 2.5a.5.5 0 0 1 .5.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1V6a.5.5 0 0 1 .5-.5z"></path></svg> Image… <input type="file" accept="image/*" style="display:none" class="svelte-1ua3isv"/></label></div>',1),$A=B('<p class="err svelte-1ua3isv"> </p>'),nY=B('<div class="wizard svelte-1ua3isv"><div class="wizard-tabs svelte-1ua3isv"><button>Passcode</button> <button>QR / Code</button></div> <!> <label class="svelte-1ua3isv">IP Address (optional, bypasses mDNS) <input type="text" placeholder="192.168.1.100 or 192.168.1.100:5540" class="svelte-1ua3isv"/></label> <!> <button class="commission-btn svelte-1ua3isv"> </button></div>'),sY=B('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),oY=B('<span class="device-name svelte-1ua3isv"> </span>'),rY=B('<li><button class="device-select-btn svelte-1ua3isv"><span></span> <span class="device-label svelte-1ua3isv"><!></span></button> <button class="unpair-btn svelte-1ua3isv" title="Unpair">✕</button></li>'),aY=B('<li class="empty svelte-1ua3isv">No paired devices</li>'),lY=B('<p class="info svelte-1ua3isv">Loading…</p>'),cY=B('<p class="device-subtitle svelte-1ua3isv"> </p>'),dY=B('<span class="ep-chip svelte-1ua3isv"> </span>'),uY=B('<span class="attr-id svelte-1ua3isv"> </span>'),hY=B('<button class="attr-action-btn svelte-1ua3isv"> </button>'),fY=B('<div class="attr-actions svelte-1ua3isv"></div>'),gY=B('<span class="cmd-sep svelte-1ua3isv">,</span>'),pY=B('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),xY=B('<span class="cmd-id svelte-1ua3isv"> </span>'),mY=B("<!> <!>",1),vY=B('<span class="cmd-list svelte-1ua3isv"></span>'),_Y=B(' <span class="cmd-id svelte-1ua3isv"> </span>',1),bY=B('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),CY=B('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"><th class="svelte-1ua3isv">deviceType</th><th class="svelte-1ua3isv">revision</th></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),EY=B('<th class="svelte-1ua3isv"> </th>'),yY=B('<td class="svelte-1ua3isv"> </td>'),wY=B('<tr class="svelte-1ua3isv"></tr>'),SY=B('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),DY=B('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),AY=B('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),kY=B('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),BY=B('<span class="attr-val svelte-1ua3isv"> </span>'),FY=B('<tr class="svelte-1ua3isv"><td class="attr-name-cell svelte-1ua3isv"><span class="attr-key svelte-1ua3isv"> </span><!></td><td class="attr-actions-cell svelte-1ua3isv"><!></td><td class="attr-val-cell svelte-1ua3isv"><!></td></tr>'),LY=B('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),IY=B('<table class="cluster-table svelte-1ua3isv"><colgroup><col class="col-attr-name svelte-1ua3isv"/><col class="col-attr-actions svelte-1ua3isv"/><col class="col-attr-val"/></colgroup><tbody class="svelte-1ua3isv"></tbody></table>'),PY=B('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),TY=B('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),MY=B('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),RY=B('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),NY=B('<span class="stream-badge svelte-1ua3isv"> </span>'),OY=B('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),GC=B('&nbsp;<span class="e-sub svelte-1ua3isv"> </span>',1),HY=B('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),WY=B('<span class="e-badge e-badge-attr svelte-1ua3isv">attr</span> <span class="e-node svelte-1ua3isv"> <!></span> <span class="e-ep svelte-1ua3isv"> <!></span> <span class="e-cluster svelte-1ua3isv"> </span> <span class="e-attr svelte-1ua3isv"> </span> <span class="e-val svelte-1ua3isv"> </span>',1),zY=B('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),VY=B('<div class="stream-body svelte-1ua3isv"><!></div>'),jY=B('<p class="scan-err svelte-1ua3isv"> </p>'),$Y=B('<div class="scan-preview svelte-1ua3isv"><video playsinline="" class="scan-video svelte-1ua3isv"></video> <div class="scan-reticle svelte-1ua3isv"></div></div> <p class="scan-hint svelte-1ua3isv">Point camera at the QR code on the device</p>',3),UY=B('<div class="scan-backdrop svelte-1ua3isv"></div> <div class="scan-modal svelte-1ua3isv"><div class="scan-modal-hdr svelte-1ua3isv"><span>Scan Matter QR Code</span> <button class="scan-close svelte-1ua3isv">✕</button></div> <!> <canvas style="display:none"></canvas></div>',1),qY=B('<!> <div class="matter-page svelte-1ua3isv"><div class="matter-main svelte-1ua3isv"><div class="sidebar svelte-1ua3isv"><div class="sidebar-header svelte-1ua3isv"><span class="sidebar-title svelte-1ua3isv">Matter Devices</span> <button class="add-btn svelte-1ua3isv" title="Commission new device">+</button></div> <!> <ul class="device-list svelte-1ua3isv"><!> <!></ul></div> <div class="detail svelte-1ua3isv"><!></div></div> <div class="stream-panel svelte-1ua3isv"><div class="stream-resize svelte-1ua3isv"></div> <div class="stream-hdr-row svelte-1ua3isv"><span class="stream-title svelte-1ua3isv">Matter Events</span> <!> <button class="stream-toggle svelte-1ua3isv" title="Toggle event feed"> </button></div> <!></div></div> <!>',1);function GY(o,e){Vs(e,!0);const t={onOff:{onOff:[{label:"On",command:"on"},{label:"Off",command:"off"},{label:"Toggle",command:"toggle"}]},levelControl:{currentLevel:[{label:"Step ▲",command:"stepWithOnOff",args:{stepMode:0,stepSize:25,transitionTime:5}},{label:"Step ▼",command:"stepWithOnOff",args:{stepMode:1,stepSize:25,transitionTime:5}}]},windowCovering:{currentPositionLiftPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}],currentPositionTiltPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}]}};async function i(Y,Oe,Ve,ye,At){try{await sU(Y,Oe,Ve,ye,At)}catch(Ot){console.error("matter command failed",Ot)}}const n={identify:{0:"identify",1:"triggerEffect"},groups:{0:"addGroup",1:"viewGroup",2:"getGroupMembership",3:"removeGroup",4:"removeAllGroups",5:"addGroupIfIdentifying"},scenes:{0:"addScene",1:"viewScene",2:"removeScene",3:"removeAllScenes",4:"storeScene",5:"recallScene",6:"getSceneMembership",64:"enhancedAddScene",65:"enhancedViewScene",66:"copyScene"},onOff:{0:"off",1:"on",2:"toggle",64:"offWithEffect",65:"onWithRecallGlobalScene",66:"onWithTimedOff"},levelControl:{0:"moveToLevel",1:"move",2:"step",3:"stop",4:"moveToLevelWithOnOff",5:"moveWithOnOff",6:"stepWithOnOff",7:"stopWithOnOff",8:"moveToClosestFrequency"},colorControl:{0:"moveToHue",1:"moveHue",2:"stepHue",3:"moveToSaturation",4:"moveSaturation",5:"stepSaturation",6:"moveToHueAndSaturation",7:"moveToColor",8:"moveColor",9:"stepColor",10:"moveToColorTemperature",64:"enhancedMoveToHue",65:"enhancedMoveHue",66:"enhancedStepHue",67:"enhancedMoveToHueAndSaturation",68:"colorLoopSet",71:"stopMoveStep",75:"moveColorTemperature",76:"stepColorTemperature"},thermostat:{0:"setpointRaiseLower",1:"setWeeklySchedule",2:"getWeeklySchedule",3:"clearWeeklySchedule"},doorLock:{0:"lockDoor",1:"unlockDoor",3:"unlockWithTimeout",11:"setWeekDaySchedule",12:"getWeekDaySchedule",13:"clearWeekDaySchedule",14:"setYearDaySchedule",15:"getYearDaySchedule",16:"clearYearDaySchedule",17:"setHolidaySchedule",18:"getHolidaySchedule",19:"clearHolidaySchedule",26:"setUser",27:"getUser",28:"clearUser",34:"setCredential",36:"getCredential",38:"clearCredential"},windowCovering:{0:"upOrOpen",1:"downOrClose",2:"stopMotion",4:"goToLiftValue",5:"goToLiftPercentage",7:"goToTiltValue",8:"goToTiltPercentage"},fanControl:{0:"step"}};function s(Y,Oe){const Ve=n[Y];return Oe.map(ye=>{const At=typeof ye=="number"?ye:Number(ye);return{id:At,name:(Ve==null?void 0:Ve[At])??null}})}const r={10:"Door Lock",11:"Door Lock Controller",14:"Aggregator",15:"Generic Switch",17:"On/Off Plug-In Unit",18:"Dimmable Plug-In Unit",19:"Pump",20:"On/Off Light Switch",21:"Dimmer Switch",22:"Color Dimmer Switch",23:"Control Bridge",24:"Pump Controller",256:"On/Off Light",257:"Dimmable Light",268:"Extended Color Light",269:"Color Temperature Light",262:"Light Sensor",263:"Occupancy Sensor",514:"Window Covering",515:"Window Covering Controller",768:"Heating/Cooling Unit",769:"Thermostat",770:"Temperature Sensor",771:"Pressure Sensor",772:"Flow Sensor",773:"Humidity Sensor",774:"On/Off Sensor",2112:"Air Quality Sensor"},a={generatedCommandList:65528,acceptedCommandList:65529,eventList:65530,attributeList:65531,featureMap:65532,clusterRevision:65533},d={descriptor:{deviceTypeList:0,serverList:1,clientList:2,partsList:3,tagList:4},basicInformation:{dataModelRevision:0,vendorName:1,vendorID:2,vendorId:2,productName:3,productID:4,productId:4,nodeLabel:5,location:6,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,localConfigDisabled:16,reachable:17,uniqueID:18,uniqueId:18,capabilityMinima:19,productAppearance:20,specificationVersion:21,maxPathsPerInvoke:22},bridgedDeviceBasicInformation:{vendorName:1,vendorID:2,vendorId:2,productName:3,productId:4,nodeLabel:5,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,reachable:17,uniqueID:18,uniqueId:18,productAppearance:20},identify:{identifyTime:0,identifyType:1},groups:{nameSupport:0},onOff:{onOff:0,globalSceneControl:16384,onTime:16385,offWaitTime:16386,startUpOnOff:16387},levelControl:{currentLevel:0,remainingTime:1,minLevel:2,maxLevel:3,currentFrequency:4,minFrequency:5,maxFrequency:6,options:15,onOffTransitionTime:16,onLevel:17,onTransitionTime:18,offTransitionTime:19,defaultMoveRate:20,startUpCurrentLevel:16384},colorControl:{currentHue:0,currentSaturation:1,remainingTime:2,currentX:3,currentY:4,colorTemperatureMireds:7,colorMode:8,options:15,enhancedCurrentHue:16384,enhancedColorMode:16385,colorLoopActive:16386,colorLoopDirection:16387,colorLoopTime:16388,colorCapabilities:16394,colorTempPhysicalMinMireds:16395,colorTempPhysicalMaxMireds:16396,coupleColorTempToLevelMinMireds:16397,startUpColorTemperatureMireds:16400},thermostat:{localTemperature:0,outdoorTemperature:1,occupancy:2,absMinHeatSetpointLimit:3,absMaxHeatSetpointLimit:4,absMinCoolSetpointLimit:5,absMaxCoolSetpointLimit:6,piCoolingDemand:7,piHeatingDemand:8,localTemperatureCalibration:16,occupiedCoolingSetpoint:17,occupiedHeatingSetpoint:18,unoccupiedCoolingSetpoint:19,unoccupiedHeatingSetpoint:20,minHeatSetpointLimit:21,maxHeatSetpointLimit:22,minCoolSetpointLimit:23,maxCoolSetpointLimit:24,minSetpointDeadBand:25,remoteSensing:26,controlSequenceOfOperation:27,systemMode:28,thermostatRunningMode:30,startOfWeek:32,numberOfWeeklyTransitions:33,numberOfDailyTransitions:34,temperatureSetpointHold:35,temperatureSetpointHoldDuration:36,thermostatProgrammingOperationMode:37,thermostatRunningState:41,setpointChangeSource:48,setpointChangeAmount:49,setpointChangeSourceTimestamp:50,occupiedSetback:52,unoccupiedSetback:55,emergencyHeatDelta:58},windowCovering:{type:0,physicalClosedLimitLift:1,physicalClosedLimitTilt:2,currentPositionLift:3,currentPositionTilt:4,numberOfActuationsLift:5,numberOfActuationsTilt:6,configStatus:7,currentPositionLiftPercentage:8,currentPositionTiltPercentage:9,operationalStatus:10,targetPositionLiftPercent100ths:11,targetPositionTiltPercent100ths:12,endProductType:13,currentPositionLiftPercent100ths:14,currentPositionTiltPercent100ths:15,installedOpenLimitLift:16,installedClosedLimitLift:17,installedOpenLimitTilt:18,installedClosedLimitTilt:19,mode:23,safetyStatus:26},doorLock:{lockState:0,lockType:1,actuatorEnabled:2,doorState:3,numberOfTotalUsersSupported:17,numberOfPINUsersSupported:18,maxPINCodeLength:23,minPINCodeLength:24,language:33,autoRelockTime:35,soundVolume:36,operatingMode:37,supportedOperatingModes:38,wrongCodeEntryLimit:48},fanControl:{fanMode:0,fanModeSequence:1,percentSetting:2,percentCurrent:3,speedMax:4,speedSetting:5,speedCurrent:6,rockSupport:7,rockSetting:8,windSupport:9,windSetting:10,airflowDirectionSupport:11,airflowDirection:12},occupancySensing:{occupancy:0,occupancySensorType:1,occupancySensorTypeBitmap:2,holdTime:3,pirOccupiedToUnoccupiedDelay:16,pirUnoccupiedToOccupiedDelay:17},illuminanceMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,lightSensorType:4},temperatureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},pressureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,scaledValue:16,minScaledValue:17,maxScaledValue:18,scale:20},flowMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},relativeHumidityMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},powerSource:{status:0,order:1,description:2,batVoltage:11,batPercentRemaining:12,batTimeRemaining:13,batChargeLevel:14,batReplacementNeeded:15,batReplaceability:16,batPresent:17,activeBatFaults:18,batChargeState:26}};function u(Y){return"0x"+Y.toString(16).toUpperCase().padStart(4,"0")}let f=I(Ei([])),g=Ei(new Map);function p(Y){if(Y==null)return"—";if(typeof Y=="boolean"||typeof Y=="number")return String(Y);if(typeof Y=="string")return Y.length>50?Y.slice(0,47)+"…":Y;const Oe=JSON.stringify(Y);return Oe.length>60?Oe.slice(0,57)+"…":Oe}function C(Y){return Y==null?"—":typeof Y=="boolean"||typeof Y=="number"?String(Y):typeof Y=="string"?Y:JSON.stringify(Y)}function b(Y){return Y!==null&&typeof Y=="object"&&!Array.isArray(Y)}function y(Y){return Array.isArray(Y)&&Y.length>0&&Y.every(b)}function w(Y,Oe){return!!(Oe==="attributeList"||Array.isArray(Y)&&Y.length===0||b(Y)&&Object.keys(Y).length===0)}function A(Y){return new Date(Y).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const P=500,M=20,R=32;let T=0,V=I(Ei([])),W=I(!0),Q=I(180),ne=Tt(()=>{const Y=Math.max(1,Math.floor((c(Q)-R)/M)+1);return c(V).slice(0,Y)});function de(Y){Y.preventDefault();const Oe=Y.clientY,Ve=c(Q);function ye(Ot){m(Q,Math.max(60,Math.min(600,Ve+Oe-Ot.clientY)),!0)}function At(){document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",At)}document.addEventListener("mousemove",ye),document.addEventListener("mouseup",At)}let te=I(null),he=I(!1),De=I(null),oe=I(!1),ge=I("passcode"),Se=I(""),Re=I(""),xe=I(""),et=I(!1),We=I(null),_e=I(""),dt=I(!1),Wt=I(""),tt=I(void 0),kt=I(void 0),be=null,Rt=null;function ut(){Rt!==null&&(cancelAnimationFrame(Rt),Rt=null),be&&(be.getTracks().forEach(Y=>Y.stop()),be=null),m(dt,!1),m(Wt,"")}function at(Y){ut(),m(ge,"pairingCode"),m(xe,Y,!0)}function Ze(){if(!c(kt))return null;const Y=c(kt).getContext("2d",{willReadFrequently:!0}),{width:Oe,height:Ve}=c(kt);if(!Oe||!Ve)return null;const ye=Y.getImageData(0,0,Oe,Ve);return eY(ye.data,ye.width,ye.height,{inversionAttempts:"dontInvert"})}async function Pt(){if(m(dt,!0),m(Wt,""),await ul(),!c(tt)||!c(kt))return;try{be=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}),c(tt).srcObject=be,await c(tt).play()}catch(Oe){m(Wt,"Camera unavailable: "+(Oe instanceof Error?Oe.message:String(Oe)));return}const Y=()=>{var Oe;if(!(!c(tt)||!c(kt)||!be)){if(c(tt).readyState===c(tt).HAVE_ENOUGH_DATA){c(kt).width=c(tt).videoWidth,c(kt).height=c(tt).videoHeight,c(kt).getContext("2d",{willReadFrequently:!0}).drawImage(c(tt),0,0);const ye=Ze();if((Oe=ye==null?void 0:ye.data)!=null&&Oe.startsWith("MT:")){at(ye.data);return}}Rt=requestAnimationFrame(Y)}};Rt=requestAnimationFrame(Y)}function ui(Y){var ye;const Oe=(ye=Y.target.files)==null?void 0:ye[0];if(!Oe)return;const Ve=new FileReader;Ve.onload=At=>{const Ot=new Image;Ot.onload=()=>{var xi;if(!c(kt))return;c(kt).width=Ot.width,c(kt).height=Ot.height,c(kt).getContext("2d",{willReadFrequently:!0}).drawImage(Ot,0,0);const oi=Ze();(xi=oi==null?void 0:oi.data)!=null&&xi.startsWith("MT:")?at(oi.data):m(Wt,"No Matter QR code found in image.")},Ot.src=At.target.result},Ve.readAsDataURL(Oe)}const wt="she:matter:selectedNodeId";async function Ft(){try{m(f,await gF(),!0);for(const Y of c(f))gm(Y.nodeId).then(Oe=>{g.set(Y.nodeId,Oe)}).catch(()=>{});if(c(f).length>0&&!c(te)){const Y=localStorage.getItem(wt),Oe=Y&&c(f).find(Ve=>Ve.nodeId===Y)?Y:c(f)[0].nodeId;Vt(Oe)}}catch{m(f,[],!0)}}async function Vt(Y){m(he,!0),m(De,null);try{m(te,await gm(Y),!0),g.set(Y,c(te)),localStorage.setItem(wt,Y)}catch(Oe){m(De,Oe instanceof Error?Oe.message:String(Oe),!0)}finally{m(he,!1)}}let zt;async function Zt(Y){var Oe;if(await zt.show(`Unpair device ${Y}?`,{confirm:"Unpair",danger:!0}))try{await nU(Y),((Oe=c(te))==null?void 0:Oe.nodeId)===Y&&m(te,null),await Ft()}catch(Ve){m(De,Ve instanceof Error?Ve.message:String(Ve),!0)}}async function mt(){m(et,!0),m(We,null);try{let Y;c(ge)==="passcode"?(Y={passcode:Number(c(Se))},c(Re)&&(Y={...Y,discriminator:Number(c(Re))})):Y={pairingCode:c(xe).trim()},c(_e).trim()&&(Y={...Y,discoveryAddress:c(_e).trim()}),await iU(Y),m(oe,!1),m(Se,""),m(Re,""),m(xe,""),m(_e,""),await Ft()}catch(Y){m(We,Y instanceof Error?Y.message:String(Y),!0)}finally{m(et,!1)}}Ks(()=>{Ft()});const Mi=ar("matter:deviceList",Y=>{if(!Array.isArray(Y.devices))return;const Oe=Y.devices;for(const Ve of Oe)g.has(Ve.nodeId)||gm(Ve.nodeId).then(ye=>{g.set(Ve.nodeId,ye)}).catch(()=>{});m(f,Oe,!0)}),Ri=ar("matter:deviceStatus",Y=>{if(Y.nodeId===void 0)return;const Oe=String(Y.nodeId),Ve=!!Y.online;m(f,c(f).map(ye=>ye.nodeId===Oe?{...ye,online:Ve}:ye),!0),m(V,[{id:T++,kind:"status",nodeId:Oe,online:Ve,ts:Date.now()},...c(V).slice(0,P-1)],!0)}),Di=ar("matter:attr",Y=>{const Oe=String(Y.nodeId),Ve=Y.endpointId,ye=String(Y.clusterName),At=String(Y.attrName),Ot=Y.value;if(c(te)&&c(te).nodeId===Oe){const oi=c(te).endpoints.find(Ut=>Ut.endpointId===Ve),xi=oi==null?void 0:oi.clusters.find(Ut=>Ut.name===ye);xi&&(xi.attrs[At]=Ot)}const ri=g.get(Oe);if(ri){const oi=ri.endpoints.find(Ut=>Ut.endpointId===Ve),xi=oi==null?void 0:oi.clusters.find(Ut=>Ut.name===ye);xi&&(xi.attrs[At]=Ot)}m(V,[{id:T++,kind:"attr",nodeId:Oe,endpointId:Ve,clusterName:ye,attrName:At,value:Ot,ts:Y.ts??Date.now()},...c(V).slice(0,P-1)],!0)});Tp(()=>{Mi(),Ri(),Di(),ut()});var Ui=qY(),ji=yt(Ui);us(qc(ji,{}),Y=>zt=Y,()=>zt);var Bi=v(ji,2),fn=_(Bi),an=_(fn),Zi=_(an),_n=v(_(Zi),2),gt=v(Zi,2);{var Yt=Y=>{var Oe=nY(),Ve=_(Oe),ye=_(Ve);let At;var Ot=v(ye,2);let ri;var oi=v(Ve,2);{var xi=Jt=>{var fe=tY(),Ke=yt(fe),ot=v(_(Ke)),rt=v(Ke,2),ht=v(_(rt));jt(ot,()=>c(Se),_t=>m(Se,_t)),jt(ht,()=>c(Re),_t=>m(Re,_t)),D(Jt,fe)},Ut=Jt=>{var fe=iY(),Ke=yt(fe),ot=v(_(Ke)),rt=v(Ke,2),ht=_(rt),_t=v(ht,2),Xt=v(_(_t),2);jt(ot,()=>c(xe),F=>m(xe,F)),$("click",ht,Pt),$("change",Xt,ui),D(Jt,fe)};z(oi,Jt=>{c(ge)==="passcode"?Jt(xi):Jt(Ut,-1)})}var mi=v(oi,2),He=v(_(mi)),Ye=v(mi,2);{var Qt=Jt=>{var fe=$A(),Ke=_(fe);j(()=>O(Ke,c(We))),D(Jt,fe)};z(Ye,Jt=>{c(We)&&Jt(Qt)})}var Gt=v(Ye,2),gi=_(Gt);j(()=>{At=Bt(ye,1,"svelte-1ua3isv",null,At,{active:c(ge)==="passcode"}),ri=Bt(Ot,1,"svelte-1ua3isv",null,ri,{active:c(ge)==="pairingCode"}),Gt.disabled=c(et),O(gi,c(et)?"Commissioning…":"Commission")}),$("click",ye,()=>m(ge,"passcode")),$("click",Ot,()=>m(ge,"pairingCode")),jt(He,()=>c(_e),Jt=>m(_e,Jt)),$("click",Gt,mt),D(Y,Oe)};z(gt,Y=>{c(oe)&&Y(Yt)})}var Ci=v(gt,2),Wi=_(Ci);ei(Wi,17,()=>c(f),Y=>Y.nodeId,(Y,Oe)=>{var Ve=rY();let ye;var At=_(Ve),Ot=_(At);let ri;var oi=v(Ot,2),xi=_(oi);{var Ut=Ye=>{var Qt=sY(),Gt=yt(Qt),gi=_(Gt),Jt=v(Gt,2),fe=_(Jt);j(()=>{O(gi,c(Oe).name),O(fe,`#${c(Oe).nodeId??""}`)}),D(Ye,Qt)},mi=Ye=>{var Qt=oY(),Gt=_(Qt);j(()=>O(Gt,`Node ${c(Oe).nodeId??""}`)),D(Ye,Qt)};z(xi,Ye=>{c(Oe).name?Ye(Ut):Ye(mi,-1)})}var He=v(At,2);j(()=>{var Ye;ye=Bt(Ve,1,"svelte-1ua3isv",null,ye,{selected:((Ye=c(te))==null?void 0:Ye.nodeId)===c(Oe).nodeId}),ri=Bt(Ot,1,"status-dot svelte-1ua3isv",null,ri,{online:c(Oe).online})}),$("click",At,()=>Vt(c(Oe).nodeId)),$("click",He,()=>Zt(c(Oe).nodeId)),D(Y,Ve)});var Pi=v(Wi,2);{var Ti=Y=>{var Oe=aY();D(Y,Oe)};z(Pi,Y=>{c(f).length===0&&Y(Ti)})}var Oi=v(an,2),Qi=_(Oi);{var yi=Y=>{var Oe=lY();D(Y,Oe)},Xe=Y=>{var Oe=$A(),Ve=_(Oe);j(()=>O(Ve,c(De))),D(Y,Oe)},St=Y=>{var Oe=MY(),Ve=yt(Oe),ye=_(Ve),At=_(ye),Ot=v(ye,2);{var ri=mi=>{var He=cY(),Ye=_(He);j(()=>O(Ye,c(te).subtitle)),D(mi,He)};z(Ot,mi=>{c(te).subtitle&&mi(ri)})}var oi=v(Ot,2),xi=_(oi),Ut=v(Ve,2);ei(Ut,17,()=>c(te).endpoints,mi=>mi.endpointId,(mi,He)=>{var Ye=TY(),Qt=_(Ye),Gt=_(Qt),gi=v(Gt),Jt=_(gi),fe=v(gi,2);ei(fe,21,()=>c(He).clusters,Ni,(ht,_t)=>{var Xt=dY(),F=_(Xt);j(()=>O(F,c(_t).name)),D(ht,Xt)});var Ke=v(Qt,2);{var ot=ht=>{var _t=IY(),Xt=v(_(_t));ei(Xt,21,()=>c(He).clusters,Ni,(F,H)=>{var K=LY(),le=yt(K),Z=_(le),J=_(Z),ce=v(le,2);ei(ce,17,()=>Object.entries(c(H).attrs),Ni,(Qe,ae)=>{var pe=Tt(()=>o8(c(ae),2));let Te=()=>c(pe)[0],me=()=>c(pe)[1];var Ie=Es(),lt=yt(Ie);{var G=Ne=>{const it=Tt(()=>{var Li;return(Li=t[c(H).name])==null?void 0:Li[Te()]}),Pe=Tt(()=>(Te()==="acceptedCommandList"||Te()==="generatedCommandList")&&Array.isArray(me())),ke=Tt(()=>{var Li;return((Li=d[c(H).name])==null?void 0:Li[Te()])??a[Te()]});var bt=FY(),vt=_(bt),Fe=_(vt),Dt=_(Fe),Ge=v(Fe);{var ze=Li=>{var ni=uY(),ii=_(ni);j(Xi=>O(ii,`(${Xi??""})`),[()=>u(c(ke))]),D(Li,ni)};z(Ge,Li=>{c(ke)!==void 0&&Li(ze)})}var Je=v(vt),Ct=_(Je);{var $e=Li=>{var ni=fY();ei(ni,21,()=>c(it),Ni,(ii,Xi)=>{var Ji=hY(),Ln=_(Ji);j(()=>O(Ln,c(Xi).label)),$("click",Ji,()=>i(c(te).nodeId,c(He).endpointId,c(H).name,c(Xi).command,c(Xi).args)),D(ii,Ji)}),D(Li,ni)};z(Ct,Li=>{c(it)&&Li($e)})}var It=v(Je),Me=_(It);{var st=Li=>{var ni=vY();ei(ni,21,()=>s(c(H).name,me()),Ni,(ii,Xi,Ji)=>{var Ln=mY(),Jn=yt(Ln);{var Ss=ss=>{var ps=gY();D(ss,ps)};z(Jn,ss=>{Ji>0&&ss(Ss)})}var as=v(Jn,2);{var Bs=ss=>{var ps=pY(),zi=yt(ps),Ys=_(zi),Pn=v(zi),Vn=_(Pn);j(()=>{O(Ys,c(Xi).name),O(Vn,`(${c(Xi).id??""})`)}),D(ss,ps)},kn=ss=>{var ps=xY(),zi=_(ps);j(()=>O(zi,c(Xi).id)),D(ss,ps)};z(as,ss=>{c(Xi).name?ss(Bs):ss(kn,-1)})}D(ii,Ln)}),D(Li,ni)},Lt=Li=>{var ni=CY(),ii=v(_(ni));ei(ii,21,me,Ni,(Xi,Ji)=>{const Ln=Tt(()=>c(Ji)),Jn=Tt(()=>c(Ln).deviceType),Ss=Tt(()=>r[c(Jn)]);var as=bY(),Bs=_(as),kn=_(Bs);{var ss=Pn=>{var Vn=_Y(),Ts=yt(Vn),dr=v(Ts),Or=_(dr);j(Za=>{O(Ts,`${c(Ss)??""} `),O(Or,`(${Za??""})`)},[()=>u(c(Jn))]),D(Pn,Vn)},ps=Pn=>{var Vn=_o();j(Ts=>O(Vn,Ts),[()=>u(c(Jn))]),D(Pn,Vn)};z(kn,Pn=>{c(Ss)?Pn(ss):Pn(ps,-1)})}var zi=v(Bs),Ys=_(zi);j(Pn=>O(Ys,Pn),[()=>C(c(Ln).revision)]),D(Xi,as)}),D(Li,ni)},Ht=Tt(()=>Te()==="deviceTypeList"&&Array.isArray(me())),pt=Li=>{const ni=Tt(()=>[...new Set(me().flatMap(Jn=>Object.keys(Jn)))]);var ii=SY(),Xi=_(ii),Ji=_(Xi);ei(Ji,21,()=>c(ni),Ni,(Jn,Ss)=>{var as=EY(),Bs=_(as);j(()=>O(Bs,c(Ss))),D(Jn,as)});var Ln=v(Xi);ei(Ln,21,me,Ni,(Jn,Ss)=>{var as=wY();ei(as,21,()=>c(ni),Ni,(Bs,kn)=>{var ss=yY(),ps=_(ss);j(zi=>O(ps,zi),[()=>C(c(Ss)[c(kn)])]),D(Bs,ss)}),D(Jn,as)}),D(Li,ii)},vi=Tt(()=>y(me())),wi=Li=>{var ni=AY(),ii=_(ni);ei(ii,21,()=>Object.entries(me()),Ni,(Xi,Ji)=>{var Ln=Tt(()=>o8(c(Ji),2));let Jn=()=>c(Ln)[0],Ss=()=>c(Ln)[1];var as=DY(),Bs=_(as),kn=_(Bs),ss=v(Bs),ps=_(ss);j(zi=>{O(kn,Jn()),O(ps,zi)},[()=>C(Ss())]),D(Xi,as)}),D(Li,ni)},qi=Tt(()=>b(me())),Fi=Li=>{var ni=kY(),ii=_(ni);j(()=>{ln(ni,"href",me()),O(ii,me())}),D(Li,ni)},Gi=Li=>{var ni=BY(),ii=_(ni);j(Xi=>O(ii,Xi),[()=>C(me())]),D(Li,ni)};z(Me,Li=>{c(Pe)?Li(st):c(Ht)?Li(Lt,1):c(vi)?Li(pt,2):c(qi)?Li(wi,3):(Te()==="productUrl"||Te()==="productURL")&&typeof me()=="string"?Li(Fi,4):Li(Gi,-1)})}j(()=>{ln(vt,"title",Te()),O(Dt,Te())}),D(Ne,bt)},re=Tt(()=>!w(me(),Te()));z(lt,Ne=>{c(re)&&Ne(G)})}D(Qe,Ie)}),j(()=>O(J,c(H).name)),D(F,K)}),D(ht,_t)},rt=ht=>{var _t=PY();D(ht,_t)};z(Ke,ht=>{c(He).clusters.length>0?ht(ot):ht(rt,-1)})}j(()=>{O(Gt,`${c(He).name??`Endpoint ${c(He).endpointId}`??""} `),O(Jt,`ep${c(He).endpointId??""}`)}),D(mi,Ye)}),j(()=>{O(At,c(te).name??`Node ${c(te).nodeId}`),O(xi,`Node ID: ${c(te).nodeId??""}`)}),D(Y,Oe)},Ai=Y=>{var Oe=RY();D(Y,Oe)};z(Qi,Y=>{c(he)?Y(yi):c(De)?Y(Xe,1):c(te)?Y(St,2):Y(Ai,-1)})}var ki=v(fn,2),fi=_(ki),Ii=v(fi,2),X=v(_(Ii),2);{var Ae=Y=>{var Oe=NY(),Ve=_(Oe);j(()=>O(Ve,c(V).length)),D(Y,Oe)};z(X,Y=>{!c(W)&&c(V).length>0&&Y(Ae)})}var qe=v(X,2),nt=_(qe),qt=v(Ii,2);{var se=Y=>{var Oe=VY(),Ve=_(Oe);{var ye=Ot=>{var ri=OY();D(Ot,ri)},At=Ot=>{var ri=Es(),oi=yt(ri);ei(oi,17,()=>c(ne),xi=>xi.id,(xi,Ut)=>{const mi=Tt(()=>{var ot,rt;return((ot=g.get(c(Ut).nodeId))==null?void 0:ot.name)??((rt=c(f).find(ht=>ht.nodeId===c(Ut).nodeId))==null?void 0:rt.name)??null}),He=Tt(()=>{var ot,rt;return c(Ut).endpointId!==void 0?((rt=(ot=g.get(c(Ut).nodeId))==null?void 0:ot.endpoints.find(ht=>ht.endpointId===c(Ut).endpointId))==null?void 0:rt.name)??null:null}),Ye=Tt(()=>c(Ut).attrName??c(Ut).clusterName);var Qt=zY(),Gt=_(Qt),gi=_(Gt),Jt=v(Gt,2);{var fe=ot=>{var rt=HY(),ht=v(yt(rt),2),_t=_(ht),Xt=v(_t);{var F=Z=>{var J=GC(),ce=v(yt(J)),Qe=_(ce);j(()=>O(Qe,`(#${c(Ut).nodeId??""})`)),D(Z,J)};z(Xt,Z=>{c(mi)&&Z(F)})}var H=v(ht,2);let K;var le=_(H);j(()=>{O(_t,c(mi)??`#${c(Ut).nodeId}`),K=Bt(H,1,"e-val svelte-1ua3isv",null,K,{"e-online":c(Ut).online,"e-offline":!c(Ut).online}),O(le,c(Ut).online?"online":"offline")}),D(ot,rt)},Ke=ot=>{var rt=WY(),ht=v(yt(rt),2),_t=_(ht),Xt=v(_t);{var F=me=>{var Ie=GC(),lt=v(yt(Ie)),G=_(lt);j(()=>O(G,`(#${c(Ut).nodeId??""})`)),D(me,Ie)};z(Xt,me=>{c(mi)&&me(F)})}var H=v(ht,2),K=_(H),le=v(K);{var Z=me=>{var Ie=GC(),lt=v(yt(Ie)),G=_(lt);j(()=>O(G,`(ep ${c(Ut).endpointId??""})`)),D(me,Ie)};z(le,me=>{c(He)&&me(Z)})}var J=v(H,2),ce=_(J),Qe=v(J,2),ae=_(Qe),pe=v(Qe,2),Te=_(pe);j(me=>{O(_t,c(mi)??`#${c(Ut).nodeId}`),O(K,c(He)??`ep${c(Ut).endpointId}`),O(ce,c(Ut).clusterName),O(ae,c(Ye)),O(Te,me)},[()=>p(c(Ut).value)]),D(ot,rt)};z(Jt,ot=>{c(Ut).kind==="status"?ot(fe):ot(Ke,-1)})}j(ot=>O(gi,ot),[()=>A(c(Ut).ts)]),D(xi,Qt)}),D(Ot,ri)};z(Ve,Ot=>{c(ne).length===0?Ot(ye):Ot(At,-1)})}D(Y,Oe)};z(qt,Y=>{c(W)&&Y(se)})}var Ee=v(Bi,2);{var Le=Y=>{var Oe=UY(),Ve=yt(Oe),ye=v(Ve,2),At=_(ye),Ot=v(_(At),2),ri=v(At,2);{var oi=mi=>{var He=jY(),Ye=_(He);j(()=>O(Ye,c(Wt))),D(mi,He)},xi=mi=>{var He=$Y(),Ye=yt(He),Qt=_(Ye);us(Qt,Gt=>m(tt,Gt),()=>c(tt)),D(mi,He)};z(ri,mi=>{c(Wt)?mi(oi):mi(xi,-1)})}var Ut=v(ri,2);us(Ut,mi=>m(kt,mi),()=>c(kt)),$("click",Ve,ut),$("click",Ot,ut),D(Y,Oe)};z(Ee,Y=>{c(dt)&&Y(Le)})}j(()=>{$o(ki,c(W)?`height: ${c(Q)}px;`:""),O(nt,c(W)?"▾":"▸")}),$("click",_n,()=>m(oe,!c(oe))),$("mousedown",fi,de),$("click",qe,()=>{m(W,!c(W))}),D(o,Ui),js()}Zs(["click","change","mousedown"]);var KY=B("<button>›</button>"),ZY=B('<span class="chev-ph svelte-1vejtrc"></span>'),XY=B('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),YY=B("<button>🔒</button>"),QY=B('<span class="acl-loading">Loading…</span>'),JY=B("<span> </span>"),eQ=B('<span class="acl-dyn svelte-1vejtrc" title="per-user/client pattern — cannot evaluate statically">⚠%u/%c</span>'),tQ=B('<span class="acl-members svelte-1vejtrc"> </span>'),iQ=B('<span class="acl-group svelte-1vejtrc"> </span>'),nQ=B('<span> <strong class="svelte-1vejtrc"> </strong> <!> <!> <!></span>'),sQ=B('<div class="acl-sec svelte-1vejtrc"><span class="acl-sec-hdr svelte-1vejtrc"> </span> <!></div>'),oQ=B('<div class="acl-panel svelte-1vejtrc"><!></div>'),rQ=B('<div class="tc svelte-1vejtrc"></div>'),aQ=B('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!> <!></div> <!> <!></div>'),lQ=B('<button class="acl-refresh svelte-1vejtrc" title="Refresh ACL data">↺</button>'),cQ=B('<button title="Show ACL coverage for topics"><svg width="11" height="11" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><rect x="3" y="7" width="10" height="8" rx="1.5"></rect><path d="M5 7V5a3 3 0 0 1 6 0v2" fill="none" stroke="currentColor" stroke-width="1.8"></path></svg> ACL<!></button> <!>',1),dQ=B("<option></option>"),uQ=B('<span class="pub-ok svelte-1vejtrc">✓</span>'),hQ=B('<span class="pub-err svelte-1vejtrc"> </span>'),fQ=B('<div class="info svelte-1vejtrc">Loading…</div>'),gQ=B('<div class="info err svelte-1vejtrc"> </div>'),pQ=B('<div class="info svelte-1vejtrc">No topics match.</div>'),xQ=B('<div class="vr svelte-1vejtrc"><span class="v-topic svelte-1vejtrc"> </span> <span class="v-val svelte-1vejtrc"> </span> <span class="v-ts svelte-1vejtrc"> </span></div>'),mQ=B('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),vQ=B('<div class="info svelte-1vejtrc">No topics yet.</div>'),_Q=B('<div class="tree-wrap svelte-1vejtrc"><!></div>'),bQ=B('<span class="stream-badge"> </span>'),CQ=B('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),EQ=B('<span class="s-ret svelte-1vejtrc" title="retained snapshot">&#x229B;</span>'),yQ=B('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),wQ=B('<div class="stream-body svelte-1vejtrc"><!></div>'),SQ=B('<div class="ctx-bd svelte-1vejtrc"></div> <div class="ctx-menu svelte-1vejtrc"><button class="svelte-1vejtrc">Copy topic</button> <button class="svelte-1vejtrc">Clear retained</button></div>',1),DQ=B('<label class="modal-check svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> Recursive — also clear all child topics</label>'),AQ=B('<div class="modal-bd svelte-1vejtrc"></div> <div class="modal svelte-1vejtrc"><div class="modal-title svelte-1vejtrc">Clear retained</div> <div class="modal-body svelte-1vejtrc"><p class="svelte-1vejtrc">Clear retained value for <code class="svelte-1vejtrc"> </code>?</p> <!></div> <div class="modal-footer svelte-1vejtrc"><button class="btn-cancel svelte-1vejtrc">Cancel</button> <button class="btn-confirm svelte-1vejtrc">Clear</button></div></div>',1),kQ=B('<div class="page svelte-1vejtrc"><div class="toolbar svelte-1vejtrc"><h2 class="svelte-1vejtrc">MQTT</h2> <!></div> <div class="main-group svelte-1vejtrc"><div class="pub-bar svelte-1vejtrc"><input class="pt svelte-1vejtrc" type="text" placeholder="topic" list="pub-topic-list" autocomplete="off"/> <datalist id="pub-topic-list"></datalist> <input class="pp svelte-1vejtrc" type="text" placeholder="payload"/> <label class="rl svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> retain</label> <select class="svelte-1vejtrc"><option>QoS 0</option><option>QoS 1</option><option>QoS 2</option></select> <button class="svelte-1vejtrc">Publish</button> <!> <!></div> <div class="tree-filter-bar svelte-1vejtrc"><input class="filter-in svelte-1vejtrc" type="search" placeholder="Filter topics…"/> <span class="count svelte-1vejtrc"><!> </span></div> <!></div> <div class="stream-panel svelte-1vejtrc"><div class="stream-resize svelte-1vejtrc"></div> <div class="stream-hdr-row svelte-1vejtrc"><input class="filter-in stream-filter-in svelte-1vejtrc" type="search" placeholder="Live stream filter (MQTT wildcard, default: #)"/> <!> <button class="stream-toggle svelte-1vejtrc" title="Toggle live stream"> </button></div> <!></div> <!> <!></div>');function BQ(o,e){Vs(e,!0);const t=(F,H=tb)=>{const K=Tt(()=>c(g).has(H().path)),le=Tt(()=>c(a)>=0&&H().children.size>0),Z=Tt(()=>c(a)>=0&&H().isLeaf&&!n.has(H().path));var J=aQ(),ce=_(J);let Qe;var ae=_(ce);{var pe=Fe=>{var Dt=KY();let Ge;j(()=>{Ge=Bt(Dt,1,"chev svelte-1vejtrc",null,Ge,{open:c(K)}),ln(Dt,"aria-label",c(K)?"Collapse":"Expand")}),$("click",Dt,()=>p(H().path)),D(Fe,Dt)},Te=Fe=>{var Dt=ZY();D(Fe,Dt)};z(ae,Fe=>{c(le)?Fe(pe):Fe(Te,-1)})}var me=v(ae,2),Ie=_(me),lt=v(me,2);{var G=Fe=>{var Dt=XY(),Ge=yt(Dt),ze=_(Ge),Je=v(Ge,2),Ct=_(Je);j(($e,It,Me)=>{ln(Ge,"title",$e),O(ze,It),O(Ct,Me)},[()=>{var $e;return wt(($e=zt(H().path))==null?void 0:$e.val)},()=>{var $e;return wt(($e=zt(H().path))==null?void 0:$e.val)},()=>{var $e;return(($e=zt(H().path))==null?void 0:$e.ts)!=null?Ft(zt(H().path).ts):""}]),D(Fe,Dt)},re=Tt(()=>H().isLeaf&&i.has(H().path));z(lt,Fe=>{c(re)&&Fe(G)})}var Ne=v(lt,2);{var it=Fe=>{const Dt=Tt(()=>!!c(Ui)&&Zi(H().path));var Ge=YY();let ze;j(()=>{ze=Bt(Ge,1,"acl-badge svelte-1vejtrc",null,ze,{matched:c(Dt)}),ln(Ge,"title",c(Dt)?"Has explicit ACL — click to inspect":"No explicit ACL — click to inspect defaults")}),$("click",Ge,Je=>{Je.stopPropagation(),gt(H().path)}),D(Fe,Ge)};z(Ne,Fe=>{c(Ri)&&H().isLeaf&&Fe(it)})}var Pe=v(ce,2);{var ke=Fe=>{var Dt=oQ(),Ge=_(Dt);{var ze=Ct=>{var $e=QY();D(Ct,$e)},Je=Ct=>{var $e=Es(),It=yt($e);ei(It,17,()=>[{label:"Send",section:c(Bi).send},{label:"Subscribe",section:c(Bi).subscribe},{label:"Receive",section:c(Bi).receive}],Ni,(Me,st)=>{var Lt=sQ(),Ht=_(Lt),pt=_(Ht),vi=v(Ht,2);{var wi=Fi=>{var Gi=JY();let Li;var ni=_(Gi);j(()=>{Li=Bt(Gi,1,"acl-def svelte-1vejtrc",null,Li,{allow:c(st).section.default,deny:!c(st).section.default}),O(ni,`${c(st).section.default?"allow":"deny"} (default)`)}),D(Fi,Gi)},qi=Fi=>{var Gi=Es(),Li=yt(Gi);ei(Li,17,()=>c(st).section.roles,Ni,(ni,ii)=>{var Xi=nQ();let Ji;var Ln=_(Xi),Jn=v(Ln),Ss=_(Jn),as=v(Jn,2);{var Bs=zi=>{var Ys=eQ();D(zi,Ys)};z(as,zi=>{c(ii).dynamic&&zi(Bs)})}var kn=v(as,2);{var ss=zi=>{var Ys=tQ(),Pn=_(Ys);j(Vn=>O(Pn,Vn),[()=>c(ii).users.join(", ")]),D(zi,Ys)};z(kn,zi=>{c(ii).users.length>0&&zi(ss)})}var ps=v(kn,2);ei(ps,17,()=>c(ii).groups,Ni,(zi,Ys)=>{var Pn=iQ(),Vn=_(Pn);j(()=>O(Vn,c(Ys).groupname)),D(zi,Pn)}),j(()=>{Ji=Bt(Xi,1,"acl-role svelte-1vejtrc",null,Ji,{allow:c(ii).allow,deny:!c(ii).allow}),O(Ln,`${c(ii).allow?"✓":"✗"} `),O(Ss,c(ii).rolename)}),D(ni,Xi)}),D(Fi,Gi)};z(vi,Fi=>{c(st).section.roles.length===0?Fi(wi):Fi(qi,-1)})}j(()=>O(pt,c(st).label)),D(Me,Lt)}),D(Ct,$e)};z(Ge,Ct=>{c(fn)?Ct(ze):c(Bi)&&Ct(Je,1)})}D(Fe,Dt)};z(Pe,Fe=>{c(Ri)&&H().isLeaf&&c(ji)===H().path&&Fe(ke)})}var bt=v(Pe,2);{var vt=Fe=>{var Dt=rQ();ei(Dt,21,()=>[...H().children.values()].sort((Ge,ze)=>Ge.seg.localeCompare(ze.seg)),Ge=>Ge.path,(Ge,ze)=>{t(Ge,()=>c(ze))}),D(Fe,Dt)};z(bt,Fe=>{c(le)&&c(K)&&Fe(vt)})}j(()=>{Qe=Bt(ce,1,"tr svelte-1vejtrc",null,Qe,{stale:c(Z)}),O(Ie,H().seg)}),$("click",ce,()=>{m(he,H().path+"/#")}),$("contextmenu",ce,Fe=>{Fe.preventDefault(),m(_e,{x:Fe.clientX,y:Fe.clientY,topic:H().path},!0)}),D(F,J)},i=new Map,n=new Set,s=new Set;let r=null,a=I(0);function d(){r===null&&(r=requestAnimationFrame(()=>{r=null;for(const F of s)f(F);s.clear(),l8(a)}))}const u=new Map;function f(F){const H=F.split("/");let K=u,le="";for(let Z=0;Z<H.length;Z++){const J=H[Z];le=Z===0?J:`${le}/${J}`,K.has(J)||K.set(J,{seg:J,path:le,children:new Map,isLeaf:!1});const ce=K.get(J);Z===H.length-1&&(ce.isLeaf=!0),K=ce.children}}let g=I(Ei(new Set));function p(F){const H=new Set(c(g));H.has(F)?H.delete(F):H.add(F),m(g,H,!0)}let C=I("");const b=24,y=5;let w=I(0),A=I(300),P=Tt(()=>{if(c(a),!c(C))return[];const F=c(C).toLowerCase().split(/\s+/).filter(Boolean),H=[];for(const[K,le]of i){const Z=K.toLowerCase();F.every(J=>Z.includes(J))&&H.push({topic:K,...le})}return H.sort((K,le)=>K.topic.localeCompare(le.topic))}),M=Tt(()=>{const F=c(P).length,H=Math.max(0,Math.floor(c(w)/b)-y),K=Math.min(F,Math.ceil((c(w)+c(A))/b)+y);return{start:H,end:K,totalH:F*b,top:H*b}});const R=1e3,T=200,V=20,W=36;let Q=0,ne=I(Ei([])),de=I(Ei([])),te=I(!0),he=I("#"),De=I(200);$n(()=>{const F=c(he).trim(),H=Ol(()=>c(ne)),K=!F||F==="#"?H.slice(0,T):H.filter(le=>oe(F,le.topic)).slice(0,T);if(F&&F!=="#"){const le=new Set(K.map(J=>J.topic)),Z=[];for(const[J,ce]of i)le.has(J)||oe(F,J)&&Z.push({id:-(Z.length+1),topic:J,val:ce.val,ts:ce.ts,retained:!0});Z.sort((J,ce)=>J.topic.localeCompare(ce.topic)),m(de,[...K,...Z],!0)}else m(de,K,!0)});function oe(F,H){if(F==="#")return!0;const K=F.split("/"),le=H.split("/");for(let Z=0;Z<K.length;Z++){if(K[Z]==="#")return!0;if(Z>=le.length||K[Z]!=="+"&&K[Z]!==le[Z])return!1}return K.length===le.length}function ge(F){F.preventDefault();const H=F.clientY,K=c(De);function le(J){m(De,Math.max(60,Math.min(800,K+H-J.clientY)),!0)}function Z(){document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",Z)}document.addEventListener("mousemove",le),document.addEventListener("mouseup",Z)}let Se=Tt(()=>{const F=Math.max(1,Math.floor((c(De)-W)/V)+1);return c(de).slice(0,F)}),Re=I(!0),xe=I(null);async function et(){m(Re,!0),m(xe,null);try{const F=await pF();for(const H of F)i.set(H.topic,{val:H.val,ts:H.ts}),f(H.topic)}catch(F){m(xe,F instanceof Error?F.message:String(F),!0)}finally{m(Re,!1),l8(a)}}const We=ar("mqtt",F=>{const{topic:H,val:K,ts:le}=F;i.set(H,{val:K,ts:le}),n.add(H),s.add(H),d();const Z={id:Q++,topic:H,val:K,ts:le};m(ne,[Z,...c(ne).slice(0,R-1)],!0);const J=c(he).trim();(!J||J==="#"||oe(J,H))&&m(de,[Z,...c(de).filter(ce=>!(ce.retained&&ce.topic===H)).slice(0,T-1)],!0)});let _e=I(null),dt=I(null);async function Wt(F,H){const K=[F];if(H){const le=F+"/";for(const Z of i.keys())Z.startsWith(le)&&K.push(Z)}for(const le of K)await dA(le,"",!0,0)}let tt=Tt(()=>(c(a),[...i.keys()].sort())),kt=I(""),be=I(""),Rt=I(!1),ut=I(0),at=I(!1),Ze=I(null),Pt=I(!1);async function ui(){if(c(kt)){m(at,!0),m(Ze,null),m(Pt,!1);try{await dA(c(kt),c(be),c(Rt),c(ut)),m(Pt,!0),setTimeout(()=>{m(Pt,!1)},2e3)}catch(F){m(Ze,F instanceof Error?F.message:String(F),!0)}finally{m(at,!1)}}}function wt(F){return F==null?"":typeof F=="object"?JSON.stringify(F):String(F)}function Ft(F){return new Date(F).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Vt(F){return new Date(F).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function zt(F){return c(a),i.get(F)}let Zt=Tt(()=>(c(a),[...u.values()].sort((F,H)=>F.seg.localeCompare(H.seg)))),mt=Tt(()=>(c(a),i.size)),Mi=I(!1),Ri=I(!1),Di=I(!1),Ui=I(null),ji=I(null),Bi=I(null),fn=I(!1);function an(F,H,K){return H.includes("%u")||H.includes("%c")?"dynamic":F==="subscribeLiteral"||F==="unsubscribeLiteral"?H===K?"match":"no-match":oe(H,K)?"match":"no-match"}function Zi(F){if(!c(Ui))return!1;for(const H of c(Ui).roles)if(H.acls){for(const K of H.acls)if(an(K.acltype,K.topic,F)!=="no-match")return!0}return!1}async function _n(){m(Di,!0);try{const F=await EF();m(Ui,{roles:F.roles},!0)}catch{m(Ui,null),m(Ri,!1)}finally{m(Di,!1)}}async function gt(F){if(c(ji)===F){m(ji,null),m(Bi,null);return}m(ji,F,!0),m(Bi,null),m(fn,!0);try{m(Bi,await BU(F),!0)}catch{m(Bi,null)}finally{m(fn,!1)}}async function Yt(){c(Ri)?(m(Ri,!1),m(ji,null),m(Bi,null)):(m(Ri,!0),m(ji,null),m(Bi,null),c(Ui)||await _n())}Ks(et),Ks(async()=>{var F;try{const H=await oS();m(Mi,!!((F=H.dynsec)!=null&&F.dynsecReady),!0)}catch{m(Mi,!1)}}),Tp(()=>{We(),r!==null&&cancelAnimationFrame(r)});var Ci=kQ(),Wi=_(Ci),Pi=v(_(Wi),2);{var Ti=F=>{var H=cQ(),K=yt(H);let le;var Z=v(_(K),2);{var J=ae=>{var pe=_o("…");D(ae,pe)};z(Z,ae=>{c(Di)&&ae(J)})}var ce=v(K,2);{var Qe=ae=>{var pe=lQ();j(()=>pe.disabled=c(Di)),$("click",pe,_n),D(ae,pe)};z(ce,ae=>{c(Ri)&&ae(Qe)})}j(()=>{le=Bt(K,1,"acl-btn svelte-1vejtrc",null,le,{active:c(Ri)}),K.disabled=c(Di)}),$("click",K,Yt),D(F,H)};z(Pi,F=>{c(Mi)&&F(Ti)})}var Oi=v(Wi,2),Qi=_(Oi),yi=_(Qi),Xe=v(yi,2);ei(Xe,20,()=>c(tt),F=>F,(F,H)=>{var K=dQ(),le={};j(()=>{le!==(le=H)&&(K.value=(K.__value=H)??"")}),D(F,K)});var St=v(Xe,2),Ai=v(St,2),ki=_(Ai),fi=v(Ai,2),Ii=_(fi);Ii.value=Ii.__value=0;var X=v(Ii);X.value=X.__value=1;var Ae=v(X);Ae.value=Ae.__value=2;var qe=v(fi,2),nt=v(qe,2);{var qt=F=>{var H=uQ();D(F,H)};z(nt,F=>{c(Pt)&&F(qt)})}var se=v(nt,2);{var Ee=F=>{var H=hQ(),K=_(H);j(()=>O(K,c(Ze))),D(F,H)};z(se,F=>{c(Ze)&&F(Ee)})}var Le=v(Qi,2),Y=_(Le),Oe=v(Y,2),Ve=_(Oe);{var ye=F=>{var H=_o();j(()=>O(H,`${c(P).length??""} /`)),D(F,H)};z(Ve,F=>{c(C)&&F(ye)})}var At=v(Ve),Ot=v(Le,2);{var ri=F=>{var H=fQ();D(F,H)},oi=F=>{var H=gQ(),K=_(H);j(()=>O(K,c(xe))),D(F,H)},xi=F=>{var H=Es(),K=yt(H);{var le=J=>{var ce=pQ();D(J,ce)},Z=J=>{var ce=mQ(),Qe=_(ce),ae=_(Qe);ei(ae,21,()=>c(P).slice(c(M).start,c(M).end),pe=>pe.topic,(pe,Te)=>{var me=xQ(),Ie=_(me),lt=_(Ie),G=v(Ie,2),re=_(G),Ne=v(G,2),it=_(Ne);j((Pe,ke,bt)=>{O(lt,c(Te).topic),ln(G,"title",Pe),O(re,ke),O(it,bt)},[()=>wt(c(Te).val),()=>wt(c(Te).val),()=>Ft(c(Te).ts)]),D(pe,me)}),j(()=>{$o(Qe,`height: ${c(M).totalH??""}px; position: relative;`),$o(ae,`top: ${c(M).top??""}px;`)}),fs("scroll",ce,pe=>{m(w,pe.currentTarget.scrollTop,!0)}),dP(ce,"clientHeight",pe=>m(A,pe)),D(J,ce)};z(K,J=>{c(P).length===0?J(le):J(Z,-1)})}D(F,H)},Ut=F=>{var H=_Q(),K=_(H);{var le=J=>{var ce=vQ();D(J,ce)},Z=J=>{var ce=Es(),Qe=yt(ce);ei(Qe,17,()=>c(Zt),ae=>ae.path,(ae,pe)=>{t(ae,()=>c(pe))}),D(J,ce)};z(K,J=>{c(Zt).length===0?J(le):J(Z,-1)})}D(F,H)};z(Ot,F=>{c(Re)?F(ri):c(xe)?F(oi,1):c(C)?F(xi,2):F(Ut,-1)})}var mi=v(Oi,2),He=_(mi),Ye=v(He,2),Qt=_(Ye),Gt=v(Qt,2);{var gi=F=>{var H=bQ(),K=_(H);j(()=>O(K,c(de).length)),D(F,H)};z(Gt,F=>{!c(te)&&c(de).length>0&&F(gi)})}var Jt=v(Gt,2),fe=_(Jt),Ke=v(Ye,2);{var ot=F=>{var H=wQ(),K=_(H);{var le=J=>{var ce=CQ();D(J,ce)},Z=J=>{var ce=Es(),Qe=yt(ce);ei(Qe,17,()=>c(Se),ae=>ae.id,(ae,pe)=>{var Te=yQ();let me;var Ie=_(Te),lt=_(Ie),G=v(Ie,2);{var re=bt=>{var vt=EQ();D(bt,vt)};z(G,bt=>{c(pe).retained&&bt(re)})}var Ne=v(G,2),it=_(Ne),Pe=v(Ne,2),ke=_(Pe);j((bt,vt,Fe)=>{me=Bt(Te,1,"sr svelte-1vejtrc",null,me,{retained:c(pe).retained}),O(lt,bt),O(it,c(pe).topic),ln(Pe,"title",vt),O(ke,Fe)},[()=>Vt(c(pe).ts),()=>wt(c(pe).val),()=>wt(c(pe).val)]),D(ae,Te)}),D(J,ce)};z(K,J=>{c(Se).length===0?J(le):J(Z,-1)})}D(F,H)};z(Ke,F=>{c(te)&&F(ot)})}var rt=v(mi,2);{var ht=F=>{var H=SQ(),K=yt(H),le=v(K,2);let Z;var J=_(le),ce=v(J,2);j(()=>Z=$o(le,"",Z,{left:`${c(_e).x??""}px`,top:`${c(_e).y??""}px`})),$("click",K,()=>m(_e,null)),$("contextmenu",K,Qe=>{Qe.preventDefault(),m(_e,null)}),$("click",J,()=>{navigator.clipboard.writeText(c(_e).topic),m(_e,null)}),$("click",ce,()=>{const Qe=c(_e).topic,ae=Qe+"/",pe=[...i.keys()].some(Te=>Te.startsWith(ae));m(dt,{topic:Qe,hasChildren:pe,recursive:!1},!0),m(_e,null)}),D(F,H)};z(rt,F=>{c(_e)&&F(ht)})}var _t=v(rt,2);{var Xt=F=>{var H=AQ(),K=yt(H),le=v(K,2),Z=v(_(le),2),J=_(Z),ce=v(_(J)),Qe=_(ce),ae=v(J,2);{var pe=lt=>{var G=DQ(),re=_(G);Cs(re,()=>c(dt).recursive,Ne=>c(dt).recursive=Ne),D(lt,G)};z(ae,lt=>{c(dt).hasChildren&&lt(pe)})}var Te=v(Z,2),me=_(Te),Ie=v(me,2);j(()=>O(Qe,c(dt).topic)),$("click",K,()=>m(dt,null)),$("click",me,()=>m(dt,null)),$("click",Ie,()=>{const{topic:lt,recursive:G}=c(dt);m(dt,null),Wt(lt,G)}),D(F,H)};z(_t,F=>{c(dt)&&F(Xt)})}j(()=>{qe.disabled=c(at)||!c(kt),O(At,` ${c(mt)??""}`),$o(mi,c(te)?`height: ${c(De)}px;`:""),O(fe,c(te)?"▾":"▸")}),jt(yi,()=>c(kt),F=>m(kt,F)),jt(St,()=>c(be),F=>m(be,F)),Cs(ki,()=>c(Rt),F=>m(Rt,F)),Fs(fi,()=>c(ut),F=>m(ut,F)),$("click",qe,ui),jt(Y,()=>c(C),F=>m(C,F)),$("mousedown",He,ge),jt(Qt,()=>c(he),F=>m(he,F)),$("click",Jt,()=>{m(te,!c(te))}),D(o,Ci),js()}Zs(["click","contextmenu","mousedown"]);var FQ=B('<div class="restart-banner restart-banner--restarting svelte-twakcj">Restarting daemon…</div>'),LQ=B('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. <button class="restart-btn svelte-twakcj">Restart now</button></div>'),IQ=B('<div class="err svelte-twakcj"> </div>'),PQ=B('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),TQ=B('<p class="empty svelte-twakcj">No packages installed.</p>'),MQ=B('<p class="empty svelte-twakcj">No match.</p>'),RQ=B("<span> </span>"),NQ=b6('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="8" cy="8" r="6" stroke-dasharray="18" stroke-dashoffset="4"></circle></svg>'),OQ=b6('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg>'),HQ=B('<div><div class="dep-info svelte-twakcj"><a class="dep-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="dep-ver svelte-twakcj"> </span> <!></div> <div class="dep-btns svelte-twakcj"><button><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4"></path><line x1="9" y1="15" x2="4.5" y2="19.5"></line><line x1="14.5" y1="4" x2="20" y2="9.5"></line></svg></button> <button><!></button> <button class="icon-btn icon-btn--danger svelte-twakcj" title="Uninstall"><svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"></line><line x1="14" y1="2" x2="2" y2="14"></line></svg></button></div></div>'),WQ=B('<span class="result-author svelte-twakcj"> </span>'),zQ=B('<span class="result-date svelte-twakcj"> </span>'),VQ=B('<span class="result-desc svelte-twakcj"> </span>'),jQ=B('<div class="result-row svelte-twakcj"><div class="result-info svelte-twakcj"><a class="result-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="result-ver svelte-twakcj"> </span> <!> <!> <!></div> <button class="install-btn svelte-twakcj"> </button></div>'),$Q=B('<div class="results-list svelte-twakcj"></div>'),UQ=B('<pre class="npm-output svelte-twakcj"> </pre>'),qQ=B(`<p class="hint svelte-twakcj">Install npm packages into <code class="svelte-twakcj">~/.she/</code>. Scripts can then <code class="svelte-twakcj">require('package-name')</code> directly.</p>`),GQ=B('<!> <div class="pkg-shell svelte-twakcj"><!> <!> <div class="pkg-body svelte-twakcj"><div class="pkg-left svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Installed</span> <span class="pane-count svelte-twakcj"> </span> <!> <button class="icon-btn check-outdated-btn svelte-twakcj" title="Check for package updates"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg></button></div> <div class="filter-row svelte-twakcj"><input class="filter-in svelte-twakcj" type="search" placeholder="Filter…"/></div> <div class="installed-list svelte-twakcj"><!></div></div> <div class="pkg-right svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Search npm</span></div> <div class="search-row svelte-twakcj"><input class="search-in svelte-twakcj" type="text" placeholder="Package name, e.g. axios, lodash…"/> <button class="search-btn svelte-twakcj"> </button></div> <!> <!> <!></div></div></div>',1);function KQ(o,e){Vs(e,!0);let t=I(Ei([])),i=I(""),n=I(Ei({})),s=I(Ei([])),r=I(!1),a=I(""),d=I(Ei([])),u=I(!1),f=I(!1),g=I(!1),p=I(""),C=I(""),b=Ei({});const y=Tt(()=>c(i).trim()?c(t).filter(gt=>gt.name.toLowerCase().includes(c(i).toLowerCase())):c(t)),w=Tt(()=>Object.keys(c(n)).filter(gt=>!c(s).includes(gt)).length);Ks(async()=>{await Promise.all([A(),P(),M()])});async function A(){try{m(t,await G$(),!0),m(p,"")}catch(gt){m(p,gt.message,!0)}}async function P(){try{m(n,await fF(),!0)}catch{}}async function M(){try{const gt=await Il();m(s,Array.isArray(gt.pinnedPackages)?gt.pinnedPackages:[],!0)}catch{}}async function R(gt){const Yt=c(s).includes(gt)?c(s).filter(Ci=>Ci!==gt):[...c(s),gt];m(s,Yt,!0);try{const Ci=await Il();await ap({...Ci,pinnedPackages:Yt})}catch{}}async function T(){m(r,!0);try{m(n,await Q$(),!0)}catch{}finally{m(r,!1)}}async function V(){const gt=c(a).trim();if(!gt){m(d,[],!0);return}m(g,!0),m(p,"");try{m(d,await K$(gt),!0)}catch(Yt){m(p,Yt.message,!0)}finally{m(g,!1)}}function W(gt){if(!gt)return"";try{return new Date(gt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}async function Q(gt,Yt){b[gt]=!0,m(p,""),m(C,"");try{const Ci=await Z$(gt,Yt);m(C,Ci.stdout||Ci.stderr||"Done.",!0),m(u,!0),await A()}catch(Ci){m(p,Ci.message,!0)}finally{b[gt]=!1}}async function ne(gt){b[gt]=!0,m(p,""),m(C,"");try{const Yt=await X$(gt);m(C,Yt.stdout||Yt.stderr||"Done.",!0),m(u,!0);const Ci={...c(n)};delete Ci[gt],m(n,Ci,!0),await A()}catch(Yt){m(p,Yt.message,!0)}finally{b[gt]=!1}}async function de(gt){b[gt]=!0,m(p,""),m(C,"");try{const Yt=await Y$(gt);m(C,Yt.stdout||Yt.stderr||"Done.",!0),m(u,!0);const Ci={...c(n)};delete Ci[gt],m(n,Ci,!0),await A()}catch(Yt){m(p,Yt.message,!0)}finally{b[gt]=!1}}let te;async function he(){if(await te.show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"})){m(f,!0);try{await dF()}catch{}setTimeout(()=>{window.location.reload()},3e3)}}var De=GQ(),oe=yt(De);us(qc(oe,{}),gt=>te=gt,()=>te);var ge=v(oe,2),Se=_(ge);{var Re=gt=>{var Yt=FQ();D(gt,Yt)},xe=gt=>{var Yt=LQ(),Ci=v(_(Yt));$("click",Ci,he),D(gt,Yt)};z(Se,gt=>{c(f)?gt(Re):c(u)&&gt(xe,1)})}var et=v(Se,2);{var We=gt=>{var Yt=IQ(),Ci=_(Yt);j(()=>O(Ci,c(p))),D(gt,Yt)};z(et,gt=>{c(p)&&gt(We)})}var _e=v(et,2),dt=_(_e),Wt=_(dt),tt=v(_(Wt),2),kt=_(tt),be=v(tt,2);{var Rt=gt=>{var Yt=PQ(),Ci=_(Yt);j(()=>O(Ci,`${c(w)??""} outdated`)),D(gt,Yt)};z(be,gt=>{c(w)>0&&gt(Rt)})}var ut=v(be,2),at=_(ut);let Ze;var Pt=v(Wt,2),ui=_(Pt),wt=v(Pt,2),Ft=_(wt);{var Vt=gt=>{var Yt=TQ();D(gt,Yt)},zt=gt=>{var Yt=MQ();D(gt,Yt)},Zt=gt=>{var Yt=Es(),Ci=yt(Yt);ei(Ci,17,()=>c(y),Wi=>Wi.name,(Wi,Pi)=>{var Ti=HQ();let Oi;var Qi=_(Ti),yi=_(Qi),Xe=_(yi),St=v(yi,2),Ai=_(St),ki=v(St,2);{var fi=Y=>{var Oe=RQ();let Ve;var ye=_(Oe);j(At=>{Ve=Bt(Oe,1,"dep-latest svelte-twakcj",null,Ve,At),O(ye,`→ v${c(n)[c(Pi).name].latest??""}`)},[()=>({"dep-latest--pinned":c(s).includes(c(Pi).name)})]),D(Y,Oe)};z(ki,Y=>{c(n)[c(Pi).name]&&Y(fi)})}var Ii=v(Qi,2),X=_(Ii);let Ae;var qe=v(X,2);let nt;var qt=_(qe);{var se=Y=>{var Oe=NQ();D(Y,Oe)},Ee=Y=>{var Oe=OQ();D(Y,Oe)};z(qt,Y=>{b[c(Pi).name]?Y(se):Y(Ee,-1)})}var Le=v(qe,2);j((Y,Oe,Ve)=>{Oi=Bt(Ti,1,"dep-row svelte-twakcj",null,Oi,{"dep-busy":!!b[c(Pi).name]}),ln(yi,"href",c(Pi).url??`https://www.npmjs.com/package/${c(Pi).name}`),O(Xe,c(Pi).name),O(Ai,c(Pi).installedVersion??c(Pi).version),Ae=Bt(X,1,"icon-btn svelte-twakcj",null,Ae,Y),ln(X,"title",Oe),nt=Bt(qe,1,"icon-btn svelte-twakcj",null,nt,Ve),qe.disabled=!!b[c(Pi).name],ln(qe,"title",c(n)[c(Pi).name]?`Update to v${c(n)[c(Pi).name].latest}`:"Update to latest"),Le.disabled=!!b[c(Pi).name]},[()=>({"icon-btn--pinned":c(s).includes(c(Pi).name)}),()=>c(s).includes(c(Pi).name)?"Unpin package":"Pin package (suppress update dot)",()=>({"icon-btn--update":!!c(n)[c(Pi).name]&&!c(s).includes(c(Pi).name)})]),$("click",X,()=>R(c(Pi).name)),$("click",qe,()=>de(c(Pi).name)),$("click",Le,()=>ne(c(Pi).name)),D(Wi,Ti)}),D(gt,Yt)};z(Ft,gt=>{c(t).length===0?gt(Vt):c(y).length===0?gt(zt,1):gt(Zt,-1)})}var mt=v(dt,2),Mi=v(_(mt),2),Ri=_(Mi),Di=v(Ri,2),Ui=_(Di),ji=v(Mi,2);{var Bi=gt=>{var Yt=$Q();ei(Yt,21,()=>c(d),Ci=>Ci.name,(Ci,Wi)=>{var Pi=jQ(),Ti=_(Pi),Oi=_(Ti),Qi=_(Oi),yi=v(Oi,2),Xe=_(yi),St=v(yi,2);{var Ai=nt=>{var qt=WQ(),se=_(qt);j(()=>O(se,c(Wi).author)),D(nt,qt)};z(St,nt=>{c(Wi).author&&nt(Ai)})}var ki=v(St,2);{var fi=nt=>{var qt=zQ(),se=_(qt);j(Ee=>{ln(qt,"title",c(Wi).date),O(se,Ee)},[()=>W(c(Wi).date)]),D(nt,qt)};z(ki,nt=>{c(Wi).date&&nt(fi)})}var Ii=v(ki,2);{var X=nt=>{var qt=VQ(),se=_(qt);j(()=>O(se,c(Wi).description)),D(nt,qt)};z(Ii,nt=>{c(Wi).description&&nt(X)})}var Ae=v(Ti,2),qe=_(Ae);j(()=>{ln(Oi,"href",c(Wi).url??`https://www.npmjs.com/package/${c(Wi).name}`),O(Qi,c(Wi).name),O(Xe,c(Wi).version),Ae.disabled=!!b[c(Wi).name],O(qe,b[c(Wi).name]?"Installing…":"Install")}),$("click",Ae,()=>Q(c(Wi).name)),D(Ci,Pi)}),D(gt,Yt)};z(ji,gt=>{c(d).length>0&&gt(Bi)})}var fn=v(ji,2);{var an=gt=>{var Yt=UQ(),Ci=_(Yt);j(()=>O(Ci,c(C))),D(gt,Yt)};z(fn,gt=>{c(C)&&gt(an)})}var Zi=v(fn,2);{var _n=gt=>{var Yt=qQ();D(gt,Yt)};z(Zi,gt=>{!c(d).length&&!c(C)&&gt(_n)})}j(()=>{O(kt,c(t).length),ut.disabled=c(r),Ze=Bt(at,0,"svelte-twakcj",null,Ze,{spinning:c(r)}),Di.disabled=c(g),O(Ui,c(g)?"Searching…":"Search")}),$("click",ut,T),jt(ui,()=>c(i),gt=>m(i,gt)),$("keydown",Ri,gt=>gt.key==="Enter"&&V()),jt(Ri,()=>c(a),gt=>m(a,gt)),$("click",Di,V),D(o,De),js()}Zs(["click","keydown"]);var ZQ=B('<div class="plugin-warning svelte-3itf14">⚠ The dynamic-security plugin is not responding. Add <code class="svelte-3itf14">plugin …/mosquitto_dynamic_security.so</code> and <code class="svelte-3itf14">plugin_opt_config_file …/dynamic-security.json</code> to your mosquitto.conf and restart mosquitto. Operations below will time out until the plugin is active.</div>'),ba=B('<div class="err svelte-3itf14"> </div>'),XQ=B('<div class="empty svelte-3itf14">No users found.</div>'),YQ=B('<span class="tag svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove role">×</button></span>'),yh=B("<option> </option>"),zx=B('<div class="inline-err svelte-3itf14"> </div>'),UA=B('<div class="inline-add svelte-3itf14"><select class="svelte-3itf14"><option>— role —</option><!></select> <button class="inline-confirm svelte-3itf14">Add</button> <button class="inline-cancel svelte-3itf14">×</button></div> <!>',1),QQ=B('<span class="tag tag--group svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove from group">×</button></span>'),JQ=B('<div class="inline-add svelte-3itf14"><select class="svelte-3itf14"><option>— group —</option><!></select> <button class="inline-confirm svelte-3itf14">Add</button> <button class="inline-cancel svelte-3itf14">×</button></div> <!>',1),eJ=B('<tr class="svelte-3itf14"><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus svelte-3itf14" title="Add role">+</button></div> <!></div></td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus tag-plus--group svelte-3itf14" title="Add to group">+</button></div> <!></div></td><td class="cell-actions svelte-3itf14"><div class="actions svelte-3itf14"><button title="Set password" class="svelte-3itf14">🔑</button> <button class="danger svelte-3itf14" title="Delete">✕</button></div></td></tr>'),tJ=B('<table class="svelte-3itf14"><thead><tr><th class="svelte-3itf14">Username</th><th class="svelte-3itf14">Roles</th><th class="svelte-3itf14">Groups</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),iJ=B('<div class="panel svelte-3itf14"><div class="panel-header svelte-3itf14"><h3 class="svelte-3itf14">Users</h3> <button class="btn-add svelte-3itf14">+ Add user</button></div> <!> <!></div>'),nJ=B('<div class="empty svelte-3itf14">No roles found.</div>'),sJ=B('<tr class="svelte-3itf14"><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"> </td><td class="cell-actions svelte-3itf14"><div class="actions svelte-3itf14"><button title="Edit ACLs" class="svelte-3itf14">Edit ACLs</button> <button class="danger svelte-3itf14" title="Delete">✕</button></div></td></tr>'),oJ=B('<table class="svelte-3itf14"><thead><tr><th class="svelte-3itf14">Role</th><th class="svelte-3itf14">ACLs</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),rJ=B('<div class="panel svelte-3itf14"><div class="panel-header svelte-3itf14"><h3 class="svelte-3itf14">Roles</h3> <button class="btn-add svelte-3itf14">+ Add role</button></div> <!> <!></div>'),aJ=B('<div class="empty svelte-3itf14">No groups found.</div>'),lJ=B('<span class="tag svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove member">×</button></span>'),cJ=B('<div class="inline-add svelte-3itf14"><select class="svelte-3itf14"><option>— user —</option><!></select> <button class="inline-confirm svelte-3itf14">Add</button> <button class="inline-cancel svelte-3itf14">×</button></div> <!>',1),dJ=B('<span class="tag tag--group svelte-3itf14"> <button class="tag-x svelte-3itf14" title="Remove role">×</button></span>'),uJ=B('<tr class="svelte-3itf14"><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus svelte-3itf14" title="Add member">+</button></div> <!></div></td><td class="svelte-3itf14"><div class="tags-cell svelte-3itf14"><div class="tags svelte-3itf14"><!> <button class="tag-plus tag-plus--group svelte-3itf14" title="Add role">+</button></div> <!></div></td><td class="cell-actions svelte-3itf14"><div class="actions svelte-3itf14"><button class="danger svelte-3itf14" title="Delete">✕</button></div></td></tr>'),hJ=B('<table class="svelte-3itf14"><thead><tr><th class="svelte-3itf14">Group</th><th class="svelte-3itf14">Members</th><th class="svelte-3itf14">Roles</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),fJ=B('<div class="panel svelte-3itf14"><div class="panel-header svelte-3itf14"><h3 class="svelte-3itf14">Groups</h3> <button class="btn-add svelte-3itf14">+ Add group</button></div> <!> <!></div>'),qA=B('<div class="empty svelte-3itf14">Loading…</div>'),gJ=B('<tr><td class="mono small svelte-3itf14"> </td><td class="acl-radio svelte-3itf14"><input type="radio" value="allow"/></td><td class="acl-radio svelte-3itf14"><input type="radio" value="deny"/></td></tr>'),pJ=B('<table class="acl-defaults-table svelte-3itf14"><thead><tr><th class="svelte-3itf14">Operation</th><th class="svelte-3itf14">Allow</th><th class="svelte-3itf14">Deny</th></tr></thead><tbody></tbody></table>'),xJ=B('<div class="anon-current svelte-3itf14">Current: <span class="mono svelte-3itf14"> </span></div>'),mJ=B('<div class="anon-current muted svelte-3itf14">No anonymous group configured.</div>'),vJ=B('<div class="anon-row svelte-3itf14"><select class="svelte-3itf14"><option>— none —</option><!></select> <button class="svelte-3itf14"> </button></div> <!>',1),_J=B('<div class="panel svelte-3itf14"><div class="settings-section svelte-3itf14"><h3 class="settings-heading svelte-3itf14">Default ACL Access</h3> <p class="settings-hint svelte-3itf14">Broker-wide defaults applied when no role ACL matches. Role ACLs always take precedence over these defaults.</p> <!> <!></div> <div class="settings-section svelte-3itf14"><h3 class="settings-heading svelte-3itf14">Anonymous Group</h3> <p class="settings-hint svelte-3itf14">Clients connecting without credentials are treated as members of this group. Requires <code class="svelte-3itf14">allow_anonymous true</code> in mosquitto.conf.</p> <!> <!></div></div>'),bJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Add user</h3> <label class="svelte-3itf14">Username<input autocomplete="off" class="svelte-3itf14"/></label> <label class="svelte-3itf14">Password <div class="pw-row svelte-3itf14"><input autocomplete="new-password" class="svelte-3itf14"/> <button class="toggle-pw svelte-3itf14"> </button></div></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),CJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Set password for <em class="svelte-3itf14"> </em></h3> <label class="svelte-3itf14">New password <input type="password" autocomplete="new-password" class="svelte-3itf14"/></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),EJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Add role</h3> <label class="svelte-3itf14">Role name<input autocomplete="off" class="svelte-3itf14"/></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),yJ=B('<tr class="svelte-3itf14"><td class="mono small svelte-3itf14"> </td><td class="mono svelte-3itf14"> </td><td class="svelte-3itf14"> </td><td class="svelte-3itf14"><button class="danger">✕</button></td></tr>'),wJ=B('<table class="acl-table svelte-3itf14"><thead><tr><th class="svelte-3itf14">Type</th><th class="svelte-3itf14">Topic</th><th class="svelte-3itf14">Allow</th><th class="svelte-3itf14"></th></tr></thead><tbody></tbody></table>'),SJ=B('<div class="empty svelte-3itf14">No ACL rules yet.</div>'),DJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-3itf14"><h3 class="svelte-3itf14">ACLs for role <em class="svelte-3itf14"> </em></h3> <!> <div class="acl-add-row svelte-3itf14"><select class="svelte-3itf14"></select> <input placeholder="topic or pattern" class="svelte-3itf14"/> <label class="allow-toggle svelte-3itf14"><input type="checkbox" class="svelte-3itf14"/> Allow</label> <button class="svelte-3itf14">Add</button></div> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Close</button></div></div></div>'),AJ=B('<div class="modal-backdrop svelte-3itf14" role="dialog" aria-modal="true"><div class="modal svelte-3itf14"><h3 class="svelte-3itf14">Add group</h3> <label class="svelte-3itf14">Group name<input autocomplete="off" class="svelte-3itf14"/></label> <!> <div class="modal-actions svelte-3itf14"><button class="svelte-3itf14">Cancel</button> <button class="btn-primary svelte-3itf14"> </button></div></div></div>'),kJ=B('<div class="users-page svelte-3itf14"><!> <div class="panel-tabs svelte-3itf14"><button>Users</button> <button>Roles</button> <button>Groups</button> <button>Settings</button> <button class="reload-btn svelte-3itf14" title="Refresh">↺</button></div> <!> <!> <!> <!></div> <!> <!> <!> <!> <!> <!>',1);function BJ(o,e){Vs(e,!0);let t=wu(e,"dynsecReady",3,!1),i,n=I(Ei([])),s=I(Ei([])),r=I(Ei([])),a=I(""),d=I(""),u=I(""),f=I("users"),g=I(null),p=I(""),C=I(""),b=I(!1);const y=Tt(()=>c(g)?c(g).kind==="user-roles"?c(s).map(fe=>fe.rolename).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(n).find(rt=>rt.username===c(g).target))==null?void 0:Ke.roles)!=null&&ot.some(rt=>rt.rolename===fe))}):c(g).kind==="user-groups"?c(r).map(fe=>fe.groupname).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(n).find(rt=>rt.username===c(g).target))==null?void 0:Ke.groups)!=null&&ot.some(rt=>rt.groupname===fe))}):c(g).kind==="group-members"?c(n).map(fe=>fe.username).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(r).find(rt=>rt.groupname===c(g).target))==null?void 0:Ke.clients)!=null&&ot.some(rt=>rt.username===fe))}):c(s).map(fe=>fe.rolename).filter(fe=>{var Ke,ot;return!((ot=(Ke=c(r).find(rt=>rt.groupname===c(g).target))==null?void 0:Ke.roles)!=null&&ot.some(rt=>rt.rolename===fe))}):[]);function w(fe,Ke){m(g,{kind:fe,target:Ke},!0),m(p,""),m(C,"")}async function A(){if(!(!c(g)||!c(p))){m(b,!0),m(C,"");try{const{kind:fe,target:Ke}=c(g);fe==="user-roles"?await xU(Ke,c(p)):fe==="user-groups"?await uA(c(p),Ke):fe==="group-members"?await uA(Ke,c(p)):await SU(Ke,c(p)),m(g,null),m(p,""),await Bi()}catch(fe){m(C,fe.message,!0)}finally{m(b,!1)}}}async function P(fe,Ke){try{await mU(fe,Ke),await Bi()}catch(ot){m(a,ot.message,!0)}}async function M(fe,Ke){try{await hA(Ke,fe),await Bi()}catch(ot){m(a,ot.message,!0)}}async function R(fe,Ke){try{await hA(fe,Ke),await Bi()}catch(ot){m(u,ot.message,!0)}}async function T(fe,Ke){try{await DU(fe,Ke),await Bi()}catch(ot){m(u,ot.message,!0)}}let V=I(!1),W=I(""),Q=I(""),ne=I(!1),de=I(""),te=I(!1),he=I(!1),De=I(""),oe=I(""),ge=I(""),Se=I(!1),Re=I(!1),xe=I(""),et=I(""),We=I(!1),_e=I(null),dt=I(!1),Wt=I("publishClientSend"),tt=I(""),kt=I(!0),be=I(""),Rt=I(!1),ut=I(""),at=I(""),Ze=I(!1),Pt=I(Ei([])),ui=I(""),wt=I(!1),Ft=I(null),Vt=I(""),zt=I(""),Zt=I(!1),mt=I(!1);const Mi=[{acltype:"publishClientSend",label:"Publish (send)"},{acltype:"publishClientReceive",label:"Publish (receive)"},{acltype:"subscribe",label:"Subscribe"},{acltype:"unsubscribe",label:"Unsubscribe"}];async function Ri(){var fe,Ke;m(mt,!1),m(ui,""),m(zt,"");try{const[ot,rt]=await Promise.allSettled([AU(),FU()]);if(ot.status==="fulfilled"){const ht=Object.fromEntries(ot.value.acls.map(_t=>[_t.acltype,_t.allow]));m(Pt,Mi.map(({acltype:_t})=>({acltype:_t,allow:ht[_t]??(_t==="publishClientReceive"||_t==="unsubscribe")})),!0)}else m(ui,((fe=ot.reason)==null?void 0:fe.message)??"Failed to load default ACLs",!0);rt.status==="fulfilled"?(m(Ft,rt.value.group,!0),m(Vt,rt.value.group??"",!0)):m(zt,((Ke=rt.reason)==null?void 0:Ke.message)??"Failed to load anonymous group",!0)}finally{m(mt,!0)}}async function Di(fe,Ke){m(Pt,c(Pt).map(ot=>ot.acltype===fe?{...ot,allow:Ke}:ot),!0),m(wt,!0),m(ui,"");try{await kU(c(Pt))}catch(ot){m(ui,ot.message,!0)}finally{m(wt,!1)}}async function Ui(){m(Zt,!0),m(zt,"");try{await LU(c(Vt)||null),m(Ft,c(Vt)||null,!0)}catch(fe){m(zt,fe.message,!0)}finally{m(Zt,!1)}}const ji=["publishClientSend","publishClientReceive","subscribeLiteral","subscribePattern","unsubscribeLiteral","unsubscribePattern"];async function Bi(){var fe,Ke,ot;try{const[rt,ht,_t]=await Promise.allSettled([hU(),EF(),EU()]);rt.status==="fulfilled"?(m(n,rt.value.users,!0),m(a,"")):m(a,((fe=rt.reason)==null?void 0:fe.message)??"Failed to load users",!0),ht.status==="fulfilled"?(m(s,ht.value.roles,!0),m(d,"")):m(d,((Ke=ht.reason)==null?void 0:Ke.message)??"Failed to load roles",!0),_t.status==="fulfilled"?(m(r,_t.value.groups,!0),m(u,"")):m(u,((ot=_t.reason)==null?void 0:ot.message)??"Failed to load groups",!0)}catch{}}Ks(()=>{Bi()});async function fn(){m(de,""),m(te,!0);try{await fU(c(W),c(Q)),m(W,""),m(Q,""),m(V,!1),await Bi()}catch(fe){m(de,fe.message??"Failed to create user",!0)}finally{m(te,!1)}}async function an(fe){if(await i.show(`Delete user “${fe}”?`,{confirm:"Delete",danger:!0}))try{await gU(fe),await Bi()}catch(Ke){m(a,Ke.message,!0)}}async function Zi(fe){m(De,fe,!0),m(oe,""),m(ge,""),m(he,!0)}async function _n(){m(ge,""),m(Se,!0);try{await pU(c(De),c(oe)),m(he,!1)}catch(fe){m(ge,fe.message,!0)}finally{m(Se,!1)}}async function gt(){m(et,""),m(We,!0);try{await vU(c(xe)),m(xe,""),m(Re,!1),await Bi()}catch(fe){m(et,fe.message??"Failed to create role",!0)}finally{m(We,!1)}}async function Yt(fe){var Ke;if(await i.show(`Delete role “${fe}”?`,{confirm:"Delete",danger:!0}))try{await _U(fe),((Ke=c(_e))==null?void 0:Ke.rolename)===fe&&(m(_e,null),m(dt,!1)),await Bi()}catch(ot){m(d,ot.message,!0)}}function Ci(fe){m(_e,fe,!0),m(dt,!0),m(Wt,"publishClientSend"),m(tt,""),m(kt,!0),m(be,"")}async function Wi(){if(c(_e)){m(be,"");try{await bU(c(_e).rolename,{acltype:c(Wt),topic:c(tt),allow:c(kt)}),m(tt,""),await Bi(),m(_e,c(s).find(fe=>fe.rolename===c(_e).rolename)??c(_e),!0)}catch(fe){m(be,fe.message,!0)}}}async function Pi(fe,Ke,ot){try{await CU(fe,Ke,ot),await Bi(),m(_e,c(s).find(rt=>rt.rolename===fe)??c(_e),!0)}catch(rt){m(be,rt.message,!0)}}async function Ti(){m(at,""),m(Ze,!0);try{await yU(c(ut)),m(ut,""),m(Rt,!1),await Bi()}catch(fe){m(at,fe.message??"Failed to create group",!0)}finally{m(Ze,!1)}}async function Oi(fe){if(await i.show(`Delete group “${fe}”?`,{confirm:"Delete",danger:!0}))try{await wU(fe),await Bi()}catch(Ke){m(u,Ke.message,!0)}}var Qi=kJ(),yi=yt(Qi),Xe=_(yi);{var St=fe=>{var Ke=ZQ();D(fe,Ke)};z(Xe,fe=>{t()||fe(St)})}var Ai=v(Xe,2),ki=_(Ai);let fi;var Ii=v(ki,2);let X;var Ae=v(Ii,2);let qe;var nt=v(Ae,2);let qt;var se=v(nt,2),Ee=v(Ai,2);{var Le=fe=>{var Ke=iJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(ot,2);{var _t=K=>{var le=ba(),Z=_(le);j(()=>O(Z,c(a))),D(K,le)};z(ht,K=>{c(a)&&K(_t)})}var Xt=v(ht,2);{var F=K=>{var le=XQ();D(K,le)},H=K=>{var le=tJ(),Z=v(_(le));ei(Z,21,()=>c(n),Ni,(J,ce)=>{var Qe=eJ(),ae=_(Qe),pe=_(ae),Te=v(ae),me=_(Te),Ie=_(me),lt=_(Ie);ei(lt,17,()=>c(ce).roles??[],Ni,($e,It)=>{var Me=YQ(),st=_(Me),Lt=v(st);j(()=>O(st,c(It).rolename)),$("click",Lt,()=>P(c(ce).username,c(It).rolename)),D($e,Me)});var G=v(lt,2),re=v(Ie,2);{var Ne=$e=>{var It=UA(),Me=yt(It),st=_(Me),Lt=_(st);Lt.value=Lt.__value="";var Ht=v(Lt);ei(Ht,17,()=>c(y),Ni,(Fi,Gi)=>{var Li=yh(),ni=_(Li),ii={};j(()=>{O(ni,c(Gi)),ii!==(ii=c(Gi))&&(Li.value=(Li.__value=c(Gi))??"")}),D(Fi,Li)});var pt=v(st,2),vi=v(pt,2),wi=v(Me,2);{var qi=Fi=>{var Gi=zx(),Li=_(Gi);j(()=>O(Li,c(C))),D(Fi,Gi)};z(wi,Fi=>{c(C)&&Fi(qi)})}j(()=>pt.disabled=!c(p)||c(b)),Fs(st,()=>c(p),Fi=>m(p,Fi)),$("click",pt,A),$("click",vi,()=>m(g,null)),D($e,It)};z(re,$e=>{var It;((It=c(g))==null?void 0:It.kind)==="user-roles"&&c(g).target===c(ce).username&&$e(Ne)})}var it=v(Te),Pe=_(it),ke=_(Pe),bt=_(ke);ei(bt,17,()=>c(ce).groups??[],Ni,($e,It)=>{var Me=QQ(),st=_(Me),Lt=v(st);j(()=>O(st,c(It).groupname)),$("click",Lt,()=>M(c(ce).username,c(It).groupname)),D($e,Me)});var vt=v(bt,2),Fe=v(ke,2);{var Dt=$e=>{var It=JQ(),Me=yt(It),st=_(Me),Lt=_(st);Lt.value=Lt.__value="";var Ht=v(Lt);ei(Ht,17,()=>c(y),Ni,(Fi,Gi)=>{var Li=yh(),ni=_(Li),ii={};j(()=>{O(ni,c(Gi)),ii!==(ii=c(Gi))&&(Li.value=(Li.__value=c(Gi))??"")}),D(Fi,Li)});var pt=v(st,2),vi=v(pt,2),wi=v(Me,2);{var qi=Fi=>{var Gi=zx(),Li=_(Gi);j(()=>O(Li,c(C))),D(Fi,Gi)};z(wi,Fi=>{c(C)&&Fi(qi)})}j(()=>pt.disabled=!c(p)||c(b)),Fs(st,()=>c(p),Fi=>m(p,Fi)),$("click",pt,A),$("click",vi,()=>m(g,null)),D($e,It)};z(Fe,$e=>{var It;((It=c(g))==null?void 0:It.kind)==="user-groups"&&c(g).target===c(ce).username&&$e(Dt)})}var Ge=v(it),ze=_(Ge),Je=_(ze),Ct=v(Je,2);j(()=>O(pe,c(ce).username)),$("click",G,()=>w("user-roles",c(ce).username)),$("click",vt,()=>w("user-groups",c(ce).username)),$("click",Je,()=>Zi(c(ce).username)),$("click",Ct,()=>an(c(ce).username)),D(J,Qe)}),D(K,le)};z(Xt,K=>{c(n).length===0?K(F):K(H,-1)})}$("click",rt,()=>{m(V,!0),m(de,"")}),D(fe,Ke)};z(Ee,fe=>{c(f)==="users"&&fe(Le)})}var Y=v(Ee,2);{var Oe=fe=>{var Ke=rJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(ot,2);{var _t=K=>{var le=ba(),Z=_(le);j(()=>O(Z,c(d))),D(K,le)};z(ht,K=>{c(d)&&K(_t)})}var Xt=v(ht,2);{var F=K=>{var le=nJ();D(K,le)},H=K=>{var le=oJ(),Z=v(_(le));ei(Z,21,()=>c(s),Ni,(J,ce)=>{var Qe=sJ(),ae=_(Qe),pe=_(ae),Te=v(ae),me=_(Te),Ie=v(Te),lt=_(Ie),G=_(lt),re=v(G,2);j(()=>{var Ne;O(pe,c(ce).rolename),O(me,((Ne=c(ce).acls)==null?void 0:Ne.length)??0)}),$("click",G,()=>Ci(c(ce))),$("click",re,()=>Yt(c(ce).rolename)),D(J,Qe)}),D(K,le)};z(Xt,K=>{c(s).length===0?K(F):K(H,-1)})}$("click",rt,()=>{m(Re,!0),m(et,""),m(xe,"")}),D(fe,Ke)};z(Y,fe=>{c(f)==="roles"&&fe(Oe)})}var Ve=v(Y,2);{var ye=fe=>{var Ke=fJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(ot,2);{var _t=K=>{var le=ba(),Z=_(le);j(()=>O(Z,c(u))),D(K,le)};z(ht,K=>{c(u)&&K(_t)})}var Xt=v(ht,2);{var F=K=>{var le=aJ();D(K,le)},H=K=>{var le=hJ(),Z=v(_(le));ei(Z,21,()=>c(r),Ni,(J,ce)=>{var Qe=uJ(),ae=_(Qe),pe=_(ae),Te=v(ae),me=_(Te),Ie=_(me),lt=_(Ie);ei(lt,17,()=>c(ce).clients??[],Ni,(Ct,$e)=>{var It=lJ(),Me=_(It),st=v(Me);j(()=>O(Me,c($e).username)),$("click",st,()=>R(c(ce).groupname,c($e).username)),D(Ct,It)});var G=v(lt,2),re=v(Ie,2);{var Ne=Ct=>{var $e=cJ(),It=yt($e),Me=_(It),st=_(Me);st.value=st.__value="";var Lt=v(st);ei(Lt,17,()=>c(y),Ni,(qi,Fi)=>{var Gi=yh(),Li=_(Gi),ni={};j(()=>{O(Li,c(Fi)),ni!==(ni=c(Fi))&&(Gi.value=(Gi.__value=c(Fi))??"")}),D(qi,Gi)});var Ht=v(Me,2),pt=v(Ht,2),vi=v(It,2);{var wi=qi=>{var Fi=zx(),Gi=_(Fi);j(()=>O(Gi,c(C))),D(qi,Fi)};z(vi,qi=>{c(C)&&qi(wi)})}j(()=>Ht.disabled=!c(p)||c(b)),Fs(Me,()=>c(p),qi=>m(p,qi)),$("click",Ht,A),$("click",pt,()=>m(g,null)),D(Ct,$e)};z(re,Ct=>{var $e;(($e=c(g))==null?void 0:$e.kind)==="group-members"&&c(g).target===c(ce).groupname&&Ct(Ne)})}var it=v(Te),Pe=_(it),ke=_(Pe),bt=_(ke);ei(bt,17,()=>c(ce).roles??[],Ni,(Ct,$e)=>{var It=dJ(),Me=_(It),st=v(Me);j(()=>O(Me,c($e).rolename)),$("click",st,()=>T(c(ce).groupname,c($e).rolename)),D(Ct,It)});var vt=v(bt,2),Fe=v(ke,2);{var Dt=Ct=>{var $e=UA(),It=yt($e),Me=_(It),st=_(Me);st.value=st.__value="";var Lt=v(st);ei(Lt,17,()=>c(y),Ni,(qi,Fi)=>{var Gi=yh(),Li=_(Gi),ni={};j(()=>{O(Li,c(Fi)),ni!==(ni=c(Fi))&&(Gi.value=(Gi.__value=c(Fi))??"")}),D(qi,Gi)});var Ht=v(Me,2),pt=v(Ht,2),vi=v(It,2);{var wi=qi=>{var Fi=zx(),Gi=_(Fi);j(()=>O(Gi,c(C))),D(qi,Fi)};z(vi,qi=>{c(C)&&qi(wi)})}j(()=>Ht.disabled=!c(p)||c(b)),Fs(Me,()=>c(p),qi=>m(p,qi)),$("click",Ht,A),$("click",pt,()=>m(g,null)),D(Ct,$e)};z(Fe,Ct=>{var $e;(($e=c(g))==null?void 0:$e.kind)==="group-roles"&&c(g).target===c(ce).groupname&&Ct(Dt)})}var Ge=v(it),ze=_(Ge),Je=_(ze);j(()=>O(pe,c(ce).groupname)),$("click",G,()=>w("group-members",c(ce).groupname)),$("click",vt,()=>w("group-roles",c(ce).groupname)),$("click",Je,()=>Oi(c(ce).groupname)),D(J,Qe)}),D(K,le)};z(Xt,K=>{c(r).length===0?K(F):K(H,-1)})}$("click",rt,()=>{m(Rt,!0),m(at,""),m(ut,"")}),D(fe,Ke)};z(Ve,fe=>{c(f)==="groups"&&fe(ye)})}var At=v(Ve,2);{var Ot=fe=>{var Ke=_J(),ot=_(Ke),rt=v(_(ot),4);{var ht=Qe=>{var ae=ba(),pe=_(ae);j(()=>O(pe,c(ui))),D(Qe,ae)};z(rt,Qe=>{c(ui)&&Qe(ht)})}var _t=v(rt,2);{var Xt=Qe=>{var ae=qA();D(Qe,ae)},F=Qe=>{var ae=pJ(),pe=v(_(ae));ei(pe,21,()=>Mi,Ni,(Te,me)=>{let Ie=()=>c(me).acltype,lt=()=>c(me).label;const G=Tt(()=>c(Pt).find(Dt=>Dt.acltype===Ie()));var re=gJ();let Ne;var it=_(re),Pe=_(it),ke=v(it),bt=_(ke),vt=v(ke),Fe=_(vt);j(()=>{var Dt,Ge;Ne=Bt(re,1,"svelte-3itf14",null,Ne,{saving:c(wt)}),O(Pe,lt()),ln(bt,"name",Ie()),oa(bt,((Dt=c(G))==null?void 0:Dt.allow)===!0),ln(Fe,"name",Ie()),oa(Fe,((Ge=c(G))==null?void 0:Ge.allow)===!1)}),$("change",bt,()=>Di(Ie(),!0)),$("change",Fe,()=>Di(Ie(),!1)),D(Te,re)}),D(Qe,ae)};z(_t,Qe=>{c(mt)?Qe(F,-1):Qe(Xt)})}var H=v(ot,2),K=v(_(H),4);{var le=Qe=>{var ae=ba(),pe=_(ae);j(()=>O(pe,c(zt))),D(Qe,ae)};z(K,Qe=>{c(zt)&&Qe(le)})}var Z=v(K,2);{var J=Qe=>{var ae=qA();D(Qe,ae)},ce=Qe=>{var ae=vJ(),pe=yt(ae),Te=_(pe),me=_(Te);me.value=me.__value="";var Ie=v(me);ei(Ie,17,()=>c(r),Ni,(Pe,ke)=>{var bt=yh(),vt=_(bt),Fe={};j(()=>{O(vt,c(ke).groupname),Fe!==(Fe=c(ke).groupname)&&(bt.value=(bt.__value=c(ke).groupname)??"")}),D(Pe,bt)});var lt=v(Te,2),G=_(lt),re=v(pe,2);{var Ne=Pe=>{var ke=xJ(),bt=v(_(ke)),vt=_(bt);j(()=>O(vt,c(Ft))),D(Pe,ke)},it=Pe=>{var ke=mJ();D(Pe,ke)};z(re,Pe=>{c(Ft)?Pe(Ne):Pe(it,-1)})}j(()=>{lt.disabled=c(Zt)||c(Vt)===(c(Ft)??""),O(G,c(Zt)?"Saving…":"Save")}),Fs(Te,()=>c(Vt),Pe=>m(Vt,Pe)),$("click",lt,Ui),D(Qe,ae)};z(Z,Qe=>{c(mt)?Qe(ce,-1):Qe(J)})}D(fe,Ke)};z(At,fe=>{c(f)==="settings"&&fe(Ot)})}var ri=v(yi,2);{var oi=fe=>{var Ke=bJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(_(rt)),_t=v(rt,2),Xt=v(_(_t)),F=_(Xt),H=v(F,2),K=_(H),le=v(_t,2);{var Z=pe=>{var Te=ba(),me=_(Te);j(()=>O(me,c(de))),D(pe,Te)};z(le,pe=>{c(de)&&pe(Z)})}var J=v(le,2),ce=_(J),Qe=v(ce,2),ae=_(Qe);j(()=>{ln(F,"type",c(ne)?"text":"password"),O(K,c(ne)?"Hide":"Show"),Qe.disabled=c(te)||!c(W)||!c(Q),O(ae,c(te)?"Creating…":"Create")}),jt(ht,()=>c(W),pe=>m(W,pe)),jt(F,()=>c(Q),pe=>m(Q,pe)),$("click",H,()=>m(ne,!c(ne))),$("click",ce,()=>m(V,!1)),$("click",Qe,fn),D(fe,Ke)};z(ri,fe=>{c(V)&&fe(oi)})}var xi=v(ri,2);{var Ut=fe=>{var Ke=CJ(),ot=_(Ke),rt=_(ot),ht=v(_(rt)),_t=_(ht),Xt=v(rt,2),F=v(_(Xt)),H=v(Xt,2);{var K=Qe=>{var ae=ba(),pe=_(ae);j(()=>O(pe,c(ge))),D(Qe,ae)};z(H,Qe=>{c(ge)&&Qe(K)})}var le=v(H,2),Z=_(le),J=v(Z,2),ce=_(J);j(()=>{O(_t,c(De)),J.disabled=c(Se)||!c(oe),O(ce,c(Se)?"Saving…":"Set password")}),jt(F,()=>c(oe),Qe=>m(oe,Qe)),$("click",Z,()=>m(he,!1)),$("click",J,_n),D(fe,Ke)};z(xi,fe=>{c(he)&&fe(Ut)})}var mi=v(xi,2);{var He=fe=>{var Ke=EJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(_(rt)),_t=v(rt,2);{var Xt=Z=>{var J=ba(),ce=_(J);j(()=>O(ce,c(et))),D(Z,J)};z(_t,Z=>{c(et)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2),le=_(K);j(()=>{K.disabled=c(We)||!c(xe),O(le,c(We)?"Creating…":"Create")}),jt(ht,()=>c(xe),Z=>m(xe,Z)),$("click",H,()=>m(Re,!1)),$("click",K,gt),D(fe,Ke)};z(mi,fe=>{c(Re)&&fe(He)})}var Ye=v(mi,2);{var Qt=fe=>{var Ke=DJ(),ot=_(Ke),rt=_(ot),ht=v(_(rt)),_t=_(ht),Xt=v(rt,2);{var F=Ie=>{var lt=wJ(),G=v(_(lt));ei(G,21,()=>c(_e).acls??[],Ni,(re,Ne)=>{var it=yJ(),Pe=_(it),ke=_(Pe),bt=v(Pe),vt=_(bt),Fe=v(bt),Dt=_(Fe),Ge=v(Fe),ze=_(Ge);j(()=>{O(ke,c(Ne).acltype),O(vt,c(Ne).topic),O(Dt,c(Ne).allow?"✓":"✗")}),$("click",ze,()=>Pi(c(_e).rolename,c(Ne).acltype,c(Ne).topic)),D(re,it)}),D(Ie,lt)},H=Ie=>{var lt=SJ();D(Ie,lt)};z(Xt,Ie=>{var lt;(((lt=c(_e).acls)==null?void 0:lt.length)??0)>0?Ie(F):Ie(H,-1)})}var K=v(Xt,2),le=_(K);ei(le,21,()=>ji,Ni,(Ie,lt)=>{var G=yh(),re=_(G),Ne={};j(()=>{O(re,c(lt)),Ne!==(Ne=c(lt))&&(G.value=(G.__value=c(lt))??"")}),D(Ie,G)});var Z=v(le,2),J=v(Z,2),ce=_(J),Qe=v(J,2),ae=v(K,2);{var pe=Ie=>{var lt=ba(),G=_(lt);j(()=>O(G,c(be))),D(Ie,lt)};z(ae,Ie=>{c(be)&&Ie(pe)})}var Te=v(ae,2),me=_(Te);j(()=>{O(_t,c(_e).rolename),Qe.disabled=!c(tt)}),Fs(le,()=>c(Wt),Ie=>m(Wt,Ie)),jt(Z,()=>c(tt),Ie=>m(tt,Ie)),Cs(ce,()=>c(kt),Ie=>m(kt,Ie)),$("click",Qe,Wi),$("click",me,()=>m(dt,!1)),D(fe,Ke)};z(Ye,fe=>{c(dt)&&c(_e)&&fe(Qt)})}var Gt=v(Ye,2);{var gi=fe=>{var Ke=AJ(),ot=_(Ke),rt=v(_(ot),2),ht=v(_(rt)),_t=v(rt,2);{var Xt=Z=>{var J=ba(),ce=_(J);j(()=>O(ce,c(at))),D(Z,J)};z(_t,Z=>{c(at)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2),le=_(K);j(()=>{K.disabled=c(Ze)||!c(ut),O(le,c(Ze)?"Creating…":"Create")}),jt(ht,()=>c(ut),Z=>m(ut,Z)),$("click",H,()=>m(Rt,!1)),$("click",K,Ti),D(fe,Ke)};z(Gt,fe=>{c(Rt)&&fe(gi)})}var Jt=v(Gt,2);us(qc(Jt,{}),fe=>i=fe,()=>i),j(()=>{fi=Bt(ki,1,"svelte-3itf14",null,fi,{active:c(f)==="users"}),X=Bt(Ii,1,"svelte-3itf14",null,X,{active:c(f)==="roles"}),qe=Bt(Ae,1,"svelte-3itf14",null,qe,{active:c(f)==="groups"}),qt=Bt(nt,1,"svelte-3itf14",null,qt,{active:c(f)==="settings"})}),$("click",ki,()=>m(f,"users")),$("click",Ii,()=>m(f,"roles")),$("click",Ae,()=>m(f,"groups")),$("click",nt,()=>{m(f,"settings"),c(mt)||Ri()}),$("click",se,Bi),D(o,Qi),js()}Zs(["click","change"]);var GA=B('<div class="err svelte-9i68x"> </div>'),FJ=B('<div class="ok svelte-9i68x">Saved.</div>'),LJ=B('<div class="reload-msg svelte-9i68x"> </div>'),IJ=B('<div class="loading svelte-9i68x">Loading…</div>'),PJ=B('<div class="anon-row svelte-9i68x"><span class="field-label svelte-9i68x"><code class="svelte-9i68x">allow_anonymous</code></span> <select class="svelte-9i68x"><option>auto (broker default)</option><option>true — allow unauthenticated clients</option><option>false — require authentication</option></select></div>'),TJ=B("<option></option>"),MJ=B('<div class="tls-section svelte-9i68x"><div class="field-row svelte-9i68x"><label class="svelte-9i68x">Certificate file (certfile) <input placeholder="/etc/mosquitto/certs/server.crt" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Key file (keyfile) <input placeholder="/etc/mosquitto/certs/server.key" class="svelte-9i68x"/></label></div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">CA file (cafile) — single CA cert <input placeholder="/etc/mosquitto/ca.crt" class="svelte-9i68x"/></label> <label class="svelte-9i68x">CA path (capath) — CA cert directory <input placeholder="/etc/mosquitto/ca-certs/" class="svelte-9i68x"/></label></div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">CRL file (crlfile) <input placeholder="/etc/mosquitto/crl.pem" class="svelte-9i68x"/></label> <label class="svelte-9i68x">TLS version <select class="svelte-9i68x"><option>Default</option><option>tlsv1.3</option><option>tlsv1.2</option></select></label></div> <div class="field-row svelte-9i68x"><label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> Require client certificate (require_certificate)</label> <label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> Use cert CN as username (use_identity_as_username)</label></div></div>'),RJ=B('<div class="field-row svelte-9i68x"><label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> Use cert Subject as username (use_subject_as_username)</label></div>'),NJ=B('<div class="advanced-section svelte-9i68x"><div class="field-row svelte-9i68x"><label class="svelte-9i68x">Mount point <input placeholder="(none)" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Max connections <input type="number" min="-1" placeholder="-1 (unlimited)" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Max QoS <select class="svelte-9i68x"><option>default</option><option>0 — fire and forget</option><option>1 — at least once</option><option>2 — exactly once</option></select></label></div> <!></div>'),OJ=B('<div class="auth-section svelte-9i68x"><div class="auth-section-title svelte-9i68x">Authentication</div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">allow_anonymous <select class="svelte-9i68x"><option>auto (broker default)</option><option>true — allow unauthenticated</option><option>false — require auth</option></select></label> <label class="svelte-9i68x">password_file <input placeholder="/etc/mosquitto/passwd" class="svelte-9i68x"/></label> <label class="svelte-9i68x">acl_file <input placeholder="/etc/mosquitto/acl" class="svelte-9i68x"/></label></div></div>'),HJ=B('<div class="listener-card svelte-9i68x"><div class="card-title svelte-9i68x"><span> </span> <button class="remove-btn svelte-9i68x" title="Remove listener">✕</button></div> <div class="field-row svelte-9i68x"><label class="svelte-9i68x">Port <input type="number" min="1" max="65535" class="svelte-9i68x"/></label> <label class="svelte-9i68x">Protocol <select class="svelte-9i68x"><option>mqtt</option><option>websockets</option></select></label> <label class="svelte-9i68x">Bind address <input placeholder="(all interfaces)" class="svelte-9i68x"/></label> <label class="toggle-label tls-inline svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> TLS</label></div> <datalist></datalist> <!> <button class="advanced-btn svelte-9i68x"> </button> <!> <!></div>'),WJ=B('<div class="empty svelte-9i68x">No listeners configured. Click "+ Add listener" to create one.</div>'),zJ=B('<div class="global-settings svelte-9i68x"><label class="toggle-label svelte-9i68x"><input type="checkbox" class="svelte-9i68x"/> <span class="checkmark svelte-9i68x"></span> <span><code>per_listener_settings</code> — independent auth per listener</span> <span class="info-icon svelte-9i68x" title="Not recommended when using the dynamic-security plugin — dynsec credentials only apply to the default listener. See mosquitto documentation.">ℹ</span></label> <!></div> <div class="cards svelte-9i68x"><!> <!></div>',1),VJ=B('<div class="listeners-page svelte-9i68x"><div class="page-header svelte-9i68x"><h3 class="svelte-9i68x">Listeners</h3> <div class="header-actions svelte-9i68x"><button class="svelte-9i68x">+ Add listener</button> <button class="btn-save svelte-9i68x"> </button> <button class="btn-reload svelte-9i68x" title="Apply &amp; Reload mosquitto"> </button></div></div> <!> <!> <!> <!> <!></div>');function jJ(o,e){Vs(e,!0);let t=I(null),i=I(""),n=I(!1),s=I(""),r=I(!1),a=I(!1),d=I(""),u=I(Ei([])),f=I(null),g=I(!1),p=I(""),C=I(Ei([])),b=I(Ei(new Set));Ks(()=>{y(),rU().then(be=>{m(C,be.addresses,!0)}).catch(()=>{})});async function y(){try{m(t,await rS(),!0),m(u,JSON.parse(JSON.stringify(c(t).listeners)),!0),m(f,c(t).checksum,!0);const be=c(t).managed.allow_anonymous;m(p,be==="true"||be==="false"?be:"",!0),m(g,c(t).managed.per_listener_settings==="true"),m(i,"")}catch(be){m(i,be.message??"Failed to load broker config",!0)}}function w(){m(u,[...c(u),{port:1883,bindAddress:"",protocol:"mqtt",tls:{}}],!0),m(b,new Set(c(b)),!0)}function A(be){const Rt=new Set(c(b));Rt.has(be)?Rt.delete(be):Rt.add(be),m(b,Rt,!0)}function P(be){m(u,c(u).filter((Rt,ut)=>ut!==be),!0)}async function M(){if(c(t)){m(n,!0),m(s,""),m(r,!1);try{const be={...c(t).managed};c(g)?(be.per_listener_settings="true",delete be.allow_anonymous):(delete be.per_listener_settings,c(p)?be.allow_anonymous=c(p):delete be.allow_anonymous),await bF({listeners:c(u),managed:be,passthrough:c(t).passthrough,checksum:c(f)}),m(r,!0),setTimeout(()=>m(r,!1),3e3),await y()}catch(be){m(s,be.message??"Save failed",!0)}finally{m(n,!1)}}}async function R(){m(a,!0),m(d,"");try{const be=await CF();m(d,be.stderr||be.stdout||"Reloaded",!0)}catch(be){m(d,"Error: "+(be.message??"reload failed"))}finally{m(a,!1)}}function T(be){var Rt,ut,at,Ze;return!!((Rt=be.tls)!=null&&Rt.certfile||(ut=be.tls)!=null&&ut.keyfile||(at=be.tls)!=null&&at.capath||(Ze=be.tls)!=null&&Ze.cafile)}function V(be,Rt){Rt||(be.tls={}),m(u,[...c(u)],!0)}var W=VJ(),Q=_(W),ne=v(_(Q),2),de=_(ne),te=v(de,2),he=_(te),De=v(te,2),oe=_(De),ge=v(Q,2);{var Se=be=>{var Rt=GA(),ut=_(Rt);j(()=>O(ut,c(i))),D(be,Rt)};z(ge,be=>{c(i)&&be(Se)})}var Re=v(ge,2);{var xe=be=>{var Rt=GA(),ut=_(Rt);j(()=>O(ut,c(s))),D(be,Rt)};z(Re,be=>{c(s)&&be(xe)})}var et=v(Re,2);{var We=be=>{var Rt=FJ();D(be,Rt)};z(et,be=>{c(r)&&be(We)})}var _e=v(et,2);{var dt=be=>{var Rt=LJ(),ut=_(Rt);j(()=>O(ut,c(d))),D(be,Rt)};z(_e,be=>{c(d)&&be(dt)})}var Wt=v(_e,2);{var tt=be=>{var Rt=IJ();D(be,Rt)},kt=be=>{var Rt=zJ(),ut=yt(Rt),at=_(ut),Ze=_(at),Pt=v(at,2);{var ui=Zt=>{var mt=PJ(),Mi=v(_(mt),2),Ri=_(Mi);Ri.value=Ri.__value="";var Di=v(Ri);Di.value=Di.__value="true";var Ui=v(Di);Ui.value=Ui.__value="false",Fs(Mi,()=>c(p),ji=>m(p,ji)),D(Zt,mt)};z(Pt,Zt=>{c(g)||Zt(ui)})}var wt=v(ut,2),Ft=_(wt);ei(Ft,17,()=>c(u),Ni,(Zt,mt,Mi)=>{var Ri=HJ(),Di=_(Ri),Ui=_(Di),ji=_(Ui),Bi=v(Ui,2),fn=v(Di,2),an=_(fn),Zi=v(_(an)),_n=v(an,2),gt=v(_(_n)),Yt=_(gt);Yt.value=Yt.__value="mqtt";var Ci=v(Yt);Ci.value=Ci.__value="websockets";var Wi=v(_n,2),Pi=v(_(Wi));ln(Pi,"list",`bind-addr-list-${Mi}`);var Ti=v(Wi,2),Oi=_(Ti),Qi=v(fn,2);ln(Qi,"id",`bind-addr-list-${Mi}`),ei(Qi,21,()=>c(C),Ni,(nt,qt)=>{var se=TJ(),Ee={};j(()=>{Ee!==(Ee=c(qt))&&(se.value=(se.__value=c(qt))??"")}),D(nt,se)});var yi=v(Qi,2);{var Xe=nt=>{var qt=MJ(),se=_(qt),Ee=_(se),Le=v(_(Ee)),Y=v(Ee,2),Oe=v(_(Y)),Ve=v(se,2),ye=_(Ve),At=v(_(ye)),Ot=v(ye,2),ri=v(_(Ot)),oi=v(Ve,2),xi=_(oi),Ut=v(_(xi)),mi=v(xi,2),He=v(_(mi)),Ye=_(He);Ye.value=Ye.__value="";var Qt=v(Ye);Qt.value=Qt.__value="tlsv1.3";var Gt=v(Qt);Gt.value=Gt.__value="tlsv1.2";var gi=v(oi,2),Jt=_(gi),fe=_(Jt),Ke=v(Jt,2),ot=_(Ke);jt(Le,()=>c(mt).tls.certfile,rt=>c(mt).tls.certfile=rt),jt(Oe,()=>c(mt).tls.keyfile,rt=>c(mt).tls.keyfile=rt),jt(At,()=>c(mt).tls.cafile,rt=>c(mt).tls.cafile=rt),jt(ri,()=>c(mt).tls.capath,rt=>c(mt).tls.capath=rt),jt(Ut,()=>c(mt).tls.crlfile,rt=>c(mt).tls.crlfile=rt),Fs(He,()=>c(mt).tls.tls_version,rt=>c(mt).tls.tls_version=rt),Cs(fe,()=>c(mt).tls.require_certificate,rt=>c(mt).tls.require_certificate=rt),Cs(ot,()=>c(mt).tls.use_identity_as_username,rt=>c(mt).tls.use_identity_as_username=rt),D(nt,qt)},St=Tt(()=>T(c(mt)));z(yi,nt=>{c(St)&&nt(Xe)})}var Ai=v(yi,2),ki=_(Ai),fi=v(Ai,2);{var Ii=nt=>{var qt=NJ(),se=_(qt),Ee=_(se),Le=v(_(Ee)),Y=v(Ee,2),Oe=v(_(Y)),Ve=v(Y,2),ye=v(_(Ve)),At=_(ye);At.value=At.__value="";var Ot=v(At);Ot.value=Ot.__value="0";var ri=v(Ot);ri.value=ri.__value="1";var oi=v(ri);oi.value=oi.__value="2";var xi;w1(ye);var Ut=v(se,2);{var mi=Ye=>{var Qt=RJ(),Gt=_(Qt),gi=_(Gt);Cs(gi,()=>c(mt).tls.use_subject_as_username,Jt=>c(mt).tls.use_subject_as_username=Jt),D(Ye,Qt)},He=Tt(()=>T(c(mt)));z(Ut,Ye=>{c(He)&&Ye(mi)})}j(Ye=>{xi!==(xi=Ye)&&(ye.value=(ye.__value=Ye)??"",Tm(ye,Ye))},[()=>c(mt).max_qos!==void 0?String(c(mt).max_qos):""]),jt(Le,()=>c(mt).mount_point,Ye=>c(mt).mount_point=Ye),jt(Oe,()=>c(mt).max_connections,Ye=>c(mt).max_connections=Ye),$("change",ye,Ye=>{const Qt=Ye.target.value;c(mt).max_qos=Qt===""?void 0:Number(Qt),m(u,[...c(u)],!0)}),D(nt,qt)},X=Tt(()=>c(b).has(Mi));z(fi,nt=>{c(X)&&nt(Ii)})}var Ae=v(fi,2);{var qe=nt=>{var qt=OJ(),se=v(_(qt),2),Ee=_(se),Le=v(_(Ee)),Y=_(Le);Y.value=Y.__value="";var Oe=v(Y);Oe.value=Oe.__value="true";var Ve=v(Oe);Ve.value=Ve.__value="false";var ye;w1(Le);var At=v(Ee,2),Ot=v(_(At)),ri=v(At,2),oi=v(_(ri));j(()=>{ye!==(ye=c(mt).allow_anonymous===void 0?"":c(mt).allow_anonymous?"true":"false")&&(Le.value=Le.__value=c(mt).allow_anonymous===void 0?"":c(mt).allow_anonymous?"true":"false",Tm(Le,c(mt).allow_anonymous===void 0?"":c(mt).allow_anonymous?"true":"false"))}),$("change",Le,xi=>{const Ut=xi.target.value;c(mt).allow_anonymous=Ut===""?void 0:Ut==="true",m(u,[...c(u)],!0)}),jt(Ot,()=>c(mt).password_file,xi=>c(mt).password_file=xi),jt(oi,()=>c(mt).acl_file,xi=>c(mt).acl_file=xi),D(nt,qt)};z(Ae,nt=>{c(g)&&nt(qe)})}j((nt,qt)=>{O(ji,`Port ${c(mt).port??""}`),oa(Oi,nt),O(ki,`${qt??""} Advanced`)},[()=>T(c(mt)),()=>c(b).has(Mi)?"▾":"▸"]),$("click",Bi,()=>P(Mi)),jt(Zi,()=>c(mt).port,nt=>c(mt).port=nt),Fs(gt,()=>c(mt).protocol,nt=>c(mt).protocol=nt),jt(Pi,()=>c(mt).bindAddress,nt=>c(mt).bindAddress=nt),$("change",Oi,nt=>V(c(mt),nt.target.checked)),$("click",Ai,()=>A(Mi)),D(Zt,Ri)});var Vt=v(Ft,2);{var zt=Zt=>{var mt=WJ();D(Zt,mt)};z(Vt,Zt=>{c(u).length===0&&Zt(zt)})}Cs(Ze,()=>c(g),Zt=>m(g,Zt)),D(be,Rt)};z(Wt,be=>{c(t)===null&&!c(i)?be(tt):be(kt,-1)})}j(()=>{te.disabled=c(n),O(he,c(n)?"Saving…":"Save"),De.disabled=c(a),O(oe,c(a)?"Reloading…":"Apply & Reload")}),$("click",de,w),$("click",te,M),$("click",De,R),D(o,W),js()}Zs(["click","change"]);var KA=B('<div class="err svelte-1by6o5t"> </div>'),$J=B('<div class="ok svelte-1by6o5t">Saved.</div>'),UJ=B('<div class="reload-msg svelte-1by6o5t"> </div>'),KC=B('<label class="check-label svelte-1by6o5t"><input type="checkbox" class="svelte-1by6o5t"/> <span class="checkmark svelte-1by6o5t"></span> </label>'),qJ=B('<label class="check-label svelte-1by6o5t"><input type="checkbox" class="svelte-1by6o5t"/> <span class="checkmark svelte-1by6o5t"></span> <strong> </strong></label>'),GJ=B(`<div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Logging</h4> <div class="field svelte-1by6o5t"><span class="field-key svelte-1by6o5t">log_dest</span> <div class="checkbox-group svelte-1by6o5t"></div> <p class="hint svelte-1by6o5t">Log destinations. Enable <code class="svelte-1by6o5t">topic</code> to stream logs to <code class="svelte-1by6o5t">$SYS/broker/log/*</code> and view them in the Logs tab. <code class="svelte-1by6o5t">none</code> disables logging entirely.</p></div> <div class="field svelte-1by6o5t"><span class="field-key svelte-1by6o5t">log_type</span> <div class="log-type-grid svelte-1by6o5t"><div class="log-type-group svelte-1by6o5t"><span class="log-type-group-label svelte-1by6o5t">Severity</span> <!></div> <div class="log-type-group svelte-1by6o5t"><span class="log-type-group-label svelte-1by6o5t">Events</span> <!></div> <div class="log-type-group log-type-group--other svelte-1by6o5t"><!> <span class="all-hint svelte-1by6o5t">enables all types above</span></div></div> <p class="hint svelte-1by6o5t">Types of messages to log. Leave all unchecked to use the broker default.</p></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Connection limits</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_connections</span> <input placeholder="−1 (unlimited)" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum simultaneous client connections. <code class="svelte-1by6o5t">-1</code> = unlimited.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_keepalive</span> <input placeholder="65535" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum keepalive value (seconds) a client may request. <code class="svelte-1by6o5t">0</code> = unlimited.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_inflight_messages</span> <input placeholder="20" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Max simultaneous unacknowledged QoS 1/2 messages per client.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_queued_messages</span> <input placeholder="100" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Max messages queued for a disconnected persistent client.</p></div></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Packet &amp; payload size</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">max_packet_size</span> <input placeholder="0 (no limit)" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum MQTT packet size in bytes (MQTT v5 only). <code class="svelte-1by6o5t">0</code> = no limit.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">message_size_limit</span> <input placeholder="0 (no limit)" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Maximum payload size in bytes for published messages. <code class="svelte-1by6o5t">0</code> = no limit.</p></div></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Sessions &amp; persistence</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">persistent_client_expiration</span> <input placeholder="e.g. 7d, 2h, 30m" class="svelte-1by6o5t"/></label> <p class="hint svelte-1by6o5t">Expire persistent sessions after this duration. Suffix: <code class="svelte-1by6o5t">d</code>/<code class="svelte-1by6o5t">h</code>/<code class="svelte-1by6o5t">m</code>/<code class="svelte-1by6o5t">s</code>. Empty = never expire.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">retain_available</span> <select class="svelte-1by6o5t"><option>auto (broker default)</option><option>true — allow retained messages</option><option>false — disable retained messages globally</option></select></label> <p class="hint svelte-1by6o5t">Disable retained messages broker-wide.</p></div></div></div> <div class="section svelte-1by6o5t"><h4 class="svelte-1by6o5t">Performance</h4> <div class="field-grid svelte-1by6o5t"><div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">set_tcp_nodelay</span> <select class="svelte-1by6o5t"><option>auto (broker default)</option><option>true — disable Nagle (lower latency)</option><option>false — enable Nagle</option></select></label> <p class="hint svelte-1by6o5t">Disable Nagle's algorithm to reduce latency at the cost of slightly more packets.</p></div> <div class="field svelte-1by6o5t"><label class="svelte-1by6o5t"><span class="svelte-1by6o5t">connection_messages</span> <select class="svelte-1by6o5t"><option>auto (broker default)</option><option>true — log connect/disconnect</option><option>false — suppress</option></select></label> <p class="hint svelte-1by6o5t">Log a message on every client connect and disconnect.</p></div></div></div>`,1),KJ=B('<div class="config-page svelte-1by6o5t"><div class="page-header svelte-1by6o5t"><h3 class="svelte-1by6o5t">Global config</h3> <div class="header-actions svelte-1by6o5t"><button class="btn-save svelte-1by6o5t"> </button> <button class="btn-reload svelte-1by6o5t"> </button></div></div> <!> <!> <!> <!> <!></div>');function ZJ(o,e){Vs(e,!0);let t=I(null),i=I(""),n=I(!1),s=I(""),r=I(!1),a=I(!1),d=I(""),u=I(null),f=I(""),g=I(""),p=I(""),C=I(""),b=I(""),y=I(""),w=I(""),A=I(""),P=I(""),M=I("");const R=["file","stdout","stderr","syslog","topic","none"],T=["error","warning","notice","information","debug"],V=["connect","disconnect","subscribe","unsubscribe","publish","receive","websockets"],W=["all"];[...T,...V,...W];let Q=I(Ei(new Set)),ne=I(Ei(new Set));function de(wt,Ft){const Vt=new Set(wt);return Vt.has(Ft)?Vt.delete(Ft):Vt.add(Ft),Vt}function te(wt){if(!c(t))return"";const Ft=c(t).managed[wt];return Array.isArray(Ft)?Ft[0]:Ft??""}function he(wt){if(!c(t))return new Set;const Ft=c(t).managed[wt];return Ft?new Set(Array.isArray(Ft)?Ft:[Ft]):new Set}Ks(()=>De());async function De(){try{m(t,await rS(),!0),m(u,c(t).checksum,!0),m(f,te("max_connections"),!0),m(g,te("max_inflight_messages"),!0),m(p,te("max_queued_messages"),!0),m(C,te("max_packet_size"),!0),m(b,te("message_size_limit"),!0),m(y,te("max_keepalive"),!0),m(w,te("persistent_client_expiration"),!0),m(A,te("retain_available"),!0),m(P,te("set_tcp_nodelay"),!0),m(M,te("connection_messages"),!0),m(Q,he("log_dest"),!0),m(ne,he("log_type"),!0),m(i,"")}catch(wt){m(i,wt.message??"Failed to load config",!0)}}async function oe(){if(c(t)){m(n,!0),m(s,""),m(r,!1);try{let Ft=function(Vt,zt){zt!==""?wt[Vt]=zt:delete wt[Vt]};const wt={...c(t).managed};Ft("max_connections",c(f)),Ft("max_inflight_messages",c(g)),Ft("max_queued_messages",c(p)),Ft("max_packet_size",c(C)),Ft("message_size_limit",c(b)),Ft("max_keepalive",c(y)),Ft("persistent_client_expiration",c(w)),Ft("retain_available",c(A)),Ft("set_tcp_nodelay",c(P)),Ft("connection_messages",c(M)),c(Q).size>0?wt.log_dest=c(Q).size===1?[...c(Q)][0]:[...c(Q)]:delete wt.log_dest,c(ne).size>0?wt.log_type=c(ne).size===1?[...c(ne)][0]:[...c(ne)]:delete wt.log_type,await bF({listeners:c(t).listeners,managed:wt,passthrough:c(t).passthrough,checksum:c(u)}),m(r,!0),setTimeout(()=>m(r,!1),3e3),await De()}catch(wt){m(s,wt.message??"Save failed",!0)}finally{m(n,!1)}}}async function ge(){m(a,!0),m(d,"");try{const wt=await CF();m(d,wt.stderr||wt.stdout||"Reloaded",!0)}catch(wt){m(d,"Error: "+(wt.message??"reload failed"))}finally{m(a,!1)}}var Se=KJ(),Re=_(Se),xe=v(_(Re),2),et=_(xe),We=_(et),_e=v(et,2),dt=_(_e),Wt=v(Re,2);{var tt=wt=>{var Ft=KA(),Vt=_(Ft);j(()=>O(Vt,c(i))),D(wt,Ft)};z(Wt,wt=>{c(i)&&wt(tt)})}var kt=v(Wt,2);{var be=wt=>{var Ft=KA(),Vt=_(Ft);j(()=>O(Vt,c(s))),D(wt,Ft)};z(kt,wt=>{c(s)&&wt(be)})}var Rt=v(kt,2);{var ut=wt=>{var Ft=$J();D(wt,Ft)};z(Rt,wt=>{c(r)&&wt(ut)})}var at=v(Rt,2);{var Ze=wt=>{var Ft=UJ(),Vt=_(Ft);j(()=>O(Vt,c(d))),D(wt,Ft)};z(at,wt=>{c(d)&&wt(Ze)})}var Pt=v(at,2);{var ui=wt=>{var Ft=GJ(),Vt=yt(Ft),zt=v(_(Vt),2),Zt=v(_(zt),2);ei(Zt,21,()=>R,Ni,(ht,_t)=>{var Xt=KC(),F=_(Xt),H=v(F,3);j(K=>{oa(F,K),O(H,` ${c(_t)??""}`)},[()=>c(Q).has(c(_t))]),$("change",F,()=>{m(Q,de(c(Q),c(_t)),!0)}),D(ht,Xt)});var mt=v(zt,2),Mi=v(_(mt),2),Ri=_(Mi),Di=v(_(Ri),2);ei(Di,17,()=>T,Ni,(ht,_t)=>{var Xt=KC(),F=_(Xt),H=v(F,3);j(K=>{oa(F,K),O(H,` ${c(_t)??""}`)},[()=>c(ne).has(c(_t))]),$("change",F,()=>{m(ne,de(c(ne),c(_t)),!0)}),D(ht,Xt)});var Ui=v(Ri,2),ji=v(_(Ui),2);ei(ji,17,()=>V,Ni,(ht,_t)=>{var Xt=KC(),F=_(Xt),H=v(F,3);j(K=>{oa(F,K),O(H,` ${c(_t)??""}`)},[()=>c(ne).has(c(_t))]),$("change",F,()=>{m(ne,de(c(ne),c(_t)),!0)}),D(ht,Xt)});var Bi=v(Ui,2),fn=_(Bi);ei(fn,17,()=>W,Ni,(ht,_t)=>{var Xt=qJ(),F=_(Xt),H=v(F,4),K=_(H);j(le=>{oa(F,le),O(K,c(_t))},[()=>c(ne).has(c(_t))]),$("change",F,()=>{m(ne,de(c(ne),c(_t)),!0)}),D(ht,Xt)});var an=v(Vt,2),Zi=v(_(an),2),_n=_(Zi),gt=_(_n),Yt=v(_(gt),2),Ci=v(_n,2),Wi=_(Ci),Pi=v(_(Wi),2),Ti=v(Ci,2),Oi=_(Ti),Qi=v(_(Oi),2),yi=v(Ti,2),Xe=_(yi),St=v(_(Xe),2),Ai=v(an,2),ki=v(_(Ai),2),fi=_(ki),Ii=_(fi),X=v(_(Ii),2),Ae=v(fi,2),qe=_(Ae),nt=v(_(qe),2),qt=v(Ai,2),se=v(_(qt),2),Ee=_(se),Le=_(Ee),Y=v(_(Le),2),Oe=v(Ee,2),Ve=_(Oe),ye=v(_(Ve),2),At=_(ye);At.value=At.__value="";var Ot=v(At);Ot.value=Ot.__value="true";var ri=v(Ot);ri.value=ri.__value="false";var oi=v(qt,2),xi=v(_(oi),2),Ut=_(xi),mi=_(Ut),He=v(_(mi),2),Ye=_(He);Ye.value=Ye.__value="";var Qt=v(Ye);Qt.value=Qt.__value="true";var Gt=v(Qt);Gt.value=Gt.__value="false";var gi=v(Ut,2),Jt=_(gi),fe=v(_(Jt),2),Ke=_(fe);Ke.value=Ke.__value="";var ot=v(Ke);ot.value=ot.__value="true";var rt=v(ot);rt.value=rt.__value="false",jt(Yt,()=>c(f),ht=>m(f,ht)),jt(Pi,()=>c(y),ht=>m(y,ht)),jt(Qi,()=>c(g),ht=>m(g,ht)),jt(St,()=>c(p),ht=>m(p,ht)),jt(X,()=>c(C),ht=>m(C,ht)),jt(nt,()=>c(b),ht=>m(b,ht)),jt(Y,()=>c(w),ht=>m(w,ht)),Fs(ye,()=>c(A),ht=>m(A,ht)),Fs(He,()=>c(P),ht=>m(P,ht)),Fs(fe,()=>c(M),ht=>m(M,ht)),D(wt,Ft)};z(Pt,wt=>{c(t)&&wt(ui)})}j(()=>{et.disabled=c(n),O(We,c(n)?"Saving…":"Save"),_e.disabled=c(a),O(dt,c(a)?"Reloading…":"Apply & Reload")}),$("click",et,oe),$("click",_e,ge),D(o,Se),js()}Zs(["click","change"]);var il=B('<div class="err svelte-9auejo"> </div>'),XJ=B('<div class="info-card svelte-9auejo"><dl class="svelte-9auejo"><dt class="svelte-9auejo">CN</dt><dd class="svelte-9auejo"> </dd> <dt class="svelte-9auejo">Fingerprint (SHA-256)</dt><dd class="mono small svelte-9auejo"> </dd> <dt class="svelte-9auejo">Expires</dt><dd> </dd></dl></div>'),YJ=B('<div class="empty svelte-9auejo">No managed server certificate. Use one of the options above, or configure <code>certfile</code>/<code>keyfile</code> manually in the Listeners tab.</div>'),QJ=B('<div class="empty svelte-9auejo">No trusted CA certs. Add one to enable client certificate authentication.</div>'),JJ=B('<tr><td class="mono svelte-9auejo"> </td><td class="mono small svelte-9auejo"> </td><td> </td><td class="actions svelte-9auejo"><button class="danger svelte-9auejo">✕</button></td></tr>'),eee=B('<table class="svelte-9auejo"><thead><tr><th class="svelte-9auejo">CN</th><th class="svelte-9auejo">Fingerprint</th><th class="svelte-9auejo">Expires</th><th class="svelte-9auejo"></th></tr></thead><tbody></tbody></table>'),tee=B('<div class="result-box svelte-9auejo"><p class="svelte-9auejo">✓ Certificate installed.</p> <dl class="svelte-9auejo"><dt class="svelte-9auejo">Fingerprint</dt><dd class="mono small svelte-9auejo"> </dd><dt class="svelte-9auejo">Expires</dt><dd class="svelte-9auejo"> </dd></dl></div>'),ZA=B('<button class="btn-primary svelte-9auejo"> </button>'),iee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal svelte-9auejo"><h3 class="svelte-9auejo">Generate self-signed server certificate</h3> <label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Validity (days)<input type="number" min="1" max="3650" class="svelte-9auejo"/></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div></div></div>'),nee=B('<label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <p class="hint svelte-9auejo">A private key and CSR are generated on the server. Copy the CSR, have it signed by your CA, then paste the signed cert below.</p> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),see=B('<div class="ok svelte-9auejo">✓ Certificate installed.</div>'),oee=B('<p class="hint svelte-9auejo">Key stored on server. Copy the CSR, get it signed, then paste the signed certificate to complete installation.</p> <label class="svelte-9auejo">Certificate Signing Request<textarea readonly="" rows="8" class="svelte-9auejo"></textarea></label> <div class="csr-actions svelte-9auejo"><button class="svelte-9auejo">Copy CSR</button> <a class="btn-download svelte-9auejo" download="server.csr">Download .csr</a></div> <hr class="svelte-9auejo"/> <label class="svelte-9auejo">Upload signed certificate (PEM)<textarea rows="6" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div>',1),ree=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Generate key + CSR for server certificate</h3> <!></div></div>'),aee=B('<label class="svelte-9auejo">Certificate (PEM)<textarea rows="5" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <label class="svelte-9auejo">Private key (PEM — leave blank if key is already on disk from a prior CSR)<textarea rows="4" placeholder="-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----" class="svelte-9auejo"></textarea></label>',1),lee=B('<span class="file-name mono small svelte-9auejo"> </span>'),cee=B('<label class="svelte-9auejo">PKCS#12 file <div class="file-row svelte-9auejo"><input type="file" accept=".p12,.pfx" class="svelte-9auejo"/> <!></div></label> <label class="svelte-9auejo">Passphrase <div class="pw-row svelte-9auejo"><input autocomplete="off" class="svelte-9auejo"/> <button class="toggle-pw svelte-9auejo"> </button></div></label>',1),dee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Import server certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>PEM files</button> <button>PKCS#12 (.p12 / .pfx)</button></div> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),ZC=B("<option></option>"),uee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Use existing certificate files</h3> <p class="hint svelte-9auejo">Enter absolute paths on the broker host. Tab-completion is available for paths starting with /.</p> <label class="svelte-9auejo">Certificate file path <input list="set-cert-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/fullchain.pem" class="svelte-9auejo"/> <datalist id="set-cert-path-list"></datalist></label> <label class="svelte-9auejo">Private key file path <input list="set-key-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/privkey.pem" class="svelte-9auejo"/> <datalist id="set-key-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),hee=B('<label class="svelte-9auejo">CA certificate (PEM)<textarea rows="8" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),fee=B('<p class="hint svelte-9auejo">Enter the absolute path to the CA certificate file on the broker host.</p> <label class="svelte-9auejo">CA certificate path <input list="trusted-path-list" placeholder="/etc/ssl/certs/my-ca.pem" class="svelte-9auejo"/> <datalist id="trusted-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),gee=B('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Add trusted CA certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>Paste PEM</button> <button>From path</button></div> <!></div></div>'),pee=B('<div class="certs-page svelte-9auejo"><div class="page-toolbar svelte-9auejo"><button class="reload-btn svelte-9auejo" title="Refresh">↺</button></div> <!> <!> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Server Certificate</h3> <button class="svelte-9auejo">Self-signed</button> <button class="svelte-9auejo">Generate CSR</button> <button class="svelte-9auejo">Import cert</button> <button class="svelte-9auejo">Use path</button></div> <!></div> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Trusted CA Certificates</h3> <button class="svelte-9auejo">+ Add CA cert</button></div> <!></div></div> <!> <!> <!> <!> <!>',1);function xee(o,e){Vs(e,!0);let t=I(null),i=I(Ei([])),n=I(""),s=I(""),r=I(!1),a=I(""),d=I(""),u=I(365),f=I(!1),g=I(""),p=I(null),C=I(!1),b=I(""),y=I(""),w=I(!1),A=I(""),P=I(""),M=I(""),R=I(!1),T=I(""),V=I(!1),W=I(!1),Q=I("pem"),ne=I(""),de=I(""),te=I(""),he=I(""),De=I(""),oe=I(!1),ge=I(!1),Se=I(""),Re=I(!1),xe=I(""),et=I(""),We=I(!1),_e=I(""),dt=I(Ei([])),Wt=I(Ei([])),tt=I(!1),kt=I("pem"),be=I(""),Rt=I(!1),ut=I(""),at=I(""),Ze=I(Ei([])),Pt=I(!1),ui=I("");async function wt(){try{const[He,Ye]=await Promise.allSettled([IU(),MU()]);He.status==="fulfilled"&&m(t,He.value.server,!0),Ye.status==="fulfilled"&&m(i,Ye.value.certs,!0),m(n,"")}catch(He){m(n,He.message,!0)}}Ks(()=>{wt()});async function Ft(){m(g,""),m(f,!0),m(p,null);try{const He=c(d).split(",").map(Qt=>Qt.trim()).filter(Boolean),Ye=await PU({cn:c(a),san:He,days:c(u)});m(p,{fingerprint:Ye.fingerprint,expires:Ye.expires},!0),await wt()}catch(He){m(g,He.message,!0)}finally{m(f,!1)}}async function Vt(){m(A,""),m(w,!0),m(P,"");try{const He=c(y).split(",").map(Qt=>Qt.trim()).filter(Boolean),Ye=await TU({cn:c(b),san:He});m(P,Ye.csrPem,!0)}catch(He){m(A,He.message,!0)}finally{m(w,!1)}}async function zt(){m(T,""),m(R,!0),m(V,!1);try{if(!c(M).trim())throw new Error("Paste the signed certificate PEM");await jC({cert:c(M)}),m(V,!0),await wt()}catch(He){m(T,He.message,!0)}finally{m(R,!1)}}function Zt(){navigator.clipboard.writeText(c(P)).catch(()=>{})}function mt(He){var Gt;const Ye=(Gt=He.target.files)==null?void 0:Gt[0];if(!Ye)return;m(he,Ye.name,!0);const Qt=new FileReader;Qt.onload=()=>{const gi=Qt.result;m(te,btoa(String.fromCharCode(...new Uint8Array(gi))),!0)},Qt.readAsArrayBuffer(Ye)}async function Mi(){m(Se,""),m(ge,!0);try{if(c(Q)==="p12"){if(!c(te))throw new Error("Select a .p12 / .pfx file");await jC({p12base64:c(te),passphrase:c(De)})}else{if(!c(ne).trim())throw new Error("Certificate PEM is required");await jC({cert:c(ne),key:c(de)||void 0})}m(W,!1),await wt()}catch(He){m(Se,He.message,!0)}finally{m(ge,!1)}}function Ri(He){let Ye;return Qt=>{const Gt=Qt.target.value;clearTimeout(Ye),Ye=setTimeout(async()=>{if(!Gt.startsWith("/")||Gt.length<2){He([]);return}try{He((await OU(Gt)).suggestions)}catch{He([])}},280)}}const Di=Ri(He=>{m(dt,He,!0)}),Ui=Ri(He=>{m(Wt,He,!0)}),ji=Ri(He=>{m(Ze,He,!0)});async function Bi(){m(_e,""),m(We,!0);try{await HU({certPath:c(xe),keyPath:c(et)}),m(Re,!1),await wt()}catch(He){m(_e,He.message,!0)}finally{m(We,!1)}}async function fn(){m(ut,""),m(Rt,!0);try{await RU(c(be)),m(be,""),m(tt,!1),await wt()}catch(He){m(ut,He.message,!0)}finally{m(Rt,!1)}}async function an(){m(ui,""),m(Pt,!0);try{await WU(c(at)),m(at,""),m(tt,!1),await wt()}catch(He){m(ui,He.message,!0)}finally{m(Pt,!1)}}async function Zi(He){if(confirm("Remove this trusted CA cert?"))try{await NU(He),await wt()}catch(Ye){m(s,Ye.message,!0)}}function _n(He){const Ye=new Date(He).getTime()-Date.now();return Ye<0?"expired":Ye<30*864e5?"expiring":""}function gt(He){return new Date(He).toLocaleDateString()}var Yt=pee(),Ci=yt(Yt),Wi=_(Ci),Pi=_(Wi),Ti=v(Wi,2);{var Oi=He=>{var Ye=il(),Qt=_(Ye);j(()=>O(Qt,c(n))),D(He,Ye)};z(Ti,He=>{c(n)&&He(Oi)})}var Qi=v(Ti,2);{var yi=He=>{var Ye=il(),Qt=_(Ye);j(()=>O(Qt,c(s))),D(He,Ye)};z(Qi,He=>{c(s)&&He(yi)})}var Xe=v(Qi,2),St=_(Xe),Ai=v(_(St),2),ki=v(Ai,2),fi=v(ki,2),Ii=v(fi,2),X=v(St,2);{var Ae=He=>{var Ye=XJ(),Qt=_(Ye),Gt=v(_(Qt)),gi=_(Gt),Jt=v(Gt,3),fe=_(Jt),Ke=v(Jt,3),ot=_(Ke);j((rt,ht)=>{O(gi,c(t).cn),O(fe,c(t).fingerprint),Bt(Ke,1,rt,"svelte-9auejo"),O(ot,ht)},[()=>sg(_n(c(t).expires)),()=>gt(c(t).expires)]),D(He,Ye)},qe=He=>{var Ye=YJ();D(He,Ye)};z(X,He=>{c(t)?He(Ae):He(qe,-1)})}var nt=v(Xe,2),qt=_(nt),se=v(_(qt),2),Ee=v(qt,2);{var Le=He=>{var Ye=QJ();D(He,Ye)},Y=He=>{var Ye=eee(),Qt=v(_(Ye));ei(Qt,21,()=>c(i),Ni,(Gt,gi)=>{var Jt=JJ(),fe=_(Jt),Ke=_(fe),ot=v(fe),rt=_(ot),ht=v(ot),_t=_(ht),Xt=v(ht),F=_(Xt);j((H,K,le)=>{O(Ke,c(gi).cn),O(rt,`${H??""}…`),Bt(ht,1,K,"svelte-9auejo"),O(_t,le)},[()=>c(gi).fingerprint.slice(0,29),()=>sg(_n(c(gi).expires)),()=>gt(c(gi).expires)]),$("click",F,()=>Zi(c(gi).fingerprint)),D(Gt,Jt)}),D(He,Ye)};z(Ee,He=>{c(i).length===0?He(Le):He(Y,-1)})}var Oe=v(Ci,2);{var Ve=He=>{var Ye=iee(),Qt=_(Ye),Gt=v(_(Qt),2),gi=v(_(Gt)),Jt=v(Gt,2),fe=v(_(Jt)),Ke=v(Jt,2),ot=v(_(Ke)),rt=v(Ke,2);{var ht=Z=>{var J=il(),ce=_(J);j(()=>O(ce,c(g))),D(Z,J)};z(rt,Z=>{c(g)&&Z(ht)})}var _t=v(rt,2);{var Xt=Z=>{var J=tee(),ce=v(_(J),2),Qe=v(_(ce)),ae=_(Qe),pe=v(Qe,2),Te=_(pe);j(me=>{O(ae,c(p).fingerprint),O(Te,me)},[()=>gt(c(p).expires)]),D(Z,J)};z(_t,Z=>{c(p)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2);{var le=Z=>{var J=ZA(),ce=_(J);j(()=>{J.disabled=c(f),O(ce,c(f)?"Generating…":"Generate")}),$("click",J,Ft),D(Z,J)};z(K,Z=>{c(p)||Z(le)})}jt(gi,()=>c(a),Z=>m(a,Z)),jt(fe,()=>c(d),Z=>m(d,Z)),jt(ot,()=>c(u),Z=>m(u,Z)),$("click",H,()=>m(r,!1)),D(He,Ye)};z(Oe,He=>{c(r)&&He(Ve)})}var ye=v(Oe,2);{var At=He=>{var Ye=ree(),Qt=_(Ye),Gt=v(_(Qt),2);{var gi=fe=>{var Ke=nee(),ot=yt(Ke),rt=v(_(ot)),ht=v(ot,2),_t=v(_(ht)),Xt=v(ht,4);{var F=J=>{var ce=il(),Qe=_(ce);j(()=>O(Qe,c(A))),D(J,ce)};z(Xt,J=>{c(A)&&J(F)})}var H=v(Xt,2),K=_(H),le=v(K,2),Z=_(le);j(()=>{le.disabled=c(w),O(Z,c(w)?"Generating…":"Generate key + CSR")}),jt(rt,()=>c(b),J=>m(b,J)),jt(_t,()=>c(y),J=>m(y,J)),$("click",K,()=>m(C,!1)),$("click",le,Vt),D(fe,Ke)},Jt=fe=>{var Ke=oee(),ot=v(yt(Ke),2),rt=v(_(ot)),ht=v(ot,2),_t=_(ht),Xt=v(_t,2),F=v(ht,4),H=v(_(F)),K=v(F,2);{var le=Te=>{var me=il(),Ie=_(me);j(()=>O(Ie,c(T))),D(Te,me)};z(K,Te=>{c(T)&&Te(le)})}var Z=v(K,2);{var J=Te=>{var me=see();D(Te,me)};z(Z,Te=>{c(V)&&Te(J)})}var ce=v(Z,2),Qe=_(ce),ae=v(Qe,2);{var pe=Te=>{var me=ZA(),Ie=_(me);j(lt=>{me.disabled=lt,O(Ie,c(R)?"Uploading…":"Upload signed cert")},[()=>c(R)||!c(M).trim()]),$("click",me,zt),D(Te,me)};z(ae,Te=>{c(V)||Te(pe)})}j(Te=>{S1(rt,c(P)),ln(Xt,"href",`data:application/pkcs10;charset=utf-8,${Te??""}`)},[()=>encodeURIComponent(c(P))]),$("click",_t,Zt),jt(H,()=>c(M),Te=>m(M,Te)),$("click",Qe,()=>m(C,!1)),D(fe,Ke)};z(Gt,fe=>{c(P)?fe(Jt,-1):fe(gi)})}D(He,Ye)};z(ye,He=>{c(C)&&He(At)})}var Ot=v(ye,2);{var ri=He=>{var Ye=dee(),Qt=_(Ye),Gt=v(_(Qt),2),gi=_(Gt);let Jt;var fe=v(gi,2);let Ke;var ot=v(Gt,2);{var rt=Z=>{var J=aee(),ce=yt(J),Qe=v(_(ce)),ae=v(ce,2),pe=v(_(ae));jt(Qe,()=>c(ne),Te=>m(ne,Te)),jt(pe,()=>c(de),Te=>m(de,Te)),D(Z,J)},ht=Z=>{var J=cee(),ce=yt(J),Qe=v(_(ce)),ae=_(Qe),pe=v(ae,2);{var Te=Ne=>{var it=lee(),Pe=_(it);j(()=>O(Pe,c(he))),D(Ne,it)};z(pe,Ne=>{c(he)&&Ne(Te)})}var me=v(ce,2),Ie=v(_(me)),lt=_(Ie),G=v(lt,2),re=_(G);j(()=>{ln(lt,"type",c(oe)?"text":"password"),O(re,c(oe)?"Hide":"Show")}),$("change",ae,mt),jt(lt,()=>c(De),Ne=>m(De,Ne)),$("click",G,()=>m(oe,!c(oe))),D(Z,J)};z(ot,Z=>{c(Q)==="pem"?Z(rt):Z(ht,-1)})}var _t=v(ot,2);{var Xt=Z=>{var J=il(),ce=_(J);j(()=>O(ce,c(Se))),D(Z,J)};z(_t,Z=>{c(Se)&&Z(Xt)})}var F=v(_t,2),H=_(F),K=v(H,2),le=_(K);j(()=>{Jt=Bt(gi,1,"svelte-9auejo",null,Jt,{active:c(Q)==="pem"}),Ke=Bt(fe,1,"svelte-9auejo",null,Ke,{active:c(Q)==="p12"}),K.disabled=c(ge),O(le,c(ge)?"Importing…":"Import")}),$("click",gi,()=>m(Q,"pem")),$("click",fe,()=>m(Q,"p12")),$("click",H,()=>m(W,!1)),$("click",K,Mi),D(He,Ye)};z(Ot,He=>{c(W)&&He(ri)})}var oi=v(Ot,2);{var xi=He=>{var Ye=uee(),Qt=_(Ye),Gt=v(_(Qt),4),gi=v(_(Gt)),Jt=v(gi,2);ei(Jt,21,()=>c(dt),Ni,(K,le)=>{var Z=ZC(),J={};j(()=>{J!==(J=c(le))&&(Z.value=(Z.__value=c(le))??"")}),D(K,Z)});var fe=v(Gt,2),Ke=v(_(fe)),ot=v(Ke,2);ei(ot,21,()=>c(Wt),Ni,(K,le)=>{var Z=ZC(),J={};j(()=>{J!==(J=c(le))&&(Z.value=(Z.__value=c(le))??"")}),D(K,Z)});var rt=v(fe,2);{var ht=K=>{var le=il(),Z=_(le);j(()=>O(Z,c(_e))),D(K,le)};z(rt,K=>{c(_e)&&K(ht)})}var _t=v(rt,2),Xt=_(_t),F=v(Xt,2),H=_(F);j(K=>{F.disabled=K,O(H,c(We)?"Installing…":"Install")},[()=>c(We)||!c(xe).trim()||!c(et).trim()]),$("input",gi,Di),jt(gi,()=>c(xe),K=>m(xe,K)),$("input",Ke,Ui),jt(Ke,()=>c(et),K=>m(et,K)),$("click",Xt,()=>m(Re,!1)),$("click",F,Bi),D(He,Ye)};z(oi,He=>{c(Re)&&He(xi)})}var Ut=v(oi,2);{var mi=He=>{var Ye=gee(),Qt=_(Ye),Gt=v(_(Qt),2),gi=_(Gt);let Jt;var fe=v(gi,2);let Ke;var ot=v(Gt,2);{var rt=_t=>{var Xt=hee(),F=yt(Xt),H=v(_(F)),K=v(F,2);{var le=ae=>{var pe=il(),Te=_(pe);j(()=>O(Te,c(ut))),D(ae,pe)};z(K,ae=>{c(ut)&&ae(le)})}var Z=v(K,2),J=_(Z),ce=v(J,2),Qe=_(ce);j(ae=>{ce.disabled=ae,O(Qe,c(Rt)?"Adding…":"Add CA cert")},[()=>c(Rt)||!c(be).trim()]),jt(H,()=>c(be),ae=>m(be,ae)),$("click",J,()=>m(tt,!1)),$("click",ce,fn),D(_t,Xt)},ht=_t=>{var Xt=fee(),F=v(yt(Xt),2),H=v(_(F)),K=v(H,2);ei(K,21,()=>c(Ze),Ni,(pe,Te)=>{var me=ZC(),Ie={};j(()=>{Ie!==(Ie=c(Te))&&(me.value=(me.__value=c(Te))??"")}),D(pe,me)});var le=v(F,2);{var Z=pe=>{var Te=il(),me=_(Te);j(()=>O(me,c(ui))),D(pe,Te)};z(le,pe=>{c(ui)&&pe(Z)})}var J=v(le,2),ce=_(J),Qe=v(ce,2),ae=_(Qe);j(pe=>{Qe.disabled=pe,O(ae,c(Pt)?"Adding…":"Add CA cert")},[()=>c(Pt)||!c(at).trim()]),$("input",H,ji),jt(H,()=>c(at),pe=>m(at,pe)),$("click",ce,()=>m(tt,!1)),$("click",Qe,an),D(_t,Xt)};z(ot,_t=>{c(kt)==="pem"?_t(rt):_t(ht,-1)})}j(()=>{Jt=Bt(gi,1,"svelte-9auejo",null,Jt,{active:c(kt)==="pem"}),Ke=Bt(fe,1,"svelte-9auejo",null,Ke,{active:c(kt)==="path"})}),$("click",gi,()=>m(kt,"pem")),$("click",fe,()=>m(kt,"path")),D(He,Ye)};z(Ut,He=>{c(tt)&&He(mi)})}$("click",Pi,wt),$("click",Ai,()=>{m(r,!0),m(g,""),m(p,null)}),$("click",ki,()=>{m(C,!0),m(A,""),m(P,""),m(M,""),m(V,!1),m(T,"")}),$("click",fi,()=>{m(W,!0),m(Se,""),m(Q,"pem"),m(ne,""),m(de,""),m(te,""),m(he,""),m(De,""),m(oe,!1)}),$("click",Ii,()=>{m(Re,!0),m(_e,""),m(xe,""),m(et,""),m(dt,[],!0),m(Wt,[],!0)}),$("click",se,()=>{m(tt,!0),m(ut,""),m(be,""),m(kt,"pem"),m(ui,""),m(at,""),m(Ze,[],!0)}),D(o,Yt),js()}Zs(["click","change","input"]);var Vx=B('<div class="err svelte-17yczfe"> </div>'),mee=B('<div class="check-list svelte-17yczfe"><div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto_ctrl</code> <span> </span></div> <div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto</code> <span> </span></div></div>'),vee=B('<div class="checking svelte-17yczfe">Checking…</div>'),_ee=B('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Tool availability</h3> <p class="hint svelte-17yczfe">These tools must be installed and in the PATH of the she process. They are used by the Setup Wizard and cert installation.</p> <!> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div></div>'),bee=B('<label class="svelte-17yczfe">Install command (run locally) <div class="pubkey-row svelte-17yczfe"><input readonly="" class="svelte-17yczfe"/> <button class="copy-btn svelte-17yczfe">Copy</button></div></label>'),Cee=B('<label class="svelte-17yczfe">Public key <div class="pubkey-row svelte-17yczfe"><textarea readonly="" rows="3" class="svelte-17yczfe"></textarea> <button class="copy-btn svelte-17yczfe">Copy</button></div></label> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>',1),Eee=B('<div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>'),yee=B("<span> </span>"),wee=B('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH connection</h3> <p class="hint svelte-17yczfe">Used for file operations: reading/writing mosquitto.conf and installing certificates on the broker host. User/ACL management always uses the MQTT port directly.</p> <div class="fields svelte-17yczfe"><label class="svelte-17yczfe">Host<input placeholder="192.168.1.10 or broker.local" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Port<input type="number" min="1" max="65535" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">SSH user<input placeholder="root" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Identity file (private key)<input class="svelte-17yczfe"/></label></div></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH keypair</h3> <p class="hint svelte-17yczfe">Dedicated Ed25519 keypair for she to authenticate to the broker host. Private key stored at <code class="svelte-17yczfe"> </code>.</p> <!> <!></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Test connection</h3> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button> <!></div></div>',1),See=B('<div class="ok svelte-17yczfe">Saved.</div>'),Dee=B('<div class="mosquitto-page svelte-17yczfe"><!> <div class="mode-bar svelte-17yczfe"><span class="mode-label svelte-17yczfe">Connection mode</span> <div class="mode-toggle svelte-17yczfe"><button>Local</button> <button>SSH / Remote</button></div> <span class="mode-desc svelte-17yczfe"> </span></div> <!> <!> <!> <!> <div class="row svelte-17yczfe"><button class="btn-primary svelte-17yczfe"> </button></div></div>');function Aee(o,e){Vs(e,!0);let t=I(Ei({})),i=I(""),n=I(!1),s=I(!1),r=I(""),a=I("~/.she/ssh/broker_id_ed25519"),d=I("local"),u=I(null),f=I(!1),g=I(""),p=I(""),C=I(!1),b=I(""),y=I(!1),w=I(""),A=I(Ei({}));Ks(async()=>{try{const[Ze,Pt,ui]=await Promise.all([Il(),oS(),fetch("/she/broker/ssh/pubkey").then(Ft=>Ft.json()).catch(()=>({publicKey:null}))]);m(A,Ze,!0),Pt.sshKeyDefault&&m(a,Pt.sshKeyDefault,!0);const wt=c(A).broker??{};m(t,wt.ssh??{},!0),c(t).port||(c(t).port=22),c(t).identityFile||(c(t).identityFile=c(a)),ui.publicKey&&m(p,ui.publicKey,!0),m(d,c(t).host?"ssh":"local",!0),c(d)==="local"&&P()}catch(Ze){m(i,Ze.message,!0)}});async function P(){m(f,!0),m(g,"");try{m(u,await oU(),!0)}catch(Ze){m(g,Ze.message??"Check failed",!0)}finally{m(f,!1)}}async function M(){m(n,!0),m(r,""),m(s,!1);try{const Ze=c(A).broker??{},Pt=c(d)==="local"?{...c(t),host:""}:c(t),ui={...c(A),broker:{...Ze,ssh:Pt}};await ap(ui),m(s,!0),setTimeout(()=>m(s,!1),3e3)}catch(Ze){m(r,Ze.message,!0)}finally{m(n,!1)}}async function R(){m(C,!0),m(b,"");try{const Ze=await fetch("/she/broker/ssh/keygen",{method:"POST",headers:{"Content-Type":"application/json"}}),Pt=await Ze.json();if(!Ze.ok)throw new Error(Pt.error??Ze.statusText);m(p,Pt.publicKey,!0)}catch(Ze){m(b,Ze.message,!0)}finally{m(C,!1)}}async function T(){m(y,!0),m(w,"");try{const Ze=await fetch("/she/broker/ssh/test",{method:"POST",headers:{"Content-Type":"application/json"}}),Pt=await Ze.json();if(!Ze.ok)throw new Error(Pt.error??Ze.statusText);m(w,Pt.ok?"✓ Connection successful":"✗ "+(Pt.error??"Failed"),!0)}catch(Ze){m(w,"✗ "+Ze.message)}finally{m(y,!1)}}function V(Ze){navigator.clipboard.writeText(Ze).catch(()=>{})}const W=Tt(()=>c(t).identityFile&&c(t).user&&c(t).host?`ssh-copy-id -i ${c(t).identityFile}.pub ${c(t).user}@${c(t).host}`:"");var Q=Dee(),ne=_(Q);{var de=Ze=>{var Pt=Vx(),ui=_(Pt);j(()=>O(ui,c(i))),D(Ze,Pt)};z(ne,Ze=>{c(i)&&Ze(de)})}var te=v(ne,2),he=v(_(te),2),De=_(he);let oe;var ge=v(De,2);let Se;var Re=v(he,2),xe=_(Re),et=v(te,2);{var We=Ze=>{var Pt=_ee(),ui=v(_(Pt),4);{var wt=Ri=>{var Di=Vx(),Ui=_(Di);j(()=>O(Ui,c(g))),D(Ri,Di)};z(ui,Ri=>{c(g)&&Ri(wt)})}var Ft=v(ui,2);{var Vt=Ri=>{var Di=mee(),Ui=_(Di),ji=_(Ui);let Bi;var fn=_(ji),an=v(ji,4);let Zi;var _n=_(an),gt=v(Ui,2),Yt=_(gt);let Ci;var Wi=_(Yt),Pi=v(Yt,4);let Ti;var Oi=_(Pi);j(()=>{Bi=Bt(ji,1,"check-icon svelte-17yczfe",null,Bi,{ok:c(u).mosquittoCtrl,fail:!c(u).mosquittoCtrl}),O(fn,c(u).mosquittoCtrl?"✓":"✗"),Zi=Bt(an,1,"check-note svelte-17yczfe",null,Zi,{ok:c(u).mosquittoCtrl,fail:!c(u).mosquittoCtrl}),O(_n,c(u).mosquittoCtrl?"found in PATH":"not found — install the mosquitto or mosquitto-clients package"),Ci=Bt(Yt,1,"check-icon svelte-17yczfe",null,Ci,{ok:c(u).mosquitto,fail:!c(u).mosquitto}),O(Wi,c(u).mosquitto?"✓":"✗"),Ti=Bt(Pi,1,"check-note svelte-17yczfe",null,Ti,{ok:c(u).mosquitto,fail:!c(u).mosquitto}),O(Oi,c(u).mosquitto?"found in PATH":"not found — install the mosquitto package")}),D(Ri,Di)},zt=Ri=>{var Di=vee();D(Ri,Di)};z(Ft,Ri=>{c(u)?Ri(Vt):c(f)&&Ri(zt,1)})}var Zt=v(Ft,2),mt=_(Zt),Mi=_(mt);j(()=>{mt.disabled=c(f),O(Mi,c(f)?"Checking…":c(u)?"Re-check":"Check tools")}),$("click",mt,P),D(Ze,Pt)};z(et,Ze=>{c(d)==="local"&&Ze(We)})}var _e=v(et,2);{var dt=Ze=>{var Pt=wee(),ui=yt(Pt),wt=v(_(ui),4),Ft=_(wt),Vt=v(_(Ft)),zt=v(Ft,2),Zt=v(_(zt)),mt=v(zt,2),Mi=v(_(mt)),Ri=v(mt,2),Di=v(_(Ri)),Ui=v(ui,2),ji=v(_(Ui),2),Bi=v(_(ji)),fn=_(Bi),an=v(ji,2);{var Zi=yi=>{var Xe=Cee(),St=yt(Xe),Ai=v(_(St)),ki=_(Ai),fi=v(ki,2),Ii=v(St,2);{var X=qt=>{var se=bee(),Ee=v(_(se)),Le=_(Ee),Y=v(Le,2);j(()=>S1(Le,c(W))),$("click",Y,()=>V(c(W))),D(qt,se)};z(Ii,qt=>{c(W)&&qt(X)})}var Ae=v(Ii,2),qe=_(Ae),nt=_(qe);j(()=>{S1(ki,c(p)),qe.disabled=c(C),O(nt,c(C)?"Generating…":"Regenerate keypair")}),$("click",fi,()=>V(c(p))),$("click",qe,R),D(yi,Xe)},_n=yi=>{var Xe=Eee(),St=_(Xe),Ai=_(St);j(()=>{St.disabled=c(C),O(Ai,c(C)?"Generating…":"Generate keypair")}),$("click",St,R),D(yi,Xe)};z(an,yi=>{c(p)?yi(Zi):yi(_n,-1)})}var gt=v(an,2);{var Yt=yi=>{var Xe=Vx(),St=_(Xe);j(()=>O(St,c(b))),D(yi,Xe)};z(gt,yi=>{c(b)&&yi(Yt)})}var Ci=v(Ui,2),Wi=v(_(Ci),2),Pi=_(Wi),Ti=_(Pi),Oi=v(Pi,2);{var Qi=yi=>{var Xe=yee();let St;var Ai=_(Xe);j(ki=>{St=Bt(Xe,1,"test-result svelte-17yczfe",null,St,ki),O(Ai,c(w))},[()=>({ok:c(w).startsWith("✓"),fail:c(w).startsWith("✗")})]),D(yi,Xe)};z(Oi,yi=>{c(w)&&yi(Qi)})}j(()=>{ln(Di,"placeholder",c(a)),O(fn,c(t).identityFile||c(a)),Pi.disabled=c(y)||!c(t).host,O(Ti,c(y)?"Testing…":"Test SSH connection")}),jt(Vt,()=>c(t).host,yi=>c(t).host=yi),jt(Zt,()=>c(t).port,yi=>c(t).port=yi),jt(Mi,()=>c(t).user,yi=>c(t).user=yi),jt(Di,()=>c(t).identityFile,yi=>c(t).identityFile=yi),$("click",Pi,T),D(Ze,Pt)};z(_e,Ze=>{c(d)==="ssh"&&Ze(dt)})}var Wt=v(_e,2);{var tt=Ze=>{var Pt=Vx(),ui=_(Pt);j(()=>O(ui,c(r))),D(Ze,Pt)};z(Wt,Ze=>{c(r)&&Ze(tt)})}var kt=v(Wt,2);{var be=Ze=>{var Pt=See();D(Ze,Pt)};z(kt,Ze=>{c(s)&&Ze(be)})}var Rt=v(kt,2),ut=_(Rt),at=_(ut);j(()=>{oe=Bt(De,1,"svelte-17yczfe",null,oe,{active:c(d)==="local"}),Se=Bt(ge,1,"svelte-17yczfe",null,Se,{active:c(d)==="ssh"}),O(xe,c(d)==="local"?"she and mosquitto run on the same machine — local filesystem access":"mosquitto runs on a remote host — file operations go through SSH"),ut.disabled=c(n),O(at,c(n)?"Saving…":"Save")}),$("click",De,()=>{m(d,"local"),c(u)||P()}),$("click",ge,()=>m(d,"ssh")),$("click",ut,M),D(o,Q),js()}Zs(["click"]);var kee=B("<button> </button>"),Bee=B('<code>log_dest topic</code> is not enabled in mosquitto.conf.<br/> <span class="hint svelte-1yc29ow">Enable it in the <strong>Config</strong> tab, then click <em>Apply &amp; Reload</em>.</span>',1),Fee=B('<code>log_dest topic</code> is configured — waiting for messages&hellip;<br/> <span class="hint svelte-1yc29ow">If nothing appears, mosquitto may need a full restart for the change to take effect.</span>',1),Lee=B('Waiting for log messages&hellip;<br/> <span class="hint svelte-1yc29ow">Make sure <code class="svelte-1yc29ow">log_dest topic</code> is set in mosquitto.conf.</span>',1),Iee=B('<div class="empty svelte-1yc29ow"><!></div>'),Pee=B('<div class="entry svelte-1yc29ow"><span class="ts svelte-1yc29ow"> </span> <span> </span> <span class="msg svelte-1yc29ow"> </span></div>'),Tee=B('<div class="logs-page svelte-1yc29ow"><div class="toolbar svelte-1yc29ow"><div class="level-filters svelte-1yc29ow"></div> <div class="spacer svelte-1yc29ow"></div> <label class="autoscroll-label svelte-1yc29ow"><input type="checkbox" class="svelte-1yc29ow"/> <span class="checkmark svelte-1yc29ow"></span> Auto-scroll</label> <button class="btn-clear svelte-1yc29ow">Clear</button></div> <div class="log-container svelte-1yc29ow"><!></div></div>');function Mee(o,e){Vs(e,!0);const t={D:"DBG",I:"INF",N:"NTC",W:"WRN",E:"ERR"},i={D:"lvl-d",I:"lvl-i",N:"lvl-n",W:"lvl-w",E:"lvl-e"},n=new Set(["D","I","N","W","E"]);let s=I(Ei([])),r=I(!0),a=I(Ei(new Set(["D","I","N","W","E"]))),d=I(void 0),u=I(!1),f=I(null),g=null;Ks(async()=>{const te=await aU().catch(()=>[]),he=jU(),De=new Set,oe=[...te,...he].filter(ge=>n.has(ge.level)).map(ge=>({ts:ge.ts,level:ge.level,msg:ge.msg}));oe.sort((ge,Se)=>ge.ts-Se.ts),m(s,oe.filter(ge=>{const Se=`${ge.ts}\0${ge.msg}`;return De.has(Se)?!1:(De.add(Se),!0)}).slice(-500),!0),c(s).length>0&&(m(u,!0),ul().then(p)),g=ar("brokerLog",ge=>{n.has(ge.level)&&(m(u,!0),m(s,[...c(s).slice(-499),{ts:ge.ts,level:ge.level,msg:ge.msg}],!0),c(r)&&ul().then(p))}),rS().then(ge=>{const Se=ge.managed.log_dest,Re=Array.isArray(Se)?Se:Se?[Se]:[];m(f,Re.includes("topic"),!0)}).catch(()=>{m(f,null)})}),Tp(()=>{g==null||g()});function p(){c(d)&&(c(d).scrollTop=c(d).scrollHeight)}function C(te){const he=new Set(c(a));he.has(te)?he.delete(te):he.add(te),m(a,he,!0)}function b(){m(s,[],!0),m(u,!1)}let y=Tt(()=>c(s).filter(te=>c(a).has(te.level)));function w(te){const he=new Date(te);return he.toTimeString().slice(0,8)+"."+String(he.getMilliseconds()).padStart(3,"0")}var A=Tee(),P=_(A),M=_(P);ei(M,20,()=>["D","I","N","W","E"],Ni,(te,he)=>{var De=kee();let oe;var ge=_(De);j(Se=>{oe=Bt(De,1,`lvl-btn ${i[he]??""}`,"svelte-1yc29ow",oe,Se),ln(De,"title",`Toggle ${he??""} messages`),O(ge,t[he])},[()=>({active:c(a).has(he)})]),$("click",De,()=>C(he)),D(te,De)});var R=v(M,4),T=_(R),V=v(R,2),W=v(P,2),Q=_(W);{var ne=te=>{var he=Iee(),De=_(he);{var oe=Se=>{var Re=Es(),xe=yt(Re);{var et=dt=>{var Wt=Bee();D(dt,Wt)},We=dt=>{var Wt=Fee();D(dt,Wt)},_e=dt=>{var Wt=Lee();D(dt,Wt)};z(xe,dt=>{c(f)===!1?dt(et):c(f)===!0?dt(We,1):dt(_e,-1)})}D(Se,Re)},ge=Se=>{var Re=_o("No messages match the current filter.");D(Se,Re)};z(De,Se=>{c(u)?Se(ge,-1):Se(oe)})}D(te,he)},de=te=>{var he=Es(),De=yt(he);ei(De,17,()=>c(y),oe=>oe.ts+oe.msg,(oe,ge)=>{var Se=Pee(),Re=_(Se),xe=_(Re),et=v(Re,2),We=_(et),_e=v(et,2),dt=_(_e);j(Wt=>{O(xe,Wt),Bt(et,1,`badge ${i[c(ge).level]??""}`,"svelte-1yc29ow"),O(We,t[c(ge).level]),O(dt,c(ge).msg)},[()=>w(c(ge).ts)]),D(oe,Se)}),D(te,he)};z(Q,te=>{c(y).length===0?te(ne):te(de,-1)})}us(W,te=>m(d,te),()=>c(d)),Cs(T,()=>c(r),te=>m(r,te)),$("click",V,b),D(o,A),js()}Zs(["click"]);var Ree=B('<div class="err svelte-d31be1"> </div>'),Nee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1">This wizard will configure the <strong>Mosquitto Dynamic Security plugin</strong> for use with she. It will:</p> <ul class="svelte-d31be1"><li>Create a <code class="svelte-d31be1">she-admin</code> service account with a random strong password.</li> <li>Write <code class="svelte-d31be1">dynamic-security.json</code> to your mosquitto config directory.</li> <li>Add the <code class="svelte-d31be1">plugin</code> line to <code class="svelte-d31be1">mosquitto.conf</code>.</li> <li>Ask you to restart mosquitto to activate the plugin.</li></ul> <p class="hint svelte-d31be1">In <strong>remote mode</strong> (SSH host configured), <code class="svelte-d31be1">mosquitto_ctrl</code> is invoked on the broker host via SSH. In local mode, it must be installed on this machine. <code class="svelte-d31be1">mosquitto_ctrl</code> is part of the <code class="svelte-d31be1">mosquitto</code> package.</p> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Start</button></div></div>'),Oee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1"> </p></div>'),Hee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1">dynsec is not yet active. Configure bootstrap settings:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" placeholder="(leave blank to auto-generate)" class="svelte-d31be1"/></label> <label class="svelte-d31be1">Mosquitto config directory<input class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1"> </button></div></div>'),Wee=B('<p class="hint svelte-d31be1">Restarting mosquitto… this may take a few seconds.</p>'),zee=B(`<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec files written and credentials saved.</div> <p class="svelte-d31be1">The <code class="svelte-d31be1">plugin</code> line has been added to <code class="svelte-d31be1"> </code>.</p> <p class="svelte-d31be1">Enabling a new plugin requires a <strong>full mosquitto restart</strong> (not just SIGHUP):</p> <div class="actions svelte-d31be1"><button class="btn-warn svelte-d31be1"> </button> <button class="skip-step svelte-d31be1">Skip (I'll restart manually)</button></div> <!></div>`),Vee=B('<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec is configured and connected.</div> <p class="svelte-d31be1">she is now managing broker users and ACLs via the Dynamic Security plugin. You can use the <strong>Users & Roles</strong> tab to add users, create roles, and define ACL rules.</p> <div class="actions svelte-d31be1"><button class="btn-primary svelte-d31be1">Done</button></div></div>'),jee=B('<div class="step svelte-d31be1"><p class="svelte-d31be1">Enter the credentials of an existing dynsec admin account:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Back</button> <button class="btn-primary svelte-d31be1"> </button></div></div>'),$ee=B('<div class="wizard svelte-d31be1"><div class="wizard-header svelte-d31be1"><h3 class="svelte-d31be1">dynsec Setup Wizard</h3> <button class="skip-btn svelte-d31be1">Manual setup instead</button></div> <!> <!></div>');function Uee(o,e){Vs(e,!0);let t=I("intro"),i=I(""),n=I(!1),s=I("she-admin"),r=I(""),a=I("/etc/mosquitto"),d=I(null),u=I(!1),f=I(!1),g=I("she-admin"),p=I(""),C=I(!1);async function b(){m(n,!0),m(i,"");try{(await(await fetch("/she/broker/wizard/probe",{method:"POST",headers:{"Content-Type":"application/json"}})).json()).active?m(t,"done"):m(t,"config")}catch(oe){m(i,oe.message,!0)}finally{m(n,!1)}}async function y(){m(n,!0),m(i,"");try{const oe=await fetch("/she/broker/wizard/bootstrap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminUsername:c(s),adminPassword:c(r)||void 0,configDir:c(a)})}),ge=await oe.json();if(!oe.ok||!ge.ok)throw new Error(ge.error??"Bootstrap failed");m(d,ge,!0);const Se=await Il(),Re=Se.broker??{};await ap({...Se,broker:{...Re,dynsec:{adminUsername:ge.adminUsername,adminPassword:ge.adminPassword}}}),await dU().catch(()=>{}),m(t,"restart")}catch(oe){m(i,oe.message,!0)}finally{m(n,!1)}}async function w(){m(f,!0),m(i,"");try{await lU(),await new Promise(oe=>setTimeout(oe,2e3)),m(u,!0),m(t,"done")}catch(oe){m(i,oe.message,!0)}finally{m(f,!1)}}async function A(){m(C,!0),m(i,"");try{const oe=await Il(),ge=oe.broker??{};await ap({...oe,broker:{...ge,dynsec:{adminUsername:c(g),adminPassword:c(p)}}}),m(t,"done")}catch(oe){m(i,oe.message,!0)}finally{m(C,!1)}}var P=$ee(),M=_(P),R=v(_(M),2),T=v(M,2);{var V=oe=>{var ge=Ree(),Se=_(ge);j(()=>O(Se,c(i))),D(oe,ge)};z(T,oe=>{c(i)&&oe(V)})}var W=v(T,2);{var Q=oe=>{var ge=Nee(),Se=v(_(ge),6),Re=_(Se);j(()=>Re.disabled=c(n)),$("click",Re,()=>{m(t,"probe"),b()}),D(oe,ge)},ne=oe=>{var ge=Oee(),Se=_(ge),Re=_(Se);j(()=>O(Re,c(n)?"Probing dynsec…":"Checking dynsec status…")),D(oe,ge)},de=oe=>{var ge=Hee(),Se=v(_(ge),2),Re=v(_(Se)),xe=v(Se,2),et=v(_(xe)),We=v(xe,2),_e=v(_(We)),dt=v(We,2),Wt=_(dt),tt=_(Wt);j(()=>{Wt.disabled=c(n)||!c(s),O(tt,c(n)?"Bootstrapping…":"Bootstrap dynsec")}),jt(Re,()=>c(s),kt=>m(s,kt)),jt(et,()=>c(r),kt=>m(r,kt)),jt(_e,()=>c(a),kt=>m(a,kt)),$("click",Wt,y),D(oe,ge)},te=oe=>{var ge=zee(),Se=v(_(ge),2),Re=v(_(Se),3),xe=_(Re),et=v(Se,4),We=_(et),_e=_(We),dt=v(We,2),Wt=v(et,2);{var tt=kt=>{var be=Wee();D(kt,be)};z(Wt,kt=>{c(f)&&kt(tt)})}j(()=>{O(xe,c(d).confFilePath),We.disabled=c(f),O(_e,c(f)?"Restarting…":"Restart mosquitto now")}),$("click",We,w),$("click",dt,()=>{m(t,"done")}),D(oe,ge)},he=oe=>{var ge=Vee(),Se=v(_(ge),4),Re=_(Se);$("click",Re,function(...xe){var et;(et=e.onDone)==null||et.apply(this,xe)}),D(oe,ge)},De=oe=>{var ge=jee(),Se=v(_(ge),2),Re=v(_(Se)),xe=v(Se,2),et=v(_(xe)),We=v(xe,2),_e=_(We),dt=v(_e,2),Wt=_(dt);j(()=>{dt.disabled=c(C)||!c(g)||!c(p),O(Wt,c(C)?"Saving…":"Save credentials")}),jt(Re,()=>c(g),tt=>m(g,tt)),jt(et,()=>c(p),tt=>m(p,tt)),$("click",_e,()=>m(t,"intro")),$("click",dt,A),D(oe,ge)};z(W,oe=>{c(t)==="intro"?oe(Q):c(t)==="probe"?oe(ne,1):c(t)==="config"?oe(de,2):c(t)==="restart"&&c(d)?oe(te,3):c(t)==="done"?oe(he,4):c(t)==="manual"&&oe(De,5)})}$("click",R,()=>m(t,"manual")),D(o,P),js()}Zs(["click"]);var qee=B('<div class="loading svelte-zuhcpo">Loading…</div>'),Gee=B('<div class="error-banner svelte-zuhcpo"> </div>'),Kee=B('<div class="conn-row svelte-zuhcpo"><span></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span><!></span> <button class="btn-deactivate svelte-zuhcpo"> </button></div>'),Zee=B('<button class="btn-wizard-inline svelte-zuhcpo">Setup Wizard ↗</button>'),Xee=B('<div class="conn-row svelte-zuhcpo"><span class="dot dot-off svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span class="conn-detail muted svelte-zuhcpo">not configured</span> <!></div>'),Yee=B('<div class="error-inline svelte-zuhcpo"> </div>'),Qee=B('<button class="diag-btn svelte-zuhcpo"> </button>'),XA=B('<p class="diag-issue svelte-zuhcpo"> </p>'),Jee=B('<p class="diag-ok-msg svelte-zuhcpo">✓ dynamic-security.json looks correct. Verify mosquitto restarted with the plugin loaded.</p>'),ete=B('<p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">File</span><code class="svelte-zuhcpo"> </code></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Admin user exists</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Has admin role</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">$CONTROL publish ACL</span><span> </span></p> <!> <!>',1),tte=B('<div><!></div> <button class="diag-btn svelte-zuhcpo" style="margin-top:6px"> </button>',1),ite=B('<button class="wizard-btn svelte-zuhcpo">Run Setup Wizard</button>'),nte=B('<div class="diag-area svelte-zuhcpo"><!> <!></div>'),ste=B('<div class="stats-block svelte-zuhcpo"><dl class="svelte-zuhcpo"><dt class="svelte-zuhcpo">Version</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Uptime</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Clients</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Messages</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Topics</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Traffic</dt><dd class="svelte-zuhcpo"> </dd></dl></div>'),ote=B('<div style="margin-top: 20px;"><!></div>'),rte=B('<div class="status-layout svelte-zuhcpo"><div class="conn-block svelte-zuhcpo"><div class="conn-row svelte-zuhcpo"><span class="dot ok svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">mosquitto</span> <span class="conn-detail svelte-zuhcpo"> </span></div> <!> <!></div> <!> <!></div> <!>',1),ate=B('<div class="tab-content svelte-zuhcpo"><!></div>'),lte=B('<div class="broker-page svelte-zuhcpo"><div class="sub-nav svelte-zuhcpo"><button>Status</button> <button>Directory</button> <button>Config</button> <button>Listeners</button> <button>Certificates</button> <button>Connection</button> <button>Logs</button></div> <!></div> <!>',1);function cte(o,e){Vs(e,!0);let t=I(!1),i,n=I(!1),s=I(""),r=I(!1),a=I(null);const d="she-broker-tab";let u=I(Ei(localStorage.getItem(d)??"status"));$n(()=>{localStorage.setItem(d,c(u))});let f=I(null),g=I(""),p=I(!0);async function C(){try{m(f,await oS(),!0),m(g,"")}catch(at){m(g,at.message??"Failed to load broker status",!0)}finally{m(p,!1)}}Ks(()=>{C();const at=setInterval(C,1e4);return()=>clearInterval(at)});async function b(){m(r,!0),m(a,null);try{m(a,await uU(),!0)}catch(at){m(a,{ok:!1,dynSecPath:"",issues:[at.message??"Diagnose request failed"]},!0)}finally{m(r,!1)}}async function y(){if(await i.show("Remove dynsec plugin lines from mosquitto.conf and clear credentials? You will need to restart mosquitto afterwards.",{confirm:"Deactivate",danger:!0})){m(n,!0),m(s,"");try{await cU(),await C()}catch(at){m(s,at.message??"Deactivate failed",!0)}finally{m(n,!1)}}}function w(at){var Pt;if(!((Pt=c(f))!=null&&Pt.sys))return"—";const Ze=c(f).sys[at];return Ze?String(Ze.val??"—"):"—"}function A(at){if(at==="—")return at;const Ze=at.match(/^(\d+)/),Pt=Ze?parseInt(Ze[1]):NaN;if(isNaN(Pt))return at;const ui=Math.floor(Pt/86400),wt=Math.floor(Pt%86400/3600),Ft=Math.floor(Pt%3600/60),Vt=Pt%60,zt=Zt=>String(Zt).padStart(2,"0");return ui>0?`${ui}d ${zt(wt)}:${zt(Ft)}:${zt(Vt)}`:`${zt(wt)}:${zt(Ft)}:${zt(Vt)}`}function P(at){if(at==="—")return at;const Ze=parseInt(at);return isNaN(Ze)?at:Ze<1024?`${Ze} B`:Ze<1048576?`${(Ze/1024).toFixed(1)} KB`:Ze<1073741824?`${(Ze/1048576).toFixed(1)} MB`:`${(Ze/1073741824).toFixed(1)} GB`}var M=lte(),R=yt(M),T=_(R),V=_(T);let W;var Q=v(V,2);let ne;var de=v(Q,2);let te;var he=v(de,2);let De;var oe=v(he,2);let ge;var Se=v(oe,2);let Re;var xe=v(Se,2);let et;var We=v(T,2);{var _e=at=>{var Ze=ate(),Pt=_(Ze);{var ui=Vt=>{var zt=qee();D(Vt,zt)},wt=Vt=>{var zt=Gee(),Zt=_(zt);j(()=>O(Zt,c(g))),D(Vt,zt)},Ft=Vt=>{var zt=rte(),Zt=yt(zt),mt=_(Zt),Mi=_(mt),Ri=v(_(Mi),4),Di=_(Ri),Ui=v(Mi,2);{var ji=Ti=>{var Oi=Kee(),Qi=_(Oi);let yi;var Xe=v(Qi,4);let St;var Ai=_(Xe);{var ki=qe=>{var nt=_o("plugin active");D(qe,nt)},fi=qe=>{var nt=_o("connected — plugin not responding");D(qe,nt)},Ii=qe=>{var nt=_o("disconnected");D(qe,nt)};z(Ai,qe=>{c(f).dynsec.dynsecReady?qe(ki):c(f).dynsec.connected?qe(fi,1):qe(Ii,-1)})}var X=v(Xe,2),Ae=_(X);j(()=>{yi=Bt(Qi,1,"dot svelte-zuhcpo",null,yi,{ok:c(f).dynsec.dynsecReady,warn:c(f).dynsec.connected&&!c(f).dynsec.dynsecReady,"dot-err":!c(f).dynsec.connected}),St=Bt(Xe,1,"conn-detail svelte-zuhcpo",null,St,{ok:c(f).dynsec.dynsecReady,warn:c(f).dynsec.connected&&!c(f).dynsec.dynsecReady,err:!c(f).dynsec.connected}),X.disabled=c(n),O(Ae,c(n)?"…":"deactivate")}),$("click",X,y),D(Ti,Oi)},Bi=Ti=>{var Oi=Xee(),Qi=v(_(Oi),6);{var yi=Xe=>{var St=Zee();$("click",St,()=>m(t,!0)),D(Xe,St)};z(Qi,Xe=>{c(t)||Xe(yi)})}D(Ti,Oi)};z(Ui,Ti=>{c(f).dynsec.configured?Ti(ji):Ti(Bi,-1)})}var fn=v(Ui,2);{var an=Ti=>{var Oi=Yee(),Qi=_(Oi);j(()=>O(Qi,c(s))),D(Ti,Oi)};z(fn,Ti=>{c(s)&&Ti(an)})}var Zi=v(mt,2);{var _n=Ti=>{var Oi=nte(),Qi=_(Oi);{var yi=ki=>{var fi=Qee(),Ii=_(fi);j(()=>{fi.disabled=c(r),O(Ii,c(r)?"Running diagnostics…":"Run diagnostics")}),$("click",fi,b),D(ki,fi)},Xe=ki=>{var fi=tte(),Ii=yt(fi);let X;var Ae=_(Ii);{var qe=Ee=>{var Le=XA(),Y=_(Le);j(()=>O(Y,`⚠ ${c(a).error??""}`)),D(Ee,Le)},nt=Ee=>{var Le=ete(),Y=yt(Le),Oe=v(_(Y)),Ve=_(Oe),ye=v(Y,2),At=v(_(ye)),Ot=_(At),ri=v(ye,2),oi=v(_(ri)),xi=_(oi),Ut=v(ri,2),mi=v(_(Ut)),He=_(mi),Ye=v(Ut,2);ei(Ye,17,()=>c(a).issues,Ni,(gi,Jt)=>{var fe=XA(),Ke=_(fe);j(()=>O(Ke,`⚠ ${c(Jt)??""}`)),D(gi,fe)});var Qt=v(Ye,2);{var Gt=gi=>{var Jt=Jee();D(gi,Jt)};z(Qt,gi=>{c(a).ok&&gi(Gt)})}j(()=>{O(Ve,c(a).dynSecPath),Bt(At,1,sg(c(a).adminClientExists?"ok":"fail"),"svelte-zuhcpo"),O(Ot,c(a).adminClientExists?"✓ yes":"✗ no"),Bt(oi,1,sg(c(a).hasAdminRole?"ok":"fail"),"svelte-zuhcpo"),O(xi,c(a).hasAdminRole?"✓ yes":"✗ no"),Bt(mi,1,sg(c(a).hasControlSendAcl?"ok":"fail"),"svelte-zuhcpo"),O(He,c(a).hasControlSendAcl?"✓ present":"✗ missing")}),D(Ee,Le)};z(Ae,Ee=>{c(a).error?Ee(qe):Ee(nt,-1)})}var qt=v(Ii,2),se=_(qt);j(()=>{X=Bt(Ii,1,"diag-card svelte-zuhcpo",null,X,{"diag-ok":c(a).ok,"diag-fail":!c(a).ok}),qt.disabled=c(r),O(se,c(r)?"Running…":"Re-run")}),$("click",qt,b),D(ki,fi)};z(Qi,ki=>{c(a)?ki(Xe,-1):ki(yi)})}var St=v(Qi,2);{var Ai=ki=>{var fi=ite();$("click",fi,()=>m(t,!0)),D(ki,fi)};z(St,ki=>{c(t)||ki(Ai)})}D(Ti,Oi)};z(Zi,Ti=>{c(f).dynsec.configured&&c(f).dynsec.connected&&!c(f).dynsec.dynsecReady&&Ti(_n)})}var gt=v(Zi,2);{var Yt=Ti=>{var Oi=ste(),Qi=_(Oi),yi=v(_(Qi)),Xe=_(yi),St=v(yi,3),Ai=_(St),ki=v(St,3),fi=_(ki),Ii=v(ki,3),X=_(Ii),Ae=v(Ii,3),qe=_(Ae),nt=v(Ae,3),qt=_(nt);j((se,Ee,Le,Y,Oe,Ve,ye,At,Ot,ri,oi,xi)=>{O(Xe,se),O(Ai,Ee),O(fi,`${Le??""} connected · ${Y??""} max · ${Oe??""} total`),O(X,`${Ve??""} rcv · ${ye??""} sent · ${At??""} stored`),O(qe,`${Ot??""} retained · ${ri??""} subscriptions`),O(qt,`${oi??""} in · ${xi??""} out`)},[()=>w("$SYS/broker/version"),()=>A(w("$SYS/broker/uptime")),()=>w("$SYS/broker/clients/connected"),()=>w("$SYS/broker/clients/maximum"),()=>w("$SYS/broker/clients/total"),()=>w("$SYS/broker/messages/received"),()=>w("$SYS/broker/messages/sent"),()=>w("$SYS/broker/messages/stored"),()=>w("$SYS/broker/retained messages/count"),()=>w("$SYS/broker/subscriptions/count"),()=>P(w("$SYS/broker/bytes/received")),()=>P(w("$SYS/broker/bytes/sent"))]),D(Ti,Oi)},Ci=Tt(()=>Object.keys(c(f).sys).length>0);z(gt,Ti=>{c(Ci)&&Ti(Yt)})}var Wi=v(Zt,2);{var Pi=Ti=>{var Oi=ote(),Qi=_(Oi);Uee(Qi,{onDone:()=>{m(t,!1),C()}}),D(Ti,Oi)};z(Wi,Ti=>{c(t)&&(!c(f).dynsec.configured||!c(f).dynsec.dynsecReady)&&Ti(Pi)})}j(()=>O(Di,c(f).sshConfigured?`ssh — ${c(f).sshHost}`:"local")),D(Vt,zt)};z(Pt,Vt=>{c(p)?Vt(ui):c(g)?Vt(wt,1):c(f)&&Vt(Ft,2)})}D(at,Ze)},dt=at=>{{let Ze=Tt(()=>{var Pt;return((Pt=c(f))==null?void 0:Pt.dynsec.dynsecReady)??!1});BJ(at,{get dynsecReady(){return c(Ze)}})}},Wt=at=>{ZJ(at,{})},tt=at=>{jJ(at,{})},kt=at=>{xee(at,{})},be=at=>{Aee(at,{})},Rt=at=>{Mee(at,{})};z(We,at=>{c(u)==="status"?at(_e):c(u)==="users"?at(dt,1):c(u)==="brokerconfig"?at(Wt,2):c(u)==="listeners"?at(tt,3):c(u)==="certs"?at(kt,4):c(u)==="ssh"?at(be,5):c(u)==="logs"&&at(Rt,6)})}var ut=v(R,2);us(qc(ut,{}),at=>i=at,()=>i),j(()=>{W=Bt(V,1,"svelte-zuhcpo",null,W,{active:c(u)==="status"}),ne=Bt(Q,1,"svelte-zuhcpo",null,ne,{active:c(u)==="users"}),te=Bt(de,1,"svelte-zuhcpo",null,te,{active:c(u)==="brokerconfig"}),De=Bt(he,1,"svelte-zuhcpo",null,De,{active:c(u)==="listeners"}),ge=Bt(oe,1,"svelte-zuhcpo",null,ge,{active:c(u)==="certs"}),Re=Bt(Se,1,"svelte-zuhcpo",null,Re,{active:c(u)==="ssh"}),et=Bt(xe,1,"svelte-zuhcpo",null,et,{active:c(u)==="logs"})}),$("click",V,()=>m(u,"status")),$("click",Q,()=>m(u,"users")),$("click",de,()=>m(u,"brokerconfig")),$("click",he,()=>m(u,"listeners")),$("click",oe,()=>m(u,"certs")),$("click",Se,()=>m(u,"ssh")),$("click",xe,()=>m(u,"logs")),D(o,M),js()}Zs(["click"]);var dte=B('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),ute=B('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),hte=B('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),fte=B('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),gte=B('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),pte=B('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),xte=B('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),mte=B('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),vte=B('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),_te=B('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),bte=B('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Cte=B('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),Ete=B('<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>'),yte=B('<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>'),wte=B('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Ste=B('<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),Dte=B('<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),Ate=B('<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></dl>'),kte=B('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Bte=B('<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>'),Fte=B('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Lte=B('<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>'),Ite=B('<div class="shell svelte-1n46o8q"><nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><circle cx="8" cy="10" r="2" class="svelte-1n46o8q"></circle><path d="M5,7 A4,4 0,0,1 11,7" class="svelte-1n46o8q"></path><path d="M3,5 A6.5,6.5 0,0,1 13,5" class="svelte-1n46o8q"></path><line x1="8" y1="12" x2="8" y2="15" class="svelte-1n46o8q"></line></svg> Broker</button> <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> <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> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),Pte=B('<div class="login-error svelte-1n46o8q"> </div>'),Tte=B('<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>'),Mte=B('<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>'),Rte=B('<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>'),Nte=B("<!> <!> <!> <!>",1);function Ote(o,e){Vs(e,!0);const t=["scripts","mqtt","matter","security","db","logs","config","packages"];function i(){const ut=location.hash.slice(1);return t.includes(ut)?ut:"scripts"}let n=I(Ei(i())),s=I(null),r=I(!1),a=I(!1),d=I(!1),u=I(!1),f=I("none"),g=I(""),p=I(!1),C=I(""),b=I(""),y=I(!1),w=I(!1);B$(()=>{m(p,!0)});async function A(){m(b,""),m(y,!0);try{await I$(c(C)),m(C,""),m(p,!1)}catch(ut){m(b,ut.message??"Login failed",!0)}finally{m(y,!1)}}async function P(){if(c(f)==="proxy"&&c(g)){window.location.href=c(g);return}await P$(),m(p,!0)}let M=I(null),R=I(!1),T=I(!1),V=I(!1),W=I(!1),Q=I(Ei([])),ne=I(0),de=I(Ei([]));const te=Tt(()=>c(de).filter(ut=>ut.online).length),he=Tt(()=>c(de).length===0?"none":c(te)===c(de).length?"all":c(te)>0?"some":"offline");let De=I(!1),oe=I(!1);async function ge(){if(!await c(M).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;m(R,!0);let ut;try{ut=(await Xf()).startedAt}catch{}try{await dF()}catch{}const at=Date.now()+6e4;for(;Date.now()<at;){await new Promise(Ze=>setTimeout(Ze,250));try{const Ze=await Xf();if(ut===void 0||Ze.startedAt!==ut){location.reload();return}}catch{}}location.reload()}async function Se(){m(d,!0);try{const ut=await H$();c(s)&&m(s,{...c(s),latestVersion:ut.latestVersion??void 0},!0)}catch{}finally{m(d,!1)}}async function Re(){var Ze,Pt;if(!await c(M).show(`Update to v${(Ze=c(s))==null?void 0:Ze.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;m(a,!1),m(u,!0);const ut=(Pt=c(s))==null?void 0:Pt.startedAt;try{await O$()}catch{}const at=Date.now()+18e4;for(;Date.now()<at;){await new Promise(ui=>setTimeout(ui,1e3));try{const ui=await Xf();if(ut===void 0||ui.startedAt!==ut){location.reload();return}}catch{m(u,!1),m(R,!0)}}location.reload()}function xe(ut){m(n,ut,!0),location.hash=ut}Ks(async()=>{location.hash||(location.hash=c(n));const ut=()=>{m(n,i(),!0)};window.addEventListener("hashchange",ut);try{const zt=await L$();m(f,zt.mode,!0),m(g,zt.proxyLogoutUrl??"",!0),c(f)==="password"&&(await fetch("/she/scripts")).status===401&&m(p,!0)}catch{}m(w,!0);async function at(){try{m(s,await Xf(),!0)}catch{}try{const[zt,Zt]=await Promise.all([fF(),Il()]);m(Q,Array.isArray(Zt.pinnedPackages)?Zt.pinnedPackages:[],!0),m(ne,Object.keys(zt).filter(mt=>!c(Q).includes(mt)).length,!0)}catch{}}at();const Ze=setInterval(at,5e3),Pt=ar("mqtt:status",zt=>{zt.connected===!1?(m(W,!0),m(T,!1),m(V,!1)):(m(W,!1),m(T,zt.ready===!1),m(V,zt.ready===!0))}),ui=ar("matter:deviceList",zt=>{Array.isArray(zt.devices)&&m(de,zt.devices.map(Zt=>({nodeId:String(Zt.nodeId),online:!!Zt.online})),!0)}),wt=ar("matter:deviceStatus",zt=>{if(zt.nodeId===void 0)return;const Zt=String(zt.nodeId),mt=!!zt.online;m(de,c(de).map(Mi=>Mi.nodeId===Zt?{...Mi,online:mt}:Mi),!0)}),Ft=yF();m(De,Ft.some(zt=>zt.level==="error"),!0),m(oe,!c(De)&&Ft.some(zt=>zt.level==="warn"),!0);const Vt=lS(zt=>{zt.level==="error"?(m(De,!0),m(oe,!1)):zt.level==="warn"&&!c(De)&&m(oe,!0)});return()=>{window.removeEventListener("hashchange",ut),clearInterval(Ze),Pt(),ui(),wt(),Vt()}});var et=Nte();fs("click",Jk,()=>{c(r)&&m(r,!1),c(a)&&m(a,!1)});var We=yt(et);{var _e=ut=>{var at=Ite(),Ze=_(at),Pt=v(_(Ze),2);let ui;var wt=v(Pt,2);let Ft;var Vt=v(_(wt),2);{var zt=Z=>{var J=dte();j(()=>ln(J,"title",`${c(ne)??""} package update${c(ne)===1?"":"s"} available`)),D(Z,J)};z(Vt,Z=>{c(ne)>0&&Z(zt)})}var Zt=v(wt,2);let mt;var Mi=v(_(Zt),2);{var Ri=Z=>{var J=ute();D(Z,J)},Di=Z=>{var J=hte();D(Z,J)},Ui=Z=>{var J=fte();D(Z,J)};z(Mi,Z=>{c(W)?Z(Ri):c(T)?Z(Di,1):c(V)&&Z(Ui,2)})}var ji=v(Zt,2);let Bi;var fn=v(ji,2);let an;var Zi=v(_(fn),2);{var _n=Z=>{var J=gte();D(Z,J)},gt=Z=>{var J=pte();D(Z,J)},Yt=Z=>{var J=xte();D(Z,J)};z(Zi,Z=>{c(he)==="all"?Z(_n):c(he)==="some"?Z(gt,1):c(he)==="offline"&&Z(Yt,2)})}var Ci=v(fn,2);let Wi;var Pi=v(Ci,2);let Ti;var Oi=v(_(Pi),2);{var Qi=Z=>{var J=mte();D(Z,J)},yi=Z=>{var J=vte();D(Z,J)};z(Oi,Z=>{c(De)?Z(Qi):c(oe)&&Z(yi,1)})}var Xe=v(Pi,4),St=v(_(Xe),2),Ai=_(St),ki=_(Ai);ki.nodeValue="v1.10.2 ";var fi=v(ki);{var Ii=Z=>{var J=_te();D(Z,J)};z(fi,Z=>{var J,ce;(J=c(s))!=null&&J.latestVersion&&!((ce=c(s))!=null&&ce.docker)&&Z(Ii)})}var X=v(Ai,2);{var Ae=Z=>{var J=yte(),ce=_(J),Qe=v(_(ce));Qe.textContent="v1.10.2";var ae=v(Qe,2);{var pe=Pe=>{var ke=bte(),bt=v(yt(ke)),vt=_(bt);j(()=>O(vt,`v${c(s).latestVersion??""}`)),D(Pe,ke)},Te=Pe=>{var ke=Cte();D(Pe,ke)};z(ae,Pe=>{var ke;(ke=c(s))!=null&&ke.latestVersion?Pe(pe):Pe(Te,-1)})}var me=v(ce,2),Ie=_(me);{var lt=Pe=>{var ke=Ete(),bt=v(_(ke));j(()=>O(bt,` Update to v${c(s).latestVersion??""}`)),$("click",ke,Re),D(Pe,ke)};z(Ie,Pe=>{var ke;(ke=c(s))!=null&&ke.latestVersion&&Pe(lt)})}var G=v(Ie,2),re=_(G);let Ne;var it=v(re);j(()=>{G.disabled=c(d),Ne=Bt(re,0,"svelte-1n46o8q",null,Ne,{spinning:c(d)}),O(it,` ${c(d)?"Checking…":"Check for updates"}`)}),$("click",J,Pe=>Pe.stopPropagation()),$("click",G,Se),D(Z,J)};z(X,Z=>{var J;c(a)&&!((J=c(s))!=null&&J.docker)&&Z(Ae)})}var qe=v(St,2),nt=_(qe),qt=v(nt,2);{var se=Z=>{var J=Fte(),ce=_(J);{var Qe=Ie=>{var lt=Ate(),G=_(lt);{var re=Lt=>{const Ht=Tt(()=>Math.floor((Date.now()-c(s).startedAt)/1e3)),pt=Tt(()=>Math.floor(c(Ht)/86400)),vi=Tt(()=>Math.floor(c(Ht)%86400/3600)),wi=Tt(()=>Math.floor(c(Ht)%3600/60));var qi=wte(),Fi=v(yt(qi)),Gi=_(Fi);j(()=>O(Gi,`${c(pt)>0?c(pt)+"d ":""}${c(vi)>0||c(pt)>0?c(vi)+"h ":""}${c(wi)??""}m`)),D(Lt,qi)};z(G,Lt=>{c(s).startedAt&&Lt(re)})}var Ne=v(G,3),it=_(Ne),Pe=v(Ne,3),ke=_(Pe),bt=v(Pe,3),vt=_(bt),Fe=v(bt,2);{var Dt=Lt=>{var Ht=Ste(),pt=v(yt(Ht)),vi=_(pt),wi=v(pt,3),qi=_(wi);j(()=>{O(vi,c(s).matterNodes??0),O(qi,c(s).matterEndpoints??0)}),D(Lt,Ht)};z(Fe,Lt=>{c(s).matterEnabled&&Lt(Dt)})}var Ge=v(Fe,2);{var ze=Lt=>{var Ht=Dte(),pt=v(yt(Ht)),vi=_(pt),wi=v(pt,3),qi=_(wi);j(()=>{O(vi,c(s).dbDocs??"—"),O(qi,c(s).dbViews??"—")}),D(Lt,Ht)};z(Ge,Lt=>{c(s).dbEnabled&&Lt(ze)})}var Je=v(Ge,3),Ct=_(Je),$e=v(Je,3),It=_($e),Me=v($e,3),st=_(Me);j(()=>{O(it,c(s).scripts),O(ke,c(s).topics),O(vt,c(s).mqttMsgPerSec??"—"),O(Ct,c(s).handlers??"—"),O(It,c(s).memMb!=null?c(s).memMb+" MB":"—"),O(st,c(s).cpuPercent!=null?c(s).cpuPercent+" %":"—")}),D(Ie,lt)},ae=Ie=>{var lt=kte();D(Ie,lt)};z(ce,Ie=>{c(s)?Ie(Qe):Ie(ae,-1)})}var pe=v(ce,2),Te=_(pe);{var me=Ie=>{var lt=Bte();$("click",lt,()=>{m(r,!1),ge()}),D(Ie,lt)};z(Te,Ie=>{var lt;(lt=c(s))!=null&&lt.docker||Ie(me)})}$("click",J,Ie=>Ie.stopPropagation()),D(Z,J)};z(qt,Z=>{c(r)&&Z(se)})}var Ee=v(qe,2);let Le;var Y=v(Ee,2);{var Oe=Z=>{var J=Lte();$("click",J,P),D(Z,J)};z(Y,Z=>{c(f)==="password"&&Z(Oe)})}var Ve=v(Ze,2),ye=_(Ve);us(qc(ye,{}),Z=>m(M,Z,!0),()=>c(M));var At=v(ye,2);let Ot;var ri=_(At);{let Z=Tt(()=>c(n)==="scripts");nZ(ri,{get active(){return c(Z)}})}var oi=v(At,2);let xi;var Ut=_(oi);KQ(Ut,{});var mi=v(oi,2);let He;var Ye=_(mi);BQ(Ye,{});var Qt=v(mi,2);let Gt;var gi=_(Qt);GY(gi,{});var Jt=v(Qt,2);let fe;var Ke=_(Jt);cte(Ke,{});var ot=v(Jt,2);let rt;var ht=_(ot);XX(ht,{});var _t=v(ot,2);let Xt;var F=_(_t);VZ(F,{});var H=v(_t,2);let K;var le=_(H);qZ(le,{}),j(()=>{ui=Bt(Pt,1,"svelte-1n46o8q",null,ui,{active:c(n)==="scripts"}),Ft=Bt(wt,1,"svelte-1n46o8q",null,Ft,{active:c(n)==="packages"}),mt=Bt(Zt,1,"svelte-1n46o8q",null,mt,{active:c(n)==="mqtt"}),Bi=Bt(ji,1,"svelte-1n46o8q",null,Bi,{active:c(n)==="security"}),an=Bt(fn,1,"svelte-1n46o8q",null,an,{active:c(n)==="matter"}),Wi=Bt(Ci,1,"svelte-1n46o8q",null,Wi,{active:c(n)==="db"}),Ti=Bt(Pi,1,"svelte-1n46o8q",null,Ti,{active:c(n)==="logs"}),Le=Bt(Ee,1,"nav-settings svelte-1n46o8q",null,Le,{active:c(n)==="config"}),Ot=Bt(At,1,"page-wrap svelte-1n46o8q",null,Ot,{hidden:c(n)!=="scripts"}),xi=Bt(oi,1,"page-wrap svelte-1n46o8q",null,xi,{hidden:c(n)!=="packages"}),He=Bt(mi,1,"page-wrap svelte-1n46o8q",null,He,{hidden:c(n)!=="mqtt"}),Gt=Bt(Qt,1,"page-wrap svelte-1n46o8q",null,Gt,{hidden:c(n)!=="matter"}),fe=Bt(Jt,1,"page-wrap svelte-1n46o8q",null,fe,{hidden:c(n)!=="security"}),rt=Bt(ot,1,"page-wrap svelte-1n46o8q",null,rt,{hidden:c(n)!=="db"}),Xt=Bt(_t,1,"page-wrap svelte-1n46o8q",null,Xt,{hidden:c(n)!=="config"}),K=Bt(H,1,"page-wrap svelte-1n46o8q",null,K,{hidden:c(n)!=="logs"})}),$("click",Pt,()=>xe("scripts")),$("click",wt,()=>xe("packages")),$("click",Zt,()=>xe("mqtt")),$("click",ji,()=>xe("security")),$("click",fn,()=>xe("matter")),$("click",Ci,()=>xe("db")),$("click",Pi,()=>{xe("logs"),m(De,!1),m(oe,!1)}),$("click",Ai,Z=>{Z.stopPropagation(),m(a,!c(a)),m(r,!1)}),$("click",nt,Z=>{Z.stopPropagation(),m(r,!c(r)),m(a,!1)}),$("click",Ee,()=>xe("config")),D(ut,at)};z(We,ut=>{c(w)&&!c(p)&&ut(_e)})}var dt=v(We,2);{var Wt=ut=>{var at=Tte(),Ze=_(at),Pt=v(_(Ze),4),ui=v(_(Pt),2),wt=v(Pt,2);{var Ft=Zt=>{var mt=Pte(),Mi=_(mt);j(()=>O(Mi,c(b))),D(Zt,mt)};z(wt,Zt=>{c(b)&&Zt(Ft)})}var Vt=v(wt,2),zt=_(Vt);j(()=>{ui.disabled=c(y),Vt.disabled=c(y)||!c(C),O(zt,c(y)?"Signing in…":"Sign in")}),fs("submit",Ze,Zt=>{Zt.preventDefault(),A()}),jt(ui,()=>c(C),Zt=>m(C,Zt)),D(ut,at)};z(dt,ut=>{c(p)&&ut(Wt)})}var tt=v(dt,2);{var kt=ut=>{var at=Mte();D(ut,at)};z(tt,ut=>{c(R)&&ut(kt)})}var be=v(tt,2);{var Rt=ut=>{var at=Rte();D(ut,at)};z(be,ut=>{c(u)&&ut(Rt)})}D(o,et),js()}Zs(["click"]);ZI(Ote,{target:document.getElementById("app")});export{I6 as t};