@sockethub/examples 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_app/immutable/assets/0.DcfK0tAS.css +1 -0
- package/build/_app/immutable/chunks/BJctjvPM.js +1 -0
- package/build/_app/immutable/chunks/{CbO4bo1j.js → BbNltU0J.js} +1 -1
- package/build/_app/immutable/chunks/{BFJazgM-.js → BoJm-rJp.js} +2 -2
- package/build/_app/immutable/chunks/{CgjHsrhs.js → BrzeKAzG.js} +2 -2
- package/build/_app/immutable/chunks/CDWD0DpS.js +1 -0
- package/build/_app/immutable/chunks/CT5jku5V.js +1 -0
- package/build/_app/immutable/chunks/{D5R3T3gW.js → CUkP7wPG.js} +1 -1
- package/build/_app/immutable/chunks/Cdx-st7a.js +1 -0
- package/build/_app/immutable/chunks/Cl-XOB7Z.js +1 -0
- package/build/_app/immutable/chunks/{BRcKhWZZ.js → Cy27bMkS.js} +1 -1
- package/build/_app/immutable/chunks/{BKtlB-ZE.js → DbhdhNIA.js} +22 -22
- package/build/_app/immutable/chunks/DmYLKglP.js +3 -0
- package/build/_app/immutable/chunks/Dn5i8FcP.js +1 -0
- package/build/_app/immutable/chunks/{BymJmDWJ.js → k-cRz8DS.js} +1 -1
- package/build/_app/immutable/entry/app.9VcJfFEV.js +2 -0
- package/build/_app/immutable/entry/start.CjxPNHHO.js +1 -0
- package/build/_app/immutable/nodes/0.CxDeLLNM.js +39 -0
- package/build/_app/immutable/nodes/1.vrN-G10-.js +1 -0
- package/build/_app/immutable/nodes/10.CkEG6ShK.js +1 -0
- package/build/_app/immutable/nodes/11.Dr5oRP_F.js +1 -0
- package/build/_app/immutable/nodes/12.Dhj1Bcc5.js +1 -0
- package/build/_app/immutable/nodes/2.CtT9BzdB.js +5 -0
- package/build/_app/immutable/nodes/3.DvLQTmd4.js +1 -0
- package/build/_app/immutable/nodes/4.Cy-sRRDt.js +1 -0
- package/build/_app/immutable/nodes/5.CC9kaqH_.js +2 -0
- package/build/_app/immutable/nodes/{5.D6ttn0N8.js → 6.ChLUpcIN.js} +1 -1
- package/build/_app/immutable/nodes/{3.DrGIkVu0.js → 7.Dp-S3Ioq.js} +1 -1
- package/build/_app/immutable/nodes/8.f8bTdAen.js +1 -0
- package/build/_app/immutable/nodes/{6.CkpDg7i6.js → 9.BfkSU2iC.js} +1 -1
- package/build/_app/version.json +1 -1
- package/build/caldav.html +10 -10
- package/build/carddav.html +10 -10
- package/build/dummy.html +10 -10
- package/build/email.html +40 -0
- package/build/feeds.html +10 -10
- package/build/index.html +10 -10
- package/build/instagram.html +40 -0
- package/build/irc.html +10 -10
- package/build/messenger.html +40 -0
- package/build/metadata.html +10 -10
- package/build/xmpp.html +10 -10
- package/package.json +4 -4
- package/build/_app/immutable/assets/0.DiwDnc-u.css +0 -1
- package/build/_app/immutable/chunks/BDxEtWDn.js +0 -1
- package/build/_app/immutable/chunks/C7zmhnYM.js +0 -1
- package/build/_app/immutable/chunks/CH5OY5MF.js +0 -1
- package/build/_app/immutable/chunks/Cko76dBZ.js +0 -1
- package/build/_app/immutable/chunks/FpM_-oX5.js +0 -1
- package/build/_app/immutable/chunks/wMyiGnQa.js +0 -1
- package/build/_app/immutable/entry/app.C88mAu2e.js +0 -2
- package/build/_app/immutable/entry/start.B1PB6bga.js +0 -1
- package/build/_app/immutable/nodes/0.BwQUhEGu.js +0 -39
- package/build/_app/immutable/nodes/1.C-zkRZjk.js +0 -1
- package/build/_app/immutable/nodes/2.8bzWQILm.js +0 -5
- package/build/_app/immutable/nodes/4.Clpm2HdH.js +0 -1
- package/build/_app/immutable/nodes/7.DrKGjs0l.js +0 -1
- package/build/_app/immutable/nodes/8.2NG23_e4.js +0 -1
- package/build/_app/immutable/nodes/9.D7zgVgYt.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1,2 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/C7zmhnYM.js";export{o as load_css,r as start};
|
|
@@ -1,39 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1,5 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1,2 +0,0 @@
|
|
|
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};
|