···11-import{n as e,o as t,q as s,r,u as n,v as a,w as o,x as i,y as c,z as l,p as d,k as u,t as p,i as h,a as f,b as y,c as v,d as b,A as g}from"./index-DPDFpGOB.js";function w(e){}function m(e=1){}function x(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function k(o,i,c,l,d){var u,p=o,h="";e((()=>{h!==(h=i()??"")&&(void 0!==u&&(a(u),u=void 0),""!==h&&(u=t((()=>{var e=s(h+"");r(n(e),e.lastChild),p.before(e)}))))}))}function j(e){null===o&&x(),function(e){null===o&&x(),i((()=>{const t=c(e);if("function"==typeof t)return t}))}((()=>()=>c(e)))}const C=({service:e,fetch:t=fetch})=>async(s,r)=>{const n=new URL(s,e);return t(n,r)},z=(e,t)=>{let s;for(const r in t){const n=t[r];null!==n&&(s??=new Headers(e),s.has(r)||s.set(r,n))}return s??e};class O extends Error{constructor(e,{kind:t=`HTTP error ${e}`,description:s="Unspecified error description",headers:r,cause:n}={}){super(`${t} > ${s}`,{cause:n}),this.name="XRPCError",this.status=e,this.kind=t,this.description=s,this.headers=r||{}}}class ${constructor({handler:e,proxy:t}){this.handle=(e=>"object"==typeof e?e.handle.bind(e):e)(e),this.proxy=t}get(e,t){return this.request({type:"get",nsid:e,...t})}call(e,t){return this.request({type:"post",nsid:e,...t})}async request(e){const t=e.data,s=`/xrpc/${e.nsid}`+A(e.params),r=E(t),n=await this.handle(s,{method:e.type,signal:e.signal,body:r?JSON.stringify(t):t,headers:z(e.headers,{"content-type":r?"application/json":null,"atproto-proxy":q(this.proxy)})}),a=n.status,o=Object.fromEntries(n.headers),i=o["content-type"];let c,l;i&&(i.startsWith("application/json")?c=n.json():i.startsWith("text/")&&(c=n.text()));try{l=await(c||n.arrayBuffer().then((e=>new Uint8Array(e))))}catch(d){throw new O(2,{cause:d,kind:"InvalidResponse",description:"Failed to parse response body",headers:o})}if(200===a)return{data:l,headers:o};if(H(l))throw new O(a,{kind:l.error,description:l.message,headers:o});throw new O(a,{headers:o})}}const q=e=>e?`${e.service}#${e.type}`:null,A=e=>{let t;for(const s in e){const r=e[s];if(void 0!==r)if(t??=new URLSearchParams,Array.isArray(r))for(let e=0,n=r.length;e<n;e++){const n=r[e];t.append(s,""+n)}else t.set(s,""+r)}return t?"?"+t.toString():""},E=e=>{if("object"!=typeof e||null===e)return!1;if("toJSON"in e)return!0;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},H=e=>{if("object"!=typeof e||null===e)return!1;const t=typeof e.error,s=typeof e.message;return!("undefined"!==t&&"string"!==t||"undefined"!==s&&"string"!==s)},P=e=>e.replace(/[<"&]/g,(e=>"&#"+e.charCodeAt(0)+";"));var R=(e,t)=>{navigator.clipboard.writeText(t.code).catch((()=>alert("Failed to copy to clipboard")))},S=v('<div class="code-block svelte-1ayzm2r"><pre class="svelte-1ayzm2r"><code> </code></pre> <div class="actions svelte-1ayzm2r"><button title="Copy" aria-label="Copy" class="action-button svelte-1ayzm2r"><svg class="icon svelte-1ayzm2r" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="2" d="M15 5h4v16H5V5h4m0-2h6v4H9V3Z"></path></svg></button></div></div>');function U(e,t){d(t,!0);var s=S(),r=b(s),n=b(r),a=b(n),o=u(r,2);b(o).__click=[R,t],p((()=>h(a,t.code))),f(e,s),y()}l(["click"]);var _=v('<div class="guide svelte-13uuyu6"><h4 class="guide-header svelte-13uuyu6"> </h4> <!></div>');function T(e,t){d(t,!0);var s=_(),r=b(s),n=b(r),a=u(r,2);g(a,(()=>t.children)),p((()=>h(n,t.title))),f(e,s),y()}var B=v('<ol class="guide-instructions svelte-10td8te"><!></ol>');function F(e,t){d(t,!0);var s=B(),r=b(s);g(r,(()=>t.children)),f(e,s),y()}export{U as C,T as G,$ as X,O as a,F as b,P as e,k as h,m as n,j as o,w as r,C as s};
···11+import{t as e,m as t,r as s,n as r,o as n,q as a,v as o,w as i,x as c,p as l,f as d,k as p,c as h,i as u,a as f,b as v,y,z as g}from"./index-CD_0uzJz.js";function w(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function b(o,i,c=!1,l=!1,d=!1){var p=o,h="";e(()=>{var e=t;if(h!==(h=i()??"")&&(null!==e.nodes&&(s(e.nodes.start,e.nodes.end),e.nodes=null),""!==h)){var o=h+"";c?o=`<svg>${o}</svg>`:l&&(o=`<math>${o}</math>`);var d=r(o);if((c||l)&&(d=a(d)),n(a(d),d.lastChild),c||l)for(;a(d);)p.before(a(d));else p.before(d)}})}function k(e){null===o&&w(),function(e){null===o&&w(),i(()=>{const t=c(e);if("function"==typeof t)return t})}(()=>()=>c(e))}const x=({service:e,fetch:t=fetch})=>async(s,r)=>{const n=new URL(s,e);return await t(n,r)},m=(e,t)=>{let s;for(const r in t){const n=t[r];null!==n&&(s??=new Headers(e),s.has(r)||s.set(r,n))}return s??e};class j extends Error{constructor(e,{kind:t=`HTTP error ${e}`,description:s="Unspecified error description",headers:r,cause:n}={}){super(`${t} > ${s}`,{cause:n}),this.name="XRPCError",this.status=e,this.kind=t,this.description=s,this.headers=r||{}}}class ${constructor({handler:e,proxy:t}){this.handle=(e=>"object"==typeof e?e.handle.bind(e):e)(e),this.proxy=t}get(e,t){return this.request({type:"get",nsid:e,...t})}call(e,t){return this.request({type:"post",nsid:e,...t})}async request(e){const t=e.data,s=`/xrpc/${e.nsid}`+O(e.params),r=q(t),n=await this.handle(s,{method:e.type,signal:e.signal,body:r?JSON.stringify(t):t,headers:m(e.headers,{"content-type":r?"application/json":null,"atproto-proxy":C(this.proxy)})}),a=n.status,o=Object.fromEntries(n.headers),i=o["content-type"];let c,l;i&&(i.startsWith("application/json")?c=n.json():i.startsWith("text/")&&(c=n.text()));try{l=await(c||n.arrayBuffer().then(e=>new Uint8Array(e)))}catch(d){throw new j(2,{cause:d,kind:"InvalidResponse",description:"Failed to parse response body",headers:o})}if(200===a)return{data:l,headers:o};if(A(l))throw new j(a,{kind:l.error,description:l.message,headers:o});throw new j(a,{headers:o})}}const C=e=>e?`${e.service}#${e.type}`:null,O=e=>{let t;for(const s in e){const r=e[s];if(void 0!==r)if(t??=new URLSearchParams,Array.isArray(r))for(let e=0,n=r.length;e<n;e++){const n=r[e];t.append(s,""+n)}else t.set(s,""+r)}return t?"?"+t.toString():""},q=e=>{if("object"!=typeof e||null===e)return!1;if("toJSON"in e)return!0;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},A=e=>{if("object"!=typeof e||null===e)return!1;const t=typeof e.error,s=typeof e.message;return!("undefined"!==t&&"string"!==t||"undefined"!==s&&"string"!==s)},E=e=>e.replace(/[<"&]/g,e=>"&#"+e.charCodeAt(0)+";");var H=d('<div class="code-block svelte-ipr7k2"><pre class="svelte-ipr7k2"><code> </code></pre> <div class="actions svelte-ipr7k2"><button title="Copy" aria-label="Copy" class="action-button svelte-ipr7k2"><svg class="icon svelte-ipr7k2" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="square" stroke-width="2" d="M15 5h4v16H5V5h4m0-2h6v4H9V3Z"></path></svg></button></div></div>');function P(t,s){l(s,!0);var r=H(),n=h(r),a=h(n),o=h(a),i=p(n,2);h(i).__click=()=>{navigator.clipboard.writeText(s.code).catch(()=>alert("Failed to copy to clipboard"))},e(()=>u(o,s.code)),f(t,r),v()}y(["click"]);var R=d('<div class="guide svelte-1wxv0ke"><h4 class="guide-header svelte-1wxv0ke"> </h4> <!></div>');function S(t,s){var r=R(),n=h(r),a=h(n),o=p(n,2);g(o,()=>s.children),e(()=>u(a,s.title)),f(t,r)}var U=d('<ol class="guide-instructions svelte-mki4x9"><!></ol>');function _(e,t){var s=U(),r=h(s);g(r,()=>t.children),f(e,s)}export{P as C,S as G,$ as X,j as a,_ as b,E as e,b as h,k as o,x as s};