···1-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-xYaDyaLn.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};
···1+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-cNEJntuD.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};