@sockethub/examples 1.0.0-alpha.9 → 1.0.0-beta.1

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 (67) hide show
  1. package/README.md +47 -153
  2. package/build/_app/immutable/assets/0.DiwDnc-u.css +1 -0
  3. package/build/_app/immutable/chunks/BDxEtWDn.js +1 -0
  4. package/build/_app/immutable/chunks/BFJazgM-.js +4 -0
  5. package/build/_app/immutable/chunks/BKtlB-ZE.js +37 -0
  6. package/build/_app/immutable/chunks/BRcKhWZZ.js +1 -0
  7. package/build/_app/immutable/chunks/BymJmDWJ.js +1 -0
  8. package/build/_app/immutable/chunks/C7zmhnYM.js +1 -0
  9. package/build/_app/immutable/chunks/CH5OY5MF.js +1 -0
  10. package/build/_app/immutable/chunks/{D_xw8KSE.js → CbO4bo1j.js} +1 -1
  11. package/build/_app/immutable/chunks/CgjHsrhs.js +2 -0
  12. package/build/_app/immutable/chunks/Cko76dBZ.js +1 -0
  13. package/build/_app/immutable/chunks/D5R3T3gW.js +1 -0
  14. package/build/_app/immutable/chunks/FpM_-oX5.js +1 -0
  15. package/build/_app/immutable/chunks/wMyiGnQa.js +1 -0
  16. package/build/_app/immutable/entry/app.C88mAu2e.js +2 -0
  17. package/build/_app/immutable/entry/start.B1PB6bga.js +1 -0
  18. package/build/_app/immutable/nodes/0.BwQUhEGu.js +39 -0
  19. package/build/_app/immutable/nodes/1.C-zkRZjk.js +1 -0
  20. package/build/_app/immutable/nodes/2.8bzWQILm.js +5 -0
  21. package/build/_app/immutable/nodes/3.DrGIkVu0.js +2 -0
  22. package/build/_app/immutable/nodes/4.Clpm2HdH.js +1 -0
  23. package/build/_app/immutable/nodes/5.D6ttn0N8.js +1 -0
  24. package/build/_app/immutable/nodes/6.CkpDg7i6.js +1 -0
  25. package/build/_app/immutable/nodes/7.DrKGjs0l.js +1 -0
  26. package/build/_app/immutable/nodes/8.2NG23_e4.js +1 -0
  27. package/build/_app/immutable/nodes/9.D7zgVgYt.js +2 -0
  28. package/build/_app/version.json +1 -1
  29. package/build/caldav.html +40 -0
  30. package/build/carddav.html +40 -0
  31. package/build/dummy.html +16 -14
  32. package/build/feeds.html +16 -14
  33. package/build/index.html +16 -14
  34. package/build/irc.html +16 -14
  35. package/build/metadata-test.html +16 -0
  36. package/build/metadata.html +16 -14
  37. package/build/xmpp.html +16 -14
  38. package/package.json +11 -5
  39. package/build/_app/immutable/assets/0.JUA-HkH6.css +0 -1
  40. package/build/_app/immutable/chunks/B-2myMF5.js +0 -1
  41. package/build/_app/immutable/chunks/BBdxXcNs.js +0 -23
  42. package/build/_app/immutable/chunks/BhL0iima.js +0 -4
  43. package/build/_app/immutable/chunks/BnKTx64M.js +0 -1
  44. package/build/_app/immutable/chunks/C1LF9VyP.js +0 -1
  45. package/build/_app/immutable/chunks/CARmnL8B.js +0 -1
  46. package/build/_app/immutable/chunks/CC-fhLYv.js +0 -1
  47. package/build/_app/immutable/chunks/CFHe0i8O.js +0 -1
  48. package/build/_app/immutable/chunks/Cf7Xaqef.js +0 -1
  49. package/build/_app/immutable/chunks/Ciq9INsC.js +0 -1
  50. package/build/_app/immutable/chunks/CoHdmBcD.js +0 -1
  51. package/build/_app/immutable/chunks/CuMZk85B.js +0 -1
  52. package/build/_app/immutable/chunks/DqdrLdzV.js +0 -2
  53. package/build/_app/immutable/chunks/P3PHXZz3.js +0 -2
  54. package/build/_app/immutable/chunks/ckVI8gYG.js +0 -1
  55. package/build/_app/immutable/entry/app.Bl74kTht.js +0 -2
  56. package/build/_app/immutable/entry/start.D24qTA3b.js +0 -1
  57. package/build/_app/immutable/nodes/0.DdMWQ3yw.js +0 -39
  58. package/build/_app/immutable/nodes/1.CsFfh9_m.js +0 -1
  59. package/build/_app/immutable/nodes/2.D-ebmGgp.js +0 -5
  60. package/build/_app/immutable/nodes/3.1s4AoiT3.js +0 -1
  61. package/build/_app/immutable/nodes/4.Ck-0hor4.js +0 -1
  62. package/build/_app/immutable/nodes/5.BV2I1j0o.js +0 -1
  63. package/build/_app/immutable/nodes/6.PZ-pmrq7.js +0 -1
  64. package/build/_app/immutable/nodes/7.C7IiHO6h.js +0 -1
  65. package/build/config.json +0 -9
  66. package/build/favicon.ico +0 -0
  67. package/build/sockethub-logo.svg +0 -147
