UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 62.3 kB
var Q=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}},_e=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 $n(e){return e instanceof _e?e.cause:e}var _={},pt={},Nr=typeof Proxy=="function",gt={},vr=Symbol("refresh"),De=Set;function Mn(e){let t=e.De;for(;t;)t.R|=32,Mn(t),t=t.pe}var Bt;function yt(e){try{e()}catch(t){Bt||=[t],W()}}function Wt(e){let t=Bt;if(Bt=void 0,t&&!e)throw t[0]}function we(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)&&we(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||Ce.length)&&W());let i=n?e.T.Ue:e.De;for(n?e.T.Ue=null:e.De=null;i;){let o=i;o.l&=-33,ye(o,G),Et(o),i.Ze=i,we(i,!0),i=i.pe}if(n||(e.ye=0),t&&!n&&!(r&32)&&e._parent!==null&&!(e._parent.R&64)){let o=e.Ze,s=e.pe;o!==null?o.pe=s:e._parent.De=s,s!==null&&(s.Ze=o),e.Ze=null}if(Io(e,n),t&&e.Je){let o=e.Je;e.Je=void 0,yt(o)}}function Kt(e,t){let n=e.De;t.Ze=null,t.pe=n,n!==null&&(n.Ze=t),e.De=t}function Io(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--)yt(n[r]);else yt(n)}function Oo(e,t){let n=e;for(;n.l&4&&n._parent;)n=n._parent;if(n.id!=null)return No(n.id,t?n.ye++:n.ye);throw new Error("")}function Yt(e){return Oo(e,!0)}function Xt(e,t,n){return e?.id??(t?n?.id:n?.id!=null?Yt(n):void 0)}function No(e,t){let n=t.toString(36),r=n.length-1;return e+(r?String.fromCharCode(64+r):"")+n}function ge(){return P}function Dn(e,t=P){return t&&(t.He?Array.isArray(t.He)?t.He.push(e):t.He=[t.He,e]:t.He=e),e}function kr(e=!0){we(this,e),Bt&&!x.q&&Wt()}function Ae(e){let t=P,n=e?.transparent??!1,r={id:Xt(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||gt,ye:0,T:null,_parent:t,dispose:kr};return t&&Kt(t,r),r}function Jt(e,t){let n=Ae(t);return ne(n,()=>e(kr.bind(n,!0)))}var Vn=null,ie=null,$r=null,jn=null,vo=null,Zt=null,ko=null,xo=null,Po=null;var Fo=null,Qe=null,$o=null,Ho=null,qn=null;var Mo=null,Do=null;var Lo=null,Uo=null;var Ze=null;var Hr,zn;var Le=[];function Go(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||Le.push(n),n}var Z=null;function It(e){Z=e}var X=null,Ie=null;function Bn(e,t){if(x.q&&!t||X!==null)return Ne(e);Ie===null?Ie=ce(e):Mr(ce(e),Ie),W()}function oe(e){return e.T.Re=ce(e.T.Re)}function Vo(e){return e=ce(e),Le.indexOf(e)!==-1?e:null}function ce(e){for(;e.cn!==null;)e=e.cn;return e}function Ne(e){let t=X;t===null?X=e===null?Go(!1):ce(e):e!==null&&Mr(ce(e),t),x.q||W()}function Mr(e,t){e=ce(e),t=ce(t),!(e===t||e.v||t.v)&&(e.cn=t,t.tt+=e.tt,t.nt||=e.nt,Ye(t.tn,e.tn),Ye(t.un[0],e.un[0]),Ye(t.un[1],e.un[1]),Ye(t.En,e.En),e.I!==null&&Ye(t.I??=[],e.I),Le.splice(Le.indexOf(e),1))}function jo(e){let t=Tt;Tt??=e;let n=e.tt!==0||zo(e.tn,e)||!!Po?.(e);return Tt=t,n}var Tt=null;function qo(e,t){let n=e.T?.fe;if(n===void 0)return!0;for(let r of n){let i=r.T?.Re;if(i==null||ce(i)===t)return!0}return!1}function zo(e,t,n=!1){for(let r=0;r<e.length;r++){let i=e[r];if(!(!(i.m&1)||i.R&64||i.l&8192||i.T.Re!==null&&oe(i)!==t||n&&!qo(i,t))){if(i.i===1){if(xr(i,Tt??t))return!0;continue}for(let o=i.o;o!==null;o=o.t){let s=o.u;if((s.i===1&&s.m&1||s.R&2048||s.l&16384&&s.m===1)&&(o.Te===s.Ne||s.T?.F!=null)&&!(s.R&64)&&xr(s,Tt??t))return!0}}}return!1}function xr(e,t){return!(e.R&32&&Bo(e,t))&&!$o?.(e)}function Bo(e,t){let n=e;for(;n?.R&32;)n=n._parent;return n?.l&256&&n.T?.Re!=null&&oe(n)===ce(t)}var bt=[];function Dr(e){bt.push(e)}var Qt=[];function Lr(e){ye(e,G),e.R&=-4,Qt.push(e)}function Ot(e,t){e.l|=256,Wo(e,t)}function Wo(e,t){let n=K(e);n.Re!==t&&(n.Re=t,t.tn.push(e))}function Ur(e,t){for(let n=e.De;n!==null;n=n.pe)n.T?.Re?.v||(n.X!==void 0&&(n.l&256||Ot(n,t),n.l|=1048576),Ur(n,t))}var G={$e:new Array(2e3).fill(void 0),p:!1,Ge:0,et:0},J=0,en=!1,tn=!1,Pr=!1,Ln=0;var Ko=0;var Gr=0;var Vr=2147483647;function W(){if(tn){Yo();return}en||(en=!0,!Ln&&!x.q&&queueMicrotask(ve))}var ln=Symbol.for("solid-js/root-error-hook");function jr(e){if(tn)return;tn=!0,Wt(!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 Yo(){Pr||(Pr=!0,console.error("[REACTIVITY_HALTED]"))}var ae=class e{un=[[],[]];q=!1;flush(){if(!this.q){this.q=!0,Kr(),Z=null,Ie=null;try{Br(),Un(G,e._e),this.settle(),J++,en=G.et>=G.Ge||Ce.length!==0,this.run(1),this.run(2)}finally{this.q=!1,Ie=null}}}settle(){ko?.()&&Un(G,e._e);let t=X;X=null,vo?.(t);let n=t!==null&&!t.v?ce(t):null;if(n!==null){let l=Ce.length;for(let c=0;c<l;c++){let d=Ce[c];if(!(d.l&2304)&&(d.T===null||d.T.Re===null||!d.T.Re.v)){if(d.ue===_&&d.m&4&&d.i!==1)continue;if(d.ue!==_&&!(d.m&5)&&d.T?.Ue==null&&d.T?.me==null&&an(d,d.Ie,d.ue)){d.ue=_,d.l&=-129;continue}Ot(d,n)}d.l&128&&Ur(d,n)}Ce.length=0,Mo?.(n);let u=Qt.splice(0);if(Ze){u.sort((c,d)=>c.Fe-d.Fe);for(let c=0;c<u.length;c++)(u[c].R&96)===32&&u[c].l&32768&&de(u[c])}}else{Zo();for(let l=0;l<bt.length;l++){let u=bt[l];u.T?.F==null&&!u.Ae&&Fe(u)}}bt.length&&(bt.length=0);let r=this.un,i=this.un=[[],[]];Zt&&(Zt(n!==null?_t:null),_t.length&&(_t.length=0)),this.un=[[],[]];for(let l=Le.length-1;l>=0;l--){let u=Le[l];jo(u)||(Le.splice(l,1),xo?.(u),Jo(u),l=Le.length)}Do?.();let o=n&&Vo(n);Uo?.(o);let s=o!==null;for(let l=0;l<2;l++)s&&Ye(o.un[l],r[l]),this.un[l]=s||i[l].length||this.un[l].length?i[l].concat(s?[]:r[l],this.un[l]):r[l];if(Qt.length!==0){let l=Qt.splice(0).sort((u,c)=>u.Fe-c.Fe);for(let u=0;u<l.length;u++)l[u].R&64||de(l[u])}Ho?.()}run(t){let n=this.un[t-1];n.length&&(this.un[t-1]=[],es(n,t))}enqueue(t,n,r=Z){t&&(r!==null?r:this).un[t-1].push(n),W()}notify(t,n,r,i){return Fo?.(t,r&n,i)?!0:n&1?(r&1&&Z===null&&Ne(null),!0):!1}};function Xo(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 i=r.De;i!==null;i=i.pe)i.i&&(i.Ae=!1);me(r)}}return e.En.length=0,t}function Jo(e){let t=Xo(e);e.I!==null&&Lo(e.I);for(let n=0;n<e.tn.length;n++){let r=e.tn[n];r.T.Re===null||oe(r)!==e||(r.T.Re=null,zr(r))}X===e&&(X=null),t?x.un[1].push(()=>Fr(e)):Fr(e)}function Fr(e){for(let t=0;t<2;t++)Ye(x.un[t],e.un[t]),e.un[t]=[]}function Ye(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}var Ce=[],_t=[];function un(e,t){e.R&2048||(e.R|=2048,t.En.push(e))}function Nt(e){Ce.push(e),x.q||Wr()}var fn=0;function cn(){fn++}function Wn(e){e.Me=fn;let n=(e.l&512)!==0&&e.T?.Pe!==void 0;for(let r=e.o;r!==null;r=r.t){let i=r.u;if(i.R&4&&r.Te===i.Ne&&r!==i._&&(i.R|=4096),n&&i.l&8){i.R|=256;continue}me(i)}}function qr(e,t){for(let n=e.o;n!==null;n=n.t){let r=n.u.T?.Re;(r?.v?Qo(r,t):n.u.i)&&(n.u.R|=65536)}}function Qo(e,t){return e===t||e.en!==null&&e.en===t.en}function zr(e){let t=e;if(!t.X){e.l&=-385,e.ue!==_&&(e.Ie=e.ue,e.ue=_);return}let n=e.ue===_&&(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 i=e.ue;e.ue=_,e.ie=J+1,Ve(t,2,i)}else e.ue!==_&&(e.Ie=e.ue,e.ue=_,t.m&=-5,t.T!=null&&(t.T.Ve=!1,t.T.je=_),e.i&&e.i!==3&&(e.Ae=!0,x.enqueue(e.i,e.W??=ae.K.bind(null,t))));t.ce=!1,t.R&=-1025,t.T?.F==null&&Fe(t),t.m&1||(t.m&=-5),!n&&t.T!=null&&(t.T.Ue!==null||t.T.me!==null)&&ae.Ce(t,!1,!0)}function Zo(){for(let e=0;e<Ce.length;e++){let t=Ce[e];t.l&2304||zr(t)}Ce.length=0}var x=new ae;function ve(e){if(Ko>0)return e?e():void 0;if(e){Ln++;try{return e()}finally{try{ve()}finally{Ln--}}}if(!x.q&&!tn){for(;en;)x.flush();Wt()}}function es(e,t){for(let n=0;n<e.length;n++)e[n](t)}function me(e){G.Ge>e.Fe&&(G.Ge=e.Fe),Kn(e,G)}function Yr(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,i=t.$e[r];if(i===void 0)t.$e[r]=e;else{let o=i.We;o.be=e,e.We=o,i.We=e}r>t.et&&(t.et=r)}function Kn(e,t){let n=e.R;n&12||(n&1?e.R=n&-4|2|8:(e.R=n|8,t.p&&xt(e)),n&16||Yr(e,t))}function Yn(e,t){let n=e.R;n&28||(e.R=n|16,Yr(e,t))}function ye(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 i=e.be,o=t.$e[r],s=i??o;e===o?t.$e[r]=i:e.We.be=i,s.We=e.We}e.We=e,e.be=void 0}function Xr(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&&xt(n)}}function xt(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)xt(r.u,1)}}function Un(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):ts(n,e),n=e.$e[e.Ge]}e.et=0}function ts(e,t){ye(e,t);let n=e.Fe;for(let r=e.C;r;r=r.G){let i=r.S;i.X&&i.Fe>=n&&(n=i.Fe+1)}if(e.Fe!==n){e.Fe=n;for(let r=e.o;r!==null;r=r.t)Yn(r.u,t)}}var ns;function Qr(e){let t=e.S,n=e.G,r=e.t,i=e.Xe;if(r!==null?r.Xe=i:t.ve=i,i!==null)i.t=r;else if(t.o=r,r===null){t.l&4096?ns(t):t.T?.we&&yt(t.T.we);let o=t;o.X&&o.l&32&&!(o.R&32)&&!(o.m&1)&&(Ft?Ft.push(o):ut(o))}return n}function Fe(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 Et(e){let t=e.C;if(t){do t=Qr(t);while(t!==null);e.C=null,e._=null}}var Ft=null,Xn=e=>Ft=e;function ut(e){ye(e,G),Et(e),we(e,!0)}var Pt=new De;function Br(){if(Pt.size!==0){for(let e of Pt)!e.o&&e.l&32&&!(e.m&1)&&!(e.R&96)&&ut(e);Pt.clear()}}function dn(e,t){let n=t._;if(n!==null&&n.S===e)return;let r=null,i=t.R&4;if(i&&(r=n!==null?n.G:t.C,r!==null&&r.S===e)){r.Te=t.Ne,t._=r;return}let o=e.ve;if(o!==null&&o.u===t&&(!i||o.Te===t.Ne))return;let s=t._=e.ve={S:e,u:t,G:r,Xe:o,t:null,Te:t.Ne};n!==null?n.G=s:t.C=s,o!==null?o.t=s:e.o=s,cn()}function ti(e,t){return e.T?.fe?.has(t)?!1:((K(e).fe??=new De).add(t),!0)}function Zr(e,t){let n=e.T?.fe;return n?.delete(t)?(n.size||(e.T.fe=void 0),!0):!1}function Qn(e){e.T!==null&&(e.T.fe=void 0)}function rs(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 Zn(e,t){K(e).se=!0,t.source&&ti(e,t.source),e.m&2||et(e,t.source,t)}function et(e,t,n){if(!t){e.T!==null&&(e.T.F=null);return}if(n instanceof Q&&n.source===t){K(e).F=n;return}let r=e.T?.F;(!(r instanceof Q)||r.source!==t)&&(K(e).F=new Q(t))}function tt(e,t){for(let n=e.o;n!==null;n=n.t)t(n.u,n)}function mn(e){e.X&&e.l&32&&!e.o&&!(e.R&32)&&!(e.m&1)&&ut(e)}function is(e){let t,n=new De,r=i=>{n.has(i)||(n.add(i),!i.o&&i.l&32&&(t??=[]).push(i),tt(i,r))};if(tt(e,r),t)for(let i of t)mn(i)}function er(e,t,n){return!(e.l&256||n&&e.R&16384&&x.q&&!e.fam)||Z?!1:(Qn(e),e.T&&(e.T.se=!1),(e.m&=6)&2||et(e),e.ue=t instanceof _e?t:new _e(e,t),e.l|=2097280,ze(e),W(),!0)}function ni(e,t){let n=!1,r=new De,i=o=>{r.has(o)||(r.add(o),o.T?.F===t&&(me(o),n=!0),tt(o,i))};tt(e,i),n&&W()}function ze(e,t=e){Zr(e,t);let n=!1,r,i=new De,o=s=>{if(i.has(s)||t!==e&&rs(s,t)||!Zr(s,t))return s.l&32768&&me(s);i.add(s),s.ie=J;let l=s.T?.fe?.values().next().value,u=s.m&2;l?u||et(s,l):(s.m&=-2,u||et(s),s.l&256&&Ne(oe(s)),s.T?.se&&(me(s),n=!0),s.T!==null&&(s.T.se=!1),!s.o&&s.l&32&&(r??=[]).push(s)),tt(s,o)};if(tt(e,o),r)for(let s of r)mn(s);n&&W()}function Jn(e){return e!=null&&typeof e=="object"&&typeof e.then=="function"}function ri(e){let t=e.T?.ae;t!=null&&(e.T.ae=null,t())}function ii(e,t,n,r){let i=!1,o=!1;if(typeof t=="object"&&t!==null&&se(()=>{i=t[Symbol.asyncIterator],o=!i&&Jn(t)}),!o&&!i)return e.T!==null&&(e.T.Se=null),e.ce=!1,t;K(e).Se=t,e.T.Ee=Gr||Vr,e.T.fe=void 0;let s,l=m=>{if(e.T?.Se!==t)return;let g=m instanceof Q;if(g&&e.ce){e.T!==null&&(e.T.Se=null),Zn(e,m),e.ie=J;return}(g||n||!er(e,m))&&(Ve(e,g?1:2,m),g||we(e,!1,!0)),g&&ze(e),e.ie=J,g||is(e),r?.(m,g)},u=(m,g)=>{if(e.T?.Se!==t||e.R&2)return;let f=e.m&4;if(ei(e),n){try{n(m)}catch(h){l(h);return}e.l&256||(e.T.de=void 0),f&&ei(e,!0)}else Ee(e,()=>m);e.ue===_&&(e.ce=!1,Fe(e)),ze(e),W(),ve(),g?.()},c=()=>e.l&32&&!e.o&&!(e.m&1)?(ut(e),!0):!1,d=(m,g)=>{let f=m[Symbol.asyncIterator](),h=!1,y=!1,R=!g,M=()=>{if(!y){y=!0;try{let w=f.return?.();Jn(w)&&w.then(void 0,()=>{})}catch{}}};Dn(M,g),K(e).ae=M;let T=()=>{try{c()||F()}catch(w){l(w)}},F=()=>{let w,v,C=!1,A=!1,$=!0,V=f.next();if((Jn(V)?V:{then:U=>{U(V)}}).then(U=>{if($&&R)w=U,C=!0,U.done&&(y=!0);else{if(e.T?.Se!==t)return;U.done?(y=!0,h?(W(),ve()):u(void 0),c()):(h=!0,u(U.value,T))}},U=>{$&&R?(v=U,A=!0):e.T?.Se===t&&(y=!0,l(U),c())}),$=!1,A){if(y=!0,l(v),R)throw v;return!0}return C&&!w.done?(s=w.value,h=!0,F()):C&&w.done},S=F();return R=!1,h||S},p=null,a=(m,g)=>{let f=!1;if(typeof m=="object"&&m!==null&&se(()=>{f=m[Symbol.asyncIterator]}),!f)return!1;s=void 0;let h=d(m,g);return g||(p=h),!0};if(o){let m=!1,g=!1,f,h=!0;if(t.then(y=>{if(h)s=y,m=!0;else{try{if(e.T?.Se===t&&!(e.R&64)&&a(y,e))return;u(y)}catch(R){l(R)}c()}},y=>{h?(f=y,g=!0):(l(y),c())}),h=!1,g)throw l(f),f;m?a(s)||(e.ce=!1):p=!1}if(i&&a(t),p!==null){if(!p){if(e.ce)return e.Ie;throw new Q(P)}e.ce=!1}return s}function tr(e,t=!1){e.T?.fe&&Qn(e),e.T?.se&&(e.T.se=!1),e.m=t?0:e.m&4,e.T?.F&&et(e);let n=nr(e);n&&n.call(e)}function ei(e,t=!1){let n=e.T?.fe;n&&(n.delete(e),n.size)?(e.T.se=!1,t&&(e.m=1),et(e,n.values().next().value)):tr(e,t)}function Ve(e,t,n){t===2&&!(n instanceof _e)&&!(n instanceof Q)&&(n=new _e(e,n));let r=t===1&&n instanceof Q?n.source:void 0;if(t===1&&r?(e.m&2&&(e.T.de=e.T.F),ti(e,r),e.m=1|e.m&4,et(e,r,n)):(Qn(e),e.m=t|(t!==2?e.m&4:0),K(e).F=n),t===1&&e.l&8192){Z===null&&Ne(null);return}let i=nr(e);if(i){i.call(e);return}os(e,t,n)}function os(e,t,n){let r=t===1&&n instanceof Q?n.source:void 0;tt(e,(i,o)=>{if(i.ie=J,i.l&49152||t===1&&o.Te!==i.Ne){me(i),W();return}if(t===1&&r&&i.T?.fe?.has(r)){Z===null&&(i.l&2304)===256&&x.q&&!Qe?.(i,r.ie===J)&&Ne(oe(i));return}(t===1&&r||t!==1&&(i.T?.F!==n||i.T?.fe))&&(ie&&Z!==null?ie(i,Z,!0,e):(Nt(i),t===1&&(i.l&2304)===256&&!i.i&&Ne(oe(i))),Ve(i,t,n))})}ae._e=e=>{e.i===3?(ye(e,G),e.Ae=!0,x.enqueue(2,e.M)):e.R&32&&!(e.R&65536)?Lr(e):ie&&e.R&32&&cs(e)?(ye(e,G),e.R&=-65540):de(e)};function cs(e){let t=e._parent;for(;t.R&32;)t=t._parent;return(t.l&10240)===2048||t.i&&t.T?.Re?.v}ae.Ce=we;var te=!1,P=null,nt=!1,rr,ur=null;function hi(e){for(;e;){if(e.Oe)return!0;e=e._parent}return!1}function de(e,t=!1){cn();let n=e.i,r,i=Z,o=rr,s=ie&&(rr=t&&(i||o));if(It(ie?(e.R&65536||(e.l&10240)===2048)&&e.T?.Re?.v?e.T.Re:t&&i?._parent.he!=i&&ui(P)?.R&4?i:null:null),!t){if(ye(e,G),e.T!==null&&(e.T.Se=null,ri(e)),e.m&1&&(e.l&=-32769),e.l&256){let S=oe(e);S.v||e.l&524288||(n!==1&&!(e.l&32768)?Bn(S,Qe?.(e,e.m&4)):S!==X&&!(e.m&4||e.l&1048576)&&(e.ue=_,n===1&&(e.l&=-257)))}if(n===3||e.l&128){let S=Ft;Xn(r=[]),we(e),Xn(S)}else(e.De!==null||e.He!==null)&&as(e);e.l&2097152&&(e.ue=_,e.l^=2097152)}let l=!!(e.m&4),u=e.m&2?e.T?.F:void 0,d=(e.m&1)!==0?e.T?.fe:void 0,p=e.T?.fe?.has(e),a=!1,m=(e.R&8192)!==0&&!(e.m&1&&e.T!==null&&!e.T.Ve),g=P;P=e,e._=null,e.Ne++,e.R=4|e.R&8224,e.ie=J;let f=e.ue!==_?e.ue:e.l&2048&&e.T.v!==_?e.T.v:e.Ie,h=e.Fe,y=!1,R=!1,M=te;te=!0;try{if(e.l&64)f=e.X(f),e.T!==null&&(e.T.Se=null),e.ce=!1;else{let S=e.T?.Se,w=e.X(f),v=typeof w=="object"&&w!==null,C=e.T?.Se!==S;f=C||!v?w:ii(e,w),!C&&!v&&(e.T!==null&&(e.T.Se=null),e.ce=!1)}(e.m!==0||e.T!==null)&&tr(e,t)}catch(S){let w=S instanceof Q;if(w&&e.ce)Zn(e,S);else if((w||!(a=er(e,S,!0)))&&(w&&(K(e).se=!0),Ve(e,w?1:2,S),w&&p&&!e.T?.Se&&ze(e)),(w||a)&&d)for(let v of d)v!==e&&!e.T?.fe?.has(v)&&ze(e,v)}finally{if(te=M,ie&&(rr=o),y=(e.R&4096)!==0,R=!!(e.R&(s&&(i||n||!(e.m&1))?16512:128)),e.l=e.l&-32769|e.R&32768,e.R=e.R&936032|(t?e.R&256:0),P=g,r)for(let S of r)mn(S);e.T!==null&&(e.T.Ve=m&&(e.m&1)!==0)}if(e.R&64){Et(e),e.T!==null&&(e.T.Se=null),It(i);return}let T=ie?Z:null,F=!!e.T?.F||a;if(ie&&T!==null&&(ie(e,T,t,F)?It(T):T=null),!F){let S=e.ue!==_?e.ue:e.l&2048&&e.T.v!==_?e.T.v:e.Ie,w=!n&&l||!!e.T?.de||!an(e,S,f);if(n&&w&&!(e.R&262144&&!e.Ae&&Object.is(e.ge,f))&&e.ue===_&&(e.Ae=!e.T?.F,(!t||T!==null)&&x.enqueue(n,e.W??=ae.K.bind(null,e),T)),!(!t&&T===null&&e.l&8192&&$r(e,f,F))){if(!F){if(w)T!==null?n&&e.ue===_?e.Ie=f:n||T.ke?e.ue=f:e.T.v=f:(t?!((X!==null||Ie!==null)&&(R||ui(g)?.R&128)):n&&e.ue===_)?e.Ie=f:(e.ue=f,t&&(Ot(e,X??Ie),e.m|=4,Qe?.(e,!s&&X))),e.o!==null&&(Wn(e),T!==null&&qr(e,T));else if(e.Fe!=h)for(let v=e.o;v!==null;v=v.t)Yn(v.u,G)}}if(!w&&!e.T?.F&&(u!==void 0&&ni(e,u),d))for(let v of d)v!==e&&ze(e,v);p&&!(e.m&5)&&ze(e)}if(t&&T===null&&R&&e.m&1){let S=X??Ie;S&&!S.v&&Qe?.(e)!==2&&Ot(e,S)}!e.T?.F&&e.ue===_&&!(n&&e.Ae)&&(t||n===3?Fe(e):Dr(e)),(e.ue!==_||e.T!==null&&(e.T.Ue!==null||e.T.me!==null)||(e.m&5)!==0&&(!t||(e.m&1)!==0))&&(e.l|=128,T===null&&Nt(e)),It(i),y&&(me(e),W())}function or(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&&or(n),e.R&2)break}(e.R&2||e.T?.F&&e.ie<J&&!e.T?.Se)&&de(e),e.R=e.R&937336}}function rt(e,t){let n=t?.transparent??!1,r=t!==null&&typeof t=="object"&&"loadingValue"in t,i={id:Xt(t,n,P),l:(n?4:0)|(t?.ownedWrite?1:0)|(!P||t?.lazy?32:0)|(t?.sync?64:0)|(t?.le?2:0)|(t?.Le??0)|(nt&&hi(P)?8:0),xe:t?.equals??Mt,He:null,A:P?.A??gt,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:P,pe:null,Ze:null,De:null,R:t?.lazy?512:0,m:r?0:4,ie:J,ue:_,Me:-1,ce:r,T:null};return t?.unobserved&&(K(i).we=t.unobserved),Ei(i,t),i}function K(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:_,Be:-1,Ee:0,v:_,I:0,de:void 0}}function si(e,t){e.R|=128,(t.m&4||e.i!==1)&&Bn(oe(t),!e.i&&e.m&4||Qe?.(e))}function li(e,t){let n=Ze&&e.l&32768,r=ie&&Z!==null;if((!r||e.m&4&&t.m&1)&&!n&&(e.i!==1||t.l&1024))return!1;let i=oe(t);return i===X&&!r&&!n||pi(e,i)?!1:(un(e,i),!0)}function pi(e,t){return(e.m&4||e.l&1048576)&&e.l&256&&oe(e)===t}function ui(e){return e!==null&&e.Qe?e.Ye:e}function as(e){Mn(e);let t=K(e);t.me=e.He,t.Ue=e.De,e.He=null,e.De=null,e.ye=0}function gi(e,t,n,r,i){let o=i?.transparent??!1,s={id:Xt(i,o,P),l:(o?4:0)|(i?.ownedWrite?1:0)|(i?.sync?64:0)|(i?.Le??0)|(nt&&hi(P)?8:0),xe:!1,He:null,A:P?.A??gt,ye:0,X:e,Ie:void 0,Fe:0,be:void 0,We:null,C:null,_:null,Ne:0,o:null,ve:null,_parent:P,pe:null,Ze:null,De:null,R:512,m:4,ie:J,ue:_,Me:-1,ce:!1,Ae:!1,ge:void 0,Ke:t,qe:n,Je:void 0,i:r,T:null};return i?.unobserved&&(K(s).we=i.unobserved),Ei(s,ds),s}var yi=null;function Si(e){yi=e}function nr(e){return e.i?yi:null}var ds={lazy:!0};function Ei(e,t){e.We=e;let n=P?.Qe?P.Ye:P;P&&Kt(P,e),n&&(e.Fe=n.Fe+1),Hr?.(e),!t?.lazy&&de(e,!0),nt&&!t?.lazy&&!(e.m&1)&&!(e.l&2)&&(K(e).Pe=e.Ie===void 0?pt:e.Ie,e.l|=512,ur.add(e))}function it(e,t){let n={xe:t?.equals??Mt,l:(t?.ownedWrite?1:0)|(t?.le?2:0),Ie:e,o:null,ve:null,ie:J,ue:_,Me:-1,T:null};return t?.unobserved&&(K(n).we=t.unobserved),nt&&!(n.l&2)&&(K(n).Pe=e===void 0?pt:e,n.l|=512,ur.add(n)),n}function Mt(e,t){return e===t}var fi=null;function se(e,t){let n=te;te=!1;try{return zn?zn(e):e()}finally{te=n}}var bi=!1;function ms(e,t){if(e.R&512)e.R&=-513,de(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)}de(e,!0)}}function hs(e,t){return!t||e.ue===_||t.l&16}var Dt=!1;function Wr(){Dt=!0}function ps(e){return x.q||e.ue===_||e.l&4194304?_:e.l&256?e.T.Be===J?e.T.je:_:e.Ie}function gs(e){let t=e.T;t.Be!==J&&(t.je=e.ue,t.Be=J,Dt=!0)}var hn=[];function ys(e){return e.R|=4096,!0}function Kr(){if(Dt=!1,hn.length!==0){for(let e of hn)e.l&=-4194305;hn.length=0}}function Ss(e,t){e.Fe>=G.Ge?(xt(t),Xr(G),or(e)):t.l&65536&&or(e);let n=e.Fe;n>=t.Fe&&e._parent!==t&&(t.Fe=n+1)}function fr(e){let t=P;t?.Qe&&(t=t.Ye);let n=e,r=e;if(typeof n.X=="function"&&ms(e),fi!==null)return fi(e,t);if(!n.X&&e.T?.Pe===void 0&&!nt&&(!Dt||e.ue===_)&&!(e.l&2048)){if(t&&(te&&dn(e,t),e.l&256&&!(t.l&16))){if(li(t,e))return e.Ie;si(t,e)}return!t||e.ue===_||t.l&16||(Ze&&t.l&32768||ie&&Z?.folded)&&_i(t)?e.Ie:(Ti(t),e.ue)}let i=!1;if(t&&(te&&(dn(e,t),r.X&&(Ss(r,t),t.i||(t.R|=r.l&32768))),e.l&256&&!(e.l&2048)&&!(t.l&16)&&(r.m&4||!li(t,e)?si(t,e):i=!0)),Vn&&e.l&2048){let s=Vn(t,e);if(s!==_)return s}if(r.m&1&&!i&&!(e.l&2048)&&!(r.m&4)&&(ie&&Z!==null&&!(t?.m&4)?i=!0:Ze&&t!==null&&t.l&32768&&(i=Ze(t,r))),r.m&1&&!i){if(t){if(!(t.l&16)||r.m&4)throw!te&&!bi&&e!==t&&dn(e,t),r.T?.F}else if(r.m&4)throw r.T?.F}if(r.X&&r.m&2){if(te&&r.ie<J)return de(r),fr(e);throw r.T?.F}if(nt&&t&&t.l&8){let s=e.T?.Pe;if(s!==void 0){let l=s===pt?void 0:s;return(e.ue!==_?e.ue:e.Ie)!==l&&(t.R|=256),l}}if(i)return e.Ie;if(!t&&e.T?.de)throw e.T.de;let o=Es(e,t);return!t&&typeof n.X=="function"&&e.l&32&&!(r.m&1)&&!e.o&&(Pt.add(e),W()),o}function Es(e,t){if(e.ue!==_&&e.m&4&&(!t||bi||t.l&16))throw new Q(null);let n=t&&Dt?ps(e):_;if(n!==_)return ys(t),n;if(hs(e,t)||Ze&&t.l&32768&&!(e.m&4)&&_i(t))return e.Ie;if(Ti(t,e),e.l&2097152)throw e.ue;return e.ue}function Ti(e,t){t?.m&4||(e.R|=16384,Zt&&Z!==null&&_t.push(e))}function _i(e){return X===null||pi(e,X)?!1:(un(e,X),!0)}function bs(e){x.q||e.l&4194304||(e.l|=4194304,hn.push(e))}function Ts(e,t){e.l&2||e.X!==void 0||e.T?.Pe!==void 0||(K(e).Pe=t===void 0?pt:t,e.l|=512,ur.add(e))}var ci=null;function an(e,t,n){if(e.xe===Mt)return t===n;try{return e.xe&&e.xe(t,n)}catch(r){if(!(r instanceof Q))return Ve(e,2,r),!0}}function Ee(e,t){ci!==null&&ci(e);let n=e.ue===_?e.Ie:e.ue;if(typeof t=="function"&&(t=t(n)),jn&&e.l&2048)return jn(e,t);if(e.l&256&&Ne(oe(e)),!(!!(e.m&4)||!!e.T?.de||!an(e,n,t)))return t;nt&&Ts(e,n);let i=e.ue!==_;return i?e.l&256&&!x.q&&gs(e):Nt(e),e.ue=t,P!==null&&bs(e),e.X!==void 0&&(e.ie=J),i&&e.Me===fn||(Wn(e),W()),t}function wi(e,t){let n=e.l&256&&!(e.R&1024)&&oe(e)!==X;if(n&&typeof t=="function"){let r=t(e.Ie);t=()=>r}return e.m&2&&(e.T.de=e.T.F,Ve(e,0,void 0)),t=Ee(e,t),e.l&=-2097153,n?(e.R=e.R&-2|2,Kn(e,G),W()):e.ue!==_&&(e.R|=1024),t}function ne(e,t){let n=P,r=te;P=e,te=!1;try{return t()}finally{P=n,te=r}}function Ri(e,t=!0){return e()}var cr=null;function Ai(e,t,n,r){let i=!!r?.user,o=gi(e,t,n,i?2:1,r);de(o,!0),!r?.defer&&o.ue===_&&!o.T?.Re?.v&&(o.i===2||r?.schedule?x.enqueue(o.i,yn.bind(null,o)):yn(o,o.i))}function _s(){let e=this.m,t=this.T?.F;if(e&2){if(x.notify(this,1,0),this.i===2){this.m&2&&(this.Ae=!0,x.enqueue(this.i,this.W??=yn.bind(null,this)));return}ar(this,$n(t),t,this)}else this.i===1&&x.notify(this,3,e,t)}function ar(e,t,n=t,r=e){if(!x.notify(e,2,2))throw jr(t),n}function yn(e,t){if(!e.Ae||e.R&64||qn?.(e))return;if(e.m&2&&e.i===2){let i=$n(e.T?.F);e.ge=e.Ie,e.Ae=!1;try{e.qe?e.qe(i,()=>{let o=e.Je;e.Je=void 0,o?.()}):console.error(i)}catch(o){ar(e,o)}return}let n=e.T?.F==null,r=e.Je;e.Je=void 0;try{r?.();let i=e.Ke(e.Ie,e.ge);e.Je=i}catch(i){K(e).F=new _e(e,i),e.m|=2,ar(e,i)}finally{e.ge=e.Ie,e.Ae=!1,n&&Fe(e)}}ae.K=yn;function Ci(e,t){let n=()=>{!r.Ae||r.R&64||qn?.(r)||(r.Ae=!1,de(r))},r=rt(()=>{let i=r.Je;r.Je=void 0,i?.();let o=Ri(e);r.Je=o},{...t,lazy:!0});r.Je=void 0,r.l=r.l&-33|16,r.Ae=!0,r.i=3,r.M=n,me(r),W()}Si(_s);var dr=Symbol(0),Sn=Symbol(0),Be=Symbol(0),Lt=Symbol(0);var sf=Object.prototype;function Ii(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function $e(e){let t=fr.bind(null,e);return t[vr]=e,t}function mr(e,t){if(typeof e=="function"){let r=rt(e,t);return r.l&=-33,[$e(r),wi.bind(null,r)]}let n=it(e,t);return cr!==null&&cr(n),[$e(n),Ee.bind(null,n)]}function xe(e,t){return $e(rt(e,t))}function hr(e,t,n){Ai(e,t,void 0,n)}function En(e){let t=ge();t&&!(t.l&16)?Ci(()=>se(e),void 0):x.enqueue(2,function n(){if(G.et>=G.Ge)return x.enqueue(2,n);e()})}function Tn(e,t,n){let r=typeof n?.keyed=="function"?n.keyed:void 0,i=t.length>1,o=t,s={L:Ae(),it:0,st:e,ot:[],ft:o,ht:[],tn:[],ze:r,ct:r||n?.keyed===!1?[]:void 0,lt:i&&n?.keyed!==!1?[]:void 0,ut:n?.keyed===!1,H:n?.fallback},l=rt(Is.bind(s),void 0);return l.l&=-33,$e(l)}var bn={ownedWrite:!0};function ws(e,t,n,r){let i=e.ot,o=e.it-1,s=[],l=[],u=[],c=256,d=r,p=r,a=!1;for(;d<=o&&p<=n-1;){let m=i[d],g=t[p];if(m===g){a||(u.push(d,p,0),a=!0),u[u.length-1]++,d++,p++;continue}a=!1;let f=-1,h=Math.min(32-s.length,o-d,c);for(let R=1;R<=h;R++)if(i[d+R]===g){f=R;break}c-=f===-1?h:f;let y=-1;h=Math.min(32-l.length,n-1-p,c);for(let R=1;R<=h;R++)if(t[p+R]===m){y=R;break}if(c-=y===-1?h:y,f!==-1&&(y===-1||f<=y)){for(;f-- >0;)s.push(d++);continue}if(y!==-1){for(;y-- >0;)l.push(p++);continue}if(c<=0||s.length===32||l.length===32)return!1;s.push(d++),l.push(p++)}for(;d<=o;d++){if(s.length===32)return!1;s.push(d)}for(;p<=n-1;p++){if(l.length===32)return!1;l.push(p)}return Rs(e,t,n,s,l,u)}function Rs(e,t,n,r,i,o){let s=e.ot,l,u,c;if(i.length!==0)for(c=new Array(r.length),u=0;u<i.length;u++){let g=-1;for(l=0;l<r.length;l++)if(!c[l]&&s[r[l]]===t[i[u]]){g=l;break}if(g===-1)return!1;c[g]=!0,i[u]=i[u]<<6|g}if(r.length!==0||i.length!==0){let g=new Set;for(l=0;l<r.length;l++)g.add(s[r[l]]);for(u=0;u<i.length;u++)g.add(t[i[u]>>6]);for(let f=0;f<o.length;f+=3){let h=o[f];for(let y=0,R=o[f+2];y<R;y++)if(g.has(s[h+y]))return!1}}let d=e.ht,p=e.tn,a=d.slice(0,n),m=p.slice(0,n);for(let g=0;g<o.length;g+=3){let f=o[g],h=o[g+1];if(f!==h)for(let y=0;y<o[g+2];y++)a[h+y]=d[f+y],m[h+y]=p[f+y]}for(u=0;u<i.length;u++){let g=i[u]>>6,f=r[i[u]&63];a[g]=d[f],m[g]=p[f]}for(e.ht=a,e.tn=m,e.it=n,e.ot=t.slice(0),l=0;l<r.length;l++)(c===void 0||!c[l])&&p[r[l]].dispose();return!0}function As(e,t,n,r,i,o,s,l,u){let c=e.ze,d=e.ot,p=e.tn,a=[],m=n;for(let g=n;g<=i;m++,g++){let f=c?c(t[g]):t[g];for(;m<=r&&(c?c(d[m]):d[m])!==f;)a.push(p[m++]);if(m>r)return s.fill(void 0),null;o[g]=e.ht[m],s[g-n]=p[m],l&&(l[g-n]=e.ct[m]),u&&(u[g-n]=e.lt[m])}for(;m<=r;m++)a.push(p[m]);return a}function Cs(e,t,n,r,i,o,s,l,u){let c=e.tn,d=e.ct,p=e.lt,a=e.it,m=n-a,g,f;if(m>0)for(c.length=n,d&&(d.length=n),p&&(p.length=n),g=a-1,f=n-1;g>i;g--,f--)c[f]=c[g],d&&(d[f]=d[g]),p&&(p[f]=p[g]);else if(m<0){for(g=i+1,f=o+1;g<a;g++,f++)c[f]=c[g],d&&(d[f]=d[g]),p&&(p[f]=p[g]);c.length=n,d&&(d.length=n),p&&(p.length=n)}for(f=r;f<=o;f++)c[f]=s[f-r],d&&Ee(d[f]=l[f-r],t[f]),p&&Ee(p[f]=u[f-r],f);for(f=o+1;f<n;f++)d&&Ee(d[f],t[f]),p&&m!==0&&Ee(p[f],f)}function Is(){this.L.Ye=ge();let e=this.st()||[],t=e.length;return e[dr],ne(this.L,()=>{let n,r,i,o,s,l=this.ct?this.ut?()=>(o[i]=it(e[r],bn),this.ft($e(o[i]),r)):()=>(o[i]=it(e[r],bn),s&&(s[i]=it(r,bn)),this.ft($e(o[i]),s?$e(s[i]):void 0)):this.lt?()=>{let u=e[r];return s[i]=it(r,bn),this.ft(u,$e(s[i]))}:()=>{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]=ne(this.tn[0]=Ae(),this.H));else if(this.it===0){let u=new Array(t),c=new Array(t);o=this.ct&&new Array(t),s=this.lt&&new Array(t);try{for(r=0;r<t;r++)i=r,u[r]=ne(c[r]=Ae(),l)}catch(d){for(n=0;n<=r;n++)c[n]?.dispose();throw d}this.tn[0]&&this.tn[0].dispose(),this.ht=u,this.tn=c,o&&(this.ct=o),s&&(this.lt=s),this.ot=e.slice(0),this.it=t}else{let u,c,d,p,a,m,g,f,h,y,R,M=Ee;for(u=0,c=Math.min(this.it,t);u<c&&(this.ot[u]===e[u]||this.ct&&Oi(this.ze,this.ot[u],e[u]));u++)this.ct&&M(this.ct[u],e[u]);for(c=this.it-1,d=t-1;c>=u&&d>=u&&(this.ot[c]===e[d]||this.ct&&Oi(this.ze,this.ot[c],e[d]));c--,d--);if(u===t&&this.it===t){this.ot=e.slice(0);return}if(t<=this.it&&c-u>64&&this.ct===void 0&&this.lt===void 0){let C=u+(d-u>>1),A=e[C],$=Math.min(c,C+32),V=Math.max(u,C-32);for(;V<=$&&this.ot[V]!==A;)V++;if(V<=$&&ws(this,e,t,u))return}let T=t-this.it,F=d-u+1,S=new Array(t),w=new Array(F);o=this.ct?new Array(F):void 0,s=this.lt?new Array(F):void 0;let v=T<0?As(this,e,u,c,d,S,w,o,s):null;if(v!==null)v.length!==0&&(f=v);else{for(m=new Map,g=new Array(F),r=d;r>=u;r--)p=e[r],a=this.ze?this.ze(p):p,n=m.get(a),g[r-u]=n===void 0?-1:n,m.set(a,r);for(n=u;n<=c;n++)p=this.ot[n],a=this.ze?this.ze(p):p,r=m.get(a),r!==void 0&&r!==-1?(S[r]=this.ht[n],w[r-u]=this.tn[n],o&&(o[r-u]=this.ct[n]),s&&(s[r-u]=this.lt[n]),r=g[r-u],m.set(a,r)):(f??=[]).push(this.tn[n]);try{for(r=u;r<=d;r++)w[r-u]===void 0&&((h??=[]).push(w[r-u]=Ae()),i=r-u,S[r]=ne(w[r-u],l))}catch(C){if(h)for(n=0;n<h.length;n++)h[n].dispose();throw C}}for(n=0;n<u;n++)S[n]=this.ht[n];for(r=d+1;r<t;r++)S[r]=this.ht[r-T];if(Cs(this,e,t,u,c,d,w,o,s),this.ht=S,this.it=t,this.ot=e.slice(0),f)for(n=0;n<f.length;n++)f[n].dispose()}}),this.ht}function Oi(e,t,n){return e?e(t)===e(n):!0}function ot(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 pr(e,n,t)?()=>{let r=[];return pr(n,r,{...t,doNotUnwrap:!1}),r}:n}return e}}function pr(e,t=[],n){let r=null,i=!1;for(let o=0;o<e.length;o++)try{let s=e[o];if(typeof s=="function"&&!s.length){if(n?.doNotUnwrap){t.push(s),i=!0;continue}do s=s();while(typeof s=="function"&&!s.length)}Array.isArray(s)?i=pr(s,t,n)||i:n?.skipNonRendered&&(s==null||s===!0||s===!1||s==="")||t.push(s)}catch(s){if(!(s instanceof Q))throw s;r=s}if(r)throw r;return i}function gr(){return!0}var He=0,Me=1,Gt=2,Vt=3,st=4,Os=Object.freeze({});function ct(e,t){return t===Vt&&(e=e())==null?Os:e}function lt(e,t){let n=e.hidden;return typeof n=="function"?n(t):n.includes(t)}function ki(e){return ct(e.source,e.kind)}function xi(e){return e[Lt]}function Ns(e,t){return t===He?Object.keys(e):t===Gt||e[Be]===e?Reflect.ownKeys(e):Object.keys(e)}function An(e,t,n){return t===Me?lt(e,n)?!1:e.kind===st?Di(e.source,n):n in ki(e):n in ct(e,t)}function Pi(e,t){return t===He?!0:t!==Me?!1:e.kind===He?!0:e.kind===st&&vs(e.source)}function vs(e){let t=e.sources,n=e.kinds;for(let r=0;r<t.length;r++)if(!Pi(t[r],n[r]))return!1;return!0}function _n(e,t=!0){return{configurable:!0,enumerable:t,get:e,set:gr}}function Sr(e,t,n,r=!1){if(t===Me)return lt(e,n)?void 0:Sr(e.source,e.kind,n,r);if(t===st)return Li(e,n);if(t===Vt)return r||n in ct(e,t)?_n(()=>ct(e,t)[n]):void 0;if(t===Gt)return xi(e)!==void 0?Reflect.getOwnPropertyDescriptor(e,n):r||n in e?_n(()=>e[n]):void 0;let i=Reflect.getOwnPropertyDescriptor(e,n);if(i!==void 0)return i.get!==void 0||i.set!==void 0?_n(()=>e[n],i.enumerable):i.configurable?i:{configurable:!0,enumerable:i.enumerable,writable:!0,value:i.value}}var Ut=class{sources;kinds;table=0;keys=void 0;descs=void 0;constructor(t,n){this.sources=t,this.kinds=n}};function Er(e){let t=e.table;if(typeof t!="object"){let n=e.sources,r=e.kinds;for(let i=0;i<n.length;i++)if(!Pi(n[i],r[i])){e.table=null;return}t=new Map,Fi(t,e,void 0),e.table=t}return t===null?void 0:t}function Fi(e,t,n){let r=t.sources,i=t.kinds;for(let o=0;o<r.length;o++){let s=r[o];if(i[o]===Me){if(s.kind===st){n===void 0?n=[s]:n.push(s),Fi(e,s.source,n),n.pop();continue}let l=s.source,u=Reflect.ownKeys(l);for(let c=0;c<u.length;c++){let d=u[c];!lt(s,d)&&!yr(n,d)&&Ni(e,d,l)}}else{let l=Reflect.ownKeys(s);for(let u=0;u<l.length;u++){let c=l[u];yr(n,c)||Ni(e,c,s)}}}}function yr(e,t){if(e!==void 0){for(let n=e.length-1;n>=0;n--)if(lt(e[n],t))return!0}return!1}function Ni(e,t,n){e.has(t)&&e.delete(t),e.set(t,n)}var ks=Object.prototype.propertyIsEnumerable;function xs(e,t){let n=e.keys;if(n===void 0){n=e.keys=[];for(let[r,i]of t)ks.call(i,r)&&n.push(r)}return n}function $i(e,t,n){let r=t.get(n);if(r===void 0)return;let i=e.descs;i===void 0&&(i=e.descs=new Map);let o=i.get(n);return o===void 0?(o=Sr(r,He,n),o===void 0?void 0:(i.set(n,o),o)):o.get!==void 0?o:{configurable:!0,enumerable:o.enumerable,writable:o.writable,value:r[n]}}var Hi=16;function vi(e){let t=e.table;if(typeof t=="object")return t===null?void 0:t;if(t+1<Hi){e.table=t+1;return}return Er(e)}function br(e){let t=e.table;return typeof t=="object"&&t!==null?t:void 0}var wn=Symbol();function Mi(e,t){let n=br(e);if(n!==void 0){let o=n.get(t);return o===void 0?wn:o[t]}let r=e.sources,i=e.kinds;for(let o=r.length-1;o>=0;o--){let s=i[o];if(s===He){let l=r[o];if(t in l)return l[t];continue}if(s===Me){let l=r[o];if(lt(l,t))continue;if(l.kind===st){let c=Mi(l.source,t);if(c!==wn)return c;continue}let u=ki(l);if(t in u)return u[t]}else{let l=ct(r[o],s);if(t in l)return l[t]}}return wn}function Rn(e,t){let n=Mi(e,t);return n===wn?void 0:n}function Di(e,t){let n=br(e);if(n!==void 0)return n.has(t);let r=e.sources,i=e.kinds;for(let o=r.length-1;o>=0;o--)if(An(r[o],i[o],t))return!0;return!1}function Li(e,t){let n=br(e);if(n!==void 0)return $i(e,n,t);let r=e.sources,i=e.kinds;for(let o=r.length-1;o>=0;o--)if(An(r[o],i[o],t))return Sr(r[o],i[o],t,!0)??_n(()=>Rn(e,t))}function Ps(e,t,n){let r=[];return Ui(e,n===void 0?void 0:[n],t,r,null),r}function Ui(e,t,n,r,i){let o=e.sources,s=e.kinds;for(let l=0;l<o.length;l++){let u=o[l],c=s[l],d;if(c===Me){if(u.kind===st){t===void 0?t=[u]:t.push(u),Ui(u.source,t,n,r,i),t.pop();continue}d=u,c=u.kind,u=u.source}u=ct(u,c);let p=n?Ii(u):Ns(u,c);for(let a=0;a<p.length;a++){let m=p[a];d!==void 0&&lt(d,m)||yr(t,m)||Fs(r,i,m,u)}}}function Fs(e,t,n,r){let i=e.indexOf(n);i!==-1&&(e.splice(i,1),t!==null&&t.splice(i,1)),e.push(n),t!==null&&t.push(r)}function $s(e,t){let n=Er(e);if(n===void 0)return Ps(e,!0,t);let r=xs(e,n);if(t===void 0)return r;let i=[];for(let o=0;o<r.length;o++)lt(t,r[o])||i.push(r[o]);return i}var Hs={get(e,t,n){if(typeof t=="symbol"){if(t===Be)return n;if(t===Lt)return e;if(t===Sn)return}let r=e.table,i;if(typeof r!="object"){if(r+1<Hi){e.table=r+1;let s=e.sources,l=e.kinds;for(let u=s.length-1;u>=0;u--){if(l[u]!==He)return Rn(e,t);let c=s[u][t];if(c!==void 0||t in s[u])return c}return}if(i=Er(e),i===void 0)return Rn(e,t)}else{if(r===null)return Rn(e,t);i=r}let o=i.get(t);return o===void 0?void 0:o[t]},has(e,t){if(t===Be)return!0;if(t===Sn||t===Lt)return!1;let n=vi(e);return n!==void 0?n.has(t):Di(e,t)},set:gr,deleteProperty:gr,getOwnPropertyDescriptor(e,t){if(t===Be||t===Sn||t===Lt)return;let n=vi(e);return n!==void 0?$i(e,n,t):Li(e,t)},ownKeys(e){return $s(e)}};function jt(...e){if(e.length===1&&typeof e[0]!="function")return e[0];let t=new Array(e.length),n=new Array(e.length),r=0,i,o=0;for(let p=0;p<e.length;p++){let a=e[p];if(a){if(o++,i=a,typeof a=="function"){t[r]=xe(a),n[r++]=Vt;continue}if(Be in a){let m=xi(a);if(m instanceof Ut)for(let g=0;g<m.sources.length;g++)t[r]=m.sources[g],n[r++]=m.kinds[g];else m!==void 0?(t[r]=m,n[r++]=Me):(t[r]=a,n[r++]=Gt);continue}t[r]=a,n[r++]=He}}if(r!==t.length&&(t.length=r,n.length=r),Nr)return o===1&&typeof i!="function"?i:new Proxy(new Ut(t,n),Hs);let s=Object.create(null),l=!1,u=t.length-1;for(let p=u;p>=0;p--){let a=t[p];if(!a){p===u&&u--;continue}let m=Object.getOwnPropertyNames(a);for(let g=m.length-1;g>=0;g--){let f=m[g];if(!(f==="__proto__"||f==="constructor")&&!s[f]){l=l||p!==u;let h=Object.getOwnPropertyDescriptor(a,f);s[f]=h.get?{enumerable:!0,configurable:!0,get:h.get.bind(a)}:h}}}if(!l)return t[u];let c={},d=Object.keys(s);for(let p=d.length-1;p>=0;p--){let a=d[p],m=s[a];m.get?Object.defineProperty(c,a,m):c[a]=m.value}return c}var Bi=!1;function Wi(e){let t=xe(e,{lazy:!0}),n=xe(()=>ot(t()),{lazy:!0,sync:!0});return n.toArray=()=>{let r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var Tr={hydrating:!1,registry:void 0,done:!1};var fl,cl,al;var dl;var ue=(...e)=>(cl||xe)(...e),qt=(...e)=>(al||mr)(...e);var Ki=(...e)=>(fl||Jt)(...e),Yi=(...e)=>(dl||hr)(...e);function I(e,t,n,r){return se(()=>e(t||{}))}var ml=e=>`Stale read from <${e}>.`;function Cn(e){let t="fallback"in e?{keyed:e.keyed,fallback:()=>e.fallback}:{keyed:e.keyed},n=ge(),r,i=()=>ne(n,()=>Tn(()=>e.each,e.children,t));return Tr.hydrating&&(r=i()),()=>(r??(r=i()))()}function be(e){let t=e.keyed,n=xe(()=>e.when,void 0),r=t?n:xe(n,{equals:(o,s)=>!o==!s,sync:!0}),i=!1;return xe(()=>{let o=r();if(i=o,o){let s=e.children;return typeof s=="function"&&s.length>0?t?se(()=>s(o),Bi):se(()=>s(()=>{if(!i)throw ml("Show");return n()}),Bi):s}return e.fallback},{sync:!0})}var at=Tr;var Pe=Symbol("slot"),Xi=Symbol("host");var pl={transparent:!0,sync:!0},gl={sync:!0};function le(e,t,n){let r=n?{sync:!0,...n,transparent:!n.scope}:pl;Yi(e,t,r)}function N(e){return ue(()=>e(),gl)}function yl(e,t,n,r){let i=f=>{if(!f)return!1;let h=f[Pe];return f.parentNode===e&&(!h||h===r)},o=n.length,s=t.length,l=o,u=0,c=0,d=t[s-1],p=i(d)?d.nextSibling:r||null,a=null,m,g;for(;u<s||c<l;){if(t[u]===n[c]){u++,c++;continue}for(;s>u&&l>c&&t[s-1]===n[l-1];)s--,l--;if(s===u){let f;if(l<o)if(c&&i(f=n[c-1]))f=f.nextSibling;else{let h=l;for(;h<o&&!i(n[h]);)h++;f=h<o?n[h]:p}else f=p;for(;c<l;){let h=n[c++];e.insertBefore(h,f),r&&(h[Pe]=r)}}else if(l===c)for(;u<s;){let f=t[u++];(!a||!a.has(f))&&i(f)&&f.remove()}else if((m=t[u])===n[l-1]&&n[c]===t[s-1]&&m.parentNode===e&&(!(g=m[Pe])||g===r))if(r)do{let f=t[--s];if(e.insertBefore(f,m),f[Pe]=r,c++,u>=s-1||c>=l)break}while(t[u]===n[l-1]&&n[c]===t[s-1]);else do if(e.insertBefore(t[--s],m),c++,u>=s-1||c>=l)break;while(t[u]===n[l-1]&&n[c]===t[s-1]);else{if(!i(t[u])){u++;continue}if(!a){a=new Map;let h=c;for(;h<l;)a.set(n[h],h++)}let f=a.get(t[u]);if(f!=null)if(c<f&&f<l){let h=u,y=1,R;for(;++h<s&&h<l&&!((R=a.get(t[h]))==null||R!==f+y);)y++;if(y>f-c){let M=t[u];for(;c<f;){let T=n[c++];e.insertBefore(T,M),r&&(T[Pe]=r)}}else{let M=n[c++];e.replaceChild(M,t[u++]),r&&(M[Pe]=r)}}else u++;else t[u++].remove()}}}var Sl="_$$",Ji="_$SOLID_EVENT_OWNER";var Qi={},Rr=new Set,dt=new Map;function io(e,t,n,r={}){let i;El(t);try{Ki(o=>{if(i=o,r.onError&&(ge()[ln]=r.onError),t===document){let s=e();le(()=>ot(s),()=>{})}else{let s=e();E(t,()=>s,t.firstChild?null:void 0,n,{...r.insertOptions,schedule:!0})}},{id:r.renderId}),ve()}catch(o){throw i&&i(),eo(t),o}return()=>{i(),eo(t),t.textContent=""}}function Zi(e,t,n){let r=document.createElement("template");return r.innerHTML=e,n===2?r.content.firstChild.firstChild:r.content.firstChild}function H(e,t){let n;return t===1?i=>document.importNode(n||(n=Zi(e,i,t)),!0):i=>(n||(n=Zi(e,i,t))).cloneNode(!0)}function kn(e){for(let t=0,n=e.length;t<n;t++){let r=e[t];Rr.has(r)||(Rr.add(r),dt.forEach((i,o)=>oo(r,o,i)))}}function El(e){let t=bl(e,e);t&&(t.roots=(t.roots||0)+1)}function eo(e){let t=dt.get(e);t&&(t.roots>1?t.roots--:delete t.roots),Tl(e,e)}function bl(e,t=e){if(!e||!t)return;let n=dt.get(e);return n||dt.set(e,n={owners:new Map,handlers:new Map}),n.owners.set(t,(n.owners.get(t)||0)+1),Rr.forEach(r=>oo(r,e,n)),n}function Tl(e,t=e){let n=dt.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((i,o)=>e.removeEventListener(o,i)),dt.delete(e))}function oo(e,t,n){if(n.handlers.has(e))return;let r=i=>Il(i,t,n);n.handlers.set(e,r),t.addEventListener(e,r)}function _l(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}}function so(e,t,n){if(zt(e))return;let r=e.nodeName;t==="value"&&r==="SELECT"?Ol(e,n):(t==="value"||t==="defaultValue")&&(r==="INPUT"||r==="TEXTAREA")?n==null&&/^(checkbox|radio)$/.test(e.type)?e.removeAttribute("value"):e[t]=n??"":e[t]=n,lo(e,t)}var to=null,wl=[];function Rl(e,t){for(let n=0;n<e.length;n++)e[n](t)}function lo(e,t){to!==null&&e._$claimed&&wl.some(n=>n.includes(t.slice(t.indexOf(":")+1)))&&Rl(to,e)}function D(e,t,n){if(zt(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 i=e.options;for(let o=0;o<i.length;o++)i[o].defaultSelected&&(i[o].selected=!0)}r&&(e._$multiple=!0),lo(e,t)}function Al(e,t){Array.isArray(e)?e.flat(1/0).forEach(n=>n&&n(t)):e(t)}function uo(e,t){let n=se(e);ne(null,()=>Al(n,t))}var Cl={scope:!0},Te=null,Nn=null;function E(e,t,n,r,i){let o=n!==void 0,s=i&&i.host;if(o&&!r&&(r=[]),Te!==null&&(r=Te.claimInitial(e,o,r)),typeof t!="function"&&(t=wr(t,r,o,!0),typeof t!="function")){_r(e,t,r,n),s&&On(t,s);return}if(o&&r.length===0){let c=document.createTextNode("");e.insertBefore(c,n),r=[c]}let l=r,u=!1;le(()=>{Te!==null&&(l=Te.reclaimRegion(l,e,n));let c=wr(t(),l,o,!0),d=u;if(u=!0,typeof c!="function")return c;let p=d&&!(i&&i.schedule)?{...i,schedule:!0}:i;return le(()=>(Te!==null&&(l=Te.reclaimRegion(l,e,n)),wr(c,l,o)),a=>{l=_r(e,a,l,n),s&&On(l,s)},p),Qi},c=>{c!==Qi&&(l=_r(e,c,l,n),s&&On(l,s))},t.$s?i?{...i,scope:!0}:Cl:i)}function zt(e){return!at.hydrating||at.isClaiming&&!at.isClaiming()?!1:!e||e.isConnected?!0:no!==null&&no.claimed(e)}var no=null;function Il(e,t,n){if(Te!==null&&Te.dedupEvent(e))return;let r=e[Ji],i;if(r){if(r===!0||r===t||!t.contains(r))return;i=r}let o=n.owners.size===1&&n.owners.has(t)?t:_l(e.target,n)?.owner;if(!o||o===i)return;e[Ji]=o;let s=i||e.target,l=Sl+e.type,u=e.target,c=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),d=()=>{let a=s[l];if(a&&!s.disabled){let m=s[`${l}Data`];if(m!==void 0?a.call(s,m,e):typeof a=="function"?a.call(s,e):a.handleEvent(e),e.cancelBubble)return}return s.host&&typeof s.host!="string"&&!s.host._$host&&s.contains(e.target)&&c(s.host),!0},p=()=>{for(;s&&d()&&!(s===o||s.parentNode===o);)s=s._$host||s.parentNode||s.host};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return s||o}}),i)i===e.target&&(s=i._$host||i.parentNode||i.host),s&&s!==o&&p();else if(e.composedPath){let a=e.composedPath();if(a.length){c(a[0]);for(let m=0;m<a.length&&(s=a[m],!!d());m++){if(s._$host){s=s._$host,p();break}if(s===o||s.parentNode===o)break}}else p()}else p();c(u)}function _r(e,t,n,r){if(Te!==null&&zt(e)){if(t&&t!==n){let s=Array.isArray(t);for(let l of s?t:[t])if(l&&l.nodeType){if(!zt(l))return n}else if(s&&(typeof l=="string"||typeof l=="number"))return n}return t}if(t===n)return t;if(Te!==null&&at.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 i=typeof t,o=r!==void 0;if(i==="string"||i==="number"){let s=typeof n;s==="string"||s==="number"?e.firstChild.data=t:fo(e,n)?e.textContent=t:(co(e,n),e.insertBefore(document.createTextNode(t),e.firstChild))}else if(t===void 0)In(e,n,r);else if(t.nodeType)Array.isArray(n)?In(e,n,o?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[Pe]=r);else if(Array.isArray(t)){let s=Array.isArray(n);for(let l=0,u=t.length;l<u;l++){let c=t[l],d=typeof c;if(d==="string"||d==="number"){let p=s?n[l]:void 0;p&&p.nodeType===3?(p.data!==""+c&&(p.data=c),t[l]=p):t[l]=document.createTextNode(c)}}t.length===0?In(e,n,r):s?n.length===0?ro(e,t,r):yl(e,n,t,r):(n!=null&&In(e,n),ro(e,t))}return Nn&&Nn(e),t}function vn(e){(e=e.currentTarget||e)._$v=null,e.removeEventListener("change",vn,!0)}function Ol(e,t){let n=e._$v&&e._$v.map;if(t!=null&&t.map?n||e.addEventListener("change",vn,!0):n&&e.removeEventListener("change",vn,!0),t==null)return e._$v=null,queueMicrotask(()=>e.value=t)||(e.value=t);e._$v=t,(Nn||=Nl)(e),queueMicrotask(()=>Nn(e))}function Nl(e){e&&e._$v==null&&(e=e.parentNode);let t=e&&e._$v;if(t!=null)if(t.map){let n=[...e.options];for(let r=0;r<n.length;r++)n[r].selected=t.some(i=>i==n[r].value);t.every(r=>n.some(i=>i.value==r))&&vn(e)}else e.value=t,e.selectedIndex>-1&&e.value==t&&(e._$v=null)}function wr(e,t,n,r){if(e=ot(e,{skipNonRendered:!0,doNotUnwrap:r}),r&&typeof e=="function")return e;if(n&&!Array.isArray(e)&&(e=[e??""]),Te!==null&&at.hydrating&&Array.isArray(e))for(let i=0,o=e.length;i<o;i++){let s=e[i],l=t&&t[i],u=typeof s;(u==="string"||u==="number")&&l&&l.nodeType===3&&zt(l)&&(e[i]=l)}return e}function On(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)On(e[n],t);else e&&e.nodeType&&e[Xi]!==t&&(e[Xi]=t,Object.defineProperty(e,"_$host",{get:t,configurable:!0}))}function ro(e,t,n=null){for(let r=0,i=t.length;r<i;r++){let o=t[r];e.insertBefore(o,n),n&&(o[Pe]=n)}}function fo(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 co(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 In(e,t,n,r){if(n===void 0)return fo(e,t)?e.textContent="":co(e,t);if(t.length){let i=!1;for(let o=t.length-1;o>=0;o--){let s=t[o];if(r!==s){let l=s[Pe],u=s.parentNode===e&&(!l||l===n);r&&!i&&!o?u?e.replaceChild(r,s):e.insertBefore(r,n):u&&s.remove()}else i=!0}}else r&&e.insertBefore(r,n);r&&n&&(r[Pe]=n)}var vl=2147e6,ia=Math.floor(vl/1e3);function xn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Pn(e,t){let n=e?.[t];return typeof n=="string"?n:void 0}function mt(e){return xn(e)?e:null}var kl=H("<span class=settings-row__desc>"),xl=H("<div class=settings-row__control>"),Pl=H("<div class=settings-row><div class=settings-row__text><span class=settings-row__title>"),Fl=H("<span class=settings-status><span class=settings-status__dot></span><span>"),$l=H("<span class=settings-count>"),Hl=H("<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>");function We(e){let t=Wi(()=>e.control);var n=Pl(),r=n.firstChild,i=r.firstChild;return E(i,()=>e.title),E(r,I(be,{get when(){return e.description},get children(){var o=kl();return E(o,()=>e.description),o}}),null),E(n,I(be,{get when(){return N(()=>t()!==void 0&&t()!==null)()?t()!==!1:t()!==void 0&&t()!==null},get children(){var o=xl();return E(o,t),o}}),null),le(()=>e.role,o=>{D(n,"role",o)}),n}function ht(e){var t=Fl(),n=t.firstChild,r=n.nextSibling;return E(r,()=>e.label),le(()=>({e:e.kind==="ok",t:e.kind==="danger"}),({e:i,t:o},s)=>{i!==s?.e&&t.classList.toggle("settings-status--ok",i),o!==s?.t&&t.classList.toggle("settings-status--danger",o)}),t}function ho(e){var t=Hl(),n=t.firstChild,r=n.firstChild,i=r.firstChild,o=i.firstChild,s=o.nextSibling,l=i.nextSibling,u=n.nextSibling;return E(i,()=>e.title,o),E(i,I(be,{get when(){return e.count!==void 0},get children(){return[" ",(()=>{var c=$l();return E(c,()=>e.count),c})()]}}),s),E(l,()=>e.description),E(u,()=>e.children),t}var Ml=H("<textarea class=settings-input maxlength=2000 rows=3>"),Dl=H("<input class=settings-input maxlength=256>"),Ll=H('<div class="settings-row settings-row--stacked"><div class=settings-row__text><label class=settings-row__title></label><!><!></div><div class=settings-row__control>'),po=H("<span class=settings-row__desc>"),Ul=H("<span class=settings-row__desc style=color:var(--danger)>"),Gl=H('<div class=settings-row><div class=settings-row__text></div><div class=settings-row__control><button class="btn primary"></button><button class=btn></button><button class=btn></button><button class=btn>'),Vl=H("<div class=settings-row role=status><div class=settings-row__text><span class=settings-row__desc>"),jl=H("<img style=max-width:80px;max-height:80px;border-radius:50%;object-fit:cover>"),Ar=[["name","username","placeholders.username","usernameHelp","text"],["displayName","displayName","placeholders.displayName","displayNameHelp","text"],["about","bio","bioPlaceholder","bioHelp","textarea"],["picture","avatarUrl","placeholders.avatarUrl","avatarHelp","url"]],Cr=[["banner","bannerUrl","placeholders.bannerUrl","bannerHelp","url"],["website","website","placeholders.website","websiteHelp","url"],["nip05","nip05Identifier","placeholders.nip05","nip05Help","text"],["lud16","lightningAddress","placeholders.lightningAddress","lightningHelp","text"]];function go(e){return function(n){let r=ue(()=>[...Ar,...Cr].some(([o])=>n.state.values[o]!==n.state.original[o])),i=([o,s,l,u,c])=>{let d=ue(()=>e(`channels.nostr.${u}`)),p=ue(()=>n.state.values[o]??""),a=ue(()=>n.state.fieldErrors[o]),m=`nostr-profile-${o}`,g=`${m}-help`,f=`${m}-error`,h=ue(()=>[d()?g:"",a()?f:""].filter(Boolean).join(" ")),R=c==="textarea"?(()=>{var C=Ml();return C._$$input=A=>n.callbacks.onFieldChange(o,A.currentTarget.value),D(C,"id",m),le(()=>({e:p(),t:e(`channels.nostr.${l}`),a:h()||void 0,o:a()?"true":void 0,i:n.state.saving}),({e:A,t:$,a:V,o:he,i:U},z)=>{C.value=A??"",$!==z?.t&&D(C,"placeholder",$),V!==z?.a&&D(C,"aria-describedby",V),he!==z?.o&&D(C,"aria-invalid",he),U!==z?.i&&D(C,"disabled",U)}),C})():(()=>{var C=Dl();return C._$$input=A=>n.callbacks.onFieldChange(o,A.currentTarget.value),D(C,"id",m),D(C,"type",c),le(()=>({e:p(),t:e(`channels.nostr.${l}`),a:h()||void 0,o:a()?"true":void 0,i:n.state.saving}),({e:A,t:$,a:V,o:he,i:U},z)=>{so(C,"value",A),$!==z?.t&&D(C,"placeholder",$),V!==z?.a&&D(C,"aria-describedby",V),he!==z?.o&&D(C,"aria-invalid",he),U!==z?.i&&D(C,"disabled",U)}),C})();var M=Ll(),T=M.firstChild,F=T.firstChild,S=F.nextSibling,w=S.nextSibling,v=T.nextSibling;return D(F,"for",m),E(F,()=>e(`channels.nostr.${s}`)),E(T,(()=>{var C=N(()=>!!d());return()=>C()?(()=>{var A=po();return D(A,"id",g),E(A,d),A})():void 0})(),S),E(T,(()=>{var C=N(()=>!!a());return()=>C()?(()=>{var A=Ul();return D(A,"id",f),E(A,a),A})():void 0})(),w),E(v,R),M};return[I(We,{get title(){return e("channels.nostr.editProfile")},get description(){return[N(()=>e("channels.nostr.account")),": ",N(()=>n.accountId)]}}),N(()=>N(()=>!!n.state.error)()?I(We,{role:"alert",get title(){return I(ht,{kind:"danger",get label(){return e("channels.lastError")}})},get description(){return n.state.error}}):void 0),N(()=>N(()=>!!n.state.success)()?(()=>{var o=Vl(),s=o.firstChild,l=s.firstChild;return E(l,()=>n.state.success),o})():void 0),N(()=>N(()=>!!n.state.values.picture)()?I(We,{get title(){return e("channels.nostr.profilePicturePreview")},get control(){var o=jl();return o.addEventListener("load",s=>{s.currentTarget.style.display="block"}),o.addEventListener("error",s=>{s.currentTarget.style.display="none"}),le(()=>({e:n.state.values.picture,t:e("channels.nostr.profilePicturePreview")}),({e:s,t:l},u)=>{s!==u?.e&&D(o,"src",s),l!==u?.t&&D(o,"alt",l)}),o}}):void 0),N(()=>Ar.map(i)),N(()=>N(()=>!!n.state.showAdvanced)()?[I(We,{get title(){return e("channels.nostr.advanced")}}),N(()=>Cr.map(i))]:void 0),(()=>{var o=Gl(),s=o.firstChild,l=s.nextSibling,u=l.firstChild,c=u.nextSibling,d=c.nextSibling,p=d.nextSibling;return E(s,(()=>{var a=N(()=>!!r());return()=>a()?(()=>{var m=po();return E(m,()=>e("common.unsavedChanges")),m})():void 0})()),u._$$click=()=>n.callbacks.onSave(),E(u,(()=>{var a=N(()=>!!n.state.saving);return()=>a()?e("common.saving"):e("common.saveAndPublish")})()),c._$$click=()=>n.callbacks.onImport(),E(c,(()=>{var a=N(()=>!!n.state.importing);return()=>a()?e("common.importing"):e("common.importFromRelays")})()),d._$$click=()=>n.callbacks.onToggleAdvanced(),E(d,(()=>{var a=N(()=>!!n.state.showAdvanced);return()=>a()?e("common.hideAdvanced"):e("common.showAdvanced")})()),p._$$click=()=>n.callbacks.onCancel(),E(p,()=>e("common.cancel")),le(()=>({e:!n.connected||n.state.saving||!r(),t:!n.connected||n.state.importing||n.state.saving,a:n.state.showAdvanced?"true":"false",o:n.state.saving}),({e:a,t:m,a:g,o:f},h)=>{a!==h?.e&&D(u,"disabled",a),m!==h?.t&&D(c,"disabled",m),g!==h?.a&&D(d,"aria-expanded",g),f!==h?.o&&D(p,"disabled",f)}),o})()]}}function yo(e){let t=Object.fromEntries([...Ar,...Cr].map(([n])=>[n,e?.[n]??""]));return{values:t,original:{...t},saving:!1,importing:!1,error:null,success:null,fieldErrors:{},showAdvanced:!!(e?.banner||e?.website||e?.nip05||e?.lud16)}}kn(["input","click"]);var ql=3e4;function zl(e,t){if(!Array.isArray(e))return{};let n={};for(let r of e){if(typeof r!="string")continue;let[i,...o]=r.split(":");if(!i||o.length===0)continue;let s=i.trim(),l=o.join(":").trim();s&&l&&(n[s]=t(l))}return n}function So(e){return xn(e)&&["name","displayName","about","picture","banner","website","nip05","lud16"].every(t=>e[t]===void 0||e[t]===null||typeof e[t]=="string")}function Eo(e,t,n){let r=e.props,i=null,o=null,s,l=!1;function u(){s?.abort(),s=void 0}function c(a){!l&&i&&(i=a(i),t())}async function d(a){if(l||e.signal.aborted||!r.connected||!r.canAdmin||!i||i.saving||i.importing)return;u();let m=new AbortController;s=m;let g=i,f=()=>!l&&!e.signal.aborted&&s===m,h=a==="save"?"saving":"importing";c(y=>({...y,[h]:!0,error:null,success:null,...a==="save"?{fieldErrors:{}}:{}}));try{let y=o??r.accounts[0]?.accountId??"default";async function R(S,w,v=[]){let C=new AbortController,A=setTimeout(()=>C.abort(new DOMException("Nostr profile request timed out after 30 seconds","TimeoutError")),ql);try{return await e.request({accountId:y,path:["profile",...v],method:S,body:w,signal:AbortSignal.any([m.signal,C.signal])})}finally{clearTimeout(A)}}async function M(){let S=await R("POST",{autoMerge:!0},["import"]);return{...S,data:S.data&&{...S.data,ok:S.data.ok,saved:S.data.saved,imported:So(S.data.imported)?S.data.imported:void 0,merged:So(S.data.merged)?S.data.merged:void 0}}}let T=a==="save"?{action:a,...await R("PUT",g.values)}:{action:a,...await M()};if(!f()||!i)return;let F={...i,[h]:!1,error:null,success:null};if(!T.ok||T.data?.ok===!1||!T.data)i={...F,error:T.errorMessage,...T.action==="save"?{fieldErrors:zl(T.data?.details,e.formatExternalText)}:{}};else if(T.action==="save")i=T.data.persisted?{...F,success:n("channels.nostr.notices.published"),fieldErrors:{},original:{...g.values}}:{...F,error:n("channels.nostr.notices.publishFailed")};else{let S=T.data.merged??T.data.imported??null,w=S?{...i.values,...S}:i.values;i={...F,values:w,success:n(T.data.saved?"channels.nostr.notices.importedFromRelays":"channels.nostr.notices.imported"),showAdvanced:!!(w.banner||w.website||w.nip05||w.lud16)}}t(),!i.error&&(T.action==="save"||T.data?.saved)&&await e.refresh(!0)}catch(y){if(!f())return;c(R=>({...R,[h]:!1,success:null,error:y instanceof DOMException&&y.name==="TimeoutError"?n("channels.nostr.notices.timeout"):n("channels.nostr.notices.operationFailed",{prefix:n(a==="save"?"channels.nostr.notices.updateFailed":"channels.nostr.notices.importFailed"),error:e.formatError(y)})}))}}function p(){l=!0,u(),e.signal.removeEventListener("abort",p)}return e.signal.addEventListener("abort",p,{once:!0}),{read:()=>({snapshot:r,form:i,accountId:o}),update(a){l||((r.connectionEpoch!==a.connectionEpoch||r.connected!==a.connected)&&(u(),i&&(i={...i,saving:!1,importing:!1})),r=a,t())},edit(a,m){l||(u(),o=a,i=yo(m??void 0),t())},cancel(){l||(u(),i=null,o=null,t())},field(a,m){c(g=>({...g,values:{...g.values,[a]:m},fieldErrors:{...g.fieldErrors,[a]:""}}))},toggleAdvanced(){c(a=>({...a,showAdvanced:!a.showAdvanced}))},save:()=>d("save"),import:()=>d("import"),dispose:p}}var bo={common:{cancel:"Cancel",configured:"Configured",hideAdvanced:"Hide Advanced",importFromRelays:"Import from Relays",importing:"Importing\u2026",lastStart:"Last start",na:"n/a",no:"No",publicKey:"Public Key",refresh:"Refresh",running:"Running",saveAndPublish:"Save & Publish",saving:"Saving\u2026",showAdvanced:"Show Advanced",unsavedChanges:"You have unsaved changes",yes:"Yes"},channels:{lastError:"Last error",nostr:{title:"Nostr",subtitle:"Decentralized DMs via Nostr relays (NIP-04).",profile:"Profile",editProfile:"Edit Profile",profilePicture:"Profile picture",noProfile:"No profile set.",noProfileHint:'Click "Edit Profile" to add your name, bio, and avatar.',name:"Name",displayName:"Display Name",about:"About",advanced:"Advanced",profilePicturePreview:"Profile picture preview",account:"Account",username:"Username",usernameHelp:"Short username (e.g., satoshi)",bio:"Bio",bioPlaceholder:"Tell people about yourself...",bioHelp:"A brief bio or description",displayNameHelp:"Your full display name",avatarUrl:"Avatar URL",avatarHelp:"HTTPS URL to your profile picture",bannerUrl:"Banner URL",bannerHelp:"HTTPS URL to a banner image",website:"Website",websiteHelp:"Your personal website",nip05Identifier:"NIP-05 Identifier",nip05Help:"Verifiable identifier (e.g., you@domain.com)",lightningAddress:"Lightning Address",lightningHelp:"Lightning address for tips (LUD-16)",placeholders:{username:"satoshi",displayName:"Satoshi Nakamoto",avatarUrl:"https://example.com/avatar.jpg",bannerUrl:"https://example.com/banner.jpg",website:"https://example.com",nip05:"you@example.com",lightningAddress:"you@getalby.com"},notices:{timeout:"Request timed out after 30 seconds; the server may still have applied the change \u2014 check the profile before retrying.",operationFailed:"{prefix}: {error}",updateFailed:"Profile update failed",publishFailed:"Profile publish failed on all relays.",published:"Profile published to relays.",importFailed:"Profile import failed",importedFromRelays:"Profile imported from relays. Review and publish.",imported:"Profile imported. Review and publish."}}}};var[To,Bl]=qt({});function _o(e){return e==="en"?bo:To()[e]}function Ir(e){if(!(e==="en"||To()[e]))return Wl()}async function Wl(){try{let{default:e}=await import("./chunk-1.js");Bl(e)}catch{}}function wo(e,t){let n=_o(e);for(let r of t.split("."))n=n&&typeof n=="object"?n[r]:void 0;return n}function Fn(e){return(t,n)=>{let r=wo(e(),t)??wo("en",t);return typeof r=="string"?r.replace(/\{(\w+)\}/g,(i,o)=>n?.[o]??`{${o}}`):t}}var Or=H("<dt>"),Ro=H("<dd>"),Kl=H('<div class="settings-row settings-row--actions"><div class=settings-row__control>'),Yl=H("<span class=settings-row__desc>"),Xl=H("<div class=settings-row><div class=settings-row__text><span class=settings-row__title></span><span class=settings-row__desc></span></div><div class=settings-row__control><span class=settings-row__value>"),Jl=H("<div style=display:contents>"),Ql=H("<dl class=settings-kv><!><!>"),Zl=H('<button class="btn btn--sm">'),eu=H("<dd><img style=width:48px;height:48px;border-radius:50%;object-fit:cover>"),tu=H("<button class=btn>"),nu=H("<dl class=settings-kv><!><dt></dt><dd><code></code></dd><dt></dt><dd>"),Ao=["name","displayName","about","nip05"];function Co(e,t,n){let r=Fn(()=>t().snapshot.locale),i=e.formatRelativeTimestamp,o=go(r),s=f=>f===!0?"ok":"muted";function l(f){return[(()=>{var h=Or();return E(h,()=>r(`common.${f.field}`)),h})(),(()=>{var h=Ro();return E(h,I(ht,{get kind(){return s(f.value)},get label(){return r(f.value==null?"common.na":f.value?"common.yes":"common.no")}})),h})()]}function u(f){return I(We,{get title(){return I(ht,{kind:"danger",get label(){return r("channels.lastError")}})},get description(){return e.formatError(f.message)}})}function c(f){var h=Kl(),y=h.firstChild;return E(y,()=>f.children),h}function d(f){var h=Xl(),y=h.firstChild,R=y.firstChild,M=R.nextSibling,T=y.nextSibling,F=T.firstChild;return E(R,()=>f.title),E(M,()=>[f.accountId,...f.facts].join(" \xB7 ")),E(y,I(be,{get when(){return f.lastError},get children(){var S=Yl();return E(S,()=>e.formatExternalText(f.lastError)),S}}),null),E(T,I(ht,jt(()=>f.status)),F),E(F,(()=>{var S=N(()=>!!f.lastInboundAt);return()=>S()?i(f.lastInboundAt):r("common.na")})()),h}function p(){let f;En(()=>e.mountConfig(f));var h=Jl();return uo(()=>y=>{f=y},h),h}function a(f){return f?f.length<=20?f:`${f.slice(0,8)}...${f.slice(-8)}`:r("common.na")}function m(f){let h=()=>f.account,y=()=>Pn(mt(h()),"publicKey"),R=ue(()=>mt(h())?.profile),M=()=>R()?.displayName??R()?.name??h().name??h().accountId;return I(d,{get title(){return M()},get accountId(){return h().accountId},get facts(){return[`${r("common.configured")}: ${h().configured?r("common.yes"):r("common.no")}`,`${r("common.publicKey")}: ${a(y())}`]},get status(){return{kind:s(h().running),label:h().running?r("common.running"):r("common.no")}},get lastInboundAt(){return h().lastInboundAt},get lastError(){return h().lastError}})}function g(){let f=()=>t().snapshot.accounts,h=ue(()=>t().snapshot.status),y=()=>f()[0]?.accountId??"default",R=ue(()=>t().accountId===y()?t().form:null),M=()=>f()[0],T=()=>h()?.configured??M()?.configured??!1,F=()=>h()?.publicKey??Pn(mt(M()),"publicKey"),S=()=>h()?.lastStartAt??M()?.lastStartAt,w=()=>h()?.lastError??M()?.lastError,v=ue(()=>mt(M())?.profile??h()?.profile??null);function C(){let A=()=>v()?.picture||Ao.some($=>v()?.[$]);return[I(We,{get title(){return r("channels.nostr.profile")},get description(){return N(()=>!!A())()?void 0:[N(()=>r("channels.nostr.noProfile"))," ",N(()=>r("channels.nostr.noProfileHint"))]},get control(){return N(()=>!!T())()?(()=>{var $=Zl();return $._$$click=()=>n.edit(y(),v()),E($,()=>r("channels.nostr.editProfile")),$})():void 0}}),I(be,{get when(){return A()},get children(){var $=Ql(),V=$.firstChild,he=V.nextSibling;return E($,I(be,{get when(){return v()?.picture},keyed:!0,children:U=>[(()=>{var z=Or();return E(z,()=>r("channels.nostr.profilePicture")),z})(),(()=>{var z=eu(),pe=z.firstChild;return pe.addEventListener("error",Ke=>{Ke.currentTarget.style.display="none"}),D(pe,"src",U),le(()=>r("channels.nostr.profilePicture"),Ke=>{D(pe,"alt",Ke)}),z})()]}),V),E($,I(Cn,{each:Ao,children:U=>I(be,{get when(){return v()?.[U]},children:z=>[(()=>{var pe=Or();return E(pe,()=>U==="nip05"?"NIP-05":r(`channels.nostr.${U}`)),pe})(),(()=>{var pe=Ro();return E(pe,z),pe})()]})}),he),$}})]}return I(ho,{get title(){return r("channels.nostr.title")},get description(){return r("channels.nostr.subtitle")},get count(){return N(()=>f().length>=2)()?f().length:void 0},get children(){return[N(()=>N(()=>f().length>1)()?I(Cn,{get each(){return f()},keyed:A=>A.accountId,children:A=>I(m,{get account(){return A()}})}):(()=>{var A=nu(),$=A.firstChild,V=$.nextSibling,he=V.nextSibling,U=he.firstChild,z=he.nextSibling,pe=z.nextSibling;return E(A,I(l,{field:"configured",get value(){return T()}}),$),E(A,I(l,{field:"running",get value(){return h()?.running??M()?.running??!1}}),V),E(V,()=>r("common.publicKey")),E(U,()=>a(F())),E(z,()=>r("common.lastStart")),E(pe,(()=>{var Ke=N(()=>!!S());return()=>Ke()?i(S()):r("common.na")})()),le(()=>F()??"",Ke=>{D(U,"title",Ke)}),A})()),N(()=>N(()=>!!w())()?I(u,{get message(){return w()}}):void 0),I(be,{get when(){return R()},get fallback(){return I(C,{})},children:A=>I(o,{get state(){return A()},get connected(){return t().snapshot.connected},get accountId(){return y()},callbacks:{onFieldChange:($,V)=>n.field($,V),onSave:()=>{n.save()},onImport:()=>{n.import()},onCancel:()=>n.cancel(),onToggleAdvanced:()=>n.toggleAdvanced()}})}),I(p,{}),I(c,{get children(){var A=tu();return A._$$click=()=>{e.refresh(!1)},E(A,()=>r("common.refresh")),A}})]}})}return g}kn(["click"]);var Rm="nostr",Am=[{placement:{section:"channels",panel:"detail",channelId:"nostr"},mount(e,t){Ir(t.props.locale);let[n,r]=qt({snapshot:t.props,form:null,accountId:null},{ownedWrite:!0}),i=Eo(t,()=>{let l=i.read();l.snapshot.presented&&r(l)},Fn(()=>i.read().snapshot.locale)),o=Co(t,n,i),s=io(()=>I(o,{}),e);return{update(l){Ir(l.locale),i.update(l)},dispose(){try{i.dispose()}finally{s()}}}}}];export{Rm as pluginId,Am as settingsViews};