@sockethub/examples 1.0.0-alpha.14 → 1.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_app/immutable/chunks/BF3skBIG.js +1 -0
- package/build/_app/immutable/chunks/{DTPsrcK7.js → BJRrkVji.js} +1 -1
- package/build/_app/immutable/chunks/{DZxyUSp9.js → BaJgcY-K.js} +1 -1
- package/build/_app/immutable/chunks/{DhU_U-a9.js → DDdxxuPN.js} +1 -1
- package/build/_app/immutable/chunks/{CE_Br0Li.js → DJmaXuzm.js} +3 -3
- package/build/_app/immutable/chunks/{De6kqrZW.js → Xcu1kWNr.js} +1 -1
- package/build/_app/immutable/chunks/pIrFrRr_.js +1 -0
- package/build/_app/immutable/entry/{app.DX05TQx7.js → app.O51Bq4gE.js} +2 -2
- package/build/_app/immutable/entry/start.CsBI0vdE.js +1 -0
- package/build/_app/immutable/nodes/{0.CUKpZtNl.js → 0.BRqQLijI.js} +1 -1
- package/build/_app/immutable/nodes/{1.BrfAO1-b.js → 1.DgRkrrFn.js} +1 -1
- package/build/_app/immutable/nodes/{2.B1Xhzoi4.js → 2.BPd2TBcL.js} +1 -1
- package/build/_app/immutable/nodes/{3.D2Llbnh2.js → 3.CLtTIQ-W.js} +1 -1
- package/build/_app/immutable/nodes/{4.PE7b6wi8.js → 4.DnrOHjLB.js} +1 -1
- package/build/_app/immutable/nodes/{5.Cc6bNRTx.js → 5.DygHZ5nm.js} +1 -1
- package/build/_app/immutable/nodes/{6.D0DWXXhX.js → 6.Be2N6Kf3.js} +1 -1
- package/build/_app/immutable/nodes/{7.Dby-1i_s.js → 7.D0zF0cZZ.js} +1 -1
- package/build/_app/version.json +1 -1
- package/build/dummy.html +7 -7
- package/build/feeds.html +7 -7
- package/build/index.html +7 -7
- package/build/irc.html +7 -7
- package/build/metadata.html +7 -7
- package/build/xmpp.html +7 -7
- package/package.json +3 -3
- package/build/_app/immutable/chunks/BfZhcH3H.js +0 -1
- package/build/_app/immutable/chunks/BpD8G2jq.js +0 -1
- package/build/_app/immutable/entry/start.D5427z_U.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var qa=Object.defineProperty;var La=(t,e,r)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var nt=(t,e,r)=>La(t,typeof e!="symbol"?e+"":e,r);import{g as ss,j as Va,f as at,a as Ve,s as et,c as zt,t as Ts,d as jn}from"./Bh9jqwq3.js";import"./CLcl1K30.js";import{y as Rr,L as Rs,R as sr,A as kt,aQ as nr,M as Mr,g as ae,a1 as Ua,O as Fa,P as za,Q as as,S as pr,B as tr,ay as Mn,b2 as xa,aJ as is,q as Ba,b4 as xt,z as En,D as Ha,X as os,V as Is,b0 as Dn,ae as Ka,b5 as Ga,b6 as Wa,b7 as Ja,v as Cs,x as As,b8 as ln,aY as Dr,a$ as Qa,w as Xa,b9 as js,ai as Ya,ba as Za,t as ut,W as ei,bb as ti,b3 as ri,aZ as ni,bc as si,p as Bt,s as qe,c as me,r as he,n as Ms,a as Ht,u as st,f as gt,bd as ai,be as ii,d as _t,m as un,e as oi,b as er,$ as fn,ag as ci}from"./DT_OQU4t.js";import{w as yr,g as li,c as ui,a as fi}from"./CF0IgWN3.js";import{b as di,s as hi,i as dt,l as qr,p as rr,d as pi}from"./B5Mgq-ia.js";import{s as mi,a as mr,d as gi,C as vi}from"./BB3nrZKK.js";import{i as Ds}from"./BPmfLl8P.js";function qs(t,e){return e}function yi(t,e,r){for(var n=[],s=e.length,l,a=e.length,u=0;u<s;u++){let d=e[u];As(d,()=>{if(l){if(l.pending.delete(d),l.done.add(d),l.pending.size===0){var w=t.outrogroups;Sn(Dn(l.done)),w.delete(l),w.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var i=n.length===0&&r!==null;if(i){var h=r,c=h.parentNode;Qa(c),c.append(h),t.items.clear()}Sn(e,!i)}else l={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(l)}function Sn(t,e=!0){for(var r=0;r<t.length;r++)Xa(t[r],e)}var cs;function Pn(t,e,r,n,s,l=null){var a=t,u=new Map,i=(e&js)!==0;if(i){var h=t;a=kt?sr(nr(h)):h.appendChild(Rr())}kt&&Mr();var c=null,d=Ua(()=>{var o=r();return Ka(o)?o:o==null?[]:Dn(o)}),w,P=!0;function b(){m.fallback=c,_i(m,w,a,e,n),c!==null&&(w.length===0?(c.f&xt)===0?Cs(c):(c.f^=xt,fr(c,null,a)):As(c,()=>{c=null}))}var E=Rs(()=>{w=ae(d);var o=w.length;let _=!1;if(kt){var p=Fa(a)===za;p!==(o===0)&&(a=as(),sr(a),pr(!1),_=!0)}for(var v=new Set,$=Ba,y=Ha(),f=0;f<o;f+=1){kt&&tr.nodeType===Mn&&tr.data===xa&&(a=tr,_=!0,pr(!1));var S=w[f],O=n(S,f),j=P?null:u.get(O);j?(j.v&&is(j.v,S),j.i&&is(j.i,f),y&&$.skipped_effects.delete(j.e)):(j=wi(u,P?a:cs??(cs=Rr()),S,O,f,s,e,r),P||(j.e.f|=xt),u.set(O,j)),v.add(O)}if(o===0&&l&&!c&&(P?c=En(()=>l(a)):(c=En(()=>l(cs??(cs=Rr()))),c.f|=xt)),kt&&o>0&&sr(as()),!P)if(y){for(const[F,V]of u)v.has(F)||$.skipped_effects.add(V.e);$.oncommit(b),$.ondiscard(()=>{})}else b();_&&pr(!0),ae(d)}),m={effect:E,items:u,outrogroups:null,fallback:c};P=!1,kt&&(a=tr)}function _i(t,e,r,n,s){var j,F,V,X,G,ee,fe,we,Oe;var l=(n&Za)!==0,a=e.length,u=t.items,i=t.effect.first,h,c=null,d,w=[],P=[],b,E,m,o;if(l)for(o=0;o<a;o+=1)b=e[o],E=s(b,o),m=u.get(E).e,(m.f&xt)===0&&((F=(j=m.nodes)==null?void 0:j.a)==null||F.measure(),(d??(d=new Set)).add(m));for(o=0;o<a;o+=1){if(b=e[o],E=s(b,o),m=u.get(E).e,t.outrogroups!==null)for(const se of t.outrogroups)se.pending.delete(m),se.done.delete(m);if((m.f&xt)!==0)if(m.f^=xt,m===i)fr(m,null,r);else{var _=c?c.next:i;m===t.effect.last&&(t.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),Wt(t,c,m),Wt(t,m,_),fr(m,_,r),c=m,w=[],P=[],i=c.next;continue}if((m.f&ln)!==0&&(Cs(m),l&&((X=(V=m.nodes)==null?void 0:V.a)==null||X.unfix(),(d??(d=new Set)).delete(m))),m!==i){if(h!==void 0&&h.has(m)){if(w.length<P.length){var p=P[0],v;c=p.prev;var $=w[0],y=w[w.length-1];for(v=0;v<w.length;v+=1)fr(w[v],p,r);for(v=0;v<P.length;v+=1)h.delete(P[v]);Wt(t,$.prev,y.next),Wt(t,c,$),Wt(t,y,p),i=p,c=y,o-=1,w=[],P=[]}else h.delete(m),fr(m,i,r),Wt(t,m.prev,m.next),Wt(t,m,c===null?t.effect.first:c.next),Wt(t,c,m),c=m;continue}for(w=[],P=[];i!==null&&i!==m;)(h??(h=new Set)).add(i),P.push(i),i=i.next;if(i===null)continue}(m.f&xt)===0&&w.push(m),c=m,i=m.next}if(t.outrogroups!==null){for(const se of t.outrogroups)se.pending.size===0&&(Sn(Dn(se.done)),(G=t.outrogroups)==null||G.delete(se));t.outrogroups.size===0&&(t.outrogroups=null)}if(i!==null||h!==void 0){var f=[];if(h!==void 0)for(m of h)(m.f&ln)===0&&f.push(m);for(;i!==null;)(i.f&ln)===0&&i!==t.fallback&&f.push(i),i=i.next;var S=f.length;if(S>0){var O=(n&js)!==0&&a===0?r:null;if(l){for(o=0;o<S;o+=1)(fe=(ee=f[o].nodes)==null?void 0:ee.a)==null||fe.measure();for(o=0;o<S;o+=1)(Oe=(we=f[o].nodes)==null?void 0:we.a)==null||Oe.fix()}yi(t,f,O)}}l&&Ya(()=>{var se,x;if(d!==void 0)for(m of d)(x=(se=m.nodes)==null?void 0:se.a)==null||x.apply()})}function wi(t,e,r,n,s,l,a,u){var i=(a&Ga)!==0?(a&Wa)===0?Is(r,!1,!1):os(r):null,h=(a&Ja)!==0?os(s):null;return{v:i,i:h,e:En(()=>(l(e,i??r,h??s,u),()=>{t.delete(n)}))}}function fr(t,e,r){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end,l=e&&(e.f&xt)===0?e.nodes.start:r;n!==null;){var a=Dr(n);if(l.before(n),n===s)return;n=a}}function Wt(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function Ls(t,e,r=!1,n=!1,s=!1){var l=t,a="";ut(()=>{var u=ei;if(a===(a=e()??"")){kt&&Mr();return}if(u.nodes!==null&&(ti(u.nodes.start,u.nodes.end),u.nodes=null),a!==""){if(kt){tr.data;for(var i=Mr(),h=i;i!==null&&(i.nodeType!==Mn||i.data!=="");)h=i,i=Dr(i);if(i===null)throw ri(),ni;ss(tr,h),l=sr(i);return}var c=a+"";r?c=`<svg>${c}</svg>`:n&&(c=`<math>${c}</math>`);var d=Va(c);if((r||n)&&(d=nr(d)),ss(nr(d),d.lastChild),r||n)for(;nr(d);)l.before(nr(d));else l.before(d)}})}function $i(t,e,r,n,s){var u;kt&&Mr();var l=(u=e.$$slots)==null?void 0:u[r],a=!1;l===!0&&(l=e.children,a=!0),l===void 0?s!==null&&s(t):l(t,a?()=>n:n)}function bi(t,e){let r=null,n=kt;var s;if(kt){r=tr;for(var l=nr(document.head);l!==null&&(l.nodeType!==Mn||l.data!==t);)l=Dr(l);if(l===null)pr(!1);else{var a=Dr(l);l.remove(),sr(a)}}kt||(s=document.head.appendChild(Rr()));try{Rs(()=>e(s),si)}finally{n&&(pr(!0),sr(r))}}const kn=yr([]),Or=new Map;function Vs(t,e=!1){var r,n,s;if(console.log("displayMessage called:",{type:t.type,platform:Vr(t["@context"]),isResponse:e,actor:t.actor,content:(r=t.object)==null?void 0:r.content}),t.type==="send"&&((n=t.object)==null?void 0:n.type)==="message"){const l=typeof t.actor=="string"?t.actor:((s=t.actor)==null?void 0:s.name)||"",a=t.object.content||"",u=`${l}:${a}`,i=Date.now(),h=Or.get(u);if(h&&i-h<2e3){console.log("Skipping duplicate message:",u);return}Or.set(u,i);for(const[c,d]of Or)i-d>5e3&&Or.delete(c);kn.set([...li(kn),[l,a]]),console.log("Message displayed:",{actorName:l,content:a,isResponse:e,platform:Vr(t["@context"])})}}var Ei=at("<li> </li>"),Si=at('<div><label for="incomingMessagesContainer" class="text-gray-900 font-bold">Incoming Messages</label> <div id="incomingMessagesContainer" class="incoming-messages-container w-full"><ui class="incoming-messages"></ui> <div class="incoming-messages-anchor"></div></div></div>');function
|
|
1
|
+
var qa=Object.defineProperty;var La=(t,e,r)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var nt=(t,e,r)=>La(t,typeof e!="symbol"?e+"":e,r);import{g as ss,j as Va,f as at,a as Ve,s as et,c as zt,t as Ts,d as jn}from"./Bh9jqwq3.js";import"./CLcl1K30.js";import{y as Rr,L as Rs,R as sr,A as kt,aQ as nr,M as Mr,g as ae,a1 as Ua,O as Fa,P as za,Q as as,S as pr,B as tr,ay as Mn,b2 as xa,aJ as is,q as Ba,b4 as xt,z as En,D as Ha,X as os,V as Is,b0 as Dn,ae as Ka,b5 as Ga,b6 as Wa,b7 as Ja,v as Cs,x as As,b8 as ln,aY as Dr,a$ as Qa,w as Xa,b9 as js,ai as Ya,ba as Za,t as ut,W as ei,bb as ti,b3 as ri,aZ as ni,bc as si,p as Bt,s as qe,c as me,r as he,n as Ms,a as Ht,u as st,f as gt,bd as ai,be as ii,d as _t,m as un,e as oi,b as er,$ as fn,ag as ci}from"./DT_OQU4t.js";import{w as yr,g as li,c as ui,a as fi}from"./CF0IgWN3.js";import{b as di,s as hi,i as dt,l as qr,p as rr,d as pi}from"./B5Mgq-ia.js";import{s as mi,a as mr,d as gi,C as vi}from"./BB3nrZKK.js";import{i as Ds}from"./BPmfLl8P.js";function qs(t,e){return e}function yi(t,e,r){for(var n=[],s=e.length,l,a=e.length,u=0;u<s;u++){let d=e[u];As(d,()=>{if(l){if(l.pending.delete(d),l.done.add(d),l.pending.size===0){var w=t.outrogroups;Sn(Dn(l.done)),w.delete(l),w.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var i=n.length===0&&r!==null;if(i){var h=r,c=h.parentNode;Qa(c),c.append(h),t.items.clear()}Sn(e,!i)}else l={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(l)}function Sn(t,e=!0){for(var r=0;r<t.length;r++)Xa(t[r],e)}var cs;function Pn(t,e,r,n,s,l=null){var a=t,u=new Map,i=(e&js)!==0;if(i){var h=t;a=kt?sr(nr(h)):h.appendChild(Rr())}kt&&Mr();var c=null,d=Ua(()=>{var o=r();return Ka(o)?o:o==null?[]:Dn(o)}),w,P=!0;function b(){m.fallback=c,_i(m,w,a,e,n),c!==null&&(w.length===0?(c.f&xt)===0?Cs(c):(c.f^=xt,fr(c,null,a)):As(c,()=>{c=null}))}var E=Rs(()=>{w=ae(d);var o=w.length;let _=!1;if(kt){var p=Fa(a)===za;p!==(o===0)&&(a=as(),sr(a),pr(!1),_=!0)}for(var v=new Set,$=Ba,y=Ha(),f=0;f<o;f+=1){kt&&tr.nodeType===Mn&&tr.data===xa&&(a=tr,_=!0,pr(!1));var S=w[f],O=n(S,f),j=P?null:u.get(O);j?(j.v&&is(j.v,S),j.i&&is(j.i,f),y&&$.skipped_effects.delete(j.e)):(j=wi(u,P?a:cs??(cs=Rr()),S,O,f,s,e,r),P||(j.e.f|=xt),u.set(O,j)),v.add(O)}if(o===0&&l&&!c&&(P?c=En(()=>l(a)):(c=En(()=>l(cs??(cs=Rr()))),c.f|=xt)),kt&&o>0&&sr(as()),!P)if(y){for(const[F,V]of u)v.has(F)||$.skipped_effects.add(V.e);$.oncommit(b),$.ondiscard(()=>{})}else b();_&&pr(!0),ae(d)}),m={effect:E,items:u,outrogroups:null,fallback:c};P=!1,kt&&(a=tr)}function _i(t,e,r,n,s){var j,F,V,X,G,ee,fe,we,Oe;var l=(n&Za)!==0,a=e.length,u=t.items,i=t.effect.first,h,c=null,d,w=[],P=[],b,E,m,o;if(l)for(o=0;o<a;o+=1)b=e[o],E=s(b,o),m=u.get(E).e,(m.f&xt)===0&&((F=(j=m.nodes)==null?void 0:j.a)==null||F.measure(),(d??(d=new Set)).add(m));for(o=0;o<a;o+=1){if(b=e[o],E=s(b,o),m=u.get(E).e,t.outrogroups!==null)for(const se of t.outrogroups)se.pending.delete(m),se.done.delete(m);if((m.f&xt)!==0)if(m.f^=xt,m===i)fr(m,null,r);else{var _=c?c.next:i;m===t.effect.last&&(t.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),Wt(t,c,m),Wt(t,m,_),fr(m,_,r),c=m,w=[],P=[],i=c.next;continue}if((m.f&ln)!==0&&(Cs(m),l&&((X=(V=m.nodes)==null?void 0:V.a)==null||X.unfix(),(d??(d=new Set)).delete(m))),m!==i){if(h!==void 0&&h.has(m)){if(w.length<P.length){var p=P[0],v;c=p.prev;var $=w[0],y=w[w.length-1];for(v=0;v<w.length;v+=1)fr(w[v],p,r);for(v=0;v<P.length;v+=1)h.delete(P[v]);Wt(t,$.prev,y.next),Wt(t,c,$),Wt(t,y,p),i=p,c=y,o-=1,w=[],P=[]}else h.delete(m),fr(m,i,r),Wt(t,m.prev,m.next),Wt(t,m,c===null?t.effect.first:c.next),Wt(t,c,m),c=m;continue}for(w=[],P=[];i!==null&&i!==m;)(h??(h=new Set)).add(i),P.push(i),i=i.next;if(i===null)continue}(m.f&xt)===0&&w.push(m),c=m,i=m.next}if(t.outrogroups!==null){for(const se of t.outrogroups)se.pending.size===0&&(Sn(Dn(se.done)),(G=t.outrogroups)==null||G.delete(se));t.outrogroups.size===0&&(t.outrogroups=null)}if(i!==null||h!==void 0){var f=[];if(h!==void 0)for(m of h)(m.f&ln)===0&&f.push(m);for(;i!==null;)(i.f&ln)===0&&i!==t.fallback&&f.push(i),i=i.next;var S=f.length;if(S>0){var O=(n&js)!==0&&a===0?r:null;if(l){for(o=0;o<S;o+=1)(fe=(ee=f[o].nodes)==null?void 0:ee.a)==null||fe.measure();for(o=0;o<S;o+=1)(Oe=(we=f[o].nodes)==null?void 0:we.a)==null||Oe.fix()}yi(t,f,O)}}l&&Ya(()=>{var se,x;if(d!==void 0)for(m of d)(x=(se=m.nodes)==null?void 0:se.a)==null||x.apply()})}function wi(t,e,r,n,s,l,a,u){var i=(a&Ga)!==0?(a&Wa)===0?Is(r,!1,!1):os(r):null,h=(a&Ja)!==0?os(s):null;return{v:i,i:h,e:En(()=>(l(e,i??r,h??s,u),()=>{t.delete(n)}))}}function fr(t,e,r){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end,l=e&&(e.f&xt)===0?e.nodes.start:r;n!==null;){var a=Dr(n);if(l.before(n),n===s)return;n=a}}function Wt(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function Ls(t,e,r=!1,n=!1,s=!1){var l=t,a="";ut(()=>{var u=ei;if(a===(a=e()??"")){kt&&Mr();return}if(u.nodes!==null&&(ti(u.nodes.start,u.nodes.end),u.nodes=null),a!==""){if(kt){tr.data;for(var i=Mr(),h=i;i!==null&&(i.nodeType!==Mn||i.data!=="");)h=i,i=Dr(i);if(i===null)throw ri(),ni;ss(tr,h),l=sr(i);return}var c=a+"";r?c=`<svg>${c}</svg>`:n&&(c=`<math>${c}</math>`);var d=Va(c);if((r||n)&&(d=nr(d)),ss(nr(d),d.lastChild),r||n)for(;nr(d);)l.before(nr(d));else l.before(d)}})}function $i(t,e,r,n,s){var u;kt&&Mr();var l=(u=e.$$slots)==null?void 0:u[r],a=!1;l===!0&&(l=e.children,a=!0),l===void 0?s!==null&&s(t):l(t,a?()=>n:n)}function bi(t,e){let r=null,n=kt;var s;if(kt){r=tr;for(var l=nr(document.head);l!==null&&(l.nodeType!==Mn||l.data!==t);)l=Dr(l);if(l===null)pr(!1);else{var a=Dr(l);l.remove(),sr(a)}}kt||(s=document.head.appendChild(Rr()));try{Rs(()=>e(s),si)}finally{n&&(pr(!0),sr(r))}}const kn=yr([]),Or=new Map;function Vs(t,e=!1){var r,n,s;if(console.log("displayMessage called:",{type:t.type,platform:Vr(t["@context"]),isResponse:e,actor:t.actor,content:(r=t.object)==null?void 0:r.content}),t.type==="send"&&((n=t.object)==null?void 0:n.type)==="message"){const l=typeof t.actor=="string"?t.actor:((s=t.actor)==null?void 0:s.name)||"",a=t.object.content||"",u=`${l}:${a}`,i=Date.now(),h=Or.get(u);if(h&&i-h<2e3){console.log("Skipping duplicate message:",u);return}Or.set(u,i);for(const[c,d]of Or)i-d>5e3&&Or.delete(c);kn.set([...li(kn),[l,a]]),console.log("Message displayed:",{actorName:l,content:a,isResponse:e,platform:Vr(t["@context"])})}}var Ei=at("<li> </li>"),Si=at('<div><label for="incomingMessagesContainer" class="text-gray-900 font-bold">Incoming Messages</label> <div id="incomingMessagesContainer" class="incoming-messages-container w-full"><ui class="incoming-messages"></ui> <div class="incoming-messages-anchor"></div></div></div>');function of(t,e){Bt(e,!1);const r=()=>di(kn,"$messages",n),[n,s]=hi();Ds();var l=Si(),a=qe(me(l),2),u=me(a);Pn(u,5,r,qs,(i,h)=>{var c=Ei(),d=me(c);he(c),ut(()=>et(d,`${ae(h)[0]??""}: ${ae(h)[1]??""}`)),Ve(i,c)}),he(u),Ms(2),he(a),he(l),Ve(t,l),Ht(),s()}var Pi=at("<span> </span>");function qn(t,e){Bt(e,!0);const r=st(()=>Vr(e.entry["@context"]));var n=Pi(),s=me(n);he(n),ut(()=>et(s,`[${ae(r)??"unknown"??""}:${e.entry.type??""}]`)),Ve(t,n),Ht()}var ki=at("<!> <span> </span> <span> </span>",1);function Oi(t,e){Bt(e,!0);var r=ki(),n=gt(r);qn(n,{get entry(){return e.entry}});var s=qe(n,2),l=me(s);he(s);var a=qe(s,2),u=me(a,!0);he(a),ut(()=>{var i,h,c;et(l,`#${e.id??""}
|
|
2
2
|
${(typeof e.entry.actor=="string"?e.entry.actor:((i=e.entry.actor)==null?void 0:i.name)||((h=e.entry.actor)==null?void 0:h.id))??""}:`),et(u,((c=e.entry.object)==null?void 0:c.content)||"")}),Ve(t,r),Ht()}var Ni=at('<span class="font-medium">📰 Fetched feed:</span> <span> </span> <span class="text-gray-500"> </span>',1),Ti=at("<span> </span>"),Ri=at('<span class="text-gray-500 text-xs italic"> </span>'),Ii=at('<span class="text-gray-500"> </span> <!> <span><a rel="noreferrer" target="_blank" class="text-blue-600 hover:text-blue-800 underline"><!></a></span> <!>',1),Ci=at("<!> <!>",1);function Ai(t,e){Bt(e,!0);const r=st(()=>e.entry.totalItems!==void 0),n=st(()=>{var c;return ae(r)?e.entry.summary:(c=e.entry.object)==null?void 0:c.url}),s=st(()=>{var c,d;return typeof e.entry.actor=="string"?e.entry.actor:((c=e.entry.actor)==null?void 0:c.name)||((d=e.entry.actor)==null?void 0:d.id)});var l=Ci(),a=gt(l);qn(a,{get entry(){return e.entry}});var u=qe(a,2);{var i=c=>{var d=Ni(),w=qe(gt(d),2),P=me(w,!0);he(w);var b=qe(w,2),E=me(b);he(b),ut(()=>{et(P,ae(n)),et(E,`(${e.entry.totalItems??""} ${e.entry.totalItems===1?"item":"items"})`)}),Ve(c,d)},h=c=>{var d=Ii(),w=gt(d),P=me(w);he(w);var b=qe(w,2);{var E=f=>{var S=Ti(),O=me(S);he(S),ut(()=>et(O,`${ae(s)??""}:`)),Ve(f,S)};dt(b,f=>{ae(s)&&f(E)})}var m=qe(b,2),o=me(m),_=me(o);{var p=f=>{var S=zt(),O=gt(S);Ls(O,()=>{var j;return(j=e.entry.object)==null?void 0:j.title}),Ve(f,S)},v=f=>{var S=Ts();ut(()=>{var O,j;return et(S,(O=e.entry.object)!=null&&O.title||typeof e.entry.target=="string"?e.entry.target:(j=e.entry.target)==null?void 0:j.id)}),Ve(f,S)};dt(_,f=>{var S;((S=e.entry.object)==null?void 0:S.contentType)==="html"?f(p):f(v,!1)})}he(o),he(m);var $=qe(m,2);{var y=f=>{var S=Ri(),O=me(S,!0);he(S),ut(j=>et(O,j),[()=>{var j;return(j=e.entry.object)==null?void 0:j.published.split("T")[0]}]),Ve(f,S)};dt($,f=>{var S;(S=e.entry.object)!=null&&S.published&&f(y)})}ut(()=>{var f;et(P,`#${e.id??""}`),mi(o,"href",(f=e.entry.object)==null?void 0:f.url)}),Ve(c,d)};dt(u,c=>{ae(r)?c(i):c(h,!1)})}Ve(t,l),Ht()}var ji=at("<!> <span> </span>",1);function Mi(t,e){Bt(e,!0);var r=ji(),n=gt(r);qn(n,{get entry(){return e.entry}});var s=qe(n,2),l=me(s);he(s),ut(()=>{var a,u;return et(l,`#${e.id??""}
|
|
3
3
|
${(typeof e.entry.actor=="string"?e.entry.actor:((a=e.entry.actor)==null?void 0:a.name)||((u=e.entry.actor)==null?void 0:u.id))??""}`)}),Ve(t,r),Ht()}var Di=at('<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full"> </span>'),qi=at('<span class="px-2 py-1 bg-purple-100 text-purple-800 text-xs font-medium rounded-full"> </span>'),Li=at('<div class="mt-2 p-3 bg-red-50 border border-red-200 rounded-lg"><div class="flex items-center space-x-2"><svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="text-red-800 font-medium text-sm">Error:</span> <span class="text-red-700 text-sm"> </span></div></div>'),Vi=at('<li class="p-4 hover:bg-gray-50 transition-colors"><div class="flex items-start space-x-3"><div class="flex flex-col items-center space-y-1 mt-1"><div></div> <div class="text-xs text-gray-400 font-mono"> </div></div> <div class="flex-1 min-w-0"><div class="flex items-center justify-between mb-2"><div class="flex items-center space-x-2"><span class="text-sm font-semibold text-gray-700"> </span> <!> <!></div> <button class="px-3 py-1 text-xs font-medium text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded-md transition-colors flex items-center space-x-1"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg> <span>View Details</span></button></div> <div class="text-sm text-gray-600"><!></div> <!></div></div></li>');function ls(t,e){Bt(e,!0);const r=st(()=>Vr(e.entry["@context"])),n=st(()=>e.timestamp?new Date(e.timestamp).toLocaleTimeString():""),s=st(()=>e.hasSend&&e.hasResponse?"Sent → Response OK":e.hasSend?"Sent → Awaiting response":""),l=st(()=>e.hasSend&&e.hasResponse?"bg-green-500":e.hasSend?"bg-orange-400":"bg-green-500");var a=Vi(),u=me(a),i=me(u),h=me(i),c=qe(h,2),d=me(c,!0);he(c),he(i);var w=qe(i,2),P=me(w),b=me(P),E=me(b),m=me(E,!0);he(E);var o=qe(E,2);{var _=V=>{var X=Di(),G=me(X,!0);he(X),ut(ee=>et(G,ee),[()=>ae(r).toUpperCase()]),Ve(V,X)};dt(o,V=>{ae(r)&&V(_)})}var p=qe(o,2);{var v=V=>{var X=qi(),G=me(X,!0);he(X),ut(()=>et(G,e.entry.type)),Ve(V,X)};dt(p,V=>{e.entry.type&&V(v)})}he(b);var $=qe(b,2);$.__click=function(...V){var X;(X=e.buttonAction)==null||X.apply(this,V)},he(P);var y=qe(P,2),f=me(y);{var S=V=>{Oi(V,{get id(){return e.id},get entry(){return e.entry}})},O=V=>{var X=zt(),G=gt(X);{var ee=we=>{Ai(we,{get id(){return e.id},get entry(){return e.entry}})},fe=we=>{Mi(we,{get id(){return e.id},get entry(){return e.entry}})};dt(G,we=>{ae(r)==="feeds"?we(ee):we(fe,!1)},!0)}Ve(V,X)};dt(f,V=>{ae(r)==="dummy"?V(S):V(O,!1)})}he(y);var j=qe(y,2);{var F=V=>{var X=Li(),G=me(X),ee=qe(me(G),4),fe=me(ee,!0);he(ee),he(G),he(X),ut(()=>et(fe,e.entry.error)),Ve(V,X)};dt(j,V=>{e.entry.error&&V(F)})}he(w),he(u),he(a),ut(()=>{mr(h,1,`w-3 h-3 ${ae(l)??""} rounded-full`),et(d,ae(n)||`#${e.id}`),et(m,ae(s))}),Ve(t,a),Ht()}jn(["click"]);var Ui=at('<div class="mt-2 p-2 bg-red-50 border border-red-200 rounded-lg"><span class="text-red-700 text-xs"> </span></div>'),Fi=at('<li class="p-4 hover:bg-indigo-50/40 transition-colors"><div class="flex items-start space-x-3"><div class="flex flex-col items-center space-y-1 mt-1"><div></div> <div class="text-xs text-gray-400 font-mono"> </div></div> <div class="flex-1 min-w-0"><div class="flex items-center justify-between mb-1"><div class="flex items-center space-x-2"><span> </span></div> <button class="px-3 py-1 text-xs font-medium text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded-md transition-colors flex items-center space-x-1"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg> <span>View Details</span></button></div> <p class="text-sm text-gray-600 truncate"> </p> <!></div></div></li>');function zi(t,e){Bt(e,!0);const r={schemas:{label:"Schemas Received",color:"text-indigo-800",bg:"bg-indigo-100"},ready:{label:"Client Ready",color:"text-emerald-800",bg:"bg-emerald-100"},init_error:{label:"Init Error",color:"text-red-800",bg:"bg-red-100"}},n=st(()=>r[e.entry._logType]??r.schemas);function s(f){if(!f||typeof f!="object")return"";const S=f;if(e.entry._logType==="schemas"){const j=(Array.isArray(S.platforms)?S.platforms:[]).map(V=>V==null?void 0:V.id).filter(Boolean);return`v${typeof S.version=="string"?S.version:""} — ${j.length} platform${j.length!==1?"s":""}: ${j.join(", ")}`}if(e.entry._logType==="ready"){const O=typeof S.reason=="string"?S.reason:"",j=typeof S.sockethubVersion=="string"?S.sockethubVersion:"",F=Array.isArray(S.platforms)?S.platforms.length:0;return`${O} — Sockethub v${j}, ${F} platform${F!==1?"s":""}`}if(e.entry._logType==="init_error"){const O=typeof S.error=="string"?S.error:"unknown",j=typeof S.phase=="string"?S.phase:"",F=S.retrying?" (retrying)":"";return`${j}: ${O}${F}`}return JSON.stringify(f).slice(0,120)}const l=st(()=>s(e.entry.payload)),a=st(()=>new Date(e.entry._timestamp).toLocaleTimeString());var u=Fi(),i=me(u),h=me(i),c=me(h),d=qe(c,2),w=me(d,!0);he(d),he(h);var P=qe(h,2),b=me(P),E=me(b),m=me(E),o=me(m,!0);he(m),he(E);var _=qe(E,2);_.__click=function(...f){var S;(S=e.buttonAction)==null||S.apply(this,f)},he(b);var p=qe(b,2),v=me(p,!0);he(p);var $=qe(p,2);{var y=f=>{var S=Ui(),O=me(S),j=me(O,!0);he(O),he(S),ut(()=>{var F;return et(j,((F=e.entry.payload)==null?void 0:F.error)??"")}),Ve(f,S)};dt($,f=>{e.entry._logType==="init_error"&&f(y)})}he(P),he(i),he(u),ut(()=>{mr(c,1,`w-3 h-3 ${e.entry._logType==="init_error"?"bg-red-500":"bg-indigo-500"} rounded-full`),et(w,ae(a)),mr(m,1,`px-2 py-1 ${ae(n).bg??""} ${ae(n).color??""} text-xs font-semibold rounded-full`),et(o,ae(n).label),et(v,ae(l))}),Ve(t,u),Ht()}jn(["click"]);function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dn,us;function Bi(){if(us)return dn;us=1;function t(q){return q instanceof Map?q.clear=q.delete=q.set=function(){throw new Error("map is read-only")}:q instanceof Set&&(q.add=q.clear=q.delete=function(){throw new Error("set is read-only")}),Object.freeze(q),Object.getOwnPropertyNames(q).forEach(Y=>{const ne=q[Y],$e=typeof ne;($e==="object"||$e==="function")&&!Object.isFrozen(ne)&&t(ne)}),q}class e{constructor(Y){Y.data===void 0&&(Y.data={}),this.data=Y.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(q){return q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function n(q,...Y){const ne=Object.create(null);for(const $e in q)ne[$e]=q[$e];return Y.forEach(function($e){for(const Je in $e)ne[Je]=$e[Je]}),ne}const s="</span>",l=q=>!!q.scope,a=(q,{prefix:Y})=>{if(q.startsWith("language:"))return q.replace("language:","language-");if(q.includes(".")){const ne=q.split(".");return[`${Y}${ne.shift()}`,...ne.map(($e,Je)=>`${$e}${"_".repeat(Je+1)}`)].join(" ")}return`${Y}${q}`};class u{constructor(Y,ne){this.buffer="",this.classPrefix=ne.classPrefix,Y.walk(this)}addText(Y){this.buffer+=r(Y)}openNode(Y){if(!l(Y))return;const ne=a(Y.scope,{prefix:this.classPrefix});this.span(ne)}closeNode(Y){l(Y)&&(this.buffer+=s)}value(){return this.buffer}span(Y){this.buffer+=`<span class="${Y}">`}}const i=(q={})=>{const Y={children:[]};return Object.assign(Y,q),Y};class h{constructor(){this.rootNode=i(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Y){this.top.children.push(Y)}openNode(Y){const ne=i({scope:Y});this.add(ne),this.stack.push(ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Y){return this.constructor._walk(Y,this.rootNode)}static _walk(Y,ne){return typeof ne=="string"?Y.addText(ne):ne.children&&(Y.openNode(ne),ne.children.forEach($e=>this._walk(Y,$e)),Y.closeNode(ne)),Y}static _collapse(Y){typeof Y!="string"&&Y.children&&(Y.children.every(ne=>typeof ne=="string")?Y.children=[Y.children.join("")]:Y.children.forEach(ne=>{h._collapse(ne)}))}}class c extends h{constructor(Y){super(),this.options=Y}addText(Y){Y!==""&&this.add(Y)}startScope(Y){this.openNode(Y)}endScope(){this.closeNode()}__addSublanguage(Y,ne){const $e=Y.root;ne&&($e.scope=`language:${ne}`),this.add($e)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(q){return q?typeof q=="string"?q:q.source:null}function w(q){return E("(?=",q,")")}function P(q){return E("(?:",q,")*")}function b(q){return E("(?:",q,")?")}function E(...q){return q.map(ne=>d(ne)).join("")}function m(q){const Y=q[q.length-1];return typeof Y=="object"&&Y.constructor===Object?(q.splice(q.length-1,1),Y):{}}function o(...q){return"("+(m(q).capture?"":"?:")+q.map($e=>d($e)).join("|")+")"}function _(q){return new RegExp(q.toString()+"|").exec("").length-1}function p(q,Y){const ne=q&&q.exec(Y);return ne&&ne.index===0}const v=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $(q,{joinWith:Y}){let ne=0;return q.map($e=>{ne+=1;const Je=ne;let Ye=d($e),ue="";for(;Ye.length>0;){const ce=v.exec(Ye);if(!ce){ue+=Ye;break}ue+=Ye.substring(0,ce.index),Ye=Ye.substring(ce.index+ce[0].length),ce[0][0]==="\\"&&ce[1]?ue+="\\"+String(Number(ce[1])+Je):(ue+=ce[0],ce[0]==="("&&ne++)}return ue}).map($e=>`(${$e})`).join(Y)}const y=/\b\B/,f="[a-zA-Z]\\w*",S="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",V="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=(q={})=>{const Y=/^#![ ]*\//;return q.binary&&(q.begin=E(Y,/.*\b/,q.binary,/\b.*/)),n({scope:"meta",begin:Y,end:/$/,relevance:0,"on:begin":(ne,$e)=>{ne.index!==0&&$e.ignoreMatch()}},q)},G={begin:"\\\\[\\s\\S]",relevance:0},ee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[G]},fe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[G]},we={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Oe=function(q,Y,ne={}){const $e=n({scope:"comment",begin:q,end:Y,contains:[]},ne);$e.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Je=o("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return $e.contains.push({begin:E(/[ ]+/,"(",Je,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),$e},se=Oe("//","$"),x=Oe("/\\*","\\*/"),T=Oe("#","$"),M={scope:"number",begin:O,relevance:0},R={scope:"number",begin:j,relevance:0},g={scope:"number",begin:F,relevance:0},k={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[G,{begin:/\[/,end:/\]/,relevance:0,contains:[G]}]},A={scope:"title",begin:f,relevance:0},W={scope:"title",begin:S,relevance:0},Q={begin:"\\.\\s*"+S,relevance:0};var re=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:G,BINARY_NUMBER_MODE:g,BINARY_NUMBER_RE:F,COMMENT:Oe,C_BLOCK_COMMENT_MODE:x,C_LINE_COMMENT_MODE:se,C_NUMBER_MODE:R,C_NUMBER_RE:j,END_SAME_AS_BEGIN:function(q){return Object.assign(q,{"on:begin":(Y,ne)=>{ne.data._beginMatch=Y[1]},"on:end":(Y,ne)=>{ne.data._beginMatch!==Y[1]&&ne.ignoreMatch()}})},HASH_COMMENT_MODE:T,IDENT_RE:f,MATCH_NOTHING_RE:y,METHOD_GUARD:Q,NUMBER_MODE:M,NUMBER_RE:O,PHRASAL_WORDS_MODE:we,QUOTE_STRING_MODE:fe,REGEXP_MODE:k,RE_STARTERS_RE:V,SHEBANG:X,TITLE_MODE:A,UNDERSCORE_IDENT_RE:S,UNDERSCORE_TITLE_MODE:W});function ve(q,Y){q.input[q.index-1]==="."&&Y.ignoreMatch()}function N(q,Y){q.className!==void 0&&(q.scope=q.className,delete q.className)}function I(q,Y){Y&&q.beginKeywords&&(q.begin="\\b("+q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",q.__beforeBegin=ve,q.keywords=q.keywords||q.beginKeywords,delete q.beginKeywords,q.relevance===void 0&&(q.relevance=0))}function L(q,Y){Array.isArray(q.illegal)&&(q.illegal=o(...q.illegal))}function z(q,Y){if(q.match){if(q.begin||q.end)throw new Error("begin & end are not supported with match");q.begin=q.match,delete q.match}}function J(q,Y){q.relevance===void 0&&(q.relevance=1)}const te=(q,Y)=>{if(!q.beforeMatch)return;if(q.starts)throw new Error("beforeMatch cannot be used with starts");const ne=Object.assign({},q);Object.keys(q).forEach($e=>{delete q[$e]}),q.keywords=ne.keywords,q.begin=E(ne.beforeMatch,w(ne.begin)),q.starts={relevance:0,contains:[Object.assign(ne,{endsParent:!0})]},q.relevance=0,delete ne.beforeMatch},Ee=["of","and","for","in","not","or","if","then","parent","list","value"],Fe="keyword";function Re(q,Y,ne=Fe){const $e=Object.create(null);return typeof q=="string"?Je(ne,q.split(" ")):Array.isArray(q)?Je(ne,q):Object.keys(q).forEach(function(Ye){Object.assign($e,Re(q[Ye],Y,Ye))}),$e;function Je(Ye,ue){Y&&(ue=ue.map(ce=>ce.toLowerCase())),ue.forEach(function(ce){const ye=ce.split("|");$e[ye[0]]=[Ye,Ae(ye[0],ye[1])]})}}function Ae(q,Y){return Y?Number(Y):_e(q)?0:1}function _e(q){return Ee.includes(q.toLowerCase())}const xe={},Ie=q=>{console.error(q)},vt=(q,...Y)=>{console.log(`WARN: ${q}`,...Y)},Xe=(q,Y)=>{xe[`${q}/${Y}`]||(console.log(`Deprecated as of ${q}. ${Y}`),xe[`${q}/${Y}`]=!0)},ht=new Error;function $t(q,Y,{key:ne}){let $e=0;const Je=q[ne],Ye={},ue={};for(let ce=1;ce<=Y.length;ce++)ue[ce+$e]=Je[ce],Ye[ce+$e]=!0,$e+=_(Y[ce-1]);q[ne]=ue,q[ne]._emit=Ye,q[ne]._multi=!0}function ct(q){if(Array.isArray(q.begin)){if(q.skip||q.excludeBegin||q.returnBegin)throw Ie("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ht;if(typeof q.beginScope!="object"||q.beginScope===null)throw Ie("beginScope must be object"),ht;$t(q,q.begin,{key:"beginScope"}),q.begin=$(q.begin,{joinWith:""})}}function wt(q){if(Array.isArray(q.end)){if(q.skip||q.excludeEnd||q.returnEnd)throw Ie("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ht;if(typeof q.endScope!="object"||q.endScope===null)throw Ie("endScope must be object"),ht;$t(q,q.end,{key:"endScope"}),q.end=$(q.end,{joinWith:""})}}function _r(q){q.scope&&typeof q.scope=="object"&&q.scope!==null&&(q.beginScope=q.scope,delete q.scope)}function wr(q){_r(q),typeof q.beginScope=="string"&&(q.beginScope={_wrap:q.beginScope}),typeof q.endScope=="string"&&(q.endScope={_wrap:q.endScope}),ct(q),wt(q)}function Yt(q){function Y(ue,ce){return new RegExp(d(ue),"m"+(q.case_insensitive?"i":"")+(q.unicodeRegex?"u":"")+(ce?"g":""))}class ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ce,ye){ye.position=this.position++,this.matchIndexes[this.matchAt]=ye,this.regexes.push([ye,ce]),this.matchAt+=_(ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ce=this.regexes.map(ye=>ye[1]);this.matcherRe=Y($(ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(ce){this.matcherRe.lastIndex=this.lastIndex;const ye=this.matcherRe.exec(ce);if(!ye)return null;const it=ye.findIndex((C,U)=>U>0&&C!==void 0),D=this.matchIndexes[it];return ye.splice(0,it),Object.assign(ye,D)}}class $e{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ce){if(this.multiRegexes[ce])return this.multiRegexes[ce];const ye=new ne;return this.rules.slice(ce).forEach(([it,D])=>ye.addRule(it,D)),ye.compile(),this.multiRegexes[ce]=ye,ye}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ce,ye){this.rules.push([ce,ye]),ye.type==="begin"&&this.count++}exec(ce){const ye=this.getMatcher(this.regexIndex);ye.lastIndex=this.lastIndex;let it=ye.exec(ce);if(this.resumingScanAtSamePosition()&&!(it&&it.index===this.lastIndex)){const D=this.getMatcher(0);D.lastIndex=this.lastIndex+1,it=D.exec(ce)}return it&&(this.regexIndex+=it.position+1,this.regexIndex===this.count&&this.considerAll()),it}}function Je(ue){const ce=new $e;return ue.contains.forEach(ye=>ce.addRule(ye.begin,{rule:ye,type:"begin"})),ue.terminatorEnd&&ce.addRule(ue.terminatorEnd,{type:"end"}),ue.illegal&&ce.addRule(ue.illegal,{type:"illegal"}),ce}function Ye(ue,ce){const ye=ue;if(ue.isCompiled)return ye;[N,z,wr,te].forEach(D=>D(ue,ce)),q.compilerExtensions.forEach(D=>D(ue,ce)),ue.__beforeBegin=null,[I,L,J].forEach(D=>D(ue,ce)),ue.isCompiled=!0;let it=null;return typeof ue.keywords=="object"&&ue.keywords.$pattern&&(ue.keywords=Object.assign({},ue.keywords),it=ue.keywords.$pattern,delete ue.keywords.$pattern),it=it||/\w+/,ue.keywords&&(ue.keywords=Re(ue.keywords,q.case_insensitive)),ye.keywordPatternRe=Y(it,!0),ce&&(ue.begin||(ue.begin=/\B|\b/),ye.beginRe=Y(ye.begin),!ue.end&&!ue.endsWithParent&&(ue.end=/\B|\b/),ue.end&&(ye.endRe=Y(ye.end)),ye.terminatorEnd=d(ye.end)||"",ue.endsWithParent&&ce.terminatorEnd&&(ye.terminatorEnd+=(ue.end?"|":"")+ce.terminatorEnd)),ue.illegal&&(ye.illegalRe=Y(ue.illegal)),ue.contains||(ue.contains=[]),ue.contains=[].concat(...ue.contains.map(function(D){return nn(D==="self"?ue:D)})),ue.contains.forEach(function(D){Ye(D,ye)}),ue.starts&&Ye(ue.starts,ce),ye.matcher=Je(ye),ye}if(q.compilerExtensions||(q.compilerExtensions=[]),q.contains&&q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return q.classNameAliases=n(q.classNameAliases||{}),Ye(q)}function ir(q){return q?q.endsWithParent||ir(q.starts):!1}function nn(q){return q.variants&&!q.cachedVariants&&(q.cachedVariants=q.variants.map(function(Y){return n(q,{variants:null},Y)})),q.cachedVariants?q.cachedVariants:ir(q)?n(q,{starts:q.starts?n(q.starts):null}):Object.isFrozen(q)?n(q):q}var $r="11.11.1";class bt extends Error{constructor(Y,ne){super(Y),this.name="HTMLInjectionError",this.html=ne}}const or=r,br=n,Er=Symbol("nomatch"),sn=7,Sr=function(q){const Y=Object.create(null),ne=Object.create(null),$e=[];let Je=!0;const Ye="Could not find the language '{}', did you forget to load/include a language module?",ue={disableAutodetect:!0,name:"Plain text",contains:[]};let ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function ye(Z){return ce.noHighlightRe.test(Z)}function it(Z){let le=Z.className+" ";le+=Z.parentNode?Z.parentNode.className:"";const Se=ce.languageDetectRe.exec(le);if(Se){const Me=Le(Se[1]);return Me||(vt(Ye.replace("{}",Se[1])),vt("Falling back to no-highlight mode for this block.",Z)),Me?Se[1]:"no-highlight"}return le.split(/\s+/).find(Me=>ye(Me)||Le(Me))}function D(Z,le,Se){let Me="",Qe="";typeof le=="object"?(Me=Z,Se=le.ignoreIllegals,Qe=le.language):(Xe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Xe("10.7.0",`Please use highlight(code, options) instead.
|
|
4
4
|
https://github.com/highlightjs/highlight.js/issues/2277`),Qe=Z,Me=le),Se===void 0&&(Se=!0);const yt={code:Me,language:Qe};Nt("before:highlight",yt);const Tt=yt.result?yt.result:C(yt.language,yt.code,Se);return Tt.code=yt.code,Nt("after:highlight",Tt),Tt}function C(Z,le,Se,Me){const Qe=Object.create(null);function yt(oe,pe){return oe.keywords[pe]}function Tt(){if(!Pe.keywords){ft.addText(We);return}let oe=0;Pe.keywordPatternRe.lastIndex=0;let pe=Pe.keywordPatternRe.exec(We),Ne="";for(;pe;){Ne+=We.substring(oe,pe.index);const Be=jt.case_insensitive?pe[0].toLowerCase():pe[0],pt=yt(Pe,Be);if(pt){const[Ft,Ma]=pt;if(ft.addText(Ne),Ne="",Qe[Be]=(Qe[Be]||0)+1,Qe[Be]<=sn&&(kr+=Ma),Ft.startsWith("_"))Ne+=pe[0];else{const Da=jt.classNameAliases[Ft]||Ft;mt(pe[0],Da)}}else Ne+=pe[0];oe=Pe.keywordPatternRe.lastIndex,pe=Pe.keywordPatternRe.exec(We)}Ne+=We.substring(oe),ft.addText(Ne)}function Ut(){if(We==="")return;let oe=null;if(typeof Pe.subLanguage=="string"){if(!Y[Pe.subLanguage]){ft.addText(We);return}oe=C(Pe.subLanguage,We,!0,ns[Pe.subLanguage]),ns[Pe.subLanguage]=oe._top}else oe=H(We,Pe.subLanguage.length?Pe.subLanguage:null);Pe.relevance>0&&(kr+=oe.relevance),ft.__addSublanguage(oe._emitter,oe.language)}function lt(){Pe.subLanguage!=null?Ut():Tt(),We=""}function mt(oe,pe){oe!==""&&(ft.startScope(pe),ft.addText(oe),ft.endScope())}function cr(oe,pe){let Ne=1;const Be=pe.length-1;for(;Ne<=Be;){if(!oe._emit[Ne]){Ne++;continue}const pt=jt.classNameAliases[oe[Ne]]||oe[Ne],Ft=pe[Ne];pt?mt(Ft,pt):(We=Ft,Tt(),We=""),Ne++}}function lr(oe,pe){return oe.scope&&typeof oe.scope=="string"&&ft.openNode(jt.classNameAliases[oe.scope]||oe.scope),oe.beginScope&&(oe.beginScope._wrap?(mt(We,jt.classNameAliases[oe.beginScope._wrap]||oe.beginScope._wrap),We=""):oe.beginScope._multi&&(cr(oe.beginScope,pe),We="")),Pe=Object.create(oe,{parent:{value:Pe}}),Pe}function Gt(oe,pe,Ne){let Be=p(oe.endRe,Ne);if(Be){if(oe["on:end"]){const pt=new e(oe);oe["on:end"](pe,pt),pt.isMatchIgnored&&(Be=!1)}if(Be){for(;oe.endsParent&&oe.parent;)oe=oe.parent;return oe}}if(oe.endsWithParent)return Gt(oe.parent,pe,Ne)}function Ra(oe){return Pe.matcher.regexIndex===0?(We+=oe[0],1):(cn=!0,0)}function Ia(oe){const pe=oe[0],Ne=oe.rule,Be=new e(Ne),pt=[Ne.__beforeBegin,Ne["on:begin"]];for(const Ft of pt)if(Ft&&(Ft(oe,Be),Be.isMatchIgnored))return Ra(pe);return Ne.skip?We+=pe:(Ne.excludeBegin&&(We+=pe),lt(),!Ne.returnBegin&&!Ne.excludeBegin&&(We=pe)),lr(Ne,oe),Ne.returnBegin?0:pe.length}function Ca(oe){const pe=oe[0],Ne=le.substring(oe.index),Be=Gt(Pe,oe,Ne);if(!Be)return Er;const pt=Pe;Pe.endScope&&Pe.endScope._wrap?(lt(),mt(pe,Pe.endScope._wrap)):Pe.endScope&&Pe.endScope._multi?(lt(),cr(Pe.endScope,oe)):pt.skip?We+=pe:(pt.returnEnd||pt.excludeEnd||(We+=pe),lt(),pt.excludeEnd&&(We=pe));do Pe.scope&&ft.closeNode(),!Pe.skip&&!Pe.subLanguage&&(kr+=Pe.relevance),Pe=Pe.parent;while(Pe!==Be.parent);return Be.starts&&lr(Be.starts,oe),pt.returnEnd?0:pe.length}function Aa(){const oe=[];for(let pe=Pe;pe!==jt;pe=pe.parent)pe.scope&&oe.unshift(pe.scope);oe.forEach(pe=>ft.openNode(pe))}let Pr={};function rs(oe,pe){const Ne=pe&&pe[0];if(We+=oe,Ne==null)return lt(),0;if(Pr.type==="begin"&&pe.type==="end"&&Pr.index===pe.index&&Ne===""){if(We+=le.slice(pe.index,pe.index+1),!Je){const Be=new Error(`0 width match regex (${Z})`);throw Be.languageName=Z,Be.badRule=Pr.rule,Be}return 1}if(Pr=pe,pe.type==="begin")return Ia(pe);if(pe.type==="illegal"&&!Se){const Be=new Error('Illegal lexeme "'+Ne+'" for mode "'+(Pe.scope||"<unnamed>")+'"');throw Be.mode=Pe,Be}else if(pe.type==="end"){const Be=Ca(pe);if(Be!==Er)return Be}if(pe.type==="illegal"&&Ne==="")return We+=`
|
|
5
5
|
`,1;if(on>1e5&&on>pe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return We+=Ne,Ne.length}const jt=Le(Z);if(!jt)throw Ie(Ye.replace("{}",Z)),new Error('Unknown language: "'+Z+'"');const ja=Yt(jt);let an="",Pe=Me||ja;const ns={},ft=new ce.__emitter(ce);Aa();let We="",kr=0,Zt=0,on=0,cn=!1;try{if(jt.__emitTokens)jt.__emitTokens(le,ft);else{for(Pe.matcher.considerAll();;){on++,cn?cn=!1:Pe.matcher.considerAll(),Pe.matcher.lastIndex=Zt;const oe=Pe.matcher.exec(le);if(!oe)break;const pe=le.substring(Zt,oe.index),Ne=rs(pe,oe);Zt=oe.index+Ne}rs(le.substring(Zt))}return ft.finalize(),an=ft.toHTML(),{language:Z,value:an,relevance:kr,illegal:!1,_emitter:ft,_top:Pe}}catch(oe){if(oe.message&&oe.message.includes("Illegal"))return{language:Z,value:or(le),illegal:!0,relevance:0,_illegalBy:{message:oe.message,index:Zt,context:le.slice(Zt-100,Zt+100),mode:oe.mode,resultSoFar:an},_emitter:ft};if(Je)return{language:Z,value:or(le),illegal:!1,relevance:0,errorRaised:oe,_emitter:ft,_top:Pe};throw oe}}function U(Z){const le={value:or(Z),illegal:!1,relevance:0,_top:ue,_emitter:new ce.__emitter(ce)};return le._emitter.addText(Z),le}function H(Z,le){le=le||ce.languages||Object.keys(Y);const Se=U(Z),Me=le.filter(Le).filter(Ge).map(lt=>C(lt,Z,!1));Me.unshift(Se);const Qe=Me.sort((lt,mt)=>{if(lt.relevance!==mt.relevance)return mt.relevance-lt.relevance;if(lt.language&&mt.language){if(Le(lt.language).supersetOf===mt.language)return 1;if(Le(mt.language).supersetOf===lt.language)return-1}return 0}),[yt,Tt]=Qe,Ut=yt;return Ut.secondBest=Tt,Ut}function K(Z,le,Se){const Me=le&&ne[le]||Se;Z.classList.add("hljs"),Z.classList.add(`language-${Me}`)}function de(Z){let le=null;const Se=it(Z);if(ye(Se))return;if(Nt("before:highlightElement",{el:Z,language:Se}),Z.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Z);return}if(Z.children.length>0&&(ce.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Z)),ce.throwUnescapedHTML))throw new bt("One of your code blocks includes unescaped HTML.",Z.innerHTML);le=Z;const Me=le.textContent,Qe=Se?D(Me,{language:Se,ignoreIllegals:!0}):H(Me);Z.innerHTML=Qe.value,Z.dataset.highlighted="yes",K(Z,Se,Qe.language),Z.result={language:Qe.language,re:Qe.relevance,relevance:Qe.relevance},Qe.secondBest&&(Z.secondBest={language:Qe.secondBest.language,relevance:Qe.secondBest.relevance}),Nt("after:highlightElement",{el:Z,result:Qe,text:Me})}function ge(Z){ce=br(ce,Z)}const je=()=>{ke(),Xe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ke(){ke(),Xe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ze=!1;function ke(){function Z(){ke()}if(document.readyState==="loading"){Ze||window.addEventListener("DOMContentLoaded",Z,!1),Ze=!0;return}document.querySelectorAll(ce.cssSelector).forEach(de)}function He(Z,le){let Se=null;try{Se=le(q)}catch(Me){if(Ie("Language definition for '{}' could not be registered.".replace("{}",Z)),Je)Ie(Me);else throw Me;Se=ue}Se.name||(Se.name=Z),Y[Z]=Se,Se.rawDefinition=le.bind(null,q),Se.aliases&&rt(Se.aliases,{languageName:Z})}function tt(Z){delete Y[Z];for(const le of Object.keys(ne))ne[le]===Z&&delete ne[le]}function be(){return Object.keys(Y)}function Le(Z){return Z=(Z||"").toLowerCase(),Y[Z]||Y[ne[Z]]}function rt(Z,{languageName:le}){typeof Z=="string"&&(Z=[Z]),Z.forEach(Se=>{ne[Se.toLowerCase()]=le})}function Ge(Z){const le=Le(Z);return le&&!le.disableAutodetect}function At(Z){Z["before:highlightBlock"]&&!Z["before:highlightElement"]&&(Z["before:highlightElement"]=le=>{Z["before:highlightBlock"](Object.assign({block:le.el},le))}),Z["after:highlightBlock"]&&!Z["after:highlightElement"]&&(Z["after:highlightElement"]=le=>{Z["after:highlightBlock"](Object.assign({block:le.el},le))})}function Et(Z){At(Z),$e.push(Z)}function St(Z){const le=$e.indexOf(Z);le!==-1&&$e.splice(le,1)}function Nt(Z,le){const Se=Z;$e.forEach(function(Me){Me[Se]&&Me[Se](le)})}function Vt(Z){return Xe("10.7.0","highlightBlock will be removed entirely in v12.0"),Xe("10.7.0","Please use highlightElement now."),de(Z)}Object.assign(q,{highlight:D,highlightAuto:H,highlightAll:ke,highlightElement:de,highlightBlock:Vt,configure:ge,initHighlighting:je,initHighlightingOnLoad:Ke,registerLanguage:He,unregisterLanguage:tt,listLanguages:be,getLanguage:Le,registerAliases:rt,autoDetection:Ge,inherit:br,addPlugin:Et,removePlugin:St}),q.debugMode=function(){Je=!1},q.safeMode=function(){Je=!0},q.versionString=$r,q.regex={concat:E,lookahead:w,either:o,optional:b,anyNumberOfTimes:P};for(const Z in re)typeof re[Z]=="object"&&t(re[Z]);return Object.assign(q,re),q},Kt=Sr({});return Kt.newInstance=()=>Sr({}),dn=Kt,Kt.HighlightJS=Kt,Kt.default=Kt,dn}var Hi=Bi();const fs=xi(Hi);var Ki=at("<pre><code><!></code></pre>");function Gi(t,e){const r=qr(e,["children","$$slots","$$events","$$legacy"]),n=qr(r,["code","highlighted","languageName","langtag"]);let s=rr(e,"code",8),l=rr(e,"highlighted",8),a=rr(e,"languageName",8,"plaintext"),u=rr(e,"langtag",8,!1);var i=Ki();gi(i,()=>({"data-language":a(),...n,[vi]:{langtag:u()}}),void 0,void 0,void 0,"svelte-4jgeki");var h=me(i);mr(h,1,"",null,{},{hljs:!0});var c=me(h);{var d=P=>{var b=zt(),E=gt(b);Ls(E,l),Ve(P,b)},w=P=>{var b=Ts();ut(()=>et(b,s())),Ve(P,b)};dt(c,P=>{l()?P(d):P(w,!1)})}he(h),he(i),Ve(t,i)}function ds(t,e){const r=qr(e,["children","$$slots","$$events","$$legacy"]),n=qr(r,["language","code","langtag"]);Bt(e,!1);let s=rr(e,"language",8),l=rr(e,"code",8),a=rr(e,"langtag",8,!1);const u=ui();let i=Is("");fi(()=>{ae(i)&&u("highlight",{highlighted:ae(i)})}),ai(()=>(un(s()),un(l())),()=>{fs.registerLanguage(s().name,s().register),_t(i,fs.highlight(l(),{language:s().name}).value)}),ii(),Ds();var h=zt(),c=gt(h);$i(c,e,"default",{get highlighted(){return ae(i)}},d=>{Gi(d,pi(()=>n,{get languageName(){return un(s()),oi(()=>s().name)},get langtag(){return a()},get highlighted(){return ae(i)},get code(){return l()}}))}),Ve(t,h),Ht()}function Wi(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],s={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,s,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const hs={name:"json",register:Wi},Us=yr({}),Fs=yr({});let Lr=0;function hn(t,e,r=!1){let n;const s=++Lr;e.id?n=e.id:n=`${s}`,e.id=n,r&&(n=`${n}-${++Lr}`);const l=Date.now();return Fs.update(a=>(a[n]||(a[n]={timestamp:l,sortKey:s}),a)),Us.update(a=>{if(!a[n])t==="SEND"?a[n]=[e,{}]:a[n]=[{},e];else{const u=t==="SEND"?0:1;a[n][u]=e}return a}),e}const zs=yr([]);function pn(t,e){const r={_logType:t,_logId:`${t}-${++Lr}`,_sortKey:Lr,_timestamp:Date.now(),payload:e};zs.update(n=>[r,...n])}var Ji=at(`<style>body {
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
}</style>`),Qi=at('<div class="p-8 text-center text-gray-500"><div class="text-4xl mb-2">📭</div> <p class="font-medium">No activity yet</p> <p class="text-sm">Activity will appear here when you interact with Sockethub</p></div>'),Xi=at('<ul class="divide-y divide-gray-100"></ul>'),Yi=at('<div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-lg p-4"><h4 class="font-semibold text-green-900 mb-3 flex items-center"><span class="mr-2">📥</span> Response from Sockethub</h4> <div class="bg-white rounded border border-green-200 overflow-hidden"><!></div></div>'),Zi=at(`<div class="bg-gradient-to-r from-slate-50 to-gray-50 border border-gray-200 rounded-xl p-6 shadow-sm"><div class="flex items-center justify-between mb-4"><div><h3 class="text-xl font-bold text-gray-900 flex items-center"><span class="mr-2">📡</span> Sockethub Activity Log</h3> <p class="text-gray-600 text-sm mt-1">Real-time communication between your browser and Sockethub server</p></div> <div class="flex items-center space-x-4 text-xs"><div class="flex items-center space-x-1"><div class="w-3 h-3 bg-orange-400 rounded-full"></div> <span class="text-gray-600">Pending</span></div> <div class="flex items-center space-x-1"><div class="w-3 h-3 bg-green-500 rounded-full"></div> <span class="text-gray-600">Complete</span></div> <div class="flex items-center space-x-1"><div class="w-3 h-3 bg-indigo-500 rounded-full"></div> <span class="text-gray-600">Schema</span></div></div></div> <div class="bg-white rounded-lg border border-gray-200 shadow-sm"><div class="p-4 border-b border-gray-200 bg-gray-50 rounded-t-lg"><p class="text-sm text-gray-700">💡 <strong>How to read this log:</strong> Each entry shows messages sent to and received from Sockethub.
|
|
8
|
-
Click "View Details" to see the full JSON data being exchanged.</p></div> <div id="messages" class="max-h-96 overflow-y-auto"><!></div></div></div> <div><div class="bg-white rounded-xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col"><div class="bg-gradient-to-r from-indigo-50 to-purple-50 px-6 py-4 border-b border-gray-200"><div class="flex items-center justify-between"><h3 class="text-lg font-bold text-gray-900 flex items-center"><span class="mr-2">🔍</span> </h3> <button type="button" aria-label="Close activity log details" class="text-gray-400 hover:text-gray-600 transition-colors"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <p class="text-gray-600 text-sm mt-1">Raw JSON data showing the ActivityStreams message exchange with Sockethub</p></div> <div class="flex-1 overflow-auto p-6 space-y-6"><div class="bg-gradient-to-r from-blue-50 to-cyan-50 border border-blue-200 rounded-lg p-4"><h4 class="font-semibold text-blue-900 mb-3 flex items-center"><span class="mr-2"> </span> </h4> <div class="bg-white rounded border border-blue-200 overflow-hidden"><!></div></div> <!></div> <div class="bg-gray-50 px-6 py-4 border-t border-gray-200 flex justify-end"><button class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors font-medium">Close</button></div></div></div>`,1);function sf(t,e){Bt(e,!0);let r=er(fn({})),n=er(fn({})),s=er(fn([])),l=er(!1),a=er(""),u=er(""),i=er("ActivityStreams Data Exchange");Us.subscribe(M=>{_t(r,M,!0)}),Fs.subscribe(M=>{_t(n,M,!0)}),zs.subscribe(M=>{_t(s,M,!0)});const h=st(()=>{const M=[];for(const[R,g]of Object.entries(ae(r)??{})){const k=ae(n)[R];M.push({kind:"activity",id:R,sortKey:(k==null?void 0:k.sortKey)??0,tuple:g,timestamp:(k==null?void 0:k.timestamp)??0})}for(const R of ae(s))M.push({kind:"schema",sortKey:R._sortKey,entry:R});return M.sort((R,g)=>g.sortKey-R.sortKey),M});function c(M){return()=>{var A;let R=M,g=M;M.includes("-")&&(R=M.split("-")[0]),console.log(`indexSend:${R} indexResp:${g}`),console.log("logs: ",ae(r)),_t(i,"ActivityStreams Data Exchange"),_t(l,!0),_t(a,JSON.stringify(ae(r)[R][0],null,2),!0);const k=(A=ae(r)[g])==null?void 0:A[1];_t(u,k&&Object.keys(k).length>0?JSON.stringify(k,null,2):"",!0)}}function d(M){return()=>{_t(i,`Schema Event: ${M._logType}`),_t(l,!0),_t(a,JSON.stringify(M.payload,null,2),!0),_t(u,"")}}var w=Zi();bi("asm1x0",M=>{var R=zt(),g=gt(R);{var k=A=>{var W=Ji();Ve(A,W)};dt(g,A=>{ae(l)&&A(k)})}Ve(M,R)});var P=gt(w),b=qe(me(P),2),E=qe(me(b),2),m=me(E);{var o=M=>{var R=Qi();Ve(M,R)},_=M=>{var R=Xi();Pn(R,21,()=>ae(h),g=>g.kind==="schema"?g.entry._logId:g.id,(g,k)=>{var A=zt(),W=gt(A);{var Q=re=>{{let ve=st(()=>d(ae(k).entry));zi(re,{get entry(){return ae(k).entry},get buttonAction(){return ae(ve)}})}},ie=re=>{var ve=zt(),N=gt(ve);{var I=z=>{var J=zt(),te=gt(J);Pn(te,17,()=>Object.entries(ae(k).tuple[ae(k).tuple.length-1]),qs,(Ee,Fe)=>{var Re=st(()=>ci(ae(Fe),2));let Ae=()=>ae(Re)[0],_e=()=>ae(Re)[1];var xe=zt(),Ie=gt(xe);{var vt=Xe=>{{let ht=st(()=>c(`${ae(k).id}-${Ae()}`)),$t=st(()=>Object.prototype.hasOwnProperty.call(ae(k).tuple[0],"@context")),ct=st(()=>typeof ae(r)[ae(k).id][1]<"u"),wt=st(()=>`${ae(k).id}-${Ae()}`);ls(Xe,{get buttonAction(){return ae(ht)},get hasSend(){return ae($t)},get hasResponse(){return ae(ct)},get id(){return ae(wt)},get entry(){return _e()},get timestamp(){return ae(k).timestamp}})}};dt(Ie,Xe=>{_e()&&Xe(vt)})}Ve(Ee,xe)}),Ve(z,J)},L=z=>{const J=st(()=>Object.prototype.hasOwnProperty.call(ae(k).tuple[0],"@context")),te=st(()=>Object.prototype.hasOwnProperty.call(ae(k).tuple[1],"@context"));{let Ee=st(()=>c(ae(k).id)),Fe=st(()=>ae(te)?ae(k).tuple[1]:ae(k).tuple[0]);ls(z,{get buttonAction(){return ae(Ee)},get id(){return ae(k).id},get hasSend(){return ae(J)},get hasResponse(){return ae(te)},get entry(){return ae(Fe)},get timestamp(){return ae(k).timestamp}})}};dt(N,z=>{Array.isArray(ae(k).tuple[ae(k).tuple.length-1])?z(I):z(L,!1)},!0)}Ve(re,ve)};dt(W,re=>{ae(k).kind==="schema"?re(Q):re(ie,!1)})}Ve(g,A)}),he(R),Ve(M,R)};dt(m,M=>{ae(h).length===0?M(o):M(_,!1)})}he(E),he(b),he(P);var p=qe(P,2),v=me(p),$=me(v),y=me($),f=me(y),S=qe(me(f));he(f);var O=qe(f,2);O.__click=()=>_t(l,!1),he(y),Ms(2),he($);var j=qe($,2),F=me(j),V=me(F),X=me(V),G=me(X,!0);he(X);var ee=qe(X);he(V);var fe=qe(V,2),we=me(fe);ds(we,{get language(){return hs},get code(){return ae(a)}}),he(fe),he(F);var Oe=qe(F,2);{var se=M=>{var R=Yi(),g=qe(me(R),2),k=me(g);ds(k,{get language(){return hs},get code(){return ae(u)}}),he(g),he(R),Ve(M,R)};dt(Oe,M=>{ae(u)&&M(se)})}he(j);var x=qe(j,2),T=me(x);T.__click=()=>_t(l,!1),he(x),he(v),he(p),ut(()=>{mr(p,1,`${ae(l)?"flex items-center justify-center":"hidden"} bg-black bg-opacity-50 fixed top-0 left-0 w-full h-full z-50 p-4`),et(S,` ${ae(i)??""}`),et(G,ae(u)?"📤":"📋"),et(ee,` ${ae(u)?"Sent to Sockethub":"Event Payload"}`)}),Ve(t,w),Ht()}jn(["click"]);var ps="https://sockethub.org/ns/context/platform/";function Vr(t){if(Array.isArray(t)){for(const e of t)if(typeof e=="string"&&e.startsWith(ps)){const r=e.slice(ps.length),n=r.indexOf("/");if(n>0)return r.slice(0,n)}}}var eo=Object.create,to=Object.getPrototypeOf,gr=Object.defineProperty,xs=Object.getOwnPropertyNames,ro=Object.getOwnPropertyDescriptor,Bs=Object.prototype.hasOwnProperty;function Hs(t){return this[t]}var no,Hr=(t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var s=no??(no=new WeakMap),l=s.get(t);if(l)return l}r=t!=null?eo(to(t)):{};const a=gr(r,"default",{value:t,enumerable:!0});for(let u of xs(t))Bs.call(a,u)||gr(a,u,{get:Hs.bind(t,u),enumerable:!0});return n&&s.set(t,a),a},so=t=>{var e=(ms??(ms=new WeakMap)).get(t),r;if(e)return e;if(e=gr({},"__esModule",{value:!0}),t&&typeof t=="object"||typeof t=="function")for(var n of xs(t))Bs.call(e,n)||gr(e,n,{get:Hs.bind(t,n),enumerable:!(r=ro(t,n))||r.enumerable});return ms.set(t,e),e},ms,B=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ao=t=>t;function io(t,e){this[t]=ao.bind(null,e)}var oo=(t,e)=>{for(var r in e)gr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:io.bind(e,r)})},co=(t,e)=>()=>(t&&(e=t(t=0)),e),Ur=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(_){if(super(),!t.IDENTIFIER.test(_))throw new Error("CodeGen: name must be a valid identifier");this.str=_}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(_){super(),this._items=typeof _=="string"?[_]:_}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const _=this._items[0];return _===""||_==='""'}get str(){var _;return(_=this._str)!==null&&_!==void 0?_:this._str=this._items.reduce((p,v)=>`${p}${v}`,"")}get names(){var _;return(_=this._names)!==null&&_!==void 0?_:this._names=this._items.reduce((p,v)=>(v instanceof r&&(p[v.str]=(p[v.str]||0)+1),p),{})}}t._Code=n,t.nil=new n("");function s(o,..._){const p=[o[0]];let v=0;for(;v<_.length;)u(p,_[v]),p.push(o[++v]);return new n(p)}t._=s;var l=new n("+");function a(o,..._){const p=[P(o[0])];let v=0;for(;v<_.length;)p.push(l),u(p,_[v]),p.push(l,P(o[++v]));return i(p),new n(p)}t.str=a;function u(o,_){_ instanceof n?o.push(..._._items):_ instanceof r?o.push(_):o.push(d(_))}t.addCodeArg=u;function i(o){let _=1;for(;_<o.length-1;){if(o[_]===l){const p=h(o[_-1],o[_+1]);if(p!==void 0){o.splice(_-1,3,p);continue}o[_++]="+"}_++}}function h(o,_){if(_==='""')return o;if(o==='""')return _;if(typeof o=="string")return _ instanceof r||o[o.length-1]!=='"'?void 0:typeof _!="string"?`${o.slice(0,-1)}${_}"`:_[0]==='"'?o.slice(0,-1)+_.slice(1):void 0;if(typeof _=="string"&&_[0]==='"'&&!(o instanceof r))return`"${o}${_.slice(1)}`}function c(o,_){return _.emptyStr()?o:o.emptyStr()?_:a`${o}${_}`}t.strConcat=c;function d(o){return typeof o=="number"||typeof o=="boolean"||o===null?o:P(Array.isArray(o)?o.join(","):o)}function w(o){return new n(P(o))}t.stringify=w;function P(o){return JSON.stringify(o).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=P;function b(o){return typeof o=="string"&&t.IDENTIFIER.test(o)?new n(`.${o}`):s`[${o}]`}t.getProperty=b;function E(o){if(typeof o=="string"&&t.IDENTIFIER.test(o))return new n(`${o}`);throw new Error(`CodeGen: invalid export name: ${o}, use explicit $id name mapping`)}t.getEsmExportName=E;function m(o){return new n(o.toString())}t.regexpCode=m}),gs=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=Ur();class r extends Error{constructor(h){super(`CodeGen: "code" for ${h} not defined`),this.value=h.value}}var n;(function(i){i[i.Started=0]="Started",i[i.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:h,parent:c}={}){this._names={},this._prefixes=h,this._parent=c}toName(h){return h instanceof e.Name?h:this.name(h)}name(h){return new e.Name(this._newName(h))}_newName(h){const c=this._names[h]||this._nameGroup(h);return`${h}${c.index++}`}_nameGroup(h){var c,d;if(!((d=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||d===void 0)&&d.has(h)||this._prefixes&&!this._prefixes.has(h))throw new Error(`CodeGen: prefix "${h}" is not allowed in this scope`);return this._names[h]={prefix:h,index:0}}}t.Scope=s;class l extends e.Name{constructor(h,c){super(c),this.prefix=h}setValue(h,{property:c,itemIndex:d}){this.value=h,this.scopePath=(0,e._)`.${new e.Name(c)}[${d}]`}}t.ValueScopeName=l;var a=(0,e._)`\n`;class u extends s{constructor(h){super(h),this._values={},this._scope=h.scope,this.opts={...h,_n:h.lines?a:e.nil}}get(){return this._scope}name(h){return new l(h,this._newName(h))}value(h,c){var d;if(c.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(h),{prefix:P}=w,b=(d=c.key)!==null&&d!==void 0?d:c.ref;let E=this._values[P];if(E){const _=E.get(b);if(_)return _}else E=this._values[P]=new Map;E.set(b,w);const m=this._scope[P]||(this._scope[P]=[]),o=m.length;return m[o]=c.ref,w.setValue(c,{property:P,itemIndex:o}),w}getValue(h,c){const d=this._values[h];if(d)return d.get(c)}scopeRefs(h,c=this._values){return this._reduceValues(c,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,e._)`${h}${d.scopePath}`})}scopeCode(h=this._values,c,d){return this._reduceValues(h,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},c,d)}_reduceValues(h,c,d={},w){let P=e.nil;for(const b in h){const E=h[b];if(!E)continue;const m=d[b]=d[b]||new Map;E.forEach(o=>{if(m.has(o))return;m.set(o,n.Started);let _=c(o);if(_){const p=this.opts.es5?t.varKinds.var:t.varKinds.const;P=(0,e._)`${P}${p} ${o} = ${_};${this.opts._n}`}else if(_=w==null?void 0:w(o))P=(0,e._)`${P}${_}${this.opts._n}`;else throw new r(o);m.set(o,n.Completed)})}return P}}t.ValueScope=u}),Ce=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=Ur(),r=gs(),n=Ur();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var s=gs();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class l{optimizeNodes(){return this}optimizeNames(g,k){return this}}class a extends l{constructor(g,k,A){super(),this.varKind=g,this.name=k,this.rhs=A}render({es5:g,_n:k}){const A=g?r.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${A} ${this.name}${W};`+k}optimizeNames(g,k){if(g[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,g,k)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class u extends l{constructor(g,k,A){super(),this.lhs=g,this.rhs=k,this.sideEffects=A}render({_n:g}){return`${this.lhs} = ${this.rhs};`+g}optimizeNames(g,k){if(!(this.lhs instanceof e.Name&&!g[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,g,k),this}get names(){const g=this.lhs instanceof e.Name?{}:{...this.lhs.names};return X(g,this.rhs)}}class i extends u{constructor(g,k,A,W){super(g,A,W),this.op=k}render({_n:g}){return`${this.lhs} ${this.op}= ${this.rhs};`+g}}class h extends l{constructor(g){super(),this.label=g,this.names={}}render({_n:g}){return`${this.label}:`+g}}class c extends l{constructor(g){super(),this.label=g,this.names={}}render({_n:g}){return`break${this.label?` ${this.label}`:""};`+g}}class d extends l{constructor(g){super(),this.error=g}render({_n:g}){return`throw ${this.error};`+g}get names(){return this.error.names}}class w extends l{constructor(g){super(),this.code=g}render({_n:g}){return`${this.code};`+g}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(g,k){return this.code=G(this.code,g,k),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class P extends l{constructor(g=[]){super(),this.nodes=g}render(g){return this.nodes.reduce((k,A)=>k+A.render(g),"")}optimizeNodes(){const{nodes:g}=this;let k=g.length;for(;k--;){const A=g[k].optimizeNodes();Array.isArray(A)?g.splice(k,1,...A):A?g[k]=A:g.splice(k,1)}return g.length>0?this:void 0}optimizeNames(g,k){const{nodes:A}=this;let W=A.length;for(;W--;){const Q=A[W];Q.optimizeNames(g,k)||(ee(g,Q.names),A.splice(W,1))}return A.length>0?this:void 0}get names(){return this.nodes.reduce((g,k)=>V(g,k.names),{})}}class b extends P{render(g){return"{"+g._n+super.render(g)+"}"+g._n}}class E extends P{}class m extends b{}m.kind="else";class o extends b{constructor(g,k){super(k),this.condition=g}render(g){let k=`if(${this.condition})`+super.render(g);return this.else&&(k+="else "+this.else.render(g)),k}optimizeNodes(){super.optimizeNodes();const g=this.condition;if(g===!0)return this.nodes;let k=this.else;if(k){const A=k.optimizeNodes();k=this.else=Array.isArray(A)?new m(A):A}if(k)return g===!1?k instanceof o?k:k.nodes:this.nodes.length?this:new o(fe(g),k instanceof o?[k]:k.nodes);if(!(g===!1||!this.nodes.length))return this}optimizeNames(g,k){var A;if(this.else=(A=this.else)===null||A===void 0?void 0:A.optimizeNames(g,k),!!(super.optimizeNames(g,k)||this.else))return this.condition=G(this.condition,g,k),this}get names(){const g=super.names;return X(g,this.condition),this.else&&V(g,this.else.names),g}}o.kind="if";class _ extends b{}_.kind="for";class p extends _{constructor(g){super(),this.iteration=g}render(g){return`for(${this.iteration})`+super.render(g)}optimizeNames(g,k){if(super.optimizeNames(g,k))return this.iteration=G(this.iteration,g,k),this}get names(){return V(super.names,this.iteration.names)}}class v extends _{constructor(g,k,A,W){super(),this.varKind=g,this.name=k,this.from=A,this.to=W}render(g){const k=g.es5?r.varKinds.var:this.varKind,{name:A,from:W,to:Q}=this;return`for(${k} ${A}=${W}; ${A}<${Q}; ${A}++)`+super.render(g)}get names(){const g=X(super.names,this.from);return X(g,this.to)}}class $ extends _{constructor(g,k,A,W){super(),this.loop=g,this.varKind=k,this.name=A,this.iterable=W}render(g){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(g)}optimizeNames(g,k){if(super.optimizeNames(g,k))return this.iterable=G(this.iterable,g,k),this}get names(){return V(super.names,this.iterable.names)}}class y extends b{constructor(g,k,A){super(),this.name=g,this.args=k,this.async=A}render(g){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(g)}}y.kind="func";class f extends P{render(g){return"return "+super.render(g)}}f.kind="return";class S extends b{render(g){let k="try"+super.render(g);return this.catch&&(k+=this.catch.render(g)),this.finally&&(k+=this.finally.render(g)),k}optimizeNodes(){var g,k;return super.optimizeNodes(),(g=this.catch)===null||g===void 0||g.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(g,k){var A,W;return super.optimizeNames(g,k),(A=this.catch)===null||A===void 0||A.optimizeNames(g,k),(W=this.finally)===null||W===void 0||W.optimizeNames(g,k),this}get names(){const g=super.names;return this.catch&&V(g,this.catch.names),this.finally&&V(g,this.finally.names),g}}class O extends b{constructor(g){super(),this.error=g}render(g){return`catch(${this.error})`+super.render(g)}}O.kind="catch";class j extends b{render(g){return"finally"+super.render(g)}}j.kind="finally";class F{constructor(g,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
8
|
+
Click "View Details" to see the full JSON data being exchanged.</p></div> <div id="messages" class="max-h-96 overflow-y-auto"><!></div></div></div> <div><div class="bg-white rounded-xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col"><div class="bg-gradient-to-r from-indigo-50 to-purple-50 px-6 py-4 border-b border-gray-200"><div class="flex items-center justify-between"><h3 class="text-lg font-bold text-gray-900 flex items-center"><span class="mr-2">🔍</span> </h3> <button type="button" aria-label="Close activity log details" class="text-gray-400 hover:text-gray-600 transition-colors"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <p class="text-gray-600 text-sm mt-1">Raw JSON data showing the ActivityStreams message exchange with Sockethub</p></div> <div class="flex-1 overflow-auto p-6 space-y-6"><div class="bg-gradient-to-r from-blue-50 to-cyan-50 border border-blue-200 rounded-lg p-4"><h4 class="font-semibold text-blue-900 mb-3 flex items-center"><span class="mr-2"> </span> </h4> <div class="bg-white rounded border border-blue-200 overflow-hidden"><!></div></div> <!></div> <div class="bg-gray-50 px-6 py-4 border-t border-gray-200 flex justify-end"><button class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors font-medium">Close</button></div></div></div>`,1);function cf(t,e){Bt(e,!0);let r=er(fn({})),n=er(fn({})),s=er(fn([])),l=er(!1),a=er(""),u=er(""),i=er("ActivityStreams Data Exchange");Us.subscribe(M=>{_t(r,M,!0)}),Fs.subscribe(M=>{_t(n,M,!0)}),zs.subscribe(M=>{_t(s,M,!0)});const h=st(()=>{const M=[];for(const[R,g]of Object.entries(ae(r)??{})){const k=ae(n)[R];M.push({kind:"activity",id:R,sortKey:(k==null?void 0:k.sortKey)??0,tuple:g,timestamp:(k==null?void 0:k.timestamp)??0})}for(const R of ae(s))M.push({kind:"schema",sortKey:R._sortKey,entry:R});return M.sort((R,g)=>g.sortKey-R.sortKey),M});function c(M){return()=>{var A;let R=M,g=M;M.includes("-")&&(R=M.split("-")[0]),console.log(`indexSend:${R} indexResp:${g}`),console.log("logs: ",ae(r)),_t(i,"ActivityStreams Data Exchange"),_t(l,!0),_t(a,JSON.stringify(ae(r)[R][0],null,2),!0);const k=(A=ae(r)[g])==null?void 0:A[1];_t(u,k&&Object.keys(k).length>0?JSON.stringify(k,null,2):"",!0)}}function d(M){return()=>{_t(i,`Schema Event: ${M._logType}`),_t(l,!0),_t(a,JSON.stringify(M.payload,null,2),!0),_t(u,"")}}var w=Zi();bi("asm1x0",M=>{var R=zt(),g=gt(R);{var k=A=>{var W=Ji();Ve(A,W)};dt(g,A=>{ae(l)&&A(k)})}Ve(M,R)});var P=gt(w),b=qe(me(P),2),E=qe(me(b),2),m=me(E);{var o=M=>{var R=Qi();Ve(M,R)},_=M=>{var R=Xi();Pn(R,21,()=>ae(h),g=>g.kind==="schema"?g.entry._logId:g.id,(g,k)=>{var A=zt(),W=gt(A);{var Q=re=>{{let ve=st(()=>d(ae(k).entry));zi(re,{get entry(){return ae(k).entry},get buttonAction(){return ae(ve)}})}},ie=re=>{var ve=zt(),N=gt(ve);{var I=z=>{var J=zt(),te=gt(J);Pn(te,17,()=>Object.entries(ae(k).tuple[ae(k).tuple.length-1]),qs,(Ee,Fe)=>{var Re=st(()=>ci(ae(Fe),2));let Ae=()=>ae(Re)[0],_e=()=>ae(Re)[1];var xe=zt(),Ie=gt(xe);{var vt=Xe=>{{let ht=st(()=>c(`${ae(k).id}-${Ae()}`)),$t=st(()=>Object.prototype.hasOwnProperty.call(ae(k).tuple[0],"@context")),ct=st(()=>typeof ae(r)[ae(k).id][1]<"u"),wt=st(()=>`${ae(k).id}-${Ae()}`);ls(Xe,{get buttonAction(){return ae(ht)},get hasSend(){return ae($t)},get hasResponse(){return ae(ct)},get id(){return ae(wt)},get entry(){return _e()},get timestamp(){return ae(k).timestamp}})}};dt(Ie,Xe=>{_e()&&Xe(vt)})}Ve(Ee,xe)}),Ve(z,J)},L=z=>{const J=st(()=>Object.prototype.hasOwnProperty.call(ae(k).tuple[0],"@context")),te=st(()=>Object.prototype.hasOwnProperty.call(ae(k).tuple[1],"@context"));{let Ee=st(()=>c(ae(k).id)),Fe=st(()=>ae(te)?ae(k).tuple[1]:ae(k).tuple[0]);ls(z,{get buttonAction(){return ae(Ee)},get id(){return ae(k).id},get hasSend(){return ae(J)},get hasResponse(){return ae(te)},get entry(){return ae(Fe)},get timestamp(){return ae(k).timestamp}})}};dt(N,z=>{Array.isArray(ae(k).tuple[ae(k).tuple.length-1])?z(I):z(L,!1)},!0)}Ve(re,ve)};dt(W,re=>{ae(k).kind==="schema"?re(Q):re(ie,!1)})}Ve(g,A)}),he(R),Ve(M,R)};dt(m,M=>{ae(h).length===0?M(o):M(_,!1)})}he(E),he(b),he(P);var p=qe(P,2),v=me(p),$=me(v),y=me($),f=me(y),S=qe(me(f));he(f);var O=qe(f,2);O.__click=()=>_t(l,!1),he(y),Ms(2),he($);var j=qe($,2),F=me(j),V=me(F),X=me(V),G=me(X,!0);he(X);var ee=qe(X);he(V);var fe=qe(V,2),we=me(fe);ds(we,{get language(){return hs},get code(){return ae(a)}}),he(fe),he(F);var Oe=qe(F,2);{var se=M=>{var R=Yi(),g=qe(me(R),2),k=me(g);ds(k,{get language(){return hs},get code(){return ae(u)}}),he(g),he(R),Ve(M,R)};dt(Oe,M=>{ae(u)&&M(se)})}he(j);var x=qe(j,2),T=me(x);T.__click=()=>_t(l,!1),he(x),he(v),he(p),ut(()=>{mr(p,1,`${ae(l)?"flex items-center justify-center":"hidden"} bg-black bg-opacity-50 fixed top-0 left-0 w-full h-full z-50 p-4`),et(S,` ${ae(i)??""}`),et(G,ae(u)?"📤":"📋"),et(ee,` ${ae(u)?"Sent to Sockethub":"Event Payload"}`)}),Ve(t,w),Ht()}jn(["click"]);var ps="https://sockethub.org/ns/context/platform/";function Vr(t){if(Array.isArray(t)){for(const e of t)if(typeof e=="string"&&e.startsWith(ps)){const r=e.slice(ps.length),n=r.indexOf("/");if(n>0)return r.slice(0,n)}}}var eo=Object.create,to=Object.getPrototypeOf,gr=Object.defineProperty,xs=Object.getOwnPropertyNames,ro=Object.getOwnPropertyDescriptor,Bs=Object.prototype.hasOwnProperty;function Hs(t){return this[t]}var no,Hr=(t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var s=no??(no=new WeakMap),l=s.get(t);if(l)return l}r=t!=null?eo(to(t)):{};const a=gr(r,"default",{value:t,enumerable:!0});for(let u of xs(t))Bs.call(a,u)||gr(a,u,{get:Hs.bind(t,u),enumerable:!0});return n&&s.set(t,a),a},so=t=>{var e=(ms??(ms=new WeakMap)).get(t),r;if(e)return e;if(e=gr({},"__esModule",{value:!0}),t&&typeof t=="object"||typeof t=="function")for(var n of xs(t))Bs.call(e,n)||gr(e,n,{get:Hs.bind(t,n),enumerable:!(r=ro(t,n))||r.enumerable});return ms.set(t,e),e},ms,B=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ao=t=>t;function io(t,e){this[t]=ao.bind(null,e)}var oo=(t,e)=>{for(var r in e)gr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:io.bind(e,r)})},co=(t,e)=>()=>(t&&(e=t(t=0)),e),Ur=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(_){if(super(),!t.IDENTIFIER.test(_))throw new Error("CodeGen: name must be a valid identifier");this.str=_}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(_){super(),this._items=typeof _=="string"?[_]:_}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const _=this._items[0];return _===""||_==='""'}get str(){var _;return(_=this._str)!==null&&_!==void 0?_:this._str=this._items.reduce((p,v)=>`${p}${v}`,"")}get names(){var _;return(_=this._names)!==null&&_!==void 0?_:this._names=this._items.reduce((p,v)=>(v instanceof r&&(p[v.str]=(p[v.str]||0)+1),p),{})}}t._Code=n,t.nil=new n("");function s(o,..._){const p=[o[0]];let v=0;for(;v<_.length;)u(p,_[v]),p.push(o[++v]);return new n(p)}t._=s;var l=new n("+");function a(o,..._){const p=[P(o[0])];let v=0;for(;v<_.length;)p.push(l),u(p,_[v]),p.push(l,P(o[++v]));return i(p),new n(p)}t.str=a;function u(o,_){_ instanceof n?o.push(..._._items):_ instanceof r?o.push(_):o.push(d(_))}t.addCodeArg=u;function i(o){let _=1;for(;_<o.length-1;){if(o[_]===l){const p=h(o[_-1],o[_+1]);if(p!==void 0){o.splice(_-1,3,p);continue}o[_++]="+"}_++}}function h(o,_){if(_==='""')return o;if(o==='""')return _;if(typeof o=="string")return _ instanceof r||o[o.length-1]!=='"'?void 0:typeof _!="string"?`${o.slice(0,-1)}${_}"`:_[0]==='"'?o.slice(0,-1)+_.slice(1):void 0;if(typeof _=="string"&&_[0]==='"'&&!(o instanceof r))return`"${o}${_.slice(1)}`}function c(o,_){return _.emptyStr()?o:o.emptyStr()?_:a`${o}${_}`}t.strConcat=c;function d(o){return typeof o=="number"||typeof o=="boolean"||o===null?o:P(Array.isArray(o)?o.join(","):o)}function w(o){return new n(P(o))}t.stringify=w;function P(o){return JSON.stringify(o).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=P;function b(o){return typeof o=="string"&&t.IDENTIFIER.test(o)?new n(`.${o}`):s`[${o}]`}t.getProperty=b;function E(o){if(typeof o=="string"&&t.IDENTIFIER.test(o))return new n(`${o}`);throw new Error(`CodeGen: invalid export name: ${o}, use explicit $id name mapping`)}t.getEsmExportName=E;function m(o){return new n(o.toString())}t.regexpCode=m}),gs=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=Ur();class r extends Error{constructor(h){super(`CodeGen: "code" for ${h} not defined`),this.value=h.value}}var n;(function(i){i[i.Started=0]="Started",i[i.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:h,parent:c}={}){this._names={},this._prefixes=h,this._parent=c}toName(h){return h instanceof e.Name?h:this.name(h)}name(h){return new e.Name(this._newName(h))}_newName(h){const c=this._names[h]||this._nameGroup(h);return`${h}${c.index++}`}_nameGroup(h){var c,d;if(!((d=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||d===void 0)&&d.has(h)||this._prefixes&&!this._prefixes.has(h))throw new Error(`CodeGen: prefix "${h}" is not allowed in this scope`);return this._names[h]={prefix:h,index:0}}}t.Scope=s;class l extends e.Name{constructor(h,c){super(c),this.prefix=h}setValue(h,{property:c,itemIndex:d}){this.value=h,this.scopePath=(0,e._)`.${new e.Name(c)}[${d}]`}}t.ValueScopeName=l;var a=(0,e._)`\n`;class u extends s{constructor(h){super(h),this._values={},this._scope=h.scope,this.opts={...h,_n:h.lines?a:e.nil}}get(){return this._scope}name(h){return new l(h,this._newName(h))}value(h,c){var d;if(c.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(h),{prefix:P}=w,b=(d=c.key)!==null&&d!==void 0?d:c.ref;let E=this._values[P];if(E){const _=E.get(b);if(_)return _}else E=this._values[P]=new Map;E.set(b,w);const m=this._scope[P]||(this._scope[P]=[]),o=m.length;return m[o]=c.ref,w.setValue(c,{property:P,itemIndex:o}),w}getValue(h,c){const d=this._values[h];if(d)return d.get(c)}scopeRefs(h,c=this._values){return this._reduceValues(c,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,e._)`${h}${d.scopePath}`})}scopeCode(h=this._values,c,d){return this._reduceValues(h,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},c,d)}_reduceValues(h,c,d={},w){let P=e.nil;for(const b in h){const E=h[b];if(!E)continue;const m=d[b]=d[b]||new Map;E.forEach(o=>{if(m.has(o))return;m.set(o,n.Started);let _=c(o);if(_){const p=this.opts.es5?t.varKinds.var:t.varKinds.const;P=(0,e._)`${P}${p} ${o} = ${_};${this.opts._n}`}else if(_=w==null?void 0:w(o))P=(0,e._)`${P}${_}${this.opts._n}`;else throw new r(o);m.set(o,n.Completed)})}return P}}t.ValueScope=u}),Ce=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=Ur(),r=gs(),n=Ur();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var s=gs();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class l{optimizeNodes(){return this}optimizeNames(g,k){return this}}class a extends l{constructor(g,k,A){super(),this.varKind=g,this.name=k,this.rhs=A}render({es5:g,_n:k}){const A=g?r.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${A} ${this.name}${W};`+k}optimizeNames(g,k){if(g[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,g,k)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class u extends l{constructor(g,k,A){super(),this.lhs=g,this.rhs=k,this.sideEffects=A}render({_n:g}){return`${this.lhs} = ${this.rhs};`+g}optimizeNames(g,k){if(!(this.lhs instanceof e.Name&&!g[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,g,k),this}get names(){const g=this.lhs instanceof e.Name?{}:{...this.lhs.names};return X(g,this.rhs)}}class i extends u{constructor(g,k,A,W){super(g,A,W),this.op=k}render({_n:g}){return`${this.lhs} ${this.op}= ${this.rhs};`+g}}class h extends l{constructor(g){super(),this.label=g,this.names={}}render({_n:g}){return`${this.label}:`+g}}class c extends l{constructor(g){super(),this.label=g,this.names={}}render({_n:g}){return`break${this.label?` ${this.label}`:""};`+g}}class d extends l{constructor(g){super(),this.error=g}render({_n:g}){return`throw ${this.error};`+g}get names(){return this.error.names}}class w extends l{constructor(g){super(),this.code=g}render({_n:g}){return`${this.code};`+g}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(g,k){return this.code=G(this.code,g,k),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class P extends l{constructor(g=[]){super(),this.nodes=g}render(g){return this.nodes.reduce((k,A)=>k+A.render(g),"")}optimizeNodes(){const{nodes:g}=this;let k=g.length;for(;k--;){const A=g[k].optimizeNodes();Array.isArray(A)?g.splice(k,1,...A):A?g[k]=A:g.splice(k,1)}return g.length>0?this:void 0}optimizeNames(g,k){const{nodes:A}=this;let W=A.length;for(;W--;){const Q=A[W];Q.optimizeNames(g,k)||(ee(g,Q.names),A.splice(W,1))}return A.length>0?this:void 0}get names(){return this.nodes.reduce((g,k)=>V(g,k.names),{})}}class b extends P{render(g){return"{"+g._n+super.render(g)+"}"+g._n}}class E extends P{}class m extends b{}m.kind="else";class o extends b{constructor(g,k){super(k),this.condition=g}render(g){let k=`if(${this.condition})`+super.render(g);return this.else&&(k+="else "+this.else.render(g)),k}optimizeNodes(){super.optimizeNodes();const g=this.condition;if(g===!0)return this.nodes;let k=this.else;if(k){const A=k.optimizeNodes();k=this.else=Array.isArray(A)?new m(A):A}if(k)return g===!1?k instanceof o?k:k.nodes:this.nodes.length?this:new o(fe(g),k instanceof o?[k]:k.nodes);if(!(g===!1||!this.nodes.length))return this}optimizeNames(g,k){var A;if(this.else=(A=this.else)===null||A===void 0?void 0:A.optimizeNames(g,k),!!(super.optimizeNames(g,k)||this.else))return this.condition=G(this.condition,g,k),this}get names(){const g=super.names;return X(g,this.condition),this.else&&V(g,this.else.names),g}}o.kind="if";class _ extends b{}_.kind="for";class p extends _{constructor(g){super(),this.iteration=g}render(g){return`for(${this.iteration})`+super.render(g)}optimizeNames(g,k){if(super.optimizeNames(g,k))return this.iteration=G(this.iteration,g,k),this}get names(){return V(super.names,this.iteration.names)}}class v extends _{constructor(g,k,A,W){super(),this.varKind=g,this.name=k,this.from=A,this.to=W}render(g){const k=g.es5?r.varKinds.var:this.varKind,{name:A,from:W,to:Q}=this;return`for(${k} ${A}=${W}; ${A}<${Q}; ${A}++)`+super.render(g)}get names(){const g=X(super.names,this.from);return X(g,this.to)}}class $ extends _{constructor(g,k,A,W){super(),this.loop=g,this.varKind=k,this.name=A,this.iterable=W}render(g){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(g)}optimizeNames(g,k){if(super.optimizeNames(g,k))return this.iterable=G(this.iterable,g,k),this}get names(){return V(super.names,this.iterable.names)}}class y extends b{constructor(g,k,A){super(),this.name=g,this.args=k,this.async=A}render(g){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(g)}}y.kind="func";class f extends P{render(g){return"return "+super.render(g)}}f.kind="return";class S extends b{render(g){let k="try"+super.render(g);return this.catch&&(k+=this.catch.render(g)),this.finally&&(k+=this.finally.render(g)),k}optimizeNodes(){var g,k;return super.optimizeNodes(),(g=this.catch)===null||g===void 0||g.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(g,k){var A,W;return super.optimizeNames(g,k),(A=this.catch)===null||A===void 0||A.optimizeNames(g,k),(W=this.finally)===null||W===void 0||W.optimizeNames(g,k),this}get names(){const g=super.names;return this.catch&&V(g,this.catch.names),this.finally&&V(g,this.finally.names),g}}class O extends b{constructor(g){super(),this.error=g}render(g){return`catch(${this.error})`+super.render(g)}}O.kind="catch";class j extends b{render(g){return"finally"+super.render(g)}}j.kind="finally";class F{constructor(g,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
9
9
|
`:""},this._extScope=g,this._scope=new r.Scope({parent:g}),this._nodes=[new E]}toString(){return this._root.render(this.opts)}name(g){return this._scope.name(g)}scopeName(g){return this._extScope.name(g)}scopeValue(g,k){const A=this._extScope.value(g,k);return(this._values[A.prefix]||(this._values[A.prefix]=new Set)).add(A),A}getScopeValue(g,k){return this._extScope.getValue(g,k)}scopeRefs(g){return this._extScope.scopeRefs(g,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(g,k,A,W){const Q=this._scope.toName(k);return A!==void 0&&W&&(this._constants[Q.str]=A),this._leafNode(new a(g,Q,A)),Q}const(g,k,A){return this._def(r.varKinds.const,g,k,A)}let(g,k,A){return this._def(r.varKinds.let,g,k,A)}var(g,k,A){return this._def(r.varKinds.var,g,k,A)}assign(g,k,A){return this._leafNode(new u(g,k,A))}add(g,k){return this._leafNode(new i(g,t.operators.ADD,k))}code(g){return typeof g=="function"?g():g!==e.nil&&this._leafNode(new w(g)),this}object(...g){const k=["{"];for(const[A,W]of g)k.length>1&&k.push(","),k.push(A),(A!==W||this.opts.es5)&&(k.push(":"),(0,e.addCodeArg)(k,W));return k.push("}"),new e._Code(k)}if(g,k,A){if(this._blockNode(new o(g)),k&&A)this.code(k).else().code(A).endIf();else if(k)this.code(k).endIf();else if(A)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(g){return this._elseNode(new o(g))}else(){return this._elseNode(new m)}endIf(){return this._endBlockNode(o,m)}_for(g,k){return this._blockNode(g),k&&this.code(k).endFor(),this}for(g,k){return this._for(new p(g),k)}forRange(g,k,A,W,Q=this.opts.es5?r.varKinds.var:r.varKinds.let){const ie=this._scope.toName(g);return this._for(new v(Q,ie,k,A),()=>W(ie))}forOf(g,k,A,W=r.varKinds.const){const Q=this._scope.toName(g);if(this.opts.es5){const ie=k instanceof e.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,e._)`${ie}.length`,re=>{this.var(Q,(0,e._)`${ie}[${re}]`),A(Q)})}return this._for(new $("of",W,Q,k),()=>A(Q))}forIn(g,k,A,W=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(g,(0,e._)`Object.keys(${k})`,A);const Q=this._scope.toName(g);return this._for(new $("in",W,Q,k),()=>A(Q))}endFor(){return this._endBlockNode(_)}label(g){return this._leafNode(new h(g))}break(g){return this._leafNode(new c(g))}return(g){const k=new f;if(this._blockNode(k),this.code(g),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(f)}try(g,k,A){if(!k&&!A)throw new Error('CodeGen: "try" without "catch" and "finally"');const W=new S;if(this._blockNode(W),this.code(g),k){const Q=this.name("e");this._currNode=W.catch=new O(Q),k(Q)}return A&&(this._currNode=W.finally=new j,this.code(A)),this._endBlockNode(O,j)}throw(g){return this._leafNode(new d(g))}block(g,k){return this._blockStarts.push(this._nodes.length),g&&this.code(g).endBlock(k),this}endBlock(g){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const A=this._nodes.length-k;if(A<0||g!==void 0&&A!==g)throw new Error(`CodeGen: wrong number of nodes: ${A} vs ${g} expected`);return this._nodes.length=k,this}func(g,k=e.nil,A,W){return this._blockNode(new y(g,k,A)),W&&this.code(W).endFunc(),this}endFunc(){return this._endBlockNode(y)}optimize(g=1){for(;g-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(g){return this._currNode.nodes.push(g),this}_blockNode(g){this._currNode.nodes.push(g),this._nodes.push(g)}_endBlockNode(g,k){const A=this._currNode;if(A instanceof g||k&&A instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${g.kind}/${k.kind}`:g.kind}"`)}_elseNode(g){const k=this._currNode;if(!(k instanceof o))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=g,this}get _root(){return this._nodes[0]}get _currNode(){const g=this._nodes;return g[g.length-1]}set _currNode(g){const k=this._nodes;k[k.length-1]=g}}t.CodeGen=F;function V(R,g){for(const k in g)R[k]=(R[k]||0)+(g[k]||0);return R}function X(R,g){return g instanceof e._CodeOrName?V(R,g.names):R}function G(R,g,k){if(R instanceof e.Name)return A(R);if(!W(R))return R;return new e._Code(R._items.reduce((Q,ie)=>(ie instanceof e.Name&&(ie=A(ie)),ie instanceof e._Code?Q.push(...ie._items):Q.push(ie),Q),[]));function A(Q){const ie=k[Q.str];return ie===void 0||g[Q.str]!==1?Q:(delete g[Q.str],ie)}function W(Q){return Q instanceof e._Code&&Q._items.some(ie=>ie instanceof e.Name&&g[ie.str]===1&&k[ie.str]!==void 0)}}function ee(R,g){for(const k in g)R[k]=(R[k]||0)-(g[k]||0)}function fe(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,e._)`!${M(R)}`}t.not=fe;var we=T(t.operators.AND);function Oe(...R){return R.reduce(we)}t.and=Oe;var se=T(t.operators.OR);function x(...R){return R.reduce(se)}t.or=x;function T(R){return(g,k)=>g===e.nil?k:k===e.nil?g:(0,e._)`${M(g)} ${R} ${M(k)}`}function M(R){return R instanceof e.Name?R:(0,e._)`(${R})`}}),Ue=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=Ce(),r=Ur();function n(y){const f={};for(const S of y)f[S]=!0;return f}t.toHash=n;function s(y,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(l(y,f),!a(f,y.self.RULES.all))}t.alwaysValidSchema=s;function l(y,f=y.schema){const{opts:S,self:O}=y;if(!S.strictSchema||typeof f=="boolean")return;const j=O.RULES.keywords;for(const F in f)j[F]||$(y,`unknown keyword: "${F}"`)}t.checkUnknownRules=l;function a(y,f){if(typeof y=="boolean")return!y;for(const S in y)if(f[S])return!0;return!1}t.schemaHasRules=a;function u(y,f){if(typeof y=="boolean")return!y;for(const S in y)if(S!=="$ref"&&f.all[S])return!0;return!1}t.schemaHasRulesButRef=u;function i({topSchemaRef:y,schemaPath:f},S,O,j){if(!j){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return(0,e._)`${S}`}return(0,e._)`${y}${f}${(0,e.getProperty)(O)}`}t.schemaRefOrVal=i;function h(y){return w(decodeURIComponent(y))}t.unescapeFragment=h;function c(y){return encodeURIComponent(d(y))}t.escapeFragment=c;function d(y){return typeof y=="number"?`${y}`:y.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=d;function w(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=w;function P(y,f){if(Array.isArray(y))for(const S of y)f(S);else f(y)}t.eachItem=P;function b({mergeNames:y,mergeToName:f,mergeValues:S,resultToName:O}){return(j,F,V,X)=>{const G=V===void 0?F:V instanceof e.Name?(F instanceof e.Name?y(j,F,V):f(j,F,V),V):F instanceof e.Name?(f(j,V,F),F):S(F,V);return X===e.Name&&!(G instanceof e.Name)?O(j,G):G}}t.mergeEvaluated={props:b({mergeNames:(y,f,S)=>y.if((0,e._)`${S} !== true && ${f} !== undefined`,()=>{y.if((0,e._)`${f} === true`,()=>y.assign(S,!0),()=>y.assign(S,(0,e._)`${S} || {}`).code((0,e._)`Object.assign(${S}, ${f})`))}),mergeToName:(y,f,S)=>y.if((0,e._)`${S} !== true`,()=>{f===!0?y.assign(S,!0):(y.assign(S,(0,e._)`${S} || {}`),m(y,S,f))}),mergeValues:(y,f)=>y===!0?!0:{...y,...f},resultToName:E}),items:b({mergeNames:(y,f,S)=>y.if((0,e._)`${S} !== true && ${f} !== undefined`,()=>y.assign(S,(0,e._)`${f} === true ? true : ${S} > ${f} ? ${S} : ${f}`)),mergeToName:(y,f,S)=>y.if((0,e._)`${S} !== true`,()=>y.assign(S,f===!0?!0:(0,e._)`${S} > ${f} ? ${S} : ${f}`)),mergeValues:(y,f)=>y===!0?!0:Math.max(y,f),resultToName:(y,f)=>y.var("items",f)})};function E(y,f){if(f===!0)return y.var("props",!0);const S=y.var("props",(0,e._)`{}`);return f!==void 0&&m(y,S,f),S}t.evaluatedPropsToName=E;function m(y,f,S){Object.keys(S).forEach(O=>y.assign((0,e._)`${f}${(0,e.getProperty)(O)}`,!0))}t.setEvaluated=m;var o={};function _(y,f){return y.scopeValue("func",{ref:f,code:o[f.code]||(o[f.code]=new r._Code(f.code))})}t.useFunc=_;var p;(function(y){y[y.Num=0]="Num",y[y.Str=1]="Str"})(p||(t.Type=p={}));function v(y,f,S){if(y instanceof e.Name){const O=f===p.Num;return S?O?(0,e._)`"[" + ${y} + "]"`:(0,e._)`"['" + ${y} + "']"`:O?(0,e._)`"/" + ${y}`:(0,e._)`"/" + ${y}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return S?(0,e.getProperty)(y).toString():"/"+d(y)}t.getErrorPath=v;function $(y,f,S=y.opts.strictSchema){if(S){if(f=`strict mode: ${f}`,S===!0)throw new Error(f);y.self.logger.warn(f)}}t.checkStrictMode=$}),Qt=B(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ce(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),Kr=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ce(),r=Ue(),n=Qt();t.keywordError={message:({keyword:m})=>(0,e.str)`must pass "${m}" keyword validation`},t.keyword$DataError={message:({keyword:m,schemaType:o})=>o?(0,e.str)`"${m}" keyword must be ${o} ($data)`:(0,e.str)`"${m}" keyword is invalid ($data)`};function s(m,o=t.keywordError,_,p){const{it:v}=m,{gen:$,compositeRule:y,allErrors:f}=v,S=d(m,o,_);p??(y||f)?i($,S):h(v,(0,e._)`[${S}]`)}t.reportError=s;function l(m,o=t.keywordError,_){const{it:p}=m,{gen:v,compositeRule:$,allErrors:y}=p,f=d(m,o,_);i(v,f),$||y||h(p,n.default.vErrors)}t.reportExtraError=l;function a(m,o){m.assign(n.default.errors,o),m.if((0,e._)`${n.default.vErrors} !== null`,()=>m.if(o,()=>m.assign((0,e._)`${n.default.vErrors}.length`,o),()=>m.assign(n.default.vErrors,null)))}t.resetErrorsCount=a;function u({gen:m,keyword:o,schemaValue:_,data:p,errsCount:v,it:$}){if(v===void 0)throw new Error("ajv implementation error");const y=m.name("err");m.forRange("i",v,n.default.errors,f=>{m.const(y,(0,e._)`${n.default.vErrors}[${f}]`),m.if((0,e._)`${y}.instancePath === undefined`,()=>m.assign((0,e._)`${y}.instancePath`,(0,e.strConcat)(n.default.instancePath,$.errorPath))),m.assign((0,e._)`${y}.schemaPath`,(0,e.str)`${$.errSchemaPath}/${o}`),$.opts.verbose&&(m.assign((0,e._)`${y}.schema`,_),m.assign((0,e._)`${y}.data`,p))})}t.extendErrors=u;function i(m,o){const _=m.const("err",o);m.if((0,e._)`${n.default.vErrors} === null`,()=>m.assign(n.default.vErrors,(0,e._)`[${_}]`),(0,e._)`${n.default.vErrors}.push(${_})`),m.code((0,e._)`${n.default.errors}++`)}function h(m,o){const{gen:_,validateName:p,schemaEnv:v}=m;v.$async?_.throw((0,e._)`new ${m.ValidationError}(${o})`):(_.assign((0,e._)`${p}.errors`,o),_.return(!1))}var c={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(m,o,_){const{createErrors:p}=m.it;return p===!1?(0,e._)`{}`:w(m,o,_)}function w(m,o,_={}){const{gen:p,it:v}=m,$=[P(v,_),b(m,_)];return E(m,o,$),p.object(...$)}function P({errorPath:m},{instancePath:o}){const _=o?(0,e.str)`${m}${(0,r.getErrorPath)(o,r.Type.Str)}`:m;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,_)]}function b({keyword:m,it:{errSchemaPath:o}},{schemaPath:_,parentSchema:p}){let v=p?o:(0,e.str)`${o}/${m}`;return _&&(v=(0,e.str)`${v}${(0,r.getErrorPath)(_,r.Type.Str)}`),[c.schemaPath,v]}function E(m,{params:o,message:_},p){const{keyword:v,data:$,schemaValue:y,it:f}=m,{opts:S,propertyName:O,topSchemaRef:j,schemaPath:F}=f;p.push([c.keyword,v],[c.params,typeof o=="function"?o(m):o||(0,e._)`{}`]),S.messages&&p.push([c.message,typeof _=="function"?_(m):_]),S.verbose&&p.push([c.schema,y],[c.parentSchema,(0,e._)`${j}${F}`],[n.default.data,$]),O&&p.push([c.propertyName,O])}}),lo=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Kr(),r=Ce(),n=Qt(),s={message:"boolean schema is false"};function l(i){const{gen:h,schema:c,validateName:d}=i;c===!1?u(i,!1):typeof c=="object"&&c.$async===!0?h.return(n.default.data):(h.assign((0,r._)`${d}.errors`,null),h.return(!0))}t.topBoolOrEmptySchema=l;function a(i,h){const{gen:c,schema:d}=i;d===!1?(c.var(h,!1),u(i)):c.var(h,!0)}t.boolOrEmptySchema=a;function u(i,h){const{gen:c,data:d}=i,w={gen:c,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(w,s,void 0,h)}}),Ks=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(l){return typeof l=="string"&&r.has(l)}t.isJSONType=n;function s(){const l={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...l,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},l.number,l.string,l.array,l.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=s}),Gs=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:s,self:l},a){const u=l.RULES.types[a];return u&&u!==!0&&r(s,u)}t.schemaHasRulesForType=e;function r(s,l){return l.rules.some(a=>n(s,a))}t.shouldUseGroup=r;function n(s,l){var a;return s[l.keyword]!==void 0||((a=l.definition.implements)===null||a===void 0?void 0:a.some(u=>s[u]!==void 0))}t.shouldUseRule=n}),Fr=B(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=Ks(),r=Gs(),n=Kr(),s=Ce(),l=Ue(),a;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(a||(t.DataType=a={}));function u(p){const v=i(p.type);if(v.includes("null")){if(p.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!v.length&&p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&v.push("null")}return v}t.getSchemaTypes=u;function i(p){const v=Array.isArray(p)?p:p?[p]:[];if(v.every(e.isJSONType))return v;throw new Error("type must be JSONType or JSONType[]: "+v.join(","))}t.getJSONTypes=i;function h(p,v){const{gen:$,data:y,opts:f}=p,S=d(v,f.coerceTypes),O=v.length>0&&!(S.length===0&&v.length===1&&(0,r.schemaHasRulesForType)(p,v[0]));if(O){const j=E(v,y,f.strictNumbers,a.Wrong);$.if(j,()=>{S.length?w(p,v,S):o(p)})}return O}t.coerceAndCheckDataType=h;var c=new Set(["string","number","integer","boolean","null"]);function d(p,v){return v?p.filter($=>c.has($)||v==="array"&&$==="array"):[]}function w(p,v,$){const{gen:y,data:f,opts:S}=p,O=y.let("dataType",(0,s._)`typeof ${f}`),j=y.let("coerced",(0,s._)`undefined`);S.coerceTypes==="array"&&y.if((0,s._)`${O} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>y.assign(f,(0,s._)`${f}[0]`).assign(O,(0,s._)`typeof ${f}`).if(E(v,f,S.strictNumbers),()=>y.assign(j,f))),y.if((0,s._)`${j} !== undefined`);for(const V of $)(c.has(V)||V==="array"&&S.coerceTypes==="array")&&F(V);y.else(),o(p),y.endIf(),y.if((0,s._)`${j} !== undefined`,()=>{y.assign(f,j),P(p,j)});function F(V){switch(V){case"string":y.elseIf((0,s._)`${O} == "number" || ${O} == "boolean"`).assign(j,(0,s._)`"" + ${f}`).elseIf((0,s._)`${f} === null`).assign(j,(0,s._)`""`);return;case"number":y.elseIf((0,s._)`${O} == "boolean" || ${f} === null
|
|
10
10
|
|| (${O} == "string" && ${f} && ${f} == +${f})`).assign(j,(0,s._)`+${f}`);return;case"integer":y.elseIf((0,s._)`${O} === "boolean" || ${f} === null
|
|
11
11
|
|| (${O} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(j,(0,s._)`+${f}`);return;case"boolean":y.elseIf((0,s._)`${f} === "false" || ${f} === 0 || ${f} === null`).assign(j,!1).elseIf((0,s._)`${f} === "true" || ${f} === 1`).assign(j,!0);return;case"null":y.elseIf((0,s._)`${f} === "" || ${f} === 0 || ${f} === false`),y.assign(j,null);return;case"array":y.elseIf((0,s._)`${O} === "string" || ${O} === "number"
|
|
@@ -33,4 +33,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Qe=Z,Me=le),Se===void
|
|
|
33
33
|
`)},u.prototype.displayStateStack=function(c,d){for(var w,P=0,b=0;b<c.length;b++){var E=c[b],m=E.rule.toString(E.dot);m===w?P++:(P>0&&d.push(" ^ "+P+" more lines identical to this"),P=0,d.push(" "+m)),w=m}},u.prototype.getSymbolDisplay=function(c){return i(c)},u.prototype.buildFirstStateStack=function(c,d){if(d.indexOf(c)!==-1)return null;if(c.wantedBy.length===0)return[c];var w=c.wantedBy[0],P=[c].concat(d),b=this.buildFirstStateStack(w,P);return b===null?null:[c].concat(b)},u.prototype.save=function(){var c=this.table[this.current];return c.lexerState=this.lexerState,c},u.prototype.restore=function(c){var d=c.index;this.current=d,this.table[d]=c,this.table.splice(d+1),this.lexerState=c.lexerState,this.results=this.finish()},u.prototype.rewind=function(c){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[c])},u.prototype.finish=function(){var c=[],d=this.grammar.start,w=this.table[this.table.length-1];return w.states.forEach(function(P){P.rule.name===d&&P.dot===P.rule.symbols.length&&P.reference===0&&P.data!==u.fail&&c.push(P)}),c.map(function(P){return P.data})};function i(c){var d=typeof c;if(d==="string")return c;if(d==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return"character matching "+c;if(c.type)return c.type+" token";if(c.test)return"token matching "+String(c.test);throw new Error("Unknown symbol type: "+c)}}function h(c){var d=typeof c;if(d==="string")return c;if(d==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return c.toString();if(c.type)return"%"+c.type;if(c.test)return"<"+String(c.test)+">";throw new Error("Unknown symbol type: "+c)}}return{Parser:u,Grammar:l,Rule:r}})}),Qc=B(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(l){return l[0]}var r=l=>[].concat(...l.map(a=>Array.isArray(a)?r(a):a));function n(l){return l?Array.isArray(l)?r(l).join(""):l:""}var s={Lexer:void 0,ParserRules:[{name:"Reverse_path",symbols:["Path"]},{name:"Reverse_path$string$1",symbols:[{literal:"<"},{literal:">"}],postprocess:l=>l.join("")},{name:"Reverse_path",symbols:["Reverse_path$string$1"]},{name:"Forward_path$subexpression$1$subexpression$1",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:"@"}],postprocess:function(l){return l.join("")}},{name:"Forward_path$subexpression$1",symbols:["Forward_path$subexpression$1$subexpression$1","Domain",{literal:">"}]},{name:"Forward_path",symbols:["Forward_path$subexpression$1"]},{name:"Forward_path$subexpression$2",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:">"}],postprocess:function(l){return l.join("")}},{name:"Forward_path",symbols:["Forward_path$subexpression$2"]},{name:"Forward_path",symbols:["Path"]},{name:"Path$ebnf$1$subexpression$1",symbols:["A_d_l",{literal:":"}]},{name:"Path$ebnf$1",symbols:["Path$ebnf$1$subexpression$1"],postprocess:e},{name:"Path$ebnf$1",symbols:[],postprocess:()=>null},{name:"Path",symbols:[{literal:"<"},"Path$ebnf$1","Mailbox",{literal:">"}]},{name:"A_d_l$ebnf$1",symbols:[]},{name:"A_d_l$ebnf$1$subexpression$1",symbols:[{literal:","},"At_domain"]},{name:"A_d_l$ebnf$1",symbols:["A_d_l$ebnf$1","A_d_l$ebnf$1$subexpression$1"],postprocess:l=>l[0].concat([l[1]])},{name:"A_d_l",symbols:["At_domain","A_d_l$ebnf$1"]},{name:"At_domain",symbols:[{literal:"@"},"Domain"]},{name:"Domain$ebnf$1",symbols:[]},{name:"Domain$ebnf$1$subexpression$1",symbols:[{literal:"."},"sub_domain"]},{name:"Domain$ebnf$1",symbols:["Domain$ebnf$1","Domain$ebnf$1$subexpression$1"],postprocess:l=>l[0].concat([l[1]])},{name:"Domain",symbols:["sub_domain","Domain$ebnf$1"]},{name:"sub_domain",symbols:["U_label"]},{name:"Let_dig",symbols:["ALPHA_DIGIT"],postprocess:e},{name:"Ldh_str$ebnf$1",symbols:[]},{name:"Ldh_str$ebnf$1",symbols:["Ldh_str$ebnf$1","ALPHA_DIG_DASH"],postprocess:l=>l[0].concat([l[1]])},{name:"Ldh_str",symbols:["Ldh_str$ebnf$1","Let_dig"]},{name:"U_Let_dig",symbols:["ALPHA_DIGIT_U"],postprocess:e},{name:"U_Ldh_str$ebnf$1",symbols:[]},{name:"U_Ldh_str$ebnf$1",symbols:["U_Ldh_str$ebnf$1","ALPHA_DIG_DASH_U"],postprocess:l=>l[0].concat([l[1]])},{name:"U_Ldh_str",symbols:["U_Ldh_str$ebnf$1","U_Let_dig"]},{name:"U_label$ebnf$1$subexpression$1",symbols:["U_Ldh_str"]},{name:"U_label$ebnf$1",symbols:["U_label$ebnf$1$subexpression$1"],postprocess:e},{name:"U_label$ebnf$1",symbols:[],postprocess:()=>null},{name:"U_label",symbols:["U_Let_dig","U_label$ebnf$1"]},{name:"address_literal$subexpression$1",symbols:["IPv4_address_literal"]},{name:"address_literal$subexpression$1",symbols:["IPv6_address_literal"]},{name:"address_literal$subexpression$1",symbols:["General_address_literal"]},{name:"address_literal",symbols:[{literal:"["},"address_literal$subexpression$1",{literal:"]"}]},{name:"non_local_part",symbols:["Domain"],postprocess:function(l){return{DomainName:n(l[0])}}},{name:"non_local_part",symbols:["address_literal"],postprocess:function(l){return{AddressLiteral:n(l[0])}}},{name:"Mailbox",symbols:["Local_part",{literal:"@"},"non_local_part"],postprocess:function(l){return{localPart:n(l[0]),domainPart:n(l[2])}}},{name:"Local_part",symbols:["Dot_string"],postprocess:function(l){return{DotString:n(l[0])}}},{name:"Local_part",symbols:["Quoted_string"],postprocess:function(l){return{QuotedString:n(l[0])}}},{name:"Dot_string$ebnf$1",symbols:[]},{name:"Dot_string$ebnf$1$subexpression$1",symbols:[{literal:"."},"Atom"]},{name:"Dot_string$ebnf$1",symbols:["Dot_string$ebnf$1","Dot_string$ebnf$1$subexpression$1"],postprocess:l=>l[0].concat([l[1]])},{name:"Dot_string",symbols:["Atom","Dot_string$ebnf$1"]},{name:"Atom$ebnf$1",symbols:[/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/]},{name:"Atom$ebnf$1",symbols:["Atom$ebnf$1",/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/],postprocess:l=>l[0].concat([l[1]])},{name:"Atom",symbols:["Atom$ebnf$1"]},{name:"Quoted_string$ebnf$1",symbols:[]},{name:"Quoted_string$ebnf$1",symbols:["Quoted_string$ebnf$1","QcontentSMTP"],postprocess:l=>l[0].concat([l[1]])},{name:"Quoted_string",symbols:["DQUOTE","Quoted_string$ebnf$1","DQUOTE"]},{name:"QcontentSMTP",symbols:["qtextSMTP"]},{name:"QcontentSMTP",symbols:["quoted_pairSMTP"]},{name:"quoted_pairSMTP",symbols:[{literal:"\\"},/[\x20-\x7e]/]},{name:"qtextSMTP",symbols:[/[\x20-\x21\x23-\x5b\x5d-\x7e\u0080-\uFFFF]/],postprocess:e},{name:"IPv4_address_literal$macrocall$2",symbols:[{literal:"."},"Snum"]},{name:"IPv4_address_literal$macrocall$1",symbols:["IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2"]},{name:"IPv4_address_literal",symbols:["Snum","IPv4_address_literal$macrocall$1"]},{name:"IPv6_address_literal$subexpression$1",symbols:[/[iI]/,/[pP]/,/[vV]/,{literal:"6"},{literal:":"}],postprocess:function(l){return l.join("")}},{name:"IPv6_address_literal",symbols:["IPv6_address_literal$subexpression$1","IPv6_addr"]},{name:"General_address_literal$ebnf$1",symbols:["dcontent"]},{name:"General_address_literal$ebnf$1",symbols:["General_address_literal$ebnf$1","dcontent"],postprocess:l=>l[0].concat([l[1]])},{name:"General_address_literal",symbols:["Standardized_tag",{literal:":"},"General_address_literal$ebnf$1"]},{name:"Standardized_tag",symbols:["Ldh_str"]},{name:"dcontent",symbols:[/[\x21-\x5a\x5e-\x7e]/],postprocess:e},{name:"Snum",symbols:["DIGIT"]},{name:"Snum$subexpression$1",symbols:[/[1-9]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$1"]},{name:"Snum$subexpression$2",symbols:[{literal:"1"},"DIGIT","DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$2"]},{name:"Snum$subexpression$3",symbols:[{literal:"2"},/[0-4]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$3"]},{name:"Snum$subexpression$4",symbols:[{literal:"2"},{literal:"5"},/[0-5]/]},{name:"Snum",symbols:["Snum$subexpression$4"]},{name:"IPv6_addr",symbols:["IPv6_full"]},{name:"IPv6_addr",symbols:["IPv6_comp"]},{name:"IPv6_addr",symbols:["IPv6v4_full"]},{name:"IPv6_addr",symbols:["IPv6v4_comp"]},{name:"IPv6_hex",symbols:["HEXDIG"]},{name:"IPv6_hex$subexpression$1",symbols:["HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$1"]},{name:"IPv6_hex$subexpression$2",symbols:["HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$2"]},{name:"IPv6_hex$subexpression$3",symbols:["HEXDIG","HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$3"]},{name:"IPv6_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_full$macrocall$1",symbols:["IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2"]},{name:"IPv6_full",symbols:["IPv6_hex","IPv6_full$macrocall$1"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$1",symbols:["IPv6_comp$ebnf$1$subexpression$1"],postprocess:e},{name:"IPv6_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:l=>l.join("")},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$2$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$2",symbols:["IPv6_comp$ebnf$2$subexpression$1"],postprocess:e},{name:"IPv6_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6_comp",symbols:["IPv6_comp$ebnf$1","IPv6_comp$string$1","IPv6_comp$ebnf$2"]},{name:"IPv6v4_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_full$macrocall$1",symbols:["IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2"]},{name:"IPv6v4_full",symbols:["IPv6_hex","IPv6v4_full$macrocall$1",{literal:":"},"IPv4_address_literal"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6v4_comp$ebnf$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1"],postprocess:e},{name:"IPv6v4_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:l=>l.join("")},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",{literal:":"}]},{name:"IPv6v4_comp$ebnf$2",symbols:["IPv6v4_comp$ebnf$2$subexpression$1"],postprocess:e},{name:"IPv6v4_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp",symbols:["IPv6v4_comp$ebnf$1","IPv6v4_comp$string$1","IPv6v4_comp$ebnf$2","IPv4_address_literal"]},{name:"DIGIT",symbols:[/[0-9]/],postprocess:e},{name:"ALPHA_DIGIT_U",symbols:[/[0-9A-Za-z\u0080-\uFFFF]/],postprocess:e},{name:"ALPHA_DIGIT",symbols:[/[0-9A-Za-z]/],postprocess:e},{name:"ALPHA_DIG_DASH",symbols:[/[-0-9A-Za-z]/],postprocess:e},{name:"ALPHA_DIG_DASH_U",symbols:[/[-0-9A-Za-z\u0080-\uFFFF]/],postprocess:e},{name:"HEXDIG",symbols:[/[0-9A-Fa-f]/],postprocess:e},{name:"DQUOTE",symbols:[{literal:'"'}],postprocess:e}],ParserStart:"Reverse_path"};t.default=s}),Kn=B(t=>{var e=t&&t.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(t,"__esModule",{value:!0}),t.canonicalize=t.canonicalize_quoted_string=t.normalize=t.normalize_dot_string=t.parse=void 0;var r=Jc(),n=e(Qc());n.default.ParserStart="Mailbox";var s=r.Grammar.fromCompiled(n.default);function l(c){if(c.length>986)throw new Error("address too long");const w=new r.Parser(s);if(w.feed(c),w.results.length!==1)throw new Error("address parsing failed: ambiguous grammar");const P=c.lastIndexOf("@"),b=c.substring(P+1);if(b[0]!=="["){if(b.length>253)throw new Error("domain too long");const E=b.split(".");if(E.length<2)throw new Error("domain not fully qualified");if(E[E.length-1].length<2)throw new Error("top level domain label too short");if(E.sort(function(m,o){return o.length-m.length}),E[0].length>63)throw new Error("domain label too long")}return w.results[0]}t.parse=l;function a(c){return function(){const P=c.indexOf("+");return P===-1?c:c.substr(0,P)}().replace(/\./g,"").toLowerCase()}t.normalize_dot_string=a;function u(c){var d,w;const P=l(c),b=(d=P.domainPart.AddressLiteral)!==null&&d!==void 0?d:P.domainPart.DomainName.toLowerCase();return`${(w=P.localPart.QuotedString)!==null&&w!==void 0?w:a(P.localPart.DotString)}@${b}`}t.normalize=u;function i(c){return`"${c.substr(1).substr(0,c.length-2).replace(/(?:\\(.))/g,"$1").replace(/(?:(["\\]))/g,"\\$1")}"`}t.canonicalize_quoted_string=i;function h(c){var d;const w=l(c),P=(d=w.domainPart.AddressLiteral)!==null&&d!==void 0?d:w.domainPart.DomainName.toLowerCase();return`${w.localPart.QuotedString?i(w.localPart.QuotedString):w.localPart.DotString}@${P}`}t.canonicalize=h}),Xc=B((t,e)=>{var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},u=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var w=r.call(d,"constructor"),P=d.constructor&&d.constructor.prototype&&r.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!w&&!P)return!1;var b;for(b in d);return typeof b>"u"||r.call(d,b)},i=function(d,w){s&&w.name==="__proto__"?s(d,w.name,{enumerable:!0,configurable:!0,value:w.newValue,writable:!0}):d[w.name]=w.newValue},h=function(d,w){if(w==="__proto__")if(r.call(d,w)){if(l)return l(d,w).value}else return;return d[w]};e.exports=function c(){var d,w,P,b,E,m,o=arguments[0],_=1,p=arguments.length,v=!1;for(typeof o=="boolean"&&(v=o,o=arguments[1]||{},_=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});_<p;++_)if(d=arguments[_],d!=null)for(w in d)P=h(o,w),b=h(d,w),o!==b&&(v&&b&&(u(b)||(E=a(b)))?(E?(E=!1,m=P&&a(P)?P:[]):m=P&&u(P)?P:{},i(o,{name:w,newValue:c(v,m,b)})):typeof b<"u"&&i(o,{name:w,newValue:b}));return o}}),Yc=B((t,e)=>{e.exports=[{scheme:"aaa",description:"Diameter Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6733"}]},{scheme:"aaas",description:"Diameter Protocol with Secure Transport",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6733"}]},{scheme:"about",description:"about",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6694"}]},{scheme:"acap",description:"application configuration access protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2244"}]},{scheme:"acct",description:"acct",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7565"}]},{scheme:"cap",description:"Calendar Access Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4324"}]},{scheme:"cid",description:"content identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2392"}]},{scheme:"coap",description:"coap",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7252"}]},{scheme:"coaps",description:"coaps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7252"}]},{scheme:"crid",description:"TV-Anytime Content Reference Identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4078"}]},{scheme:"data",description:"data",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2397"}]},{scheme:"dav",description:"dav",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4918"}]},{scheme:"dict",description:"dictionary service protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2229"}]},{scheme:"dns",description:"Domain Name System",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4501"}]},{scheme:"example",description:"example",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7595"}]},{scheme:"file",description:"Host-specific file names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"ftp",description:"File Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"geo",description:"Geographic Locations",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5870"}]},{scheme:"go",description:"go",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3368"}]},{scheme:"gopher",description:"The Gopher Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4266"}]},{scheme:"h323",description:"H.323",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3508"}]},{scheme:"http",description:"Hypertext Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7230"}]},{scheme:"https",description:"Hypertext Transfer Protocol Secure",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7230"}]},{scheme:"iax",description:"Inter-Asterisk eXchange Version 2",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5456"}]},{scheme:"icap",description:"Internet Content Adaptation Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3507"}]},{scheme:"im",description:"Instant Messaging",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3860"}]},{scheme:"imap",description:"internet message access protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5092"}]},{scheme:"info",description:`Information Assets with Identifiers in Public Namespaces.
|
|
34
34
|
(section 3) defines an "info" registry
|
|
35
35
|
of public namespaces, which is maintained by NISO and can be accessed
|
|
36
|
-
from .`,reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4452"}]},{scheme:"ipp",description:"Internet Printing Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3510"}]},{scheme:"ipps",description:"Internet Printing Protocol over HTTPS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7472"}]},{scheme:"iris",description:"Internet Registry Information Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3981"}]},{scheme:"iris.beep",description:"iris.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3983"}]},{scheme:"iris.lwz",description:"iris.lwz",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4993"}]},{scheme:"iris.xpc",description:"iris.xpc",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"iris.xpcs",description:"iris.xpcs",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"jabber",description:"jabber",reference:[],template:"http://www.iana.org/assignments/uri-schemes/perm/jabber"},{scheme:"ldap",description:"Lightweight Directory Access Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4516"}]},{scheme:"mailto",description:"Electronic mail address",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6068"}]},{scheme:"mid",description:"message identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2392"}]},{scheme:"msrp",description:"Message Session Relay Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"msrps",description:"Message Session Relay Protocol Secure",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"mtqp",description:"Message Tracking Query Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3887"}]},{scheme:"mupdate",description:"Mailbox Update (MUPDATE) Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3656"}]},{scheme:"news",description:"USENET news",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"nfs",description:"network file system protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2224"}]},{scheme:"ni",description:"ni",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nih",description:"nih",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nntp",description:"USENET news using NNTP access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"opaquelocktoken",description:"opaquelocktokent",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4918"}]},{scheme:"pkcs11",description:"PKCS#11",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7512"}]},{scheme:"pop",description:"Post Office Protocol v3",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2384"}]},{scheme:"pres",description:"Presence",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3859"}]},{scheme:"reload",description:"reload",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6940"}]},{scheme:"rtsp",description:"Real-time Streaming Protocol (RTSP)",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtsps",description:"Real-time Streaming Protocol (RTSP) over TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtspu",description:"Real-time Streaming Protocol (RTSP) over unreliable datagram transport",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"}]},{scheme:"service",description:"service location",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2609"}]},{scheme:"session",description:"session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6787"}]},{scheme:"shttp",description:"Secure Hypertext Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2660"}]},{scheme:"sieve",description:"ManageSieve Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5804"}]},{scheme:"sip",description:"session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sips",description:"secure session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sms",description:"Short Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5724"}]},{scheme:"snmp",description:"Simple Network Management Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4088"}]},{scheme:"soap.beep",description:"soap.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"soap.beeps",description:"soap.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"stun",description:"stun",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"stuns",description:"stuns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"tag",description:"tag",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4151"}]},{scheme:"tel",description:"telephone",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"telnet",description:"Reference to interactive sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4248"}]},{scheme:"tftp",description:"Trivial File Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3617"}]},{scheme:"thismessage",description:"multipart/related relative reference resolution",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2557"}],template:"http://www.iana.org/assignments/uri-schemes/perm/thismessage"},{scheme:"tip",description:"Transaction Internet Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2371"}]},{scheme:"tn3270",description:"Interactive 3270 emulation sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6270"}]},{scheme:"turn",description:"turn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"turns",description:"turns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"tv",description:"TV Broadcasts",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2838"}]},{scheme:"urn",description:"Uniform Resource Names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2141"},{type:"registry",href:"http://www.iana.org/assignments/urn-namespaces"}]},{scheme:"vemmi",description:"versatile multimedia interface",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2122"}]},{scheme:"vnc",description:"Remote Framebuffer Protocol",reference:[{type:"draft",href:"http://www.iana.org/go/RFC-warden-appsawg-vnc-scheme-10"}]},{scheme:"ws",description:"WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"wss",description:"Encrypted WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"xcon",description:"xcon",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xcon-userid",description:"xcon-userid",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xmlrpc.beep",description:"xmlrpc.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmlrpc.beeps",description:"xmlrpc.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmpp",description:"Extensible Messaging and Presence Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5122"}]},{scheme:"z39.50r",description:"Z39.50 Retrieval",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]},{scheme:"z39.50s",description:"Z39.50 Session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),Zc=B((t,e)=>{e.exports=[{scheme:"acr",description:"acr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/acr"},{scheme:"adiumxtra",description:"adiumxtra",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/adiumxtra"},{scheme:"afp",description:"afp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/afp"},{scheme:"afs",description:"Andrew File System global file names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"aim",description:"aim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aim"},{scheme:"appdata",description:"appdata",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/appdata"},{scheme:"apt",description:"apt",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/apt"},{scheme:"attachment",description:"attachment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/attachment"},{scheme:"aw",description:"aw",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aw"},{scheme:"barion",description:"barion",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/barion"},{scheme:"beshare",description:"beshare",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/beshare"},{scheme:"bitcoin",description:"bitcoin",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bitcoin"},{scheme:"blob",description:"blob",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/blob"},{scheme:"bolo",description:"bolo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bolo"},{scheme:"callto",description:"callto",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/callto"},{scheme:"chrome",description:"chrome",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome"},{scheme:"chrome-extension",description:"chrome-extension",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome-extension"},{scheme:"com-eventbrite-attendee",description:"com-eventbrite-attendee",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/com-eventbrite-attendee"},{scheme:"content",description:"content",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/content"},{scheme:"cvs",description:"cvs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/cvs"},{scheme:"dis",description:"dis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dis"},{scheme:"dlna-playcontainer",description:"dlna-playcontainer",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playcontainer"},{scheme:"dlna-playsingle",description:"dlna-playsingle",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playsingle"},{scheme:"dntp",description:"dntp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dntp"},{scheme:"dtn",description:"DTNRG research and development",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5050"}]},{scheme:"dvb",description:"dvb",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mcroberts-uri-dvb"}]},{scheme:"ed2k",description:"ed2k",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ed2k"},{scheme:"facetime",description:"facetime",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/facetime"},{scheme:"feed",description:"feed",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feed"},{scheme:"feedready",description:"feedready",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feedready"},{scheme:"finger",description:"finger",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/finger"},{scheme:"fish",description:"fish",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/fish"},{scheme:"gg",description:"gg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gg"},{scheme:"git",description:"git",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/git"},{scheme:"gizmoproject",description:"gizmoproject",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gizmoproject"},{scheme:"gtalk",description:"gtalk",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gtalk"},{scheme:"ham",description:"ham",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7046"}]},{scheme:"hcp",description:"hcp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/hcp"},{scheme:"icon",description:"icon",reference:[{type:"draft",href:"http://www.iana.org/go/draft-lafayette-icon-uri-scheme"}]},{scheme:"iotdisco",description:"iotdisco",reference:[{type:"uri",href:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco.pdf"}],template:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco"},{scheme:"ipn",description:"ipn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6260"}]},{scheme:"irc",description:"irc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc"},{scheme:"irc6",description:"irc6",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc6"},{scheme:"ircs",description:"ircs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ircs"},{scheme:"isostore",description:"isostore",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/isostore"},{scheme:"itms",description:"itms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/itms"},{scheme:"jar",description:"jar",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/jar"},{scheme:"jms",description:"Java Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6167"}]},{scheme:"keyparc",description:"keyparc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/keyparc"},{scheme:"lastfm",description:"lastfm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/lastfm"},{scheme:"ldaps",description:"ldaps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ldaps"},{scheme:"magnet",description:"magnet",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/magnet"},{scheme:"maps",description:"maps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/maps"},{scheme:"market",description:"market",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/market"},{scheme:"message",description:"message",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/message"},{scheme:"mms",description:"mms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mms"},{scheme:"ms-access",description:"ms-access",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-access"},{scheme:"ms-drive-to",description:"ms-drive-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-drive-to"},{scheme:"ms-enrollment",description:"ms-enrollment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-enrollment"},{scheme:"ms-excel",description:"ms-excel",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-excel"},{scheme:"ms-getoffice",description:"ms-getoffice",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-getoffice"},{scheme:"ms-help",description:"ms-help",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-help"},{scheme:"ms-infopath",description:"ms-infopath",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-infopath"},{scheme:"ms-media-stream-id",description:"ms-media-stream-id",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-media-stream-id"},{scheme:"ms-powerpoint",description:"ms-powerpoint",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-powerpoint"},{scheme:"ms-project",description:"ms-project",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-project"},{scheme:"ms-publisher",description:"ms-publisher",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-publisher"},{scheme:"ms-search-repair",description:"ms-search-repair",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-search-repair"},{scheme:"ms-secondary-screen-controller",description:"ms-secondary-screen-controller",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-controller"},{scheme:"ms-secondary-screen-setup",description:"ms-secondary-screen-setup",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-setup"},{scheme:"ms-settings",description:"ms-settings",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings"},{scheme:"ms-settings-airplanemode",description:"ms-settings-airplanemode",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-airplanemode"},{scheme:"ms-settings-bluetooth",description:"ms-settings-bluetooth",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-bluetooth"},{scheme:"ms-settings-camera",description:"ms-settings-camera",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-camera"},{scheme:"ms-settings-cellular",description:"ms-settings-cellular",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cellular"},{scheme:"ms-settings-cloudstorage",description:"ms-settings-cloudstorage",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cloudstorage"},{scheme:"ms-settings-connectabledevices",description:"ms-settings-connectabledevices",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-connectabledevices"},{scheme:"ms-settings-displays-topology",description:"ms-settings-displays-topology",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-displays-topology"},{scheme:"ms-settings-emailandaccounts",description:"ms-settings-emailandaccounts",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-emailandaccounts"},{scheme:"ms-settings-language",description:"ms-settings-language",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-language"},{scheme:"ms-settings-location",description:"ms-settings-location",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-location"},{scheme:"ms-settings-lock",description:"ms-settings-lock",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-lock"},{scheme:"ms-settings-nfctransactions",description:"ms-settings-nfctransactions",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-nfctransactions"},{scheme:"ms-settings-notifications",description:"ms-settings-notifications",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-notifications"},{scheme:"ms-settings-power",description:"ms-settings-power",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-power"},{scheme:"ms-settings-privacy",description:"ms-settings-privacy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-privacy"},{scheme:"ms-settings-proximity",description:"ms-settings-proximity",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-proximity"},{scheme:"ms-settings-screenrotation",description:"ms-settings-screenrotation",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-screenrotation"},{scheme:"ms-settings-wifi",description:"ms-settings-wifi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-wifi"},{scheme:"ms-settings-workplace",description:"ms-settings-workplace",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-workplace"},{scheme:"ms-spd",description:"ms-spd",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-spd"},{scheme:"ms-transit-to",description:"ms-transit-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-transit-to"},{scheme:"ms-visio",description:"ms-visio",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-visio"},{scheme:"ms-walk-to",description:"ms-walk-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-walk-to"},{scheme:"ms-word",description:"ms-word",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-word"},{scheme:"msnim",description:"msnim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/msnim"},{scheme:"mumble",description:"mumble",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mumble"},{scheme:"mvn",description:"mvn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mvn"},{scheme:"notes",description:"notes",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/notes"},{scheme:"oid",description:"oid",reference:[{type:"draft",href:"http://www.iana.org/go/draft-larmouth-oid-iri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/oid"},{scheme:"palm",description:"palm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/palm"},{scheme:"paparazzi",description:"paparazzi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/paparazzi"},{scheme:"platform",description:"platform",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/platform"},{scheme:"proxy",description:"proxy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/proxy"},{scheme:"psyc",description:"psyc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/psyc"},{scheme:"query",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/query"},{scheme:"redis",description:"redis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/redis"},{scheme:"rediss",description:"rediss",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rediss"},{scheme:"res",description:"res",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/res"},{scheme:"resource",description:"resource",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/resource"},{scheme:"rmi",description:"rmi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rmi"},{scheme:"rsync",description:"rsync",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5781"}]},{scheme:"rtmfp",description:"rtmfp",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7425"}],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmfp"},{scheme:"rtmp",description:"rtmp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmp"},{scheme:"secondlife",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/secondlife"},{scheme:"sftp",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sftp"},{scheme:"sgn",description:"sgn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sgn"},{scheme:"skype",description:"skype",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/skype"},{scheme:"smb",description:"smb",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/smb"},{scheme:"smtp",description:"smtp",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/smtp"},{scheme:"soldat",description:"soldat",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/soldat"},{scheme:"spotify",description:"spotify",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/spotify"},{scheme:"ssh",description:"ssh",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ssh"},{scheme:"steam",description:"steam",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/steam"},{scheme:"submit",description:"submit",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/submit"},{scheme:"svn",description:"svn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/svn"},{scheme:"teamspeak",description:"teamspeak",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teamspeak"},{scheme:"teliaeid",description:"teliaeid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teliaeid"},{scheme:"things",description:"things",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/things"},{scheme:"tool",description:"tool",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/tool"},{scheme:"udp",description:"udp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/udp"},{scheme:"unreal",description:"unreal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/unreal"},{scheme:"ut2004",description:"ut2004",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ut2004"},{scheme:"v-event",description:"v-event",reference:[{type:"draft",href:"http://www.iana.org/go/draft-menderico-v-event-uri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/v-event"},{scheme:"ventrilo",description:"ventrilo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ventrilo"},{scheme:"view-source",description:"view-source",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/view-source"},{scheme:"webcal",description:"webcal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/webcal"},{scheme:"wpid",description:"wpid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wpid"},{scheme:"wtai",description:"wtai",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wtai"},{scheme:"wyciwyg",description:"wyciwyg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wyciwyg"},{scheme:"xfire",description:"xfire",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xfire"},{scheme:"xri",description:"xri",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xri"},{scheme:"ymsgr",description:"ymsgr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ymsgr"}]}),el=B((t,e)=>{e.exports=[{scheme:"fax",description:"fax",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"filesystem",description:"filesystem",reference:[],template:"http://www.iana.org/assignments/uri-schemes/historic/filesystem"},{scheme:"mailserver",description:"Access to data available from mail servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6196"}]},{scheme:"modem",description:"modem",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"pack",description:"pack",reference:[{type:"draft",href:"http://www.iana.org/go/draft-shur-pack-uri-scheme"}],template:"http://www.iana.org/assignments/uri-schemes/historic/pack"},{scheme:"prospero",description:"Prospero Directory Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4157"}]},{scheme:"snews",description:"NNTP over SSL/TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"videotex",description:"videotex",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mavrakis-videotex-url-spec"},{type:"rfc",href:"http://www.iana.org/go/rfc2122"},{type:"rfc",href:"http://www.iana.org/go/rfc3986"}],template:"http://www.iana.org/assignments/uri-schemes/historic/videotex"},{scheme:"wais",description:"Wide Area Information Servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4156"}]},{scheme:"z39.50",description:"Z39.50 information access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"},{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),tl=B((t,e)=>{e.exports=[{scheme:"android-app"},{scheme:"webpack"},{scheme:"s3",description:"Amazon Web Services S3 bucket"},{scheme:"gs",description:"Google Cloud Storage"},{scheme:"mqtt",description:"Message Queuing Telemetry Transport Protocol"},{scheme:"modbus+tcp",description:"Modbus over TCP"}]}),sa=B((t,e)=>{var r=Xc(),n={permanent:Yc(),provosional:Zc(),historical:el()},s={};Object.keys(n).forEach(function(l){n[l].forEach(function(a){s[a.scheme]=r(a,{type:l})})}),n.unofficial=tl().filter(function(l){return!s[l.scheme]}),n.unofficial.forEach(function(l){s[l.scheme]=r(l,{type:"unofficial"})}),e.exports=r(n,{allByName:s})}),rl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return!!(u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&s.allByName[u.scheme])}}),nl=B((t,e)=>{e.exports=/^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?W)?(\d+(?:\.\d+)?D)?(T(?=\d)(\d+(?:\.\d+)?H)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?S)?)?$/}),sl=B((t,e)=>{var{parse:r}=Kn();e.exports=n=>{try{return r(n),!0}catch{return!1}}}),aa={};oo(aa,{default:()=>la});function ia(t){return this[t]}function al(t,e){this[t]=ll.bind(null,e)}var oa,ca,vr,Gn,Wn,il=(t,e,r)=>{var n=Gn(e);for(let s of n)!Wn.call(t,s)&&s!=="default"&&vr(t,s,{get:ia.bind(e,s),enumerable:!0})},ol,ys=(t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var s=ol??(ol=new WeakMap),l=s.get(t);if(l)return l}r=t!=null?oa(ca(t)):{};let a=e||!t||!t.__esModule?vr(r,"default",{value:t,enumerable:!0}):r;for(let u of Gn(t))Wn.call(a,u)||vr(a,u,{get:ia.bind(t,u),enumerable:!0});return n&&s.set(t,a),a},cl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ll=t=>t,ul=(t,e)=>{for(var r in e)vr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:al.bind(e,r)})},mn,gn,vn,la,fl=co(()=>{oa=Object.create,{getPrototypeOf:ca,defineProperty:vr,getOwnPropertyNames:Gn}=Object,Wn=Object.prototype.hasOwnProperty,mn=cl((t,e)=>{var r=/^xn--/,n=/[^\0-\x7F]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,u=String.fromCharCode;function i($){throw RangeError(l[$])}function h($,y){let f=[],S=$.length;for(;S--;)f[S]=y($[S]);return f}function c($,y){let f=$.split("@"),S="";f.length>1&&(S=f[0]+"@",$=f[1]),$=$.replace(s,".");let O=$.split("."),j=h(O,y).join(".");return S+j}function d($){let y=[],f=0,S=$.length;for(;f<S;){let O=$.charCodeAt(f++);if(O>=55296&&O<=56319&&f<S){let j=$.charCodeAt(f++);(j&64512)==56320?y.push(((O&1023)<<10)+(j&1023)+65536):(y.push(O),f--)}else y.push(O)}return y}var w=$=>String.fromCodePoint(...$),P=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:36},b=function($,y){return $+22+75*($<26)-((y!=0)<<5)},E=function($,y,f){let S=0;for($=f?a($/700):$>>1,$+=a($/y);$>455;S+=36)$=a($/35);return a(S+36*$/($+38))},m=function($){let y=[],f=$.length,S=0,O=128,j=72,F=$.lastIndexOf("-");F<0&&(F=0);for(let V=0;V<F;++V)$.charCodeAt(V)>=128&&i("not-basic"),y.push($.charCodeAt(V));for(let V=F>0?F+1:0;V<f;){let X=S;for(let ee=1,fe=36;;fe+=36){V>=f&&i("invalid-input");let we=P($.charCodeAt(V++));we>=36&&i("invalid-input"),we>a((2147483647-S)/ee)&&i("overflow"),S+=we*ee;let Oe=fe<=j?1:fe>=j+26?26:fe-j;if(we<Oe)break;let se=36-Oe;ee>a(2147483647/se)&&i("overflow"),ee*=se}let G=y.length+1;j=E(S-X,G,X==0),a(S/G)>2147483647-O&&i("overflow"),O+=a(S/G),S%=G,y.splice(S++,0,O)}return String.fromCodePoint(...y)},o=function($){let y=[];$=d($);let f=$.length,S=128,O=0,j=72;for(let X of $)X<128&&y.push(u(X));let F=y.length,V=F;for(F&&y.push("-");V<f;){let X=2147483647;for(let ee of $)ee>=S&&ee<X&&(X=ee);let G=V+1;X-S>a((2147483647-O)/G)&&i("overflow"),O+=(X-S)*G,S=X;for(let ee of $)if(ee<S&&++O>2147483647&&i("overflow"),ee===S){let fe=O;for(let we=36;;we+=36){let Oe=we<=j?1:we>=j+26?26:we-j;if(fe<Oe)break;let se=fe-Oe,x=36-Oe;y.push(u(b(Oe+se%x,0))),fe=a(se/x)}y.push(u(b(fe,0))),j=E(O,G,V===F),O=0,++V}++O,++S}return y.join("")},_=function($){return c($,function(y){return r.test(y)?m(y.slice(4).toLowerCase()):y})},p=function($){return c($,function(y){return n.test(y)?"xn--"+o(y):y})},v={version:"2.3.1",ucs2:{decode:d,encode:w},decode:m,encode:o,toASCII:p,toUnicode:_};e.exports=v}),gn={},ul(gn,{default:()=>vn.default}),il(gn,ys(mn(),1)),vn=ys(mn(),1),la=vn.default}),dl=B((t,e)=>{var{toASCII:r}=(fl(),so(aa)),n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;e.exports=s=>{const l=r(s);return l.replace(/\.$/,"").length<=253&&n.test(l)}}),hl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&u.path!==void 0&&s.allByName[u.scheme]?!0:u.scheme&&!s.allByName[u.scheme]?!1:u.path!==void 0&&(u.reference==="relative"||u.reference==="same-document"||u.reference==="uri")}}),pl=B((t,e)=>{t.iri=rl(),t.duration=nl(),t["idn-email"]=sl(),t["idn-hostname"]=dl(),t["iri-reference"]=hl()}),ml=B((t,e)=>{var r=pl();e.exports=(n,s={})=>{const l=Object.keys(r);let a=l;if(s.formats){if(!Array.isArray(s.formats))throw new Error("options.formats must be an array");a=s.formats}return l.filter(u=>a.includes(u)).forEach(u=>{n.addFormat(u,r[u])}),n}}),gl=B((t,e)=>{var r=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function l(h,c,d){this.fn=h,this.context=c,this.once=d||!1}function a(h,c,d,w,P){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new l(d,w||h,P),E=n?n+c:c;return h._events[E]?h._events[E].fn?h._events[E]=[h._events[E],b]:h._events[E].push(b):(h._events[E]=b,h._eventsCount++),h}function u(h,c){--h._eventsCount===0?h._events=new s:delete h._events[c]}function i(){this._events=new s,this._eventsCount=0}i.prototype.eventNames=function(){var c=[],d,w;if(this._eventsCount===0)return c;for(w in d=this._events)r.call(d,w)&&c.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},i.prototype.listeners=function(c){var d=n?n+c:c,w=this._events[d];if(!w)return[];if(w.fn)return[w.fn];for(var P=0,b=w.length,E=new Array(b);P<b;P++)E[P]=w[P].fn;return E},i.prototype.listenerCount=function(c){var d=n?n+c:c,w=this._events[d];return w?w.fn?1:w.length:0},i.prototype.emit=function(c,d,w,P,b,E){var m=n?n+c:c;if(!this._events[m])return!1;var o=this._events[m],_=arguments.length,p,v;if(o.fn){switch(o.once&&this.removeListener(c,o.fn,void 0,!0),_){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,d),!0;case 3:return o.fn.call(o.context,d,w),!0;case 4:return o.fn.call(o.context,d,w,P),!0;case 5:return o.fn.call(o.context,d,w,P,b),!0;case 6:return o.fn.call(o.context,d,w,P,b,E),!0}for(v=1,p=new Array(_-1);v<_;v++)p[v-1]=arguments[v];o.fn.apply(o.context,p)}else{var $=o.length,y;for(v=0;v<$;v++)switch(o[v].once&&this.removeListener(c,o[v].fn,void 0,!0),_){case 1:o[v].fn.call(o[v].context);break;case 2:o[v].fn.call(o[v].context,d);break;case 3:o[v].fn.call(o[v].context,d,w);break;case 4:o[v].fn.call(o[v].context,d,w,P);break;default:if(!p)for(y=1,p=new Array(_-1);y<_;y++)p[y-1]=arguments[y];o[v].fn.apply(o[v].context,p)}}return!0},i.prototype.on=function(c,d,w){return a(this,c,d,w,!1)},i.prototype.once=function(c,d,w){return a(this,c,d,w,!0)},i.prototype.removeListener=function(c,d,w,P){var b=n?n+c:c;if(!this._events[b])return this;if(!d)return u(this,b),this;var E=this._events[b];if(E.fn)E.fn===d&&(!P||E.once)&&(!w||E.context===w)&&u(this,b);else{for(var m=0,o=[],_=E.length;m<_;m++)(E[m].fn!==d||P&&!E[m].once||w&&E[m].context!==w)&&o.push(E[m]);o.length?this._events[b]=o.length===1?o[0]:o:u(this,b)}return this},i.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&u(this,d)):(this._events=new s,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,typeof e<"u"&&(e.exports=i)}),vl="https://www.w3.org/ns/activitystreams",yl="https://sockethub.org/ns/context/v1.jsonld",_l="error",wl="https://sockethub.org/ns/context/platform/error/v1.jsonld",$l="sockethub:internal",bl="https://sockethub.org/ns/context/platform/sockethub:internal/v1.jsonld",Jn=new Map,ua=new Map,fa=new Map;function El(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Sl(t){return El(t["@context"])}function da(t,e,r,n){Jn.set(e,t),ua.set(e,r),fa.set(e,n)}function Qn(t){const r=Sl(t).filter(n=>Jn.has(n));return r.length!==1?null:r[0]}function Pl(t){return Jn.get(t)}function kl(t){return ua.get(t)}function Ol(t){return fa.get(t)}var ha={feed:{required:["id","type"],additionalProperties:!0,properties:{type:{enum:["feed"]},id:{type:"string",format:"iri"},name:{type:"string"},description:{type:"string"},author:{type:"string"},favicon:{type:"string"}}},person:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["person"]},name:{type:"string"}}},room:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["room"]},name:{type:"string"}}},service:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["service"]},name:{type:"string"}}},platform:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["platform"]},name:{type:"string"}}},website:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string",format:"iri"},type:{enum:["website"]},name:{type:"string"}}},address:{required:["type"],additionalProperties:!1,properties:{type:{enum:["address"]}}}},Nl=Object.keys(ha),pa=["person","room","service","feed","website","platform"],ma=["person","room","service","feed","website","platform","address"],Tl=pa.map(t=>({$ref:`#/definitions/type/${t}`})),Rl=ma.map(t=>({$ref:`#/definitions/type/${t}`})),Il={type:"array",minItems:3,maxItems:3,items:{type:"string"},allOf:[{contains:{const:vl}},{contains:{const:yl}}]},Cl={type:"string"},Al={$id:"https://sockethub.org/schemas/v/activity-stream.json",description:"Schema for Sockethub Activity Streams",type:"object",required:["@context","type","actor"],additionalProperties:!1,properties:{"@context":Il,id:{type:"string"},type:Cl,actor:{type:"object",oneOf:Tl},target:{type:"object",oneOf:Rl},object:{type:"object"},published:{type:"string",format:"date-time"}},definitions:{type:ha}},jl=Hr(tc()),Ml=Hr(Wc()),Dl=Hr(ml());function ql(t){let e=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return t.keyword==="additionalProperties"?e+=`: ${t.params.additionalProperty}`:t.keyword==="enum"&&(e+=`: ${t.params.allowedValues.join(", ")}`),e}function dr(t){const e=[];t!=null&&t.type&&e.push(t.type);const r=t;for(const n in r){const s=r[n];s&&typeof s=="object"&&"type"in s&&e.push(...dr(s))}return e}function Ll(t){const e=t.schemaPath.match(/#\/\w+\/\w+\/([\w-]+)\//);return e?e[1]:void 0}function Vl(t){const e=t.instancePath.match(/\/(\w+)/);return e?e[1]:void 0}function Ul(t,e){const r=Ll(t),n=Vl(t);if(!n)return-1;const s=e[n];return!s||!r||!s.includes(r)?-1:t.instancePath.split("/").length}function Fl(t){if(!Array.isArray(t["@context"]))return{actor:[],target:[],object:dr(t)};const e=t;return{actor:dr(e.actor),target:dr(e.target),object:e.object?dr(e.object):[]}}function zl(t,e,r){const n=Fl(t);let s=0,l=-1;for(let a=0;a<e.length;a++){const u=Ul(e[a],n);u>l&&(l=u,s=a)}return l>=0?ql(e[s]):Bl(e[e.length-1],r)}function xl(t,e){if(!(e!=null&&e.excludeTypes)||e.excludeTypes.length===0)return t;const r=new Set(e.excludeTypes);return t.filter(n=>!r.has(n))}function Bl(t,e){let r;if(t.keyword==="oneOf"){const n=t.instancePath.split("/")[1],s=n==="actor"?pa:n==="target"?ma:Nl,l=xl(s,e),a=l.length>0?l:s;r=`${t.instancePath}: ${t.message}: ${a.join(", ")}`}else r=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return"additionalProperty"in t.params&&(r+=`: ${t.params.additionalProperty}`),r}var Mt=new jl.default({strictTypes:!1,allErrors:!0});Ml.default(Mt);Dl.default(Mt);var Dt="https://sockethub.org/schemas/v0",On={},Hl={},_s=!1;On[`${Dt}/activity-stream`]=Al;for(const t in On)Mt.addSchema(On[t],t);function ws(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`);const r=`${Dt}/context/${t}/messages`;Mt.getSchema(r)||Mt.addSchema({},r);const n=`${Dt}/context/${t}/credentials`;Mt.getSchema(n)||Mt.addSchema({},n)}function Kl(){_s||(ws(_l,wl),ws($l,bl),_s=!0)}Kl();function Br(t,e){const r=Mt.getSchema(t);if(!r)return`schema ${t} not found`;if(!r(e)){let s=zl(e,r.errors,Hl);if(Array.isArray(e["@context"])){const l=Qn(e);if(l){const a=Pl(l);a&&(s=`[${a}] ${s}`)}}return s}return""}function Gl(t){const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"activity streams must have exactly one registered platform context URL in @context";const n=kl(r);return n?Br(n,t):`platform context URL ${r} does not have a registered message schema`}function Wl(t){if(!Array.isArray(t["@context"]))return"credential activity streams must have an @context set";if(t.type!=="credentials")return"credential activity streams must have credentials set as type";const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"credential activity streams must have exactly one registered platform context URL in @context";const n=Ol(r);return n?Br(n,t):`platform context URL ${r} does not have a registered credentials schema`}function $s(t,e){const r=`${Dt}/context/${e}`;Mt.getSchema(r)||Mt.addSchema(t,r)}function Jl(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`)}var bs={actor:"id",target:"id",object:"content"};function Ql(t,e){return typeof t=="string"?{[e]:t}:Array.isArray(t)?t.map(r=>typeof r=="string"?{id:r}:r):t}function yn(t){const e={...t};for(const r of Object.keys(bs))r in e&&(e[r]=Ql(e[r],bs[r]));return e}var Xl=Hr(gl()),Yl=Xl.default;class en{constructor(e,r={}){nt(this,"events",{credentials:new Map,connect:new Map,join:new Map});nt(this,"_socket");nt(this,"socket");nt(this,"debug",!0);nt(this,"options");nt(this,"platformRegistry",new Map);nt(this,"asContextUrl");nt(this,"sockethubContextUrl");nt(this,"sockethubVersion");nt(this,"initState","idle");nt(this,"hasReadyOnce",!1);nt(this,"initCycle");nt(this,"initTokenCounter",0);nt(this,"initTimeoutTimer");nt(this,"waitingWarningTimer");nt(this,"waitingWarningIntervalMs",1e4);nt(this,"readyWaiters",[]);nt(this,"outboundQueue",[]);nt(this,"outboundSequence",0);nt(this,"registryFingerprint");nt(this,"latestReadyInfo");if(!e)throw new Error("SockethubClient requires a socket.io instance");this._socket=e,this.options={initTimeoutMs:r.initTimeoutMs??5e3,maxQueuedOutbound:r.maxQueuedOutbound??1e3,maxQueuedAgeMs:r.maxQueuedAgeMs??3e4},this.socket=this.createPublicEmitter(),this.registerSocketIOHandlers(),this._socket.connected&&(this.socket.connected=!0,this.socket.id=this._socket.id,this.socket._emit("connect"),this.startInitialization("initial-connect",!0))}clearCredentials(){this.events.credentials.clear()}getRegisteredPlatforms(){return Array.from(this.platformRegistry.values()).map(e=>({...e,types:[...e.types],schemas:{...e.schemas}}))}isSchemasReady(){return this.isReady()}isReady(){return this.initState==="ready"}getInitState(){return this.initState}getRegisteredBaseContexts(){if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");return{as:this.asContextUrl,sockethub:this.sockethubContextUrl}}getPlatformSchema(e,r="messages"){var s,l;const n=e==null?void 0:e.trim();if(n)return(l=(s=this.platformRegistry.get(n))==null?void 0:s.schemas)==null?void 0:l[r]}async waitForSchemas(e=2e3){return await this.ready(e),this.buildPlatformRegistryPayload()}ready(e=this.options.initTimeoutMs){return this.isReady()&&this.latestReadyInfo?Promise.resolve(this.latestReadyInfo):new Promise((r,n)=>{const s={resolve:r,reject:n};e>0&&(s.timer=setTimeout(()=>{this.readyWaiters=this.readyWaiters.filter(l=>l!==s),n(new Error(`SockethubClient ready() timed out after ${e}ms`))},e)),this.readyWaiters.push(s),this.socket.connected&&this.initState==="idle"&&this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)})}validateActivity(e){return e.type==="credentials"?Wl(e):Gl(e)}contextFor(e){if(typeof e!="string"||e.trim().length===0)throw new Error("SockethubClient.contextFor(platform) requires a non-empty platform string");if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");const r=e.trim(),n=this.platformRegistry.get(r);if(!n){const s=Array.from(this.platformRegistry.keys()).sort();throw new Error(`unknown platform '${r}'. Registered platforms: ${s.join(", ")}`)}return[this.asContextUrl,this.sockethubContextUrl,n.contextUrl]}createPublicEmitter(){const e=new Yl;return e._emit=e.emit,e.emit=(r,n,s)=>{this.handlePublicEmit(r,n,s)},e.connected=!1,e.disconnect=()=>{this._socket.disconnect()},e.connect=()=>{this._socket.connect()},e}requestSchemaRegistry(){"io"in this._socket&&this._socket.emit("schemas",this.registryFingerprint,r=>{this.handleSchemasPayload(r)})}applyPlatformRegistry(e){var a,u,i,h;if(!e||typeof e!="object")return;const r=e,n=(a=r.contexts)==null?void 0:a.as,s=(u=r.contexts)==null?void 0:u.sockethub;if(typeof n!="string"||typeof s!="string"||!Array.isArray(r.platforms))return;this.sockethubVersion=typeof r.version=="string"?r.version:"unknown",this.asContextUrl=n,this.sockethubContextUrl=s,this.platformRegistry.clear();for(const c of r.platforms)if(!(!c||typeof c!="object"||typeof c.id!="string"||typeof c.version!="string"||typeof c.contextUrl!="string")){this.platformRegistry.set(c.id,{...c,version:c.version,types:Array.isArray(c.types)?c.types:[],schemas:c.schemas||{}}),Jl(c.id,c.contextUrl);try{const d=(i=c.schemas)==null?void 0:i.credentials;d&&typeof d=="object"&&!Array.isArray(d)&&$s(d,`${c.id}/credentials`);const w=(h=c.schemas)==null?void 0:h.messages;w&&typeof w=="object"&&!Array.isArray(w)&&$s(w,`${c.id}/messages`)}catch(d){const w=d instanceof Error?d.message:String(d);console.warn(`[SockethubClient] Failed to register schemas for platform ${c.id}: ${w}`)}}const l=this.buildPlatformRegistryPayload();return this.registryFingerprint=typeof r.fingerprint=="string"?r.fingerprint:void 0,this.socket._emit("schemas",l),l}eventCredentials(e){if(e.object&&e.object.type==="credentials"){const r=e.actor.id||e.actor;this.events.credentials.set(r,e)}}eventMessage(e){if(!this._socket.connected)return;const r=en.getKey(e);e.type==="join"||e.type==="connect"?this.events[e.type].set(r,e):e.type==="leave"?this.events.join.delete(r):e.type==="disconnect"&&this.events.connect.delete(r)}static getKey(e){var s;const r=((s=e.actor)==null?void 0:s.id)||e.actor;if(!r)throw new Error(`actor property not present for message type: ${e==null?void 0:e.type}`);const n=e.target?e.target.id||e.target:"";return`${r}-${n}`}buildPlatformRegistryPayload(){return{version:this.sockethubVersion,contexts:this.asContextUrl&&this.sockethubContextUrl?{as:this.asContextUrl,sockethub:this.sockethubContextUrl}:void 0,platforms:this.getRegisteredPlatforms()}}buildReadyInfo(e){if(!(!this.sockethubVersion||!this.asContextUrl||!this.sockethubContextUrl))return{state:"ready",reason:e,sockethubVersion:this.sockethubVersion,contexts:{as:this.asContextUrl,sockethub:this.sockethubContextUrl},platforms:this.getRegisteredPlatforms().map(r=>({id:r.id,version:r.version,contextUrl:r.contextUrl,contextVersion:r.contextVersion,schemaVersion:r.schemaVersion,types:[...r.types]}))}}resolveReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.resolve(e)}rejectReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.reject(e)}emitInitError(e,r,n){this.socket._emit("init_error",{error:e,phase:r,retrying:n})}emitClientError(e,r,n){if(typeof r=="function"){r({error:n});return}this.socket._emit("client_error",{event:e,error:n})}clearInitTimers(){this.initTimeoutTimer&&(clearTimeout(this.initTimeoutTimer),this.initTimeoutTimer=void 0),this.waitingWarningTimer&&(clearInterval(this.waitingWarningTimer),this.waitingWarningTimer=void 0)}startWaitingWarnings(){this.waitingWarningTimer||(this.waitingWarningTimer=setInterval(()=>{if(this.isReady()||this.initState==="closed"){this.clearInitTimers();return}const e=this.outboundQueue.length,r=this.outboundQueue[0],n=r?((Date.now()-r.enqueuedAt)/1e3).toFixed(1):"0.0";console.warn(`[SockethubClient] Still waiting for schemas; queued outbound messages: ${e}; oldest queued age: ${n}s.`)},this.waitingWarningIntervalMs))}startInitialization(e,r){if(!this.socket.connected||this.initState==="closed")return;const n=++this.initTokenCounter;this.initCycle={token:n,reason:e,startedAt:Date.now(),replayOnReady:r,timedOut:!1},this.initState="initializing",this.clearInitTimers(),this.initTimeoutTimer=setTimeout(()=>{if(!this.initCycle||this.initCycle.token!==n)return;this.initCycle.timedOut=!0,this.initState="init_error";const s=`Initialization timed out after ${this.options.initTimeoutMs}ms waiting for schemas`;console.warn(`[SockethubClient] ${s}; queued outbound messages: ${this.outboundQueue.length}. Waiting for schemas event from server.`),this.emitInitError(s,"timeout",!1),this.startWaitingWarnings()},this.options.initTimeoutMs);try{this.requestSchemaRegistry()}catch(s){this.initState="init_error";const l=s instanceof Error?s.message:String(s);this.emitInitError(l,"schemas-request",!1),this.startWaitingWarnings()}}markReady(e){const r=this.initCycle,n=!!(r!=null&&r.replayOnReady);this.initCycle=void 0,this.clearInitTimers(),this.initState="ready",this.hasReadyOnce=!0;const s=this.buildReadyInfo(e);if(!s){const l=new Error("Failed to build ready payload");this.initState="init_error",this.emitInitError(l.message,"schemas-apply",!0),this.rejectReadyWaiters(l);return}this.socket._emit("ready",s),this.latestReadyInfo=s,this.resolveReadyWaiters(s),n&&(this.replay("credentials",this.events.credentials),this.replay("message",this.events.connect),this.replay("message",this.events.join)),this.flushOutboundQueue()}handleSchemasPayload(e){if(!e||typeof e!="object")return;if(e.unchanged===!0&&typeof this.registryFingerprint=="string"&&this.platformRegistry.size>0){this.initCycle?this.markReady(this.initCycle.reason):this.initState!=="ready"&&this.markReady("schemas-update");return}const r=e.fingerprint;if(this.initState==="ready"&&!this.initCycle&&r&&r===this.registryFingerprint)return;if(this.initState==="ready"&&!this.initCycle&&(this.initState="initializing"),!this.applyPlatformRegistry(e)){this.initState="init_error",this.emitInitError("Received invalid schemas payload from server","schemas-apply",!0),this.startWaitingWarnings();return}if(this.initCycle){this.markReady(this.initCycle.reason);return}this.markReady("schemas-update")}handlePublicEmit(e,r,n){const s={event:e,content:r,callback:n,enqueuedAt:Date.now(),sequence:this.outboundSequence++};if(!this.isReady()){this.enqueueOutbound(s);return}this.sendOutbound(s)}enqueueOutbound(e){if(this.outboundQueue.push(e),this.outboundQueue.length<=this.options.maxQueuedOutbound)return;const r=this.outboundQueue.shift();r&&this.emitClientError(r.event,r.callback,"SockethubClient queue overflow before ready")}flushOutboundQueue(){if(!this.isReady()||this.outboundQueue.length===0)return;const e=Date.now(),r=this.outboundQueue.sort((n,s)=>n.sequence-s.sequence);this.outboundQueue=[];for(const n of r){if(e-n.enqueuedAt>this.options.maxQueuedAgeMs){this.emitClientError(n.event,n.callback,`SockethubClient queued message expired after ${this.options.maxQueuedAgeMs}ms before initialization`);continue}this.sendOutbound(n)}}sendOutbound(e){let r=e.content;try{if(e.event==="credentials"||e.event==="message"){if(r=yn(e.content),r&&typeof r=="object"){const n=r;e.event==="credentials"&&!n.type&&(n.type="credentials"),n.actor&&typeof n.actor=="object"&&!n.actor.type&&(n.actor.type="person")}if(this.platformRegistry.size>0){const n=this.validateActivity(r);if(n){this.emitClientError(e.event,e.callback,`SockethubClient validation failed: ${n}`);return}}}e.event==="credentials"?this.eventCredentials(r):e.event==="message"&&this.eventMessage(r),this._socket.emit(e.event,r,e.callback)}catch(n){const s=n instanceof Error?n.message:String(n);this.emitClientError(e.event,e.callback,s)}}log(e,r){this.debug&&console.log(e,r)}registerSocketIOHandlers(){this._socket.on("connect",()=>{this.socket.id=this._socket.id,this.socket.connected=!0,this.socket._emit("connect"),this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)}),this._socket.on("connect_error",e=>{this.socket._emit("connect_error",e)}),this._socket.on("disconnect",e=>{this.socket.connected=!1,this.initState!=="closed"&&(this.initState="idle"),this.clearInitTimers(),this.socket._emit("disconnect",e)}),this._socket.on("schemas",e=>{this.handleSchemasPayload(e)}),this._socket.on("message",e=>{this.socket._emit("message",yn(e))})}hasActorId(e){return"actor"in e&&e.actor!==null&&typeof e.actor=="object"&&"id"in e.actor&&typeof e.actor.id=="string"}replay(e,r){for(const n of r.values()){const s=yn(n);let l=s==null?void 0:s.id;if(this.hasActorId(s)){const a=s.actor;l=typeof a=="string"?a:a.id}this.log(`replaying ${e} for ${l}`),this._socket.emit(e,s)}}}(t=>{t.SockethubClient=en})(typeof globalThis=="object"?globalThis:{});const Lt=Object.create(null);Lt.open="0";Lt.close="1";Lt.ping="2";Lt.pong="3";Lt.message="4";Lt.upgrade="5";Lt.noop="6";const Ir=Object.create(null);Object.keys(Lt).forEach(t=>{Ir[Lt[t]]=t});const Nn={type:"error",data:"parser error"},ga=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",va=typeof ArrayBuffer=="function",ya=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Xn=({type:t,data:e},r,n)=>ga&&e instanceof Blob?r?n(e):Es(e,n):va&&(e instanceof ArrayBuffer||ya(e))?r?n(e):Es(new Blob([e]),n):n(Lt[t]+(e||"")),Es=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function Ss(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let _n;function Zl(t,e){if(ga&&t.data instanceof Blob)return t.data.arrayBuffer().then(Ss).then(e);if(va&&(t.data instanceof ArrayBuffer||ya(t.data)))return e(Ss(t.data));Xn(t,!1,r=>{_n||(_n=new TextEncoder),e(_n.encode(r))})}const Ps="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Ps.length;t++)hr[Ps.charCodeAt(t)]=t;const eu=t=>{let e=t.length*.75,r=t.length,n,s=0,l,a,u,i;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const h=new ArrayBuffer(e),c=new Uint8Array(h);for(n=0;n<r;n+=4)l=hr[t.charCodeAt(n)],a=hr[t.charCodeAt(n+1)],u=hr[t.charCodeAt(n+2)],i=hr[t.charCodeAt(n+3)],c[s++]=l<<2|a>>4,c[s++]=(a&15)<<4|u>>2,c[s++]=(u&3)<<6|i&63;return h},tu=typeof ArrayBuffer=="function",Yn=(t,e)=>{if(typeof t!="string")return{type:"message",data:_a(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:ru(t.substring(1),e)}:Ir[r]?t.length>1?{type:Ir[r],data:t.substring(1)}:{type:Ir[r]}:Nn},ru=(t,e)=>{if(tu){const r=eu(t);return _a(r,e)}else return{base64:!0,data:t}},_a=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},wa="",nu=(t,e)=>{const r=t.length,n=new Array(r);let s=0;t.forEach((l,a)=>{Xn(l,!1,u=>{n[a]=u,++s===r&&e(n.join(wa))})})},su=(t,e)=>{const r=t.split(wa),n=[];for(let s=0;s<r.length;s++){const l=Yn(r[s],e);if(n.push(l),l.type==="error")break}return n};function au(){return new TransformStream({transform(t,e){Zl(t,r=>{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const l=new DataView(s.buffer);l.setUint8(0,126),l.setUint16(1,n)}else{s=new Uint8Array(9);const l=new DataView(s.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(r)})}})}let wn;function Nr(t){return t.reduce((e,r)=>e+r.length,0)}function Tr(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let s=0;s<e;s++)r[s]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function iu(t,e){wn||(wn=new TextDecoder);const r=[];let n=0,s=-1,l=!1;return new TransformStream({transform(a,u){for(r.push(a);;){if(n===0){if(Nr(r)<1)break;const i=Tr(r,1);l=(i[0]&128)===128,s=i[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Nr(r)<2)break;const i=Tr(r,2);s=new DataView(i.buffer,i.byteOffset,i.length).getUint16(0),n=3}else if(n===2){if(Nr(r)<8)break;const i=Tr(r,8),h=new DataView(i.buffer,i.byteOffset,i.length),c=h.getUint32(0);if(c>Math.pow(2,21)-1){u.enqueue(Nn);break}s=c*Math.pow(2,32)+h.getUint32(4),n=3}else{if(Nr(r)<s)break;const i=Tr(r,s);u.enqueue(Yn(l?i:wn.decode(i),e)),n=0}if(s===0||s>t){u.enqueue(Nn);break}}}})}const $a=4;function ot(t){if(t)return ou(t)}function ou(t){for(var e in ot.prototype)t[e]=ot.prototype[e];return t}ot.prototype.on=ot.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};ot.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};ot.prototype.off=ot.prototype.removeListener=ot.prototype.removeAllListeners=ot.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,s=0;s<r.length;s++)if(n=r[s],n===e||n.fn===e){r.splice(s,1);break}return r.length===0&&delete this._callbacks["$"+t],this};ot.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,e)}return this};ot.prototype.emitReserved=ot.prototype.emit;ot.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ot.prototype.hasListeners=function(t){return!!this.listeners(t).length};const tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Ot=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),cu="arraybuffer";function ba(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const lu=Ot.setTimeout,uu=Ot.clearTimeout;function rn(t,e){e.useNativeTimers?(t.setTimeoutFn=lu.bind(Ot),t.clearTimeoutFn=uu.bind(Ot)):(t.setTimeoutFn=Ot.setTimeout.bind(Ot),t.clearTimeoutFn=Ot.clearTimeout.bind(Ot))}const fu=1.33;function du(t){return typeof t=="string"?hu(t):Math.ceil((t.byteLength||t.size)*fu)}function hu(t){let e=0,r=0;for(let n=0,s=t.length;n<s;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function Ea(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function pu(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function mu(t){let e={},r=t.split("&");for(let n=0,s=r.length;n<s;n++){let l=r[n].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}class gu extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class Zn extends ot{constructor(e){super(),this.writable=!1,rn(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,n){return super.emitReserved("error",new gu(e,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const r=Yn(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const r=pu(e);return r.length?"?"+r:""}}class vu extends Zn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};su(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,nu(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Ea()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}}let Sa=!1;try{Sa=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const yu=Sa;function _u(){}class wu extends vu{constructor(e){if(super(e),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(s,l)=>{this.onError("xhr post error",s,l)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class qt extends ot{constructor(e,r,n){super(),this.createRequest=e,rn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const r=ba(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=qt.requestsCount++,qt.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=_u,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete qt.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}qt.requestsCount=0;qt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ks);else if(typeof addEventListener=="function"){const t="onpagehide"in Ot?"pagehide":"unload";addEventListener(t,ks,!1)}}function ks(){for(let t in qt.requests)qt.requests.hasOwnProperty(t)&&qt.requests[t].abort()}const $u=function(){const t=Pa({xdomain:!1});return t&&t.responseType!==null}();class bu extends wu{constructor(e){super(e);const r=e&&e.forceBase64;this.supportsBinary=$u&&!r}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new qt(Pa,this.uri(),e)}}function Pa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||yu))return new XMLHttpRequest}catch{}if(!e)try{return new Ot[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ka=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Eu extends Zn{get name(){return"websocket"}doOpen(){const e=this.uri(),r=this.opts.protocols,n=ka?{}:ba(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,n)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;Xn(n,this.supportsBinary,l=>{try{this.doWrite(n,l)}catch{}s&&tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Ea()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}}const $n=Ot.WebSocket||Ot.MozWebSocket;class Su extends Eu{createSocket(e,r,n){return ka?new $n(e,r,n):r?new $n(e,r):new $n(e)}doWrite(e,r){this.ws.send(r)}}class Pu extends Zn{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const r=iu(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),s=au();s.readable.pipeTo(e.writable),this._writer=s.writable.getWriter();const l=()=>{n.read().then(({done:u,value:i})=>{u||(this.onPacket(i),l())}).catch(u=>{})};l();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;this._writer.write(n).then(()=>{s&&tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const ku={websocket:Su,webtransport:Pu,polling:bu},Ou=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Nu=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tn(t){if(t.length>8e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let s=Ou.exec(t||""),l={},a=14;for(;a--;)l[Nu[a]]=s[a]||"";return r!=-1&&n!=-1&&(l.source=e,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=Tu(l,l.path),l.queryKey=Ru(l,l.query),l}function Tu(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Ru(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,l){s&&(r[s]=l)}),r}const Rn=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cr=[];Rn&&addEventListener("offline",()=>{Cr.forEach(t=>t())},!1);class Jt extends ot{constructor(e,r){if(super(),this.binaryType=cu,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){const n=Tn(e);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Tn(r.host).host);rn(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const s=n.prototype.name;this.transports.push(s),this._transportsByName[s]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=mu(this.opts.query)),Rn&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Cr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=$a,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Jt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(e);r.open(),this.setTransport(r)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Jt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=e.data,this._onError(r);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const s=this.writeBuffer[n].data;if(s&&(r+=du(s)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,n){return this._sendPacket("message",e,r,n),this}send(e,r,n){return this._sendPacket("message",e,r,n),this}_sendPacket(e,r,n,s){if(typeof r=="function"&&(s=r,r=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const l={type:e,data:r,options:n};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Jt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Rn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Cr.indexOf(this._offlineEventListener);n!==-1&&Cr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=$a;class Iu extends Jt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let r=this.createTransport(e),n=!1;Jt.priorWebsocketSuccess=!1;const s=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Jt.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(c(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function l(){n||(n=!0,c(),r.close(),r=null)}const a=d=>{const w=new Error("probe error: "+d);w.transport=r.name,l(),this.emitReserved("upgradeError",w)};function u(){a("transport closed")}function i(){a("socket closed")}function h(d){r&&d.name!==r.name&&l()}const c=()=>{r.removeListener("open",s),r.removeListener("error",a),r.removeListener("close",u),this.off("close",i),this.off("upgrading",h)};r.once("open",s),r.once("error",a),r.once("close",u),this.once("close",i),this.once("upgrading",h),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const r=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}}let Cu=class extends Iu{constructor(e,r={}){const n=typeof e=="object"?e:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(s=>ku[s]).filter(s=>!!s)),super(e,n)}};function Au(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=Tn(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const l=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+l+":"+n.port+e,n.href=n.protocol+"://"+l+(r&&r.port===n.port?"":":"+n.port),n}const ju=typeof ArrayBuffer=="function",Mu=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Oa=Object.prototype.toString,Du=typeof Blob=="function"||typeof Blob<"u"&&Oa.call(Blob)==="[object BlobConstructor]",qu=typeof File=="function"||typeof File<"u"&&Oa.call(File)==="[object FileConstructor]";function es(t){return ju&&(t instanceof ArrayBuffer||Mu(t))||Du&&t instanceof Blob||qu&&t instanceof File}function Ar(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(Ar(t[r]))return!0;return!1}if(es(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ar(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Ar(t[r]))return!0;return!1}function Lu(t){const e=[],r=t.data,n=t;return n.data=In(r,e),n.attachments=e.length,{packet:n,buffers:e}}function In(t,e){if(!t)return t;if(es(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=In(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=In(t[n],e));return r}return t}function Vu(t,e){return t.data=Cn(t.data,e),delete t.attachments,t}function Cn(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Cn(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Cn(t[r],e));return t}const Uu=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Fu=5;var De;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(De||(De={}));class zu{constructor(e){this.replacer=e}encode(e){return(e.type===De.EVENT||e.type===De.ACK)&&Ar(e)?this.encodeAsBinary({type:e.type===De.EVENT?De.BINARY_EVENT:De.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===De.BINARY_EVENT||e.type===De.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=Lu(e),n=this.encodeAsString(r.packet),s=r.buffers;return s.unshift(n),s}}function Os(t){return Object.prototype.toString.call(t)==="[object Object]"}class ts extends ot{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===De.BINARY_EVENT;n||r.type===De.BINARY_ACK?(r.type=n?De.EVENT:De.ACK,this.reconstructor=new xu(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(es(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(De[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===De.BINARY_EVENT||n.type===De.BINARY_ACK){const l=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const a=e.substring(l,r);if(a!=Number(a)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(r+1)==="/"){const l=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(l,r)}else n.nsp="/";const s=e.charAt(r+1);if(s!==""&&Number(s)==s){const l=r+1;for(;++r;){const a=e.charAt(r);if(a==null||Number(a)!=a){--r;break}if(r===e.length)break}n.id=Number(e.substring(l,r+1))}if(e.charAt(++r)){const l=this.tryParse(e.substr(r));if(ts.isPayloadValid(n.type,l))n.data=l;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case De.CONNECT:return Os(r);case De.DISCONNECT:return r===void 0;case De.CONNECT_ERROR:return typeof r=="string"||Os(r);case De.EVENT:case De.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Uu.indexOf(r[0])===-1);case De.ACK:case De.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class xu{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=Vu(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Bu=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ts,Encoder:zu,get PacketType(){return De},protocol:Fu},Symbol.toStringTag,{value:"Module"}));function Rt(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const Hu=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Na extends ot{constructor(e,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Rt(e,"open",this.onopen.bind(this)),Rt(e,"packet",this.onpacket.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...r){var n,s,l;if(Hu.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const a={type:De.EVENT,data:r};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const c=this.ids++,d=r.pop();this._registerAckCallback(c,d),a.id=c}const u=(s=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||s===void 0?void 0:s.writable,i=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!u||(i?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,r){var n;const s=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(s===void 0){this.acks[e]=r;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===e&&this.sendBuffer.splice(u,1);r.call(this,new Error("operation has timed out"))},s),a=(...u)=>{this.io.clearTimeoutFn(l),r.apply(this,u)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...r){return new Promise((n,s)=>{const l=(a,u)=>a?s(a):n(u);l.withError=!0,r.push(l),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...l)=>(this._queue[0],s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(s)):(this._queue.shift(),r&&r(null,...l)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:De.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case De.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case De.EVENT:case De.BINARY_EVENT:this.onevent(e);break;case De.ACK:case De.BINARY_ACK:this.onack(e);break;case De.DISCONNECT:this.ondisconnect();break;case De.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...s){n||(n=!0,r.packet({type:De.ACK,id:e,data:s}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:De.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function ar(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ar.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0};ar.prototype.reset=function(){this.attempts=0};ar.prototype.setMin=function(t){this.ms=t};ar.prototype.setMax=function(t){this.max=t};ar.prototype.setJitter=function(t){this.jitter=t};class An extends ot{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,rn(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new ar({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const s=r.parser||Bu;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Cu(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=Rt(r,"open",function(){n.onopen(),e&&e()}),l=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},a=Rt(r,"error",l);if(this._timeout!==!1){const u=this._timeout,i=this.setTimeoutFn(()=>{s(),l(new Error("timeout")),r.close()},u);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(s),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Rt(e,"ping",this.onping.bind(this)),Rt(e,"data",this.ondata.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(e,"close",this.onclose.bind(this)),Rt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){tn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Na(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ur={};function jr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=Au(t,e.path||"/socket.io"),n=r.source,s=r.id,l=r.path,a=ur[s]&&l in ur[s].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let i;return u?i=new An(n,e):(ur[s]||(ur[s]=new An(n,e)),i=ur[s]),r.query&&!e.query&&(e.query=r.queryKey),i.socket(r.path,e)}Object.assign(jr,{Manager:An,Socket:Na,io:jr,connect:jr});let Pt;const Ku=yr(!1),Gu={sockethub:{port:10550,host:"localhost",path:"/sockethub"},public:{protocol:"http",host:"localhost",port:10550,path:"/"}};async function Ta(){if(!Pt)throw new Error("Sockethub client is not initialized yet");await Pt.ready()}async function of(t){return await Ta(),Pt.contextFor(t)}function cf(t){return{id:t.id,type:t.type,name:t.name??t.id}}async function lf(t){return await Ta(),console.log("sending ->",t),new Promise((e,r)=>{Pt.socket.emit("message",hn("SEND",t),n=>{if(console.log("received <-",n),hn("RESP",n),n.totalItems&&n.items)for(const s of n.items.reverse())hn("RESP",s,!0);Vs(n,!0),n.error?r(n.error):e(n)})})}function bn(t){return e=>{const r=t==="connect";Ku.update(()=>r),console.log(`sockethub ${t} [connected: ${r}]`,e||"")}}function Wu(t){console.log("handle incoming: ",t),Vs(t,!1)}function Ns(t=Gu){Pt=new en(jr(`${t.public.protocol}://${t.public.host}:${t.public.port}`,{path:t.sockethub.path}),{initTimeoutMs:1e4}),Pt.socket.on("connect",bn("connect")),Pt.socket.on("error",bn("error")),Pt.socket.on("disconnect",bn("disconnect")),Pt.socket.on("message",Wu),Pt.socket.on("schemas",e=>{console.log("schemas received:",e),pn("schemas",e)}),Pt.socket.on("ready",e=>{console.log("client ready:",e),pn("ready",e)}),Pt.socket.on("init_error",e=>{console.error("client init error:",e),pn("init_error",e)})}typeof globalThis=="object"&&"window"in globalThis&&(console.log("connecting to sockethub"),fetch("/config.json").then(async t=>{const e=await t.json();Ns(e)}).catch(()=>{Ns()}));export{nf as I,sf as L,cf as a,Ku as b,of as c,Pt as d,Ta as e,Pn as f,Ls as g,bi as h,qs as i,lf as s};
|
|
36
|
+
from .`,reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4452"}]},{scheme:"ipp",description:"Internet Printing Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3510"}]},{scheme:"ipps",description:"Internet Printing Protocol over HTTPS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7472"}]},{scheme:"iris",description:"Internet Registry Information Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3981"}]},{scheme:"iris.beep",description:"iris.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3983"}]},{scheme:"iris.lwz",description:"iris.lwz",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4993"}]},{scheme:"iris.xpc",description:"iris.xpc",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"iris.xpcs",description:"iris.xpcs",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"jabber",description:"jabber",reference:[],template:"http://www.iana.org/assignments/uri-schemes/perm/jabber"},{scheme:"ldap",description:"Lightweight Directory Access Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4516"}]},{scheme:"mailto",description:"Electronic mail address",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6068"}]},{scheme:"mid",description:"message identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2392"}]},{scheme:"msrp",description:"Message Session Relay Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"msrps",description:"Message Session Relay Protocol Secure",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"mtqp",description:"Message Tracking Query Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3887"}]},{scheme:"mupdate",description:"Mailbox Update (MUPDATE) Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3656"}]},{scheme:"news",description:"USENET news",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"nfs",description:"network file system protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2224"}]},{scheme:"ni",description:"ni",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nih",description:"nih",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nntp",description:"USENET news using NNTP access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"opaquelocktoken",description:"opaquelocktokent",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4918"}]},{scheme:"pkcs11",description:"PKCS#11",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7512"}]},{scheme:"pop",description:"Post Office Protocol v3",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2384"}]},{scheme:"pres",description:"Presence",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3859"}]},{scheme:"reload",description:"reload",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6940"}]},{scheme:"rtsp",description:"Real-time Streaming Protocol (RTSP)",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtsps",description:"Real-time Streaming Protocol (RTSP) over TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtspu",description:"Real-time Streaming Protocol (RTSP) over unreliable datagram transport",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"}]},{scheme:"service",description:"service location",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2609"}]},{scheme:"session",description:"session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6787"}]},{scheme:"shttp",description:"Secure Hypertext Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2660"}]},{scheme:"sieve",description:"ManageSieve Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5804"}]},{scheme:"sip",description:"session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sips",description:"secure session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sms",description:"Short Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5724"}]},{scheme:"snmp",description:"Simple Network Management Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4088"}]},{scheme:"soap.beep",description:"soap.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"soap.beeps",description:"soap.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"stun",description:"stun",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"stuns",description:"stuns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"tag",description:"tag",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4151"}]},{scheme:"tel",description:"telephone",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"telnet",description:"Reference to interactive sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4248"}]},{scheme:"tftp",description:"Trivial File Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3617"}]},{scheme:"thismessage",description:"multipart/related relative reference resolution",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2557"}],template:"http://www.iana.org/assignments/uri-schemes/perm/thismessage"},{scheme:"tip",description:"Transaction Internet Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2371"}]},{scheme:"tn3270",description:"Interactive 3270 emulation sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6270"}]},{scheme:"turn",description:"turn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"turns",description:"turns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"tv",description:"TV Broadcasts",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2838"}]},{scheme:"urn",description:"Uniform Resource Names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2141"},{type:"registry",href:"http://www.iana.org/assignments/urn-namespaces"}]},{scheme:"vemmi",description:"versatile multimedia interface",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2122"}]},{scheme:"vnc",description:"Remote Framebuffer Protocol",reference:[{type:"draft",href:"http://www.iana.org/go/RFC-warden-appsawg-vnc-scheme-10"}]},{scheme:"ws",description:"WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"wss",description:"Encrypted WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"xcon",description:"xcon",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xcon-userid",description:"xcon-userid",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xmlrpc.beep",description:"xmlrpc.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmlrpc.beeps",description:"xmlrpc.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmpp",description:"Extensible Messaging and Presence Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5122"}]},{scheme:"z39.50r",description:"Z39.50 Retrieval",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]},{scheme:"z39.50s",description:"Z39.50 Session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),Zc=B((t,e)=>{e.exports=[{scheme:"acr",description:"acr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/acr"},{scheme:"adiumxtra",description:"adiumxtra",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/adiumxtra"},{scheme:"afp",description:"afp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/afp"},{scheme:"afs",description:"Andrew File System global file names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"aim",description:"aim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aim"},{scheme:"appdata",description:"appdata",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/appdata"},{scheme:"apt",description:"apt",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/apt"},{scheme:"attachment",description:"attachment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/attachment"},{scheme:"aw",description:"aw",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aw"},{scheme:"barion",description:"barion",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/barion"},{scheme:"beshare",description:"beshare",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/beshare"},{scheme:"bitcoin",description:"bitcoin",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bitcoin"},{scheme:"blob",description:"blob",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/blob"},{scheme:"bolo",description:"bolo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bolo"},{scheme:"callto",description:"callto",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/callto"},{scheme:"chrome",description:"chrome",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome"},{scheme:"chrome-extension",description:"chrome-extension",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome-extension"},{scheme:"com-eventbrite-attendee",description:"com-eventbrite-attendee",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/com-eventbrite-attendee"},{scheme:"content",description:"content",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/content"},{scheme:"cvs",description:"cvs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/cvs"},{scheme:"dis",description:"dis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dis"},{scheme:"dlna-playcontainer",description:"dlna-playcontainer",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playcontainer"},{scheme:"dlna-playsingle",description:"dlna-playsingle",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playsingle"},{scheme:"dntp",description:"dntp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dntp"},{scheme:"dtn",description:"DTNRG research and development",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5050"}]},{scheme:"dvb",description:"dvb",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mcroberts-uri-dvb"}]},{scheme:"ed2k",description:"ed2k",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ed2k"},{scheme:"facetime",description:"facetime",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/facetime"},{scheme:"feed",description:"feed",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feed"},{scheme:"feedready",description:"feedready",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feedready"},{scheme:"finger",description:"finger",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/finger"},{scheme:"fish",description:"fish",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/fish"},{scheme:"gg",description:"gg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gg"},{scheme:"git",description:"git",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/git"},{scheme:"gizmoproject",description:"gizmoproject",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gizmoproject"},{scheme:"gtalk",description:"gtalk",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gtalk"},{scheme:"ham",description:"ham",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7046"}]},{scheme:"hcp",description:"hcp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/hcp"},{scheme:"icon",description:"icon",reference:[{type:"draft",href:"http://www.iana.org/go/draft-lafayette-icon-uri-scheme"}]},{scheme:"iotdisco",description:"iotdisco",reference:[{type:"uri",href:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco.pdf"}],template:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco"},{scheme:"ipn",description:"ipn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6260"}]},{scheme:"irc",description:"irc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc"},{scheme:"irc6",description:"irc6",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc6"},{scheme:"ircs",description:"ircs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ircs"},{scheme:"isostore",description:"isostore",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/isostore"},{scheme:"itms",description:"itms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/itms"},{scheme:"jar",description:"jar",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/jar"},{scheme:"jms",description:"Java Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6167"}]},{scheme:"keyparc",description:"keyparc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/keyparc"},{scheme:"lastfm",description:"lastfm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/lastfm"},{scheme:"ldaps",description:"ldaps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ldaps"},{scheme:"magnet",description:"magnet",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/magnet"},{scheme:"maps",description:"maps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/maps"},{scheme:"market",description:"market",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/market"},{scheme:"message",description:"message",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/message"},{scheme:"mms",description:"mms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mms"},{scheme:"ms-access",description:"ms-access",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-access"},{scheme:"ms-drive-to",description:"ms-drive-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-drive-to"},{scheme:"ms-enrollment",description:"ms-enrollment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-enrollment"},{scheme:"ms-excel",description:"ms-excel",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-excel"},{scheme:"ms-getoffice",description:"ms-getoffice",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-getoffice"},{scheme:"ms-help",description:"ms-help",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-help"},{scheme:"ms-infopath",description:"ms-infopath",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-infopath"},{scheme:"ms-media-stream-id",description:"ms-media-stream-id",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-media-stream-id"},{scheme:"ms-powerpoint",description:"ms-powerpoint",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-powerpoint"},{scheme:"ms-project",description:"ms-project",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-project"},{scheme:"ms-publisher",description:"ms-publisher",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-publisher"},{scheme:"ms-search-repair",description:"ms-search-repair",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-search-repair"},{scheme:"ms-secondary-screen-controller",description:"ms-secondary-screen-controller",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-controller"},{scheme:"ms-secondary-screen-setup",description:"ms-secondary-screen-setup",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-setup"},{scheme:"ms-settings",description:"ms-settings",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings"},{scheme:"ms-settings-airplanemode",description:"ms-settings-airplanemode",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-airplanemode"},{scheme:"ms-settings-bluetooth",description:"ms-settings-bluetooth",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-bluetooth"},{scheme:"ms-settings-camera",description:"ms-settings-camera",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-camera"},{scheme:"ms-settings-cellular",description:"ms-settings-cellular",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cellular"},{scheme:"ms-settings-cloudstorage",description:"ms-settings-cloudstorage",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cloudstorage"},{scheme:"ms-settings-connectabledevices",description:"ms-settings-connectabledevices",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-connectabledevices"},{scheme:"ms-settings-displays-topology",description:"ms-settings-displays-topology",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-displays-topology"},{scheme:"ms-settings-emailandaccounts",description:"ms-settings-emailandaccounts",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-emailandaccounts"},{scheme:"ms-settings-language",description:"ms-settings-language",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-language"},{scheme:"ms-settings-location",description:"ms-settings-location",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-location"},{scheme:"ms-settings-lock",description:"ms-settings-lock",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-lock"},{scheme:"ms-settings-nfctransactions",description:"ms-settings-nfctransactions",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-nfctransactions"},{scheme:"ms-settings-notifications",description:"ms-settings-notifications",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-notifications"},{scheme:"ms-settings-power",description:"ms-settings-power",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-power"},{scheme:"ms-settings-privacy",description:"ms-settings-privacy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-privacy"},{scheme:"ms-settings-proximity",description:"ms-settings-proximity",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-proximity"},{scheme:"ms-settings-screenrotation",description:"ms-settings-screenrotation",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-screenrotation"},{scheme:"ms-settings-wifi",description:"ms-settings-wifi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-wifi"},{scheme:"ms-settings-workplace",description:"ms-settings-workplace",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-workplace"},{scheme:"ms-spd",description:"ms-spd",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-spd"},{scheme:"ms-transit-to",description:"ms-transit-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-transit-to"},{scheme:"ms-visio",description:"ms-visio",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-visio"},{scheme:"ms-walk-to",description:"ms-walk-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-walk-to"},{scheme:"ms-word",description:"ms-word",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-word"},{scheme:"msnim",description:"msnim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/msnim"},{scheme:"mumble",description:"mumble",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mumble"},{scheme:"mvn",description:"mvn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mvn"},{scheme:"notes",description:"notes",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/notes"},{scheme:"oid",description:"oid",reference:[{type:"draft",href:"http://www.iana.org/go/draft-larmouth-oid-iri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/oid"},{scheme:"palm",description:"palm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/palm"},{scheme:"paparazzi",description:"paparazzi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/paparazzi"},{scheme:"platform",description:"platform",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/platform"},{scheme:"proxy",description:"proxy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/proxy"},{scheme:"psyc",description:"psyc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/psyc"},{scheme:"query",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/query"},{scheme:"redis",description:"redis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/redis"},{scheme:"rediss",description:"rediss",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rediss"},{scheme:"res",description:"res",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/res"},{scheme:"resource",description:"resource",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/resource"},{scheme:"rmi",description:"rmi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rmi"},{scheme:"rsync",description:"rsync",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5781"}]},{scheme:"rtmfp",description:"rtmfp",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7425"}],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmfp"},{scheme:"rtmp",description:"rtmp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmp"},{scheme:"secondlife",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/secondlife"},{scheme:"sftp",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sftp"},{scheme:"sgn",description:"sgn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sgn"},{scheme:"skype",description:"skype",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/skype"},{scheme:"smb",description:"smb",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/smb"},{scheme:"smtp",description:"smtp",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/smtp"},{scheme:"soldat",description:"soldat",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/soldat"},{scheme:"spotify",description:"spotify",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/spotify"},{scheme:"ssh",description:"ssh",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ssh"},{scheme:"steam",description:"steam",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/steam"},{scheme:"submit",description:"submit",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/submit"},{scheme:"svn",description:"svn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/svn"},{scheme:"teamspeak",description:"teamspeak",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teamspeak"},{scheme:"teliaeid",description:"teliaeid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teliaeid"},{scheme:"things",description:"things",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/things"},{scheme:"tool",description:"tool",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/tool"},{scheme:"udp",description:"udp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/udp"},{scheme:"unreal",description:"unreal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/unreal"},{scheme:"ut2004",description:"ut2004",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ut2004"},{scheme:"v-event",description:"v-event",reference:[{type:"draft",href:"http://www.iana.org/go/draft-menderico-v-event-uri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/v-event"},{scheme:"ventrilo",description:"ventrilo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ventrilo"},{scheme:"view-source",description:"view-source",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/view-source"},{scheme:"webcal",description:"webcal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/webcal"},{scheme:"wpid",description:"wpid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wpid"},{scheme:"wtai",description:"wtai",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wtai"},{scheme:"wyciwyg",description:"wyciwyg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wyciwyg"},{scheme:"xfire",description:"xfire",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xfire"},{scheme:"xri",description:"xri",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xri"},{scheme:"ymsgr",description:"ymsgr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ymsgr"}]}),el=B((t,e)=>{e.exports=[{scheme:"fax",description:"fax",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"filesystem",description:"filesystem",reference:[],template:"http://www.iana.org/assignments/uri-schemes/historic/filesystem"},{scheme:"mailserver",description:"Access to data available from mail servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6196"}]},{scheme:"modem",description:"modem",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"pack",description:"pack",reference:[{type:"draft",href:"http://www.iana.org/go/draft-shur-pack-uri-scheme"}],template:"http://www.iana.org/assignments/uri-schemes/historic/pack"},{scheme:"prospero",description:"Prospero Directory Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4157"}]},{scheme:"snews",description:"NNTP over SSL/TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"videotex",description:"videotex",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mavrakis-videotex-url-spec"},{type:"rfc",href:"http://www.iana.org/go/rfc2122"},{type:"rfc",href:"http://www.iana.org/go/rfc3986"}],template:"http://www.iana.org/assignments/uri-schemes/historic/videotex"},{scheme:"wais",description:"Wide Area Information Servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4156"}]},{scheme:"z39.50",description:"Z39.50 information access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"},{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),tl=B((t,e)=>{e.exports=[{scheme:"android-app"},{scheme:"webpack"},{scheme:"s3",description:"Amazon Web Services S3 bucket"},{scheme:"gs",description:"Google Cloud Storage"},{scheme:"mqtt",description:"Message Queuing Telemetry Transport Protocol"},{scheme:"modbus+tcp",description:"Modbus over TCP"}]}),sa=B((t,e)=>{var r=Xc(),n={permanent:Yc(),provosional:Zc(),historical:el()},s={};Object.keys(n).forEach(function(l){n[l].forEach(function(a){s[a.scheme]=r(a,{type:l})})}),n.unofficial=tl().filter(function(l){return!s[l.scheme]}),n.unofficial.forEach(function(l){s[l.scheme]=r(l,{type:"unofficial"})}),e.exports=r(n,{allByName:s})}),rl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return!!(u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&s.allByName[u.scheme])}}),nl=B((t,e)=>{e.exports=/^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?W)?(\d+(?:\.\d+)?D)?(T(?=\d)(\d+(?:\.\d+)?H)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?S)?)?$/}),sl=B((t,e)=>{var{parse:r}=Kn();e.exports=n=>{try{return r(n),!0}catch{return!1}}}),aa={};oo(aa,{default:()=>la});function ia(t){return this[t]}function al(t,e){this[t]=ll.bind(null,e)}var oa,ca,vr,Gn,Wn,il=(t,e,r)=>{var n=Gn(e);for(let s of n)!Wn.call(t,s)&&s!=="default"&&vr(t,s,{get:ia.bind(e,s),enumerable:!0})},ol,ys=(t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var s=ol??(ol=new WeakMap),l=s.get(t);if(l)return l}r=t!=null?oa(ca(t)):{};let a=e||!t||!t.__esModule?vr(r,"default",{value:t,enumerable:!0}):r;for(let u of Gn(t))Wn.call(a,u)||vr(a,u,{get:ia.bind(t,u),enumerable:!0});return n&&s.set(t,a),a},cl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ll=t=>t,ul=(t,e)=>{for(var r in e)vr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:al.bind(e,r)})},mn,gn,vn,la,fl=co(()=>{oa=Object.create,{getPrototypeOf:ca,defineProperty:vr,getOwnPropertyNames:Gn}=Object,Wn=Object.prototype.hasOwnProperty,mn=cl((t,e)=>{var r=/^xn--/,n=/[^\0-\x7F]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,u=String.fromCharCode;function i($){throw RangeError(l[$])}function h($,y){let f=[],S=$.length;for(;S--;)f[S]=y($[S]);return f}function c($,y){let f=$.split("@"),S="";f.length>1&&(S=f[0]+"@",$=f[1]),$=$.replace(s,".");let O=$.split("."),j=h(O,y).join(".");return S+j}function d($){let y=[],f=0,S=$.length;for(;f<S;){let O=$.charCodeAt(f++);if(O>=55296&&O<=56319&&f<S){let j=$.charCodeAt(f++);(j&64512)==56320?y.push(((O&1023)<<10)+(j&1023)+65536):(y.push(O),f--)}else y.push(O)}return y}var w=$=>String.fromCodePoint(...$),P=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:36},b=function($,y){return $+22+75*($<26)-((y!=0)<<5)},E=function($,y,f){let S=0;for($=f?a($/700):$>>1,$+=a($/y);$>455;S+=36)$=a($/35);return a(S+36*$/($+38))},m=function($){let y=[],f=$.length,S=0,O=128,j=72,F=$.lastIndexOf("-");F<0&&(F=0);for(let V=0;V<F;++V)$.charCodeAt(V)>=128&&i("not-basic"),y.push($.charCodeAt(V));for(let V=F>0?F+1:0;V<f;){let X=S;for(let ee=1,fe=36;;fe+=36){V>=f&&i("invalid-input");let we=P($.charCodeAt(V++));we>=36&&i("invalid-input"),we>a((2147483647-S)/ee)&&i("overflow"),S+=we*ee;let Oe=fe<=j?1:fe>=j+26?26:fe-j;if(we<Oe)break;let se=36-Oe;ee>a(2147483647/se)&&i("overflow"),ee*=se}let G=y.length+1;j=E(S-X,G,X==0),a(S/G)>2147483647-O&&i("overflow"),O+=a(S/G),S%=G,y.splice(S++,0,O)}return String.fromCodePoint(...y)},o=function($){let y=[];$=d($);let f=$.length,S=128,O=0,j=72;for(let X of $)X<128&&y.push(u(X));let F=y.length,V=F;for(F&&y.push("-");V<f;){let X=2147483647;for(let ee of $)ee>=S&&ee<X&&(X=ee);let G=V+1;X-S>a((2147483647-O)/G)&&i("overflow"),O+=(X-S)*G,S=X;for(let ee of $)if(ee<S&&++O>2147483647&&i("overflow"),ee===S){let fe=O;for(let we=36;;we+=36){let Oe=we<=j?1:we>=j+26?26:we-j;if(fe<Oe)break;let se=fe-Oe,x=36-Oe;y.push(u(b(Oe+se%x,0))),fe=a(se/x)}y.push(u(b(fe,0))),j=E(O,G,V===F),O=0,++V}++O,++S}return y.join("")},_=function($){return c($,function(y){return r.test(y)?m(y.slice(4).toLowerCase()):y})},p=function($){return c($,function(y){return n.test(y)?"xn--"+o(y):y})},v={version:"2.3.1",ucs2:{decode:d,encode:w},decode:m,encode:o,toASCII:p,toUnicode:_};e.exports=v}),gn={},ul(gn,{default:()=>vn.default}),il(gn,ys(mn(),1)),vn=ys(mn(),1),la=vn.default}),dl=B((t,e)=>{var{toASCII:r}=(fl(),so(aa)),n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;e.exports=s=>{const l=r(s);return l.replace(/\.$/,"").length<=253&&n.test(l)}}),hl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&u.path!==void 0&&s.allByName[u.scheme]?!0:u.scheme&&!s.allByName[u.scheme]?!1:u.path!==void 0&&(u.reference==="relative"||u.reference==="same-document"||u.reference==="uri")}}),pl=B((t,e)=>{t.iri=rl(),t.duration=nl(),t["idn-email"]=sl(),t["idn-hostname"]=dl(),t["iri-reference"]=hl()}),ml=B((t,e)=>{var r=pl();e.exports=(n,s={})=>{const l=Object.keys(r);let a=l;if(s.formats){if(!Array.isArray(s.formats))throw new Error("options.formats must be an array");a=s.formats}return l.filter(u=>a.includes(u)).forEach(u=>{n.addFormat(u,r[u])}),n}}),gl=B((t,e)=>{var r=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function l(h,c,d){this.fn=h,this.context=c,this.once=d||!1}function a(h,c,d,w,P){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new l(d,w||h,P),E=n?n+c:c;return h._events[E]?h._events[E].fn?h._events[E]=[h._events[E],b]:h._events[E].push(b):(h._events[E]=b,h._eventsCount++),h}function u(h,c){--h._eventsCount===0?h._events=new s:delete h._events[c]}function i(){this._events=new s,this._eventsCount=0}i.prototype.eventNames=function(){var c=[],d,w;if(this._eventsCount===0)return c;for(w in d=this._events)r.call(d,w)&&c.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},i.prototype.listeners=function(c){var d=n?n+c:c,w=this._events[d];if(!w)return[];if(w.fn)return[w.fn];for(var P=0,b=w.length,E=new Array(b);P<b;P++)E[P]=w[P].fn;return E},i.prototype.listenerCount=function(c){var d=n?n+c:c,w=this._events[d];return w?w.fn?1:w.length:0},i.prototype.emit=function(c,d,w,P,b,E){var m=n?n+c:c;if(!this._events[m])return!1;var o=this._events[m],_=arguments.length,p,v;if(o.fn){switch(o.once&&this.removeListener(c,o.fn,void 0,!0),_){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,d),!0;case 3:return o.fn.call(o.context,d,w),!0;case 4:return o.fn.call(o.context,d,w,P),!0;case 5:return o.fn.call(o.context,d,w,P,b),!0;case 6:return o.fn.call(o.context,d,w,P,b,E),!0}for(v=1,p=new Array(_-1);v<_;v++)p[v-1]=arguments[v];o.fn.apply(o.context,p)}else{var $=o.length,y;for(v=0;v<$;v++)switch(o[v].once&&this.removeListener(c,o[v].fn,void 0,!0),_){case 1:o[v].fn.call(o[v].context);break;case 2:o[v].fn.call(o[v].context,d);break;case 3:o[v].fn.call(o[v].context,d,w);break;case 4:o[v].fn.call(o[v].context,d,w,P);break;default:if(!p)for(y=1,p=new Array(_-1);y<_;y++)p[y-1]=arguments[y];o[v].fn.apply(o[v].context,p)}}return!0},i.prototype.on=function(c,d,w){return a(this,c,d,w,!1)},i.prototype.once=function(c,d,w){return a(this,c,d,w,!0)},i.prototype.removeListener=function(c,d,w,P){var b=n?n+c:c;if(!this._events[b])return this;if(!d)return u(this,b),this;var E=this._events[b];if(E.fn)E.fn===d&&(!P||E.once)&&(!w||E.context===w)&&u(this,b);else{for(var m=0,o=[],_=E.length;m<_;m++)(E[m].fn!==d||P&&!E[m].once||w&&E[m].context!==w)&&o.push(E[m]);o.length?this._events[b]=o.length===1?o[0]:o:u(this,b)}return this},i.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&u(this,d)):(this._events=new s,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,typeof e<"u"&&(e.exports=i)}),vl="https://www.w3.org/ns/activitystreams",yl="https://sockethub.org/ns/context/v1.jsonld",_l="error",wl="https://sockethub.org/ns/context/platform/error/v1.jsonld",$l="sockethub:internal",bl="https://sockethub.org/ns/context/platform/sockethub:internal/v1.jsonld",Jn=new Map,ua=new Map,fa=new Map;function El(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Sl(t){return El(t["@context"])}function da(t,e,r,n){Jn.set(e,t),ua.set(e,r),fa.set(e,n)}function Qn(t){const r=Sl(t).filter(n=>Jn.has(n));return r.length!==1?null:r[0]}function Pl(t){return Jn.get(t)}function kl(t){return ua.get(t)}function Ol(t){return fa.get(t)}var ha={feed:{required:["id","type"],additionalProperties:!0,properties:{type:{enum:["feed"]},id:{type:"string",format:"iri"},name:{type:"string"},description:{type:"string"},author:{type:"string"},favicon:{type:"string"}}},person:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["person"]},name:{type:"string"}}},room:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["room"]},name:{type:"string"}}},service:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["service"]},name:{type:"string"}}},platform:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["platform"]},name:{type:"string"}}},website:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string",format:"iri"},type:{enum:["website"]},name:{type:"string"}}},address:{required:["type"],additionalProperties:!1,properties:{type:{enum:["address"]}}}},Nl=Object.keys(ha),pa=["person","room","service","feed","website","platform"],ma=["person","room","service","feed","website","platform","address"],Tl=pa.map(t=>({$ref:`#/definitions/type/${t}`})),Rl=ma.map(t=>({$ref:`#/definitions/type/${t}`})),Il={type:"array",minItems:3,maxItems:3,items:{type:"string"},allOf:[{contains:{const:vl}},{contains:{const:yl}}]},Cl={type:"string"},Al={$id:"https://sockethub.org/schemas/v/activity-stream.json",description:"Schema for Sockethub Activity Streams",type:"object",required:["@context","type","actor"],additionalProperties:!1,properties:{"@context":Il,id:{type:"string"},type:Cl,actor:{type:"object",oneOf:Tl},target:{type:"object",oneOf:Rl},object:{type:"object"},published:{type:"string",format:"date-time"}},definitions:{type:ha}},jl={version:"3.0.0-alpha.16"};function Ml(t,e){return t.replace("/v/",`/${e}/`)}var Dl={$id:"https://sockethub.org/schemas/v/sockethub-config.json"};Ml(Dl.$id,jl.version);var ql=Hr(tc()),Ll=Hr(Wc()),Vl=Hr(ml());function Ul(t){let e=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return t.keyword==="additionalProperties"?e+=`: ${t.params.additionalProperty}`:t.keyword==="enum"&&(e+=`: ${t.params.allowedValues.join(", ")}`),e}function dr(t){const e=[];t!=null&&t.type&&e.push(t.type);const r=t;for(const n in r){const s=r[n];s&&typeof s=="object"&&"type"in s&&e.push(...dr(s))}return e}function Fl(t){const e=t.schemaPath.match(/#\/\w+\/\w+\/([\w-]+)\//);return e?e[1]:void 0}function zl(t){const e=t.instancePath.match(/\/(\w+)/);return e?e[1]:void 0}function xl(t,e){const r=Fl(t),n=zl(t);if(!n)return-1;const s=e[n];return!s||!r||!s.includes(r)?-1:t.instancePath.split("/").length}function Bl(t){if(!Array.isArray(t["@context"]))return{actor:[],target:[],object:dr(t)};const e=t;return{actor:dr(e.actor),target:dr(e.target),object:e.object?dr(e.object):[]}}function Hl(t,e,r){const n=Bl(t);let s=0,l=-1;for(let a=0;a<e.length;a++){const u=xl(e[a],n);u>l&&(l=u,s=a)}return l>=0?Ul(e[s]):Gl(e[e.length-1],r)}function Kl(t,e){if(!(e!=null&&e.excludeTypes)||e.excludeTypes.length===0)return t;const r=new Set(e.excludeTypes);return t.filter(n=>!r.has(n))}function Gl(t,e){let r;if(t.keyword==="oneOf"){const n=t.instancePath.split("/")[1],s=n==="actor"?pa:n==="target"?ma:Nl,l=Kl(s,e),a=l.length>0?l:s;r=`${t.instancePath}: ${t.message}: ${a.join(", ")}`}else r=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return"additionalProperty"in t.params&&(r+=`: ${t.params.additionalProperty}`),r}var Mt=new ql.default({strictTypes:!1,allErrors:!0});Ll.default(Mt);Vl.default(Mt);var Dt="https://sockethub.org/schemas/v0",On={},Wl={},_s=!1;On[`${Dt}/activity-stream`]=Al;for(const t in On)Mt.addSchema(On[t],t);function ws(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`);const r=`${Dt}/context/${t}/messages`;Mt.getSchema(r)||Mt.addSchema({},r);const n=`${Dt}/context/${t}/credentials`;Mt.getSchema(n)||Mt.addSchema({},n)}function Jl(){_s||(ws(_l,wl),ws($l,bl),_s=!0)}Jl();function Br(t,e){const r=Mt.getSchema(t);if(!r)return`schema ${t} not found`;if(!r(e)){let s=Hl(e,r.errors,Wl);if(Array.isArray(e["@context"])){const l=Qn(e);if(l){const a=Pl(l);a&&(s=`[${a}] ${s}`)}}return s}return""}function Ql(t){const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"activity streams must have exactly one registered platform context URL in @context";const n=kl(r);return n?Br(n,t):`platform context URL ${r} does not have a registered message schema`}function Xl(t){if(!Array.isArray(t["@context"]))return"credential activity streams must have an @context set";if(t.type!=="credentials")return"credential activity streams must have credentials set as type";const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"credential activity streams must have exactly one registered platform context URL in @context";const n=Ol(r);return n?Br(n,t):`platform context URL ${r} does not have a registered credentials schema`}function $s(t,e){const r=`${Dt}/context/${e}`;Mt.getSchema(r)||Mt.addSchema(t,r)}function Yl(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`)}var bs={actor:"id",target:"id",object:"content"};function Zl(t,e){return typeof t=="string"?{[e]:t}:Array.isArray(t)?t.map(r=>typeof r=="string"?{id:r}:r):t}function yn(t){const e={...t};for(const r of Object.keys(bs))r in e&&(e[r]=Zl(e[r],bs[r]));return e}var eu=Hr(gl()),tu=eu.default;class en{constructor(e,r={}){nt(this,"events",{credentials:new Map,connect:new Map,join:new Map});nt(this,"_socket");nt(this,"socket");nt(this,"debug",!0);nt(this,"options");nt(this,"platformRegistry",new Map);nt(this,"asContextUrl");nt(this,"sockethubContextUrl");nt(this,"sockethubVersion");nt(this,"initState","idle");nt(this,"hasReadyOnce",!1);nt(this,"initCycle");nt(this,"initTokenCounter",0);nt(this,"initTimeoutTimer");nt(this,"waitingWarningTimer");nt(this,"waitingWarningIntervalMs",1e4);nt(this,"readyWaiters",[]);nt(this,"outboundQueue",[]);nt(this,"outboundSequence",0);nt(this,"registryFingerprint");nt(this,"latestReadyInfo");if(!e)throw new Error("SockethubClient requires a socket.io instance");this._socket=e,this.options={initTimeoutMs:r.initTimeoutMs??5e3,maxQueuedOutbound:r.maxQueuedOutbound??1e3,maxQueuedAgeMs:r.maxQueuedAgeMs??3e4},this.socket=this.createPublicEmitter(),this.registerSocketIOHandlers(),this._socket.connected&&(this.socket.connected=!0,this.socket.id=this._socket.id,this.socket._emit("connect"),this.startInitialization("initial-connect",!0))}clearCredentials(){this.events.credentials.clear()}getRegisteredPlatforms(){return Array.from(this.platformRegistry.values()).map(e=>({...e,types:[...e.types],schemas:{...e.schemas}}))}isSchemasReady(){return this.isReady()}isReady(){return this.initState==="ready"}getInitState(){return this.initState}getRegisteredBaseContexts(){if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");return{as:this.asContextUrl,sockethub:this.sockethubContextUrl}}getPlatformSchema(e,r="messages"){var s,l;const n=e==null?void 0:e.trim();if(n)return(l=(s=this.platformRegistry.get(n))==null?void 0:s.schemas)==null?void 0:l[r]}async waitForSchemas(e=2e3){return await this.ready(e),this.buildPlatformRegistryPayload()}ready(e=this.options.initTimeoutMs){return this.isReady()&&this.latestReadyInfo?Promise.resolve(this.latestReadyInfo):new Promise((r,n)=>{const s={resolve:r,reject:n};e>0&&(s.timer=setTimeout(()=>{this.readyWaiters=this.readyWaiters.filter(l=>l!==s),n(new Error(`SockethubClient ready() timed out after ${e}ms`))},e)),this.readyWaiters.push(s),this.socket.connected&&this.initState==="idle"&&this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)})}validateActivity(e){return e.type==="credentials"?Xl(e):Ql(e)}contextFor(e){if(typeof e!="string"||e.trim().length===0)throw new Error("SockethubClient.contextFor(platform) requires a non-empty platform string");if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");const r=e.trim(),n=this.platformRegistry.get(r);if(!n){const s=Array.from(this.platformRegistry.keys()).sort();throw new Error(`unknown platform '${r}'. Registered platforms: ${s.join(", ")}`)}return[this.asContextUrl,this.sockethubContextUrl,n.contextUrl]}createPublicEmitter(){const e=new tu;return e._emit=e.emit,e.emit=(r,n,s)=>{this.handlePublicEmit(r,n,s)},e.connected=!1,e.disconnect=()=>{this._socket.disconnect()},e.connect=()=>{this._socket.connect()},e}requestSchemaRegistry(){"io"in this._socket&&this._socket.emit("schemas",this.registryFingerprint,r=>{this.handleSchemasPayload(r)})}applyPlatformRegistry(e){var a,u,i,h;if(!e||typeof e!="object")return;const r=e,n=(a=r.contexts)==null?void 0:a.as,s=(u=r.contexts)==null?void 0:u.sockethub;if(typeof n!="string"||typeof s!="string"||!Array.isArray(r.platforms))return;this.sockethubVersion=typeof r.version=="string"?r.version:"unknown",this.asContextUrl=n,this.sockethubContextUrl=s,this.platformRegistry.clear();for(const c of r.platforms)if(!(!c||typeof c!="object"||typeof c.id!="string"||typeof c.version!="string"||typeof c.contextUrl!="string")){this.platformRegistry.set(c.id,{...c,version:c.version,types:Array.isArray(c.types)?c.types:[],schemas:c.schemas||{}}),Yl(c.id,c.contextUrl);try{const d=(i=c.schemas)==null?void 0:i.credentials;d&&typeof d=="object"&&!Array.isArray(d)&&$s(d,`${c.id}/credentials`);const w=(h=c.schemas)==null?void 0:h.messages;w&&typeof w=="object"&&!Array.isArray(w)&&$s(w,`${c.id}/messages`)}catch(d){const w=d instanceof Error?d.message:String(d);console.warn(`[SockethubClient] Failed to register schemas for platform ${c.id}: ${w}`)}}const l=this.buildPlatformRegistryPayload();return this.registryFingerprint=typeof r.fingerprint=="string"?r.fingerprint:void 0,this.socket._emit("schemas",l),l}eventCredentials(e){if(e.object&&e.object.type==="credentials"){const r=e.actor.id||e.actor;this.events.credentials.set(r,e)}}eventMessage(e){if(!this._socket.connected)return;const r=en.getKey(e);e.type==="join"||e.type==="connect"?this.events[e.type].set(r,e):e.type==="leave"?this.events.join.delete(r):e.type==="disconnect"&&this.events.connect.delete(r)}static getKey(e){var s;const r=((s=e.actor)==null?void 0:s.id)||e.actor;if(!r)throw new Error(`actor property not present for message type: ${e==null?void 0:e.type}`);const n=e.target?e.target.id||e.target:"";return`${r}-${n}`}buildPlatformRegistryPayload(){return{version:this.sockethubVersion,contexts:this.asContextUrl&&this.sockethubContextUrl?{as:this.asContextUrl,sockethub:this.sockethubContextUrl}:void 0,platforms:this.getRegisteredPlatforms()}}buildReadyInfo(e){if(!(!this.sockethubVersion||!this.asContextUrl||!this.sockethubContextUrl))return{state:"ready",reason:e,sockethubVersion:this.sockethubVersion,contexts:{as:this.asContextUrl,sockethub:this.sockethubContextUrl},platforms:this.getRegisteredPlatforms().map(r=>({id:r.id,version:r.version,contextUrl:r.contextUrl,contextVersion:r.contextVersion,schemaVersion:r.schemaVersion,types:[...r.types]}))}}resolveReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.resolve(e)}rejectReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.reject(e)}emitInitError(e,r,n){this.socket._emit("init_error",{error:e,phase:r,retrying:n})}emitClientError(e,r,n){if(typeof r=="function"){r({error:n});return}this.socket._emit("client_error",{event:e,error:n})}clearInitTimers(){this.initTimeoutTimer&&(clearTimeout(this.initTimeoutTimer),this.initTimeoutTimer=void 0),this.waitingWarningTimer&&(clearInterval(this.waitingWarningTimer),this.waitingWarningTimer=void 0)}startWaitingWarnings(){this.waitingWarningTimer||(this.waitingWarningTimer=setInterval(()=>{if(this.isReady()||this.initState==="closed"){this.clearInitTimers();return}const e=this.outboundQueue.length,r=this.outboundQueue[0],n=r?((Date.now()-r.enqueuedAt)/1e3).toFixed(1):"0.0";console.warn(`[SockethubClient] Still waiting for schemas; queued outbound messages: ${e}; oldest queued age: ${n}s.`)},this.waitingWarningIntervalMs))}startInitialization(e,r){if(!this.socket.connected||this.initState==="closed")return;const n=++this.initTokenCounter;this.initCycle={token:n,reason:e,startedAt:Date.now(),replayOnReady:r,timedOut:!1},this.initState="initializing",this.clearInitTimers(),this.initTimeoutTimer=setTimeout(()=>{if(!this.initCycle||this.initCycle.token!==n)return;this.initCycle.timedOut=!0,this.initState="init_error";const s=`Initialization timed out after ${this.options.initTimeoutMs}ms waiting for schemas`;console.warn(`[SockethubClient] ${s}; queued outbound messages: ${this.outboundQueue.length}. Waiting for schemas event from server.`),this.emitInitError(s,"timeout",!1),this.startWaitingWarnings()},this.options.initTimeoutMs);try{this.requestSchemaRegistry()}catch(s){this.initState="init_error";const l=s instanceof Error?s.message:String(s);this.emitInitError(l,"schemas-request",!1),this.startWaitingWarnings()}}markReady(e){const r=this.initCycle,n=!!(r!=null&&r.replayOnReady);this.initCycle=void 0,this.clearInitTimers(),this.initState="ready",this.hasReadyOnce=!0;const s=this.buildReadyInfo(e);if(!s){const l=new Error("Failed to build ready payload");this.initState="init_error",this.emitInitError(l.message,"schemas-apply",!0),this.rejectReadyWaiters(l);return}this.socket._emit("ready",s),this.latestReadyInfo=s,this.resolveReadyWaiters(s),n&&(this.replay("credentials",this.events.credentials),this.replay("message",this.events.connect),this.replay("message",this.events.join)),this.flushOutboundQueue()}handleSchemasPayload(e){if(!e||typeof e!="object")return;if(e.unchanged===!0&&typeof this.registryFingerprint=="string"&&this.platformRegistry.size>0){this.initCycle?this.markReady(this.initCycle.reason):this.initState!=="ready"&&this.markReady("schemas-update");return}const r=e.fingerprint;if(this.initState==="ready"&&!this.initCycle&&r&&r===this.registryFingerprint)return;if(this.initState==="ready"&&!this.initCycle&&(this.initState="initializing"),!this.applyPlatformRegistry(e)){this.initState="init_error",this.emitInitError("Received invalid schemas payload from server","schemas-apply",!0),this.startWaitingWarnings();return}if(this.initCycle){this.markReady(this.initCycle.reason);return}this.markReady("schemas-update")}handlePublicEmit(e,r,n){const s={event:e,content:r,callback:n,enqueuedAt:Date.now(),sequence:this.outboundSequence++};if(!this.isReady()){this.enqueueOutbound(s);return}this.sendOutbound(s)}enqueueOutbound(e){if(this.outboundQueue.push(e),this.outboundQueue.length<=this.options.maxQueuedOutbound)return;const r=this.outboundQueue.shift();r&&this.emitClientError(r.event,r.callback,"SockethubClient queue overflow before ready")}flushOutboundQueue(){if(!this.isReady()||this.outboundQueue.length===0)return;const e=Date.now(),r=this.outboundQueue.sort((n,s)=>n.sequence-s.sequence);this.outboundQueue=[];for(const n of r){if(e-n.enqueuedAt>this.options.maxQueuedAgeMs){this.emitClientError(n.event,n.callback,`SockethubClient queued message expired after ${this.options.maxQueuedAgeMs}ms before initialization`);continue}this.sendOutbound(n)}}sendOutbound(e){let r=e.content;try{if(e.event==="credentials"||e.event==="message"){if(r=yn(e.content),r&&typeof r=="object"){const n=r;e.event==="credentials"&&!n.type&&(n.type="credentials"),n.actor&&typeof n.actor=="object"&&!n.actor.type&&(n.actor.type="person")}if(this.platformRegistry.size>0){const n=this.validateActivity(r);if(n){this.emitClientError(e.event,e.callback,`SockethubClient validation failed: ${n}`);return}}}e.event==="credentials"?this.eventCredentials(r):e.event==="message"&&this.eventMessage(r),this._socket.emit(e.event,r,e.callback)}catch(n){const s=n instanceof Error?n.message:String(n);this.emitClientError(e.event,e.callback,s)}}log(e,r){this.debug&&console.log(e,r)}registerSocketIOHandlers(){this._socket.on("connect",()=>{this.socket.id=this._socket.id,this.socket.connected=!0,this.socket._emit("connect"),this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)}),this._socket.on("connect_error",e=>{this.socket._emit("connect_error",e)}),this._socket.on("disconnect",e=>{this.socket.connected=!1,this.initState!=="closed"&&(this.initState="idle"),this.clearInitTimers(),this.socket._emit("disconnect",e)}),this._socket.on("schemas",e=>{this.handleSchemasPayload(e)}),this._socket.on("message",e=>{this.socket._emit("message",yn(e))})}hasActorId(e){return"actor"in e&&e.actor!==null&&typeof e.actor=="object"&&"id"in e.actor&&typeof e.actor.id=="string"}replay(e,r){for(const n of r.values()){const s=yn(n);let l=s==null?void 0:s.id;if(this.hasActorId(s)){const a=s.actor;l=typeof a=="string"?a:a.id}this.log(`replaying ${e} for ${l}`),this._socket.emit(e,s)}}}(t=>{t.SockethubClient=en})(typeof globalThis=="object"?globalThis:{});const Lt=Object.create(null);Lt.open="0";Lt.close="1";Lt.ping="2";Lt.pong="3";Lt.message="4";Lt.upgrade="5";Lt.noop="6";const Ir=Object.create(null);Object.keys(Lt).forEach(t=>{Ir[Lt[t]]=t});const Nn={type:"error",data:"parser error"},ga=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",va=typeof ArrayBuffer=="function",ya=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Xn=({type:t,data:e},r,n)=>ga&&e instanceof Blob?r?n(e):Es(e,n):va&&(e instanceof ArrayBuffer||ya(e))?r?n(e):Es(new Blob([e]),n):n(Lt[t]+(e||"")),Es=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function Ss(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let _n;function ru(t,e){if(ga&&t.data instanceof Blob)return t.data.arrayBuffer().then(Ss).then(e);if(va&&(t.data instanceof ArrayBuffer||ya(t.data)))return e(Ss(t.data));Xn(t,!1,r=>{_n||(_n=new TextEncoder),e(_n.encode(r))})}const Ps="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Ps.length;t++)hr[Ps.charCodeAt(t)]=t;const nu=t=>{let e=t.length*.75,r=t.length,n,s=0,l,a,u,i;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const h=new ArrayBuffer(e),c=new Uint8Array(h);for(n=0;n<r;n+=4)l=hr[t.charCodeAt(n)],a=hr[t.charCodeAt(n+1)],u=hr[t.charCodeAt(n+2)],i=hr[t.charCodeAt(n+3)],c[s++]=l<<2|a>>4,c[s++]=(a&15)<<4|u>>2,c[s++]=(u&3)<<6|i&63;return h},su=typeof ArrayBuffer=="function",Yn=(t,e)=>{if(typeof t!="string")return{type:"message",data:_a(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:au(t.substring(1),e)}:Ir[r]?t.length>1?{type:Ir[r],data:t.substring(1)}:{type:Ir[r]}:Nn},au=(t,e)=>{if(su){const r=nu(t);return _a(r,e)}else return{base64:!0,data:t}},_a=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},wa="",iu=(t,e)=>{const r=t.length,n=new Array(r);let s=0;t.forEach((l,a)=>{Xn(l,!1,u=>{n[a]=u,++s===r&&e(n.join(wa))})})},ou=(t,e)=>{const r=t.split(wa),n=[];for(let s=0;s<r.length;s++){const l=Yn(r[s],e);if(n.push(l),l.type==="error")break}return n};function cu(){return new TransformStream({transform(t,e){ru(t,r=>{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const l=new DataView(s.buffer);l.setUint8(0,126),l.setUint16(1,n)}else{s=new Uint8Array(9);const l=new DataView(s.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(r)})}})}let wn;function Nr(t){return t.reduce((e,r)=>e+r.length,0)}function Tr(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let s=0;s<e;s++)r[s]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function lu(t,e){wn||(wn=new TextDecoder);const r=[];let n=0,s=-1,l=!1;return new TransformStream({transform(a,u){for(r.push(a);;){if(n===0){if(Nr(r)<1)break;const i=Tr(r,1);l=(i[0]&128)===128,s=i[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Nr(r)<2)break;const i=Tr(r,2);s=new DataView(i.buffer,i.byteOffset,i.length).getUint16(0),n=3}else if(n===2){if(Nr(r)<8)break;const i=Tr(r,8),h=new DataView(i.buffer,i.byteOffset,i.length),c=h.getUint32(0);if(c>Math.pow(2,21)-1){u.enqueue(Nn);break}s=c*Math.pow(2,32)+h.getUint32(4),n=3}else{if(Nr(r)<s)break;const i=Tr(r,s);u.enqueue(Yn(l?i:wn.decode(i),e)),n=0}if(s===0||s>t){u.enqueue(Nn);break}}}})}const $a=4;function ot(t){if(t)return uu(t)}function uu(t){for(var e in ot.prototype)t[e]=ot.prototype[e];return t}ot.prototype.on=ot.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};ot.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};ot.prototype.off=ot.prototype.removeListener=ot.prototype.removeAllListeners=ot.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,s=0;s<r.length;s++)if(n=r[s],n===e||n.fn===e){r.splice(s,1);break}return r.length===0&&delete this._callbacks["$"+t],this};ot.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,e)}return this};ot.prototype.emitReserved=ot.prototype.emit;ot.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ot.prototype.hasListeners=function(t){return!!this.listeners(t).length};const tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Ot=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fu="arraybuffer";function ba(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const du=Ot.setTimeout,hu=Ot.clearTimeout;function rn(t,e){e.useNativeTimers?(t.setTimeoutFn=du.bind(Ot),t.clearTimeoutFn=hu.bind(Ot)):(t.setTimeoutFn=Ot.setTimeout.bind(Ot),t.clearTimeoutFn=Ot.clearTimeout.bind(Ot))}const pu=1.33;function mu(t){return typeof t=="string"?gu(t):Math.ceil((t.byteLength||t.size)*pu)}function gu(t){let e=0,r=0;for(let n=0,s=t.length;n<s;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function Ea(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function vu(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function yu(t){let e={},r=t.split("&");for(let n=0,s=r.length;n<s;n++){let l=r[n].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}class _u extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class Zn extends ot{constructor(e){super(),this.writable=!1,rn(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,n){return super.emitReserved("error",new _u(e,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const r=Yn(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const r=vu(e);return r.length?"?"+r:""}}class wu extends Zn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};ou(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,iu(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Ea()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}}let Sa=!1;try{Sa=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $u=Sa;function bu(){}class Eu extends wu{constructor(e){if(super(e),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(s,l)=>{this.onError("xhr post error",s,l)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class qt extends ot{constructor(e,r,n){super(),this.createRequest=e,rn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const r=ba(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=qt.requestsCount++,qt.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=bu,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete qt.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}qt.requestsCount=0;qt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ks);else if(typeof addEventListener=="function"){const t="onpagehide"in Ot?"pagehide":"unload";addEventListener(t,ks,!1)}}function ks(){for(let t in qt.requests)qt.requests.hasOwnProperty(t)&&qt.requests[t].abort()}const Su=function(){const t=Pa({xdomain:!1});return t&&t.responseType!==null}();class Pu extends Eu{constructor(e){super(e);const r=e&&e.forceBase64;this.supportsBinary=Su&&!r}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new qt(Pa,this.uri(),e)}}function Pa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||$u))return new XMLHttpRequest}catch{}if(!e)try{return new Ot[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ka=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ku extends Zn{get name(){return"websocket"}doOpen(){const e=this.uri(),r=this.opts.protocols,n=ka?{}:ba(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,n)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;Xn(n,this.supportsBinary,l=>{try{this.doWrite(n,l)}catch{}s&&tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Ea()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}}const $n=Ot.WebSocket||Ot.MozWebSocket;class Ou extends ku{createSocket(e,r,n){return ka?new $n(e,r,n):r?new $n(e,r):new $n(e)}doWrite(e,r){this.ws.send(r)}}class Nu extends Zn{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const r=lu(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),s=cu();s.readable.pipeTo(e.writable),this._writer=s.writable.getWriter();const l=()=>{n.read().then(({done:u,value:i})=>{u||(this.onPacket(i),l())}).catch(u=>{})};l();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;this._writer.write(n).then(()=>{s&&tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Tu={websocket:Ou,webtransport:Nu,polling:Pu},Ru=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Iu=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tn(t){if(t.length>8e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let s=Ru.exec(t||""),l={},a=14;for(;a--;)l[Iu[a]]=s[a]||"";return r!=-1&&n!=-1&&(l.source=e,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=Cu(l,l.path),l.queryKey=Au(l,l.query),l}function Cu(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Au(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,l){s&&(r[s]=l)}),r}const Rn=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cr=[];Rn&&addEventListener("offline",()=>{Cr.forEach(t=>t())},!1);class Jt extends ot{constructor(e,r){if(super(),this.binaryType=fu,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){const n=Tn(e);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Tn(r.host).host);rn(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const s=n.prototype.name;this.transports.push(s),this._transportsByName[s]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yu(this.opts.query)),Rn&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Cr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=$a,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Jt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(e);r.open(),this.setTransport(r)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Jt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=e.data,this._onError(r);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const s=this.writeBuffer[n].data;if(s&&(r+=mu(s)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,n){return this._sendPacket("message",e,r,n),this}send(e,r,n){return this._sendPacket("message",e,r,n),this}_sendPacket(e,r,n,s){if(typeof r=="function"&&(s=r,r=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const l={type:e,data:r,options:n};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Jt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Rn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Cr.indexOf(this._offlineEventListener);n!==-1&&Cr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=$a;class ju extends Jt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let r=this.createTransport(e),n=!1;Jt.priorWebsocketSuccess=!1;const s=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Jt.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(c(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function l(){n||(n=!0,c(),r.close(),r=null)}const a=d=>{const w=new Error("probe error: "+d);w.transport=r.name,l(),this.emitReserved("upgradeError",w)};function u(){a("transport closed")}function i(){a("socket closed")}function h(d){r&&d.name!==r.name&&l()}const c=()=>{r.removeListener("open",s),r.removeListener("error",a),r.removeListener("close",u),this.off("close",i),this.off("upgrading",h)};r.once("open",s),r.once("error",a),r.once("close",u),this.once("close",i),this.once("upgrading",h),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const r=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}}let Mu=class extends ju{constructor(e,r={}){const n=typeof e=="object"?e:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(s=>Tu[s]).filter(s=>!!s)),super(e,n)}};function Du(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=Tn(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const l=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+l+":"+n.port+e,n.href=n.protocol+"://"+l+(r&&r.port===n.port?"":":"+n.port),n}const qu=typeof ArrayBuffer=="function",Lu=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Oa=Object.prototype.toString,Vu=typeof Blob=="function"||typeof Blob<"u"&&Oa.call(Blob)==="[object BlobConstructor]",Uu=typeof File=="function"||typeof File<"u"&&Oa.call(File)==="[object FileConstructor]";function es(t){return qu&&(t instanceof ArrayBuffer||Lu(t))||Vu&&t instanceof Blob||Uu&&t instanceof File}function Ar(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(Ar(t[r]))return!0;return!1}if(es(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ar(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Ar(t[r]))return!0;return!1}function Fu(t){const e=[],r=t.data,n=t;return n.data=In(r,e),n.attachments=e.length,{packet:n,buffers:e}}function In(t,e){if(!t)return t;if(es(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=In(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=In(t[n],e));return r}return t}function zu(t,e){return t.data=Cn(t.data,e),delete t.attachments,t}function Cn(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Cn(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Cn(t[r],e));return t}const xu=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Bu=5;var De;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(De||(De={}));class Hu{constructor(e){this.replacer=e}encode(e){return(e.type===De.EVENT||e.type===De.ACK)&&Ar(e)?this.encodeAsBinary({type:e.type===De.EVENT?De.BINARY_EVENT:De.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===De.BINARY_EVENT||e.type===De.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=Fu(e),n=this.encodeAsString(r.packet),s=r.buffers;return s.unshift(n),s}}function Os(t){return Object.prototype.toString.call(t)==="[object Object]"}class ts extends ot{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===De.BINARY_EVENT;n||r.type===De.BINARY_ACK?(r.type=n?De.EVENT:De.ACK,this.reconstructor=new Ku(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(es(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(De[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===De.BINARY_EVENT||n.type===De.BINARY_ACK){const l=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const a=e.substring(l,r);if(a!=Number(a)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(r+1)==="/"){const l=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(l,r)}else n.nsp="/";const s=e.charAt(r+1);if(s!==""&&Number(s)==s){const l=r+1;for(;++r;){const a=e.charAt(r);if(a==null||Number(a)!=a){--r;break}if(r===e.length)break}n.id=Number(e.substring(l,r+1))}if(e.charAt(++r)){const l=this.tryParse(e.substr(r));if(ts.isPayloadValid(n.type,l))n.data=l;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case De.CONNECT:return Os(r);case De.DISCONNECT:return r===void 0;case De.CONNECT_ERROR:return typeof r=="string"||Os(r);case De.EVENT:case De.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&xu.indexOf(r[0])===-1);case De.ACK:case De.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ku{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=zu(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gu=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ts,Encoder:Hu,get PacketType(){return De},protocol:Bu},Symbol.toStringTag,{value:"Module"}));function Rt(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const Wu=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Na extends ot{constructor(e,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Rt(e,"open",this.onopen.bind(this)),Rt(e,"packet",this.onpacket.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...r){var n,s,l;if(Wu.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const a={type:De.EVENT,data:r};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const c=this.ids++,d=r.pop();this._registerAckCallback(c,d),a.id=c}const u=(s=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||s===void 0?void 0:s.writable,i=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!u||(i?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,r){var n;const s=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(s===void 0){this.acks[e]=r;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===e&&this.sendBuffer.splice(u,1);r.call(this,new Error("operation has timed out"))},s),a=(...u)=>{this.io.clearTimeoutFn(l),r.apply(this,u)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...r){return new Promise((n,s)=>{const l=(a,u)=>a?s(a):n(u);l.withError=!0,r.push(l),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...l)=>(this._queue[0],s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(s)):(this._queue.shift(),r&&r(null,...l)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:De.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case De.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case De.EVENT:case De.BINARY_EVENT:this.onevent(e);break;case De.ACK:case De.BINARY_ACK:this.onack(e);break;case De.DISCONNECT:this.ondisconnect();break;case De.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...s){n||(n=!0,r.packet({type:De.ACK,id:e,data:s}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:De.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function ar(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ar.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0};ar.prototype.reset=function(){this.attempts=0};ar.prototype.setMin=function(t){this.ms=t};ar.prototype.setMax=function(t){this.max=t};ar.prototype.setJitter=function(t){this.jitter=t};class An extends ot{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,rn(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new ar({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const s=r.parser||Gu;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Mu(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=Rt(r,"open",function(){n.onopen(),e&&e()}),l=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},a=Rt(r,"error",l);if(this._timeout!==!1){const u=this._timeout,i=this.setTimeoutFn(()=>{s(),l(new Error("timeout")),r.close()},u);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(s),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Rt(e,"ping",this.onping.bind(this)),Rt(e,"data",this.ondata.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(e,"close",this.onclose.bind(this)),Rt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){tn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Na(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ur={};function jr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=Du(t,e.path||"/socket.io"),n=r.source,s=r.id,l=r.path,a=ur[s]&&l in ur[s].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let i;return u?i=new An(n,e):(ur[s]||(ur[s]=new An(n,e)),i=ur[s]),r.query&&!e.query&&(e.query=r.queryKey),i.socket(r.path,e)}Object.assign(jr,{Manager:An,Socket:Na,io:jr,connect:jr});let Pt;const Ju=yr(!1),Qu={sockethub:{port:10550,host:"localhost",path:"/sockethub"},public:{protocol:"http",host:"localhost",port:10550,path:"/"}};async function Ta(){if(!Pt)throw new Error("Sockethub client is not initialized yet");await Pt.ready()}async function uf(t){return await Ta(),Pt.contextFor(t)}function ff(t){return{id:t.id,type:t.type,name:t.name??t.id}}async function df(t){return await Ta(),console.log("sending ->",t),new Promise((e,r)=>{Pt.socket.emit("message",hn("SEND",t),n=>{if(console.log("received <-",n),hn("RESP",n),n.totalItems&&n.items)for(const s of n.items.reverse())hn("RESP",s,!0);Vs(n,!0),n.error?r(n.error):e(n)})})}function bn(t){return e=>{const r=t==="connect";Ju.update(()=>r),console.log(`sockethub ${t} [connected: ${r}]`,e||"")}}function Xu(t){console.log("handle incoming: ",t),Vs(t,!1)}function Ns(t=Qu){Pt=new en(jr(`${t.public.protocol}://${t.public.host}:${t.public.port}`,{path:t.sockethub.path}),{initTimeoutMs:1e4}),Pt.socket.on("connect",bn("connect")),Pt.socket.on("error",bn("error")),Pt.socket.on("disconnect",bn("disconnect")),Pt.socket.on("message",Xu),Pt.socket.on("schemas",e=>{console.log("schemas received:",e),pn("schemas",e)}),Pt.socket.on("ready",e=>{console.log("client ready:",e),pn("ready",e)}),Pt.socket.on("init_error",e=>{console.error("client init error:",e),pn("init_error",e)})}typeof globalThis=="object"&&"window"in globalThis&&(console.log("connecting to sockethub"),fetch("/config.json").then(async t=>{const e=await t.json();Ns(e)}).catch(()=>{Ns()}));export{of as I,cf as L,ff as a,Ju as b,uf as c,Pt as d,Ta as e,Pn as f,Ls as g,bi as h,qs as i,df as s};
|