@sockethub/examples 1.0.0-beta.4 → 1.0.0-beta.5

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.
Files changed (41) hide show
  1. package/build/_app/immutable/chunks/B2rCrZ6z.js +1 -0
  2. package/build/_app/immutable/chunks/{BdwwrRGO.js → BEufgWz0.js} +1 -1
  3. package/build/_app/immutable/chunks/{D3v7fTNQ.js → CLpPY9Jp.js} +1 -1
  4. package/build/_app/immutable/chunks/{B7WR2Uhh.js → DIcvT44P.js} +1 -1
  5. package/build/_app/immutable/chunks/{Bmzo1m7q.js → DZrh4NVE.js} +1 -1
  6. package/build/_app/immutable/chunks/{C4jbwiH0.js → DehUvw1i.js} +1 -1
  7. package/build/_app/immutable/chunks/QJ0LqQm_.js +1 -0
  8. package/build/_app/immutable/chunks/{D_8c8ro5.js → tApYyOtF.js} +1 -1
  9. package/build/_app/immutable/chunks/{BjhDUKS_.js → wTGAw4y8.js} +1 -1
  10. package/build/_app/immutable/chunks/{BieeuIue.js → yo1B285t.js} +1 -1
  11. package/build/_app/immutable/entry/{app.teY-68-f.js → app.BbkIp1G2.js} +2 -2
  12. package/build/_app/immutable/entry/start.By6-5HBf.js +1 -0
  13. package/build/_app/immutable/nodes/{0.DHn3_tBh.js → 0.DSwZU-9P.js} +1 -1
  14. package/build/_app/immutable/nodes/{1.C8PVD340.js → 1.51JJ2FlP.js} +1 -1
  15. package/build/_app/immutable/nodes/{10.BPJtkMU_.js → 10.B0ma2jo4.js} +1 -1
  16. package/build/_app/immutable/nodes/{11.DmMezCYJ.js → 11.C6lMwURo.js} +1 -1
  17. package/build/_app/immutable/nodes/{12.CLSsYwij.js → 12.DCNEAQNf.js} +1 -1
  18. package/build/_app/immutable/nodes/{2.B7OOKRwS.js → 2.g-FF_oGR.js} +1 -1
  19. package/build/_app/immutable/nodes/{3.SEu-dMIb.js → 3.BihBGY9y.js} +1 -1
  20. package/build/_app/immutable/nodes/{4.CU8F2gEI.js → 4.CxXOlqnK.js} +1 -1
  21. package/build/_app/immutable/nodes/{5.DmpkK7o5.js → 5.LpN7rB59.js} +1 -1
  22. package/build/_app/immutable/nodes/{6.Dbyu5GyG.js → 6.8_oL0Jwe.js} +1 -1
  23. package/build/_app/immutable/nodes/{7.-GaWlArq.js → 7.BzZfgtu_.js} +1 -1
  24. package/build/_app/immutable/nodes/{8.BG5xsxA8.js → 8.D_3lUgJe.js} +1 -1
  25. package/build/_app/immutable/nodes/{9.D11oPwqP.js → 9.GB0FEHre.js} +1 -1
  26. package/build/_app/version.json +1 -1
  27. package/build/caldav.html +7 -7
  28. package/build/carddav.html +7 -7
  29. package/build/dummy.html +7 -7
  30. package/build/email.html +7 -7
  31. package/build/feeds.html +7 -7
  32. package/build/index.html +7 -7
  33. package/build/instagram.html +7 -7
  34. package/build/irc.html +7 -7
  35. package/build/messenger.html +7 -7
  36. package/build/metadata.html +7 -7
  37. package/build/xmpp.html +7 -7
  38. package/package.json +4 -4
  39. package/build/_app/immutable/chunks/BlQP-jTH.js +0 -1
  40. package/build/_app/immutable/chunks/Bo8WhXWO.js +0 -1
  41. package/build/_app/immutable/entry/start.BZW6BR88.js +0 -1
