openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines (1 loc) • 48 kB
JavaScript
var M=class extends Error{constructor(t){let n=Error,r=n.stackTraceLimit;r!==void 0&&(n.stackTraceLimit=0),super(),r!==void 0&&(n.stackTraceLimit=r),this.source=t}},Se=class extends Error{constructor(t,n){try{var r=String(n instanceof Error?n.message:n)}catch{}super(r,{cause:n}),this.source=t}};function Et(e){return e instanceof Se?e.cause:e}var S={},St={};var Rt={},gr=Symbol("refresh"),xe=Set;function bn(e){let t=e.De;for(;t;)t.R|=32,bn(t),t=t.pe}function wn(e){e.l&=-33,Ye(e)}var Yt;function Tt(e){try{e()}catch(t){Yt||=[t],D()}}function zt(e){let t=Yt;if(Yt=void 0,t&&!e)throw t[0]}function Re(e,t=!1,n){let r=e.R;if(r&64)return;t&&!n&&e.T!==null&&(e.T.Ue!==null||e.T.me!==null)&&Re(e,!1,!0),t&&(e.R=r|64),t&&e.X&&(e.T!==null&&(e.T.Se=null),(e.m&1&&e.T?.Re!=null||r&2048||_e.length)&&D());let o=n?e.T.Ue:e.De;for(n?e.T.Ue=null:e.De=null;o;){let i=o;i.l&=-33,ge(i,x),At(i),o.Ze=o,Re(o,!0),o=o.pe}if(n||(e.ye=0),t&&!n&&!(r&32)&&e._parent!==null&&!(e._parent.R&64)){let i=e.Ze,s=e.pe;i!==null?i.pe=s:e._parent.De=s,s!==null&&(s.Ze=i),e.Ze=null}if(li(e,n),t&&e.Je){let i=e.Je;e.Je=void 0,Tt(i)}}function Kt(e,t){let n=e.De;t.Ze=null,t.pe=n,n!==null&&(n.Ze=t),e.De=t}function li(e,t){let n=t?e.T.me:e.He;if(n)if(t?e.T.me=null:e.He=null,Array.isArray(n))for(let r=n.length-1;r>=0;r--)Tt(n[r]);else Tt(n)}function ui(e,t){let n=e;for(;n.l&4&&n._parent;)n=n._parent;if(n.id!=null)return fi(n.id,t?n.ye++:n.ye);throw new Error("")}function Xt(e){return ui(e,!0)}function Qt(e,t,n){return e?.id??(t?n?.id:n?.id!=null?Xt(n):void 0)}function fi(e,t){let n=t.toString(36),r=n.length-1;return e+(r?String.fromCharCode(64+r):"")+n}function j(){return N}function Ct(e,t=N){return t&&(t.He?Array.isArray(t.He)?t.He.push(e):t.He=[t.He,e]:t.He=e),e}function Er(e=!0){Re(this,e),Yt&&!A.q&&zt()}function he(e){let t=N,n=e?.transparent??!1,r={id:Qt(e,n,t),l:n?4:0,R:0,Qe:!0,Ye:t?.Qe?t.Ye:t,De:null,pe:null,Ze:null,He:null,A:t?.A||Rt,ye:0,T:null,_parent:t,dispose:Er};return t&&Kt(t,r),r}function Zt(e,t){let n=he(t);return Y(n,()=>e(Er.bind(n,!0)))}var kn=null,K=null,_r=null,vn=null,ci=null,en=null,ai=null,di=null,hi=null;var Cr=null,$e=null,Ar=null,br=null,ln=null;function wr(e,t,n,r,o){Cr=e,$e=t,Ar=n,br=r,ln=o}var mi=null,pi=null;var yi=null,gi=null;var Xe=null;var Ir,Hn;var Fe=[];function Ei(e,t=null){let n={tn:[],un:[[],[]],En:[],cn:null,_parent:t,v:e,he:null,tt:0,nt:!1,en:null,ke:!1,ln:!1,I:null};return e||Fe.push(n),n}var L=null;function Qe(e){L=e}var P=null,Ce=null;function xn(e,t){if(A.q&&!t||P!==null)return fe(e);Ce===null?Ce=me(e):Or(me(e),Ce),D()}function U(e){return e.T.Re=me(e.T.Re)}function Si(e){return e=me(e),Fe.indexOf(e)!==-1?e:null}function me(e){for(;e.cn!==null;)e=e.cn;return e}function fe(e){let t=P;t===null?P=e===null?Ei(!1):me(e):e!==null&&Or(me(e),t),A.q||D()}function Or(e,t){e=me(e),t=me(t),!(e===t||e.v||t.v)&&(e.cn=t,t.tt+=e.tt,t.nt||=e.nt,ze(t.tn,e.tn),ze(t.un[0],e.un[0]),ze(t.un[1],e.un[1]),ze(t.En,e.En),e.I!==null&&ze(t.I??=[],e.I),Fe.splice(Fe.indexOf(e),1))}function Ri(e){let t=wt;wt??=e;let n=e.tt!==0||_i(e.tn,e)||!!hi?.(e);return wt=t,n}var wt=null;function Ti(e,t){let n=e.T?.fe;if(n===void 0)return!0;for(let r of n){let o=r.T?.Re;if(o==null||me(o)===t)return!0}return!1}function _i(e,t,n=!1){for(let r=0;r<e.length;r++){let o=e[r];if(!(!(o.m&1)||o.R&64||o.l&8192||o.T.Re!==null&&U(o)!==t||n&&!Ti(o,t))){if(o.i===1){if(Sr(o,wt??t))return!0;continue}for(let i=o.o;i!==null;i=i.t){let s=i.u;if((s.i===1&&s.m&1||s.R&2048||s.l&16384&&s.m===1)&&(i.Te===s.Ne||s.T?.F!=null)&&!(s.R&64)&&Sr(s,wt??t))return!0}}}return!1}function Sr(e,t){return!(e.R&32&&Ci(e,t))&&!Ar?.(e)}function Ci(e,t){let n=e;for(;n?.R&32;)n=n._parent;return n?.l&256&&n.T?.Re!=null&&U(n)===me(t)}var bt=[];function Nr(e){bt.push(e)}var Jt=[];function kr(e){ge(e,x),e.R&=-4,Jt.push(e)}function Ht(e,t){e.l|=256,Ai(e,t)}function Ai(e,t){let n=q(e);n.Re!==t&&(n.Re=t,t.tn.push(e))}function vr(e,t){for(let n=e.De;n!==null;n=n.pe)n.T?.Re?.v||(n.X!==void 0&&(n.l&256||Ht(n,t),n.l|=1048576),vr(n,t))}function Fn(e,t,n){for(let r=e.De;r!==null;r=r.pe)(r.l&2304)===256&&U(r)!==t&&n(r),Fn(r,t,n)}function Hr(e){e.T.Re=null,e.l&=-257}var x={$e:new Array(2e3).fill(void 0),p:!1,Ge:0,et:0},B=0,tn=!1,nn=!1,Rr=!1,In=0;var bi=0;var xr=0;var Fr=2147483647;function D(){if(nn){wi();return}tn||(tn=!0,!In&&!A.q&&queueMicrotask(be))}var ct=Symbol.for("solid-js/root-error-hook");function un(e){if(nn)return;nn=!0,zt(!0);let t="[REACTIVITY_HALTED]",n=e!==void 0&&globalThis.reportError;n||e===void 0?console.error(t):console.error(t,e),n&&n(e)}function wi(){Rr||(Rr=!0,console.error("[REACTIVITY_HALTED]"))}var ee=class e{un=[[],[]];q=!1;flush(){if(!this.q){this.q=!0,Lr(),L=null,Ce=null;try{$r(),On(x,e._e),this.settle(),B++,tn=x.et>=x.Ge||_e.length!==0,this.run(1),this.run(2)}finally{this.q=!1,Ce=null}}}settle(){ai?.()&&On(x,e._e);let t=P;P=null,ci?.(t);let n=t!==null&&!t.v?me(t):null;if(n!==null){let l=_e.length;for(let f=0;f<l;f++){let a=_e[f];if(!(a.l&2304)&&(a.T===null||a.T.Re===null||!a.T.Re.v)){if(a.ue===S&&a.m&4&&a.i!==1)continue;if(a.ue!==S&&!(a.m&5)&&a.T?.Ue==null&&a.T?.me==null&&dn(a,a.Ie,a.ue)){a.ue=S,a.l&=-129;continue}Ht(a,n)}a.l&128&&vr(a,n)}_e.length=0,mi?.(n);let u=Jt.splice(0);if(Xe){u.sort((f,a)=>f.Fe-a.Fe);for(let f=0;f<u.length;f++)(u[f].R&96)===32&&u[f].l&32768&&ie(u[f])}}else{ki();for(let l=0;l<bt.length;l++){let u=bt[l];u.T?.F==null&&!u.Ae&&ve(u)}}bt.length&&(bt.length=0);let r=this.un,o=this.un=[[],[]];en&&(en(n!==null?It:null),It.length&&(It.length=0)),this.un=[[],[]];for(let l=Fe.length-1;l>=0;l--){let u=Fe[l];Ri(u)||(Fe.splice(l,1),di?.(u),Oi(u),l=Fe.length)}pi?.();let i=n&&Si(n);gi?.(i);let s=i!==null;for(let l=0;l<2;l++)s&&ze(i.un[l],r[l]),this.un[l]=s||o[l].length||this.un[l].length?o[l].concat(s?[]:r[l],this.un[l]):r[l];if(Jt.length!==0){let l=Jt.splice(0).sort((u,f)=>u.Fe-f.Fe);for(let u=0;u<l.length;u++)l[u].R&64||ie(l[u])}br?.()}run(t){let n=this.un[t-1];n.length&&(this.un[t-1]=[],vi(n,t))}enqueue(t,n,r=L){t&&(r!==null?r:this).un[t-1].push(n),D()}notify(t,n,r,o){return Cr?.(t,r&n,o)?!0:n&1?(r&1&&L===null&&fe(null),!0):!1}};function Ii(e){let t;for(let n=0;n<e.En.length;n++){let r=e.En[n];if(!(r.R&64||r.m&2)&&(r.R&2048||r.l&32768)){t||=r.i,r.R&=-2049,r.Ae=!1;for(let o=r.De;o!==null;o=o.pe)o.i&&(o.Ae=!1);se(r)}}return e.En.length=0,t}function Oi(e){let t=Ii(e);e.I!==null&&yi(e.I);for(let n=0;n<e.tn.length;n++){let r=e.tn[n];r.T.Re===null||U(r)!==e||(r.T.Re=null,Pr(r))}P===e&&(P=null),t?A.un[1].push(()=>Tr(e)):Tr(e)}function Tr(e){for(let t=0;t<2;t++)ze(A.un[t],e.un[t]),e.un[t]=[]}function ze(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}var _e=[],It=[];function fn(e,t){e.R&2048||(e.R|=2048,t.En.push(e))}function xt(e){_e.push(e),A.q||Mr()}var cn=0;function an(){cn++}function Dn(e){e.Me=cn;let n=(e.l&512)!==0&&e.T?.Pe!==void 0;for(let r=e.o;r!==null;r=r.t){let o=r.u;if(o.R&4&&r.Te===o.Ne&&r!==o._&&(o.R|=4096),n&&o.l&8){o.R|=256;continue}se(o)}}function Dr(e,t){for(let n=e.o;n!==null;n=n.t){let r=n.u.T?.Re;(r?.v?Ni(r,t):n.u.i)&&(n.u.R|=65536)}}function Ni(e,t){return e===t||e.en!==null&&e.en===t.en}function Pr(e){let t=e;if(!t.X){e.l&=-385,e.ue!==S&&(e.Ie=e.ue,e.ue=S);return}let n=e.ue===S&&(t.m&1)!==0,r=e.l&2097152;if(!n&&t.T&&(t.T.de=void 0),e.l=n?e.l&-1048833|1024:e.l&-3147137,r){let o=e.ue;e.ue=S,e.ie=B+1,Me(t,2,o)}else e.ue!==S&&(e.Ie=e.ue,e.ue=S,t.m&=-5,t.T!=null&&(t.T.Ve=!1,t.T.je=S),e.i&&e.i!==3&&(e.Ae=!0,A.enqueue(e.i,e.W??=ee.K.bind(null,t))));t.ce=!1,t.R&=-1025,t.T?.F==null&&ve(t),t.m&1||(t.m&=-5),!n&&t.T!=null&&(t.T.Ue!==null||t.T.me!==null)&&ee.Ce(t,!1,!0)}function ki(){for(let e=0;e<_e.length;e++){let t=_e[e];t.l&2304||Pr(t)}_e.length=0}var A=new ee;function be(e){if(bi>0)return e?e():void 0;if(e){In++;try{return e()}finally{try{be()}finally{In--}}}if(!A.q&&!nn){for(;tn;)A.flush();zt()}}function vi(e,t){for(let n=0;n<e.length;n++)e[n](t)}function se(e){x.Ge>e.Fe&&(x.Ge=e.Fe),Pn(e,x)}function Gr(e,t){let n=(e._parent?.Qe?e._parent.Ye?.Fe:e._parent?.Fe)??-1;n>=e.Fe&&(e.Fe=n+1);let r=e.Fe,o=t.$e[r];if(o===void 0)t.$e[r]=e;else{let i=o.We;i.be=e,e.We=i,o.We=e}r>t.et&&(t.et=r)}function Pn(e,t){let n=e.R;n&12||(n&1?e.R=n&-4|2|8:(e.R=n|8,t.p&&Pt(e)),n&16||Gr(e,t))}function $n(e,t){let n=e.R;n&28||(e.R=n|16,Gr(e,t))}function ge(e,t){let n=e.R;if(!(n&24))return;e.R=n&-25;let r=e.Fe;if(e.We===e)t.$e[r]=void 0;else{let o=e.be,i=t.$e[r],s=o??i;e===i?t.$e[r]=o:e.We.be=o,s.We=e.We}e.We=e,e.be=void 0}function Vr(e){if(!e.p){e.p=!0;for(let t=0;t<=e.et;t++)for(let n=e.$e[t];n!==void 0;n=n.be)n.R&8&&Pt(n)}}function Pt(e,t=2){let n=e.R;if(!((n&3)>=t)){e.R=n&-4|t;for(let r=e.o;r!==null;r=r.t)Pt(r.u,1)}}function On(e,t){for(e.p=!1,e.Ge=0;e.Ge<=e.et;e.Ge++){let n=e.$e[e.Ge];for(;n!==void 0;)n.R&8?t(n):Hi(n,e),n=e.$e[e.Ge]}e.et=0}function Hi(e,t){ge(e,t);let n=e.Fe;for(let r=e.C;r;r=r.G){let o=r.S;o.X&&o.Fe>=n&&(n=o.Fe+1)}if(e.Fe!==n){e.Fe=n;for(let r=e.o;r!==null;r=r.t)$n(r.u,t)}}var xi;function qr(e){let t=e.S,n=e.G,r=e.t,o=e.Xe;if(r!==null?r.Xe=o:t.ve=o,o!==null)o.t=r;else if(t.o=r,r===null){t.l&4096?xi(t):t.T?.we&&Tt(t.T.we);let i=t;i.X&&i.l&32&&!(i.R&32)&&!(i.m&1)&&(Mt?Mt.push(i):Ye(i))}return n}function ve(e){let t=e._,n=t!==null?t.G:e.C;if(n!==null){do n=qr(n);while(n!==null);t!==null?t.G=null:e.C=null}}function At(e){let t=e.C;if(t){do t=qr(t);while(t!==null);e.C=null,e._=null}}var Mt=null,Mn=e=>Mt=e;function Ye(e){ge(e,x),At(e),Re(e,!0)}var $t=new xe;function $r(){if($t.size!==0){for(let e of $t)!e.o&&e.l&32&&!(e.m&1)&&!(e.R&96)&&Ye(e);$t.clear()}}function Ze(e,t){let n=t._;if(n!==null&&n.S===e)return;let r=null,o=t.R&4;if(o&&(r=n!==null?n.G:t.C,r!==null&&r.S===e)){r.Te=t.Ne,t._=r;return}let i=e.ve;if(i!==null&&i.u===t&&(!o||i.Te===t.Ne))return;let s=t._=e.ve={S:e,u:t,G:r,Xe:i,t:null,Te:t.Ne};n!==null?n.G=s:t.C=s,i!==null?i.t=s:e.o=s,an()}function Br(e,t){return e.T?.fe?.has(t)?!1:((q(e).fe??=new xe).add(t),!0)}function jr(e,t){let n=e.T?.fe;return n?.delete(t)?(n.size||(e.T.fe=void 0),!0):!1}function Gn(e){e.T!==null&&(e.T.fe=void 0)}function Fi(e,t){for(let n=e.C;n;n=n.G){let r=n.S;if(r===t||r.T?.fe?.has(t))return!0}return!1}function Vn(e,t){q(e).se=!0,t.source&&Br(e,t.source),e.m&2||Je(e,t.source,t)}function Je(e,t,n){if(!t){e.T!==null&&(e.T.F=null);return}if(n instanceof M&&n.source===t){q(e).F=n;return}let r=e.T?.F;(!(r instanceof M)||r.source!==t)&&(q(e).F=new M(t))}function et(e,t){for(let n=e.o;n!==null;n=n.t)t(n.u,n)}function hn(e){e.X&&e.l&32&&!e.o&&!(e.R&32)&&!(e.m&1)&&Ye(e)}function Di(e){let t,n=new xe,r=o=>{n.has(o)||(n.add(o),!o.o&&o.l&32&&(t??=[]).push(o),et(o,r))};if(et(e,r),t)for(let o of t)hn(o)}function Un(e,t,n){return!(e.l&256||n&&e.R&16384&&A.q&&!e.fam)||L?!1:(Gn(e),e.T&&(e.T.se=!1),(e.m&=6)&2||Je(e),e.ue=t instanceof Se?t:new Se(e,t),e.l|=2097280,Ve(e),D(),!0)}function Yr(e,t){let n=!1,r=new xe,o=i=>{r.has(i)||(r.add(i),i.T?.F===t&&(se(i),n=!0),et(i,o))};et(e,o),n&&D()}function Ve(e,t=e){jr(e,t);let n=!1,r,o=new xe,i=s=>{if(o.has(s)||t!==e&&Fi(s,t)||!jr(s,t))return s.l&32768&&se(s);o.add(s),s.ie=B;let l=s.T?.fe?.values().next().value,u=s.m&2;l?u||Je(s,l):(s.m&=-2,u||Je(s),s.l&256&&fe(U(s)),s.T?.se&&(se(s),n=!0),s.T!==null&&(s.T.se=!1),!s.o&&s.l&32&&(r??=[]).push(s)),et(s,i)};if(et(e,i),r)for(let s of r)hn(s);n&&D()}function Ln(e){return e!=null&&typeof e=="object"&&typeof e.then=="function"}function zr(e){let t=e.T?.ae;t!=null&&(e.T.ae=null,t())}function Kr(e,t,n,r){let o=!1,i=!1;if(typeof t=="object"&&t!==null&&le(()=>{o=t[Symbol.asyncIterator],i=!o&&Ln(t)}),!i&&!o)return e.T!==null&&(e.T.Se=null),e.ce=!1,t;q(e).Se=t,e.T.Ee=xr||Fr,e.T.fe=void 0;let s,l=h=>{if(e.T?.Se!==t)return;let m=h instanceof M;if(m&&e.ce){e.T!==null&&(e.T.Se=null),Vn(e,h),e.ie=B;return}(m||n||!Un(e,h))&&(Me(e,m?1:2,h),m||Re(e,!1,!0)),m&&Ve(e),e.ie=B,m||Di(e),r?.(h,m)},u=(h,m)=>{if(e.T?.Se!==t||e.R&2)return;let c=e.m&4;if(Wr(e),n){try{n(h)}catch(E){l(E);return}e.l&256||(e.T.de=void 0),c&&Wr(e,!0)}else ce(e,()=>h);e.ue===S&&(e.ce=!1,ve(e)),Ve(e),D(),be(),m?.()},f=()=>e.l&32&&!e.o&&!(e.m&1)?(Ye(e),!0):!1,a=(h,m)=>{let c=h[Symbol.asyncIterator](),E=!1,R=!1,I=!m,ne=()=>{if(!R){R=!0;try{let _=c.return?.();Ln(_)&&_.then(void 0,()=>{})}catch{}}};Ct(ne,m),q(e).ae=ne;let F=()=>{try{f()||Q()}catch(_){l(_)}},Q=()=>{let _,v,Z=!1,Be=!1,Ne=!0,re=c.next();if((Ln(re)?re:{then:de=>{de(re)}}).then(de=>{if(Ne&&I)_=de,Z=!0,de.done&&(R=!0);else{if(e.T?.Se!==t)return;de.done?(R=!0,E?(D(),be()):u(void 0),f()):(E=!0,u(de.value,F))}},de=>{Ne&&I?(v=de,Be=!0):e.T?.Se===t&&(R=!0,l(de),f())}),Ne=!1,Be){if(R=!0,l(v),I)throw v;return!0}return Z&&!_.done?(s=_.value,E=!0,Q()):Z&&_.done},C=Q();return I=!1,E||C},d=null,p=(h,m)=>{let c=!1;if(typeof h=="object"&&h!==null&&le(()=>{c=h[Symbol.asyncIterator]}),!c)return!1;s=void 0;let E=a(h,m);return m||(d=E),!0};if(i){let h=!1,m=!1,c,E=!0;if(t.then(R=>{if(E)s=R,h=!0;else{try{if(e.T?.Se===t&&!(e.R&64)&&p(R,e))return;u(R)}catch(I){l(I)}f()}},R=>{E?(c=R,m=!0):(l(R),f())}),E=!1,m)throw l(c),c;h?p(s)||(e.ce=!1):d=!1}if(o&&p(t),d!==null){if(!d){if(e.ce)return e.Ie;throw new M(N)}e.ce=!1}return s}function qn(e,t=!1){e.T?.fe&&Gn(e),e.T?.se&&(e.T.se=!1),e.m=t?0:e.m&4,e.T?.F&&Je(e);let n=jn(e);n&&n.call(e)}function Wr(e,t=!1){let n=e.T?.fe;n&&(n.delete(e),n.size)?(e.T.se=!1,t&&(e.m=1),Je(e,n.values().next().value)):qn(e,t)}function Me(e,t,n){t===2&&!(n instanceof Se)&&!(n instanceof M)&&(n=new Se(e,n));let r=t===1&&n instanceof M?n.source:void 0;if(t===1&&r?(e.m&2&&(e.T.de=e.T.F),Br(e,r),e.m=1|e.m&4,Je(e,r,n)):(Gn(e),e.m=t|(t!==2?e.m&4:0),q(e).F=n),t===1&&e.l&8192){L===null&&fe(null);return}let o=jn(e);if(o){o.call(e);return}Pi(e,t,n)}function Pi(e,t,n){let r=t===1&&n instanceof M?n.source:void 0;et(e,(o,i)=>{if(o.ie=B,o.l&49152||t===1&&i.Te!==o.Ne){se(o),D();return}if(t===1&&r&&o.T?.fe?.has(r)){L===null&&(o.l&2304)===256&&A.q&&!$e?.(o,r.ie===B)&&fe(U(o));return}(t===1&&r||t!==1&&(o.T?.F!==n||o.T?.fe))&&(K&&L!==null?K(o,L,!0,e):(xt(o),t===1&&(o.l&2304)===256&&!o.i&&fe(U(o))),Me(o,t,n))})}ee._e=e=>{e.i===3?(ge(e,x),e.Ae=!0,A.enqueue(2,e.M)):e.R&32&&!(e.R&65536)?kr(e):K&&e.R&32&&Gi(e)?(ge(e,x),e.R&=-65540):ie(e)};function Gi(e){let t=e._parent;for(;t.R&32;)t=t._parent;return(t.l&10240)===2048||t.i&&t.T?.Re?.v}ee.Ce=Re;var oe=!1,N=null,tt=!1,Wn,Qn=null;function io(e){for(;e;){if(e.Oe)return!0;e=e._parent}return!1}function ie(e,t=!1){an();let n=e.i,r,o=L,i=Wn,s=K&&(Wn=t&&(o||i));if(Qe(K?(e.R&65536||(e.l&10240)===2048)&&e.T?.Re?.v?e.T.Re:t&&o?._parent.he!=o&&Jr(N)?.R&4?o:null:null),!t){if(ge(e,x),e.T!==null&&(e.T.Se=null,zr(e)),e.m&1&&(e.l&=-32769),e.l&256){let C=U(e);C.v||e.l&524288||(n!==1&&!(e.l&32768)?xn(C,$e?.(e,e.m&4)):C!==P&&!(e.m&4||e.l&1048576)&&(e.ue=S,n===1&&(e.l&=-257)))}if(n===3||e.l&128){let C=Mt;Mn(r=[]),Re(e),Mn(C)}else(e.De!==null||e.He!==null)&&Vi(e);e.l&2097152&&(e.ue=S,e.l^=2097152)}let l=!!(e.m&4),u=e.m&2?e.T?.F:void 0,a=(e.m&1)!==0?e.T?.fe:void 0,d=e.T?.fe?.has(e),p=!1,h=(e.R&8192)!==0&&!(e.m&1&&e.T!==null&&!e.T.Ve),m=N;N=e,e._=null,e.Ne++,e.R=4|e.R&8224,e.ie=B;let c=e.ue!==S?e.ue:e.l&2048&&e.T.v!==S?e.T.v:e.Ie,E=e.Fe,R=!1,I=!1,ne=oe;oe=!0;try{if(e.l&64)c=e.X(c),e.T!==null&&(e.T.Se=null),e.ce=!1;else{let C=e.T?.Se,_=e.X(c),v=typeof _=="object"&&_!==null,Z=e.T?.Se!==C;c=Z||!v?_:Kr(e,_),!Z&&!v&&(e.T!==null&&(e.T.Se=null),e.ce=!1)}(e.m!==0||e.T!==null)&&qn(e,t)}catch(C){let _=C instanceof M;if(_&&e.ce)Vn(e,C);else if((_||!(p=Un(e,C,!0)))&&(_&&(q(e).se=!0),Me(e,_?1:2,C),_&&d&&!e.T?.Se&&Ve(e)),(_||p)&&a)for(let v of a)v!==e&&!e.T?.fe?.has(v)&&Ve(e,v)}finally{if(oe=ne,K&&(Wn=i),R=(e.R&4096)!==0,I=!!(e.R&(s&&(o||n||!(e.m&1))?16512:128)),e.l=e.l&-32769|e.R&32768,e.R=e.R&936032|(t?e.R&256:0),N=m,r)for(let C of r)hn(C);e.T!==null&&(e.T.Ve=h&&(e.m&1)!==0)}if(e.R&64){At(e),e.T!==null&&(e.T.Se=null),Qe(o);return}let F=K?L:null,Q=!!e.T?.F||p;if(K&&F!==null&&(K(e,F,t,Q)?Qe(F):F=null),!Q){let C=e.ue!==S?e.ue:e.l&2048&&e.T.v!==S?e.T.v:e.Ie,_=!n&&l||!!e.T?.de||!dn(e,C,c);if(n&&_&&!(e.R&262144&&!e.Ae&&Object.is(e.ge,c))&&e.ue===S&&(e.Ae=!e.T?.F,(!t||F!==null)&&A.enqueue(n,e.W??=ee.K.bind(null,e),F)),!(!t&&F===null&&e.l&8192&&_r(e,c,Q))){if(!Q){if(_)F!==null?n&&e.ue===S?e.Ie=c:n||F.ke?e.ue=c:e.T.v=c:(t?!((P!==null||Ce!==null)&&(I||Jr(m)?.R&128)):n&&e.ue===S)?e.Ie=c:(e.ue=c,t&&(Ht(e,P??Ce),e.m|=4,$e?.(e,!s&&P))),e.o!==null&&(Dn(e),F!==null&&Dr(e,F));else if(e.Fe!=E)for(let v=e.o;v!==null;v=v.t)$n(v.u,x)}}if(!_&&!e.T?.F&&(u!==void 0&&Yr(e,u),a))for(let v of a)v!==e&&Ve(e,v);d&&!(e.m&5)&&Ve(e)}if(t&&F===null&&I&&e.m&1){let C=P??Ce;C&&!C.v&&$e?.(e)!==2&&Ht(e,C)}!e.T?.F&&e.ue===S&&!(n&&e.Ae)&&(t||n===3?ve(e):Nr(e)),(e.ue!==S||e.T!==null&&(e.T.Ue!==null||e.T.me!==null)||(e.m&5)!==0&&(!t||(e.m&1)!==0))&&(e.l|=128,F===null&&xt(e)),Qe(o),R&&(se(e),D())}function Yn(e){if(!(e.R&68)){if(e.R&1)for(let t=e.C;t;t=t.G){let n=t.S;if(n.X&&Yn(n),e.R&2)break}(e.R&2||e.T?.F&&e.ie<B&&!e.T?.Se)&&ie(e),e.R=e.R&937336}}function ae(e,t){let n=t?.transparent??!1,r=t!==null&&typeof t=="object"&&"loadingValue"in t,o={id:Qt(t,n,N),l:(n?4:0)|(t?.ownedWrite?1:0)|(!N||t?.lazy?32:0)|(t?.sync?64:0)|(t?.le?2:0)|(t?.Le??0)|(tt&&io(N)?8:0),xe:t?.equals??Vt,He:null,A:N?.A??Rt,ye:0,X:e,Ie:r?t.loadingValue:void 0,Fe:0,be:void 0,We:null,C:null,_:null,Ne:0,o:null,ve:null,_parent:N,pe:null,Ze:null,De:null,R:t?.lazy?512:0,m:r?0:4,ie:B,ue:S,Me:-1,ce:r,T:null};return t?.unobserved&&(q(o).we=t.unobserved),co(o,t),o}function q(e){return e.T??={Se:null,ae:null,F:void 0,se:void 0,fe:void 0,we:void 0,Pe:void 0,Ue:null,me:null,Re:null,Ve:!1,je:S,Be:-1,Ee:0,v:S,I:0,de:void 0}}function Qr(e,t){e.R|=128,(t.m&4||e.i!==1)&&xn(U(t),!e.i&&e.m&4||$e?.(e))}function Zr(e,t){let n=Xe&&e.l&32768,r=K&&L!==null;if((!r||e.m&4&&t.m&1)&&!n&&(e.i!==1||t.l&1024))return!1;let o=U(t);return o===P&&!r&&!n||so(e,o)?!1:(fn(e,o),!0)}function so(e,t){return(e.m&4||e.l&1048576)&&e.l&256&&U(e)===t}function Jr(e){return e!==null&&e.Qe?e.Ye:e}function Vi(e){bn(e);let t=q(e);t.me=e.He,t.Ue=e.De,e.He=null,e.De=null,e.ye=0}function lo(e,t,n,r,o){let i=o?.transparent??!1,s={id:Qt(o,i,N),l:(i?4:0)|(o?.ownedWrite?1:0)|(o?.sync?64:0)|(o?.Le??0)|(tt&&io(N)?8:0),xe:!1,He:null,A:N?.A??Rt,ye:0,X:e,Ie:void 0,Fe:0,be:void 0,We:null,C:null,_:null,Ne:0,o:null,ve:null,_parent:N,pe:null,Ze:null,De:null,R:512,m:4,ie:B,ue:S,Me:-1,ce:!1,Ae:!1,ge:void 0,Ke:t,qe:n,Je:void 0,i:r,T:null};return o?.unobserved&&(q(s).we=o.unobserved),co(s,Ui),s}var uo=null;function fo(e){uo=e}function jn(e){return e.i?uo:null}var Ui={lazy:!0};function co(e,t){e.We=e;let n=N?.Qe?N.Ye:N;N&&Kt(N,e),n&&(e.Fe=n.Fe+1),Ir?.(e),!t?.lazy&&ie(e,!0),tt&&!t?.lazy&&!(e.m&1)&&!(e.l&2)&&(q(e).Pe=e.Ie===void 0?St:e.Ie,e.l|=512,Qn.add(e))}function He(e,t){let n={xe:t?.equals??Vt,l:(t?.ownedWrite?1:0)|(t?.le?2:0),Ie:e,o:null,ve:null,ie:B,ue:S,Me:-1,T:null};return t?.unobserved&&(q(n).we=t.unobserved),tt&&!(n.l&2)&&(q(n).Pe=e===void 0?St:e,n.l|=512,Qn.add(n)),n}function Vt(e,t){return e===t}var eo=null;function le(e,t){let n=oe;oe=!1;try{return Hn?Hn(e):e()}finally{oe=n}}var ao=!1;function qi(e,t){if(e.R&512)e.R&=-513,ie(e,!0);else if(e.R&64&&e.l&32){let n=e._parent;if(n!==null){if(n.R&64){e.l&=-33;return}e.R&32||Kt(n,e)}ie(e,!0)}}function ji(e,t){return!t||e.ue===S||t.l&16}var Ut=!1;function Mr(){Ut=!0}function Wi(e){return A.q||e.ue===S||e.l&4194304?S:e.l&256?e.T.Be===B?e.T.je:S:e.Ie}function Bi(e){let t=e.T;t.Be!==B&&(t.je=e.ue,t.Be=B,Ut=!0)}var mn=[];function Yi(e){return e.R|=4096,!0}function Lr(){if(Ut=!1,mn.length!==0){for(let e of mn)e.l&=-4194305;mn.length=0}}function zi(e,t){e.Fe>=x.Ge?(Pt(t),Vr(x),Yn(e)):t.l&65536&&Yn(e);let n=e.Fe;n>=t.Fe&&e._parent!==t&&(t.Fe=n+1)}function nt(e){let t=N;t?.Qe&&(t=t.Ye);let n=e,r=e;if(typeof n.X=="function"&&qi(e),eo!==null)return eo(e,t);if(!n.X&&e.T?.Pe===void 0&&!tt&&(!Ut||e.ue===S)&&!(e.l&2048)){if(t&&(oe&&Ze(e,t),e.l&256&&!(t.l&16))){if(Zr(t,e))return e.Ie;Qr(t,e)}return!t||e.ue===S||t.l&16||(Xe&&t.l&32768||K&&L?.folded)&&mo(t)?e.Ie:(ho(t),e.ue)}let o=!1;if(t&&(oe&&(Ze(e,t),r.X&&(zi(r,t),t.i||(t.R|=r.l&32768))),e.l&256&&!(e.l&2048)&&!(t.l&16)&&(r.m&4||!Zr(t,e)?Qr(t,e):o=!0)),kn&&e.l&2048){let s=kn(t,e);if(s!==S)return s}if(r.m&1&&!o&&!(e.l&2048)&&!(r.m&4)&&(K&&L!==null&&!(t?.m&4)?o=!0:Xe&&t!==null&&t.l&32768&&(o=Xe(t,r))),r.m&1&&!o){if(t){if(!(t.l&16)||r.m&4)throw!oe&&!ao&&e!==t&&Ze(e,t),r.T?.F}else if(r.m&4)throw r.T?.F}if(r.X&&r.m&2){if(oe&&r.ie<B)return ie(r),nt(e);throw r.T?.F}if(tt&&t&&t.l&8){let s=e.T?.Pe;if(s!==void 0){let l=s===St?void 0:s;return(e.ue!==S?e.ue:e.Ie)!==l&&(t.R|=256),l}}if(o)return e.Ie;if(!t&&e.T?.de)throw e.T.de;let i=Ki(e,t);return!t&&typeof n.X=="function"&&e.l&32&&!(r.m&1)&&!e.o&&($t.add(e),D()),i}function Ki(e,t){if(e.ue!==S&&e.m&4&&(!t||ao||t.l&16))throw new M(null);let n=t&&Ut?Wi(e):S;if(n!==S)return Yi(t),n;if(ji(e,t)||Xe&&t.l&32768&&!(e.m&4)&&mo(t))return e.Ie;if(ho(t,e),e.l&2097152)throw e.ue;return e.ue}function ho(e,t){t?.m&4||(e.R|=16384,en&&L!==null&&It.push(e))}function mo(e){return P===null||so(e,P)?!1:(fn(e,P),!0)}function Xi(e){A.q||e.l&4194304||(e.l|=4194304,mn.push(e))}function Qi(e,t){e.l&2||e.X!==void 0||e.T?.Pe!==void 0||(q(e).Pe=t===void 0?St:t,e.l|=512,Qn.add(e))}var to=null;function dn(e,t,n){if(e.xe===Vt)return t===n;try{return e.xe&&e.xe(t,n)}catch(r){if(!(r instanceof M))return Me(e,2,r),!0}}function ce(e,t){to!==null&&to(e);let n=e.ue===S?e.Ie:e.ue;if(typeof t=="function"&&(t=t(n)),vn&&e.l&2048)return vn(e,t);if(e.l&256&&fe(U(e)),!(!!(e.m&4)||!!e.T?.de||!dn(e,n,t)))return t;tt&&Qi(e,n);let o=e.ue!==S;return o?e.l&256&&!A.q&&Bi(e):xt(e),e.ue=t,N!==null&&Xi(e),e.X!==void 0&&(e.ie=B),o&&e.Me===cn||(Dn(e),D()),t}function po(e,t){let n=e.l&256&&!(e.R&1024)&&U(e)!==P;if(n&&typeof t=="function"){let r=t(e.Ie);t=()=>r}return e.m&2&&(e.T.de=e.T.F,Me(e,0,void 0)),t=ce(e,t),e.l&=-2097153,n?(e.R=e.R&-2|2,Pn(e,x),D()):e.ue!==S&&(e.R|=1024),t}function Y(e,t){let n=N,r=oe;N=e,oe=!1;try{return t()}finally{N=n,oe=r}}function yo(e,t=!0){return e()}var Zn=null;function go(e,t,n,r){let o=!!r?.user,i=lo(e,t,n,o?2:1,r);ie(i,!0),!r?.defer&&i.ue===S&&!i.T?.Re?.v&&(i.i===2||r?.schedule?A.enqueue(i.i,gn.bind(null,i)):gn(i,i.i))}function Zi(){let e=this.m,t=this.T?.F;if(e&2){if(A.notify(this,1,0),this.i===2){this.m&2&&(this.Ae=!0,A.enqueue(this.i,this.W??=gn.bind(null,this)));return}Jn(this,Et(t),t,this)}else this.i===1&&A.notify(this,3,e,t)}function Jn(e,t,n=t,r=e){if(!A.notify(e,2,2))throw un(t),n}function gn(e,t){if(!e.Ae||e.R&64||ln?.(e))return;if(e.m&2&&e.i===2){let o=Et(e.T?.F);e.ge=e.Ie,e.Ae=!1;try{e.qe?e.qe(o,()=>{let i=e.Je;e.Je=void 0,i?.()}):console.error(o)}catch(i){Jn(e,i)}return}let n=e.T?.F==null,r=e.Je;e.Je=void 0;try{r?.();let o=e.Ke(e.Ie,e.ge);e.Je=o}catch(o){q(e).F=new Se(e,o),e.m|=2,Jn(e,o)}finally{e.ge=e.Ie,e.Ae=!1,n&&ve(e)}}ee.K=gn;function Eo(e,t){let n=()=>{!r.Ae||r.R&64||ln?.(r)||(r.Ae=!1,ie(r))},r=ae(()=>{let o=r.Je;r.Je=void 0,o?.();let i=yo(e);r.Je=i},{...t,lazy:!0});r.Je=void 0,r.l=r.l&-33|16,r.Ae=!0,r.i=3,r.M=n,se(r),D()}fo(Zi);var Ji,So=new WeakSet;function es(e){for(let t=e;t;t=t._parent){let n=t[ct];if(n!==void 0)return n}return Ji}function Ro(e){let t=[];for(let n=e;n;n=n._parent){let r=n._name;typeof r=="string"&&r.length&&t.push(r)}return t.length?t.reverse():void 0}function To(e,t,n){if(e!==null&&(typeof e=="object"||typeof e=="function")){if(So.has(e))return;So.add(e)}let o=es(t);if(o===void 0)return;let i={},s=Ro(t),l=Ro(n)??s;l!==void 0&&(i.ownerPath=l),s!==void 0&&(i.boundaryPath=s);try{o(e,i)}catch(u){console.error(u)}}var er=Symbol(0);var Su=Object.prototype;function ye(e){let t=nt.bind(null,e);return t[gr]=e,t}function tr(e,t){if(typeof e=="function"){let r=ae(e,t);return r.l&=-33,[ye(r),po.bind(null,r)]}let n=He(e,t);return Zn!==null&&Zn(n),[ye(n),ce.bind(null,n)]}function dt(e,t){return ye(ae(e,t))}function nr(e,t,n){go(e,t,void 0,n)}function En(e){let t=j();t&&!(t.l&16)?Eo(()=>le(e),void 0):A.enqueue(2,function n(){if(x.et>=x.Ge)return A.enqueue(2,n);e()})}function Rn(e,t,n){let r=typeof n?.keyed=="function"?n.keyed:void 0,o=t.length>1,i=t,s={L:he(),it:0,st:e,ot:[],ft:i,ht:[],tn:[],ze:r,ct:r||n?.keyed===!1?[]:void 0,lt:o&&n?.keyed!==!1?[]:void 0,ut:n?.keyed===!1,H:n?.fallback},l=ae(is.bind(s),void 0);return l.l&=-33,ye(l)}var Sn={ownedWrite:!0};function ts(e,t,n,r){let o=e.ot,i=e.it-1,s=[],l=[],u=[],f=256,a=r,d=r,p=!1;for(;a<=i&&d<=n-1;){let h=o[a],m=t[d];if(h===m){p||(u.push(a,d,0),p=!0),u[u.length-1]++,a++,d++;continue}p=!1;let c=-1,E=Math.min(32-s.length,i-a,f);for(let I=1;I<=E;I++)if(o[a+I]===m){c=I;break}f-=c===-1?E:c;let R=-1;E=Math.min(32-l.length,n-1-d,f);for(let I=1;I<=E;I++)if(t[d+I]===h){R=I;break}if(f-=R===-1?E:R,c!==-1&&(R===-1||c<=R)){for(;c-- >0;)s.push(a++);continue}if(R!==-1){for(;R-- >0;)l.push(d++);continue}if(f<=0||s.length===32||l.length===32)return!1;s.push(a++),l.push(d++)}for(;a<=i;a++){if(s.length===32)return!1;s.push(a)}for(;d<=n-1;d++){if(l.length===32)return!1;l.push(d)}return ns(e,t,n,s,l,u)}function ns(e,t,n,r,o,i){let s=e.ot,l,u,f;if(o.length!==0)for(f=new Array(r.length),u=0;u<o.length;u++){let m=-1;for(l=0;l<r.length;l++)if(!f[l]&&s[r[l]]===t[o[u]]){m=l;break}if(m===-1)return!1;f[m]=!0,o[u]=o[u]<<6|m}if(r.length!==0||o.length!==0){let m=new Set;for(l=0;l<r.length;l++)m.add(s[r[l]]);for(u=0;u<o.length;u++)m.add(t[o[u]>>6]);for(let c=0;c<i.length;c+=3){let E=i[c];for(let R=0,I=i[c+2];R<I;R++)if(m.has(s[E+R]))return!1}}let a=e.ht,d=e.tn,p=a.slice(0,n),h=d.slice(0,n);for(let m=0;m<i.length;m+=3){let c=i[m],E=i[m+1];if(c!==E)for(let R=0;R<i[m+2];R++)p[E+R]=a[c+R],h[E+R]=d[c+R]}for(u=0;u<o.length;u++){let m=o[u]>>6,c=r[o[u]&63];p[m]=a[c],h[m]=d[c]}for(e.ht=p,e.tn=h,e.it=n,e.ot=t.slice(0),l=0;l<r.length;l++)(f===void 0||!f[l])&&d[r[l]].dispose();return!0}function rs(e,t,n,r,o,i,s,l,u){let f=e.ze,a=e.ot,d=e.tn,p=[],h=n;for(let m=n;m<=o;h++,m++){let c=f?f(t[m]):t[m];for(;h<=r&&(f?f(a[h]):a[h])!==c;)p.push(d[h++]);if(h>r)return s.fill(void 0),null;i[m]=e.ht[h],s[m-n]=d[h],l&&(l[m-n]=e.ct[h]),u&&(u[m-n]=e.lt[h])}for(;h<=r;h++)p.push(d[h]);return p}function os(e,t,n,r,o,i,s,l,u){let f=e.tn,a=e.ct,d=e.lt,p=e.it,h=n-p,m,c;if(h>0)for(f.length=n,a&&(a.length=n),d&&(d.length=n),m=p-1,c=n-1;m>o;m--,c--)f[c]=f[m],a&&(a[c]=a[m]),d&&(d[c]=d[m]);else if(h<0){for(m=o+1,c=i+1;m<p;m++,c++)f[c]=f[m],a&&(a[c]=a[m]),d&&(d[c]=d[m]);f.length=n,a&&(a.length=n),d&&(d.length=n)}for(c=r;c<=i;c++)f[c]=s[c-r],a&&ce(a[c]=l[c-r],t[c]),d&&ce(d[c]=u[c-r],c);for(c=i+1;c<n;c++)a&&ce(a[c],t[c]),d&&h!==0&&ce(d[c],c)}function is(){this.L.Ye=j();let e=this.st()||[],t=e.length;return e[er],Y(this.L,()=>{let n,r,o,i,s,l=this.ct?this.ut?()=>(i[o]=He(e[r],Sn),this.ft(ye(i[o]),r)):()=>(i[o]=He(e[r],Sn),s&&(s[o]=He(r,Sn)),this.ft(ye(i[o]),s?ye(s[o]):void 0)):this.lt?()=>{let u=e[r];return s[o]=He(r,Sn),this.ft(u,ye(s[o]))}:()=>{let u=e[r];return this.ft(u)};if(t===0)this.it!==0&&(this.L.dispose(!1),this.tn=[],this.ot=[],this.ht=[],this.it=0,this.ct&&(this.ct=[]),this.lt&&(this.lt=[])),this.H&&!this.ht.length&&(this.tn[0]?.dispose(),this.ht[0]=Y(this.tn[0]=he(),this.H));else if(this.it===0){let u=new Array(t),f=new Array(t);i=this.ct&&new Array(t),s=this.lt&&new Array(t);try{for(r=0;r<t;r++)o=r,u[r]=Y(f[r]=he(),l)}catch(a){for(n=0;n<=r;n++)f[n]?.dispose();throw a}this.tn[0]&&this.tn[0].dispose(),this.ht=u,this.tn=f,i&&(this.ct=i),s&&(this.lt=s),this.ot=e.slice(0),this.it=t}else{let u,f,a,d,p,h,m,c,E,R,I,ne=ce;for(u=0,f=Math.min(this.it,t);u<f&&(this.ot[u]===e[u]||this.ct&&_o(this.ze,this.ot[u],e[u]));u++)this.ct&&ne(this.ct[u],e[u]);for(f=this.it-1,a=t-1;f>=u&&a>=u&&(this.ot[f]===e[a]||this.ct&&_o(this.ze,this.ot[f],e[a]));f--,a--);if(u===t&&this.it===t){this.ot=e.slice(0);return}if(t<=this.it&&f-u>64&&this.ct===void 0&&this.lt===void 0){let Z=u+(a-u>>1),Be=e[Z],Ne=Math.min(f,Z+32),re=Math.max(u,Z-32);for(;re<=Ne&&this.ot[re]!==Be;)re++;if(re<=Ne&&ts(this,e,t,u))return}let F=t-this.it,Q=a-u+1,C=new Array(t),_=new Array(Q);i=this.ct?new Array(Q):void 0,s=this.lt?new Array(Q):void 0;let v=F<0?rs(this,e,u,f,a,C,_,i,s):null;if(v!==null)v.length!==0&&(c=v);else{for(h=new Map,m=new Array(Q),r=a;r>=u;r--)d=e[r],p=this.ze?this.ze(d):d,n=h.get(p),m[r-u]=n===void 0?-1:n,h.set(p,r);for(n=u;n<=f;n++)d=this.ot[n],p=this.ze?this.ze(d):d,r=h.get(p),r!==void 0&&r!==-1?(C[r]=this.ht[n],_[r-u]=this.tn[n],i&&(i[r-u]=this.ct[n]),s&&(s[r-u]=this.lt[n]),r=m[r-u],h.set(p,r)):(c??=[]).push(this.tn[n]);try{for(r=u;r<=a;r++)_[r-u]===void 0&&((E??=[]).push(_[r-u]=he()),o=r-u,C[r]=Y(_[r-u],l))}catch(Z){if(E)for(n=0;n<E.length;n++)E[n].dispose();throw Z}}for(n=0;n<u;n++)C[n]=this.ht[n];for(r=a+1;r<t;r++)C[r]=this.ht[r-F];if(os(this,e,t,u,f,a,_,i,s),this.ht=C,this.it=t,this.ot=e.slice(0),c)for(n=0;n<c.length;n++)c[n].dispose()}}),this.ht}function _o(e,t,n){return e?e(t)===e(n):!0}function Ue(e,t){if(typeof e=="function"&&!e.length){if(t?.doNotUnwrap)return e;do e=e();while(typeof e=="function"&&!e.length)}if(!(t?.skipNonRendered&&(e==null||e===!0||e===!1||e===""))){if(Array.isArray(e)){let n=[];return rr(e,n,t)?()=>{let r=[];return rr(n,r,{...t,doNotUnwrap:!1}),r}:n}return e}}function rr(e,t=[],n){let r=null,o=!1;for(let i=0;i<e.length;i++)try{let s=e[i];if(typeof s=="function"&&!s.length){if(n?.doNotUnwrap){t.push(s),o=!0;continue}do s=s();while(typeof s=="function"&&!s.length)}Array.isArray(s)?o=rr(s,t,n)||o:n?.skipNonRendered&&(s==null||s===!0||s===!1||s==="")||t.push(s)}catch(s){if(!(s instanceof M))throw s;r=s}if(r)throw r;return o}var bo=Symbol(""),Co=Symbol(""),qe=null;var rt=new Set,qt=e=>e.A[bo],mt=e=>e.i===2||!e.D||e.h;function jt(e,t){e.U.add(t),rt.add(e)}function or(e,t,n){if(e.i===2){n??=t.T?.F,t=n?.source??t;let r=Et(n);ce(e.F,r),To(r,e.L,t)}jt(e,t),e.h&&ir(e),e.H||Wt(e),e.V!==null&&qe.P(e.V)}function ir(e){e.D=!1,e.v=e.B;let t=e.j;!e.v&&t.l&256&&U(t)!==P&&Hr(t),e.v!==null&&e.j!==null&&K(e.j,e.v,!0,!1)}function Wt(e){e.j!==null&&!(e.j.R&96)&&(se(e.j),D())}function Ao(e,t,n){if(t===0){if(rt.size!==0)for(let r=qt(e);r;r=r._parent)!(e.m&Io(r))&&r.U.delete(e)&&r.U.size===0&&(r.H&&Wt(r),r.V!==null&&qe.P(r.V));return!1}for(let r=qt(e);r;r=r._parent)if(r.i&t){if(mt(r))return or(r,e,n),r.h?2:!0;jt(r,e)}return!1}function ss(e){for(let t=qt(e);t;t=t._parent)if(t.i&1&&mt(t))return t.h}function wo(e){for(let t=qt(e);t;t=t._parent)if(t.H)return t}function ls(e){let t=wo(e);return t===void 0?!1:((t.Z??=new Set).add(e),!0)}function us(e){if(e.Z!==null){for(let t of e.Z){let n=t.i;A.enqueue(n===3?2:n,n===3?t.M:t.W??=ee.K.bind(null,t))}e.Z=null}}var Io=e=>e.i===2?3:1;function Oo(e,t){let n=Io(e);for(let r of e.U)if(r.R&64)e.U.delete(r);else if(!(r.m&n)){if((r!==e.Y||e.h)&&(r.l&2304)===256){if(!t||!e.D)continue;fe(U(r))}e.U.delete(r)}return e.U.size}function fs(){for(let e of rt){let t=e.j.R;if(t&64){rt.delete(e);continue}if(t&32)continue;Oo(e,!1);let n=e.j;e.h&&!e.D&&n.l&256&&[...e.U].every(r=>!(r.m&1)&&r.l&256&&U(r)===U(n))&&(e.U.clear(),e.D=!0),e.h=!1,e.U.size===0&&(rt.delete(e),e.H&&Wt(e),e.V!==null&&qe.P(e.V))}}function cs(e){if(!e.D){e.H&&e.v===null&&e.B===null&&L!==null&&(e.B=L,ir(e),Wt(e));return}e.h=!0;let t=L;t===null&&A.q&&j().l&32768&&(fe(null),t=ee.J(P)),e.B=t,rt.add(e);let n=e.U.size;Fn(e.L,P,r=>jt(e,r));for(let r of e.U)if(e.U.size!==n||r.m&1&&!(r.R&64)){for(let o=e._parent;o!==null;o=o._parent)for(let i of e.U)o.U.delete(i);ir(e),Wt(e);return}}function as(e){for(let t of[...e.U])t.X!==void 0&&!(t.R&64)&&ie(t);D()}function No(e,t,n,r){let o=he(),i={i:e,_parent:qt(o)??null,L:o,Y:null,j:null,U:new Set,D:!1,h:!1,B:null,v:null,H:!1,Z:null,V:null,$:!1,ee:!1,F:e===2?He(void 0,ds):null,ne:n,re:null},s=e===1?o.A[Co]:null;if(j()&&Ct(()=>{rt.delete(i),s&&qe.te(s,i)}),r){let a=!1;Y(o,()=>ae(()=>{try{r()}catch(d){if(!(d instanceof M)){if(!A.notify(j(),2,2,d))throw un(d),d;return}}a?cs(i):a=!0})).l|=16384}let l={...o.A,[bo]:i};qe!==null&&(l[Co]=null),o.A=l;let u=Y(o,()=>{let a=ae(t);return ae(()=>Ue(nt(a)))});i.Y=u,s&&qe.oe(s,i);let f=ae(()=>{if(i.$&&(Ze(u,j()),i.V!==null&&qe.P(i.V),i.$)){if(i.ee){i.H=!0;return}return ht(i)}let a=u.m&3;if(a!==0){if(Ze(u,j()),a&e){if(mt(i))return or(i,u,void 0),ht(i);jt(i,u)}throw u.T.F}if(mt(i)){let h=j();if(i.U.size!==0&&h.m&4&&!(h.l&256)||Oo(i,!0)!==0)return ht(i)}let d;try{d=nt(u)}catch(h){if(h instanceof M?e===1:e===2){if(mt(i))return or(i,u,h),ht(i);jt(i,u)}throw h}if(mt(i)&&i.U.size!==0)return ht(i);i.D=!0,i.H=!1;let p=i.re;if(p!==null&&A.enqueue(1,()=>{!i.H&&i.re===p&&(wn(p),i.re=null)}),us(i),i.V!==null){let h=i.V;i.V=null,qe.P(h)}return d},{le:!0});return f.l|=16384,i.j=f,ye(f)}function ht(e){if(e.v!==null&&(Qe(e.v),e.j.R|=131072,e.v=null),e.H=!0,e.re===null){let t=j();e.re=Y(t._parent,()=>ae(()=>e.ne(e),{id:t.id}))}return nt(e.re)}var ds={ownedWrite:!0,le:!0};function sr(e,t,n){return No(1,e,()=>t(),n?.on)}function lr(e,t){return No(2,e,n=>t(ye(n.F),()=>as(n)))}wr(Ao,(e,t)=>!t&&(e.m&4?Ao(e,1):ss(e)),wo,fs,ls);var Fo=!1;var ur={hydrating:!1,registry:void 0,done:!1};var Ds,Ps,$s,Ms,Ls;var Gs;var Bt=(...e)=>(Ps||dt)(...e),ot=(...e)=>($s||tr)(...e),Do=(...e)=>(Ms||lr)(...e);var Po=(...e)=>(Ds||Zt)(...e),$o=(...e)=>(Ls||nr)(...e);var Mo=(e,t,n)=>(Gs||sr)(e,t,n);function X(e,t,n,r){return le(()=>e(t||{}))}var Vs=e=>`Stale read from <${e}>.`;function fr(e){let t="fallback"in e?{keyed:e.keyed,fallback:()=>e.fallback}:{keyed:e.keyed},n=j(),r,o=()=>Y(n,()=>Rn(()=>e.each,e.children,t));return ur.hydrating&&(r=o()),()=>(r??(r=o()))()}function je(e){let t=e.keyed,n=dt(()=>e.when,void 0),r=t?n:dt(n,{equals:(i,s)=>!i==!s,sync:!0}),o=!1;return dt(()=>{let i=r();if(o=i,i){let s=e.children;return typeof s=="function"&&s.length>0?t?le(()=>s(i),Fo):le(()=>s(()=>{if(!o)throw Vs("Show");return n()}),Fo):s}return e.fallback},{sync:!0})}function cr(e){return Do(()=>e.children,(t,n)=>{let r=e.fallback;return typeof r=="function"?r(t,n):r})}function ar(e){let t="on"in e?{on:()=>e.on}:void 0;return Mo(()=>e.children,()=>e.fallback,t)}var pt=ur;var Ie=Symbol("slot"),Lo=Symbol("host");var qs={transparent:!0,sync:!0},js={sync:!0};function We(e,t,n){let r=n?{sync:!0,...n,transparent:!n.scope}:qs;$o(e,t,r)}function pr(e){return Bt(()=>e(),js)}function Ws(e,t,n,r){let o=c=>{if(!c)return!1;let E=c[Ie];return c.parentNode===e&&(!E||E===r)},i=n.length,s=t.length,l=i,u=0,f=0,a=t[s-1],d=o(a)?a.nextSibling:r||null,p=null,h,m;for(;u<s||f<l;){if(t[u]===n[f]){u++,f++;continue}for(;s>u&&l>f&&t[s-1]===n[l-1];)s--,l--;if(s===u){let c;if(l<i)if(f&&o(c=n[f-1]))c=c.nextSibling;else{let E=l;for(;E<i&&!o(n[E]);)E++;c=E<i?n[E]:d}else c=d;for(;f<l;){let E=n[f++];e.insertBefore(E,c),r&&(E[Ie]=r)}}else if(l===f)for(;u<s;){let c=t[u++];(!p||!p.has(c))&&o(c)&&c.remove()}else if((h=t[u])===n[l-1]&&n[f]===t[s-1]&&h.parentNode===e&&(!(m=h[Ie])||m===r))if(r)do{let c=t[--s];if(e.insertBefore(c,h),c[Ie]=r,f++,u>=s-1||f>=l)break}while(t[u]===n[l-1]&&n[f]===t[s-1]);else do if(e.insertBefore(t[--s],h),f++,u>=s-1||f>=l)break;while(t[u]===n[l-1]&&n[f]===t[s-1]);else{if(!o(t[u])){u++;continue}if(!p){p=new Map;let E=f;for(;E<l;)p.set(n[E],E++)}let c=p.get(t[u]);if(c!=null)if(f<c&&c<l){let E=u,R=1,I;for(;++E<s&&E<l&&!((I=p.get(t[E]))==null||I!==c+R);)R++;if(R>c-f){let ne=t[u];for(;f<c;){let F=n[f++];e.insertBefore(F,ne),r&&(F[Ie]=r)}}else{let ne=n[f++];e.replaceChild(ne,t[u++]),r&&(ne[Ie]=r)}}else u++;else t[u++].remove()}}}var Bs="_$$",Go="_$SOLID_EVENT_OWNER";var Vo={},mr=new Set,yt=new Map;function zo(e,t,n,r={}){let o;Ys(t);try{Po(i=>{if(o=i,r.onError&&(j()[ct]=r.onError),t===document){let s=e();We(()=>Ue(s),()=>{})}else{let s=e();G(t,()=>s,t.firstChild?null:void 0,n,{...r.insertOptions,schedule:!0})}},{id:r.renderId}),be()}catch(i){throw o&&o(),qo(t),i}return()=>{o(),qo(t),t.textContent=""}}function Uo(e,t,n){let r=document.createElement("template");return r.innerHTML=e,n===2?r.content.firstChild.firstChild:r.content.firstChild}function Oe(e,t){let n;return t===1?o=>document.importNode(n||(n=Uo(e,o,t)),!0):o=>(n||(n=Uo(e,o,t))).cloneNode(!0)}function Ko(e){for(let t=0,n=e.length;t<n;t++){let r=e[t];mr.has(r)||(mr.add(r),yt.forEach((o,i)=>Xo(r,i,o)))}}function Ys(e){let t=zs(e,e);t&&(t.roots=(t.roots||0)+1)}function qo(e){let t=yt.get(e);t&&(t.roots>1?t.roots--:delete t.roots),Ks(e,e)}function zs(e,t=e){if(!e||!t)return;let n=yt.get(e);return n||yt.set(e,n={owners:new Map,handlers:new Map}),n.owners.set(t,(n.owners.get(t)||0)+1),mr.forEach(r=>Xo(r,e,n)),n}function Ks(e,t=e){let n=yt.get(e);if(!n)return;let r=n.owners.get(t);r>1?n.owners.set(t,r-1):n.owners.delete(t),!n.owners.size&&(n.handlers.forEach((o,i)=>e.removeEventListener(i,o)),yt.delete(e))}function Xo(e,t,n){if(n.handlers.has(e))return;let r=o=>nl(o,t,n);n.handlers.set(e,r),t.addEventListener(e,r)}function Xs(e,t){let n=e,r=0;for(;n;){if(t.owners.has(n))return{owner:n,distance:r};r++,n=n._$host||n.parentNode||n.host}}var jo=null,Qs=[];function Zs(e,t){for(let n=0;n<e.length;n++)e[n](t)}function Js(e,t){jo!==null&&e._$claimed&&Qs.some(n=>n.includes(t.slice(t.indexOf(":")+1)))&&Zs(jo,e)}function gt(e,t,n){if(Cn(e))return;let r=t==="multiple"&&e.localName==="select";if(n==null||n===!1)e.removeAttribute(t);else if(e.setAttribute(t,n===!0?"":n),r&&!e._$multiple){let o=e.options;for(let i=0;i<o.length;i++)o[i].defaultSelected&&(o[i].selected=!0)}r&&(e._$multiple=!0),Js(e,t)}function el(e,t){Array.isArray(e)?e.flat(1/0).forEach(n=>n&&n(t)):e(t)}function Qo(e,t){let n=le(e);Y(null,()=>el(n,t))}var tl={scope:!0},Ee=null,Wo=null;function G(e,t,n,r,o){let i=n!==void 0,s=o&&o.host;if(i&&!r&&(r=[]),Ee!==null&&(r=Ee.claimInitial(e,i,r)),typeof t!="function"&&(t=hr(t,r,i,!0),typeof t!="function")){dr(e,t,r,n),s&&_n(t,s);return}if(i&&r.length===0){let f=document.createTextNode("");e.insertBefore(f,n),r=[f]}let l=r,u=!1;We(()=>{Ee!==null&&(l=Ee.reclaimRegion(l,e,n));let f=hr(t(),l,i,!0),a=u;if(u=!0,typeof f!="function")return f;let d=a&&!(o&&o.schedule)?{...o,schedule:!0}:o;return We(()=>(Ee!==null&&(l=Ee.reclaimRegion(l,e,n)),hr(f,l,i)),p=>{l=dr(e,p,l,n),s&&_n(l,s)},d),Vo},f=>{f!==Vo&&(l=dr(e,f,l,n),s&&_n(l,s))},t.$s?o?{...o,scope:!0}:tl:o)}function Cn(e){return!pt.hydrating||pt.isClaiming&&!pt.isClaiming()?!1:!e||e.isConnected?!0:Bo!==null&&Bo.claimed(e)}var Bo=null;function nl(e,t,n){if(Ee!==null&&Ee.dedupEvent(e))return;let r=e[Go],o;if(r){if(r===!0||r===t||!t.contains(r))return;o=r}let i=n.owners.size===1&&n.owners.has(t)?t:Xs(e.target,n)?.owner;if(!i||i===o)return;e[Go]=i;let s=o||e.target,l=Bs+e.type,u=e.target,f=p=>Object.defineProperty(e,"target",{configurable:!0,value:p}),a=()=>{let p=s[l];if(p&&!s.disabled){let h=s[`${l}Data`];if(h!==void 0?p.call(s,h,e):typeof p=="function"?p.call(s,e):p.handleEvent(e),e.cancelBubble)return}return s.host&&typeof s.host!="string"&&!s.host._$host&&s.contains(e.target)&&f(s.host),!0},d=()=>{for(;s&&a()&&!(s===i||s.parentNode===i);)s=s._$host||s.parentNode||s.host};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return s||i}}),o)o===e.target&&(s=o._$host||o.parentNode||o.host),s&&s!==i&&d();else if(e.composedPath){let p=e.composedPath();if(p.length){f(p[0]);for(let h=0;h<p.length&&(s=p[h],!!a());h++){if(s._$host){s=s._$host,d();break}if(s===i||s.parentNode===i)break}}else d()}else d();f(u)}function dr(e,t,n,r){if(Ee!==null&&Cn(e)){if(t&&t!==n){let s=Array.isArray(t);for(let l of s?t:[t])if(l&&l.nodeType){if(!Cn(l))return n}else if(s&&(typeof l=="string"||typeof l=="number"))return n}return t}if(t===n)return t;if(Ee!==null&&pt.hydrating&&t&&t.length!==0){let s=[].concat(n??[]);if([].concat(t).every(l=>(l===s[0]&&s.shift(),l?.parentNode===e))&&!s.length)return t}let o=typeof t,i=r!==void 0;if(o==="string"||o==="number"){let s=typeof n;s==="string"||s==="number"?e.firstChild.data=t:Zo(e,n)?e.textContent=t:(Jo(e,n),e.insertBefore(document.createTextNode(t),e.firstChild))}else if(t===void 0)Tn(e,n,r);else if(t.nodeType)Array.isArray(n)?Tn(e,n,i?r:null,t):n!=null&&n.nodeType?n.parentNode===e?e.replaceChild(t,n):e.appendChild(t):n!=null&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t),r&&(t[Ie]=r);else if(Array.isArray(t)){let s=Array.isArray(n);for(let l=0,u=t.length;l<u;l++){let f=t[l],a=typeof f;if(a==="string"||a==="number"){let d=s?n[l]:void 0;d&&d.nodeType===3?(d.data!==""+f&&(d.data=f),t[l]=d):t[l]=document.createTextNode(f)}}t.length===0?Tn(e,n,r):s?n.length===0?Yo(e,t,r):Ws(e,n,t,r):(n!=null&&Tn(e,n),Yo(e,t))}return Wo&&Wo(e),t}function hr(e,t,n,r){if(e=Ue(e,{skipNonRendered:!0,doNotUnwrap:r}),r&&typeof e=="function")return e;if(n&&!Array.isArray(e)&&(e=[e??""]),Ee!==null&&pt.hydrating&&Array.isArray(e))for(let o=0,i=e.length;o<i;o++){let s=e[o],l=t&&t[o],u=typeof s;(u==="string"||u==="number")&&l&&l.nodeType===3&&Cn(l)&&(e[o]=l)}return e}function _n(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)_n(e[n],t);else e&&e.nodeType&&e[Lo]!==t&&(e[Lo]=t,Object.defineProperty(e,"_$host",{get:t,configurable:!0}))}function Yo(e,t,n=null){for(let r=0,o=t.length;r<o;r++){let i=t[r];e.insertBefore(i,n),n&&(i[Ie]=n)}}function Zo(e,t){if(t==null)return!0;if(Array.isArray(t))return t.length?e.firstChild===t[0]&&e.lastChild===t[t.length-1]:e.firstChild===null;if(t==="")return e.firstChild===null;if(t.nodeType)return e.firstChild===t&&e.lastChild===t;let n=e.firstChild;return n!==null&&n.nodeType===3&&e.lastChild===n}function Jo(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];r.parentNode===e&&r.remove()}else if(t.nodeType)t.parentNode===e&&t.remove();else{let n=e.firstChild;n&&n.nodeType===3&&n.remove()}}function Tn(e,t,n,r){if(n===void 0)return Zo(e,t)?e.textContent="":Jo(e,t);if(t.length){let o=!1;for(let i=t.length-1;i>=0;i--){let s=t[i];if(r!==s){let l=s[Ie],u=s.parentNode===e&&(!l||l===n);r&&!o&&!i?u?e.replaceChild(r,s):e.insertBefore(r,n):u&&s.remove()}else o=!0}}else r&&e.insertBefore(r,n);r&&n&&(r[Ie]=n)}var ei={common:{configured:"Configured",linked:"Linked",running:"Running",connected:"Connected",lastConnect:"Last connect",lastMessage:"Last message",authAge:"Auth age",na:"n/a",yes:"Yes",no:"No",relink:"Relink",working:"Working\u2026",showQr:"Show QR",waitForScan:"Wait for scan",logout:"Logout",refresh:"Refresh"},channels:{lastError:"Last error",setup:{whatsappQrAlt:"WhatsApp QR"},whatsapp:{title:"WhatsApp",subtitle:"Link WhatsApp Web and monitor connection health.",phoneNumber:"Phone number",logoutConfirmTitle:"Log out of WhatsApp account {accountId}?",logoutConfirmMessage:"Logging out of account {accountId} stops its listener and deletes its saved credentials."}}};var[ti,rl]=ot({});function ni(e){return e==="en"?ei:ti()[e]}function yr(e){if(!(e==="en"||ti()[e]))return ol()}async function ol(){try{let{default:e}=await import("./chunk-1.js");rl(e)}catch{}}function ri(e,t){let n=ni(e);for(let r of t.split("."))n=n&&typeof n=="object"?n[r]:void 0;return n}function oi(e){return(t,n)=>{let r=ri(e(),t)??ri("en",t);return typeof r=="string"?r.replace(/\{(\w+)\}/g,(o,i)=>n?.[i]??`{${i}}`):t}}var il=Oe('<div class=settings-row><div class=settings-row__text><span class=settings-row__title><span class="settings-status settings-status--danger"><span class=settings-status__dot></span><span></span></span></span><span class=settings-row__desc>'),sl=Oe("<span class=settings-count>"),ll=Oe("<button type=button class=btn>"),ul=Oe('<section class=settings-section><div class=settings-section__header><div class=settings-section__copy><h2 class=settings-section__heading><!><!></h2><p class=settings-section__desc></p></div></div><div class=settings-group><dl class=settings-kv></dl><div style=display:contents></div><!><div class="settings-row settings-row--actions"><div class=settings-row__control><button type=button class=btn></button><button type=button class="btn danger"></button><button type=button class=btn>'),fl=Oe("<dt>"),cl=Oe("<dd>"),al=Oe("<span class=settings-status><span class=settings-status__dot></span><span>"),dl=Oe("<div class=settings-row role=status><div class=settings-row__text><span class=settings-row__desc>"),hl=Oe('<div class="settings-row settings-row--stacked"><div class=qr-wrap><img>');function ii(e){let t=oi(()=>e.snapshot.locale),[n,r]=ot(),o=()=>e.snapshot.status,i=Bt(()=>n()?.then(()=>null)??null),s=()=>o()?.linked===!0,l=()=>e.snapshot.login,u=()=>{let g=o()?.configured,O=e.snapshot.accounts.find(z=>z.accountId===e.snapshot.defaultAccountId)??e.snapshot.accounts[0];return typeof g=="boolean"?g:O?.configured??null},f=(g,O)=>({key:g,label:t(`common.${g}`),value:t(O==null?"common.na":O?"common.yes":"common.no"),kind:O===!0?"ok":"muted"}),a=Bt(()=>{let g=o(),O=g?.self?.e164;return[f("configured",u()),f("linked",g?.linked===!0),...O?[{key:"phone",label:t("channels.whatsapp.phoneNumber"),value:e.context.formatPhoneNumber(O),kind:void 0}]:[],f("running",g?.running===!0),f("connected",g?.connected===!0),{key:"lastConnect",label:t("common.lastConnect"),value:g?.lastConnectedAt?e.context.formatRelativeTimestamp(g.lastConnectedAt):t("common.na"),kind:void 0},{key:"lastMessage",label:t("common.lastMessage"),value:g?.lastMessageAt?e.context.formatRelativeTimestamp(g.lastMessageAt):t("common.na"),kind:void 0},{key:"authAge",label:t("common.authAge"),value:g?.authAgeMs!=null?e.context.formatDuration(g.authAgeMs):t("common.na"),kind:void 0}]});function d(g){let O=(async()=>{try{await g()}catch(z){if(e.context.signal.aborted||z instanceof DOMException&&z.name==="AbortError")return;throw z}})();r(O),O.catch(()=>{})}async function p(){let g=e.context.login.captureLogout();g&&await e.context.confirm({title:t("channels.whatsapp.logoutConfirmTitle",{accountId:g.accountId}),message:t("channels.whatsapp.logoutConfirmMessage",{accountId:g.accountId}),confirmLabel:t("common.logout"),danger:!0})&&await g.logout()}let h;En(()=>e.context.mountConfig(h));let m=g=>(()=>{var O=il(),z=O.firstChild,J=z.firstChild,st=J.firstChild,lt=st.firstChild,ut=lt.nextSibling,si=J.nextSibling;return G(ut,()=>t("channels.lastError")),G(si,()=>e.context.formatError(g.error)),O})();var c=ul(),E=c.firstChild,R=E.firstChild,I=R.firstChild,ne=I.firstChild,F=ne.nextSibling,Q=I.nextSibling,C=E.nextSibling,_=C.firstChild,v=_.nextSibling,Z=v.nextSibling,Be=Z.nextSibling,Ne=Be.firstChild,re=Ne.firstChild,it=re.nextSibling,de=it.nextSibling;return G(I,()=>t("channels.whatsapp.title"),ne),G(I,X(je,{get when(){return e.snapshot.accounts.length>=2},get children(){return[" ",(()=>{var g=sl();return G(g,()=>e.snapshot.accounts.length),g})()]}}),F),G(Q,()=>t("channels.whatsapp.subtitle")),G(_,X(fr,{get each(){return a()},keyed:g=>g.key,children:g=>[(()=>{var O=fl();return G(O,()=>g().label),O})(),(()=>{var O=cl();return G(O,X(je,{get when(){return g().kind},get fallback(){return g().value},children:z=>(()=>{var J=al(),st=J.firstChild,lt=st.nextSibling;return G(lt,()=>g().value),We(()=>z()==="ok",ut=>{J.classList.toggle("settings-status--ok",ut)}),J})()})),O})()]})),G(C,X(je,{get when(){return o()?.lastError},get fallback(){return X(ar,{get on(){return n()},get children(){return X(cr,{fallback:g=>X(m,{get error(){return g()}}),get children(){return i()}})}})},children:g=>X(m,{get error(){return g()}})}),v),Qo(()=>g=>{h=g},v),G(C,X(je,{get when(){return l()?.message},children:g=>(()=>{var O=dl(),z=O.firstChild,J=z.firstChild;return G(J,g),O})()}),Z),G(C,X(je,{get when(){return l()?.qrDataUrl},children:g=>(()=>{var O=hl(),z=O.firstChild,J=z.firstChild;return We(()=>({e:g(),t:t("channels.setup.whatsappQrAlt")}),({e:st,t:lt},ut)=>{st!==ut?.e&>(J,"src",st),lt!==ut?.t&>(J,"alt",lt)}),O})()}),Be),re._$$click=()=>d(()=>e.context.login.start(s())),G(re,(()=>{var g=pr(()=>!!s());return()=>g()?t("common.relink"):pr(()=>!!l()?.busy)()?t("common.working"):t("common.showQr")})()),G(Ne,X(je,{get when(){return l()?.qrDataUrl!=null},get children(){var g=ll();return g._$$click=()=>d(()=>e.context.login.wait()),G(g,()=>t("common.waitForScan")),We(()=>l()?.busy,O=>{gt(g,"disabled",O)}),g}}),it),it._$$click=()=>d(p),G(it,()=>t("common.logout")),de._$$click=()=>d(()=>e.context.refresh(!0)),G(de,()=>t("common.refresh")),We(()=>({e:!s(),t:l()?.busy,a:l()?.busy}),({e:g,t:O,a:z},J)=>{g!==J?.e&&re.classList.toggle("primary",g),O!==J?.t&>(re,"disabled",O),z!==J?.a&>(it,"disabled",z)}),c}Ko(["click"]);var Kc="whatsapp",Xc=[{placement:{section:"channels",panel:"detail",channelId:"whatsapp"},mount(e,t){yr(t.props.locale);let[n,r]=ot(t.props,{ownedWrite:!0}),o=zo(()=>X(ii,{context:t,get snapshot(){return n()}}),e);return{update(i){i.presented&&(yr(i.locale),r(i))},dispose:o}}}];export{Kc as pluginId,Xc as settingsViews};