@@ -0,0 +1 @@
1
+ import{P as k,u as b,E as m,v as c,w as v,x as E,S as O,y as w}from"./BKtlB-ZE.js";import{W as N,X as B,W as D,A as j,X as F,z as M}from"./BKtlB-ZE.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 R(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 C=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(C.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=R(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};
@@ -0,0 +1 @@
1
+ var pn=Object.defineProperty;var wt=e=>{throw TypeError(e)};var hn=(e,t,n)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var B=(e,t,n)=>hn(e,typeof t!="symbol"?t+"":t,n),ze=(e,t,n)=>t.has(e)||wt("Cannot "+n);var w=(e,t,n)=>(ze(e,t,"read from private field"),n?n.call(e):t.get(e)),q=(e,t,n)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),oe=(e,t,n,r)=>(ze(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Q=(e,t,n)=>(ze(e,t,"access private method"),n);var xt=Array.isArray,yn=Array.prototype.indexOf,ar=Array.from,lr=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,wn=Object.getOwnPropertyDescriptors,En=Object.prototype,gn=Array.prototype,Ot=Object.getPrototypeOf,Et=Object.isExtensible;function ur(e){return typeof e=="function"}const Fe=()=>{};function or(e){return e()}function mn(e){for(var t=0;t<e.length;t++)e[t]()}function Dt(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}function cr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,Me=4,De=8,st=1<<24,Y=16,H=32,ue=64,Nt=128,k=512,T=1024,D=2048,U=4096,j=8192,G=16384,ft=32768,je=65536,gt=1<<17,Pt=1<<18,Ne=1<<19,kt=1<<20,_r=1<<25,Re=32768,We=1<<21,it=1<<22,K=1<<23,re=Symbol("$state"),vr=Symbol("legacy props"),dr=Symbol(""),_e=new class extends Error{constructor(){super(...arguments);B(this,"name","StaleReactionError");B(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},at=3,Ct=8;function lt(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function bn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Tn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function An(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Sn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Rn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function hr(){throw new Error("https://svelte.dev/e/hydration_failed")}function xn(e){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function yr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function On(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Dn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Nn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function wr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Er=1,gr=2,mr=4,br=8,Tr=16,Ar=1,Sr=2,Rr=4,xr=8,Or=16,Dr=1,Nr=2,Pn="[",kn="[!",Cn="]",ut={},g=Symbol(),Pr="http://www.w3.org/1999/xhtml",kr="@attach";function ot(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Cr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ir(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let X=!1;function Fr(e){X=e}let m;function we(e){if(e===null)throw ot(),ut;return m=e}function Mr(){return we(W(m))}function jr(e){if(X){if(W(m)!==null)throw ot(),ut;m=e}}function Lr(e=1){if(X){for(var t=e,n=m;t--;)n=W(n);m=n}}function qr(e=!0){for(var t=0,n=m;;){if(n.nodeType===Ct){var r=n.data;if(r===Cn){if(t===0)return n;t-=1}else(r===Pn||r===kn)&&(t+=1)}var s=W(n);e&&n.remove(),n=s}}function Yr(e){if(!e||e.nodeType!==Ct)throw ot(),ut;return e.data}function It(e){return e===this.v}function Ft(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Mt(e){return!Ft(e,this.v)}let Pe=!1;function Hr(){Pe=!0}let h=null;function Le(e){h=e}function Ur(e,t=!1,n){h={p:h,i:!1,c:null,e:null,s:e,x:null,l:Pe&&!t?{s:null,u:null,$:[]}:null}}function Br(e){var t=h,n=t.e;if(n!==null){t.e=null;for(var r of n)Qt(r)}return t.i=!0,h=t.p,{}}function ke(){return!Pe||h!==null&&h.l===null}let ee=[];function jt(){var e=ee;ee=[],mn(e)}function Lt(e){if(ee.length===0&&!Se){var t=ee;queueMicrotask(()=>{t===ee&&jt()})}ee.push(e)}function In(){for(;ee.length>0;)jt()}function Fn(e){var t=y;if(t===null)return _.f|=K,e;if((t.f&ft)===0){if((t.f&Nt)===0)throw e;t.b.error(e)}else qe(e,t)}function qe(e,t){for(;t!==null;){if((t.f&Nt)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const Mn=-7169;function S(e,t){e.f=e.f&Mn|t}function ct(e){(e.f&k)!==0||e.deps===null?S(e,T):S(e,U)}function qt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&Re)===0||(t.f^=Re,qt(t.deps))}function jn(e,t,n){(e.f&D)!==0?t.add(e):(e.f&U)!==0&&n.add(e),qt(e.deps),S(e,T)}const Ie=new Set;let p=null,Xe=null,b=null,P=[],Ge=null,Je=!1,Se=!1;var de,pe,te,ne,Oe,he,ye,C,Qe,et,Yt,Ht;const $e=class $e{constructor(){q(this,C);B(this,"committed",!1);B(this,"current",new Map);B(this,"previous",new Map);q(this,de,new Set);q(this,pe,new Set);q(this,te,0);q(this,ne,0);q(this,Oe,null);q(this,he,new Set);q(this,ye,new Set);B(this,"skipped_effects",new Set);B(this,"is_fork",!1)}is_deferred(){return this.is_fork||w(this,ne)>0}process(t){var s;P=[],Xe=null,this.apply();var n=[],r=[];for(const f of t)Q(this,C,Qe).call(this,f,n,r);this.is_fork||Q(this,C,Yt).call(this),this.is_deferred()?(Q(this,C,et).call(this,r),Q(this,C,et).call(this,n)):(Xe=this,p=null,mt(r),mt(n),Xe=null,(s=w(this,Oe))==null||s.resolve()),b=null}capture(t,n){n!==g&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&K)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){p=this,this.apply()}deactivate(){p===this&&(p=null,b=null)}flush(){if(this.activate(),P.length>0){if(Ut(),p!==null&&p!==this)return}else w(this,te)===0&&this.process([]);this.deactivate()}discard(){for(const t of w(this,pe))t(this);w(this,pe).clear()}increment(t){oe(this,te,w(this,te)+1),t&&oe(this,ne,w(this,ne)+1)}decrement(t){oe(this,te,w(this,te)-1),t&&oe(this,ne,w(this,ne)-1),this.revive()}revive(){for(const t of w(this,he))w(this,ye).delete(t),S(t,D),ie(t);for(const t of w(this,ye))S(t,U),ie(t);this.flush()}oncommit(t){w(this,de).add(t)}ondiscard(t){w(this,pe).add(t)}settled(){return(w(this,Oe)??oe(this,Oe,Dt())).promise}static ensure(){if(p===null){const t=p=new $e;Ie.add(p),Se||$e.enqueue(()=>{p===t&&t.flush()})}return p}static enqueue(t){Lt(t)}apply(){}};de=new WeakMap,pe=new WeakMap,te=new WeakMap,ne=new WeakMap,Oe=new WeakMap,he=new WeakMap,ye=new WeakMap,C=new WeakSet,Qe=function(t,n,r){t.f^=T;for(var s=t.first,f=null;s!==null;){var l=s.f,u=(l&(H|ue))!==0,i=u&&(l&T)!==0,a=i||(l&j)!==0||this.skipped_effects.has(s);if(!a&&s.fn!==null){u?s.f^=T:f!==null&&(l&(Me|De|st))!==0?f.b.defer_effect(s):(l&Me)!==0?n.push(s):be(s)&&((l&Y)!==0&&w(this,he).add(s),me(s));var o=s.first;if(o!==null){s=o;continue}}var c=s.parent;for(s=s.next;s===null&&c!==null;)c===f&&(f=null),s=c.next,c=c.parent}},et=function(t){for(var n=0;n<t.length;n+=1)jn(t[n],w(this,he),w(this,ye))},Yt=function(){if(w(this,ne)===0){for(const t of w(this,de))t();w(this,de).clear()}w(this,te)===0&&Q(this,C,Ht).call(this)},Ht=function(){var s;if(Ie.size>1){this.previous.clear();var t=b,n=!0;for(const f of Ie){if(f===this){n=!1;continue}const l=[];for(const[i,a]of this.current){if(f.current.has(i))if(n&&a!==f.current.get(i))f.current.set(i,a);else continue;l.push(i)}if(l.length===0)continue;const u=[...f.current.keys()].filter(i=>!this.current.has(i));if(u.length>0){var r=P;P=[];const i=new Set,a=new Map;for(const o of l)Bt(o,u,i,a);if(P.length>0){p=f,f.apply();for(const o of P)Q(s=f,C,Qe).call(s,o,[],[]);f.deactivate()}P=r}}p=null,b=t}this.committed=!0,Ie.delete(this)};let Ee=$e;function Ln(e){var t=Se;Se=!0;try{for(var n;;){if(In(),P.length===0&&(p==null||p.flush(),P.length===0))return Ge=null,n;Ut()}}finally{Se=t}}function Ut(){var e=se;Je=!0;var t=null;try{var n=0;for(Be(!0);P.length>0;){var r=Ee.ensure();if(n++>1e3){var s,f;qn()}r.process(P),z.clear()}}finally{Je=!1,Be(e),Ge=null}}function qn(){try{Rn()}catch(e){qe(e,Ge)}}let I=null;function mt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(G|j))===0&&be(r)&&(I=new Set,me(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?rn(r):r.fn=null),(I==null?void 0:I.size)>0)){z.clear();for(const s of I){if((s.f&(G|j))!==0)continue;const f=[s];let l=s.parent;for(;l!==null;)I.has(l)&&(I.delete(l),f.push(l)),l=l.parent;for(let u=f.length-1;u>=0;u--){const i=f[u];(i.f&(G|j))===0&&me(i)}}I.clear()}}I=null}}function Bt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?Bt(s,t,n,r):(f&(it|Y))!==0&&(f&D)===0&&Vt(s,t,r)&&(S(s,D),ie(s))}}function Vt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(t.includes(s))return!0;if((s.f&A)!==0&&Vt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function ie(e){for(var t=Ge=e;t.parent!==null;){t=t.parent;var n=t.f;if(Je&&t===y&&(n&Y)!==0&&(n&Pt)===0)return;if((n&(ue|H))!==0){if((n&T)===0)return;t.f^=T}}P.push(t)}function Yn(e,t,n,r){const s=ke()?_t:Bn;if(n.length===0&&e.length===0){r(t.map(s));return}var f=p,l=y,u=Hn();function i(){Promise.all(n.map(a=>Un(a))).then(a=>{u();try{r([...t.map(s),...a])}catch(o){(l.f&G)===0&&qe(o,l)}f==null||f.deactivate(),Ye()}).catch(a=>{qe(a,l)})}e.length>0?Promise.all(e).then(()=>{u();try{return i()}finally{f==null||f.deactivate(),Ye()}}):i()}function Hn(){var e=y,t=_,n=h,r=p;return function(f=!0){ge(e),Z(t),Le(n),f&&(r==null||r.activate())}}function Ye(){ge(null),Z(null),Le(null)}function _t(e){var t=A|D,n=_!==null&&(_.f&A)!==0?_:null;return y!==null&&(y.f|=Ne),{ctx:h,deps:null,effects:null,equals:It,f:t,fn:e,reactions:null,rv:0,v:g,wv:0,parent:n??y,ac:null}}function Un(e,t,n){let r=y;r===null&&bn();var s=r.b,f=void 0,l=dt(g),u=!_,i=new Map;return Jn(()=>{var d;var a=Dt();f=a.promise;try{Promise.resolve(e()).then(a.resolve,a.reject).then(()=>{o===p&&o.committed&&o.deactivate(),Ye()})}catch(E){a.reject(E),Ye()}var o=p;if(u){var c=s.is_rendered();s.update_pending_count(1),o.increment(c),(d=i.get(o))==null||d.reject(_e),i.delete(o),i.set(o,a)}const v=(E,L=void 0)=>{if(o.activate(),L)L!==_e&&(l.f|=K,nt(l,L));else{(l.f&K)!==0&&(l.f^=K),nt(l,E);for(const[J,Ce]of i){if(i.delete(J),J===o)break;Ce.reject(_e)}}u&&(s.update_pending_count(-1),o.decrement(c))};a.promise.then(v,E=>v(null,E||"unknown"))}),Zn(()=>{for(const a of i.values())a.reject(_e)}),new Promise(a=>{function o(c){function v(){c===f?a(l):o(f)}c.then(v,v)}o(f)})}function Vr(e){const t=_t(e);return an(t),t}function Bn(e){const t=_t(e);return t.equals=Mt,t}function $t(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ae(t[n])}}function Vn(e){for(var t=e.parent;t!==null;){if((t.f&A)===0)return(t.f&G)===0?t:null;t=t.parent}return null}function vt(e){var t,n=y;ge(Vn(e));try{e.f&=~Re,$t(e),t=cn(e)}finally{ge(n)}return t}function Gt(e){var t=vt(e);if(!e.equals(t)&&(e.wv=un(),(!(p!=null&&p.is_fork)||e.deps===null)&&(e.v=t,e.deps===null))){S(e,T);return}le||(b!==null?(Jt()||p!=null&&p.is_fork)&&b.set(e,t):ct(e))}let tt=new Set;const z=new Map;let Kt=!1;function dt(e,t){var n={f:0,v:e,reactions:null,equals:It,rv:0,wv:0};return n}function V(e,t){const n=dt(e);return an(n),n}function $r(e,t=!1,n=!0){var s;const r=dt(e);return t||(r.equals=Mt),Pe&&n&&h!==null&&h.l!==null&&((s=h.l).s??(s.s=[])).push(r),r}function $(e,t,n=!1){_!==null&&(!F||(_.f&gt)!==0)&&ke()&&(_.f&(A|Y|it|gt))!==0&&!(x!=null&&x.includes(e))&&Nn();let r=n?Te(t):t;return nt(e,r)}function nt(e,t){if(!e.equals(t)){var n=e.v;le?z.set(e,t):z.set(e,n),e.v=t;var r=Ee.ensure();if(r.capture(e,n),(e.f&A)!==0){const s=e;(e.f&D)!==0&&vt(s),ct(s)}e.wv=un(),zt(e,D),ke()&&y!==null&&(y.f&T)!==0&&(y.f&(H|ue))===0&&(N===null?nr([e]):N.push(e)),!r.is_fork&&tt.size>0&&!Kt&&$n()}return t}function $n(){Kt=!1;var e=se;Be(!0);const t=Array.from(tt);try{for(const n of t)(n.f&T)!==0&&S(n,U),be(n)&&me(n)}finally{Be(e)}tt.clear()}function Gr(e,t=1){var n=ve(e),r=t===1?n++:n--;return $(e,n),r}function Ze(e){$(e,e.v+1)}function zt(e,t){var n=e.reactions;if(n!==null)for(var r=ke(),s=n.length,f=0;f<s;f++){var l=n[f],u=l.f;if(!(!r&&l===y)){var i=(u&D)===0;if(i&&S(l,t),(u&A)!==0){var a=l;b==null||b.delete(a),(u&Re)===0&&(u&k&&(l.f|=Re),zt(a,U))}else i&&((u&Y)!==0&&I!==null&&I.add(l),ie(l))}}}function Te(e){if(typeof e!="object"||e===null||re in e)return e;const t=Ot(e);if(t!==En&&t!==gn)return e;var n=new Map,r=xt(e),s=V(0),f=fe,l=u=>{if(fe===f)return u();var i=_,a=fe;Z(null),Rt(f);var o=u();return Z(i),Rt(a),o};return r&&n.set("length",V(e.length)),new Proxy(e,{defineProperty(u,i,a){(!("value"in a)||a.configurable===!1||a.enumerable===!1||a.writable===!1)&&On();var o=n.get(i);return o===void 0?o=l(()=>{var c=V(a.value);return n.set(i,c),c}):$(o,a.value,!0),!0},deleteProperty(u,i){var a=n.get(i);if(a===void 0){if(i in u){const o=l(()=>V(g));n.set(i,o),Ze(s)}}else $(a,g),Ze(s);return!0},get(u,i,a){var d;if(i===re)return e;var o=n.get(i),c=i in u;if(o===void 0&&(!c||(d=Ae(u,i))!=null&&d.writable)&&(o=l(()=>{var E=Te(c?u[i]:g),L=V(E);return L}),n.set(i,o)),o!==void 0){var v=ve(o);return v===g?void 0:v}return Reflect.get(u,i,a)},getOwnPropertyDescriptor(u,i){var a=Reflect.getOwnPropertyDescriptor(u,i);if(a&&"value"in a){var o=n.get(i);o&&(a.value=ve(o))}else if(a===void 0){var c=n.get(i),v=c==null?void 0:c.v;if(c!==void 0&&v!==g)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return a},has(u,i){var v;if(i===re)return!0;var a=n.get(i),o=a!==void 0&&a.v!==g||Reflect.has(u,i);if(a!==void 0||y!==null&&(!o||(v=Ae(u,i))!=null&&v.writable)){a===void 0&&(a=l(()=>{var d=o?Te(u[i]):g,E=V(d);return E}),n.set(i,a));var c=ve(a);if(c===g)return!1}return o},set(u,i,a,o){var yt;var c=n.get(i),v=i in u;if(r&&i==="length")for(var d=a;d<c.v;d+=1){var E=n.get(d+"");E!==void 0?$(E,g):d in u&&(E=l(()=>V(g)),n.set(d+"",E))}if(c===void 0)(!v||(yt=Ae(u,i))!=null&&yt.writable)&&(c=l(()=>V(void 0)),$(c,Te(a)),n.set(i,c));else{v=c.v!==g;var L=l(()=>Te(a));$(c,L)}var J=Reflect.getOwnPropertyDescriptor(u,i);if(J!=null&&J.set&&J.set.call(o,a),!v){if(r&&typeof i=="string"){var Ce=n.get("length"),Ke=Number(i);Number.isInteger(Ke)&&Ke>=Ce.v&&$(Ce,Ke+1)}Ze(s)}return!0},ownKeys(u){ve(s);var i=Reflect.ownKeys(u).filter(c=>{var v=n.get(c);return v===void 0||v.v!==g});for(var[a,o]of n)o.v!==g&&!(a in u)&&i.push(a);return i},setPrototypeOf(){Dn()}})}function bt(e){try{if(e!==null&&typeof e=="object"&&re in e)return e[re]}catch{}return e}function Kr(e,t){return Object.is(bt(e),bt(t))}var Tt,Gn,Xt,Zt;function zr(){if(Tt===void 0){Tt=window,Gn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xt=Ae(t,"firstChild").get,Zt=Ae(t,"nextSibling").get,Et(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Et(n)&&(n.__t=void 0)}}function He(e=""){return document.createTextNode(e)}function Ue(e){return Xt.call(e)}function W(e){return Zt.call(e)}function Xr(e,t){if(!X)return Ue(e);var n=Ue(m);if(n===null)n=m.appendChild(He());else if(t&&n.nodeType!==at){var r=He();return n==null||n.before(r),we(r),r}return we(n),n}function Zr(e,t=!1){if(!X){var n=Ue(e);return n instanceof Comment&&n.data===""?W(n):n}if(t&&(m==null?void 0:m.nodeType)!==at){var r=He();return m==null||m.before(r),we(r),r}return m}function Wr(e,t=1,n=!1){let r=X?m:e;for(var s;t--;)s=r,r=W(r);if(!X)return r;if(n&&(r==null?void 0:r.nodeType)!==at){var f=He();return r===null?s==null||s.after(f):r.before(f),we(f),f}return we(r),r}function Kn(e){e.textContent=""}function Jr(){return!1}function Qr(e,t){if(t){const n=document.body;e.autofocus=!0,Lt(()=>{document.activeElement===n&&e.focus()})}}function es(e){X&&Ue(e)!==null&&Kn(e)}let At=!1;function zn(){At||(At=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function pt(e){var t=_,n=y;Z(null),ge(null);try{return e()}finally{Z(t),ge(n)}}function ts(e,t,n,r=n){e.addEventListener(t,()=>pt(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),zn()}function Wt(e){y===null&&(_===null&&Sn(),An()),le&&Tn()}function Xn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function M(e,t,n){var r=y;r!==null&&(r.f&j)!==0&&(e|=j);var s={ctx:h,deps:null,nodes:null,f:e|D|k,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{me(s),s.f|=ft}catch(u){throw ae(s),u}else t!==null&&ie(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Ne)===0&&(f=f.first,(e&Y)!==0&&(e&je)!==0&&f!==null&&(f.f|=je)),f!==null&&(f.parent=r,r!==null&&Xn(f,r),_!==null&&(_.f&A)!==0&&(e&ue)===0)){var l=_;(l.effects??(l.effects=[])).push(f)}return s}function Jt(){return _!==null&&!F}function Zn(e){const t=M(De,null,!1);return S(t,T),t.teardown=e,t}function Wn(e){Wt();var t=y.f,n=!_&&(t&H)!==0&&(t&ft)===0;if(n){var r=h;(r.e??(r.e=[])).push(e)}else return Qt(e)}function Qt(e){return M(Me|kt,e,!1)}function ns(e){return Wt(),M(De|kt,e,!0)}function rs(e){Ee.ensure();const t=M(ue|Ne,e,!0);return(n={})=>new Promise(r=>{n.outro?tr(t,()=>{ae(t),r(void 0)}):(ae(t),r(void 0))})}function ss(e){return M(Me,e,!1)}function fs(e,t){var n=h,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=en(()=>{e(),!r.ran&&(r.ran=!0,ht(t))})}function is(){var e=h;en(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&T)!==0&&n.deps!==null&&S(n,U),be(n)&&me(n),t.ran=!1}})}function Jn(e){return M(it|Ne,e,!0)}function en(e,t=0){return M(De|t,e,!0)}function as(e,t=[],n=[],r=[]){Yn(r,t,n,s=>{M(De,()=>e(...s.map(ve)),!0)})}function ls(e,t=0){var n=M(Y|t,e,!0);return n}function us(e,t=0){var n=M(st|t,e,!0);return n}function os(e){return M(H|Ne,e,!0)}function tn(e){var t=e.teardown;if(t!==null){const n=le,r=_;St(!0),Z(null);try{t.call(null)}finally{St(n),Z(r)}}}function nn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&pt(()=>{s.abort(_e)});var r=n.next;(n.f&ue)!==0?n.parent=null:ae(n,t),n=r}}function Qn(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&H)===0&&ae(t),t=n}}function ae(e,t=!0){var n=!1;(t||(e.f&Pt)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(er(e.nodes.start,e.nodes.end),n=!0),nn(e,t&&!n),Ve(e,0),S(e,G);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();tn(e);var s=e.parent;s!==null&&s.first!==null&&rn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function er(e,t){for(;e!==null;){var n=e===t?null:W(e);e.remove(),e=n}}function rn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function tr(e,t,n=!0){var r=[];sn(e,r,!0);var s=()=>{n&&ae(e),t&&t()},f=r.length;if(f>0){var l=()=>--f||s();for(var u of r)u.out(l)}else s()}function sn(e,t,n){if((e.f&j)===0){e.f^=j;var r=e.nodes&&e.nodes.t;if(r!==null)for(const u of r)(u.is_global||n)&&t.push(u);for(var s=e.first;s!==null;){var f=s.next,l=(s.f&je)!==0||(s.f&H)!==0&&(e.f&Y)!==0;sn(s,t,l?n:!1),s=f}}}function cs(e){fn(e,!0)}function fn(e,t){if((e.f&j)!==0){e.f^=j,(e.f&T)===0&&(S(e,D),ie(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&je)!==0||(n.f&H)!==0;fn(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const l of f)(l.is_global||t)&&l.in()}}function _s(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:W(n);t.append(n),n=s}}let se=!1;function Be(e){se=e}let le=!1;function St(e){le=e}let _=null,F=!1;function Z(e){_=e}let y=null;function ge(e){y=e}let x=null;function an(e){_!==null&&(x===null?x=[e]:x.push(e))}let R=null,O=0,N=null;function nr(e){N=e}let ln=1,xe=0,fe=xe;function Rt(e){fe=e}function un(){return++ln}function be(e){var t=e.f;if((t&D)!==0)return!0;if(t&A&&(e.f&=-32769),(t&U)!==0){for(var n=e.deps,r=n.length,s=0;s<r;s++){var f=n[s];if(be(f)&&Gt(f),f.wv>e.wv)return!0}(t&k)!==0&&b===null&&S(e,T)}return!1}function on(e,t,n=!0){var r=e.reactions;if(r!==null&&!(x!=null&&x.includes(e)))for(var s=0;s<r.length;s++){var f=r[s];(f.f&A)!==0?on(f,t,!1):t===f&&(n?S(f,D):(f.f&T)!==0&&S(f,U),ie(f))}}function cn(e){var E;var t=R,n=O,r=N,s=_,f=x,l=h,u=F,i=fe,a=e.f;R=null,O=0,N=null,_=(a&(H|ue))===0?e:null,x=null,Le(e.ctx),F=!1,fe=++xe,e.ac!==null&&(pt(()=>{e.ac.abort(_e)}),e.ac=null);try{e.f|=We;var o=e.fn,c=o(),v=e.deps;if(R!==null){var d;if(Ve(e,O),v!==null&&O>0)for(v.length=O+R.length,d=0;d<R.length;d++)v[O+d]=R[d];else e.deps=v=R;if(Jt()&&(e.f&k)!==0)for(d=O;d<v.length;d++)((E=v[d]).reactions??(E.reactions=[])).push(e)}else v!==null&&O<v.length&&(Ve(e,O),v.length=O);if(ke()&&N!==null&&!F&&v!==null&&(e.f&(A|U|D))===0)for(d=0;d<N.length;d++)on(N[d],e);return s!==null&&s!==e&&(xe++,N!==null&&(r===null?r=N:r.push(...N))),(e.f&K)!==0&&(e.f^=K),c}catch(L){return Fn(L)}finally{e.f^=We,R=t,O=n,N=r,_=s,x=f,Le(l),F=u,fe=i}}function rr(e,t){let n=t.reactions;if(n!==null){var r=yn.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(t.f&A)!==0&&(R===null||!R.includes(t))){var f=t;(f.f&k)!==0&&(f.f^=k,f.f&=-32769),ct(f),$t(f),Ve(f,0)}}function Ve(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)rr(e,n[r])}function me(e){var t=e.f;if((t&G)===0){S(e,T);var n=y,r=se;y=e,se=!0;try{(t&(Y|st))!==0?Qn(e):nn(e),tn(e);var s=cn(e);e.teardown=typeof s=="function"?s:null,e.wv=ln;var f}finally{se=r,y=n}}}async function vs(){await Promise.resolve(),Ln()}function ds(){return Ee.ensure().settled()}function ve(e){var t=e.f,n=(t&A)!==0;if(_!==null&&!F){var r=y!==null&&(y.f&G)!==0;if(!r&&!(x!=null&&x.includes(e))){var s=_.deps;if((_.f&We)!==0)e.rv<xe&&(e.rv=xe,R===null&&s!==null&&s[O]===e?O++:R===null?R=[e]:R.includes(e)||R.push(e));else{(_.deps??(_.deps=[])).push(e);var f=e.reactions;f===null?e.reactions=[_]:f.includes(_)||f.push(_)}}}if(le&&z.has(e))return z.get(e);if(n){var l=e;if(le){var u=l.v;return((l.f&T)===0&&l.reactions!==null||vn(l))&&(u=vt(l)),z.set(l,u),u}var i=(l.f&k)===0&&!F&&_!==null&&(se||(_.f&k)!==0),a=l.deps===null;be(l)&&(i&&(l.f|=k),Gt(l)),i&&!a&&_n(l)}if(b!=null&&b.has(e))return b.get(e);if((e.f&K)!==0)throw e.v;return e.v}function _n(e){if(e.deps!==null){e.f|=k;for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&A)!==0&&(t.f&k)===0&&_n(t)}}function vn(e){if(e.v===g)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(z.has(t)||(t.f&A)!==0&&vn(t))return!0;return!1}function ht(e){var t=F;try{return F=!0,e()}finally{F=t}}function ps(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(re in e)rt(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&re in n&&rt(n)}}}function rt(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{rt(e[r],t)}catch{}const n=Ot(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=wn(n);for(let s in r){const f=r[s].get;if(f)try{f.call(e)}catch{}}}}}function sr(e,t,n){if(e==null)return t(void 0),Fe;const r=ht(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const ce=[];function hs(e,t=Fe){let n=null;const r=new Set;function s(u){if(Ft(e,u)&&(e=u,n)){const i=!ce.length;for(const a of r)a[1](),ce.push(a,e);if(i){for(let a=0;a<ce.length;a+=2)ce[a][0](ce[a+1]);ce.length=0}}}function f(u){s(u(e))}function l(u,i=Fe){const a=[u,i];return r.add(a),r.size===1&&(n=t(s,f)||Fe),u(e),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:s,update:f,subscribe:l}}function ys(e){let t;return sr(e,n=>t=n)(),t}function ws(e){h===null&&lt(),Pe&&h.l!==null?dn(h).m.push(e):Wn(()=>{const t=ht(e);if(typeof t=="function")return t})}function fr(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Es(){const e=h;return e===null&&lt(),(t,n,r)=>{var f;const s=(f=e.s.$$events)==null?void 0:f[t];if(s){const l=xt(s)?s.slice():[s],u=fr(t,n,r);for(const i of l)i.call(e.x,u);return!u.defaultPrevented}return!0}}function gs(e){h===null&&lt(),h.l===null&&xn(),dn(h).a.push(e)}function dn(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}export{sr as $,ts as A,p as B,vs as C,X as D,en as E,Xe as F,Kr as G,Zn as H,Lt as I,cs as J,ae as K,tr as L,He as M,os as N,m as O,_s as P,Jr as Q,ls as R,Mr as S,je as T,Yr as U,kn as V,qr as W,we as X,Fr as Y,lr as Z,$r as _,Br as a,j as a$,ys as a0,y as a1,dt as a2,Ae as a3,yr as a4,Rr as a5,G as a6,Gr as a7,ge as a8,Pe as a9,qe as aA,wr as aB,Ne as aC,Nt as aD,Ir as aE,pt as aF,Ue as aG,Gn as aH,Dr as aI,Nr as aJ,ft as aK,at as aL,zr as aM,Pn as aN,W as aO,ut as aP,hr as aQ,Kn as aR,ar as aS,rs as aT,Cn as aU,ot as aV,_r as aW,xt as aX,Er as aY,Tr as aZ,gr as a_,Sr as aa,xr as ab,Ar as ac,Or as ad,le as ae,re as af,vr as ag,ur as ah,ss as ai,Ln as aj,ws as ak,cr as al,Jt as am,Ze as an,Ct as ao,Ee as ap,jn as aq,Z as ar,Le as as,Fn as at,_ as au,S as av,D as aw,ie as ax,U as ay,nt as az,V as b,mr as b0,br as b1,er as b2,Pt as b3,us as b4,Cr as b5,Yn as b6,kr as b7,Qr as b8,g as b9,zn as ba,Pr as bb,Ot as bc,dr as bd,wn as be,Es as bf,gs as bg,fs as bh,is as bi,ds as bj,Xr as c,$ as d,ht as e,Zr as f,ve as g,Te as h,Bn as i,Fe as j,h as k,ns as l,Wn as m,Lr as n,or as o,Ur as p,mn as q,jr as r,Wr as s,as as t,Vr as u,ps as v,hs as w,_t as x,Hr as y,es as z};
@@ -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,ak as Xt,b as T,g as I,d as O,C as ht,bj as Te}from"./BymJmDWJ.js";import{a as Ie,b as U}from"./BDxEtWDn.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 Ce(t){return t.split("%25").map(decodeURI).join("%25")}function Pe(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,v,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!v,chained:v?l===1&&o[0]==="":!1}),v?"([^]*?)":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:v}=Be(i),f={id:i,exec:h=>{const _=u.exec(h);if(_)return Fe(_,v,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="1793631945049",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,P,Ot,b;const mt=[],_t=[];let y=null;function Ct(){var t;(t=y==null?void 0:y.fork)==null||t.then(e=>e==null?void 0:e.discard()),y=null}const dt=new Map,we=new Set,nn=new Set,z=new Set;let m={branch:[],error:null,url:null},ye=!1,wt=!1,ne=!0,Z=!1,W=!1,ve=!1,Ft=!1,be,S,A,V;const yt=new Set,ae=new Map;async function Ln(t,e,n){var s,o,i,c,l;(s=globalThis.__sveltekit_y93smw)!=null&&s.data&&globalThis.__sveltekit_y93smw.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),P=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?vn(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&&Ct(),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!==(y==null?void 0:y.id)){Ct();const e={};yt.add(e),y={id:t.id,token:e,promise:Re({...t,preload:e}).then(n=>(yt.delete(e),n.type==="loaded"&&n.state.error&&Ct(),n)),fork:null}}return y.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 vt({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((y==null?void 0:y.id)===t)return yt.delete(y.token),y.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,v=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,v,($=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 C={};for(let B=0;B<p;B+=1)Object.assign(C,(ut=await h[B])==null?void 0:ut.data);return C},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(yt.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 $?vt({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 vt({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 vt({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:Pe(s),url:t}}}}function hn(t){return Ce(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 v=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=v);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&&(y==null?void 0:y.id)===f.id?y.fork:null;y=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()),ve=!0}else await Ee(p,Ot,!1);const{activeElement:$}=document;await x,await ht(),await ht();let C=n?n.scroll:a?kt():null;if(ne){const E=e.hash&&document.getElementById(Le(e));if(C)scrollTo(C.x,C.y);else if(E){E.scrollIntoView();const{top:K,left:j}=E.getBoundingClientRect();C={x:pageXOffset+j,y:pageYOffset+K}}else scrollTo(0,0)}const ut=document.activeElement!==$&&document.activeElement!==document.body;!r&&!ut&&yn(e,C),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&&!ye?await Yt({status:r,error:n,url:t,route:e}):await Q(t,a)}function pn(){let t,e,n;P.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)}P.addEventListener("mousedown",r),P.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,P),d=l===e&&c>=n;if(!l||d)return;const{url:u,external:v,download:f}=Tt(l,U,b.hash);if(v||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 P.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(),P.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],P);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("#"),v=d===xt(location);if(s||c.reload&&(!v||!u)){xe({url:a,type:"link",event:n})?Z=!0:n.preventDefault();return}if(u!==void 0&&v){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})}),P.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(!Pt){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&&(ve||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}){ye=!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,v=!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=vt({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="",v=!1}u.props.page&&(u.props.page.state={}),await Ee(u,t,v)}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 Pt=!1;function yn(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;Pt=!0,location.replace(`#${r}`),b.hash&&location.replace(t.hash),history.replaceState(i,"",t.hash),scrollTo(s,o),Pt=!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 vn(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};
@@ -0,0 +1 @@
1
+ import{k as g,l as d,m as c,e as m,o as b,q as i,g as p,v,x as k,y}from"./BymJmDWJ.js";function x(n=!1){const s=g,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(n){let o=0,t={};const _=k(()=>{let l=!1;const r=s.s;for(const a in r)r[a]!==t[a]&&(t[a]=r[a],l=!0);return l&&o++,o});f=()=>p(_)}e.b.length&&d(()=>{u(s,f),i(e.b)}),c(()=>{const o=m(()=>e.m.map(b));return()=>{for(const t of o)typeof t=="function"&&t()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}y();export{x as i};
@@ -1 +1 @@
1
- import{f as l,a as p,s as h}from"./DqdrLdzV.js";import{c as t,F as x,r as a,s as b,t as g}from"./Ciq9INsC.js";import{b as c}from"./P3PHXZz3.js";var u=l('<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8"><!></div>');function y(e,o){var r=u(),s=t(r);c(s,()=>o.children??x),a(r),p(e,r)}var _=l('<div class="bg-white shadow-sm border border-gray-200 rounded-xl overflow-hidden"><div class="bg-gradient-to-r from-blue-50 to-indigo-50 px-8 py-6 border-b border-gray-200"><h1 class="text-3xl font-bold text-gray-900 tracking-tight"> </h1></div> <div class="px-8 py-6"><!></div></div>');function A(e,o){y(e,{children:(r,s)=>{var i=_(),d=t(i),v=t(d),m=t(v,!0);a(v),a(d);var n=b(d,2),f=t(n);c(f,()=>o.children??x),a(n),a(i),g(()=>h(m,o.title)),p(r,i)}})}export{A as I};
1
+ import{f as l,a as p,s as h}from"./CgjHsrhs.js";import{c as t,j as x,r as a,s as g,t as b}from"./BymJmDWJ.js";import{n as c}from"./BKtlB-ZE.js";var u=l('<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8"><!></div>');function y(e,o){var r=u(),s=t(r);c(s,()=>o.children??x),a(r),p(e,r)}var _=l('<div class="bg-white shadow-sm border border-gray-200 rounded-xl overflow-hidden"><div class="bg-gradient-to-r from-blue-50 to-indigo-50 px-8 py-6 border-b border-gray-200"><h1 class="text-3xl font-bold text-gray-900 tracking-tight"> </h1></div> <div class="px-8 py-6"><!></div></div>');function k(e,o){y(e,{children:(r,s)=>{var i=_(),d=t(i),n=t(d),m=t(n,!0);a(n),a(d);var v=g(d,2),f=t(v);c(f,()=>o.children??x),a(v),a(i),b(()=>h(m,o.title)),p(r,i)}})}export{k as I};
@@ -0,0 +1,2 @@
1
+ var Me=Object.defineProperty;var pe=t=>{throw TypeError(t)};var Oe=(t,e,n)=>e in t?Me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ee=(t,e,n)=>Oe(t,typeof e!="symbol"?e+"":e,n),te=(t,e,n)=>e.has(t)||pe("Cannot "+n);var r=(t,e,n)=>(te(t,e,"read from private field"),n?n.call(t):e.get(t)),f=(t,e,n)=>e.has(t)?pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),a=(t,e,n,s)=>(te(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),p=(t,e,n)=>(te(t,e,"access private method"),n);import{am as Ie,g as we,a2 as Ne,E as Ce,e as Fe,an as ve,I as de,O as g,D as m,a1 as F,R as Pe,S as Re,ao as he,V as Ve,N as M,ap as z,L as ne,M as q,aq as Be,a8 as J,ar as B,as as ge,at as Ye,au as ie,k as Ae,P as He,av as ye,aw as xe,ax as Ee,ay as We,az as qe,K as re,X as U,n as Ue,W as je,aA as me,aB as Ge,T as ze,aC as Ke,aD as Xe,aE as $e,Z as Je,aF as Qe,H as Ze,aG as se,aH as et,aI as tt,aJ as nt,aK as rt,aL as it,aM as ae,aN as st,aO as at,aP as oe,Y as K,aQ as ot,aR as ut,aS as lt,aT as ft,p as ct,aU as dt,aV as ht,a as _t}from"./BymJmDWJ.js";function pt(t){let e=0,n=Ne(0),s;return()=>{Ie()&&(we(n),Ce(()=>(e===0&&(s=Fe(()=>t(()=>ve(n)))),e+=1,()=>{de(()=>{e-=1,e===0&&(s==null||s(),s=void 0,ve(n))})})))}}var vt=ze|Ke|Xe;function gt(t,e,n){new yt(t,e,n)}var v,j,b,O,T,E,h,w,A,k,I,S,C,Y,H,D,Q,l,Se,ke,ue,X,$,le;class yt{constructor(e,n,s){f(this,l);ee(this,"parent");ee(this,"is_pending",!1);f(this,v);f(this,j,m?g:null);f(this,b);f(this,O);f(this,T);f(this,E,null);f(this,h,null);f(this,w,null);f(this,A,null);f(this,k,null);f(this,I,0);f(this,S,0);f(this,C,!1);f(this,Y,new Set);f(this,H,new Set);f(this,D,null);f(this,Q,pt(()=>(a(this,D,Ne(r(this,I))),()=>{a(this,D,null)})));a(this,v,e),a(this,b,n),a(this,O,s),this.parent=F.b,this.is_pending=!!r(this,b).pending,a(this,T,Pe(()=>{if(F.b=this,m){const i=r(this,j);Re(),i.nodeType===he&&i.data===Ve?p(this,l,ke).call(this):(p(this,l,Se).call(this),r(this,S)===0&&(this.is_pending=!1))}else{var o=p(this,l,ue).call(this);try{a(this,E,M(()=>s(o)))}catch(i){this.error(i)}r(this,S)>0?p(this,l,$).call(this):this.is_pending=!1}return()=>{var i;(i=r(this,k))==null||i.remove()}},vt)),m&&a(this,v,g)}defer_effect(e){Be(e,r(this,Y),r(this,H))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!r(this,b).pending}update_pending_count(e){p(this,l,le).call(this,e),a(this,I,r(this,I)+e),r(this,D)&&qe(r(this,D),r(this,I))}get_effect_pending(){return r(this,Q).call(this),we(r(this,D))}error(e){var n=r(this,b).onerror;let s=r(this,b).failed;if(r(this,C)||!n&&!s)throw e;r(this,E)&&(re(r(this,E)),a(this,E,null)),r(this,h)&&(re(r(this,h)),a(this,h,null)),r(this,w)&&(re(r(this,w)),a(this,w,null)),m&&(U(r(this,j)),Ue(),U(je()));var o=!1,i=!1;const u=()=>{if(o){$e();return}o=!0,i&&Ge(),z.ensure(),a(this,I,0),r(this,w)!==null&&ne(r(this,w),()=>{a(this,w,null)}),this.is_pending=this.has_pending_snippet(),a(this,E,p(this,l,X).call(this,()=>(a(this,C,!1),M(()=>r(this,O).call(this,r(this,v)))))),r(this,S)>0?p(this,l,$).call(this):this.is_pending=!1};var y=ie;try{B(null),i=!0,n==null||n(e,u),i=!1}catch(_){me(_,r(this,T)&&r(this,T).parent)}finally{B(y)}s&&de(()=>{a(this,w,p(this,l,X).call(this,()=>{z.ensure(),a(this,C,!0);try{return M(()=>{s(r(this,v),()=>e,()=>u)})}catch(_){return me(_,r(this,T).parent),null}finally{a(this,C,!1)}}))})}}v=new WeakMap,j=new WeakMap,b=new WeakMap,O=new WeakMap,T=new WeakMap,E=new WeakMap,h=new WeakMap,w=new WeakMap,A=new WeakMap,k=new WeakMap,I=new WeakMap,S=new WeakMap,C=new WeakMap,Y=new WeakMap,H=new WeakMap,D=new WeakMap,Q=new WeakMap,l=new WeakSet,Se=function(){try{a(this,E,M(()=>r(this,O).call(this,r(this,v))))}catch(e){this.error(e)}},ke=function(){const e=r(this,b).pending;e&&(a(this,h,M(()=>e(r(this,v)))),z.enqueue(()=>{var n=p(this,l,ue).call(this);a(this,E,p(this,l,X).call(this,()=>(z.ensure(),M(()=>r(this,O).call(this,n))))),r(this,S)>0?p(this,l,$).call(this):(ne(r(this,h),()=>{a(this,h,null)}),this.is_pending=!1)}))},ue=function(){var e=r(this,v);return this.is_pending&&(a(this,k,q()),r(this,v).before(r(this,k)),e=r(this,k)),e},X=function(e){var n=F,s=ie,o=Ae;J(r(this,T)),B(r(this,T)),ge(r(this,T).ctx);try{return e()}catch(i){return Ye(i),null}finally{J(n),B(s),ge(o)}},$=function(){const e=r(this,b).pending;r(this,E)!==null&&(a(this,A,document.createDocumentFragment()),r(this,A).append(r(this,k)),He(r(this,E),r(this,A))),r(this,h)===null&&a(this,h,M(()=>e(r(this,v))))},le=function(e){var n;if(!this.has_pending_snippet()){this.parent&&p(n=this.parent,l,le).call(n,e);return}if(a(this,S,r(this,S)+e),r(this,S)===0){this.is_pending=!1;for(const s of r(this,Y))ye(s,xe),Ee(s);for(const s of r(this,H))ye(s,We),Ee(s);r(this,Y).clear(),r(this,H).clear(),r(this,h)&&ne(r(this,h),()=>{a(this,h,null)}),r(this,A)&&(r(this,v).before(r(this,A)),a(this,A,null))}};function Dt(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Et=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Lt(t){return Et.includes(t)}const mt={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Mt(t){return t=t.toLowerCase(),mt[t]??t}const bt=["touchstart","touchmove"];function Tt(t){return bt.includes(t)}const De=new Set,fe=new Set;function Ot(t){if(!m)return;t.removeAttribute("onload"),t.removeAttribute("onerror");const e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function wt(t,e,n,s={}){function o(i){if(s.capture||W.call(e,i),!i.cancelBubble)return Qe(()=>n==null?void 0:n.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?de(()=>{e.addEventListener(t,o,s)}):e.addEventListener(t,o,s),o}function It(t,e,n,s,o){var i={capture:s,passive:o},u=wt(t,e,n,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ze(()=>{e.removeEventListener(t,u,i)})}function Ct(t){for(var e=0;e<t.length;e++)De.add(t[e]);for(var n of fe)n(t)}let be=null;function W(t){var _e;var e=this,n=e.ownerDocument,s=t.type,o=((_e=t.composedPath)==null?void 0:_e.call(t))||[],i=o[0]||t.target;be=t;var u=0,y=be===t&&t.__root;if(y){var _=o.indexOf(y);if(_!==-1&&(e===document||e===window)){t.__root=e;return}var P=o.indexOf(e);if(P===-1)return;_<=P&&(u=_)}if(i=o[u]||t.target,i!==e){Je(t,"currentTarget",{configurable:!0,get(){return i||n}});var Z=ie,N=F;B(null),J(null);try{for(var c,d=[];i!==null;){var R=i.assignedSlot||i.parentNode||i.host||null;try{var x=i["__"+s];x!=null&&(!i.disabled||t.target===i)&&x.call(i,t)}catch(G){c?d.push(G):c=G}if(t.cancelBubble||R===e||R===null)break;i=R}if(c){for(let G of d)queueMicrotask(()=>{throw G});throw c}}finally{t.__root=e,delete t.currentTarget,B(Z),J(N)}}}function Nt(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function L(t,e){var n=F;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function Ft(t,e){var n=(e&tt)!==0,s=(e&nt)!==0,o,i=!t.startsWith("<!>");return()=>{if(m)return L(g,null),g;o===void 0&&(o=Nt(i?t:"<!>"+t),n||(o=se(o)));var u=s||et?document.importNode(o,!0):o.cloneNode(!0);if(n){var y=se(u),_=u.lastChild;L(y,_)}else L(u,u);return u}}function Pt(t=""){if(!m){var e=q(t+"");return L(e,e),e}var n=g;return n.nodeType!==it&&(n.before(n=q()),U(n)),L(n,n),n}function Vt(){if(m)return L(g,null),g;var t=document.createDocumentFragment(),e=document.createComment(""),n=q();return t.append(e,n),L(e,n),t}function Bt(t,e){if(m){var n=F;((n.f&rt)===0||n.nodes.end===null)&&(n.nodes.end=g),Re();return}t!==null&&t.before(e)}function Yt(t,e){var n=e==null?"":typeof e=="object"?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function Rt(t,e){return Le(t,e)}function Ht(t,e){ae(),e.intro=e.intro??!1;const n=e.target,s=m,o=g;try{for(var i=se(n);i&&(i.nodeType!==he||i.data!==st);)i=at(i);if(!i)throw oe;K(!0),U(i);const u=Le(t,{...e,anchor:i});return K(!1),u}catch(u){if(u instanceof Error&&u.message.split(`
2
+ `).some(y=>y.startsWith("https://svelte.dev/e/")))throw u;return u!==oe&&console.warn("Failed to hydrate: ",u),e.recover===!1&&ot(),ae(),ut(n),K(!1),Rt(t,e)}finally{K(s),U(o)}}const V=new Map;function Le(t,{target:e,anchor:n,props:s={},events:o,context:i,intro:u=!0}){ae();var y=new Set,_=N=>{for(var c=0;c<N.length;c++){var d=N[c];if(!y.has(d)){y.add(d);var R=Tt(d);e.addEventListener(d,W,{passive:R});var x=V.get(d);x===void 0?(document.addEventListener(d,W,{passive:R}),V.set(d,1)):V.set(d,x+1)}}};_(lt(De)),fe.add(_);var P=void 0,Z=ft(()=>{var N=n??e.appendChild(q());return gt(N,{pending:()=>{}},c=>{if(i){ct({});var d=Ae;d.c=i}if(o&&(s.$$events=o),m&&L(c,null),P=t(c,s)||{},m&&(F.nodes.end=g,g===null||g.nodeType!==he||g.data!==dt))throw ht(),oe;i&&_t()}),()=>{var R;for(var c of y){e.removeEventListener(c,W);var d=V.get(c);--d===0?(document.removeEventListener(c,W),V.delete(c)):V.set(c,d)}fe.delete(_),N!==n&&((R=N.parentNode)==null||R.removeChild(N))}});return ce.set(P,Z),P}let ce=new WeakMap;function xt(t,e){const n=ce.get(t);return n?(ce.delete(t),n(e)):Promise.resolve()}const At="5";var Te;typeof window<"u"&&((Te=window.__svelte??(window.__svelte={})).v??(Te.v=new Set)).add(At);export{Bt as a,L as b,Vt as c,Ct as d,Nt as e,Ft as f,wt as g,Ht as h,Dt as i,Lt as j,It as k,Rt as m,Mt as n,Ot as r,Yt as s,Pt as t,xt as u};
@@ -0,0 +1 @@
1
+ import{A as j,B as _,C as W,D,e as H,E as I,F as J,G as K,H as Q,I as M,c as f,g,u as R,r as u,t as C,f as E,j as L,s as y}from"./BymJmDWJ.js";import{d as T,f as m,a as h,c as U,s as P}from"./CgjHsrhs.js";import{j as X,g as Y,o as Z,n as V,L as $}from"./BKtlB-ZE.js";import{i as q,b as p,s as ee}from"./FpM_-oX5.js";import{I as ae}from"./CbO4bo1j.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=A(e)?B(o):o,a(o),_!==null&&c.add(_),await W(),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||H(s)==null&&e.value)&&(a(A(e)?B(e.value):e.value),_!==null&&c.add(_)),I(()=>{var l=s();if(e===document.activeElement){var o=J??_;if(c.has(o))return}A(e)&&l===B(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=z(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=z(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||H(s)==null)&&a(e.checked),I(()=>{var c=s();e.checked=!!c})}function z(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 A(e){var s=e.type;return s==="number"||s==="range"}function B(e){return e===""?null:+e}var re=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>'),te=m("<button><!></button>");function _e(e,s){const a=()=>p(Z,"$connected",c),[c,l]=ee(),o=R(()=>a()?!!s.disabled:!0);var r=te();r.__click=function(...d){var i;(i=s.buttonAction)==null||i.apply(this,d)};var v=f(r);{var n=d=>{var i=re();h(d,i)},t=d=>{var i=U(),b=E(i);V(b,()=>s.children??L),h(d,i)};q(v,d=>{!a()&&g(o)?d(n):d(t,!1)})}u(r),C(()=>{X(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),Y(r,"title",a()?"":"Please connect to Sockethub first")}),h(e,r),l()}T(["click"]);var se=m('<p class="text-lg text-gray-600 leading-relaxed"> </p>'),le=m("<title> </title> <!>",1),oe=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 me(e,s){var a=oe(),c=E(a);ae(c,{get title(){return s.title},children:(d,i)=>{var b=le(),k=E(b),F=f(k,!0);u(k);var G=y(k,2);{var N=x=>{var w=se(),O=f(w,!0);u(w),C(()=>P(O,s.description)),h(x,w)};q(G,x=>{s.description&&x(N)})}C(()=>P(F,s.title)),h(d,b)}});var l=y(c,2),o=f(l),r=f(o),v=f(r);V(v,()=>s.children??L),u(r),u(o),u(l);var n=y(l,2),t=f(n);$(t,{}),u(n),h(e,a)}export{me as B,_e as S,ue as a,fe as b,he as c};
@@ -0,0 +1 @@
1
+ import{f as d,a,c as P,d as te}from"./CgjHsrhs.js";import{p as T,s as j,c as x,r as w,t as se,a as L,g as n,u as H,e as C,f as I,m as ae,b as E,n as U,d as S}from"./BymJmDWJ.js";import{r as X,j as re,p as oe,d as ne,a as Y,c as G,f as ie,s as W}from"./BKtlB-ZE.js";import{b as K,S as Q}from"./Cko76dBZ.js";import{p as F,s as V,c as D,b as O,i as J}from"./FpM_-oX5.js";import{T as ce}from"./BFJazgM-.js";var le=d('<div class="pb-4"><label for="actor-id-input" class="pr-3">Actor ID</label> <input id="actor-id-input" type="text"/></div>');function Me(b,e){T(e,!0);let t=F(e,"value",15),p=F(e,"class",3,"bg-white border border-solid border-gray-300 rounded");var v=le(),s=j(x(v),2);X(s),w(v),se(()=>re(s,1,oe(p()))),K(s,t),a(b,v),L()}function Ae(b,e){T(e,!0);const t=()=>O(e.sockethubState,"$sockethubState",p),[p,v]=V();async function s(r){await ne();const u={"@context":await G(e.context),type:"credentials",actor:Y(e.actor),object:JSON.parse(r)};return new Promise((k,g)=>{ie.socket.emit("credentials",u,m=>{if(m!=null&&m.error){g(new Error(m.error));return}D(e.sockethubState,C(t).credentialsSet=!0,C(t)),k()})})}{let r=H(()=>!t().actorSet||t().credentialsSet||!1);ce(b,{title:"Credentials",get obj(){return e.credentials},buttonText:"Set Credentials",submitData:s,get disabled(){return n(r)}})}L(),v()}var de=d('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span>Connecting...</span></div>'),ve=d('<div class="flex items-center space-x-2"><svg class="h-4 w-4 text-green-500" 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="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span>Connected</span></div>'),ue=d('<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="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"></path></svg> <span>Connect</span></div>'),me=d('<div class="w-full flex justify-end"><!></div>');function Re(b,e){T(e,!0);const t=()=>O(e.sockethubState,"$sockethubState",p),[p,v]=V();let s=F(e,"disabled",3,!1),r=H(()=>s()||!t().credentialsSet||t().connected||e.connecting);var u=me(),k=x(u);Q(k,{get disabled(){return n(r)},buttonAction:async()=>{await e.onConnect()},children:(g,m)=>{var y=P(),_=I(y);{var M=o=>{var c=de();a(o,c)},i=o=>{var c=P(),z=I(c);{var A=f=>{var l=ve();a(f,l)},B=f=>{var l=ue();a(f,l)};J(z,f=>{t().connected?f(A):f(B,!1)},!0)}a(o,c)};J(_,o=>{e.connecting?o(M):o(i,!1)})}a(g,y)}}),w(u),a(b,u),L(),v()}var ge=d('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span>Joining...</span></div>'),fe=d('<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="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span>Joined</span></div>'),he=d('<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 4.5v15m7.5-7.5h-15"></path></svg> <span>Join Room</span></div>'),xe=d('<div class="bg-gradient-to-r from-indigo-50 to-purple-50 border border-indigo-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-indigo-900 mb-4 flex items-center"><span class="mr-2">🏠</span> Join Chat Room</h4> <div class="space-y-4"><div class="w-full space-y-2"><label for="room" class="block text-sm font-semibold text-gray-700">Room/Channel</label> <input id="room" class="w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-colors duration-200 text-gray-900 placeholder-gray-500" placeholder="#sockethub or kosmos-random@kosmos.chat"/> <p class="text-gray-500 text-xs">💡 IRC: enter a channel with its # (e.g. #sockethub); XMPP: room@server.com</p></div> <div class="flex justify-end"><!></div></div></div>');function ze(b,e){T(e,!0);const t=()=>O(e.sockethubState,"$sockethubState",p),[p,v]=V();let s=F(e,"room",15),r=E(!1),u=E("");ae(()=>{s()!==n(u)&&D(e.sockethubState,C(t).joined=!1,C(t))});async function k(){if(e.context==="irc"&&!e.server){console.error("IRC room joins require a server (#channel@server)");return}S(r,!0);const o=e.context==="irc"?`${s()}@${e.server}`:s();return await W({"@context":await G(e.context),type:"join",actor:Y(e.actor),target:{id:o,name:s(),type:"room"}}).then(()=>{S(u,s(),!0),D(e.sockethubState,C(t).joined=!0,C(t))}).catch(c=>{throw D(e.sockethubState,C(t).joined=!1,C(t)),console.error("joinRoom failed",{action:"join",platform:e.context,room:s(),server:e.server,err:c}),c}).finally(()=>{S(r,!1)})}var g=xe(),m=j(x(g),2),y=x(m),_=j(x(y),2);X(_),U(2),w(y);var M=j(y,2),i=x(M);{let o=H(()=>!t().connected||t().joined||n(r));Q(i,{get disabled(){return n(o)},buttonAction:k,children:(c,z)=>{var A=P(),B=I(A);{var f=h=>{var q=ge();a(h,q)},l=h=>{var q=P(),Z=I(q);{var $=R=>{var N=fe();a(R,N)},ee=R=>{var N=he();a(R,N)};J(Z,R=>{t().joined?R($):R(ee,!1)},!0)}a(h,q)};J(B,h=>{n(r)?h(f):h(l,!1)})}a(c,A)}})}w(M),w(m),w(g),K(_,s),a(b,g),L(),v()}var we=d('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="hidden sm:inline">Sending...</span></div>'),be=d('<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="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"></path></svg> <span class="hidden sm:inline">Send</span></div>'),pe=d('<div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-green-900 mb-4 flex items-center"><span class="mr-2">💬</span> Send Message</h4> <div class="space-y-4"><div class="w-full space-y-2"><label for="sendMessage" class="block text-sm font-semibold text-gray-700">Your Message</label> <div class="flex space-x-3"><input id="sendMessage" class="flex-1 px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors duration-200 text-gray-900 placeholder-gray-500" placeholder="Type your message here..."/> <!></div> <p class="text-gray-500 text-xs">💡 Press Enter to send quickly</p></div></div></div>');function Be(b,e){T(e,!0);const t=()=>O(e.sockethubState,"$sockethubState",p),[p,v]=V();let s=E(""),r=E(!1);async function u(){if(!n(s).trim())return;if(e.context==="irc"&&!e.server){console.error("IRC sends require a server (#channel@server)");return}S(r,!0);const i=n(s).trim();console.log("send message: ",i);const o=e.context==="irc"?`${e.room}@${e.server}`:e.room;try{await W({"@context":await G(e.context),type:"send",actor:Y(e.actor),object:{type:"message",content:i},target:{id:o,name:e.room,type:"room"}}),S(s,"")}catch(c){console.error("Failed to send message:",c)}finally{S(r,!1)}}var k=pe(),g=j(x(k),2),m=x(g),y=j(x(m),2),_=x(y);X(_),_.__keydown=i=>{i.key==="Enter"&&!n(r)&&t().connected&&u()};var M=j(_,2);{let i=H(()=>!t().connected||n(r)||!n(s).trim());Q(M,{get disabled(){return n(i)},buttonAction:u,children:(o,c)=>{var z=P(),A=I(z);{var B=l=>{var h=we();a(l,h)},f=l=>{var h=be();a(l,h)};J(A,l=>{n(r)?l(B):l(f,!1)})}a(o,z)}})}w(y),U(2),w(m),w(g),w(k),K(_,()=>n(s),i=>S(s,i)),a(b,k),L(),v()}te(["keydown"]);export{Me as A,Ae as C,Re as P,ze as R,Be as S};
@@ -0,0 +1 @@
1
+ var re=Object.defineProperty;var M=t=>{throw TypeError(t)};var se=(t,e,r)=>e in t?re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Y=(t,e,r)=>se(t,typeof e!="symbol"?e+"":e,r),F=(t,e,r)=>e.has(t)||M("Cannot "+r);var i=(t,e,r)=>(F(t,e,"read from private field"),r?r.call(t):e.get(t)),P=(t,e,r)=>e.has(t)?M("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),K=(t,e,r,s)=>(F(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r);import{B as q,J as ne,K as L,L as ie,M as H,N as W,D as B,O as ae,P as fe,Q as ue,R as oe,S as ce,T as le,U as de,V as he,W as _e,X as pe,Y as Z,H as ve,Z as be,j as z,_ as me,$ as Se,d as V,a0 as Pe,g as O,a1 as $,a2 as ge,a3 as N,a4 as we,a5 as X,h as ye,a6 as Ee,i as Re,a7 as G,a8 as J,x as Oe,e as Ae,a9 as Te,aa as xe,ab as De,ac as Ie,ad as Le,ae as Be,af as k,ag as ee,ah as E}from"./BymJmDWJ.js";var b,m,d,g,A,T,D;class Ne{constructor(e,r=!0){Y(this,"anchor");P(this,b,new Map);P(this,m,new Map);P(this,d,new Map);P(this,g,new Set);P(this,A,!0);P(this,T,()=>{var e=q;if(i(this,b).has(e)){var r=i(this,b).get(e),s=i(this,m).get(r);if(s)ne(s),i(this,g).delete(r);else{var n=i(this,d).get(r);n&&(i(this,m).set(r,n.effect),i(this,d).delete(r),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),s=n.effect)}for(const[a,u]of i(this,b)){if(i(this,b).delete(a),a===e)break;const f=i(this,d).get(u);f&&(L(f.effect),i(this,d).delete(u))}for(const[a,u]of i(this,m)){if(a===r||i(this,g).has(a))continue;const f=()=>{if(Array.from(i(this,b).values()).includes(a)){var _=document.createDocumentFragment();fe(u,_),_.append(H()),i(this,d).set(a,{effect:u,fragment:_})}else L(u);i(this,g).delete(a),i(this,m).delete(a)};i(this,A)||!s?(i(this,g).add(a),ie(u,f,!1)):f()}}});P(this,D,e=>{i(this,b).delete(e);const r=Array.from(i(this,b).values());for(const[s,n]of i(this,d))r.includes(s)||(L(n.effect),i(this,d).delete(s))});this.anchor=e,K(this,A,r)}ensure(e,r){var s=q,n=ue();if(r&&!i(this,m).has(e)&&!i(this,d).has(e))if(n){var a=document.createDocumentFragment(),u=H();a.append(u),i(this,d).set(e,{effect:W(()=>r(u)),fragment:a})}else i(this,m).set(e,W(()=>r(this.anchor)));if(i(this,b).set(s,e),n){for(const[f,o]of i(this,m))f===e?s.skipped_effects.delete(o):s.skipped_effects.add(o);for(const[f,o]of i(this,d))f===e?s.skipped_effects.delete(o.effect):s.skipped_effects.add(o.effect);s.oncommit(i(this,T)),s.ondiscard(i(this,D))}else B&&(this.anchor=ae),i(this,T).call(this)}}b=new WeakMap,m=new WeakMap,d=new WeakMap,g=new WeakMap,A=new WeakMap,T=new WeakMap,D=new WeakMap;function qe(t,e,r=!1){B&&ce();var s=new Ne(t),n=r?le:0;function a(u,f){if(B){const _=de(t)===he;if(u===_){var o=_e();pe(o),s.anchor=o,Z(!1),s.ensure(u,f),Z(!0);return}}s.ensure(u,f)}oe(()=>{var u=!1;e((f,o=!0)=>{u=!0,a(o,f)}),u||a(!1,null)},n)}let R=!1,U=Symbol();function He(t,e,r){const s=r[e]??(r[e]={store:null,source:me(void 0),unsubscribe:z});if(s.store!==t&&!(U in r))if(s.unsubscribe(),s.store=t??null,t==null)s.source.v=void 0,s.unsubscribe=z;else{var n=!0;s.unsubscribe=Se(t,a=>{n?s.source.v=a:V(s.source,a)}),n=!1}return t&&U in r?Pe(t):O(s.source)}function We(t,e){return t.set(e),e}function Ze(){const t={};function e(){ve(()=>{for(var r in t)t[r].unsubscribe();be(t,U,{enumerable:!1,value:!0})})}return[t,e]}function ze(t,e,r){return t.set(r),e}function Ge(){R=!0}function Ue(t){var e=R;try{return R=!1,[t(),R]}finally{R=e}}const $e={get(t,e){if(!t.exclude.includes(e))return O(t.version),e in t.special?t.special[e]():t.props[e]},set(t,e,r){if(!(e in t.special)){var s=$;try{J(t.parent_effect),t.special[e]=Ce({get[e](){return t.props[e]}},e,X)}finally{J(s)}}return t.special[e](r),G(t.version),!0},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},deleteProperty(t,e){return t.exclude.includes(e)||(t.exclude.push(e),G(t.version)),!0},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Je(t,e){return new Proxy({props:t,exclude:e,special:{},version:ge(0),parent_effect:$},$e)}const je={get(t,e){let r=t.props.length;for(;r--;){let s=t.props[r];if(E(s)&&(s=s()),typeof s=="object"&&s!==null&&e in s)return s[e]}},set(t,e,r){let s=t.props.length;for(;s--;){let n=t.props[s];E(n)&&(n=n());const a=N(n,e);if(a&&a.set)return a.set(r),!0}return!1},getOwnPropertyDescriptor(t,e){let r=t.props.length;for(;r--;){let s=t.props[r];if(E(s)&&(s=s()),typeof s=="object"&&s!==null&&e in s){const n=N(s,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===k||e===ee)return!1;for(let r of t.props)if(E(r)&&(r=r()),r!=null&&e in r)return!0;return!1},ownKeys(t){const e=[];for(let r of t.props)if(E(r)&&(r=r()),!!r){for(const s in r)e.includes(s)||e.push(s);for(const s of Object.getOwnPropertySymbols(r))e.includes(s)||e.push(s)}return e}};function Qe(...t){return new Proxy({props:t},je)}function Ce(t,e,r,s){var j;var n=!Te||(r&xe)!==0,a=(r&De)!==0,u=(r&Le)!==0,f=s,o=!0,_=()=>(o&&(o=!1,f=u?Ae(s):s),f),c;if(a){var S=k in t||ee in t;c=((j=N(t,e))==null?void 0:j.set)??(S&&e in t?l=>t[e]=l:void 0)}var p,v=!1;a?[p,v]=Ue(()=>t[e]):p=t[e],p===void 0&&s!==void 0&&(p=_(),c&&(n&&we(),c(p)));var h;if(n?h=()=>{var l=t[e];return l===void 0?_():(o=!0,l)}:h=()=>{var l=t[e];return l!==void 0&&(f=void 0),l===void 0?f:l},n&&(r&X)===0)return h;if(c){var w=t.$$legacy;return function(l,x){return arguments.length>0?((!n||!x||w||v)&&c(x?h():l),l):h()}}var I=!1,y=((r&Ie)!==0?Oe:Re)(()=>(I=!1,h()));a&&O(y);var te=$;return function(l,x){if(arguments.length>0){const C=x?O(y):n&&a?ye(l):l;return V(y,C),I=!0,f!==void 0&&(f=C),l}return Be&&I||(te.f&Ee)!==0?y.v:O(y)}}const Me="modulepreload",Ye=function(t,e){return new URL(t,e).href},Q={},Ve=function(e,r,s){let n=Promise.resolve();if(r&&r.length>0){let u=function(c){return Promise.all(c.map(S=>Promise.resolve(S).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const f=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),_=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));n=u(r.map(c=>{if(c=Ye(c,s),c in Q)return;Q[c]=!0;const S=c.endsWith(".css"),p=S?'[rel="stylesheet"]':"";if(s)for(let h=f.length-1;h>=0;h--){const w=f[h];if(w.href===c&&(!S||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${p}`))return;const v=document.createElement("link");if(v.rel=S?"stylesheet":Me,S||(v.as="script"),v.crossOrigin="",v.href=c,_&&v.setAttribute("nonce",_),document.head.appendChild(v),S)return new Promise((h,w)=>{v.addEventListener("load",h),v.addEventListener("error",()=>w(Error(`Unable to preload CSS for ${c}`)))})}))}function a(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return n.then(u=>{for(const f of u||[])f.status==="rejected"&&a(f.reason);return e().catch(a)})};export{Ne as B,Ve as _,We as a,He as b,ze as c,Qe as d,qe as i,Je as l,Ge as m,Ce as p,Ze as s};
@@ -0,0 +1 @@
1
+ import{d as v,f as _,s as g,a as y}from"./CgjHsrhs.js";import{p as h,c as u,r as d,s as x,t as w,a as F}from"./BymJmDWJ.js";import{r as I,g as l,j}from"./BKtlB-ZE.js";import{b as k}from"./Cko76dBZ.js";import{p as r}from"./FpM_-oX5.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=u(s),p=u(a,!0);d(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)},d(s),w(()=>{l(a,"for",e.id),g(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),y(n,s),F()}v(["input"]);export{E as F};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BwQUhEGu.js","../chunks/CgjHsrhs.js","../chunks/BymJmDWJ.js","../chunks/BKtlB-ZE.js","../chunks/FpM_-oX5.js","../chunks/CH5OY5MF.js","../assets/sockethub.Bpv0Wt6b.css","../chunks/BDxEtWDn.js","../chunks/C7zmhnYM.js","../assets/0.DiwDnc-u.css","../nodes/1.C-zkRZjk.js","../nodes/2.8bzWQILm.js","../chunks/CbO4bo1j.js","../nodes/3.DrGIkVu0.js","../chunks/Cko76dBZ.js","../chunks/BFJazgM-.js","../chunks/D5R3T3gW.js","../nodes/4.Clpm2HdH.js","../chunks/wMyiGnQa.js","../nodes/5.D6ttn0N8.js","../nodes/6.CkpDg7i6.js","../nodes/7.DrKGjs0l.js","../nodes/8.2NG23_e4.js","../nodes/9.D7zgVgYt.js"])))=>i.map(i=>d[i]);
2
+ var M=e=>{throw TypeError(e)};var B=(e,t,r)=>t.has(e)||M("Cannot "+r);var c=(e,t,r)=>(B(e,t,"read from private field"),r?r.call(e):t.get(e)),A=(e,t,r)=>t.has(e)?M("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),x=(e,t,r,i)=>(B(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);import{B as Q,p as L,i as D,_ as d}from"../chunks/FpM_-oX5.js";import{D as U,S as W,R as X,T as $,ai as tt,E as et,e as rt,I as at,af as st,d as T,ag as nt,g as f,aj as it,Z as ot,_ as ct,p as ut,l as _t,m as mt,ak as dt,b as I,C as ft,f as b,s as lt,a as ht,c as vt,r as gt,u as p,t as Et}from"../chunks/BymJmDWJ.js";import{h as yt,m as Pt,u as Rt,f as N,a as P,c as V,t as Ot,s as bt}from"../chunks/CgjHsrhs.js";function k(e,t,r){U&&W();var i=new Q(e);X(()=>{var n=t()??null;i.ensure(n,n&&(o=>r(o,n)))},$)}function F(e,t){return e===t||(e==null?void 0:e[st])===t}function j(e={},t,r,i){return tt(()=>{var n,o;return et(()=>{n=o,o=[],rt(()=>{e!==r(...o)&&(t(e,...o),n&&F(r(...n),e)&&t(null,...n))})}),()=>{at(()=>{o&&F(r(...o),e)&&t(null,...o)})}}),e}function Tt(e){return class extends At{constructor(t){super({component:e,...t})}}}var l,_;class At{constructor(t){A(this,l);A(this,_);var o;var r=new Map,i=(a,s)=>{var h=ct(s,!1,!1);return r.set(a,h),h};const n=new Proxy({...t.props||{},$$events:{}},{get(a,s){return f(r.get(s)??i(s,Reflect.get(a,s)))},has(a,s){return s===nt?!0:(f(r.get(s)??i(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,h){return T(r.get(s)??i(s,h),h),Reflect.set(a,s,h)}});x(this,_,(t.hydrate?yt:Pt)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&it(),x(this,l,n.$$events);for(const a of Object.keys(c(this,_)))a==="$set"||a==="$destroy"||a==="$on"||ot(this,a,{get(){return c(this,_)[a]},set(s){c(this,_)[a]=s},enumerable:!0});c(this,_).$set=a=>{Object.assign(n,a)},c(this,_).$destroy=()=>{Rt(c(this,_))}}$set(t){c(this,_).$set(t)}$on(t,r){c(this,l)[t]=c(this,l)[t]||[];const i=(...n)=>r.call(this,...n);return c(this,l)[t].push(i),()=>{c(this,l)[t]=c(this,l)[t].filter(n=>n!==i)}}$destroy(){c(this,_).$destroy()}}l=new WeakMap,_=new WeakMap;const St={};var xt=N('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),Lt=N("<!> <!>",1);function Dt(e,t){ut(t,!0);let r=L(t,"components",23,()=>[]),i=L(t,"data_0",3,null),n=L(t,"data_1",3,null);_t(()=>t.stores.page.set(t.page)),mt(()=>{t.stores,t.page,t.constructors,r(),t.form,i(),n(),t.stores.page.notify()});let o=I(!1),a=I(!1),s=I(null);dt(()=>{const u=t.stores.page.subscribe(()=>{f(o)&&(T(a,!0),ft().then(()=>{T(s,document.title||"untitled page",!0)}))});return T(o,!0),u});const h=p(()=>t.constructors[1]);var w=Lt(),S=b(w);{var q=u=>{const v=p(()=>t.constructors[0]);var g=V(),R=b(g);k(R,()=>f(v),(E,y)=>{j(y(E,{get data(){return i()},get form(){return t.form},get params(){return t.page.params},children:(m,pt)=>{var C=V(),H=b(C);k(H,()=>f(h),(J,K)=>{j(K(J,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),O=>r()[1]=O,()=>{var O;return(O=r())==null?void 0:O[1]})}),P(m,C)},$$slots:{default:!0}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),P(u,g)},G=u=>{const v=p(()=>t.constructors[0]);var g=V(),R=b(g);k(R,()=>f(v),(E,y)=>{j(y(E,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),P(u,g)};D(S,u=>{t.constructors[1]?u(q):u(G,!1)})}var Z=lt(S,2);{var z=u=>{var v=xt(),g=vt(v);{var R=E=>{var y=Ot();Et(()=>bt(y,f(s))),P(E,y)};D(g,E=>{f(a)&&E(R)})}gt(v),P(u,v)};D(Z,u=>{f(o)&&u(z)})}P(e,w),ht()}const Ct=Tt(Dt),Mt=[()=>d(()=>import("../nodes/0.BwQUhEGu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>d(()=>import("../nodes/1.C-zkRZjk.js"),__vite__mapDeps([10,1,2,5,8,7]),import.meta.url),()=>d(()=>import("../nodes/2.8bzWQILm.js"),__vite__mapDeps([11,1,2,5,3,4,6,7,12]),import.meta.url),()=>d(()=>import("../nodes/3.DrGIkVu0.js"),__vite__mapDeps([13,1,2,4,3,5,6,14,12,15,16]),import.meta.url),()=>d(()=>import("../nodes/4.Clpm2HdH.js"),__vite__mapDeps([17,1,2,4,15,3,5,6,14,12,18]),import.meta.url),()=>d(()=>import("../nodes/5.D6ttn0N8.js"),__vite__mapDeps([19,1,2,4,3,5,6,14,12,18]),import.meta.url),()=>d(()=>import("../nodes/6.CkpDg7i6.js"),__vite__mapDeps([20,1,2,4,15,3,5,6,14,12,16,18]),import.meta.url),()=>d(()=>import("../nodes/7.DrKGjs0l.js"),__vite__mapDeps([21,1,2,3,4,5,6,14,12,18]),import.meta.url),()=>d(()=>import("../nodes/8.2NG23_e4.js"),__vite__mapDeps([22,1,2,4,3,5,6,14,12,18]),import.meta.url),()=>d(()=>import("../nodes/9.D7zgVgYt.js"),__vite__mapDeps([23,1,2,4,15,3,5,6,14,12,18]),import.meta.url)],Bt=[],Ft={"/":[2],"/caldav":[5],"/carddav":[8],"/dummy":[7],"/feeds":[4],"/irc":[6],"/metadata":[9],"/xmpp":[3]},Y={handleError:({error:e})=>{console.error(e)},reroute:()=>{},transport:{}},It=Object.fromEntries(Object.entries(Y.transport).map(([e,t])=>[e,t.decode])),Nt=Object.fromEntries(Object.entries(Y.transport).map(([e,t])=>[e,t.encode])),Yt=!1,qt=(e,t)=>It[e](t);export{qt as decode,It as decoders,Ft as dictionary,Nt as encoders,Yt as hash,Y as hooks,St as matchers,Mt as nodes,Ct as root,Bt as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/C7zmhnYM.js";export{o as load_css,r as start};
@@ -0,0 +1,39 @@
1
+ import{f as _,a as h,s as k,c as z}from"../chunks/CgjHsrhs.js";import{t as I,c as t,n as K,r as e,s as j,p as Q,a as U,f as B,g as r,u as S,al as Y,j as Z}from"../chunks/BymJmDWJ.js";import{j as C,o as ee,e as se,i as te,p as W,g as P,k as ae,q as re,n as oe,t as le}from"../chunks/BKtlB-ZE.js";import"../chunks/CH5OY5MF.js";import{i as F,s as H,b as T}from"../chunks/FpM_-oX5.js";import{b as ne}from"../chunks/BDxEtWDn.js";import{s as ie}from"../chunks/C7zmhnYM.js";const ce=!0,de=!1,De=Object.freeze(Object.defineProperty({__proto__:null,prerender:ce,ssr:de},Symbol.toStringTag,{value:"Module"})),pe=`<style>/*!
2
+ Theme: Edge Light
3
+ Author: cjayross (https://github.com/cjayross)
4
+ License: ~ MIT (or more permissive) [via base16-schemes-source]
5
+ Maintainer: @highlightjs/core-team
6
+ Version: 2021.09.0
7
+ */pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#5e646f;background:#fafafa}.hljs::selection,
8
+ .hljs ::selection{background-color:#d69822;color:#5e646f}.hljs-comment{color:#5e646f}.hljs-tag{color:#6587bf}.hljs-subst,
9
+ .hljs-punctuation,
10
+ .hljs-operator{color:#5e646f}.hljs-operator{opacity:0.7}.hljs-bullet,
11
+ .hljs-variable,
12
+ .hljs-template-variable,
13
+ .hljs-selector-tag,
14
+ .hljs-name,
15
+ .hljs-deletion,.hljs-symbol,
16
+ .hljs-number,
17
+ .hljs-link,
18
+ .hljs-attr,
19
+ .hljs-variable.constant_,
20
+ .hljs-literal{color:#db7070}.hljs-title,
21
+ .hljs-class .hljs-title,
22
+ .hljs-title.class_,.hljs-strong{color:#d69822}.hljs-strong{font-weight:bold}.hljs-code,
23
+ .hljs-addition,
24
+ .hljs-title.class_.inherited__,
25
+ .hljs-string{color:#7c9f4b}.hljs-built_in,
26
+ .hljs-doctag,
27
+ .hljs-quote,
28
+ .hljs-keyword.hljs-atrule,
29
+ .hljs-regexp{color:#509c93}.hljs-function .hljs-title,
30
+ .hljs-attribute,
31
+ .ruby .hljs-property,
32
+ .hljs-title.function_,
33
+ .hljs-section{color:#6587bf}.hljs-type,
34
+ .hljs-template-tag,
35
+ .diff .hljs-meta,
36
+ .hljs-keyword,.hljs-emphasis{color:#b870ce}.hljs-emphasis{font-style:italic}.hljs-meta,
37
+ .hljs-meta .hljs-keyword,
38
+ .hljs-meta .hljs-string{color:#509c93}.hljs-meta .hljs-keyword,
39
+ .hljs-meta-keyword{font-weight:bold}</style>`;var he=_('<p class="text-xs text-gray-500 text-center mt-2">Make sure Sockethub server is running</p>'),ve=_('<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm"><div class="flex items-center justify-center space-x-3"><div class="flex items-center space-x-2"><div></div> <span class="text-sm font-medium text-gray-700">Sockethub Connection</span></div> <span> </span></div> <!></div>');function ue(l){const i=()=>T(ee,"$connected",c),[c,v]=H();var n=ve(),u=t(n),d=t(u),y=t(d);K(2),e(d);var p=j(d,2),f=t(p,!0);e(p),e(u);var m=j(u,2);{var s=a=>{var g=he();h(a,g)};F(m,a=>{i()||a(s)})}e(n),I(()=>{C(y,1,`w-3 h-3 rounded-full ${i()?"bg-green-400 animate-pulse":"bg-gray-300"}`),C(p,1,`px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wide ${i()?"bg-green-100 text-green-800":"bg-gray-100 text-gray-600"}`),k(f,i()?"Connected":"Disconnected")}),h(l,n),v()}const me=()=>{const l=ie;return{page:{subscribe:l.page.subscribe},navigating:{subscribe:l.navigating.subscribe},updated:l.updated}},ge={subscribe(l){return me().page.subscribe(l)}};var be=_('<a><span class="text-sm"> </span> <span class="ml-1"> </span></a>'),je=_('<span aria-disabled="true"><span class="text-sm grayscale"> </span> <span class="ml-1"> </span></span>'),fe=_('<nav class="flex justify-center flex-wrap gap-2 p-2"></nav>');function xe(l,i){Q(i,!0);const c=()=>T(ae,"$apiDiscovery",n),v=()=>T(ge,"$page",n),[n,u]=H(),d=[["🏠","Home","/","Start here to understand Sockethub",void 0],["🔧","Dummy","/dummy","Basic examples • Start here","dummy"],["📅","CalDAV","/caldav","Calendars and tasks","caldav"],["👤","CardDAV","/carddav","Address books and contacts","carddav"],["📰","Feeds","/feeds","RSS/ATOM feed parsing","feeds"],["💬","IRC","/irc","Internet Relay Chat • Advanced","irc"],["🔍","Metadata","/metadata","Web page metadata extraction","metadata"],["📨","XMPP","/xmpp","Extensible messaging • Advanced","xmpp"]],y=S(()=>{var s;return((s=c())==null?void 0:s.state)==="available"?new Set(c().descriptor.platforms.map(a=>a.id)):c()?new Set:void 0});function p(s){var a;return!s||(((a=r(y))==null?void 0:a.has(s))??!1)}function f(s,a){return a?s:`${s} • Platform not enabled`}var m=fe();se(m,21,()=>d,te,(s,a)=>{var g=S(()=>Y(r(a),5));let q=()=>r(g)[0],E=()=>r(g)[1],L=()=>r(g)[2],O=()=>r(g)[3],N=()=>r(g)[4];const w=S(()=>p(N())),R=S(()=>`group relative rounded-lg px-3 py-2 font-medium transition-all duration-200 no-underline ${r(w)?v().url.pathname.endsWith(L())?"bg-orange-600 text-blue-50 shadow-md":"text-slate-700 hover:bg-slate-200 hover:shadow-sm":"cursor-not-allowed text-slate-400"}`);var V=z(),X=B(V);{var G=x=>{var o=be(),b=t(o),A=t(b,!0);e(b);var $=j(b,2),D=t($,!0);e($),e(o),I(M=>{C(o,1,W(r(R))),P(o,"href",`${ne??""}${L()??""}`),P(o,"title",M),k(A,q()),k(D,E())},[()=>f(O(),r(w))]),h(x,o)},J=x=>{var o=je(),b=t(o),A=t(b,!0);e(b);var $=j(b,2),D=t($,!0);e($),e(o),I(M=>{C(o,1,W(r(R))),P(o,"title",M),k(A,q()),k(D,E())},[()=>f(O(),r(w))]),h(x,o)};F(X,x=>{r(w)?x(G):x(J,!1)})}h(s,V)}),e(m),h(l,m),U(),u()}var _e=_('<main><div><div><img class="m-auto" src="/sockethub-logo.svg" alt="Sockethub"/></div> <div class="col-span-2 md:mt-3"><!></div> <div class="w-full text-center"><!></div></div> <div class="pt-5"><!></div></main>');function Me(l,i){var c=_e();re("12qhfyh",m=>{var s=z(),a=B(s);le(a,()=>pe),h(m,s)});var v=t(c),n=j(t(v),2),u=t(n);xe(u,{}),e(n);var d=j(n,2),y=t(d);ue(y),e(d),e(v);var p=j(v,2),f=t(p);oe(f,()=>i.children??Z),e(p),e(c),h(l,c)}export{Me as component,De as universal};
@@ -0,0 +1 @@
1
+ import{f as h,a as g,s as e}from"../chunks/CgjHsrhs.js";import{i as l}from"../chunks/CH5OY5MF.js";import{p as v,f as d,t as _,a as x,c as o,r as p,s as $}from"../chunks/BymJmDWJ.js";import{s as k,p as m}from"../chunks/C7zmhnYM.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const f=b;var E=h("<h1> </h1> <p> </p>",1);function z(i,c){v(c,!1),l();var t=E(),r=d(t),n=o(r,!0);p(r);var s=$(r,2),u=o(s,!0);p(s),_(()=>{var a;e(n,f.status),e(u,(a=f.error)==null?void 0:a.message)}),g(i,t),x()}export{z as component};
@@ -0,0 +1,5 @@
1
+ import{f as c,a as d,c as U,s as u}from"../chunks/CgjHsrhs.js";import{i as B}from"../chunks/CH5OY5MF.js";import{p as G,s,c as t,r as e,a as Q,f as J,g as i,i as Z,t as x,n as ee}from"../chunks/BymJmDWJ.js";import{k as te,e as se,l as ae,m as re,g}from"../chunks/BKtlB-ZE.js";import{b as f}from"../chunks/BDxEtWDn.js";import{i as D,b as oe,s as ie}from"../chunks/FpM_-oX5.js";import{I as de}from"../chunks/CbO4bo1j.js";var le=c('<p class="text-gray-600 text-sm">Discovering server endpoints…</p>'),ne=c('<div><dt class="font-semibold inline">Socket.IO endpoint:</dt> <dd class="inline"><code data-testid="api-info-socket"> </code></dd></div>'),ce=c('<code data-testid="api-info-endpoint"> </code>'),pe=c('<span data-testid="api-info-endpoint-off">not enabled on this server</span>'),ve=c('<li class="bg-white border rounded px-2 py-1"> <span class="text-gray-500"> </span></li>'),be=c('<dl class="text-sm text-gray-700 space-y-2"><!> <div><dt class="font-semibold inline">HTTP actions endpoint:</dt> <dd class="inline"><!></dd></div> <div><dt class="font-semibold inline">Sockethub API version:</dt> <dd class="inline" data-testid="api-info-version"> </dd></div> <div><dt class="font-semibold">Enabled platforms:</dt> <dd><ul class="mt-1 flex flex-wrap gap-2" data-testid="api-info-platforms"></ul></dd></div></dl>'),me=c('<div class="bg-yellow-50 border border-yellow-300 text-yellow-800 rounded p-2" data-testid="api-info-unavailable"><strong>Server discovery failed.</strong> </div>'),ge=c('<div class="bg-gray-50 border-l-4 border-gray-400 p-4 rounded-r-lg" data-testid="api-info"><h2 class="text-xl font-semibold text-gray-800 mb-2">This Server</h2> <!></div>');function fe(O,M){G(M,!1);const y=()=>oe(te,"$apiDiscovery",k),[k,S]=ie();B();var v=ge(),P=s(t(v),2);{var A=l=>{var h=le();d(l,h)},_=l=>{var h=U(),w=J(h);{var I=n=>{const o=Z(()=>{const{descriptor:r,serverOrigin:a}=y();return{descriptor:r,serverOrigin:a}});var b=be(),$=t(b);{var N=r=>{var a=ne(),p=s(t(a),2),m=t(p),C=t(m);e(m),e(p),e(a),x((j,K)=>u(C,`io(${j??""}, { path: ${K??""} })`),[()=>JSON.stringify(i(o).serverOrigin),()=>JSON.stringify(i(o).descriptor.endpoints.socketIO)]),d(r,a)};D($,r=>{i(o).descriptor.endpoints&&r(N)})}var E=s($,2),X=s(t(E),2),Y=t(X);{var z=r=>{var a=ce(),p=t(a,!0);e(a),x(m=>u(p,m),[()=>re(i(o).serverOrigin,i(o).descriptor.endpoints.httpActions)]),d(r,a)},L=r=>{var a=pe();d(r,a)};D(Y,r=>{var a;(a=i(o).descriptor.endpoints)!=null&&a.httpActions?r(z):r(L,!1)})}e(X),e(E);var T=s(E,2),V=s(t(T),2),q=t(V,!0);e(V),e(T);var W=s(T,2),F=s(t(W),2),H=t(F);se(H,5,()=>ae(i(o).descriptor.platforms),r=>r.id,(r,a)=>{var p=ve(),m=t(p),C=s(m),j=t(C);e(C),e(p),x(()=>{u(m,`${i(a).id??""} `),u(j,`API v${i(a).apiVersion??""}`)}),d(r,p)}),e(H),e(F),e(W),e(b),x(()=>u(q,i(o).descriptor.apiVersion)),d(n,b)},R=n=>{var o=me(),b=s(t(o));e(o),x(()=>u(b,` ${y().reason??""}`)),d(n,o)};D(w,n=>{y().state==="available"?n(I):n(R,!1)},!0)}d(l,h)};D(P,l=>{y()?l(_,!1):l(A)})}e(v),d(O,v),Q(),S()}var he=c(`<title>Sockethub Examples</title> <div class="space-y-6"><div class="bg-blue-50 border-l-4 border-blue-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-blue-800 mb-2">What is Sockethub?</h2> <p class="text-blue-700 mb-3">Sockethub is a <strong>protocol gateway</strong> that bridges web applications with various internet protocols
2
+ like IRC, XMPP, RSS/ATOM feeds, and more. Instead of implementing each protocol directly in your web app,
3
+ you send standardized <strong>ActivityStreams</strong> messages to Sockethub, which handles the protocol-specific details.</p> <p class="text-blue-700">Think of it as a universal translator that lets your web application communicate with
4
+ chat servers, feed readers, and other internet services using a single, consistent API.</p></div> <div class="bg-green-50 border-l-4 border-green-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-green-800 mb-2">Key Concepts</h2> <div class="space-y-3"><div><h3 class="font-semibold text-green-700">🎭 Actor</h3> <p class="text-green-600 text-sm">Your identity on a platform (e.g., IRC nickname, XMPP username, feed URL)</p></div> <div><h3 class="font-semibold text-green-700">🔧 Platform</h3> <p class="text-green-600 text-sm">A protocol handler (IRC, XMPP, Feeds, etc.) that runs as a separate process</p></div> <div><h3 class="font-semibold text-green-700">📝 ActivityStreams</h3> <p class="text-green-600 text-sm">Standardized JSON format for describing activities like "send message", "connect", "fetch"</p></div> <div><h3 class="font-semibold text-green-700">🔐 Credentials</h3> <p class="text-green-600 text-sm">Connection details securely stored per session (servers, passwords, API keys)</p></div></div></div> <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-yellow-800 mb-2">How It Works</h2> <ol class="text-yellow-700 space-y-2 text-sm"><li><span class="font-semibold">1.</span> Your web app connects to Sockethub via WebSocket</li> <li><span class="font-semibold">2.</span> You define an actor and send ActivityStreams messages (<code>credentials</code>, <code>connect</code>, <code>join</code>, …) with full actor objects</li> <li><span class="font-semibold">3.</span> Sockethub routes messages to the appropriate platform</li> <li><span class="font-semibold">4.</span> Platform handles protocol-specific communication</li> <li><span class="font-semibold">5.</span> Results are sent back to your web app as ActivityStreams</li></ol></div> <div class="bg-purple-50 border-l-4 border-purple-400 p-4 rounded-r-lg"><h2 class="text-xl font-semibold text-purple-800 mb-2">Explore the Examples</h2> <p class="text-purple-700 mb-3">Each example demonstrates a different platform. Start with <strong>Dummy</strong> to understand
5
+ the basic flow, then explore real-world protocols:</p> <div class="grid gap-3 text-sm"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors border-l-4 border-l-green-400"><div class="flex items-center justify-between"><div><div class="font-semibold text-purple-800">🔧 Dummy Platform</div> <div class="text-purple-600">Learn the basics with simple echo/fail examples</div></div> <span class="text-xs bg-green-100 text-green-700 px-2 py-1 rounded">Start Here</span></div></a> <div class="grid md:grid-cols-2 gap-3"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors"><div class="font-semibold text-purple-800">📅 CalDAV Calendars</div> <div class="text-purple-600">Discover calendars and create events or tasks</div></a> <a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors"><div class="font-semibold text-purple-800">👤 CardDAV Contacts</div> <div class="text-purple-600">Discover address books, then search, add, edit, and delete contacts</div></a></div> <div class="grid md:grid-cols-2 gap-3"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors"><div class="font-semibold text-purple-800">📰 RSS/ATOM Feeds</div> <div class="text-purple-600">Fetch and parse web feeds</div></a> <a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors border-l-4 border-l-orange-400"><div class="flex items-center justify-between"><div><div class="font-semibold text-purple-800">💬 IRC Chat</div> <div class="text-purple-600">Connect to IRC servers and channels</div></div> <span class="text-xs bg-orange-100 text-orange-700 px-2 py-1 rounded">Advanced</span></div></a></div> <div class="grid md:grid-cols-2 gap-3"><a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors"><div class="font-semibold text-purple-800">🔍 Metadata</div> <div class="text-purple-600">Extract metadata from web pages</div></a> <a class="block p-3 bg-white rounded border hover:bg-purple-50 transition-colors border-l-4 border-l-orange-400"><div class="flex items-center justify-between"><div><div class="font-semibold text-purple-800">📨 XMPP Messaging</div> <div class="text-purple-600">Send and receive XMPP messages</div></div> <span class="text-xs bg-orange-100 text-orange-700 px-2 py-1 rounded">Advanced</span></div></a></div></div></div> <!> <div class="text-center text-gray-600 text-sm bg-gray-50 p-4 rounded-lg">💡 <strong>Tip:</strong> Watch the connection status at the top and the activity log at the bottom of each example to understand what's happening behind the scenes.</div></div>`,1);function Pe(O){de(O,{title:"Sockethub Examples",children:(M,y)=>{var k=he(),S=s(J(k),2),v=s(t(S),6),P=s(t(v),4),A=t(P),_=s(A,2),l=t(_),h=s(l,2);e(_);var w=s(_,2),I=t(w),R=s(I,2);e(w);var n=s(w,2),o=t(n),b=s(o,2);e(n),e(P),e(v);var $=s(v,2);fe($,{}),ee(2),e(S),x(()=>{g(A,"href",`${f??""}/dummy`),g(l,"href",`${f??""}/caldav`),g(h,"href",`${f??""}/carddav`),g(I,"href",`${f??""}/feeds`),g(R,"href",`${f??""}/irc`),g(o,"href",`${f??""}/metadata`),g(b,"href",`${f??""}/xmpp`)}),d(M,k)}})}export{Pe as component};
@@ -0,0 +1,2 @@
1
+ import{f as k,a as y}from"../chunks/CgjHsrhs.js";import{p as Q,a as T,s as t,f as U,c as n,w as J,g as e,u as P,r as d,n as W,b as S,t as Z,d as p,e as c}from"../chunks/BymJmDWJ.js";import{s as ee,a as te,m as re,b as R,i as se,c as _}from"../chunks/FpM_-oX5.js";import{r as oe,I as ae,s as ne,c as de}from"../chunks/BKtlB-ZE.js";import{B as ce,b as ie}from"../chunks/Cko76dBZ.js";import{A as le}from"../chunks/BFJazgM-.js";import{A as pe,C as me,P as ge,R as ue,S as be}from"../chunks/D5R3T3gW.js";var ve=k('<div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 4 & 5: Join Room and Chat</h4> <div class="space-y-4"><!> <!> <!></div></div>'),he=k('<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 text-center"><p class="text-gray-500">Connect to the XMPP server to access chat features</p></div>'),fe=k(`<div class="bg-indigo-50 border-l-4 border-indigo-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-indigo-800 mb-2">📨 XMPP Connection Process</h3> <p class="text-indigo-700 text-sm mb-3">XMPP (Extensible Messaging and Presence Protocol) is a real-time communication protocol used by services like Jabber.</p> <div class="text-indigo-700 text-sm space-y-1"><div><strong>1. 🎭 Actor:</strong> JSON object with <code>id</code>, <code>type</code>, and <code>name</code></div> <div><strong>2. 🔐 Set Credentials:</strong> Your XMPP login secret, sent through the password field</div> <div><strong>3. 🔌 Connect:</strong> Establish connection to XMPP server</div> <div><strong>4. 🏠 Join Room:</strong> Enter a multi-user chat room</div> <div><strong>5. 💬 Send Messages:</strong> Chat with other users in real-time</div></div></div> <div class="space-y-6"><div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 1: Set Your XMPP Address</h4> <!> <p class="text-gray-600 text-sm mt-2">💡 Format: username@server.com (e.g., user@jabber.org, alice@conversations.im)</p> <!></div> <div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 2: Set Your Credentials</h4> <label class="block text-sm font-medium text-gray-700 mb-1" for="xmpp-password-input">Password</label> <input id="xmpp-password-input" type="password" class="w-full border border-gray-300 rounded-md px-3 py-2 text-sm mb-3" placeholder="your XMPP password or compatible bearer token"/> <p class="text-gray-600 text-xs mb-3">💡 If your deployment accepts a bearer-style token in the SASL PLAIN password
2
+ slot, enter that token here. Sockethub's XMPP platform still submits it as <code>password</code>.</p> <!> <p class="text-gray-600 text-sm mt-2">🔐 Sockethub's XMPP platform accepts a single <code>password</code> field.</p></div> <div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 3: Connect to XMPP Server</h4> <!></div> <!></div>`,1);function Xe(F,Y){Q(Y,!0);const m=()=>R(M,"$actorIdStore",w),o=()=>R(s,"$sockethubState",w),[w,B]=ee(),M=J("user@jabber.org");let g=S(!1),u=S("123456"),X=P(()=>`${m()}/SockethubExample`),b=S("kosmos-random@kosmos.chat");const s=J({actorSet:!1,credentialsSet:!1,connected:!1,joined:!1});let a=P(()=>({id:e(X),type:"person",name:e(X)})),L=P(()=>({type:"credentials",userAddress:m(),resource:"SockethubExample",password:e(u)}));async function N(){p(g,!0);try{await ne({"@context":await de("xmpp"),type:"connect",actor:{id:e(a).id,type:e(a).type,name:e(a).name}}),_(s,c(o).connected=!0,c(o))}catch(v){console.error(v),_(s,c(o).connected=!1,c(o)),_(s,c(o).joined=!1,c(o))}finally{p(g,!1)}}ce(F,{title:"XMPP Platform Example",description:"Connect to XMPP servers (Jabber), join multi-user chats, and exchange messages using Sockethub's XMPP platform.",children:(v,xe)=>{var C=fe(),A=t(U(C),2),h=n(A),I=t(n(h),2);pe(I,{get value(){return re(),m()},set value(r){te(M,r)}});var O=t(I,4);le(O,{get actor(){return e(a)},get sockethubState(){return s}}),d(h);var f=t(h,2),l=t(n(f),4);oe(l);var V=t(l,4);me(V,{context:"xmpp",get credentials(){return e(L)},get actor(){return e(a)},get sockethubState(){return s}}),W(2),d(f);var x=t(f,2),q=t(n(x),2);ge(q,{get sockethubState(){return s},get connecting(){return e(g)},onConnect:N}),d(x);var z=t(x,2);{var D=r=>{var i=ve(),$=t(n(i),2),E=n($);ue(E,{get actor(){return e(a)},get sockethubState(){return s},context:"xmpp",get room(){return e(b)},set room(K){p(b,K,!0)}});var j=t(E,2);ae(j,{});var H=t(j,2);be(H,{context:"xmpp",get actor(){return e(a)},get sockethubState(){return s},get room(){return e(b)}}),d($),d(i),y(r,i)},G=r=>{var i=he();y(r,i)};se(z,r=>{o().connected?r(D):r(G,!1)})}d(A),Z(()=>l.disabled=o().credentialsSet),ie(l,()=>e(u),r=>p(u,r)),y(v,C)}}),T(),B()}export{Xe as component};
@@ -0,0 +1 @@
1
+ import{f as w,t as E,a as p,s as O}from"../chunks/CgjHsrhs.js";import{p as P,a as j,s as a,f as B,c,d as f,b as y,g as e,w as M,u as _,n as C,r as n,t as W}from"../chunks/BymJmDWJ.js";import{s as H,i as Y,b as q}from"../chunks/FpM_-oX5.js";import{A as z}from"../chunks/BFJazgM-.js";import{B as D,S as G}from"../chunks/Cko76dBZ.js";import{F as I}from"../chunks/wMyiGnQa.js";import{s as J,a as K,c as N}from"../chunks/BKtlB-ZE.js";var Q=w('<div class="bg-red-50 border border-red-200 text-red-800 rounded-lg p-4 text-sm" role="alert"><p class="font-semibold mb-1">Fetch failed</p> <p class="font-mono text-xs whitespace-pre-wrap break-words"> </p></div>'),V=w('<div class="bg-green-50 border-l-4 border-green-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-green-800 mb-2">📰 How Feed Processing Works</h3> <p class="text-green-700 text-sm mb-3">This example shows how Sockethub can fetch and parse RSS/ATOM feeds from any website.</p> <div class="text-green-700 text-sm space-y-1"><div><strong>🌐 Fetching:</strong> Sockethub downloads the feed content from the URL</div> <div><strong>🔍 Parsing:</strong> Content is parsed from RSS/ATOM format</div> <div><strong>📝 Converting:</strong> Each feed entry becomes an ActivityStreams object</div> <div><strong>📊 Results:</strong> You receive an array of structured feed entries</div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">The feed URL is the actor <code>id</code> with <code>type: "feed"</code>.</p> <!> <div class="bg-blue-50 border border-blue-200 p-3 rounded-lg"><p class="text-blue-700 text-sm"><strong>💡 What happens when you click Fetch:</strong><br/> Sockethub sends a <code>fetch</code> activity with the feed URL as the actor and returns a collection of entries.</p></div> <!> <div class="w-full text-right"><!></div></div>',1);function de(k,F){P(F,!0);const $=()=>q(h,"$sockethubState",A),[A,R]=H(),h=M({actorSet:!1});let o=y("https://sockethub.org/feed.xml"),d=y(null);const m=_(()=>({id:e(o),type:"feed",name:e(o)}));async function L(){f(d,null);try{await J({"@context":await N("feeds"),type:"fetch",actor:K(e(m))})}catch(r){f(d,r instanceof Error?r.message:String(r),!0)}}D(k,{title:"Feeds Platform Example",description:"The feeds platform takes an RSS/ATOM feed URL, fetches and parses it, and returns an array of Activity Objects for each entry.",children:(r,X)=>{var v=V(),u=a(B(v),2),b=c(u);I(b,{label:"Feed URL",id:"URL",placeholder:"https://example.com/feed.xml",get value(){return e(o)},set value(t){f(o,t,!0)}});var g=a(b,4);z(g,{get actor(){return e(m)},get sockethubState(){return h}});var x=a(g,4);{var T=t=>{var s=Q(),i=a(c(s),2),l=c(i,!0);n(i),n(s),W(()=>O(l,e(d))),p(t,s)};Y(x,t=>{e(d)&&t(T)})}var S=a(x,2),U=c(S);{let t=_(()=>!$().actorSet);G(U,{buttonAction:L,get disabled(){return e(t)},children:(s,i)=>{C();var l=E("Fetch Feed");p(s,l)}})}n(S),n(u),p(r,v)}}),j(),R()}export{de as component};
@@ -0,0 +1 @@
1
+ import{f as m,t as j,s as p,a as u}from"../chunks/CgjHsrhs.js";import{p as ft,b as d,h as Re,a as gt,f as ae,s as n,c as i,d as a,g as e,n as I,t as f,u as U,r as o}from"../chunks/BymJmDWJ.js";import{i as x}from"../chunks/FpM_-oX5.js";import{r as fe,e as Oe,b as mt,d as _t,c as re,f as bt,s as ge}from"../chunks/BKtlB-ZE.js";import{B as yt,S as le,a as Le,c as xt}from"../chunks/Cko76dBZ.js";import{F as S}from"../chunks/wMyiGnQa.js";var ht=m('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),wt=m('<div class="rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800" role="status"> </div>'),St=m("<option> </option>"),$t=m('<label for="caldav-calendar" class="block text-sm font-semibold text-gray-700">Calendar</label> <select id="caldav-calendar" class="w-full rounded-lg border border-gray-300 bg-white px-4 py-3"></select>',1),Ct=m("<!> <!>",1),kt=m('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),Et=m('<div class="rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800" role="status"> </div>'),It=m('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),Tt=m('<li class="flex flex-col gap-1 px-4 py-3 text-sm"><span class="font-medium text-gray-900"> </span> <span class="text-gray-600"> <!> <!></span></li>'),At=m('<h3 class="text-sm font-semibold text-gray-700"> </h3> <ul class="divide-y divide-gray-200 rounded-lg border border-gray-200 bg-white"></ul>',1),Dt=m('<section class="space-y-4"><h2 class="text-xl font-semibold text-gray-900">1. Set credentials</h2> <p class="text-sm text-gray-600">Use an app password when your calendar provider supports one. Credentials stay in this Sockethub session.</p> <!> <!> <!> <!> <div class="flex justify-end"><!></div> <!> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">2. Choose a calendar</h2> <div class="flex justify-end"><!></div> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">3. Add an item</h2> <div class="flex gap-6"><label class="flex items-center gap-2"><input type="radio"/> Event</label> <label class="flex items-center gap-2"><input type="radio"/> To-do</label></div> <!> <!> <div class="flex justify-end"><!></div></section> <!> <!> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">Read a published iCalendar feed</h2> <p class="text-sm text-gray-600">Public .ics and webcal:// links need no credentials. Sockethub fetches the feed and lists its items.</p> <!> <label class="flex items-center gap-2 text-sm text-gray-700"><input type="checkbox"/> Upcoming items only</label> <div class="flex justify-end"><!></div> <!> <!></section>',1);function Ot(Ve,Ne){ft(Ne,!0);const me=[];let B=d("caldav:alice"),K=d(""),M=d(""),Q=d(""),T=d(!1),$=d(Re([])),R=d(""),_=d("event"),A=d(""),O=d(""),L=d(""),V=d(""),b=d(!1),D=d(null),F=d(null),N=d(null),W=d(null),X=d(""),ne=d(!0),_e=d(""),q=d(Re([])),Y=d(!1),Z=d(null);const k=U(()=>e($).find(l=>l.id===e(R))),We=U(()=>{var l;return((l=e(k))==null?void 0:l.components.includes(e(_)))??!1});function ee(){return{id:e(B),type:"person"}}function te(){e(T)&&(a(T,!1),a($,[],!0),a(R,""),a(N,null),a(W,null))}async function qe(){a(N,null),a(W,null),a(b,!0);try{await _t();const l={"@context":await re("caldav"),type:"credentials",actor:ee(),object:{type:"credentials",url:e(K),username:e(M),password:e(Q)}};await new Promise((v,h)=>{bt.socket.emit("credentials",l,C=>{if(C!=null&&C.error){h(new Error(C.error));return}v()})}),a(T,!0),a(W,"Credentials set for this Sockethub session.")}catch(l){a(N,l instanceof Error?l.message:String(l),!0)}finally{a(b,!1)}}async function ze(){var l;a(D,null),a(F,null),a(b,!0);try{const v=await ge({"@context":await re("caldav"),type:"fetch",actor:ee()});a($,(v.items??[]).filter(h=>h.type==="calendar"&&typeof h.id=="string"&&typeof h.name=="string"&&Array.isArray(h.components)),!0),a(R,((l=e($)[0])==null?void 0:l.id)??"",!0),a(F,`Found ${e($).length} calendar${e($).length===1?"":"s"}.`)}catch(v){a(D,v instanceof Error?v.message:String(v),!0)}finally{a(b,!1)}}async function Ge(){a(Z,null),a(Y,!0);try{const l=await ge({"@context":await re("caldav"),type:"read",actor:ee(),target:{id:e(X),type:"feed"},...e(ne)?{object:{startTime:new Date().toISOString()}}:{}});a(_e,typeof l.summary=="string"?l.summary:"",!0),a(q,(l.items??[]).filter(v=>(v.type==="event"||v.type==="task")&&typeof v.name=="string"),!0)}catch(l){a(q,[],!0),a(Z,l instanceof Error?l.message:String(l),!0)}finally{a(Y,!1)}}function be(l){const v=l.startTime??l.due;return v?l.allDay||!v.includes("T")?v:new Date(v).toLocaleString():""}async function He(){if(e(k)){a(D,null),a(F,null),a(b,!0);try{const l=e(_)==="event"?{type:"event",name:e(A),startTime:new Date(e(O)).toISOString(),...e(L)?{endTime:new Date(e(L)).toISOString()}:{}}:{type:"task",name:e(A),...e(V)?{due:new Date(e(V)).toISOString()}:{}};await ge({"@context":await re("caldav"),type:"create",actor:ee(),target:{id:e(k).id,type:"calendar"},object:l}),a(F,`${e(_)==="event"?"Event":"To-do"} created.`),a(A,""),a(O,""),a(L,""),a(V,"")}catch(l){a(D,l instanceof Error?l.message:String(l),!0)}finally{a(b,!1)}}}yt(Ve,{title:"CalDAV Platform Example",description:"Discover the calendars in a CalDAV account and add an event or to-do, or list the events in a published .ics feed.",children:(l,v)=>{var h=Dt(),C=ae(h),ye=n(i(C),4);S(ye,{label:"Actor ID",id:"caldav-actor",placeholder:"caldav:alice",onInput:te,get value(){return e(B)},set value(t){a(B,t,!0)}});var xe=n(ye,2);S(xe,{label:"CalDAV URL",id:"caldav-url",type:"url",placeholder:"https://calendar.example/dav/",onInput:te,get value(){return e(K)},set value(t){a(K,t,!0)}});var he=n(xe,2);S(he,{label:"Username",id:"caldav-username",onInput:te,get value(){return e(M)},set value(t){a(M,t,!0)}});var we=n(he,2);S(we,{label:"Password",id:"caldav-password",type:"password",onInput:te,get value(){return e(Q)},set value(t){a(Q,t,!0)}});var se=n(we,2),Je=i(se);{let t=U(()=>e(T)||e(b)||!e(B)||!e(K)||!e(M)||!e(Q));le(Je,{buttonAction:qe,get disabled(){return e(t)},children:(r,s)=>{I();var c=j();f(()=>p(c,e(T)?"Credentials Set":e(b)?"Setting Credentials…":"Set Credentials")),u(r,c)}})}o(se);var Se=n(se,2);{var Ke=t=>{var r=ht(),s=i(r,!0);o(r),f(()=>p(s,e(N))),u(t,r)};x(Se,t=>{e(N)&&t(Ke)})}var Me=n(Se,2);{var Qe=t=>{var r=wt(),s=i(r,!0);o(r),f(()=>p(s,e(W))),u(t,r)};x(Me,t=>{e(W)&&t(Qe)})}o(C);var oe=n(C,2),de=n(i(oe),2),Xe=i(de);{let t=U(()=>e(b)||!e(T));le(Xe,{buttonAction:ze,get disabled(){return e(t)},children:(r,s)=>{I();var c=j("Fetch Calendars");u(r,c)}})}o(de);var Ye=n(de,2);{var Ze=t=>{var r=$t(),s=n(ae(r),2);Oe(s,21,()=>e($),c=>c.id,(c,g)=>{var w=St(),y=i(w);o(w);var P={};f(H=>{p(y,`${e(g).name??""} (${H??""})`),P!==(P=e(g).id)&&(w.value=(w.__value=e(g).id)??"")},[()=>e(g).components.join(", ")]),u(c,w)}),o(s),mt(s,()=>e(R),c=>a(R,c)),u(t,r)};x(Ye,t=>{e($).length>0&&t(Ze)})}o(oe);var ie=n(oe,2),ce=n(i(ie),2),ve=i(ce),z=i(ve);fe(z),z.value=z.__value="event",I(),o(ve);var $e=n(ve,2),G=i($e);fe(G),G.value=G.__value="task",I(),o($e),o(ce);var Ce=n(ce,2);S(Ce,{label:"Name",id:"caldav-item-name",get value(){return e(A)},set value(t){a(A,t,!0)}});var ke=n(Ce,2);{var et=t=>{var r=Ct(),s=ae(r);S(s,{label:"Starts",id:"caldav-start",type:"datetime-local",get value(){return e(O)},set value(g){a(O,g,!0)}});var c=n(s,2);S(c,{label:"Ends (optional)",id:"caldav-end",type:"datetime-local",get value(){return e(L)},set value(g){a(L,g,!0)}}),u(t,r)},tt=t=>{S(t,{label:"Due (optional)",id:"caldav-due",type:"datetime-local",get value(){return e(V)},set value(r){a(V,r,!0)}})};x(ke,t=>{e(_)==="event"?t(et):t(tt,!1)})}var Ee=n(ke,2),at=i(Ee);{let t=U(()=>e(b)||!e(We)||!e(A)||e(_)==="event"&&!e(O));le(at,{buttonAction:He,get disabled(){return e(t)},children:(r,s)=>{I();var c=j();f(()=>p(c,`Add ${e(_)==="event"?"Event":"To-do"}`)),u(r,c)}})}o(Ee),o(ie);var Ie=n(ie,2);{var rt=t=>{var r=kt(),s=i(r,!0);o(r),f(()=>p(s,e(D))),u(t,r)};x(Ie,t=>{e(D)&&t(rt)})}var Te=n(Ie,2);{var lt=t=>{var r=Et(),s=i(r,!0);o(r),f(()=>p(s,e(F))),u(t,r)};x(Te,t=>{e(F)&&t(lt)})}var Ae=n(Te,2),De=n(i(Ae),4);S(De,{label:"Feed URL",id:"caldav-feed-url",type:"url",placeholder:"https://example.org/holidays.ics",get value(){return e(X)},set value(t){a(X,t,!0)}});var ue=n(De,2),Fe=i(ue);fe(Fe),I(),o(ue);var pe=n(ue,2),nt=i(pe);{let t=U(()=>e(Y)||!e(B)||!e(X));le(nt,{buttonAction:Ge,get disabled(){return e(t)},children:(r,s)=>{I();var c=j();f(()=>p(c,e(Y)?"Reading…":"Read Feed")),u(r,c)}})}o(pe);var Pe=n(pe,2);{var st=t=>{var r=It(),s=i(r,!0);o(r),f(()=>p(s,e(Z))),u(t,r)};x(Pe,t=>{e(Z)&&t(st)})}var ot=n(Pe,2);{var dt=t=>{var r=At(),s=ae(r),c=i(s);o(s);var g=n(s,2);Oe(g,23,()=>e(q),(w,y)=>`${y}:${w.id}`,(w,y)=>{var P=Tt(),H=i(P),it=i(H,!0);o(H);var je=n(H,2),Ue=i(je),Be=n(Ue);{var ct=E=>{var J=j();f(pt=>p(J,`· ${pt??""}`),[()=>be(e(y))]),u(E,J)};x(Be,E=>{be(e(y))&&E(ct)})}var vt=n(Be,2);{var ut=E=>{var J=j();f(()=>p(J,`· ${e(y).location??""}`)),u(E,J)};x(vt,E=>{e(y).location&&E(ut)})}o(je),o(P),f(()=>{p(it,e(y).name),p(Ue,`${e(y).type==="task"?"To-do":"Event"} `)}),u(w,P)}),o(g),f(()=>p(c,`${e(_e)||"Feed"} (${e(q).length??""})`)),u(t,r)};x(ot,t=>{e(q).length>0&&t(dt)})}o(Ae),f((t,r)=>{z.disabled=t,G.disabled=r},[()=>!!(e(k)&&!e(k).components.includes("event")),()=>!!(e(k)&&!e(k).components.includes("task"))]),Le(me,[],z,()=>e(_),t=>a(_,t)),Le(me,[],G,()=>e(_),t=>a(_,t)),xt(Fe,()=>e(ne),t=>a(ne,t)),u(l,h)}}),gt()}export{Ot as component};
@@ -0,0 +1 @@
1
+ import{f as w,a as C}from"../chunks/CgjHsrhs.js";import{p as ee,w as B,a as te,s as t,f as re,c as o,g as e,u as q,r as a,d as v,b as u,e as i}from"../chunks/BymJmDWJ.js";import{s as se,a as oe,m as ae,b as z,i as ne,c as S}from"../chunks/FpM_-oX5.js";import{A as de}from"../chunks/BFJazgM-.js";import{A as ce,C as ie,P as le,R as ve,S as me}from"../chunks/D5R3T3gW.js";import{B as ue}from"../chunks/Cko76dBZ.js";import{F as N}from"../chunks/wMyiGnQa.js";import{I as ge,s as pe,c as be}from"../chunks/BKtlB-ZE.js";var fe=w('<div class="bg-gradient-to-r from-emerald-50 to-green-50 border border-emerald-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-emerald-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-emerald-600 text-white rounded-full flex items-center justify-center text-sm font-bold">4</span> Join Channel and Chat</h4> <div class="space-y-6"><!> <!> <!></div></div>'),he=w('<div class="bg-gradient-to-r from-gray-50 to-slate-50 border border-gray-200 rounded-xl p-6 text-center shadow-sm"><div class="flex items-center justify-center mb-3"><span class="w-8 h-8 bg-gray-400 text-white rounded-full flex items-center justify-center text-sm font-bold">4</span></div> <p class="text-gray-600 font-medium">Connect to the IRC server to access chat features</p> <p class="text-gray-500 text-sm mt-1">Complete steps 1-3 above to unlock this section</p></div>'),xe=w('<div class="bg-orange-50 border-l-4 border-orange-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-orange-800 mb-2">💬 IRC Connection Process</h3> <p class="text-orange-700 text-sm mb-3">IRC (Internet Relay Chat) requires several steps to get connected and chatting.</p> <div class="text-orange-700 text-sm space-y-1"><div><strong>1. 🎭 Actor:</strong> JSON object with <code>id</code>, <code>type</code>, and <code>name</code></div> <div><strong>2. 🔐 Set Credentials:</strong> Provide server connection details</div> <div><strong>3. 🔌 Connect:</strong> Establish connection to IRC server</div> <div><strong>4. 🏠 Join Room:</strong> Enter a channel to start chatting</div> <div><strong>5. 💬 Send Messages:</strong> Chat with other users</div></div></div> <div class="space-y-6"><div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-green-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold">1</span> Confirm your actor</h4> <div class="space-y-4"><!> <!></div></div> <div class="bg-gradient-to-r from-blue-50 to-sky-50 border border-blue-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-blue-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-bold">2</span> Configure Server Connection</h4> <div class="space-y-4"><div class="grid md:grid-cols-2 gap-4"><!> <!></div> <div class="bg-blue-100 border border-blue-200 rounded-lg p-3"><p class="text-blue-800 text-sm">💡 <strong>Popular IRC networks:</strong> irc.libera.chat, irc.oftc.net, irc.rizon.net</p></div> <!></div></div> <div class="bg-gradient-to-r from-purple-50 to-violet-50 border border-purple-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-purple-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-purple-600 text-white rounded-full flex items-center justify-center text-sm font-bold">3</span> Connect to Server</h4> <!></div> <!></div>',1);function je(O,D){ee(D,!0);const m=()=>z(k,"$actorIdStore",I),n=()=>z(s,"$sockethubState",I),[I,G]=se(),k=B(`sh-${(Math.random()+1).toString(36).substring(7)}`);let c=u("irc.libera.chat"),g=u(6697),p=u("#sh-random"),b=u(!1);const s=B({actorSet:!1,credentialsSet:!1,connected:!1,joined:!1});let d=q(()=>({id:`${m()}@${e(c)}`,type:"person",name:m()})),H=q(()=>({type:"credentials",nick:m(),server:e(c),port:e(g),secure:!0}));async function K(){v(b,!0);try{await pe({"@context":await be("irc"),type:"connect",actor:{id:e(d).id,type:e(d).type,name:e(d).name}}),S(s,i(n).connected=!0,i(n))}catch(f){console.error(f),S(s,i(n).connected=!1,i(n)),S(s,i(n).joined=!1,i(n))}finally{v(b,!1)}}ue(O,{title:"IRC Platform Example",description:"Connect to IRC servers, join channels, and send messages using Sockethub's IRC platform.",children:(f,_e)=>{var R=xe(),$=t(re(R),2),h=o($),j=t(o(h),2),P=o(j);ce(P,{get value(){return ae(),m()},set value(r){oe(k,r)}});var L=t(P,2);de(L,{get actor(){return e(d)},get sockethubState(){return s}}),a(j),a(h);var x=t(h,2),A=t(o(x),2),_=o(A),F=o(_);N(F,{label:"IRC Server",id:"server",placeholder:"irc.libera.chat",get value(){return e(c)},set value(r){v(c,r,!0)}});var Q=t(F,2);N(Q,{label:"Port",id:"port",type:"number",placeholder:"6697",get value(){return e(g)},set value(r){v(g,r,!0)}}),a(_);var T=t(_,4);ie(T,{context:"irc",get credentials(){return e(H)},get actor(){return e(d)},get sockethubState(){return s}}),a(A),a(x);var y=t(x,2),U=t(o(y),2);le(U,{get sockethubState(){return s},get connecting(){return e(b)},onConnect:K}),a(y);var V=t(y,2);{var W=r=>{var l=fe(),E=t(o(l),2),M=o(E);ve(M,{get actor(){return e(d)},get sockethubState(){return s},context:"irc",get server(){return e(c)},get room(){return e(p)},set room(Z){v(p,Z,!0)}});var J=t(M,2);ge(J,{});var Y=t(J,2);me(Y,{context:"irc",get actor(){return e(d)},get sockethubState(){return s},get room(){return e(p)},get server(){return e(c)}}),a(E),a(l),C(r,l)},X=r=>{var l=he();C(r,l)};ne(V,r=>{n().connected?r(W):r(X,!1)})}a($),C(f,R)}}),te(),G()}export{je as component};
@@ -0,0 +1 @@
1
+ import{f as be,t as a,a as d}from"../chunks/CgjHsrhs.js";import{p as xe,a as pe,s,f as fe,c as e,d as he,b as ue,g as N,n as o,r as t}from"../chunks/BymJmDWJ.js";import{s as b,c as ge}from"../chunks/BKtlB-ZE.js";import{B as we,S as l}from"../chunks/Cko76dBZ.js";import{F as ye}from"../chunks/wMyiGnQa.js";var _e=be(`<div class="bg-gradient-to-r from-blue-50 to-blue-100 border border-blue-200 rounded-xl p-6 shadow-sm"><h3 class="text-xl font-bold text-blue-900 mb-3 flex items-center"><span class="mr-2">💡</span> What You'll Learn</h3> <p class="text-blue-800 mb-4 leading-relaxed">This example demonstrates the core Sockethub workflow with a test platform that doesn't require external connections.</p> <div class="grid md:grid-cols-2 gap-3 text-blue-800"><div class="flex items-start space-x-2"><span class="text-lg">📤</span> <div><div class="font-semibold">Sending</div> <div class="text-sm text-blue-700">How to create and send ActivityStreams messages</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">📥</span> <div><div class="font-semibold">Receiving</div> <div class="text-sm text-blue-700">How Sockethub responds with results or errors</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">🎯</span> <div><div class="font-semibold">Actor</div> <div class="text-sm text-blue-700">How your identity is represented</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">🔄</span> <div><div class="font-semibold">Types</div> <div class="text-sm text-blue-700">Different activity types (echo, greet, fail, throw, exit0, exit1, sigterm, sigkill, throwTypeError, throwReferenceError, hang)</div></div></div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ This text will be included in the <code>object.content</code> field of your ActivityStreams message.</p> <div class="bg-gradient-to-r from-amber-50 to-yellow-50 border border-amber-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-amber-900 mb-3 flex items-center"><span class="mr-2">🚀</span> Try Different Activity Types</h4> <p class="text-amber-800 mb-4 leading-relaxed">Each button sends the same basic message structure but with a different <code class="bg-amber-100 px-1 rounded text-sm">type</code> field:</p> <div class="grid md:grid-cols-2 gap-4"><div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Echo</div> <p class="text-amber-700 text-sm">Returns your message back unchanged</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Greet</div> <p class="text-amber-700 text-sm">Returns a friendly greeting</p></div> <!></div></div></div> <div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Fail</div> <p class="text-amber-700 text-sm">Returns an error message (for testing error handling)</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Throw</div> <p class="text-amber-700 text-sm">Throws an exception (for testing exception handling)</p></div> <!></div></div></div></div></div> <div class="bg-gradient-to-r from-red-50 to-rose-50 border border-red-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-red-900 mb-3 flex items-center"><span class="mr-2">⚠️</span> Crash/Recovery Tests</h4> <p class="text-red-800 mb-4 leading-relaxed">These types intentionally terminate or hang the dummy platform process. Use them to validate crash handling and recovery.</p> <div class="grid md:grid-cols-2 gap-4"><div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">Exit 0</div> <p class="text-red-700 text-sm">Graceful exit (process.exit(0))</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">Exit 1</div> <p class="text-red-700 text-sm">Crash exit (process.exit(1))</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">SIGTERM</div> <p class="text-red-700 text-sm">Self-terminate with SIGTERM</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">SIGKILL</div> <p class="text-red-700 text-sm">Self-terminate with SIGKILL</p></div> <!></div></div></div> <div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">TypeError</div> <p class="text-red-700 text-sm">Throw a TypeError on next tick</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">ReferenceError</div> <p class="text-red-700 text-sm">Throw a ReferenceError on next tick</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-red-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-red-900 mb-1">Hang</div> <p class="text-red-700 text-sm">Block the event loop (heartbeat timeout)</p></div> <!></div></div></div></div></div></div>`,1);function ke(Q,V){xe(V,!0);const T="https://sockethub.org/examples/dummy";let x=ue("");async function c(m){return{"@context":await ge("dummy"),type:m,actor:{type:"person",id:T,name:T},object:{type:"message",content:N(x)}}}async function v(m){await b(await c(m))}async function X(){await b(await c("echo"))}async function Z(){await b(await c("fail"))}async function ee(){await b(await c("throw"))}async function te(){await b(await c("greet"))}we(Q,{title:"Dummy Platform Example",description:"The dummy platform is the most basic test to communicate via Sockethub to a platform, and receive a response back. You can use either the echo or fail types on your Activity Stream object.",children:(m,$e)=>{var S=_e(),A=s(fe(S),2),j=e(A);ye(j,{label:"Message Content",id:"objectContent",placeholder:"Hello from Sockethub",get value(){return N(x)},set value(r){he(x,r,!0)}});var p=s(j,4),k=s(e(p),4),f=e(k),h=e(f),P=e(h),se=s(e(P),2);l(se,{buttonAction:X,children:(r,n)=>{o();var i=a("Echo");d(r,i)}}),t(P),t(h);var R=s(h,2),G=e(R),re=s(e(G),2);l(re,{buttonAction:te,children:(r,n)=>{o();var i=a("Greet");d(r,i)}}),t(G),t(R),t(f);var I=s(f,2),u=e(I),F=e(u),ie=s(e(F),2);l(ie,{buttonAction:Z,children:(r,n)=>{o();var i=a("Fail");d(r,i)}}),t(F),t(u);var L=s(u,2),H=e(L),de=s(e(H),2);l(de,{buttonAction:ee,children:(r,n)=>{o();var i=a("Throw");d(r,i)}}),t(H),t(L),t(I),t(k),t(p);var B=s(p,2),C=s(e(B),4),g=e(C),w=e(g),M=e(w),ae=s(e(M),2);l(ae,{buttonAction:()=>v("exit0"),children:(r,n)=>{o();var i=a("Exit 0");d(r,i)}}),t(M),t(w);var y=s(w,2),D=e(y),oe=s(e(D),2);l(oe,{buttonAction:()=>v("exit1"),children:(r,n)=>{o();var i=a("Exit 1");d(r,i)}}),t(D),t(y);var _=s(y,2),K=e(_),le=s(e(K),2);l(le,{buttonAction:()=>v("sigterm"),children:(r,n)=>{o();var i=a("SIGTERM");d(r,i)}}),t(K),t(_);var Y=s(_,2),q=e(Y),ne=s(e(q),2);l(ne,{buttonAction:()=>v("sigkill"),children:(r,n)=>{o();var i=a("SIGKILL");d(r,i)}}),t(q),t(Y),t(g);var O=s(g,2),$=e(O),U=e($),ve=s(e(U),2);l(ve,{buttonAction:()=>v("throwTypeError"),children:(r,n)=>{o();var i=a("TypeError");d(r,i)}}),t(U),t($);var E=s($,2),W=e(E),ce=s(e(W),2);l(ce,{buttonAction:()=>v("throwReferenceError"),children:(r,n)=>{o();var i=a("ReferenceError");d(r,i)}}),t(W),t(E);var z=s(E,2),J=e(z),me=s(e(J),2);l(me,{buttonAction:()=>v("hang"),children:(r,n)=>{o();var i=a("Hang");d(r,i)}}),t(J),t(z),t(O),t(C),t(B),t(A),d(m,S)}}),pe()}export{ke as component};
@@ -0,0 +1 @@
1
+ import{d as Zt,f as y,t as _e,s as h,a as m,c as er}from"../chunks/CgjHsrhs.js";import{p as tr,b as g,h as ft,a as rr,s as o,f as Ue,c as d,d as t,g as e,n as he,t as b,u as K,r as i}from"../chunks/BymJmDWJ.js";import{i as w}from"../chunks/FpM_-oX5.js";import{b as gt,e as Ve,d as ar,c as oe,f as or,s as se,i as sr,g as Oe}from"../chunks/BKtlB-ZE.js";import{B as nr,S as ye}from"../chunks/Cko76dBZ.js";import{F}from"../chunks/wMyiGnQa.js";var lr=y('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),ir=y('<div class="rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800" role="status"> </div>'),dr=y("<option> </option>"),cr=y('<p class="text-sm text-gray-600"> </p>'),vr=y('<label for="carddav-address-book" class="block text-sm font-semibold text-gray-700">Address book</label> <select id="carddav-address-book" class="w-full rounded-lg border border-gray-300 bg-white px-4 py-3"></select> <!>',1),ur=y('<span class="font-normal text-gray-500"> </span>'),pr=y('<p class="text-sm text-gray-600"> </p>'),mr=y('<p class="text-sm text-gray-600"> </p>'),fr=y('<p class="text-sm text-gray-600"> </p>'),gr=y('<p class="text-sm text-gray-600"> </p>'),_r=y('<p class="text-sm text-gray-600 break-all"> </p>'),hr=y('<p class="text-sm text-gray-600"> </p>'),yr=y('<p class="text-sm text-gray-600 whitespace-pre-wrap"> </p>'),br=y('<li class="flex flex-col gap-3 p-4 md:flex-row md:items-start md:justify-between"><div class="min-w-0 space-y-1"><h3 class="font-semibold text-gray-900"> <!></h3> <!> <!> <!> <!> <!> <!> <!> <p class="truncate text-xs text-gray-400"> </p></div> <div class="flex shrink-0 gap-2"><button type="button" class="rounded-lg border border-gray-300 px-3 py-2 text-sm font-semibold text-gray-700 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50">Edit</button> <button type="button" class="rounded-lg border border-red-200 px-3 py-2 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50">Delete</button></div></li>'),xr=y('<ul class="divide-y divide-gray-200 rounded-lg border border-gray-200"></ul>'),wr=y('<p class="text-sm text-gray-600">The update sends the full contact back with its stored <code>etag</code>. Fields not shown here are kept as they are.</p>'),$r=y('<button type="button" class="rounded-lg border border-gray-300 px-6 py-3 text-sm font-semibold text-gray-700 hover:bg-gray-50">Cancel</button>'),kr=y('<div class="rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800" role="alert"> </div>'),Cr=y('<div class="rounded-lg border border-green-200 bg-green-50 p-4 text-sm text-green-800" role="status"> </div>'),Ar=y(`<div class="bg-teal-50 border-l-4 border-teal-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-teal-800 mb-2">👤 How the CardDAV Platform Works</h3> <p class="text-teal-700 text-sm mb-3">Sockethub talks WebDAV and vCard to your contacts server so your app only has to send ActivityStreams.</p> <div class="text-teal-700 text-sm space-y-1"><div><strong>1. 🔐 Credentials:</strong> Sent once per session over the <code>credentials</code> event, never in an activity</div> <div><strong>2. 📚 fetch:</strong> Discovers the account's address books from the service URL</div> <div><strong>3. 🔍 query:</strong> Lists every contact, or runs a server-side search across name, email, telephone, or organization</div> <div><strong>4. ✏️ create / update / delete:</strong> Each contact carries an <code>etag</code>; updates and deletes are refused with <code>carddav:conflict</code> if another client changed the card first</div></div></div> <section class="space-y-4"><h2 class="text-xl font-semibold text-gray-900">1. Set credentials</h2> <p class="text-sm text-gray-600">Use an app password when your contacts provider supports one. Credentials stay in this Sockethub session.</p> <!> <!> <!> <!> <div class="flex justify-end"><!></div> <!> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">2. Choose an address book</h2> <div class="flex justify-end"><!></div> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900">3. Browse contacts</h2> <p class="text-sm text-gray-600">Leave the search empty to list every contact, or type text to search on the server.</p> <div class="grid gap-4 md:grid-cols-[1fr_auto]"><!> <div class="w-full space-y-2 md:w-48"><label for="carddav-search-field" class="block text-sm font-semibold text-gray-700">Search in</label> <select id="carddav-search-field" class="w-full rounded-lg border border-gray-300 bg-white px-4 py-3"><option>All fields</option><option>Name</option><option>Email</option><option>Telephone</option><option>Organization</option></select></div></div> <div class="flex justify-end"><!></div> <!></section> <section class="space-y-4 border-t border-gray-200 pt-6"><h2 class="text-xl font-semibold text-gray-900"> </h2> <!> <!> <div class="grid gap-4 md:grid-cols-2"><!> <!></div> <div class="grid gap-4 md:grid-cols-2"><!> <!></div> <!> <!> <div class="flex justify-end gap-2"><!> <!></div></section> <!> <!>`,1);function zr(_t,ht){tr(ht,!0);const be=100;let ne=g("carddav:alice"),le=g(""),ie=g(""),de=g(""),C=g(!1),q=g(ft([])),O=g(""),ce=g(""),ve=g("all"),E=g(ft([])),A=g(null),L=g(""),G=g(""),Q=g(""),X=g(""),Z=g(""),W=g(""),H=g(""),x=g(!1),j=g(null),N=g(null),ee=g(null),te=g(null),$=0,z=0;const D=K(()=>e(q).find(a=>a.id===e(O))),yt=K(()=>!!(e(C)&&e(D)&&e(L).trim()));function M(){return{id:e(ne),type:"person"}}function ue(a){return{id:a,type:"addressBook"}}function re(a){const c=a instanceof Error?a.message:String(a);return c==="carddav:conflict"?"carddav:conflict — another client changed this contact. Refresh the list and try again with the current version.":c}function U(){t(A,null),t(L,""),t(G,""),t(Q,""),t(X,""),t(Z,""),t(W,""),t(H,"")}function pe(){$+=1,z+=1,t(C,!1),t(q,[],!0),t(O,""),t(E,[],!0),U(),t(ee,null),t(te,null)}function bt(){z+=1,t(E,[],!0),U(),t(j,null),t(N,null)}function xt(a){var c,u,p,f;t(A,a,!0),t(L,a.name,!0),t(G,a.givenName??"",!0),t(Q,a.familyName??"",!0),t(X,((u=(c=a.emails)==null?void 0:c[0])==null?void 0:u.value)??"",!0),t(Z,((f=(p=a.telephones)==null?void 0:p[0])==null?void 0:f.value)??"",!0),t(W,a.organization??"",!0),t(H,a.note??"",!0),t(j,null),t(N,null)}async function wt(){const a=$;t(ee,null),t(te,null),t(x,!0);try{await ar();const c={"@context":await oe("carddav"),type:"credentials",actor:M(),object:{type:"credentials",url:e(le),username:e(ie),password:e(de)}};await new Promise((u,p)=>{or.socket.emit("credentials",c,f=>{if(f!=null&&f.error){p(new Error(f.error));return}u()})}),a===$&&(t(C,!0),t(te,"Credentials set for this Sockethub session."))}catch(c){a===$&&t(ee,re(c),!0)}finally{t(x,!1)}}async function $t(){var c;if(!e(C))return;const a=$;t(j,null),t(N,null),t(E,[],!0),U(),t(x,!0);try{const u=await se({"@context":await oe("carddav"),type:"fetch",actor:M()});if(a!==$||!e(C))return;t(q,(u.items??[]).filter(p=>p.type==="addressBook"&&typeof p.id=="string"&&typeof p.name=="string"),!0),t(O,((c=e(q)[0])==null?void 0:c.id)??"",!0),t(N,`Found ${e(q).length} address book${e(q).length===1?"":"s"}.`)}catch(u){a===$&&t(j,re(u),!0)}finally{t(x,!1)}}async function Ge(a=""){if(!e(C)||!e(D))return;const c=$,u=++z,p=e(D).id,f=e(ce).trim();t(j,null),t(N,null),t(x,!0);try{const I=await se({"@context":await oe("carddav"),type:"query",actor:M(),target:ue(p),object:{type:"contactQuery",...f?{text:f}:{},...f&&e(ve)!=="all"?{fields:[e(ve)]}:{},limit:be}});if(c!==$||u!==z||e(O)!==p||!e(C))return;if(t(E,(I.items??[]).filter(R=>R.type==="person"&&typeof R.id=="string"&&typeof R.name=="string"),!0),e(A)){const R=e(E).find(me=>{var J;return me.id===((J=e(A))==null?void 0:J.id)});R?t(A,R,!0):U()}const Y=`${e(E).length} contact${e(E).length===1?"":"s"}`,ae=e(E).length>=be?` Only the first ${be} are shown; narrow the search to see the rest.`:"";t(N,a+(f?`Found ${Y} matching “${f}”.`:`Listed ${Y}.`)+ae)}catch(I){c===$&&u===z&&t(j,re(I),!0)}finally{t(x,!1)}}function Qe(a,c){const u=(a==null?void 0:a.slice(1))??[],p=c?[{...(a==null?void 0:a[0])??{},value:c},...u]:u;return p.length?p:void 0}function We(a){const c=Qe(a==null?void 0:a.emails,e(X).trim()),u=Qe(a==null?void 0:a.telephones,e(Z).trim());return{name:e(L).trim(),...e(G).trim()?{givenName:e(G).trim()}:{},...e(Q).trim()?{familyName:e(Q).trim()}:{},...c?{emails:c}:{},...u?{telephones:u}:{},...e(W).trim()?{organization:e(W).trim()}:{},...e(H).trim()?{note:e(H).trim()}:{}}}async function kt(){if(!e(C)||!e(D)||!e(L).trim()||e(A)&&!e(A).etag)return;const a=$,c=z,u=e(D).id,p=e(A);t(j,null),t(N,null),t(x,!0);try{const f=await oe("carddav");if(p){const{emails:I,telephones:Y,givenName:ae,familyName:R,organization:me,note:J,...xe}=p;await se({"@context":f,type:"update",actor:M(),target:ue(u),object:{...xe,...We(p)}})}else await se({"@context":f,type:"create",actor:M(),target:ue(u),object:{type:"person",...We()}});if(a!==$||c!==z||!e(C))return;U(),await Ge(p?"Contact updated. ":"Contact created. ")}catch(f){a===$&&c===z&&t(j,re(f),!0)}finally{t(x,!1)}}async function Ct(a){var f;if(!e(C)||!e(D)||!a.etag)return;const c=$,u=z,p=e(D).id;t(j,null),t(N,null),t(x,!0);try{if(await se({"@context":await oe("carddav"),type:"delete",actor:M(),target:ue(p),object:{id:a.id,type:"person",etag:a.etag}}),c!==$||u!==z||!e(C))return;((f=e(A))==null?void 0:f.id)===a.id&&U(),t(E,e(E).filter(I=>I.id!==a.id),!0),t(N,`Deleted ${a.name}.`)}catch(I){c===$&&u===z&&t(j,re(I),!0)}finally{t(x,!1)}}function He(a){return[a.street,a.locality,a.region,a.postalCode,a.country].filter(Boolean).join(", ")}function Me(a){const c=[...a.preferred?["preferred"]:[],...a.types??[]];return c.length?`${a.value} (${c.join(", ")})`:a.value}nr(_t,{title:"CardDAV Platform Example",description:"Discover the address books in a CardDAV account, then list, search, add, edit, and delete contacts.",children:(a,c)=>{var u=Ar(),p=o(Ue(u),2),f=o(d(p),4);F(f,{label:"Actor ID",id:"carddav-actor",placeholder:"carddav:alice",onInput:pe,get value(){return e(ne)},set value(r){t(ne,r,!0)}});var I=o(f,2);F(I,{label:"CardDAV URL",id:"carddav-url",type:"url",placeholder:"https://contacts.example/dav/",onInput:pe,get value(){return e(le)},set value(r){t(le,r,!0)}});var Y=o(I,2);F(Y,{label:"Username",id:"carddav-username",onInput:pe,get value(){return e(ie)},set value(r){t(ie,r,!0)}});var ae=o(Y,2);F(ae,{label:"Password",id:"carddav-password",type:"password",onInput:pe,get value(){return e(de)},set value(r){t(de,r,!0)}});var R=o(ae,2),me=d(R);{let r=K(()=>e(C)||e(x)||!e(ne)||!e(le)||!e(ie)||!e(de));ye(me,{buttonAction:wt,get disabled(){return e(r)},children:(l,_)=>{he();var s=_e();b(()=>h(s,e(C)?"Credentials Set":e(x)?"Setting Credentials…":"Set Credentials")),m(l,s)}})}i(R);var J=o(R,2);{var xe=r=>{var l=lr(),_=d(l,!0);i(l),b(()=>h(_,e(ee))),m(r,l)};w(J,r=>{e(ee)&&r(xe)})}var At=o(J,2);{var Bt=r=>{var l=ir(),_=d(l,!0);i(l),b(()=>h(_,e(te))),m(r,l)};w(At,r=>{e(te)&&r(Bt)})}i(p);var we=o(p,2),$e=o(d(we),2),St=d($e);{let r=K(()=>e(x)||!e(C));ye(St,{buttonAction:$t,get disabled(){return e(r)},children:(l,_)=>{he();var s=_e("Fetch Address Books");m(l,s)}})}i($e);var Et=o($e,2);{var jt=r=>{var l=vr(),_=o(Ue(l),2);_.__change=bt,Ve(_,21,()=>e(q),S=>S.id,(S,B)=>{var P=dr(),Te=d(P,!0);i(P);var fe={};b(()=>{h(Te,e(B).name),fe!==(fe=e(B).id)&&(P.value=(P.__value=e(B).id)??"")}),m(S,P)}),i(_);var s=o(_,2);{var V=S=>{var B=cr(),P=d(B,!0);i(B),b(()=>h(P,e(D).description)),m(S,B)};w(s,S=>{var B;(B=e(D))!=null&&B.description&&S(V)})}gt(_,()=>e(O),S=>t(O,S)),m(r,l)};w(Et,r=>{e(q).length>0&&r(jt)})}i(we);var ke=o(we,2),Ce=o(d(ke),4),Ye=d(Ce);F(Ye,{label:"Search text (optional)",id:"carddav-search-text",placeholder:"Bob",get value(){return e(ce)},set value(r){t(ce,r,!0)}});var Je=o(Ye,2),Ae=o(d(Je),2),Be=d(Ae);Be.value=Be.__value="all";var Se=o(Be);Se.value=Se.__value="name";var Ee=o(Se);Ee.value=Ee.__value="email";var je=o(Ee);je.value=je.__value="telephone";var Ke=o(je);Ke.value=Ke.__value="organization",i(Ae),i(Je),i(Ce);var Fe=o(Ce,2),Ft=d(Fe);{let r=K(()=>e(x)||!e(C)||!e(D));ye(Ft,{buttonAction:Ge,get disabled(){return e(r)},children:(l,_)=>{he();var s=_e();b(V=>h(s,V),[()=>e(ce).trim()?"Search Contacts":"List Contacts"]),m(l,s)}})}i(Fe);var Nt=o(Fe,2);{var zt=r=>{var l=xr();Ve(l,21,()=>e(E),_=>_.id,(_,s)=>{var V=br(),S=d(V),B=d(S),P=d(B),Te=o(P);{var fe=v=>{var n=ur(),k=d(n);i(n),b(()=>h(k,`“${e(s).nickname??""}”`)),m(v,n)};w(Te,v=>{e(s).nickname&&v(fe)})}i(B);var lt=o(B,2);{var Ot=v=>{var n=pr(),k=d(n,!0);i(n),b(T=>h(k,T),[()=>[e(s).title,e(s).organization].filter(Boolean).join(" · ")]),m(v,n)};w(lt,v=>{(e(s).title||e(s).organization)&&v(Ot)})}var it=o(lt,2);{var Gt=v=>{var n=mr(),k=d(n);i(n),b(T=>h(k,`✉️ ${T??""}`),[()=>e(s).emails.map(Me).join(", ")]),m(v,n)};w(it,v=>{var n;(n=e(s).emails)!=null&&n.length&&v(Gt)})}var dt=o(it,2);{var Qt=v=>{var n=fr(),k=d(n);i(n),b(T=>h(k,`📞 ${T??""}`),[()=>e(s).telephones.map(Me).join(", ")]),m(v,n)};w(dt,v=>{var n;(n=e(s).telephones)!=null&&n.length&&v(Qt)})}var ct=o(dt,2);Ve(ct,17,()=>e(s).addresses??[],sr,(v,n)=>{var k=er(),T=Ue(k);{var Jt=qe=>{var Le=gr(),Kt=d(Le);i(Le),b(Xt=>h(Kt,`📍 ${Xt??""}`),[()=>He(e(n))]),m(qe,Le)};w(T,qe=>{He(e(n))&&qe(Jt)})}m(v,k)});var vt=o(ct,2);{var Wt=v=>{var n=_r(),k=d(n);i(n),b(T=>h(k,`🔗 ${T??""}`),[()=>e(s).urls.map(T=>T.value).join(", ")]),m(v,n)};w(vt,v=>{var n;(n=e(s).urls)!=null&&n.length&&v(Wt)})}var ut=o(vt,2);{var Ht=v=>{var n=hr(),k=d(n);i(n),b(()=>h(k,`🎂 ${e(s).birthday??""}`)),m(v,n)};w(ut,v=>{e(s).birthday&&v(Ht)})}var pt=o(ut,2);{var Mt=v=>{var n=yr(),k=d(n,!0);i(n),b(()=>h(k,e(s).note)),m(v,n)};w(pt,v=>{e(s).note&&v(Mt)})}var De=o(pt,2),Yt=d(De);i(De),i(S);var mt=o(S,2),ge=d(mt);ge.__click=()=>xt(e(s));var Pe=o(ge,2);Pe.__click=()=>Ct(e(s)),i(mt),i(V),b(()=>{h(P,`${e(s).name??""} `),Oe(De,"title",e(s).id),h(Yt,`uid ${e(s).uid??""}${e(s).etag?` · etag ${e(s).etag}`:""}`),ge.disabled=e(x)||!e(s).etag,Oe(ge,"title",e(s).etag?"":"This contact has no ETag, so it cannot be updated safely"),Pe.disabled=e(x)||!e(s).etag,Oe(Pe,"title",e(s).etag?"":"This contact has no ETag, so it cannot be deleted safely")}),m(_,V)}),i(l),m(r,l)};w(Nt,r=>{e(E).length>0&&r(zt)})}i(ke);var Ne=o(ke,2),ze=d(Ne),It=d(ze);i(ze);var Xe=o(ze,2);{var Rt=r=>{var l=wr();m(r,l)};w(Xe,r=>{e(A)&&r(Rt)})}var Ze=o(Xe,2);F(Ze,{label:"Full name",id:"carddav-contact-name",placeholder:"Bob Example",get value(){return e(L)},set value(r){t(L,r,!0)}});var Ie=o(Ze,2),et=d(Ie);F(et,{label:"Given name",id:"carddav-contact-given",placeholder:"Bob",get value(){return e(G)},set value(r){t(G,r,!0)}});var Tt=o(et,2);F(Tt,{label:"Family name",id:"carddav-contact-family",placeholder:"Example",get value(){return e(Q)},set value(r){t(Q,r,!0)}}),i(Ie);var Re=o(Ie,2),tt=d(Re);F(tt,{label:"Email",id:"carddav-contact-email",type:"email",placeholder:"bob@example.com",get value(){return e(X)},set value(r){t(X,r,!0)}});var Dt=o(tt,2);F(Dt,{label:"Telephone",id:"carddav-contact-telephone",type:"tel",placeholder:"+1 555 0100",get value(){return e(Z)},set value(r){t(Z,r,!0)}}),i(Re);var rt=o(Re,2);F(rt,{label:"Organization",id:"carddav-contact-organization",get value(){return e(W)},set value(r){t(W,r,!0)}});var at=o(rt,2);F(at,{label:"Note",id:"carddav-contact-note",get value(){return e(H)},set value(r){t(H,r,!0)}});var ot=o(at,2),st=d(ot);{var Pt=r=>{var l=$r();l.__click=U,m(r,l)};w(st,r=>{e(A)&&r(Pt)})}var qt=o(st,2);{let r=K(()=>e(x)||!e(yt));ye(qt,{buttonAction:kt,get disabled(){return e(r)},children:(l,_)=>{he();var s=_e();b(()=>h(s,e(A)?"Save Changes":"Add Contact")),m(l,s)}})}i(ot),i(Ne);var nt=o(Ne,2);{var Lt=r=>{var l=kr(),_=d(l,!0);i(l),b(()=>h(_,e(j))),m(r,l)};w(nt,r=>{e(j)&&r(Lt)})}var Ut=o(nt,2);{var Vt=r=>{var l=Cr(),_=d(l,!0);i(l),b(()=>h(_,e(N))),m(r,l)};w(Ut,r=>{e(N)&&r(Vt)})}b(()=>h(It,`4. ${e(A)?`Edit ${e(A).name}`:"Add a contact"}`)),gt(Ae,()=>e(ve),r=>t(ve,r)),m(a,u)}}),rr()}Zt(["change","click"]);export{zr as component};
@@ -0,0 +1,2 @@
1
+ import{f,t as H,a as s,c as C,s as D}from"../chunks/CgjHsrhs.js";import{p as G,a as J,s as o,f as $,c as p,d,b,g as e,w as N,u as P,n as q,r as v,t as z}from"../chunks/BymJmDWJ.js";import{s as I,i as F,b as K}from"../chunks/FpM_-oX5.js";import{A as Q}from"../chunks/BFJazgM-.js";import{B as V,S as X}from"../chunks/Cko76dBZ.js";import{F as Y}from"../chunks/wMyiGnQa.js";import{M as Z,s as tt,a as et,c as at,h as rt}from"../chunks/BKtlB-ZE.js";var st=f(`<div class="space-y-2"><h3 class="text-lg font-semibold text-gray-800">Preview</h3> <p class="text-gray-600 text-sm">How a chat client would render the fetched metadata. The raw
2
+ response is in the activity log below.</p> <!></div>`),ot=f('<div class="p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700"> </div>'),dt=f('<div class="bg-purple-50 border-l-4 border-purple-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-purple-800 mb-2">🔍 How Metadata Extraction Works</h3> <p class="text-purple-700 text-sm mb-3">This example shows how Sockethub can extract structured metadata from any web page.</p> <div class="text-purple-700 text-sm space-y-1"><div><strong>🌐 Fetching:</strong> Sockethub downloads the web page content</div> <div><strong>🔍 Scanning:</strong> Searches for Open Graph, Twitter Cards, JSON-LD, and meta tags</div> <div><strong>📊 Extracting:</strong> Pulls out titles, descriptions, images, and other metadata</div> <div><strong>📋 Returning:</strong> Provides structured data about the page</div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">The page URL is the actor <code>id</code> with <code>type: "website"</code>.</p> <!> <div class="bg-blue-50 border border-blue-200 p-3 rounded-lg"><p class="text-blue-700 text-sm"><strong>💡 What happens when you click Fetch:</strong><br/> Sockethub sends a <code>fetch</code> activity with the page URL as the actor and returns extracted metadata.</p></div> <div class="w-full text-right"><!></div> <!></div>',1);function mt(E,L){G(L,!0);const R=()=>K(x,"$sockethubState",A),[A,M]=I(),x=N({actorSet:!1});let i=b("https://sockethub.org"),c=b(void 0),n=b("");const w=P(()=>({id:e(i),type:"website",name:e(i)}));async function U(){d(c,void 0),d(n,"");try{const r=await tt({"@context":await at("metadata"),type:"fetch",actor:et(e(w))});rt(r.object)&&d(c,r.object,!0)}catch(r){throw d(n,String(r),!0),r}}V(E,{title:"Metadata Platform Example",description:"Sockethub's metadata platform takes a URL, fetches and parses it for any metadata.",children:(r,it)=>{var _=dt(),y=o($(_),2),S=p(y);Y(S,{label:"Website URL",id:"URL",placeholder:"https://example.com",get value(){return e(i)},set value(t){d(i,t,!0)}});var k=o(S,4);Q(k,{get actor(){return e(w)},get sockethubState(){return x}});var u=o(k,4),j=p(u);{let t=P(()=>!R().actorSet);X(j,{buttonAction:U,get disabled(){return e(t)},children:(a,l)=>{q();var h=H("Extract Metadata");s(a,h)}})}v(u);var O=o(u,2);{var T=t=>{var a=st(),l=o(p(a),4);Z(l,{get page(){return e(c)}}),v(a),s(t,a)},B=t=>{var a=C(),l=$(a);{var h=m=>{var g=ot(),W=p(g,!0);v(g),z(()=>D(W,e(n))),s(m,g)};F(l,m=>{e(n)&&m(h)},!0)}s(t,a)};F(O,t=>{e(c)?t(T):t(B,!1)})}v(y),s(r,_)}}),J(),M()}export{mt as component};
@@ -1 +1 @@
1
- {"version":"1769115136270"}
1
+ {"version":"1793631945049"}