@@ -0,0 +1 @@
1
+ var Jt=t=>{throw TypeError(t)};var Ue=(t,e,n)=>e.has(t)||Jt("Cannot "+n);var w=(t,e,n)=>(Ue(t,e,"read from private field"),n?n.call(t):e.get(t)),L=(t,e,n)=>e.has(t)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{w as $t,o as Xt,s as T,g as I,e as O,D as ht,bj as Te}from"./k-cRz8DS.js";import{a as Ie,b as U}from"./QJ0LqQm_.js";class jt{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Nt{constructor(e,n){this.status=e,this.location=n}}class Dt extends Error{constructor(e,n,r){super(r),this.status=e,this.text=n}}new URL("sveltekit-internal://");function Oe(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function Pe(t){return t.split("%25").map(decodeURI).join("%25")}function Ce(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function xt({href:t}){return t.split("#")[0]}function $e(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function je(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}const Ne=window.fetch;window.fetch=(t,e)=>((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&Y.delete(Vt(t)),Ne(t,e));const Y=new Map;function De(t,e){const n=Vt(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&Y.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=je(a)),Promise.resolve(new Response(a,s))}return window.fetch(t,e)}function Ve(t,e,n){if(Y.size>0){const r=Vt(t,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(e,n)}function Vt(t,e){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(t instanceof Request?t.url:t)}]`;if(e!=null&&e.headers||e!=null&&e.body){const a=[];e.headers&&a.push([...new Headers(e.headers)].join(",")),e.body&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&a.push(e.body),r+=`[data-hash="${$e(...a)}"]`}return r}const qe=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Be(t){const e=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${Me(t).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return At(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return At(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const d=qe.exec(c),[,u,y,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!y,chained:y?l===1&&o[0]==="":!1}),y?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return At(c)}).join("")}).join("")}/?$`),params:e}}function Ke(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function Me(t){return t.slice(1).split("/").filter(Ke)}function Fe(t,e,n){const r={},a=t.slice(1),s=a.filter(i=>i!==void 0);let o=0;for(let i=0;i<e.length;i+=1){const c=e[i];let l=a[i-o];if(c.chained&&c.rest&&o&&(l=a.slice(i-o,i+1).filter(d=>d).join("/"),o=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=e[i+1],u=a[i+1];d&&!d.rest&&d.optional&&u&&c.chained&&(o=0),!d&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(c.optional&&c.chained){o++;continue}return}if(!o)return r}function At(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ge({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([i,[c,l,d]])=>{const{pattern:u,params:y}=Be(i),f={id:i,exec:h=>{const _=u.exec(h);if(_)return Fe(_,y,r)},errors:[1,...d||[]].map(h=>t[h]),layouts:[0,...l||[]].map(o),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(i){const c=i<0;return c&&(i=~i),[c,t[i]]}function o(i){return i===void 0?i:[a.has(i),t[i]]}}function ce(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function Qt(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}const We="1794187739611",le="sveltekit:snapshot",fe="sveltekit:scroll",ue="sveltekit:states",Ye="sveltekit:pageurl",F="sveltekit:history",H="sveltekit:navigation",D={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},qt=location.origin;function de(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function kt(){return{x:pageXOffset,y:pageYOffset}}function M(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const Zt={...D,"":D.hover};function he(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function pe(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=he(t)}}function Tt(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,s=!r||!!a||St(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===qt&&t.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function pt(t){let e=null,n=null,r=null,a=null,s=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=M(i,"preload-code")),a===null&&(a=M(i,"preload-data")),e===null&&(e=M(i,"keepfocus")),n===null&&(n=M(i,"noscroll")),s===null&&(s=M(i,"reload")),o===null&&(o=M(i,"replacestate")),i=he(i);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Zt[r??"off"],preload_data:Zt[a??"off"],keepfocus:c(e),noscroll:c(n),reload:c(s),replace_state:c(o)}}function te(t){const e=$t(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function s(o){let i;return e.subscribe(c=>{(i===void 0||n&&c!==i)&&o(i=c)})}return{notify:r,set:a,subscribe:s}}const ge={v:()=>{}};function ze(){const{set:t,subscribe:e}=$t(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ie}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==We;return o&&(t(!0),ge.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function St(t,e,n){return t.origin!==qt||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function En(t){}const me=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...me];const He=new Set([...me]);[...He];function Je(t){return t.filter(e=>e!=null)}function Bt(t){return t instanceof jt||t instanceof Dt?t.status:500}function Xe(t){return t instanceof Dt?t.text:"Internal Error"}let R,J,Lt;const Qe=Xt.toString().includes("$$")||/function \w+\(\) \{\}/.test(Xt.toString());var et,nt,at,rt,ot,st,it,ct,oe,lt,se,ft,ie;Qe?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},Lt={current:!1}):(R=new(oe=class{constructor(){L(this,et,T({}));L(this,nt,T(null));L(this,at,T(null));L(this,rt,T({}));L(this,ot,T({id:null}));L(this,st,T({}));L(this,it,T(-1));L(this,ct,T(new URL("https://example.com")))}get data(){return I(w(this,et))}set data(e){O(w(this,et),e)}get form(){return I(w(this,nt))}set form(e){O(w(this,nt),e)}get error(){return I(w(this,at))}set error(e){O(w(this,at),e)}get params(){return I(w(this,rt))}set params(e){O(w(this,rt),e)}get route(){return I(w(this,ot))}set route(e){O(w(this,ot),e)}get state(){return I(w(this,st))}set state(e){O(w(this,st),e)}get status(){return I(w(this,it))}set status(e){O(w(this,it),e)}get url(){return I(w(this,ct))}set url(e){O(w(this,ct),e)}},et=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,ct=new WeakMap,oe),J=new(se=class{constructor(){L(this,lt,T(null))}get current(){return I(w(this,lt))}set current(e){O(w(this,lt),e)}},lt=new WeakMap,se),Lt=new(ie=class{constructor(){L(this,ft,T(!1))}get current(){return I(w(this,ft))}set current(e){O(w(this,ft),e)}},ft=new WeakMap,ie),ge.v=()=>Lt.current=!0);function Ze(t){Object.assign(R,t)}const tn=new Set(["icon","shortcut icon","apple-touch-icon"]),q=ce(fe)??{},X=ce(le)??{},N={url:te({}),page:te({}),navigating:$t(null),updated:ze()};function Kt(t){q[t]=kt()}function en(t,e){let n=t+1;for(;q[n];)delete q[n],n+=1;for(n=e+1;X[n];)delete X[n],n+=1}function Q(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function _e(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(U||"/");t&&await t.update()}}function ee(){}let Mt,It,gt,C,Ot,b;const mt=[],_t=[];let v=null;function Pt(){var t;(t=v==null?void 0:v.fork)==null||t.then(e=>e==null?void 0:e.discard()),v=null}const dt=new Map,we=new Set,nn=new Set,z=new Set;let m={branch:[],error:null,url:null},ve=!1,wt=!1,ne=!0,Z=!1,W=!1,ye=!1,Ft=!1,be,S,A,V;const vt=new Set,ae=new Map;async function Ln(t,e,n){var s,o,i,c,l;(s=globalThis.__sveltekit_nbheu3)!=null&&s.data&&globalThis.__sveltekit_nbheu3.data,document.URL!==location.href&&(location.href=location.href),b=t,await((i=(o=t.hooks).init)==null?void 0:i.call(o)),Mt=Ge(t),C=document.documentElement,Ot=e,It=t.nodes[0],gt=t.nodes[1],It(),gt(),S=(c=history.state)==null?void 0:c[F],A=(l=history.state)==null?void 0:l[H],S||(S=A=Date.now(),history.replaceState({...history.state,[F]:S,[H]:A},""));const r=q[S];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await _n(Ot,n)):(await G({type:"enter",url:de(b.hash?yn(new URL(location.href)):location.href),replace_state:!0}),a()),mn()}function an(){mt.length=0,Ft=!1}function ke(t){_t.some(e=>e==null?void 0:e.snapshot)&&(X[t]=_t.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Se(t){var e;(e=X[t])==null||e.forEach((n,r)=>{var a,s;(s=(a=_t[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function re(){Kt(S),Qt(fe,q),ke(A),Qt(le,X)}async function rn(t,e,n,r){let a;e.invalidateAll&&Pt(),await G({type:"goto",url:de(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Ft=!0,a=[...ae.keys()]),e.invalidate&&e.invalidate.forEach(gn)}}),e.invalidateAll&&ht().then(ht).then(()=>{ae.forEach(({resource:s},o)=>{var i;a!=null&&a.includes(o)&&((i=s.refresh)==null||i.call(s))})})}async function on(t){if(t.id!==(v==null?void 0:v.id)){Pt();const e={};vt.add(e),v={id:t.id,token:e,promise:Re({...t,preload:e}).then(n=>(vt.delete(e),n.type==="loaded"&&n.state.error&&Pt(),n)),fork:null}}return v.promise}async function Ut(t){var n;const e=(n=await Et(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].map(r=>r==null?void 0:r[1]()))}async function Ee(t,e,n){var a;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),be=new b.root({target:e,props:{...t.props,stores:N,components:_t},hydrate:n,sync:!1}),await Promise.resolve(),Se(A),n){const s={from:null,to:{params:m.params,route:{id:((a=m.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(o=>o(s))}wt=!0}function yt({url:t,params:e,branch:n,status:r,error:a,route:s,form:o}){let i="never";if(U&&(t.pathname===U||t.pathname===U+"/"))i="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=Oe(t.pathname,i),t.search=t.search;const c={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:s},props:{constructors:Je(n).map(f=>f.node.component),page:Ht(R)}};o!==void 0&&(c.props.form=o);let l={},d=!R,u=0;for(let f=0;f<Math.max(n.length,m.branch.length);f+=1){const h=n[f],_=m.branch[f];(h==null?void 0:h.data)!==(_==null?void 0:_.data)&&(d=!0),h&&(l={...l,...h.data},d&&(c.props[`data_${u}`]=l),u+=1)}return(!m.url||t.href!==m.url.href||m.error!==a||o!==void 0&&o!==R.form||d)&&(c.props.page={error:a,params:e,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(t),form:o??null,data:d?l:R.data}),c}async function Gt({loader:t,parent:e,url:n,params:r,route:a,server_data_node:s}){var l,d;let o=null;const i={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await t();return{node:c,loader:t,server:s,universal:(l=c.universal)!=null&&l.load?{type:"data",data:o,uses:i}:null,data:o??(s==null?void 0:s.data)??null,slash:((d=c.universal)==null?void 0:d.trailingSlash)??(s==null?void 0:s.slash)}}function sn(t,e,n){let r=t instanceof Request?t.url:t;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=wt?Ve(r,a.href,e):De(r,e);return{resolved:a,promise:s}}function cn(t,e,n,r,a,s){if(Ft)return!0;if(!a)return!1;if(a.parent&&t||a.route&&e||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==m.params[o])return!0;for(const o of a.dependencies)if(mt.some(i=>i(new URL(o))))return!0;return!1}function Wt(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function ln(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),s=e.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function fn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:Ht(R),constructors:[]}}}async function Re({id:t,invalidating:e,url:n,params:r,route:a,preload:s}){if((v==null?void 0:v.id)===t)return vt.delete(v.token),v.promise;const{errors:o,layouts:i,leaf:c}=a,l=[...i,c];o.forEach(g=>g==null?void 0:g().catch(()=>{})),l.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const d=m.url?t!==bt(m.url):!1,u=m.route?a.id!==m.route.id:!1,y=ln(m.url,n);let f=!1;const h=l.map(async(g,p)=>{var $;if(!g)return;const k=m.branch[p];return g[1]===(k==null?void 0:k.loader)&&!cn(f,u,d,y,($=k.universal)==null?void 0:$.uses,r)?k:(f=!0,Gt({loader:g[1],url:n,params:r,route:a,parent:async()=>{var ut;const P={};for(let B=0;B<p;B+=1)Object.assign(P,(ut=await h[B])==null?void 0:ut.data);return P},server_data_node:Wt(g[0]?{type:"skip"}:null,g[0]?k==null?void 0:k.server:void 0)}))});for(const g of h)g.catch(()=>{});const _=[];for(let g=0;g<l.length;g+=1)if(l[g])try{_.push(await h[g])}catch(p){if(p instanceof Nt)return{type:"redirect",location:p.location};if(vt.has(s))return fn({error:await tt(p,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let k=Bt(p),x;if(p instanceof jt)x=p.body;else{if(await N.updated.check())return await _e(),await Q(n);x=await tt(p,{params:r,url:n,route:{id:a.id}})}const $=await un(g,_,o);return $?yt({url:n,params:r,branch:_.slice(0,$.idx).concat($.node),status:k,error:x,route:a}):await Ae(n,{id:a.id},x,k)}else _.push(void 0);return yt({url:n,params:r,branch:_,status:200,error:null,route:a,form:e?void 0:null})}async function un(t,e,n){for(;t--;)if(n[t]){let r=t;for(;!e[r];)r-=1;try{return{idx:r+1,node:{node:await n[t](),loader:n[t],data:{},server:null,universal:null}}}catch{continue}}}async function Yt({status:t,error:e,url:n,route:r}){const a={};let s=null;try{const o=await Gt({loader:It,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Wt(s)}),i={node:await gt(),loader:gt,universal:null,server:null,data:null};return yt({url:n,params:a,branch:[o,i],status:t,error:e,route:null})}catch(o){if(o instanceof Nt)return rn(new URL(o.location,location.href),{},0);throw o}}async function dn(t){const e=t.href;if(dt.has(e))return dt.get(e);let n;try{const r=(async()=>{let a=await b.hooks.reroute({url:new URL(t),fetch:async(s,o)=>sn(s,o,t).promise})??t;if(typeof a=="string"){const s=new URL(t);b.hash?s.hash=a:s.pathname=a,a=s}return a})();dt.set(e,r),n=await r}catch{dt.delete(e);return}return n}async function Et(t,e){if(t&&!St(t,U,b.hash)){const n=await dn(t);if(!n)return;const r=hn(n);for(const a of Mt){const s=a.exec(r);if(s)return{id:bt(t),invalidating:e,route:a,params:Ce(s),url:t}}}}function hn(t){return Pe(b.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(U.length))||"/"}function bt(t){return(b.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function xe({url:t,type:e,intent:n,delta:r,event:a}){let s=!1;const o=zt(m,n,t,e);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const i={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return Z||we.forEach(c=>c(i)),s?null:o}async function G({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:i=0,nav_token:c={},accept:l=ee,block:d=ee,event:u}){var B;const y=V;V=c;const f=await Et(e,!1),h=t==="enter"?zt(m,f,e,t):xe({url:e,type:t,delta:n==null?void 0:n.delta,intent:f,event:u});if(!h){d(),V===c&&(V=y);return}const _=S,g=A;l(),Z=!0,wt&&h.navigation.type!=="enter"&&N.navigating.set(J.current=h.navigation);let p=f&&await Re(f);if(!p){if(St(e,U,b.hash))return await Q(e,s);p=await Ae(e,{id:null},await tt(new Dt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,s)}if(e=(f==null?void 0:f.url)||e,V!==c)return h.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await G({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:i+1,nav_token:c}),h.fulfil(void 0);return}p=await Yt({status:500,error:await tt(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await N.updated.check()&&(await _e(),await Q(e,s));if(an(),Kt(_),ke(g),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const E=s?0:1,K={[F]:S+=E,[H]:A+=E,[ue]:o};(s?history.replaceState:history.pushState).call(history,K,"",e),s||en(S,A)}const k=f&&(v==null?void 0:v.id)===f.id?v.fork:null;v=null,p.props.page.state=o;let x;if(wt){const E=(await Promise.all(Array.from(nn,j=>j(h.navigation)))).filter(j=>typeof j=="function");if(E.length>0){let j=function(){E.forEach(Rt=>{z.delete(Rt)})};E.push(j),E.forEach(Rt=>{z.add(Rt)})}m=p.state,p.props.page&&(p.props.page.url=e);const K=k&&await k;K?x=K.commit():(be.$set(p.props),Ze(p.props.page),x=(B=Te)==null?void 0:B()),ye=!0}else await Ee(p,Ot,!1);const{activeElement:$}=document;await x,await ht(),await ht();let P=n?n.scroll:a?kt():null;if(ne){const E=e.hash&&document.getElementById(Le(e));if(P)scrollTo(P.x,P.y);else if(E){E.scrollIntoView();const{top:K,left:j}=E.getBoundingClientRect();P={x:pageXOffset+j,y:pageYOffset+K}}else scrollTo(0,0)}const ut=document.activeElement!==$&&document.activeElement!==document.body;!r&&!ut&&vn(e,P),ne=!0,p.props.page&&Object.assign(R,p.props.page),Z=!1,t==="popstate"&&Se(A),h.fulfil(void 0),z.forEach(E=>E(h.navigation)),N.navigating.set(J.current=null)}async function Ae(t,e,n,r,a){return t.origin===qt&&t.pathname===location.pathname&&!ve?await Yt({status:r,error:n,url:t,route:e}):await Q(t,a)}function pn(){let t,e,n;C.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(t),t=setTimeout(()=>{s(c,D.hover)},20)});function r(i){i.defaultPrevented||s(i.composedPath()[0],D.tap)}C.addEventListener("mousedown",r),C.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(Ut(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(i,c){const l=pe(i,C),d=l===e&&c>=n;if(!l||d)return;const{url:u,external:y,download:f}=Tt(l,U,b.hash);if(y||f)return;const h=pt(l),_=u&&bt(m.url)===bt(u);if(!(h.reload||_))if(c<=h.preload_data){e=l,n=D.tap;const g=await Et(u,!1);if(!g)return;on(g)}else c<=h.preload_code&&(e=l,n=c,Ut(u))}function o(){a.disconnect();for(const i of C.querySelectorAll("a")){const{url:c,external:l,download:d}=Tt(i,U,b.hash);if(l||d)continue;const u=pt(i);u.reload||(u.preload_code===D.viewport&&a.observe(i),u.preload_code===D.eager&&Ut(c))}}z.add(o),o()}function tt(t,e){if(t instanceof jt)return t.body;const n=Bt(t),r=Xe(t);return b.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function gn(t){if(typeof t=="function")mt.push(t);else{const{href:e}=new URL(t,location.href);mt.push(n=>n.href===e)}}function mn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(re(),!Z){const a=zt(m,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};we.forEach(o=>o(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&re()}),(e=navigator.connection)!=null&&e.saveData||pn(),C.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=pe(n.composedPath()[0],C);if(!r)return;const{url:a,external:s,target:o,download:i}=Tt(r,U,b.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const c=pt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;const[d,u]=(b.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===xt(location);if(s||c.reload&&(!y||!u)){xe({url:a,type:"link",event:n})?Z=!0:n.preventDefault();return}if(u!==void 0&&y){const[,f]=m.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=r.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(W=!0,Kt(S),t(a),!c.replace_state)return;W=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await G({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),C.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(St(i,U,!1))return;const c=n.target,l=pt(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);i.search=new URLSearchParams(d).toString(),G({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ct){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(V={},a===S)return;const s=q[a],o=n.state[ue]??{},i=new URL(n.state[Ye]??location.href),c=n.state[H],l=m.url?xt(location)===xt(m.url):!1;if(c===A&&(ye||l)){o!==R.state&&(R.state=o),t(i),q[S]=kt(),s&&scrollTo(s.x,s.y),S=a;return}const u=a-S;await G({type:"popstate",url:i,popped:{state:o,scroll:s,delta:u},accept:()=>{S=a,A=c},block:()=>{history.go(-u)},nav_token:V,event:n})}else if(!W){const a=new URL(location.href);t(a),b.hash&&location.reload()}}}),addEventListener("hashchange",()=>{W&&(W=!1,history.replaceState({...history.state,[F]:++S,[H]:A},"",location.href))});for(const n of document.querySelectorAll("link"))tn.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&N.navigating.set(J.current=null)});function t(n){m.url=R.url=n,N.page.set(Ht(R)),N.page.notify()}}async function _n(t,{status:e=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:i,form:c}){ve=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await Et(l,!1)||{}),d=Mt.find(({id:f})=>f===s.id);let u,y=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=wn(p.uses)),Gt({loader:b.nodes[_],url:l,params:a,route:s,parent:async()=>{const k={};for(let x=0;x<g;x+=1)Object.assign(k,(await f[x]).data);return k},server_data_node:Wt(p)})}),h=await Promise.all(f);if(d){const _=d.layouts;for(let g=0;g<_.length;g++)_[g]||h.splice(g,0,void 0)}u=yt({url:l,params:a,branch:h,status:e,error:n,form:c,route:d??null})}catch(f){if(f instanceof Nt){await Q(new URL(f.location,location.href));return}u=await Yt({status:Bt(f),error:await tt(f,{url:l,params:a,route:s}),url:l,route:s}),t.textContent="",y=!1}u.props.page&&(u.props.page.state={}),await Ee(u,t,y)}function wn(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}let Ct=!1;function vn(t,e=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=Le(t);if(r&&document.getElementById(r)){const{x:s,y:o}=e??kt();setTimeout(()=>{const i=history.state;Ct=!0,location.replace(`#${r}`),b.hash&&location.replace(t.hash),history.replaceState(i,"",t.hash),scrollTo(s,o),Ct=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o<a.rangeCount;o+=1)s.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===s.length){for(let o=0;o<a.rangeCount;o+=1){const i=s[o],c=a.getRangeAt(o);if(i.commonAncestorContainer!==c.commonAncestorContainer||i.startContainer!==c.startContainer||i.endContainer!==c.endContainer||i.startOffset!==c.startOffset||i.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function zt(t,e,n,r){var c,l;let a,s;const o=new Promise((d,u)=>{a=d,s=u});return o.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((l=e==null?void 0:e.route)==null?void 0:l.id)??null},url:n},willUnload:!e,type:r,complete:o},fulfil:a,reject:s}}function Ht(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function yn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Le(t){let e;if(b.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{Ln as a,En as l,R as p,N as s};
@@ -1 +1 @@
1
- import{P as k,w as b,E as m,x as c,y as v,z as E,S as O,A as w}from"./D_8c8ro5.js";import{W as N,X as B,W as D,C as j,X as F,B as M}from"./D_8c8ro5.js";class A extends k{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(e=>this.onData(e))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,e){this._fetch(t).then(s=>{if(!s.ok)return this.onError("fetch write error",s.status,s);e()}).catch(s=>{this.onError("fetch write error",s)})}_fetch(t){var e;const s=t!==void 0,n=new Headers(this.opts.extraHeaders);return s&&n.set("content-type","text/plain;charset=UTF-8"),(e=this.socket._cookieJar)===null||e===void 0||e.appendCookies(n),fetch(this.uri(),{method:s?"POST":"GET",body:s?t:null,headers:n,credentials:this.opts.withCredentials?"include":"omit"}).then(o=>{var r;return(r=this.socket._cookieJar)===null||r===void 0||r.parseCookies(o.headers.getSetCookie()),o})}}function C(i,t="",e){let s=i;e=e||typeof location<"u"&&location,i==null&&(i=e.protocol+"//"+e.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=e.protocol+i:i=e.host+i),/^(https?|wss?):\/\//.test(i)||(typeof e<"u"?i=e.protocol+"//"+i:i="https://"+i),s=b(i)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+t,s.href=s.protocol+"://"+o+(e&&e.port===s.port?"":":"+s.port),s}function a(i,t,e){return i.on(t,e),function(){i.off(t,e)}}const R=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class y extends m{constructor(t,e,s){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=t,this.nsp=e,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[a(t,"open",this.onopen.bind(this)),a(t,"packet",this.onpacket.bind(this)),a(t,"error",this.onerror.bind(this)),a(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var s,n,o;if(R.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const r={type:c.EVENT,data:e};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){const _=this.ids++,g=e.pop();this._registerAckCallback(_,g),r.id=_}const h=(n=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||n===void 0?void 0:n.writable,f=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(f?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,e){var s;const n=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(n===void 0){this.acks[t]=e;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===t&&this.sendBuffer.splice(h,1);e.call(this,new Error("operation has timed out"))},n),r=(...h)=>{this.io.clearTimeoutFn(o),e.apply(this,h)};r.withError=!0,this.acks[t]=r}emitWithAck(t,...e){return new Promise((s,n)=>{const o=(r,h)=>r?n(r):s(h);o.withError=!0,e.push(o),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((n,...o)=>(this._queue[0],n!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(n)):(this._queue.shift(),e&&e(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case c.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 c.EVENT:case c.BINARY_EVENT:this.onevent(t);break;case c.ACK:case c.BINARY_ACK:this.onack(t);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const s of e)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let s=!1;return function(...n){s||(s=!0,e.packet({type:c.ACK,id:t,data:n}))}}onack(t){const e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const s of e)s.apply(this,t.data)}}}function u(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}u.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*i);i=(Math.floor(t*10)&1)==0?i-e:i+e}return Math.min(i,this.max)|0};u.prototype.reset=function(){this.attempts=0};u.prototype.setMin=function(i){this.ms=i};u.prototype.setMax=function(i){this.max=i};u.prototype.setJitter=function(i){this.jitter=i};class p extends m{constructor(t,e){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,v(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((s=e.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new u({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;const n=e.parser||E;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new O(this.uri,this.opts);const e=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const n=a(e,"open",function(){s.onopen(),t&&t()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),t?t(h):this.maybeReconnectOnOpen()},r=a(e,"error",o);if(this._timeout!==!1){const h=this._timeout,f=this.setTimeoutFn(()=>{n(),o(new Error("timeout")),e.close()},h);this.opts.autoUnref&&f.unref(),this.subs.push(()=>{this.clearTimeoutFn(f)})}return this.subs.push(n),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(a(t,"ping",this.onping.bind(this)),a(t,"data",this.ondata.bind(this)),a(t,"error",this.onerror.bind(this)),a(t,"close",this.onclose.bind(this)),a(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){w(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new y(this,t,e),this.nsps[t]=s),s}_destroy(t){const e=Object.keys(this.nsps);for(const s of e)if(this.nsps[s].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let s=0;s<e.length;s++)this.engine.write(e[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(n=>{n?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",n)):t.onreconnect()}))},e);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const d={};function l(i,t){typeof i=="object"&&(t=i,i=void 0),t=t||{};const e=C(i,t.path||"/socket.io"),s=e.source,n=e.id,o=e.path,r=d[n]&&o in d[n].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||r;let f;return h?f=new p(s,t):(d[n]||(d[n]=new p(s,t)),f=d[n]),e.query&&!t.query&&(t.query=e.queryKey),f.socket(e.path,t)}Object.assign(l,{Manager:p,Socket:y,io:l,connect:l});export{A as Fetch,p as Manager,N as NodeWebSocket,B as NodeXHR,y as Socket,D as WebSocket,j as WebTransport,F as XHR,l as connect,l as default,l as io,M as protocol};
1
+ import{P as k,w as b,E as m,x as c,y as v,z as E,S as O,A as w}from"./tApYyOtF.js";import{W as N,X as B,W as D,C as j,X as F,B as M}from"./tApYyOtF.js";class A extends k{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(e=>this.onData(e))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,e){this._fetch(t).then(s=>{if(!s.ok)return this.onError("fetch write error",s.status,s);e()}).catch(s=>{this.onError("fetch write error",s)})}_fetch(t){var e;const s=t!==void 0,n=new Headers(this.opts.extraHeaders);return s&&n.set("content-type","text/plain;charset=UTF-8"),(e=this.socket._cookieJar)===null||e===void 0||e.appendCookies(n),fetch(this.uri(),{method:s?"POST":"GET",body:s?t:null,headers:n,credentials:this.opts.withCredentials?"include":"omit"}).then(o=>{var r;return(r=this.socket._cookieJar)===null||r===void 0||r.parseCookies(o.headers.getSetCookie()),o})}}function C(i,t="",e){let s=i;e=e||typeof location<"u"&&location,i==null&&(i=e.protocol+"//"+e.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=e.protocol+i:i=e.host+i),/^(https?|wss?):\/\//.test(i)||(typeof e<"u"?i=e.protocol+"//"+i:i="https://"+i),s=b(i)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+t,s.href=s.protocol+"://"+o+(e&&e.port===s.port?"":":"+s.port),s}function a(i,t,e){return i.on(t,e),function(){i.off(t,e)}}const R=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class y extends m{constructor(t,e,s){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=t,this.nsp=e,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[a(t,"open",this.onopen.bind(this)),a(t,"packet",this.onpacket.bind(this)),a(t,"error",this.onerror.bind(this)),a(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var s,n,o;if(R.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const r={type:c.EVENT,data:e};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){const _=this.ids++,g=e.pop();this._registerAckCallback(_,g),r.id=_}const h=(n=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||n===void 0?void 0:n.writable,f=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(f?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,e){var s;const n=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(n===void 0){this.acks[t]=e;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===t&&this.sendBuffer.splice(h,1);e.call(this,new Error("operation has timed out"))},n),r=(...h)=>{this.io.clearTimeoutFn(o),e.apply(this,h)};r.withError=!0,this.acks[t]=r}emitWithAck(t,...e){return new Promise((s,n)=>{const o=(r,h)=>r?n(r):s(h);o.withError=!0,e.push(o),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((n,...o)=>(this._queue[0],n!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(n)):(this._queue.shift(),e&&e(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case c.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 c.EVENT:case c.BINARY_EVENT:this.onevent(t);break;case c.ACK:case c.BINARY_ACK:this.onack(t);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const s of e)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let s=!1;return function(...n){s||(s=!0,e.packet({type:c.ACK,id:t,data:n}))}}onack(t){const e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const s of e)s.apply(this,t.data)}}}function u(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}u.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*i);i=(Math.floor(t*10)&1)==0?i-e:i+e}return Math.min(i,this.max)|0};u.prototype.reset=function(){this.attempts=0};u.prototype.setMin=function(i){this.ms=i};u.prototype.setMax=function(i){this.max=i};u.prototype.setJitter=function(i){this.jitter=i};class p extends m{constructor(t,e){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,v(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((s=e.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new u({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;const n=e.parser||E;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new O(this.uri,this.opts);const e=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const n=a(e,"open",function(){s.onopen(),t&&t()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),t?t(h):this.maybeReconnectOnOpen()},r=a(e,"error",o);if(this._timeout!==!1){const h=this._timeout,f=this.setTimeoutFn(()=>{n(),o(new Error("timeout")),e.close()},h);this.opts.autoUnref&&f.unref(),this.subs.push(()=>{this.clearTimeoutFn(f)})}return this.subs.push(n),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(a(t,"ping",this.onping.bind(this)),a(t,"data",this.ondata.bind(this)),a(t,"error",this.onerror.bind(this)),a(t,"close",this.onclose.bind(this)),a(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){w(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new y(this,t,e),this.nsps[t]=s),s}_destroy(t){const e=Object.keys(this.nsps);for(const s of e)if(this.nsps[s].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let s=0;s<e.length;s++)this.engine.write(e[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(n=>{n?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",n)):t.onreconnect()}))},e);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const d={};function l(i,t){typeof i=="object"&&(t=i,i=void 0),t=t||{};const e=C(i,t.path||"/socket.io"),s=e.source,n=e.id,o=e.path,r=d[n]&&o in d[n].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||r;let f;return h?f=new p(s,t):(d[n]||(d[n]=new p(s,t)),f=d[n]),e.query&&!t.query&&(t.query=e.queryKey),f.socket(e.path,t)}Object.assign(l,{Manager:p,Socket:y,io:l,connect:l});export{A as Fetch,p as Manager,N as NodeWebSocket,B as NodeXHR,y as Socket,D as WebSocket,j as WebTransport,F as XHR,l as connect,l as default,l as io,M as protocol};
@@ -1 +1 @@
1
- import{B as j,C as _,D as O,E as D,h as z,F as I,G as W,H as K,I as Q,J as M,f as E,d as f,r as u,c as y,t as A,k as H,g,u as R}from"./k-cRz8DS.js";import{f as m,a as h,s as P,d as T,c as U}from"./BrzeKAzG.js";import{o as L,L as X,j as Y,f as Z,q as $}from"./D_8c8ro5.js";import{i as V,a as p,s as ee}from"./Dn5i8FcP.js";import{I as ae}from"./BjhDUKS_.js";function fe(e,s,a=s){var c=new WeakSet;j(e,"input",async l=>{var o=l?e.defaultValue:e.value;if(o=B(e)?C(o):o,a(o),_!==null&&c.add(_),await O(),o!==(o=s())){var r=e.selectionStart,v=e.selectionEnd,n=e.value.length;if(e.value=o??"",v!==null){var t=e.value.length;r===v&&v===n&&t>n?(e.selectionStart=t,e.selectionEnd=t):(e.selectionStart=r,e.selectionEnd=Math.min(v,t))}}}),(D&&e.defaultValue!==e.value||z(s)==null&&e.value)&&(a(B(e)?C(e.value):e.value),_!==null&&c.add(_)),I(()=>{var l=s();if(e===document.activeElement){var o=W??_;if(c.has(o))return}B(e)&&l===C(e.value)||e.type==="date"&&!l&&!e.value||l!==e.value&&(e.value=l??"")})}const S=new Set;function ue(e,s,a,c,l=c){var o=a.getAttribute("type")==="checkbox",r=e;let v=!1;if(s!==null)for(var n of s)r=r[n]??(r[n]=[]);r.push(a),j(a,"change",()=>{var t=a.__value;o&&(t=q(r,t,a.checked)),l(t)},()=>l(o?[]:null)),I(()=>{var t=c();if(D&&a.defaultChecked!==a.checked){v=!0;return}o?(t=t||[],a.checked=t.includes(a.__value)):a.checked=K(a.__value,t)}),Q(()=>{var t=r.indexOf(a);t!==-1&&r.splice(t,1)}),S.has(r)||(S.add(r),M(()=>{r.sort((t,d)=>t.compareDocumentPosition(d)===4?-1:1),S.delete(r)})),M(()=>{if(v){var t;if(o)t=q(r,t,a.checked);else{var d=r.find(i=>i.checked);t=d==null?void 0:d.__value}l(t)}})}function he(e,s,a=s){j(e,"change",c=>{var l=c?e.defaultChecked:e.checked;a(l)}),(D&&e.defaultChecked!==e.checked||z(s)==null)&&a(e.checked),I(()=>{var c=s();e.checked=!!c})}function q(e,s,a){for(var c=new Set,l=0;l<e.length;l+=1)e[l].checked&&c.add(e[l].__value);return a||c.delete(s),Array.from(c)}function B(e){var s=e.type;return s==="number"||s==="range"}function C(e){return e===""?null:+e}var re=m('<p class="text-lg text-gray-600 leading-relaxed"> </p>'),te=m("<title> </title> <!>",1),se=m('<!> <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 space-y-8"><div class="bg-white shadow-sm border border-gray-200 rounded-xl p-8"><div class="space-y-8"><!></div></div></div> <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 mt-8"><!></div>',1);function _e(e,s){var a=se(),c=E(a);ae(c,{get title(){return s.title},children:(d,i)=>{var b=te(),k=E(b),F=f(k,!0);u(k);var G=y(k,2);{var J=x=>{var w=re(),N=f(w,!0);u(w),A(()=>P(N,s.description)),h(x,w)};V(G,x=>{s.description&&x(J)})}A(()=>P(F,s.title)),h(d,b)}});var l=y(c,2),o=f(l),r=f(o),v=f(r);L(v,()=>s.children??H),u(r),u(o),u(l);var n=y(l,2),t=f(n);X(t,{}),u(n),h(e,a)}var le=m('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m0-10.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75A11.959 11.959 0 0112 2.704z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M12 15.75h.007v.008H12v-.008z"></path></svg> <span class="text-xs">Not Connected</span></div>'),oe=m("<button><!></button>");function me(e,s){const a=()=>p($,"$connected",c),[c,l]=ee(),o=R(()=>a()?!!s.disabled:!0);var r=oe();r.__click=function(...d){var i;(i=s.buttonAction)==null||i.apply(this,d)};var v=f(r);{var n=d=>{var i=le();h(d,i)},t=d=>{var i=U(),b=E(i);L(b,()=>s.children??H),h(d,i)};V(v,d=>{!a()&&g(o)?d(n):d(t,!1)})}u(r),A(()=>{Y(r,1,`inline-flex items-center justify-center px-6 py-3 text-sm font-semibold border border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed transition-all duration-200 ${g(o)&&!a()?"bg-red-100 text-red-700 border-red-200 hover:bg-red-100":g(o)?"bg-gray-100 text-gray-500 border-gray-200 hover:bg-gray-100":"text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}`),r.disabled=g(o),Z(r,"title",a()?"":"Please connect to Sockethub first")}),h(e,r),l()}T(["click"]);export{_e as B,me as S,he as a,ue as b,fe as c};
1
+ import{B as j,C as _,D as O,E as D,h as z,F as I,G as W,H as K,I as Q,J as M,f as E,d as f,r as u,c as y,t as A,k as H,g,u as R}from"./k-cRz8DS.js";import{f as m,a as h,s as P,d as T,c as U}from"./BrzeKAzG.js";import{o as L,L as X,j as Y,f as Z,q as $}from"./tApYyOtF.js";import{i as V,a as p,s as ee}from"./Dn5i8FcP.js";import{I as ae}from"./wTGAw4y8.js";function fe(e,s,a=s){var c=new WeakSet;j(e,"input",async l=>{var o=l?e.defaultValue:e.value;if(o=B(e)?C(o):o,a(o),_!==null&&c.add(_),await O(),o!==(o=s())){var r=e.selectionStart,v=e.selectionEnd,n=e.value.length;if(e.value=o??"",v!==null){var t=e.value.length;r===v&&v===n&&t>n?(e.selectionStart=t,e.selectionEnd=t):(e.selectionStart=r,e.selectionEnd=Math.min(v,t))}}}),(D&&e.defaultValue!==e.value||z(s)==null&&e.value)&&(a(B(e)?C(e.value):e.value),_!==null&&c.add(_)),I(()=>{var l=s();if(e===document.activeElement){var o=W??_;if(c.has(o))return}B(e)&&l===C(e.value)||e.type==="date"&&!l&&!e.value||l!==e.value&&(e.value=l??"")})}const S=new Set;function ue(e,s,a,c,l=c){var o=a.getAttribute("type")==="checkbox",r=e;let v=!1;if(s!==null)for(var n of s)r=r[n]??(r[n]=[]);r.push(a),j(a,"change",()=>{var t=a.__value;o&&(t=q(r,t,a.checked)),l(t)},()=>l(o?[]:null)),I(()=>{var t=c();if(D&&a.defaultChecked!==a.checked){v=!0;return}o?(t=t||[],a.checked=t.includes(a.__value)):a.checked=K(a.__value,t)}),Q(()=>{var t=r.indexOf(a);t!==-1&&r.splice(t,1)}),S.has(r)||(S.add(r),M(()=>{r.sort((t,d)=>t.compareDocumentPosition(d)===4?-1:1),S.delete(r)})),M(()=>{if(v){var t;if(o)t=q(r,t,a.checked);else{var d=r.find(i=>i.checked);t=d==null?void 0:d.__value}l(t)}})}function he(e,s,a=s){j(e,"change",c=>{var l=c?e.defaultChecked:e.checked;a(l)}),(D&&e.defaultChecked!==e.checked||z(s)==null)&&a(e.checked),I(()=>{var c=s();e.checked=!!c})}function q(e,s,a){for(var c=new Set,l=0;l<e.length;l+=1)e[l].checked&&c.add(e[l].__value);return a||c.delete(s),Array.from(c)}function B(e){var s=e.type;return s==="number"||s==="range"}function C(e){return e===""?null:+e}var re=m('<p class="text-lg text-gray-600 leading-relaxed"> </p>'),te=m("<title> </title> <!>",1),se=m('<!> <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 space-y-8"><div class="bg-white shadow-sm border border-gray-200 rounded-xl p-8"><div class="space-y-8"><!></div></div></div> <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 mt-8"><!></div>',1);function _e(e,s){var a=se(),c=E(a);ae(c,{get title(){return s.title},children:(d,i)=>{var b=te(),k=E(b),F=f(k,!0);u(k);var G=y(k,2);{var J=x=>{var w=re(),N=f(w,!0);u(w),A(()=>P(N,s.description)),h(x,w)};V(G,x=>{s.description&&x(J)})}A(()=>P(F,s.title)),h(d,b)}});var l=y(c,2),o=f(l),r=f(o),v=f(r);L(v,()=>s.children??H),u(r),u(o),u(l);var n=y(l,2),t=f(n);X(t,{}),u(n),h(e,a)}var le=m('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m0-10.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75A11.959 11.959 0 0112 2.704z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M12 15.75h.007v.008H12v-.008z"></path></svg> <span class="text-xs">Not Connected</span></div>'),oe=m("<button><!></button>");function me(e,s){const a=()=>p($,"$connected",c),[c,l]=ee(),o=R(()=>a()?!!s.disabled:!0);var r=oe();r.__click=function(...d){var i;(i=s.buttonAction)==null||i.apply(this,d)};var v=f(r);{var n=d=>{var i=le();h(d,i)},t=d=>{var i=U(),b=E(i);L(b,()=>s.children??H),h(d,i)};V(v,d=>{!a()&&g(o)?d(n):d(t,!1)})}u(r),A(()=>{Y(r,1,`inline-flex items-center justify-center px-6 py-3 text-sm font-semibold border border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed transition-all duration-200 ${g(o)&&!a()?"bg-red-100 text-red-700 border-red-200 hover:bg-red-100":g(o)?"bg-gray-100 text-gray-500 border-gray-200 hover:bg-gray-100":"text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}`),r.disabled=g(o),Z(r,"title",a()?"":"Please connect to Sockethub first")}),h(e,r),l()}T(["click"]);export{_e as B,me as S,he as a,ue as b,fe as c};
@@ -1,3 +1,3 @@
1
- import{d as Ae,f as R,s as I,a as S,t as oe}from"./BrzeKAzG.js";import{p as Me,b as Pe,f as le,d,r as g,c as r,e as t,s as l,g as e,u,i as De,n as q,t as M}from"./k-cRz8DS.js";import{i as G}from"./Dn5i8FcP.js";import{n as Ee,r as Fe,b as Le,a as Be,c as ie,s as ce,d as je}from"./D_8c8ro5.js";import{B as Ge,S as de,c as Re,a as Ue}from"./D3v7fTNQ.js";import{F as P}from"./Bmzo1m7q.js";async function He(U,n){const y=await Ee(U,"credentials",n);if(y!=null&&y.error)throw new Error(y.error)}var Te=R('<label for="meta-login" class="block text-sm font-semibold text-gray-700">Login method</label> <select id="meta-login" class="w-full px-4 py-3 border border-gray-300 rounded-lg text-gray-900"><option>Instagram Login</option><option>Facebook Login (Page token)</option></select> <!>',1),Ve=R('<p role="alert" class="text-red-800 bg-red-50 border border-red-200 rounded-lg p-4 whitespace-pre-wrap break-words"> </p>'),We=R('<p role="status" class="text-green-800 bg-green-50 border border-green-200 rounded-lg p-4 break-words"> </p>'),qe=R(`<p class="text-gray-600 text-sm"> </p> <fieldset class="space-y-4"><legend class="text-lg font-semibold mb-4">Account credentials</legend> <!> <!> <!> <!> <div class="flex flex-wrap gap-3"><!> <button type="button" class="px-6 py-3 text-sm font-semibold rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed">Clear Credentials</button></div></fieldset> <fieldset class="space-y-4"><legend class="text-lg font-semibold mb-4">Send a reply</legend> <!> <div class="space-y-2"><label for="meta-message" class="block text-sm font-semibold text-gray-700">Message</label> <textarea id="meta-message" rows="4" class="w-full px-4 py-3 border border-gray-300 rounded-lg text-gray-900"></textarea> <p class="text-sm text-gray-600"> </p></div> <label class="flex items-center gap-2 text-sm text-gray-700"><input type="checkbox"/> Human Agent reply (requires Meta approval)</label> <p class="text-sm text-gray-600">Leave unchecked for standard replies. Enable only for a manual support reply
1
+ import{d as Ae,f as R,s as I,a as S,t as oe}from"./BrzeKAzG.js";import{p as Me,b as Pe,f as le,d,r as g,c as r,e as t,s as l,g as e,u,i as De,n as q,t as M}from"./k-cRz8DS.js";import{i as G}from"./Dn5i8FcP.js";import{n as Ee,r as Fe,b as Le,a as Be,c as ie,s as ce,d as je}from"./tApYyOtF.js";import{B as Ge,S as de,c as Re,a as Ue}from"./CLpPY9Jp.js";import{F as P}from"./DZrh4NVE.js";async function He(U,n){const y=await Ee(U,"credentials",n);if(y!=null&&y.error)throw new Error(y.error)}var Te=R('<label for="meta-login" class="block text-sm font-semibold text-gray-700">Login method</label> <select id="meta-login" class="w-full px-4 py-3 border border-gray-300 rounded-lg text-gray-900"><option>Instagram Login</option><option>Facebook Login (Page token)</option></select> <!>',1),Ve=R('<p role="alert" class="text-red-800 bg-red-50 border border-red-200 rounded-lg p-4 whitespace-pre-wrap break-words"> </p>'),We=R('<p role="status" class="text-green-800 bg-green-50 border border-green-200 rounded-lg p-4 break-words"> </p>'),qe=R(`<p class="text-gray-600 text-sm"> </p> <fieldset class="space-y-4"><legend class="text-lg font-semibold mb-4">Account credentials</legend> <!> <!> <!> <!> <div class="flex flex-wrap gap-3"><!> <button type="button" class="px-6 py-3 text-sm font-semibold rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed">Clear Credentials</button></div></fieldset> <fieldset class="space-y-4"><legend class="text-lg font-semibold mb-4">Send a reply</legend> <!> <div class="space-y-2"><label for="meta-message" class="block text-sm font-semibold text-gray-700">Message</label> <textarea id="meta-message" rows="4" class="w-full px-4 py-3 border border-gray-300 rounded-lg text-gray-900"></textarea> <p class="text-sm text-gray-600"> </p></div> <label class="flex items-center gap-2 text-sm text-gray-700"><input type="checkbox"/> Human Agent reply (requires Meta approval)</label> <p class="text-sm text-gray-600">Leave unchecked for standard replies. Enable only for a manual support reply
2
2
  eligible for Meta's seven-day Human Agent window. Your replies do not extend the window.</p> <!></fieldset> <!> <!>`,1);function Qe(U,n){Me(n,!0);const y=u(()=>n.platform==="messenger"?"Messenger":"Instagram"),Y=u(()=>n.platform==="messenger"?2e3:1e3);let _=l(""),x=l(""),D=l(""),f=l("instagram"),E=l(""),C=l(""),b=l(""),F=l(!1);const ge=u(()=>n.platform==="messenger"?"characters":"bytes"),z=u(()=>n.platform==="messenger"?Array.from(e(b)).length:new TextEncoder().encode(e(b)).length);let h=l(!1),L,c=l(!1),v=l(""),p=l("");const ue=u(()=>/^[0-9]+$/.test(e(_))&&e(x).length>0&&/^v[0-9]{1,3}\.[0-9]{1,2}$/.test(e(D))&&(n.platform!=="instagram"||e(f)!=="facebook"||/^[0-9]+$/.test(e(E)))),me=u(()=>e(h)&&/^[0-9]+$/.test(e(C))&&e(b).trim().length>0&&e(z)<=e(Y));function k(){t(h,!1),t(p,""),t(v,""),t(F,!1),J()}function J(){var o;L&&((o=ce)==null||o.clearCredentials(L),L=void 0)}async function pe(){t(c,!0),t(v,""),t(p,"");try{await Be();const o=await ie(n.platform);L={platform:n.platform,actorId:e(_)},await He(ce.socket,{"@context":o,type:"credentials",actor:{id:e(_),type:"person"},object:{type:"credentials",token:e(x),apiVersion:e(D),...n.platform==="instagram"?{login:e(f),...e(f)==="facebook"?{pageId:e(E)}:{}}:{}}}),t(h,!0),t(p,"Credentials set for this session. Meta checks the token when you send.")}catch(o){J(),t(v,o instanceof Error?o.message:String(o),!0)}finally{t(c,!1)}}async function fe(){var o;t(c,!0),t(v,""),t(p,"");try{const w=await je({"@context":await ie(n.platform),type:"send",actor:{id:e(_),type:"person"},target:{id:e(C),type:"person"},object:{type:"message",content:e(b),...e(F)?{humanAgent:!0}:{}}});t(p,`Accepted by Meta. Message ID: ${((o=w.object)==null?void 0:o.id)??"unknown"}. Delivery is not confirmed.`)}catch(w){t(v,w instanceof Error?w.message:String(w),!0)}finally{t(c,!1)}}async function be(){k(),t(x,""),t(C,""),t(b,""),t(p,"Local credentials cleared. To end the server session too, disconnect from Sockethub.")}Ge(U,{get title(){return`${e(y)??""} Platform Example`},description:"Send a text reply using your own Meta business account.",children:(o,w)=>{var K=qe(),H=le(K),ve=d(H);g(H);var B=r(H,2),N=r(d(B),2);{var ye=a=>{var s=Te(),i=r(le(s),2);i.__change=k;var m=d(i);m.value=m.__value="instagram";var ne=r(m);ne.value=ne.__value="facebook",g(i);var Ie=r(i,2);{var Se=A=>{P(A,{label:"Linked Facebook Page ID",id:"meta-page",onInput:k,get value(){return e(E)},set value(Ce){t(E,Ce,!0)}})};G(Ie,A=>{e(f)==="facebook"&&A(Se)})}Le(i,()=>e(f),A=>t(f,A)),S(a,s)};G(N,a=>{n.platform==="instagram"&&a(ye)})}var O=r(N,2);{let a=u(()=>n.platform==="messenger"?"Facebook Page ID":"Instagram account ID");P(O,{get label(){return e(a)},id:"meta-account",onInput:k,get value(){return e(_)},set value(s){t(_,s,!0)}})}var Q=r(O,2);P(Q,{label:"Access token",id:"meta-token",type:"password",onInput:k,get value(){return e(x)},set value(a){t(x,a,!0)}});var X=r(Q,2);P(X,{label:"Graph API version",id:"meta-version",placeholder:"e.g. v22.0 — use a version supported by your app",onInput:k,get value(){return e(D)},set value(a){t(D,a,!0)}});var Z=r(X,2),$=d(Z);{let a=u(()=>!e(ue)||e(c)||e(h));de($,{buttonAction:pe,get disabled(){return e(a)},children:(s,i)=>{q();var m=oe();M(()=>I(m,e(h)?"Credentials Set":"Set Credentials")),S(s,m)}})}var ee=r($,2);ee.__click=be,g(Z),g(B);var j=r(B,2),te=r(d(j),2);{let a=u(()=>n.platform==="messenger"?"Recipient Page-scoped ID (PSID)":"Recipient Instagram-scoped ID (IGSID)");P(te,{get label(){return e(a)},id:"meta-recipient",get value(){return e(C)},set value(s){t(C,s,!0)}})}var T=r(te,2),V=r(d(T),2);De(V);var ae=r(V,2),_e=d(ae);g(ae),g(T);var W=r(T,2),re=d(W);Fe(re),q(),g(W);var xe=r(W,4);{let a=u(()=>!e(me)||e(c));de(xe,{buttonAction:fe,get disabled(){return e(a)},children:(s,i)=>{q();var m=oe();M(()=>I(m,e(c)?"Working…":"Send Message")),S(s,m)}})}g(j);var se=r(j,2);{var he=a=>{var s=Ve(),i=d(s,!0);g(s),M(()=>I(i,e(v))),S(a,s)};G(se,a=>{e(v)&&a(he)})}var ke=r(se,2);{var we=a=>{var s=We(),i=d(s,!0);g(s),M(()=>I(i,e(p))),S(a,s)};G(ke,a=>{e(p)&&a(we)})}M(()=>{I(ve,`${n.platform==="messenger"?"Use a Facebook Page access token with pages_messaging.":e(f)==="facebook"?"Use a Page access token with instagram_manage_messages for the linked professional Instagram account.":"Use an Instagram Login token with instagram_business_manage_messages for a Business or Creator account."}
3
3
  Incoming messages are handled elsewhere. Get the recipient's scoped ID from that integration.`),B.disabled=e(c),ee.disabled=e(c)||!e(x)&&!e(h),j.disabled=e(c),I(_e,`${e(z)??""} / ${e(Y)??""} ${e(ge)??""}`)}),Re(V,()=>e(b),a=>t(b,a)),Ue(re,()=>e(F),a=>t(F,a)),S(o,K)}}),Pe()}Ae(["change","click"]);export{Qe as M};
@@ -1 +1 @@
1
- import{d as v,f as _,s as y,a as g}from"./BrzeKAzG.js";import{p as h,d,r as u,c as x,t as w,b as F}from"./k-cRz8DS.js";import{r as I,f as l,j}from"./D_8c8ro5.js";import{c as k}from"./D3v7fTNQ.js";import{p as r}from"./Dn5i8FcP.js";var C=_('<div class="w-full space-y-2"><label class="block text-sm font-semibold text-gray-700"> </label> <input/></div>');function E(n,e){h(e,!0);let c=r(e,"type",3,"text"),f=r(e,"placeholder",3,""),o=r(e,"value",15),m=r(e,"class",3,"");var s=C(),a=d(s),p=d(a,!0);u(a);var t=x(a,2);I(t),t.__input=function(...b){var i;(i=e.onInput?()=>e.onInput(o()):void 0)==null||i.apply(this,b)},u(s),w(()=>{l(a,"for",e.id),y(p,e.label),l(t,"id",e.id),l(t,"type",c()),l(t,"placeholder",f()),j(t,1,`w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 text-gray-900 placeholder-gray-500 ${m()??""}`)}),k(t,o),g(n,s),F()}v(["input"]);export{E as F};
1
+ import{d as v,f as _,s as y,a as g}from"./BrzeKAzG.js";import{p as h,d,r as u,c as x,t as w,b as F}from"./k-cRz8DS.js";import{r as I,f as l,j}from"./tApYyOtF.js";import{c as k}from"./CLpPY9Jp.js";import{p as r}from"./Dn5i8FcP.js";var C=_('<div class="w-full space-y-2"><label class="block text-sm font-semibold text-gray-700"> </label> <input/></div>');function E(n,e){h(e,!0);let c=r(e,"type",3,"text"),f=r(e,"placeholder",3,""),o=r(e,"value",15),m=r(e,"class",3,"");var s=C(),a=d(s),p=d(a,!0);u(a);var t=x(a,2);I(t),t.__input=function(...b){var i;(i=e.onInput?()=>e.onInput(o()):void 0)==null||i.apply(this,b)},u(s),w(()=>{l(a,"for",e.id),y(p,e.label),l(t,"id",e.id),l(t,"type",c()),l(t,"placeholder",f()),j(t,1,`w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 text-gray-900 placeholder-gray-500 ${m()??""}`)}),k(t,o),g(n,s),F()}v(["input"]);export{E as F};
@@ -1,4 +1,4 @@
1
- import{f as j,a as g,t as F,s as D}from"./BrzeKAzG.js";import{p as O,i as G,t as w,b as T,q as p,e as m,s as J,f as B,d as h,r as x,c as v,g as r,n as H,u as K,h as i}from"./k-cRz8DS.js";import{p as C,i as M,a as Q,c as _,s as R}from"./Dn5i8FcP.js";import{f as y,r as U}from"./D_8c8ro5.js";import{c as E,S as V}from"./D3v7fTNQ.js";var W=j(`<textarea class="form-control block w-full px-3 py-1.5 text-base font-normal
1
+ import{f as j,a as g,t as F,s as D}from"./BrzeKAzG.js";import{p as O,i as G,t as w,b as T,q as p,e as m,s as J,f as B,d as h,r as x,c as v,g as r,n as H,u as K,h as i}from"./k-cRz8DS.js";import{p as C,i as M,a as Q,c as _,s as R}from"./Dn5i8FcP.js";import{f as y,r as U}from"./tApYyOtF.js";import{c as E,S as V}from"./CLpPY9Jp.js";var W=j(`<textarea class="form-control block w-full px-3 py-1.5 text-base font-normal
2
2
  text-gray-700 bg-white bg-clip-padding border border-solid
3
3
  border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700
4
4
  focus:bg-white focus:border-blue-600 focus:outline-none" rows="5"></textarea>`);function X(l,t){O(t,!0);let e=C(t,"data",15);var o=W();G(o),w(()=>y(o,"id",`json-object-${t.title??""}`)),E(o,e),g(l,o),T()}var Y=j('<div class="w-full p-2"><label class="inline-block text-gray-900 font-bold w-32">Password</label> <input type="password" class="border-4"/></div>'),Z=j('<div class="w-full"><label class="form-label inline-block text-gray-900 font-bold mb-2"> </label> <!></div> <!> <div class="w-full text-right"><!></div>',1);function $(l,t){O(t,!0);let e=C(t,"buttonText",3,"Send"),o=J(""),S=K(()=>`secret-input-${t.title.toLowerCase().replace(/\s+/g,"-")}`),s=J("");p(()=>{m(o,typeof t.obj.password=="string"?t.obj.password:"",!0)}),p(()=>{const a={...t.obj};delete a.password,m(s,JSON.stringify(a,null,3),!0)});async function k(){let a;try{a=JSON.parse(r(s))}catch(n){const d=n instanceof Error?n.message:String(n);throw new Error(`Invalid JSON: ${d}`)}r(o).length>0&&(a.password=r(o)),t.submitData(JSON.stringify(a))}var u=Z(),f=B(u),c=h(f),b=h(c,!0);x(c);var P=v(c,2);X(P,{get title(){return t.title},get data(){return r(s)},set data(a){m(s,a,!0)}}),x(f);var I=v(f,2);{var q=a=>{var n=Y(),d=h(n),A=v(d,2);U(A),x(n),w(()=>{y(d,"for",r(S)),y(A,"id",r(S))}),E(A,()=>r(o),z=>m(o,z)),g(a,n)};M(I,a=>{typeof t.obj.password=="string"&&a(q)})}var N=v(I,2),L=h(N);V(L,{get disabled(){return t.disabled},buttonAction:k,children:(a,n)=>{H();var d=F();w(()=>D(d,e())),g(a,d)}}),x(N),w(()=>{y(c,"for",`json-object-${t.title??""}`),D(b,t.title)}),g(l,u),T()}var tt=j('<p class="text-sm text-gray-600 mb-2">Define the <code>actor</code> object for credentials and message events. Include <code>id</code>, <code>type</code>, and <code>name</code> on every outbound message.</p> <!>',1);function nt(l,t){O(t,!0);const e=()=>Q(t.sockethubState,"$sockethubState",o),[o,S]=R();let s=J(void 0);p(()=>{e().actorSet&&r(s)&&t.actor.id!==r(s)&&(_(t.sockethubState,i(e).actorSet=!1,i(e)),"credentialsSet"in e()&&_(t.sockethubState,i(e).credentialsSet=!1,i(e)),"connected"in e()&&_(t.sockethubState,i(e).connected=!1,i(e)),"joined"in e()&&_(t.sockethubState,i(e).joined=!1,i(e)))});function k(c){const b=JSON.parse(c);console.log("actor confirmed for this app session:",b),t.sockethubState.set({actorSet:!0,credentialsSet:!1,connected:!1,joined:!1}),m(s,typeof b.id=="string"?b.id:void 0,!0)}var u=tt(),f=v(B(u),2);$(f,{title:"Actor",get obj(){return t.actor},buttonText:"Confirm actor",submitData:k,get disabled(){return e().actorSet}}),g(l,u),T(),S()}export{nt as A,$ as T};
@@ -0,0 +1 @@
1
+ var s;const a=((s=globalThis.__sveltekit_nbheu3)==null?void 0:s.base)??"/examples";var e;const t=((e=globalThis.__sveltekit_nbheu3)==null?void 0:e.assets)??a??"";export{t as a,a as b};