UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 70.8 kB
var J=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}},Pe=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 nr(e){return e instanceof Pe?e.cause:e}var C={},Nt={},li=typeof Proxy=="function",Pt={},ui=Symbol("refresh"),Ke=Set;function ir(e){let t=e.De;for(;t;)t.R|=32,ir(t),t=t.pe}var ln;function Ht(e){try{e()}catch(t){ln||=[t],K()}}function un(e){let t=ln;if(ln=void 0,t&&!e)throw t[0]}function He(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)&&He(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||Ue.length)&&K());let i=n?e.T.Ue:e.De;for(n?e.T.Ue=null:e.De=null;i;){let s=i;s.l&=-33,Ae(s,M),Dt(s),i.Ze=i,He(i,!0),i=i.pe}if(n||(e.ye=0),t&&!n&&!(r&32)&&e._parent!==null&&!(e._parent.R&64)){let s=e.Ze,o=e.pe;s!==null?s.pe=o:e._parent.De=o,o!==null&&(o.Ze=s),e.Ze=null}if(ps(e,n),t&&e.Je){let s=e.Je;e.Je=void 0,Ht(s)}}function cn(e,t){let n=e.De;t.Ze=null,t.pe=n,n!==null&&(n.Ze=t),e.De=t}function ps(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--)Ht(n[r]);else Ht(n)}function gs(e,t){let n=e;for(;n.l&4&&n._parent;)n=n._parent;if(n.id!=null)return ms(n.id,t?n.ye++:n.ye);throw new Error("")}function an(e){return gs(e,!0)}function fn(e,t,n){return e?.id??(t?n?.id:n?.id!=null?an(n):void 0)}function ms(e,t){let n=t.toString(36),r=n.length-1;return e+(r?String.fromCharCode(64+r):"")+n}function pe(){return $}function dn(e,t=$){return t&&(t.He?Array.isArray(t.He)?t.He.push(e):t.He=[t.He,e]:t.He=e),e}function ci(e=!0){He(this,e),ln&&!H.q&&un()}function De(e){let t=$,n=e?.transparent??!1,r={id:fn(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||Pt,ye:0,T:null,_parent:t,dispose:ci};return t&&cn(t,r),r}function hn(e,t){let n=De(t);return ce(n,()=>e(ci.bind(n,!0)))}var ur=null,ye=null,hi=null,cr=null,ys=null,gn=null,Ss=null,Es=null,bs=null;var Rs=null,ct=null,_s=null,Cs=null,ar=null;var Ts=null,ws=null;var vs=null,Is=null;var at=null;var pi,fr;var Ye=[];function As(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||Ye.push(n),n}var te=null;function qt(e){te=e}var X=null,Fe=null;function dr(e,t){if(H.q&&!t||X!==null)return Me(e);Fe===null?Fe=be(e):gi(be(e),Fe),K()}function Se(e){return e.T.Re=be(e.T.Re)}function Os(e){return e=be(e),Ye.indexOf(e)!==-1?e:null}function be(e){for(;e.cn!==null;)e=e.cn;return e}function Me(e){let t=X;t===null?X=e===null?As(!1):be(e):e!==null&&gi(be(e),t),H.q||K()}function gi(e,t){e=be(e),t=be(t),!(e===t||e.v||t.v)&&(e.cn=t,t.tt+=e.tt,t.nt||=e.nt,st(t.tn,e.tn),st(t.un[0],e.un[0]),st(t.un[1],e.un[1]),st(t.En,e.En),e.I!==null&&st(t.I??=[],e.I),Ye.splice(Ye.indexOf(e),1))}function xs(e){let t=Ft;Ft??=e;let n=e.tt!==0||Ns(e.tn,e)||!!bs?.(e);return Ft=t,n}var Ft=null;function ks(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||be(i)===t)return!0}return!1}function Ns(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&&Se(i)!==t||n&&!ks(i,t))){if(i.i===1){if(ai(i,Ft??t))return!0;continue}for(let s=i.o;s!==null;s=s.t){let o=s.u;if((o.i===1&&o.m&1||o.R&2048||o.l&16384&&o.m===1)&&(s.Te===o.Ne||o.T?.F!=null)&&!(o.R&64)&&ai(o,Ft??t))return!0}}}return!1}function ai(e,t){return!(e.R&32&&Ps(e,t))&&!_s?.(e)}function Ps(e,t){let n=e;for(;n?.R&32;)n=n._parent;return n?.l&256&&n.T?.Re!=null&&Se(n)===be(t)}var Ut=[];function mi(e){Ut.push(e)}var pn=[];function yi(e){Ae(e,M),e.R&=-4,pn.push(e)}function Bt(e,t){e.l|=256,Hs(e,t)}function Hs(e,t){let n=Y(e);n.Re!==t&&(n.Re=t,t.tn.push(e))}function Si(e,t){for(let n=e.De;n!==null;n=n.pe)n.T?.Re?.v||(n.X!==void 0&&(n.l&256||Bt(n,t),n.l|=1048576),Si(n,t))}var M={$e:new Array(2e3).fill(void 0),p:!1,Ge:0,et:0},Q=0,mn=!1,yn=!1,fi=!1,or=0;var $s=0;var Ei=0;var bi=2147483647;function K(){if(yn){Ds();return}mn||(mn=!0,!or&&!H.q&&queueMicrotask(Ge))}var _n=Symbol.for("solid-js/root-error-hook");function Ri(e){if(yn)return;yn=!0,un(!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 Ds(){fi||(fi=!0,console.error("[REACTIVITY_HALTED]"))}var Re=class e{un=[[],[]];q=!1;flush(){if(!this.q){this.q=!0,vi(),te=null,Fe=null;try{Ti(),sr(M,e._e),this.settle(),Q++,mn=M.et>=M.Ge||Ue.length!==0,this.run(1),this.run(2)}finally{this.q=!1,Fe=null}}}settle(){Ss?.()&&sr(M,e._e);let t=X;X=null,ys?.(t);let n=t!==null&&!t.v?be(t):null;if(n!==null){let l=Ue.length;for(let c=0;c<l;c++){let a=Ue[c];if(!(a.l&2304)&&(a.T===null||a.T.Re===null||!a.T.Re.v)){if(a.ue===C&&a.m&4&&a.i!==1)continue;if(a.ue!==C&&!(a.m&5)&&a.T?.Ue==null&&a.T?.me==null&&vn(a,a.Ie,a.ue)){a.ue=C,a.l&=-129;continue}Bt(a,n)}a.l&128&&Si(a,n)}Ue.length=0,Ts?.(n);let u=pn.splice(0);if(at){u.sort((c,a)=>c.Fe-a.Fe);for(let c=0;c<u.length;c++)(u[c].R&96)===32&&u[c].l&32768&&_e(u[c])}}else{Ms();for(let l=0;l<Ut.length;l++){let u=Ut[l];u.T?.F==null&&!u.Ae&&Be(u)}}Ut.length&&(Ut.length=0);let r=this.un,i=this.un=[[],[]];gn&&(gn(n!==null?Lt:null),Lt.length&&(Lt.length=0)),this.un=[[],[]];for(let l=Ye.length-1;l>=0;l--){let u=Ye[l];xs(u)||(Ye.splice(l,1),Es?.(u),Fs(u),l=Ye.length)}ws?.();let s=n&&Os(n);Is?.(s);let o=s!==null;for(let l=0;l<2;l++)o&&st(s.un[l],r[l]),this.un[l]=o||i[l].length||this.un[l].length?i[l].concat(o?[]:r[l],this.un[l]):r[l];if(pn.length!==0){let l=pn.splice(0).sort((u,c)=>u.Fe-c.Fe);for(let u=0;u<l.length;u++)l[u].R&64||_e(l[u])}Cs?.()}run(t){let n=this.un[t-1];n.length&&(this.un[t-1]=[],Gs(n,t))}enqueue(t,n,r=te){t&&(r!==null?r:this).un[t-1].push(n),K()}notify(t,n,r,i){return Rs?.(t,r&n,i)?!0:n&1?(r&1&&te===null&&Me(null),!0):!1}};function Us(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);Ce(r)}}return e.En.length=0,t}function Fs(e){let t=Us(e);e.I!==null&&vs(e.I);for(let n=0;n<e.tn.length;n++){let r=e.tn[n];r.T.Re===null||Se(r)!==e||(r.T.Re=null,Ci(r))}X===e&&(X=null),t?H.un[1].push(()=>di(e)):di(e)}function di(e){for(let t=0;t<2;t++)st(H.un[t],e.un[t]),e.un[t]=[]}function st(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}var Ue=[],Lt=[];function Cn(e,t){e.R&2048||(e.R|=2048,t.En.push(e))}function Wt(e){Ue.push(e),H.q||wi()}var Tn=0;function wn(){Tn++}function hr(e){e.Me=Tn;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}Ce(i)}}function _i(e,t){for(let n=e.o;n!==null;n=n.t){let r=n.u.T?.Re;(r?.v?Ls(r,t):n.u.i)&&(n.u.R|=65536)}}function Ls(e,t){return e===t||e.en!==null&&e.en===t.en}function Ci(e){let t=e;if(!t.X){e.l&=-385,e.ue!==C&&(e.Ie=e.ue,e.ue=C);return}let n=e.ue===C&&(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=C,e.ie=Q+1,Qe(t,2,i)}else e.ue!==C&&(e.Ie=e.ue,e.ue=C,t.m&=-5,t.T!=null&&(t.T.Ve=!1,t.T.je=C),e.i&&e.i!==3&&(e.Ae=!0,H.enqueue(e.i,e.W??=Re.K.bind(null,t))));t.ce=!1,t.R&=-1025,t.T?.F==null&&Be(t),t.m&1||(t.m&=-5),!n&&t.T!=null&&(t.T.Ue!==null||t.T.me!==null)&&Re.Ce(t,!1,!0)}function Ms(){for(let e=0;e<Ue.length;e++){let t=Ue[e];t.l&2304||Ci(t)}Ue.length=0}var H=new Re;function Ge(e){if($s>0)return e?e():void 0;if(e){or++;try{return e()}finally{try{Ge()}finally{or--}}}if(!H.q&&!yn){for(;mn;)H.flush();un()}}function Gs(e,t){for(let n=0;n<e.length;n++)e[n](t)}function Ce(e){M.Ge>e.Fe&&(M.Ge=e.Fe),pr(e,M)}function Ii(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 s=i.We;s.be=e,e.We=s,i.We=e}r>t.et&&(t.et=r)}function pr(e,t){let n=e.R;n&12||(n&1?e.R=n&-4|2|8:(e.R=n|8,t.p&&zt(e)),n&16||Ii(e,t))}function gr(e,t){let n=e.R;n&28||(e.R=n|16,Ii(e,t))}function Ae(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,s=t.$e[r],o=i??s;e===s?t.$e[r]=i:e.We.be=i,o.We=e.We}e.We=e,e.be=void 0}function Ai(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&&zt(n)}}function zt(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)zt(r.u,1)}}function sr(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):Vs(n,e),n=e.$e[e.Ge]}e.et=0}function Vs(e,t){Ae(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)gr(r.u,t)}}var js;function xi(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?js(t):t.T?.we&&Ht(t.T.we);let s=t;s.X&&s.l&32&&!(s.R&32)&&!(s.m&1)&&(Qt?Qt.push(s):Ct(s))}return n}function Be(e){let t=e._,n=t!==null?t.G:e.C;if(n!==null){do n=xi(n);while(n!==null);t!==null?t.G=null:e.C=null}}function Dt(e){let t=e.C;if(t){do t=xi(t);while(t!==null);e.C=null,e._=null}}var Qt=null,mr=e=>Qt=e;function Ct(e){Ae(e,M),Dt(e),He(e,!0)}var Xt=new Ke;function Ti(){if(Xt.size!==0){for(let e of Xt)!e.o&&e.l&32&&!(e.m&1)&&!(e.R&96)&&Ct(e);Xt.clear()}}function In(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 s=e.ve;if(s!==null&&s.u===t&&(!i||s.Te===t.Ne))return;let o=t._=e.ve={S:e,u:t,G:r,Xe:s,t:null,Te:t.Ne};n!==null?n.G=o:t.C=o,s!==null?s.t=o:e.o=o,wn()}function Pi(e,t){return e.T?.fe?.has(t)?!1:((Y(e).fe??=new Ke).add(t),!0)}function ki(e,t){let n=e.T?.fe;return n?.delete(t)?(n.size||(e.T.fe=void 0),!0):!1}function Sr(e){e.T!==null&&(e.T.fe=void 0)}function qs(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 Er(e,t){Y(e).se=!0,t.source&&Pi(e,t.source),e.m&2||ft(e,t.source,t)}function ft(e,t,n){if(!t){e.T!==null&&(e.T.F=null);return}if(n instanceof J&&n.source===t){Y(e).F=n;return}let r=e.T?.F;(!(r instanceof J)||r.source!==t)&&(Y(e).F=new J(t))}function dt(e,t){for(let n=e.o;n!==null;n=n.t)t(n.u,n)}function An(e){e.X&&e.l&32&&!e.o&&!(e.R&32)&&!(e.m&1)&&Ct(e)}function Bs(e){let t,n=new Ke,r=i=>{n.has(i)||(n.add(i),!i.o&&i.l&32&&(t??=[]).push(i),dt(i,r))};if(dt(e,r),t)for(let i of t)An(i)}function br(e,t,n){return!(e.l&256||n&&e.R&16384&&H.q&&!e.fam)||te?!1:(Sr(e),e.T&&(e.T.se=!1),(e.m&=6)&2||ft(e),e.ue=t instanceof Pe?t:new Pe(e,t),e.l|=2097280,et(e),K(),!0)}function Hi(e,t){let n=!1,r=new Ke,i=s=>{r.has(s)||(r.add(s),s.T?.F===t&&(Ce(s),n=!0),dt(s,i))};dt(e,i),n&&K()}function et(e,t=e){ki(e,t);let n=!1,r,i=new Ke,s=o=>{if(i.has(o)||t!==e&&qs(o,t)||!ki(o,t))return o.l&32768&&Ce(o);i.add(o),o.ie=Q;let l=o.T?.fe?.values().next().value,u=o.m&2;l?u||ft(o,l):(o.m&=-2,u||ft(o),o.l&256&&Me(Se(o)),o.T?.se&&(Ce(o),n=!0),o.T!==null&&(o.T.se=!1),!o.o&&o.l&32&&(r??=[]).push(o)),dt(o,s)};if(dt(e,s),r)for(let o of r)An(o);n&&K()}function yr(e){return e!=null&&typeof e=="object"&&typeof e.then=="function"}function $i(e){let t=e.T?.ae;t!=null&&(e.T.ae=null,t())}function Di(e,t,n,r){let i=!1,s=!1;if(typeof t=="object"&&t!==null&&B(()=>{i=t[Symbol.asyncIterator],s=!i&&yr(t)}),!s&&!i)return e.T!==null&&(e.T.Se=null),e.ce=!1,t;Y(e).Se=t,e.T.Ee=Ei||bi,e.T.fe=void 0;let o,l=p=>{if(e.T?.Se!==t)return;let g=p instanceof J;if(g&&e.ce){e.T!==null&&(e.T.Se=null),Er(e,p),e.ie=Q;return}(g||n||!br(e,p))&&(Qe(e,g?1:2,p),g||He(e,!1,!0)),g&&et(e),e.ie=Q,g||Bs(e),r?.(p,g)},u=(p,g)=>{if(e.T?.Se!==t||e.R&2)return;let f=e.m&4;if(Ni(e),n){try{n(p)}catch(y){l(y);return}e.l&256||(e.T.de=void 0),f&&Ni(e,!0)}else xe(e,()=>p);e.ue===C&&(e.ce=!1,Be(e)),et(e),K(),Ge(),g?.()},c=()=>e.l&32&&!e.o&&!(e.m&1)?(Ct(e),!0):!1,a=(p,g)=>{let f=p[Symbol.asyncIterator](),y=!1,b=!1,v=!g,F=()=>{if(!b){b=!0;try{let R=f.return?.();yr(R)&&R.then(void 0,()=>{})}catch{}}};dn(F,g),Y(e).ae=F;let O=()=>{try{c()||j()}catch(R){l(R)}},j=()=>{let R,D,q=!1,se=!1,Ie=!0,ue=f.next();if((yr(ue)?ue:{then:he=>{he(ue)}}).then(he=>{if(Ie&&v)R=he,q=!0,he.done&&(b=!0);else{if(e.T?.Se!==t)return;he.done?(b=!0,y?(K(),Ge()):u(void 0),c()):(y=!0,u(he.value,O))}},he=>{Ie&&v?(D=he,se=!0):e.T?.Se===t&&(b=!0,l(he),c())}),Ie=!1,se){if(b=!0,l(D),v)throw D;return!0}return q&&!R.done?(o=R.value,y=!0,j()):q&&R.done},T=j();return v=!1,y||T},d=null,m=(p,g)=>{let f=!1;if(typeof p=="object"&&p!==null&&B(()=>{f=p[Symbol.asyncIterator]}),!f)return!1;o=void 0;let y=a(p,g);return g||(d=y),!0};if(s){let p=!1,g=!1,f,y=!0;if(t.then(b=>{if(y)o=b,p=!0;else{try{if(e.T?.Se===t&&!(e.R&64)&&m(b,e))return;u(b)}catch(v){l(v)}c()}},b=>{y?(f=b,g=!0):(l(b),c())}),y=!1,g)throw l(f),f;p?m(o)||(e.ce=!1):d=!1}if(i&&m(t),d!==null){if(!d){if(e.ce)return e.Ie;throw new J($)}e.ce=!1}return o}function Rr(e,t=!1){e.T?.fe&&Sr(e),e.T?.se&&(e.T.se=!1),e.m=t?0:e.m&4,e.T?.F&&ft(e);let n=_r(e);n&&n.call(e)}function Ni(e,t=!1){let n=e.T?.fe;n&&(n.delete(e),n.size)?(e.T.se=!1,t&&(e.m=1),ft(e,n.values().next().value)):Rr(e,t)}function Qe(e,t,n){t===2&&!(n instanceof Pe)&&!(n instanceof J)&&(n=new Pe(e,n));let r=t===1&&n instanceof J?n.source:void 0;if(t===1&&r?(e.m&2&&(e.T.de=e.T.F),Pi(e,r),e.m=1|e.m&4,ft(e,r,n)):(Sr(e),e.m=t|(t!==2?e.m&4:0),Y(e).F=n),t===1&&e.l&8192){te===null&&Me(null);return}let i=_r(e);if(i){i.call(e);return}Ws(e,t,n)}function Ws(e,t,n){let r=t===1&&n instanceof J?n.source:void 0;dt(e,(i,s)=>{if(i.ie=Q,i.l&49152||t===1&&s.Te!==i.Ne){Ce(i),K();return}if(t===1&&r&&i.T?.fe?.has(r)){te===null&&(i.l&2304)===256&&H.q&&!ct?.(i,r.ie===Q)&&Me(Se(i));return}(t===1&&r||t!==1&&(i.T?.F!==n||i.T?.fe))&&(ye&&te!==null?ye(i,te,!0,e):(Wt(i),t===1&&(i.l&2304)===256&&!i.i&&Me(Se(i))),Qe(i,t,n))})}Re._e=e=>{e.i===3?(Ae(e,M),e.Ae=!0,H.enqueue(2,e.M)):e.R&32&&!(e.R&65536)?yi(e):ye&&e.R&32&&Qs(e)?(Ae(e,M),e.R&=-65540):_e(e)};function Qs(e){let t=e._parent;for(;t.R&32;)t=t._parent;return(t.l&10240)===2048||t.i&&t.T?.Re?.v}Re.Ce=He;var ge=!1,$=null,ht=!1,Cr,Ar=null;function Wi(e){for(;e;){if(e.Oe)return!0;e=e._parent}return!1}function _e(e,t=!1){wn();let n=e.i,r,i=te,s=Cr,o=ye&&(Cr=t&&(i||s));if(qt(ye?(e.R&65536||(e.l&10240)===2048)&&e.T?.Re?.v?e.T.Re:t&&i?._parent.he!=i&&Mi($)?.R&4?i:null:null),!t){if(Ae(e,M),e.T!==null&&(e.T.Se=null,$i(e)),e.m&1&&(e.l&=-32769),e.l&256){let T=Se(e);T.v||e.l&524288||(n!==1&&!(e.l&32768)?dr(T,ct?.(e,e.m&4)):T!==X&&!(e.m&4||e.l&1048576)&&(e.ue=C,n===1&&(e.l&=-257)))}if(n===3||e.l&128){let T=Qt;mr(r=[]),He(e),mr(T)}else(e.De!==null||e.He!==null)&&Zs(e);e.l&2097152&&(e.ue=C,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),m=!1,p=(e.R&8192)!==0&&!(e.m&1&&e.T!==null&&!e.T.Ve),g=$;$=e,e._=null,e.Ne++,e.R=4|e.R&8224,e.ie=Q;let f=e.ue!==C?e.ue:e.l&2048&&e.T.v!==C?e.T.v:e.Ie,y=e.Fe,b=!1,v=!1,F=ge;ge=!0;try{if(e.l&64)f=e.X(f),e.T!==null&&(e.T.Se=null),e.ce=!1;else{let T=e.T?.Se,R=e.X(f),D=typeof R=="object"&&R!==null,q=e.T?.Se!==T;f=q||!D?R:Di(e,R),!q&&!D&&(e.T!==null&&(e.T.Se=null),e.ce=!1)}(e.m!==0||e.T!==null)&&Rr(e,t)}catch(T){let R=T instanceof J;if(R&&e.ce)Er(e,T);else if((R||!(m=br(e,T,!0)))&&(R&&(Y(e).se=!0),Qe(e,R?1:2,T),R&&d&&!e.T?.Se&&et(e)),(R||m)&&a)for(let D of a)D!==e&&!e.T?.fe?.has(D)&&et(e,D)}finally{if(ge=F,ye&&(Cr=s),b=(e.R&4096)!==0,v=!!(e.R&(o&&(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),$=g,r)for(let T of r)An(T);e.T!==null&&(e.T.Ve=p&&(e.m&1)!==0)}if(e.R&64){Dt(e),e.T!==null&&(e.T.Se=null),qt(i);return}let O=ye?te:null,j=!!e.T?.F||m;if(ye&&O!==null&&(ye(e,O,t,j)?qt(O):O=null),!j){let T=e.ue!==C?e.ue:e.l&2048&&e.T.v!==C?e.T.v:e.Ie,R=!n&&l||!!e.T?.de||!vn(e,T,f);if(n&&R&&!(e.R&262144&&!e.Ae&&Object.is(e.ge,f))&&e.ue===C&&(e.Ae=!e.T?.F,(!t||O!==null)&&H.enqueue(n,e.W??=Re.K.bind(null,e),O)),!(!t&&O===null&&e.l&8192&&hi(e,f,j))){if(!j){if(R)O!==null?n&&e.ue===C?e.Ie=f:n||O.ke?e.ue=f:e.T.v=f:(t?!((X!==null||Fe!==null)&&(v||Mi(g)?.R&128)):n&&e.ue===C)?e.Ie=f:(e.ue=f,t&&(Bt(e,X??Fe),e.m|=4,ct?.(e,!o&&X))),e.o!==null&&(hr(e),O!==null&&_i(e,O));else if(e.Fe!=y)for(let D=e.o;D!==null;D=D.t)gr(D.u,M)}}if(!R&&!e.T?.F&&(u!==void 0&&Hi(e,u),a))for(let D of a)D!==e&&et(e,D);d&&!(e.m&5)&&et(e)}if(t&&O===null&&v&&e.m&1){let T=X??Fe;T&&!T.v&&ct?.(e)!==2&&Bt(e,T)}!e.T?.F&&e.ue===C&&!(n&&e.Ae)&&(t||n===3?Be(e):mi(e)),(e.ue!==C||e.T!==null&&(e.T.Ue!==null||e.T.me!==null)||(e.m&5)!==0&&(!t||(e.m&1)!==0))&&(e.l|=128,O===null&&Wt(e)),qt(i),b&&(Ce(e),K())}function wr(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&&wr(n),e.R&2)break}(e.R&2||e.T?.F&&e.ie<Q&&!e.T?.Se)&&_e(e),e.R=e.R&937336}}function pt(e,t){let n=t?.transparent??!1,r=t!==null&&typeof t=="object"&&"loadingValue"in t,i={id:fn(t,n,$),l:(n?4:0)|(t?.ownedWrite?1:0)|(!$||t?.lazy?32:0)|(t?.sync?64:0)|(t?.le?2:0)|(t?.Le??0)|(ht&&Wi($)?8:0),xe:t?.equals??en,He:null,A:$?.A??Pt,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:$,pe:null,Ze:null,De:null,R:t?.lazy?512:0,m:r?0:4,ie:Q,ue:C,Me:-1,ce:r,T:null};return t?.unobserved&&(Y(i).we=t.unobserved),Qi(i,t),i}function Y(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:C,Be:-1,Ee:0,v:C,I:0,de:void 0}}function Fi(e,t){e.R|=128,(t.m&4||e.i!==1)&&dr(Se(t),!e.i&&e.m&4||ct?.(e))}function Li(e,t){let n=at&&e.l&32768,r=ye&&te!==null;if((!r||e.m&4&&t.m&1)&&!n&&(e.i!==1||t.l&1024))return!1;let i=Se(t);return i===X&&!r&&!n||Ki(e,i)?!1:(Cn(e,i),!0)}function Ki(e,t){return(e.m&4||e.l&1048576)&&e.l&256&&Se(e)===t}function Mi(e){return e!==null&&e.Qe?e.Ye:e}function Zs(e){ir(e);let t=Y(e);t.me=e.He,t.Ue=e.De,e.He=null,e.De=null,e.ye=0}function Yi(e,t,n,r,i){let s=i?.transparent??!1,o={id:fn(i,s,$),l:(s?4:0)|(i?.ownedWrite?1:0)|(i?.sync?64:0)|(i?.Le??0)|(ht&&Wi($)?8:0),xe:!1,He:null,A:$?.A??Pt,ye:0,X:e,Ie:void 0,Fe:0,be:void 0,We:null,C:null,_:null,Ne:0,o:null,ve:null,_parent:$,pe:null,Ze:null,De:null,R:512,m:4,ie:Q,ue:C,Me:-1,ce:!1,Ae:!1,ge:void 0,Ke:t,qe:n,Je:void 0,i:r,T:null};return i?.unobserved&&(Y(o).we=i.unobserved),Qi(o,Js),o}var zi=null;function Xi(e){zi=e}function _r(e){return e.i?zi:null}var Js={lazy:!0};function Qi(e,t){e.We=e;let n=$?.Qe?$.Ye:$;$&&cn($,e),n&&(e.Fe=n.Fe+1),pi?.(e),!t?.lazy&&_e(e,!0),ht&&!t?.lazy&&!(e.m&1)&&!(e.l&2)&&(Y(e).Pe=e.Ie===void 0?Nt:e.Ie,e.l|=512,Ar.add(e))}function gt(e,t){let n={xe:t?.equals??en,l:(t?.ownedWrite?1:0)|(t?.le?2:0),Ie:e,o:null,ve:null,ie:Q,ue:C,Me:-1,T:null};return t?.unobserved&&(Y(n).we=t.unobserved),ht&&!(n.l&2)&&(Y(n).Pe=e===void 0?Nt:e,n.l|=512,Ar.add(n)),n}function en(e,t){return e===t}var Gi=null;function B(e,t){let n=ge;ge=!1;try{return fr?fr(e):e()}finally{ge=n}}var Zi=!1;function el(e,t){if(e.R&512)e.R&=-513,_e(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||cn(n,e)}_e(e,!0)}}function tl(e,t){return!t||e.ue===C||t.l&16}var tn=!1;function wi(){tn=!0}function nl(e){return H.q||e.ue===C||e.l&4194304?C:e.l&256?e.T.Be===Q?e.T.je:C:e.Ie}function rl(e){let t=e.T;t.Be!==Q&&(t.je=e.ue,t.Be=Q,tn=!0)}var On=[];function il(e){return e.R|=4096,!0}function vi(){if(tn=!1,On.length!==0){for(let e of On)e.l&=-4194305;On.length=0}}function ol(e,t){e.Fe>=M.Ge?(zt(t),Ai(M),wr(e)):t.l&65536&&wr(e);let n=e.Fe;n>=t.Fe&&e._parent!==t&&(t.Fe=n+1)}function Or(e){let t=$;t?.Qe&&(t=t.Ye);let n=e,r=e;if(typeof n.X=="function"&&el(e),Gi!==null)return Gi(e,t);if(!n.X&&e.T?.Pe===void 0&&!ht&&(!tn||e.ue===C)&&!(e.l&2048)){if(t&&(ge&&In(e,t),e.l&256&&!(t.l&16))){if(Li(t,e))return e.Ie;Fi(t,e)}return!t||e.ue===C||t.l&16||(at&&t.l&32768||ye&&te?.folded)&&eo(t)?e.Ie:(Ji(t),e.ue)}let i=!1;if(t&&(ge&&(In(e,t),r.X&&(ol(r,t),t.i||(t.R|=r.l&32768))),e.l&256&&!(e.l&2048)&&!(t.l&16)&&(r.m&4||!Li(t,e)?Fi(t,e):i=!0)),ur&&e.l&2048){let o=ur(t,e);if(o!==C)return o}if(r.m&1&&!i&&!(e.l&2048)&&!(r.m&4)&&(ye&&te!==null&&!(t?.m&4)?i=!0:at&&t!==null&&t.l&32768&&(i=at(t,r))),r.m&1&&!i){if(t){if(!(t.l&16)||r.m&4)throw!ge&&!Zi&&e!==t&&In(e,t),r.T?.F}else if(r.m&4)throw r.T?.F}if(r.X&&r.m&2){if(ge&&r.ie<Q)return _e(r),Or(e);throw r.T?.F}if(ht&&t&&t.l&8){let o=e.T?.Pe;if(o!==void 0){let l=o===Nt?void 0:o;return(e.ue!==C?e.ue:e.Ie)!==l&&(t.R|=256),l}}if(i)return e.Ie;if(!t&&e.T?.de)throw e.T.de;let s=sl(e,t);return!t&&typeof n.X=="function"&&e.l&32&&!(r.m&1)&&!e.o&&(Xt.add(e),K()),s}function sl(e,t){if(e.ue!==C&&e.m&4&&(!t||Zi||t.l&16))throw new J(null);let n=t&&tn?nl(e):C;if(n!==C)return il(t),n;if(tl(e,t)||at&&t.l&32768&&!(e.m&4)&&eo(t))return e.Ie;if(Ji(t,e),e.l&2097152)throw e.ue;return e.ue}function Ji(e,t){t?.m&4||(e.R|=16384,gn&&te!==null&&Lt.push(e))}function eo(e){return X===null||Ki(e,X)?!1:(Cn(e,X),!0)}function ll(e){H.q||e.l&4194304||(e.l|=4194304,On.push(e))}function ul(e,t){e.l&2||e.X!==void 0||e.T?.Pe!==void 0||(Y(e).Pe=t===void 0?Nt:t,e.l|=512,Ar.add(e))}var Vi=null;function vn(e,t,n){if(e.xe===en)return t===n;try{return e.xe&&e.xe(t,n)}catch(r){if(!(r instanceof J))return Qe(e,2,r),!0}}function xe(e,t){Vi!==null&&Vi(e);let n=e.ue===C?e.Ie:e.ue;if(typeof t=="function"&&(t=t(n)),cr&&e.l&2048)return cr(e,t);if(e.l&256&&Me(Se(e)),!(!!(e.m&4)||!!e.T?.de||!vn(e,n,t)))return t;ht&&ul(e,n);let i=e.ue!==C;return i?e.l&256&&!H.q&&rl(e):Wt(e),e.ue=t,$!==null&&ll(e),e.X!==void 0&&(e.ie=Q),i&&e.Me===Tn||(hr(e),K()),t}function to(e,t){let n=e.l&256&&!(e.R&1024)&&Se(e)!==X;if(n&&typeof t=="function"){let r=t(e.Ie);t=()=>r}return e.m&2&&(e.T.de=e.T.F,Qe(e,0,void 0)),t=xe(e,t),e.l&=-2097153,n?(e.R=e.R&-2|2,pr(e,M),K()):e.ue!==C&&(e.R|=1024),t}function ce(e,t){let n=$,r=ge;$=e,ge=!1;try{return t()}finally{$=n,ge=r}}function no(e,t=!0){return e()}var xr=null;function ro(e,t,n,r){let i=!!r?.user,s=Yi(e,t,n,i?2:1,r);_e(s,!0),!r?.defer&&s.ue===C&&!s.T?.Re?.v&&(s.i===2||r?.schedule?H.enqueue(s.i,Nn.bind(null,s)):Nn(s,s.i))}function cl(){let e=this.m,t=this.T?.F;if(e&2){if(H.notify(this,1,0),this.i===2){this.m&2&&(this.Ae=!0,H.enqueue(this.i,this.W??=Nn.bind(null,this)));return}kr(this,nr(t),t,this)}else this.i===1&&H.notify(this,3,e,t)}function kr(e,t,n=t,r=e){if(!H.notify(e,2,2))throw Ri(t),n}function Nn(e,t){if(!e.Ae||e.R&64||ar?.(e))return;if(e.m&2&&e.i===2){let i=nr(e.T?.F);e.ge=e.Ie,e.Ae=!1;try{e.qe?e.qe(i,()=>{let s=e.Je;e.Je=void 0,s?.()}):console.error(i)}catch(s){kr(e,s)}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){Y(e).F=new Pe(e,i),e.m|=2,kr(e,i)}finally{e.ge=e.Ie,e.Ae=!1,n&&Be(e)}}Re.K=Nn;function io(e,t){let n=()=>{!r.Ae||r.R&64||ar?.(r)||(r.Ae=!1,_e(r))},r=pt(()=>{let i=r.Je;r.Je=void 0,i?.();let s=no(e);r.Je=s},{...t,lazy:!0});r.Je=void 0,r.l=r.l&-33|16,r.Ae=!0,r.i=3,r.M=n,Ce(r),K()}Xi(cl);var Pn=Symbol(0),nn=Symbol(0),ae=Symbol(0),mt=Symbol(0);var ha=Object.prototype;function Nr(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Hn(e){return dn(e)}function We(e){let t=Or.bind(null,e);return t[ui]=e,t}function Pr(e,t){if(typeof e=="function"){let r=pt(e,t);return r.l&=-33,[We(r),to.bind(null,r)]}let n=gt(e,t);return xr!==null&&xr(n),[We(n),xe.bind(null,n)]}function wt(e,t){return We(pt(e,t))}function Hr(e,t,n){ro(e,t,void 0,n)}function yt(e){let t=pe();t&&!(t.l&16)?io(()=>B(e),void 0):H.enqueue(2,function n(){if(M.et>=M.Ge)return H.enqueue(2,n);e()})}function Dn(e,t,n){let r=typeof n?.keyed=="function"?n.keyed:void 0,i=t.length>1,s=t,o={L:De(),it:0,st:e,ot:[],ft:s,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=pt(pl.bind(o),void 0);return l.l&=-33,We(l)}var $n={ownedWrite:!0};function al(e,t,n,r){let i=e.ot,s=e.it-1,o=[],l=[],u=[],c=256,a=r,d=r,m=!1;for(;a<=s&&d<=n-1;){let p=i[a],g=t[d];if(p===g){m||(u.push(a,d,0),m=!0),u[u.length-1]++,a++,d++;continue}m=!1;let f=-1,y=Math.min(32-o.length,s-a,c);for(let v=1;v<=y;v++)if(i[a+v]===g){f=v;break}c-=f===-1?y:f;let b=-1;y=Math.min(32-l.length,n-1-d,c);for(let v=1;v<=y;v++)if(t[d+v]===p){b=v;break}if(c-=b===-1?y:b,f!==-1&&(b===-1||f<=b)){for(;f-- >0;)o.push(a++);continue}if(b!==-1){for(;b-- >0;)l.push(d++);continue}if(c<=0||o.length===32||l.length===32)return!1;o.push(a++),l.push(d++)}for(;a<=s;a++){if(o.length===32)return!1;o.push(a)}for(;d<=n-1;d++){if(l.length===32)return!1;l.push(d)}return fl(e,t,n,o,l,u)}function fl(e,t,n,r,i,s){let o=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]&&o[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(o[r[l]]);for(u=0;u<i.length;u++)g.add(t[i[u]>>6]);for(let f=0;f<s.length;f+=3){let y=s[f];for(let b=0,v=s[f+2];b<v;b++)if(g.has(o[y+b]))return!1}}let a=e.ht,d=e.tn,m=a.slice(0,n),p=d.slice(0,n);for(let g=0;g<s.length;g+=3){let f=s[g],y=s[g+1];if(f!==y)for(let b=0;b<s[g+2];b++)m[y+b]=a[f+b],p[y+b]=d[f+b]}for(u=0;u<i.length;u++){let g=i[u]>>6,f=r[i[u]&63];m[g]=a[f],p[g]=d[f]}for(e.ht=m,e.tn=p,e.it=n,e.ot=t.slice(0),l=0;l<r.length;l++)(c===void 0||!c[l])&&d[r[l]].dispose();return!0}function dl(e,t,n,r,i,s,o,l,u){let c=e.ze,a=e.ot,d=e.tn,m=[],p=n;for(let g=n;g<=i;p++,g++){let f=c?c(t[g]):t[g];for(;p<=r&&(c?c(a[p]):a[p])!==f;)m.push(d[p++]);if(p>r)return o.fill(void 0),null;s[g]=e.ht[p],o[g-n]=d[p],l&&(l[g-n]=e.ct[p]),u&&(u[g-n]=e.lt[p])}for(;p<=r;p++)m.push(d[p]);return m}function hl(e,t,n,r,i,s,o,l,u){let c=e.tn,a=e.ct,d=e.lt,m=e.it,p=n-m,g,f;if(p>0)for(c.length=n,a&&(a.length=n),d&&(d.length=n),g=m-1,f=n-1;g>i;g--,f--)c[f]=c[g],a&&(a[f]=a[g]),d&&(d[f]=d[g]);else if(p<0){for(g=i+1,f=s+1;g<m;g++,f++)c[f]=c[g],a&&(a[f]=a[g]),d&&(d[f]=d[g]);c.length=n,a&&(a.length=n),d&&(d.length=n)}for(f=r;f<=s;f++)c[f]=o[f-r],a&&xe(a[f]=l[f-r],t[f]),d&&xe(d[f]=u[f-r],f);for(f=s+1;f<n;f++)a&&xe(a[f],t[f]),d&&p!==0&&xe(d[f],f)}function pl(){this.L.Ye=pe();let e=this.st()||[],t=e.length;return e[Pn],ce(this.L,()=>{let n,r,i,s,o,l=this.ct?this.ut?()=>(s[i]=gt(e[r],$n),this.ft(We(s[i]),r)):()=>(s[i]=gt(e[r],$n),o&&(o[i]=gt(r,$n)),this.ft(We(s[i]),o?We(o[i]):void 0)):this.lt?()=>{let u=e[r];return o[i]=gt(r,$n),this.ft(u,We(o[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]=ce(this.tn[0]=De(),this.H));else if(this.it===0){let u=new Array(t),c=new Array(t);s=this.ct&&new Array(t),o=this.lt&&new Array(t);try{for(r=0;r<t;r++)i=r,u[r]=ce(c[r]=De(),l)}catch(a){for(n=0;n<=r;n++)c[n]?.dispose();throw a}this.tn[0]&&this.tn[0].dispose(),this.ht=u,this.tn=c,s&&(this.ct=s),o&&(this.lt=o),this.ot=e.slice(0),this.it=t}else{let u,c,a,d,m,p,g,f,y,b,v,F=xe;for(u=0,c=Math.min(this.it,t);u<c&&(this.ot[u]===e[u]||this.ct&&oo(this.ze,this.ot[u],e[u]));u++)this.ct&&F(this.ct[u],e[u]);for(c=this.it-1,a=t-1;c>=u&&a>=u&&(this.ot[c]===e[a]||this.ct&&oo(this.ze,this.ot[c],e[a]));c--,a--);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 q=u+(a-u>>1),se=e[q],Ie=Math.min(c,q+32),ue=Math.max(u,q-32);for(;ue<=Ie&&this.ot[ue]!==se;)ue++;if(ue<=Ie&&al(this,e,t,u))return}let O=t-this.it,j=a-u+1,T=new Array(t),R=new Array(j);s=this.ct?new Array(j):void 0,o=this.lt?new Array(j):void 0;let D=O<0?dl(this,e,u,c,a,T,R,s,o):null;if(D!==null)D.length!==0&&(f=D);else{for(p=new Map,g=new Array(j),r=a;r>=u;r--)d=e[r],m=this.ze?this.ze(d):d,n=p.get(m),g[r-u]=n===void 0?-1:n,p.set(m,r);for(n=u;n<=c;n++)d=this.ot[n],m=this.ze?this.ze(d):d,r=p.get(m),r!==void 0&&r!==-1?(T[r]=this.ht[n],R[r-u]=this.tn[n],s&&(s[r-u]=this.ct[n]),o&&(o[r-u]=this.lt[n]),r=g[r-u],p.set(m,r)):(f??=[]).push(this.tn[n]);try{for(r=u;r<=a;r++)R[r-u]===void 0&&((y??=[]).push(R[r-u]=De()),i=r-u,T[r]=ce(R[r-u],l))}catch(q){if(y)for(n=0;n<y.length;n++)y[n].dispose();throw q}}for(n=0;n<u;n++)T[n]=this.ht[n];for(r=a+1;r<t;r++)T[r]=this.ht[r-O];if(hl(this,e,t,u,c,a,R,s,o),this.ht=T,this.it=t,this.ot=e.slice(0),f)for(n=0;n<f.length;n++)f[n].dispose()}}),this.ht}function oo(e,t,n){return e?e(t)===e(n):!0}function vt(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 $r(e,n,t)?()=>{let r=[];return $r(n,r,{...t,doNotUnwrap:!1}),r}:n}return e}}function $r(e,t=[],n){let r=null,i=!1;for(let s=0;s<e.length;s++)try{let o=e[s];if(typeof o=="function"&&!o.length){if(n?.doNotUnwrap){t.push(o),i=!0;continue}do o=o();while(typeof o=="function"&&!o.length)}Array.isArray(o)?i=$r(o,t,n)||i:n?.skipNonRendered&&(o==null||o===!0||o===!1||o==="")||t.push(o)}catch(o){if(!(o instanceof J))throw o;r=o}if(r)throw r;return i}function Ur(){return!0}var Te=0,ie=1,rt=2,it=3,re=4,gl=Object.freeze({});function nt(e,t){return t===it&&(e=e())==null?gl:e}var we=class{source;kind;hidden;table=0;keys=void 0;descs=void 0;constructor(t,n,r){this.source=t,this.kind=n,this.hidden=r}};function le(e,t){let n=e.hidden;return typeof n=="function"?n(t):n.includes(t)}function ml(e,t){if(typeof e!="function"&&typeof t!="function"){let n=e.slice();for(let r=0;r<t.length;r++)n.push(t[r]);return n}return n=>(typeof e=="function"?e(n):e.includes(n))||(typeof t=="function"?t(n):t.includes(n))}function tt(e){return nt(e.source,e.kind)}function Ln(e){return e[mt]}function Fr(e,t){return t===Te?Object.keys(e):t===rt||e[ae]===e?Reflect.ownKeys(e):Object.keys(e)}function Mn(e,t){if(t===ie){if(e.kind===re)return ho(e.source,!1,e);let n=Fr(tt(e),e.kind),r=[];for(let i=0;i<n.length;i++)le(e,n[i])||r.push(n[i]);return r}return Fr(nt(e,t),t)}function St(e,t,n){return t===ie?le(e,n)?!1:e.kind===re?fo(e.source,n):n in tt(e):n in nt(e,t)}function on(e,t,n){return t===ie?le(e,n)?void 0:e.kind===re?Br(e.source,n):tt(e)[n]:nt(e,t)[n]}function Mr(e,t){return t===Te?!0:t!==ie?!1:e.kind===Te?!0:e.kind===re&&Gr(e.source)}function Gr(e){let t=e.sources,n=e.kinds;for(let r=0;r<t.length;r++)if(!Mr(t[r],n[r]))return!1;return!0}function Gn(e){if(!(ae in e))return!0;let t=Ln(e);return t instanceof rn?Gr(t):t!==void 0&&Mr(t,ie)}function Un(e,t=!0){return{configurable:!0,enumerable:t,get:e,set:Ur}}function Vn(e,t,n,r=!1){if(t===ie)return le(e,n)?void 0:Vn(e.source,e.kind,n,r);if(t===re)return bl(e,n);if(t===it)return r||n in nt(e,t)?Un(()=>nt(e,t)[n]):void 0;if(t===rt)return Ln(e)!==void 0?Reflect.getOwnPropertyDescriptor(e,n):r||n in e?Un(()=>e[n]):void 0;let i=Reflect.getOwnPropertyDescriptor(e,n);if(i!==void 0)return i.get!==void 0||i.set!==void 0?Un(()=>e[n],i.enumerable):i.configurable?i:{configurable:!0,enumerable:i.enumerable,writable:!0,value:i.value}}function yl(e,t){{if(e.kind===re)return _l(e.source,e);let n=Nr(tt(e)),r=[];for(let i=0;i<n.length;i++)le(e,n[i])||r.push(n[i]);return r}}var rn=class{sources;kinds;table=0;keys=void 0;descs=void 0;constructor(t,n){this.sources=t,this.kinds=n}};function Et(e){return e!=null&&ae in e?e[mt]:void 0}function jn(e){if(e==null||!(ae in e))return;let t=Ln(e);return t instanceof we?jr(t):t===void 0?void 0:lo(t)}function lo(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(!Mr(n[i],r[i])){e.table=null;return}t=new Map,Vr(t,e,void 0),e.table=t}return t===null?void 0:t}function Vr(e,t,n){let r=t.sources,i=t.kinds;for(let s=0;s<r.length;s++){let o=r[s];if(i[s]===ie){if(o.kind===re){n===void 0?n=[o]:n.push(o),Vr(e,o.source,n),n.pop();continue}let l=o.source,u=Reflect.ownKeys(l);for(let c=0;c<u.length;c++){let a=u[c];!le(o,a)&&!Lr(n,a)&&so(e,a,l)}}else{let l=Reflect.ownKeys(o);for(let u=0;u<l.length;u++){let c=l[u];Lr(n,c)||so(e,c,o)}}}}function Lr(e,t){if(e!==void 0){for(let n=e.length-1;n>=0;n--)if(le(e[n],t))return!0}return!1}function so(e,t,n){e.has(t)&&e.delete(t),e.set(t,n)}function jr(e){let t=e.table;if(typeof t!="object"){let n=e.source;if(e.kind===re){if(!Gr(n)){e.table=null;return}t=new Map,Vr(t,n,[e])}else if(e.kind===Te){t=new Map;let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){let s=r[i];le(e,s)||t.set(s,n)}}else{e.table=null;return}e.table=t}return t===null?void 0:t}var Sl=Object.prototype.propertyIsEnumerable;function uo(e,t){let n=e.keys;if(n===void 0){n=e.keys=[];for(let[r,i]of t)Sl.call(i,r)&&n.push(r)}return n}function co(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 s=i.get(n);return s===void 0?(s=Vn(r,Te,n),s===void 0?void 0:(i.set(n,s),s)):s.get!==void 0?s:{configurable:!0,enumerable:s.enumerable,writable:s.writable,value:r[n]}}var El=16;function Dr(e){let t=e.table;if(typeof t=="object")return t===null?void 0:t;if(t+1<El){e.table=t+1;return}return jr(e)}function qr(e){let t=e.table;return typeof t=="object"&&t!==null?t:void 0}var Fn=Symbol();function ao(e,t){let n=qr(e);if(n!==void 0){let s=n.get(t);return s===void 0?Fn:s[t]}let r=e.sources,i=e.kinds;for(let s=r.length-1;s>=0;s--){let o=i[s];if(o===Te){let l=r[s];if(t in l)return l[t];continue}if(o===ie){let l=r[s];if(le(l,t))continue;if(l.kind===re){let c=ao(l.source,t);if(c!==Fn)return c;continue}let u=tt(l);if(t in u)return u[t]}else{let l=nt(r[s],o);if(t in l)return l[t]}}return Fn}function Br(e,t){let n=ao(e,t);return n===Fn?void 0:n}function fo(e,t){let n=qr(e);if(n!==void 0)return n.has(t);let r=e.sources,i=e.kinds;for(let s=r.length-1;s>=0;s--)if(St(r[s],i[s],t))return!0;return!1}function bl(e,t){let n=qr(e);if(n!==void 0)return co(e,n,t);let r=e.sources,i=e.kinds;for(let s=r.length-1;s>=0;s--)if(St(r[s],i[s],t))return Vn(r[s],i[s],t,!0)??Un(()=>Br(e,t))}function ho(e,t,n){let r=[];return po(e,n===void 0?void 0:[n],t,r,null),r}function po(e,t,n,r,i){let s=e.sources,o=e.kinds;for(let l=0;l<s.length;l++){let u=s[l],c=o[l],a;if(c===ie){if(u.kind===re){t===void 0?t=[u]:t.push(u),po(u.source,t,n,r,i),t.pop();continue}a=u,c=u.kind,u=u.source}u=nt(u,c);let d=n?Nr(u):Fr(u,c);for(let m=0;m<d.length;m++){let p=d[m];a!==void 0&&le(a,p)||Lr(t,p)||Rl(r,i,p,u)}}}function Rl(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 _l(e,t){let n=lo(e);if(n===void 0)return ho(e,!0,t);let r=uo(e,n);if(t===void 0)return r;let i=[];for(let s=0;s<r.length;s++)le(t,r[s])||i.push(r[s]);return i}var Cl={get(e,t,n){if(t===ae)return n;if(t===mt)return e;if(t!==nn){if(e.kind===re){let r=Dr(e);if(r!==void 0){let i=r.get(t);return i===void 0?void 0:i[t]}return le(e,t)?void 0:Br(e.source,t)}if(!le(e,t))return tt(e)[t]}},has(e,t){if(t===ae)return!0;if(t===nn||t===mt)return!1;if(e.kind===re){let n=Dr(e);return n!==void 0?n.has(t):le(e,t)?!1:fo(e.source,t)}return le(e,t)?!1:t in tt(e)},set:Ur,deleteProperty:Ur,getOwnPropertyDescriptor(e,t){if(!(t===ae||t===nn||t===mt)){if(e.kind===re){let n=Dr(e);if(n!==void 0)return co(e,n,t)}return Vn(e,ie,t)}},ownKeys(e){if(e.kind===re){let r=jr(e);return r!==void 0?uo(e,r):yl(e)}let t=Reflect.ownKeys(tt(e)),n=[];for(let r=0;r<t.length;r++)le(e,t[r])||n.push(t[r]);return n}};function qn(e,...t){let n=t.length===1&&typeof t[0]=="function"?t[0]:t;if(li){let o=e,l=Te;if(typeof e=="function")l=it;else if(ae in e){l=rt;let u=Ln(e);u instanceof we?(o=u.source,l=u.kind,n=ml(u.hidden,n)):u!==void 0&&(o=u,l=re)}return new Proxy(new we(o,l,n),Cl)}let r={},i=Object.getOwnPropertyNames(e),s=typeof n=="function"?n:n.length>4&&i.length>n.length?(o=>l=>o.has(l))(new Set(n)):o=>n.includes(o);for(let o of i)if(!s(o)){let l=Object.getOwnPropertyDescriptor(e,o);!l.get&&!l.set&&l.enumerable&&l.writable&&l.configurable?r[o]=l.value:l.get||l.set?Object.defineProperty(r,o,{enumerable:l.enumerable,configurable:!0,get:l.get&&l.get.bind(e),set:l.set&&l.set.bind(e)}):Object.defineProperty(r,o,l)}return r}var Eo=!1;var Bn={hydrating:!1,registry:void 0,done:!1};var zl,Xl,Ql;var Zl;var bt=(...e)=>(Xl||wt)(...e),Rt=(...e)=>(Ql||Pr)(...e);var bo=(...e)=>(zl||hn)(...e),Ro=(...e)=>(Zl||Hr)(...e);function A(e,t,n,r){return B(()=>e(t||{}))}var Jl=Symbol.for("solid.component-binding"),Wr=Symbol("solid.dynamic-flight");function It(e){return e?.[Jl]||void 0}function _o(e,t,n){if(t?.static)return eu(B(e),n);let r=new Set,i,s=(u,c)=>{let a=It(u);if(!a)return u;i=a.address;let d=It(c);if(d&&d.component===a.component){for(let m of r)m(a.address);return c}return u},o=(u,c)=>{if(u===c)return!0;let a=It(u),d=It(c);if(!a||!d||a.component!==d.component)return!1;if(a.address===d.address)return!0;if(i===void 0)return!1;if(d.address!==i){i=d.address;for(let m of r)m(d.address)}return!0},l=bt(u=>{let c=e();return!c||typeof c.then!="function"?s(c,u):{[Wr]:c}},{lazy:!0,equals:o});return u=>{if(Bn.hydrating)try{B(l)}catch{}let c=0,a=bt(d=>{let m=l();if(!m||!m[Wr])return s(m,d);let p=m[Wr],g=++c;return{then:(f,y)=>p.then(b=>{let v=g===c?s(b,d):b;return f?f(v):v},y)}},{equals:o});return bt(()=>{let d=a();switch(typeof d){case"function":{let m=It(d);if(m){let[p,g]=Rt(i??=m.address,{ownedWrite:!0});return r.add(g),Hn(()=>r.delete(g)),B(()=>m.component(u,p))}return B(()=>d(u))}case"string":return n?n(d,u):void 0}})}}function eu(e,t){if(typeof e=="function"){let n=It(e);if(n){let r=()=>n.address;return i=>B(()=>n.component(i,r))}return r=>B(()=>e(r))}return typeof e=="string"&&t?n=>t(e,n):()=>{}}var tu=e=>`Stale read from <${e}>.`;function ve(e){let t="fallback"in e?{keyed:e.keyed,fallback:()=>e.fallback}:{keyed:e.keyed},n=pe(),r,i=()=>ce(n,()=>Dn(()=>e.each,e.children,t));return Bn.hydrating&&(r=i()),()=>(r??(r=i()))()}function oe(e){let t=e.keyed,n=wt(()=>e.when,void 0),r=t?n:wt(n,{equals:(s,o)=>!s==!o,sync:!0}),i=!1;return wt(()=>{let s=r();if(i=s,s){let o=e.children;return typeof o=="function"&&o.length>0?t?B(()=>o(s),Eo):B(()=>o(()=>{if(!i)throw tu("Show");return n()}),Eo):o}return e.fallback},{sync:!0})}var Co=_o,Z=Bn;var To={INPUT:{value:1,defaultValue:2,checked:1,defaultChecked:2},SELECT:{value:1},OPTION:{value:1,selected:1,defaultSelected:2},TEXTAREA:{value:1,defaultValue:2},VIDEO:{muted:1,defaultMuted:2},AUDIO:{muted:1,defaultMuted:2}},ru=new Set(["innerHTML","textContent","innerText","children"]),je=Symbol("slot"),wo=Symbol("host"),iu=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ou=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),su=new Set(["annotation","annotation-xml","maction","math","menclose","merror","mfenced","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msubsup","msup","mtable","mtd","mtext","mtr","munder","munderover","semantics"]),Yr={svg:"http://www.w3.org/2000/svg",mathml:"http://www.w3.org/1998/Math/MathML",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};var lu={transparent:!0,sync:!0},uu={sync:!0};function fe(e,t,n){let r=n?{sync:!0,...n,transparent:!n.scope}:lu;Ro(e,t,r)}function Jr(e){return bt(()=>e(),uu)}function cu(e,t,n,r){let i=f=>{if(!f)return!1;let y=f[je];return f.parentNode===e&&(!y||y===r)},s=n.length,o=t.length,l=s,u=0,c=0,a=t[o-1],d=i(a)?a.nextSibling:r||null,m=null,p,g;for(;u<o||c<l;){if(t[u]===n[c]){u++,c++;continue}for(;o>u&&l>c&&t[o-1]===n[l-1];)o--,l--;if(o===u){let f;if(l<s)if(c&&i(f=n[c-1]))f=f.nextSibling;else{let y=l;for(;y<s&&!i(n[y]);)y++;f=y<s?n[y]:d}else f=d;for(;c<l;){let y=n[c++];e.insertBefore(y,f),r&&(y[je]=r)}}else if(l===c)for(;u<o;){let f=t[u++];(!m||!m.has(f))&&i(f)&&f.remove()}else if((p=t[u])===n[l-1]&&n[c]===t[o-1]&&p.parentNode===e&&(!(g=p[je])||g===r))if(r)do{let f=t[--o];if(e.insertBefore(f,p),f[je]=r,c++,u>=o-1||c>=l)break}while(t[u]===n[l-1]&&n[c]===t[o-1]);else do if(e.insertBefore(t[--o],p),c++,u>=o-1||c>=l)break;while(t[u]===n[l-1]&&n[c]===t[o-1]);else{if(!i(t[u])){u++;continue}if(!m){m=new Map;let y=c;for(;y<l;)m.set(n[y],y++)}let f=m.get(t[u]);if(f!=null)if(c<f&&f<l){let y=u,b=1,v;for(;++y<o&&y<l&&!((v=m.get(t[y]))==null||v!==f+b);)b++;if(b>f-c){let F=t[u];for(;c<f;){let O=n[c++];e.insertBefore(O,F),r&&(O[je]=r)}}else{let F=n[c++];e.replaceChild(F,t[u++]),r&&(F[je]=r)}}else u++;else t[u++].remove()}}}var Uo="_$$",vo="_$SOLID_EVENT_OWNER",Fo=Symbol(),Io=Object.prototype.hasOwnProperty,Ao={},zr=new Set,_t=new Map;function Lo(e,t,n,r={}){let i;au(t);try{bo(s=>{if(i=s,r.onError&&(pe()[_n]=r.onError),t===document){let o=e();fe(()=>vt(o),()=>{})}else{let o=e();E(t,()=>o,t.firstChild?null:void 0,n,{...r.insertOptions,schedule:!0})}},{id:r.renderId}),Ge()}catch(s){throw i&&i(),xo(t),s}return()=>{i(),xo(t),t.textContent=""}}function Oo(e,t,n){let r=document.createElement("template");return r.innerHTML=e,n===2?r.content.firstChild.firstChild:r.content.firstChild}function x(e,t){let n;return t===1?i=>document.importNode(n||(n=Oo(e,i,t)),!0):i=>(n||(n=Oo(e,i,t))).cloneNode(!0)}function ei(e){for(let t=0,n=e.length;t<n;t++){let r=e[t];zr.has(r)||(zr.add(r),_t.forEach((i,s)=>Mo(r,s,i)))}}function au(e){let t=fu(e,e);t&&(t.roots=(t.roots||0)+1)}function xo(e){let t=_t.get(e);t&&(t.roots>1?t.roots--:delete t.roots),du(e,e)}function fu(e,t=e){if(!e||!t)return;let n=_t.get(e);return n||_t.set(e,n={owners:new Map,handlers:new Map}),n.owners.set(t,(n.owners.get(t)||0)+1),zr.forEach(r=>Mo(r,e,n)),n}function du(e,t=e){let n=_t.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,s)=>e.removeEventListener(s,i)),_t.delete(e))}function Mo(e,t,n){if(n.handlers.has(e))return;let r=i=>Zr(i,t,n);n.handlers.set(e,r),t.addEventListener(e,r)}function Go(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 Vo(e,t,n){if(qe(e))return;let r=e.nodeName;t==="value"&&r==="SELECT"?Bo(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,Jn(e,t)}var At=null,hu=[];function Xr(e,t){for(let n=0;n<e.length;n++)e[n](t)}function Jn(e,t){At!==null&&e._$claimed&&hu.some(n=>n.includes(t.slice(t.indexOf(":")+1)))&&Xr(At,e)}function ti(e,t){return At!==null&&!e._$claimed&&(e._$claimed=!0,t===void 0?Xr(At,e):ce(t,()=>Xr(At,e))),e}function de(e,t,n){if(qe(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 s=0;s<i.length;s++)i[s].defaultSelected&&(i[s].selected=!0)}r&&(e._$multiple=!0),Jn(e,t)}function pu(e,t,n,r){qe(e)||(r==null||r===!1?e.removeAttributeNS(t,n.indexOf(":")>-1?n.split(":").pop():n):e.setAttributeNS(t,n,r===!0?"":r),Jn(e,n))}function gu(e,t,n){if(typeof t=="number"&&(t=""+t),typeof n=="number"&&(n=""+n),qe(e)){e._$classes=t&&typeof t=="object"?Kr(t):void 0;return}if(t==null||t===!1){(n||e._$classes)&&(e.removeAttribute("class"),e._$classes=void 0);return}if(typeof t=="string"){e._$classes=void 0,t!==n&&e.setAttribute("class",t);return}let r;typeof n=="string"?(r={},e.removeAttribute("class")):r=e._$classes||Kr(n||{}),t=Kr(t);let i=Object.keys(t),s=Object.keys(r),o,l;for(o=0,l=s.length;o<l;o++){let u=s[o];!u||u==="undefined"||t[u]||e.classList.remove(u)}for(o=0,l=i.length;o<l;o++){let u=i[o],c=!!t[u];!u||u==="undefined"||r[u]===c||!c||e.classList.add(u)}e._$classes=t}function mu(e,t,n,r){if(r){let i=Uo+t,s;Array.isArray(n)?(s=n[1],e[i]=n[0]):e[i]=n,e[`${i}Data`]=s;return}if(Array.isArray(n)){let i=n[0],s=o=>i.call(e,n[1],o);return s[Fo]=n,e.addEventListener(t,s),s}return e.addEventListener(t,n,typeof n!="function"&&n),n}function yu(e,t,n){if(qe(e))return;if(!t){(n||e._$styles)&&(de(e,"style"),e._$styles=void 0);return}let r=e.style;if(typeof t=="string")return e._$styles=void 0,r.cssText=t;typeof n=="string"&&(r.cssText="",n=void 0);let i=e._$styles;i||(i=e._$styles=n?{...n}:{});let s,o;for(o in i)(!Io.call(t,o)||t[o]==null)&&(r.removeProperty(o),delete i[o]);for(o in t)Io.call(t,o)&&(s=t[o],s!=null&&s!==i[o]&&(r.setProperty(o,s),i[o]=s))}function ni(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ni);if(e[ae]!==e)return e;let t=Reflect.ownKeys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof i=="string"&&(n[i]=e[i])}return n}function Su(e,t,n,r,i,s){let o={},l=At!==null&&(e.localName==="a"||e.localName==="form")?pe():void 0,u=c=>{let a=c.ref;a!==o.ref&&(typeof a=="function"||Array.isArray(a))&&Ot(()=>a,e),_u(e,c,!0,o,!0),l!==void 0&&ti(e,l)};if(Array.isArray(t))return fe(()=>Po({},t,void 0,r),u),!n&&!(r!==void 0&&r("children"))&&E(e,()=>{for(let c=t.length-1;c>=0;c--){let a=Kn(t[c]);if(a!=null&&ko(a,"children"))return No(a,"children")}}),o;if(fe(()=>{let c=Kn(t),a={},d=jn(c);if(d!==void 0)return Eu(a,d,r);if(c!=null){let m=Et(c);m instanceof we?Qr(a,m,ie,r):m!==void 0?Po(a,m.sources,m.kinds,r):Qr(a,c,ae in c?rt:Te,r)}return a},u),!n&&!(r!==void 0&&r("children")))if(typeof t!="function"&&t!=null&&Gn(t)){let c=Object.getOwnPropertyDescriptor(t,"children");c!==void 0&&(c.get===void 0?E(e,c.value):E(e,()=>t.children))}else E(e,()=>{let c=Kn(t);return c!=null&&ko(c,"children")?No(c,"children"):void 0});return o}function Eu(e,t,n){for(let[r,i]of t){if(typeof r!="string"||r==="children"||n!==void 0&&n(r))continue;let s=i[r];e[r]=r==="style"||r==="class"?ni(s):s}return e}function Kn(e){return typeof e=="function"?e():e}function ko(e,t){let n=Et(e);return n instanceof we?St(n,ie,t):t in e}function No(e,t){let n=Et(e);return n instanceof we?on(n,ie,t):e[t]}function Po(e,t,n,r){let i=[],s=[];for(let o=0;o<t.length;o++)jo(i,s,t[o],n!==void 0?n[o]:it);for(let o=0;o<i.length;o++)Qr(e,i[o],s[o],r,i,s,o+1);return e}function jo(e,t,n,r){if(r!==it){e.push(n),t.push(r);return}if(n=Kn(n),n==null)return;let i=Et(n);if(i instanceof we)e.push(i),t.push(ie);else if(i!==void 0){let s=i.sources,o=i.kinds;for(let l=0;l<s.length;l++)jo(e,t,s[l],o[l])}else e.push(n),t.push(ae in n?rt:Te)}function Qr(e,t,n,r,i,s,o){let l=Mn(t,n);e:for(let u=0;u<l.length;u++){let c=l[u];if(typeof c!="string"||c==="children"||r!==void 0&&r(c))continue;if(i!==void 0){for(let d=o;d<i.length;d++)if(St(i[d],s[d],c))continue e}let a=on(t,n,c);e[c]=c==="style"||c==="class"?ni(a):a}}function bu(e,t){Array.isArray(e)?e.flat(1/0).forEach(n=>n&&n(t)):e(t)}function Ot(e,t){let n=B(e);ce(null,()=>bu(n,t))}var Ru={scope:!0},ke=null,Qn=null;function E(e,t,n,r,i){let s=n!==void 0,o=i&&i.host;if(s&&!r&&(r=[]),ke!==null&&(r=ke.claimInitial(e,s,r)),typeof t!="function"&&(t=zn(t,r,s,!0),typeof t!="function")){Yn(e,t,r,n),o&&Xn(t,o);return}if(s&&r.length===0){let c=document.createTextNode("");e.insertBefore(c,n),r=[c]}let l=r,u=!1;fe(()=>{ke!==null&&(l=ke.reclaimRegion(l,e,n));let c=zn(t(),l,s,!0),a=u;if(u=!0,typeof c!="function")return c;let d=a&&!(i&&i.schedule)?{...i,schedule:!0}:i;return fe(()=>(ke!==null&&(l=ke.reclaimRegion(l,e,n)),zn(c,l,s)),m=>{l=Yn(e,m,l,n),o&&Xn(l,o)},d),Ao},c=>{c!==Ao&&(l=Yn(e,c,l,n),o&&Xn(l,o))},t.$s?i?{...i,scope:!0}:Ru:i)}function _u(e,t,n,r={},i=!1){let s=e.nodeName;t||(t={});for(let o in r)if(!(o in t)){if(o==="children")continue;r[o]=$o(e,o,null,r[o],i,s)}for(let o in t){if(o==="children"){n||Yn(e,zn(t.children,void 0,!1));continue}r[o]=$o(e,o,t[o],r[o],i,s)}}function Cu(e){let t,n;if(!qe()||!(t=Z.registry.get(n=vu()))){if(!e)throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${n}`);return e(!0)}return Z.completed&&Z.completed.add(t),Z.registry.delete(n),t}function Tu(){Z.events&&!Z.events.queued&&(queueMicrotask(()=>{let{completed:e,events:t}=Z;if(t){for(t.queued=!1;t.length;){let[n,r]=t[0];if(!e.has(n))return;t.shift();let i,s,o,l;for(let[u,c]of _t){if(!c.handlers.has(r.type))continue;let a=Go(r.target,c);a&&(i?(l||(l=[{container:i,state:s,distance:o}]),l.push({container:u,state:c,distance:a.distance})):(i=u,s=c,o=a.distance))}if(l){l.sort((u,c)=>u.distance-c.distance);for(let u=0;u<l.length;u++)Zr(r,l[u].container,l[u].state)}else i&&Zr(r,i,s)}Z.done&&(Z.events=_$HY.events=null,Z.completed=_$HY.completed=null)}}),Z.events.queued=!0)}function qe(e){return!Z.hydrating||Z.isClaiming&&!Z.isClaiming()?!1:!e||e.isConnected?!0:Ho!==null&&Ho.claimed(e)}var Ho=null;function Kr(e){if(Array.isArray(e)){let t={};qo(e,t),e=t}if(e&&typeof e=="object"){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let s=n[r];if(!e[s])continue;let o=s.trim().split(/\s+/);for(let l=0,u=o.length;l<u;l++)o[l]&&(t[o[l]]=!0)}return t}return e}function qo(e,t){for(let n=0,r=e.length;n<r;n++){let i=e[n];Array.isArray(i)?qo(i,t):typeof i=="object"&&i!=null?Object.assign(t,i):typeof i!="boolean"&&(i||i===0)&&(t[i]=!0)}}function $o(e,t,n,r,i,s){if(t==="style")return yu(e,n,r),n;if(t==="class")return gu(e,n,r),n;if(n===r&&To[s]?.[t]!==1)return r;if(t==="ref")return!i&&n&&Ot(()=>n,e),n;let o,l=t.indexOf(":")>-1;if(!l&&t.startsWith("on")&&(o=t.charCodeAt(2))>64&&o<91){let u=t.slice(2).toLowerCase(),c=iu.has(u);if(!c&&r){if(Array.isArray(n)&&typeof r=="function"&&r[Fo]===n)return r;e.removeEventListener(u,r,typeof r!="function"&&r)}if(c||n){let a=mu(e,u,n,c);if(c&&ei([u]),!c)return a}}else if(l&&t.slice(0,5)==="prop:"||ru.has(t)||To[s]?.[t]){if(l)t=t.slice(5);else if(qe(e))return n;t==="value"&&s==="SELECT"?Bo(e,n):(t==="value"||t==="defaultValue")&&(s==="INPUT"||s==="TEXTAREA")?n==null&&/^(checkbox|radio)$/.test(e.type)?e.removeAttribute("value"):e[t]=n??"":e[t]=n,Jn(e,t)}else{let u=l&&Yr[t.split(":")[0]];u?pu(e,u,t,n):de(e,t,n)}return n}function Zr(e,t,n){if(ke!==null&&ke.dedupEvent(e))return;let r=e[vo],i;if(r){if(r===!0||r===t||!t.contains(r))return;i=r}let s=n.owners.size===1&&n.owners.has(t)?t:Go(e.target,n)?.owner;if(!s||s===i)return;e[vo]=s;let o=i||e.target,l=Uo+e.type,u=e.target,c=m=>Object.defineProperty(e,"target",{configurable:!0,value:m}),a=()=>{let m=o[l];if(m&&!o.disabled){let p=o[`${l}Data`];if(p!==void 0?m.call(o,p,e):typeof m=="function"?m.call(o,e):m.handleEvent(e),e.cancelBubble)return}return o.host&&typeof o.host!="string"&&!o.host._$host&&o.contains(e.target)&&c(o.host),!0},d=()=>{for(;o&&a()&&!(o===s||o.parentNode===s);)o=o._$host||o.parentNode||o.host};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return o||s}}),i)i===e.target&&(o=i._$host||i.parentNode||i.host),o&&o!==s&&d();else if(e.composedPath){let m=e.composedPath();if(m.length){c(m[0]);for(let p=0;p<m.length&&(o=m[p],!!a());p++){if(o._$host){o=o._$host,d();break}if(o===s||o.parentNode===s)break}}else d()}else d();c(u)}function Yn(e,t,n,r){if(ke!==null&&qe(e)){if(t&&t!==n){let o=Array.isArray(t);for(let l of o?t:[t])if(l&&l.nodeType){if(!qe(l))return n}else if(o&&(typeof l=="string"||typeof l=="number"))return n}return t}if(t===n)return t;if(ke!==null&&Z.hydrating&&t&&t.length!==0){let o=[].concat(n??[]);if([].concat(t).every(l=>(l===o[0]&&o.shift(),l?.parentNode===e))&&!o.length)return t}let i=typeof t,s=r!==void 0;if(i==="string"||i==="number"){let o=typeof n;o==="string"||o==="number"?e.firstChild.data=t:Wo(e,n)?e.textContent=t:(Ko(e,n),e.insertBefore(document.createTextNode(t),e.firstChild))}else if(t===void 0)Wn(e,n,r);else if(t.nodeType)Array.isArray(n)?Wn(e,n,s?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[je]=r);else if(Array.isArray(t)){let o=Array.isArray(n);for(let l=0,u=t.length;l<u;l++){let c=t[l],a=typeof c;if(a==="string"||a==="number"){let d=o?n[l]:void 0;d&&d.nodeType===3?(d.data!==""+c&&(d.data=c),t[l]=d):t[l]=document.createTextNode(c)}}t.length===0?Wn(e,n,r):o?n.length===0?Do(e,t,r):cu(e,n,t,r):(n!=null&&Wn(e,n),Do(e,t))}return Qn&&Qn(e),t}function Zn(e){(e=e.currentTarget||e)._$v=null,e.removeEventListener("change",Zn,!0)}function Bo(e,t){let n=e._$v&&e._$v.map;if(t!=null&&t.map?n||e.addEventListener("change",Zn,!0):n&&e.removeEventListener("change",Zn,!0),t==null)return e._$v=null,queueMicrotask(()=>e.value=t)||(e.value=t);e._$v=t,(Qn||=wu)(e),queueMicrotask(()=>Qn(e))}function wu(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))&&Zn(e)}else e.value=t,e.selectedIndex>-1&&e.value==t&&(e._$v=null)}function zn(e,t,n,r){if(e=vt(e,{skipNonRendered:!0,doNotUnwrap:r}),r&&typeof e=="function")return e;if(n&&!Array.isArray(e)&&(e=[e??""]),ke!==null&&Z.hydrating&&Array.isArray(e))for(let i=0,s=e.length;i<s;i++){let o=e[i],l=t&&t[i],u=typeof o;(u==="string"||u==="number")&&l&&l.nodeType===3&&qe(l)&&(e[i]=l)}return e}function Xn(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)Xn(e[n],t);else e&&e.nodeType&&e[wo]!==t&&(e[wo]=t,Object.defineProperty(e,"_$host",{get:t,configurable:!0}))}function Do(e,t,n=null){for(let r=0,i=t.length;r<i;r++){let s=t[r];e.insertBefore(s,n),n&&(s[je]=n)}}function Wo(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 Ko(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 Wn(e,t,n,r){if(n===void 0)return Wo(e,t)?e.textContent="":Ko(e,t);if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){let o=t[s];if(r!==o){let l=o[je],u=o.parentNode===e&&(!l||l===n);r&&!i&&!s?u?e.replaceChild(r,o):e.insertBefore(r,n):u&&o.remove()}else i=!0}}else r&&e.insertBefore(r,n);r&&n&&(r[je]=n)}function vu(){return Z.getNextContextId()}function Iu(e,t){return Co(e,t,Au)}function Au(e,t){let n=Z.hydrating,r=n?Cu():Ou(e,B(()=>t.is),B(()=>t.xmlns));return Su(r,t),n&&Tu(),r}function Yo(e){let t=Iu(()=>e.component);return A(t,qn(e,"component"))}function Ou(e,t=void 0,n=void 0){return n?document.createElementNS(n,e,{is:t}):ou.has(e)?document.createElementNS(Yr.svg,e):su.has(e)?document.createElementNS(Yr.mathml,e):document.createElement(e,{is:t})}function zo(e,t,n,r,i){let s={jobs:[],loading:!0,busy:!1,writable:e.connection.canWrite,offline:!e.connection.connected},o=0,l=0,u=!1,c=!1,a,d=new Set,m=JSON.stringify(["pending-start.v1",t.agentId??"",t.sessionKey]),p,g,f,y=!1;try{for(let h=sessionStorage.length-1;h>=0;h-=1){let S=sessionStorage.key(h);S?.startsWith("deep-research.pending:")&&sessionStorage.removeItem(S)}}catch{}let b=()=>{if(f??=e.recoveryStorage??void 0,!f)throw new Error("Account-bound recovery storage is unavailable. Reconnect and retry.");return f.assertCurrent(),f},v=()=>{if(y)return;let h=JSON.parse(b().getItem(m)??"null");h&&typeof h=="object"&&"key"in h&&typeof h.key=="string"&&"question"in h&&typeof h.question=="string"&&"incarnation"in h&&typeof h.incarnation=="string"&&(g={key:h.key,question:h.question,incarnation:h.incarnation}),y=!0},F=h=>{let S=b();h?S.setItem(m,JSON.stringify(h)):S.removeItem(m),p=h,g=void 0},O=()=>!u&&!n.aborted,j=()=>{try{return f?.assertCurrent(),!0}catch{return!1}},T=h=>O()&&j()&&h===o,R=h=>{if(O()){s={...s,...h,pending:p,writable:e.connection.canWrite};for(let S of d)S(s)}},D=(h,S={})=>e.request(`deep-research.view.v1.${h}`,{...t,...S}),q=(h,S=!1)=>{if(o++,l++,S)g=p??g,p=void 0;else try{F()}catch{p=void 0,g=void 0}R({jobs:[],job:void 0,selected:void 0,sessionId:void 0,incarnation:void 0,loading:!1,busy:!1,error:h,actionError:void 0})};async function se(){if(u||n.aborted)return;if(!e.connection.connected){o++,l++,R({offline:!0,loading:!1});return}if(!e.connection.canRead){q("Access unavailable. Private research has been cleared.");return}if(a)return c=!0,a;let h=++o;R({offline:!1,loading:!0}),a=(async()=>{try{let S=await D("list");if(!T(h))return;v(),g&&F(g.incarnation===S.incarnation?g:void 0),p&&p.incarnation!==S.incarnation&&F();let w=s.incarnation&&s.incarnation!==S.incarnation;w&&(l++,R({jobs:[],job:void 0,selected:void 0,actionError:void 0}));let I=S.jobs.find(k=>k.jobId===r())?.jobId??S.jobs.find(k=>["queued","running","paused","submitting"].includes(k.state))?.jobId??S.jobs[0]?.jobId;if(R({jobs:S.jobs,sessionId:S.sessionId,incarnation:S.incarnation,selected:I,error:void 0,...!I||w||s.job?.jobId!==I?{job:void 0}:{}}),I){let k=await D("read",{jobId:I});if(!T(h))return;if(k.incarnation!==S.incarnation){q("Conversation changed. Refresh research.");return}R({job:k.job})}}catch(S){T(h)&&(e.connection.connected?q(S instanceof Error?S.message:"Research access unavailable.",!(S&&typeof S=="object"&&"code"in S&&S.code==="FORBIDDEN")):R({offline:!0}))}finally{T(h)&&R({loading:!1})}})(),await a,a=void 0,c&&(c=!1,se())}let Ie=async(h,S)=>{if(s.busy||!s.incarnation||s.offline||!e.connection.canWrite||!e.connection.connected)return;let w=s.job?.jobId;if(h!=="start"&&!w)return;let I=l,k=s.incarnation;if(h==="start"){try{v(),b(),p||F({key:Array.from(crypto.getRandomValues(new Uint8Array(16)),N=>N.toString(16).padStart(2,"0")).join(""),question:S.trim(),incarnation:k})}catch{R({actionError:"Could not retain a request key. No work was started."});return}if(p.question!==S.trim()){R({actionError:"Resolve the pending start before changing the question."});return}}o++,R({busy:!0,actionError:void 0});try{let N=await D(h,h==="start"?{incarnation:k,idempotencyKey:p.key,request:{question:p.question}}:{incarnation:k,jobId:w});if(!O()||!j()||!e.connection.connected||I!==l)return;if(N.incarnation!==k||s.incarnation!==k){q("Conversation changed. Refresh research.");return}h==="start"&&F(),o++,i(N.job.jobId),R({selected:N.job.jobId,job:N.job})}catch(N){if(O()&&j()&&I===l){let ee=N&&typeof N=="object"&&"details"in N&&N.details&&typeof N.details=="object"&&"code"in N.details&&N.details.code==="RESEARCH_START_REJECTED";ee&&h==="start"&&F(),R({actionError:h==="start"&&!ee?"Start outcome uncertain. Retry the same question with the retained request key.":N instanceof Error?N.message:"Research action failed."})}}finally{O()&&(R({busy:!1}),await se())}},ue=e.connection.connected,Ne=e.connection.canRead,he=e.subscribe(()=>{let h=!Ne&&e.connection.canRead;if(Ne=e.connection.canRead,!e.connection.connected){ue&&(ue=!1,se());return}if(!e.connection.canRead){q("Access unavailable. Private research has been cleared.");return}s.writable!==e.connection.canWrite&&R({}),(ue!==e.connection.connected||h)&&(ue=e.connection.connected,se())}),er=e.onEvent("plugin.deep-research.changed",()=>{se()}),tr=e.onEvent("sessions.changed",()=>{se()});return{read:()=>s,pending:()=>p,subscribe(h){return d.add(h),()=>{d.delete(h)}},refresh:se,async choose(h){o++,i(h),R({selected:h,job:void 0}),await se()},mutate:Ie,dispose(){u=!0,o++,d.clear(),he(),er(),tr()}}}function ri(e){if(e)try{let t=new URL(e);return["https:","http:"].includes(t.protocol)&&!t.username&&!t.password?t.href:void 0}catch{return}}function Xo(e){let t=ri(e);return t?new URL(t).hostname:"No external link"}function xu(e){let t=new TextEncoder().encode(e.report??""),n=new TextDecoder("utf-8",{fatal:!0}),r=[],i=0;for(let s of e.citations.toSorted((o,l)=>o.startByte-l.startByte))if(!(s.startByte<i||s.endByte>t.length||s.endByte<=s.startByte||!e.sources.some(o=>o.id===s.sourceId)))try{let o=n.decode(t.slice(i,s.startByte)),l=n.decode(t.slice(s.startByte,s.endByte));r.push({text:o},{text:l,sourceId:s.sourceId}),i=s.endByte}catch{}return r.push({text:n.decode(t.slice(i))}),r}function Qo(e){let t=[[]];for(let n of xu(e))for(let[r,i]of n.text.split(`
`).entries())r>0&&t.push([]),t[t.length-1].push({...n,text:i});return t.filter(n=>n.some(r=>r.text)).map(n=>{let r=n[0],i=!r.sourceId&&/^(#{1,6})[ \t]+/u.exec(r.text);return i&&(r.text=r.text.slice(i[0].length)),{heading:i?i[1].length:0,segments:n}})}var ku=x("<p role=status class=deep-research-notice>Offline \xB7 Last observed snapshot. Actions are disabled."),Zo=x("<p role=alert class=deep-research-notice>"),Nu=x("<option value>No research in this conversation"),Pu=x('<section class=deep-research-pane aria-label="Deep research"><header class=deep-research-heading><div><h2>Deep research</h2><p>Progress, evidence and open questions</p></div><button type=button>Refresh</button></header><!><!><form><label class=deep-research-field>Research question<textarea rows=3 maxlength=8000 required placeholder="What would you like to investigate?"></textarea></label><button type=submit></button></form><label class=deep-research-field>Retained research<select><!><!></select></label><!>'),Hu=x("<option> \xB7 <!>"),$u=x("<p>"),Du=x("<div role=status aria-live=polite class=deep-research-status><strong></strong><span>"),Uu=x("<span>Cancellation requested \xB7 awaiting terminal observation"),Fu=x("<div class=deep-research-actions><!><!>"),Lu=x('<nav aria-label="Research sections"class=deep-research-tabs>'),Mu=x("<p class=deep-research-notice>An operation may have been submitted without a receipt. It will not be blindly restarted."),Gu=x('<section aria-label="Research progress"><h3></h3><p>State: <strong></strong></p><!><p class=deep-research-muted>Observed counts, not estimated completion or cost.</p><time>Last recorded: </time><!>'),Vu=x("<button type=button>Back to citation"),ju=x('<section aria-label="Research sources"><p class=deep-research-muted>Attribution and quote matching are not verification of truth.</p><!>'),qu=x("<p class=deep-research-muted>"),Bu=x('<section aria-label="Research report"tabindex=-1>'),Wu=x("<button type=button>"),Ku=x("<button type=button><!><!>"),Yu=x("<dl class=deep-research-counts><div><dt>Sources retained</dt><dd></dd></div><div><dt>Searches</dt><dd></dd></div><div><dt>Fetches</dt><dd></dd></div><div><dt>Model calls</dt><dd>"),zu=x("<p>No sources have been retained yet."),Xu=x("<p>The report will appear when evidence is ready. Sources may arrive earlier."),Qu=x("<h3>Open questions and gaps"),Jo=x("<ul>"),Zu=x("<h3>Limitations"),es=x("<li>"),Ju=x("<h4>Available excerpt"),ts=x("<blockquote>"),ec=x("<details class=deep-research-source><summary><strong></strong><span> \xB7 <!></span><span class=deep-research-badge></span></summary><p><!><!></p><!><!>"),tc=x('<p><a target=_blank rel="noopener noreferrer">Open source in new tab \u2197'),nc=x("<span class=deep-research-badge>Model-supported (fallible)"),rc=x("<div><h4></h4><span class=deep-research-badge>Quote matched (mechanical)</span><!><!>"),ic=x("<div class=deep-research-report>"),oc=x("<button type=button class=deep-research-citation>"),sc=x("<span>"),lc={"provider-cited":"Provider-cited","retrieved-text":"Retrieved text","supplied-document":"Supplied document"};function rs(e){let[t,n]=Rt(()=>e.client.read()),[r,i]=Rt("Progress"),[s,o]=Rt(()=>e.client.pending()?.question??""),[l,u]=Rt(),c=new Map,a,d;yt(()=>{let h=e.client,S=h.read().incarnation,w=h.subscribe(I=>{(S&&S!==I.incarnation||!I.incarnation&&I.error)&&(o(""),c.clear(),a=void 0,d=void 0,u(void 0)),I.sessionId&&h.pending()&&o(h.pending().question),S=I.incarnation,n(I)});return h.refresh(),w});let m=()=>t().job,p=()=>t().writable&&!t().offline&&!t().busy&&!!t().sessionId,g=(h,S)=>{a=S,u(h),i("Sources"),yt(()=>{let w=c.get(h);w&&(w.details.open=!0,w.summary.focus())})},f=()=>{i("Report"),yt(()=>{a?.isConnected?a.focus():d?.focus()})};var y=Pu(),b=y.firstChild,v=b.firstChild,F=v.nextSibling,O=b.nextSibling,j=O.nextSibling,T=j.nextSibling,R=T.firstChild,D=R.firstChild,q=D.nextSibling,se=R.nextSibling,Ie=T.nextSibling,ue=Ie.firstChild,Ne=ue.nextSibling,he=Ne.firstChild,er=he.nextSibling,tr=Ie.nextSibling;return F._$$click=()=>{e.client.refresh()},E(y,A(oe,{get when(){return t().offline},get children(){return ku()}}),O),E(y,A(oe,{get when(){return t().error},get children(){var h=Zo();return E(h,()=>t().error),h}}),j),E(y,A(oe,{get when(){return t().actionError},get children(){var h=Zo();return E(h,()=>t().actionError),h}}),T),T.addEventListener("submit",h=>{h.preventDefault(),e.client.mutate("start",s())}),q._$$input=h=>o(h.currentTarget.value),E(se,()=>t().pending?"Retry pending start":"Start research"),Ne.addEventListener("change",h=>{e.client.choose(h.currentTarget.value)}),E(Ne,A(oe,{get when(){return!t().jobs.length},get children(){return Nu()}}),he),E(Ne,A(ve,{get each(){return t().jobs},keyed:h=>h.jobId,children:h=>(()=>{var S=Hu(),w=S.firstChild,I=w.nextSibling;return E(S,()=>h().title,w),E(S,()=>h().state,I),fe(()=>h().jobId,k=>{S.value=k}),S})()}),er),E(y,A(oe,{get when(){return m()},get fallback(){var h=$u();return E(h,()=>t().loading?"Loading research\u2026":"Start a question to build an evidence-backed report."),h},children:h=>[(()=>{var S=Du(),w=S.firstChild,I=w.nextSibling;return E(w,()=>h().phase),E(I,()=>h().summary),S})(),(()=>{var S=Fu(),w=S.firstChild,I=w.nextSibling;return E(S,A(oe,{get when(){return h().cancelRequested},get children(){return Uu()}}),w),E(S,A(ve,{get each(){return h().actions},children:k=>(()=>{var N=Wu();return N._$$click=()=>{e.client.mutate(k)},E(N,k==="cancel"?"Cancel research":"Resume research"),fe(()=>!p(),ee=>{de(N,"disabled",ee)}),N})()}),I),S})(),(()=>{var S=Lu();return E(S,A(ve,{each:["Progress","Sources","Report"],children:w=>(()=>{var I=Ku(),k=I.firstChild,N=k.nextSibling;return I._$$click=()=>i(w),E(I,w,k),E(I,()=>w==="Sources"?` (${h().sources.length})`:"",N),fe(()=>r()===w?"true":"false",ee=>{de(I,"aria-pressed",ee)}),I})()})),S})(),(()=>{var S=Gu(),w=S.firstChild,I=w.nextSibling,k=I.firstChild,N=k.nextSibling,ee=I.nextSibling,ii=ee.nextSibling,sn=ii.nextSibling,ac=sn.firstChild,is=sn.nextSibling;return E(w,()=>h().title),E(N,()=>h().state),E(S,A(oe,{get when(){return h().state==="indeterminate"},get children(){return Mu()}}),ee),E(S,A(oe,{get when(){return h().counts},children:ot=>(()=>{var xt=Yu(),kt=xt.firstChild,os=kt.firstChild,ss=os.nextSibling,oi=kt.nextSibling,ls=oi.firstChild,us=ls.nextSibling,si=oi.nextSibling,cs=si.firstChild,as=cs.nextSibling,fs=si.nextSibling,ds=fs.firstChild,hs=ds.nextSibling;return E(ss,()=>ot().sources),E(us,()=>ot().searches),E(as,()=>ot().fetches),E(hs,()=>ot().modelCalls),xt})()}),ii),E(sn,()=>new Date(h().updatedAt).toLocaleString(),null),E(S,A(ns,{get job(){return h()}}),is),fe(()=>({e:r()!=="Progress",t:new Date(h().updatedAt).toISOString()}),({e:ot,t:xt},kt)=>{ot!==kt?.e&&de(S,"hidden",ot),xt!==kt?.t&&de(sn,"datetime",xt)}),S})(),(()=>{var S=ju(),w=S.firstChild,I=w.nextSibling;return E(S,A(oe,{get when(){return l()},get children(){var k=Vu();return k._$$click=f,k}}),w),E(S,A(ve,{get each(){return h().sources},keyed:k=>k.id,get fallback(){return zu()},children:k=>A(uc,{get source(){return k()},get job(){return h()},register:(N,ee)=>(c.set(N,ee),()=>{c.get(N)===ee&&c.delete(N)})})}),I),fe(()=>r()!=="Sources",k=>{de(S,"hidden",k)}),S})(),(()=>{var S=Bu();return Ot(()=>w=>{d=w},S),E(S,A(oe,{get when(){return h().report},get fallback(){return Xu()},get children(){return[(()=>{var w=qu();return E(w,()=>h().state==="completed"?"Completed report":"Available report \xB7 may be incomplete"),w})(),A(cc,{get job(){return h()},onCitation:g}),A(ns,{get job(){return h()}})]}})),fe(()=>r()!=="Report",w=>{de(S,"hidden",w)}),S})()]}),tr),fe(()=>({e:t().loading||t().offline,t:s(),a:t().busy||!!t().pending,o:!p()||!s().trim(),i:t().selected??"",n:t().busy||!t().jobs.length}),({e:h,t:S,a:w,o:I,i:k,n:N},ee)=>{h!==ee?.e&&de(F,"disabled",h),q.value=S??"",w!==ee?.a&&de(q,"disabled",w),I!==ee?.o&&de(se,"disabled",I),Vo(Ne,"value",k),N!==ee?.n&&de(Ne,"disabled",N)}),y}function ns(e){return[A(oe,{get when(){return e.job.gaps.length},get children(){return[Qu(),(()=>{var t=Jo();return E(t,A(ve,{get each(){return e.job.gaps},children:n=>(()=>{var r=es();return E(r,n),r})()})),t})()]}}),A(oe,{get when(){return e.job.limitations.length},get children(){return[Zu(),(()=>{var t=Jo();return E(t,A(ve,{get each(){return e.job.limitations},children:n=>(()=>{var r=es();return E(r,n),r})()})),t})()]}})]}function uc(e){let t=()=>ri(e.source.url),n,r;yt(()=>e.register(e.source.id,{details:n,summary:r}));var i=ec(),s=i.firstChild,o=s.firstChild,l=o.nextSibling,u=l.firstChild,c=u.nextSibling,a=l.nextSibling,d=s.nextSibling,m=d.firstChild,p=m.nextSibling,g=d.nextSibling,f=g.nextSibling;return Ot(()=>y=>{n=y},i),Ot(()=>y=>{r=y},s),E(o,()=>e.source.title),E(l,()=>e.source.id,u),E(l,()=>Xo(e.source.url),c),E(a,()=>lc[e.source.provenance]),E(i,A(oe,{get when(){return t()},children:y=>(()=>{var b=tc(),v=b.firstChild,F=pe();return fe(()=>y(),O=>{de(v,"href",O),ti(v,F)}),b})()}),d),E(d,()=>e.source.retrievalStatus==="not-fetched"?"Provider attribution only. Text was not fetched.":"Retained text",m),E(d,(()=>{var y=Jr(()=>!!e.source.retrievedAt);return()=>y()?` \xB7 ${e.source.retrievedAt}`:""})(),p),E(i,A(oe,{get when(){return e.source.excerpt},get children(){return[Ju(),(()=>{var y=ts();return E(y,()=>e.source.excerpt),y})()]}}),g),E(i,A(ve,{get each(){return e.job.findings.filter(y=>y.evidence.some(b=>b.sourceId===e.source.id))},children:y=>(()=>{var b=rc(),v=b.firstChild,F=v.nextSibling,O=F.nextSibling,j=O.nextSibling;return E(v,()=>y.statement),E(b,A(oe,{get when(){return y.support==="model-supported"},get children(){return nc()}}),O),E(b,A(ve,{get each(){return y.evidence.filter(T=>T.sourceId===e.source.id)},children:T=>(()=>{var R=ts();return E(R,()=>T.quote),R})()}),j),b})()}),f),i}function cc(e){let t=bt(()=>Qo(e.job));var n=ic();return E(n,A(ve,{get each(){return t()},children:r=>A(Yo,{get component(){return Jr(()=>r.heading===1)()?"h3":r.heading?"h4":"p"},get children(){return A(ve,{get each(){return r.segments},children:i=>i.sourceId?(()=>{var s=oc();return s._$$click=o=>e.onCitation(i.sourceId,o.currentTarget),E(s,()=>i.text),fe(()=>`Source ${i.sourceId}`,o=>{de(s,"aria-label",o)}),s})():(()=>{var s=sc();return E(s,()=>i.text),s})()})}})})),n}ei(["click","input"]);var jd={id:"deep-research",activate(e){let t=new Map,n=e.ui.registerPanel({id:"research",label:"Deep research",mount:(r,i)=>{let s=JSON.stringify([i.props.agentId,i.props.sessionKey]),o=zo(i.host,i.props,i.signal,()=>t.get(s),u=>{t.set(s,u),e.ui.invalidate()}),l=Lo(()=>A(rs,{client:o}),r);return{dispose:()=>{o.dispose(),l()},update:()=>{t.has(s)&&t.get(s)!==o.read().selected&&o.refresh()}}}});return()=>{n(),t.clear()}}};export{jd as default};