"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6136],{56136:(e,t,a)=>{function o(e){return{async fetch(t,a){let o,r=new Headers;for(let e in a.bodyMediaType&&"multipart/form-data"!==a.bodyMediaType&&r.append("Content-Type",a.bodyMediaType),a.header){let t=a.header[e];Array.isArray(t.value)?r.append(e,t.value.join(",")):r.append(e,t.value)}let n=a.proxyUrl?new URL(a.proxyUrl,document.baseURI):null;if(n&&(n.searchParams.append("url",t),t=n.toString()),a.bodyMediaType&&a.body){let t=e[a.bodyMediaType];if(!t)return{status:400,type:"text",data:`[Fumadocs] No adapter for ${a.bodyMediaType}, you need to specify one from 'createOpenAPI()'.`};o=t.encode(a)}for(let e in a.cookie){let t=a.cookie[e],o=[`${e}=${t.value}`];n&&n.origin!==window.location.origin&&o.push(`domain=${n.host}`),o.push("path=/","max-age=30"),document.cookie=o.join("; ")}return fetch(t,{method:a.method,cache:"no-cache",headers:r,body:o,signal:AbortSignal.timeout(1e4)}).then(async e=>{let t,a,o=e.headers.get("Content-Type")??"";return o.startsWith("application/json")?(t="json",a=await e.json()):(t=o.startsWith("text/html")?"html":"text",a=await e.text()),{status:e.status,type:t,data:a}}).catch(e=>{let t=e instanceof Error?`[${e.name}] ${e.message}`:e.toString();return{status:400,type:"text",data:`Client side error: ${t}`}})}}}a.r(t),a.d(t,{createBrowserFetcher:()=>o})}}]);