"use strict";var d=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var J=(e,r)=>{for(var s in r)d(e,s,{get:r[s],enumerable:!0})},K=(e,r,s,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of V(r))!G.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(t=Y(r,a))||t.enumerable});return e};var Q=e=>K(d({},"__esModule",{value:!0}),e);var ue={};J(ue,{BlobPlugin:()=>z,CustomEventPlugin:()=>b,DOMExceptionPlugin:()=>P,EventPlugin:()=>h,FilePlugin:()=>u,FormDataPlugin:()=>F,HeadersPlugin:()=>n,ImageDataPlugin:()=>B,ReadableStreamPlugin:()=>o,RequestPlugin:()=>U,ResponsePlugin:()=>M,URLPlugin:()=>k,URLSearchParamsPlugin:()=>T});module.exports=Q(ue);var v=require("seroval"),W=(0,v.createPlugin)({tag:"seroval-plugins/web/Blob",test(e){return typeof Blob=="undefined"?!1:e instanceof Blob},parse:{async async(e,r){return{type:await r.parse(e.type),buffer:await r.parse(await e.arrayBuffer())}}},serialize(e,r){return"new Blob(["+r.serialize(e.buffer)+"],{type:"+r.serialize(e.type)+"})"},deserialize(e,r){return new Blob([r.deserialize(e.buffer)],{type:r.deserialize(e.type)})}}),z=W;var S=require("seroval");function f(e){return{detail:e.detail,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}}var X=(0,S.createPlugin)({tag:"seroval-plugins/web/CustomEvent",test(e){return typeof CustomEvent=="undefined"?!1:e instanceof CustomEvent},parse:{sync(e,r){return{type:r.parse(e.type),options:r.parse(f(e))}},async async(e,r){return{type:await r.parse(e.type),options:await r.parse(f(e))}},stream(e,r){return{type:r.parse(e.type),options:r.parse(f(e))}}},serialize(e,r){return"new CustomEvent("+r.serialize(e.type)+","+r.serialize(e.options)+")"},deserialize(e,r){return new CustomEvent(r.deserialize(e.type),r.deserialize(e.options))}}),b=X;var R=require("seroval"),Z=(0,R.createPlugin)({tag:"seroval-plugins/web/DOMException",test(e){return typeof DOMException=="undefined"?!1:e instanceof DOMException},parse:{sync(e,r){return{name:r.parse(e.name),message:r.parse(e.message)}},async async(e,r){return{name:await r.parse(e.name),message:await r.parse(e.message)}},stream(e,r){return{name:r.parse(e.name),message:r.parse(e.message)}}},serialize(e,r){return"new DOMException("+r.serialize(e.message)+","+r.serialize(e.name)+")"},deserialize(e,r){return new DOMException(r.deserialize(e.message),r.deserialize(e.name))}}),P=Z;var N=require("seroval");function m(e){return{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}}var $=(0,N.createPlugin)({tag:"seroval-plugins/web/Event",test(e){return typeof Event=="undefined"?!1:e instanceof Event},parse:{sync(e,r){return{type:r.parse(e.type),options:r.parse(m(e))}},async async(e,r){return{type:await r.parse(e.type),options:await r.parse(m(e))}},stream(e,r){return{type:r.parse(e.type),options:r.parse(m(e))}}},serialize(e,r){return"new Event("+r.serialize(e.type)+","+r.serialize(e.options)+")"},deserialize(e,r){return new Event(r.deserialize(e.type),r.deserialize(e.options))}}),h=$;var E=require("seroval"),x=(0,E.createPlugin)({tag:"seroval-plugins/web/File",test(e){return typeof File=="undefined"?!1:e instanceof File},parse:{async async(e,r){return{name:await r.parse(e.name),options:await r.parse({type:e.type,lastModified:e.lastModified}),buffer:await r.parse(await e.arrayBuffer())}}},serialize(e,r){return"new File(["+r.serialize(e.buffer)+"],"+r.serialize(e.name)+","+r.serialize(e.options)+")"},deserialize(e,r){return new File([r.deserialize(e.buffer)],r.deserialize(e.name),r.deserialize(e.options))}}),u=x;var y=require("seroval");function c(e){let r=[];return e.forEach((s,t)=>{r.push([t,s])}),r}var l={},ee=(0,y.createPlugin)({tag:"seroval-plugins/web/FormDataFactory",test(e){return e===l},parse:{sync(){},async async(){return await Promise.resolve(void 0)},stream(){}},serialize(e,r){return r.createEffectfulFunction(["e","f","i","s","t"],"f=new FormData;for(i=0,s=e.length;i{r.push([t,s])}),r}var ae=(0,D.createPlugin)({tag:"seroval-plugins/web/Headers",test(e){return typeof Headers=="undefined"?!1:e instanceof Headers},parse:{sync(e,r){return r.parse(g(e))},async async(e,r){return await r.parse(g(e))},stream(e,r){return r.parse(g(e))}},serialize(e,r){return"new Headers("+r.serialize(e)+")"},deserialize(e,r){return new Headers(r.deserialize(e))}}),n=ae;var I=require("seroval"),te=(0,I.createPlugin)({tag:"seroval-plugins/web/ImageData",test(e){return typeof ImageData=="undefined"?!1:e instanceof ImageData},parse:{sync(e,r){return{data:r.parse(e.data),width:r.parse(e.width),height:r.parse(e.height),options:r.parse({colorSpace:e.colorSpace})}},async async(e,r){return{data:await r.parse(e.data),width:await r.parse(e.width),height:await r.parse(e.height),options:await r.parse({colorSpace:e.colorSpace})}},stream(e,r){return{data:r.parse(e.data),width:r.parse(e.width),height:r.parse(e.height),options:r.parse({colorSpace:e.colorSpace})}}},serialize(e,r){return"new ImageData("+r.serialize(e.data)+","+r.serialize(e.width)+","+r.serialize(e.height)+","+r.serialize(e.options)+")"},deserialize(e,r){return new ImageData(r.deserialize(e.data),r.deserialize(e.width),r.deserialize(e.height),r.deserialize(e.options))}}),B=te;var i=require("seroval"),p={},se=(0,i.createPlugin)({tag:"seroval-plugins/web/ReadableStreamFactory",test(e){return e===p},parse:{sync(){},async async(){return await Promise.resolve(void 0)},stream(){}},serialize(e,r){return r.createFunction(["d"],"new ReadableStream({start:"+r.createEffectfulFunction(["c"],"d.on({next:"+r.createEffectfulFunction(["v"],"c.enqueue(v)")+",throw:"+r.createEffectfulFunction(["v"],"c.error(v)")+",return:"+r.createEffectfulFunction([],"c.close()")+"})")+"})")},deserialize(){return p}});function C(e){let r=(0,i.createStream)(),s=e.getReader();async function t(){try{let a=await s.read();a.done?r.return(a.value):(r.next(a.value),await t())}catch(a){r.throw(a)}}return t().catch(()=>{}),r}var ne=(0,i.createPlugin)({tag:"seroval/plugins/web/ReadableStream",extends:[se],test(e){return typeof ReadableStream=="undefined"?!1:e instanceof ReadableStream},parse:{sync(e,r){return{factory:r.parse(p),stream:r.parse((0,i.createStream)())}},async async(e,r){return{factory:await r.parse(p),stream:await r.parse(C(e))}},stream(e,r){return{factory:r.parse(p),stream:r.parse(C(e))}}},serialize(e,r){return"("+r.serialize(e.factory)+")("+r.serialize(e.stream)+")"},deserialize(e,r){let s=r.deserialize(e.stream);return new ReadableStream({start(t){s.on({next(a){t.enqueue(a)},throw(a){t.error(a)},return(){t.close()}})}})}}),o=ne;var O=require("seroval");function L(e,r){return{body:r,cache:e.cache,credentials:e.credentials,headers:e.headers,integrity:e.integrity,keepalive:e.keepalive,method:e.method,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy}}var ie=(0,O.createPlugin)({tag:"seroval-plugins/web/Request",extends:[o,n],test(e){return typeof Request=="undefined"?!1:e instanceof Request},parse:{async async(e,r){return{url:await r.parse(e.url),options:await r.parse(L(e,e.body?await e.clone().arrayBuffer():null))}},stream(e,r){return{url:r.parse(e.url),options:r.parse(L(e,e.clone().body))}}},serialize(e,r){return"new Request("+r.serialize(e.url)+","+r.serialize(e.options)+")"},deserialize(e,r){return new Request(r.deserialize(e.url),r.deserialize(e.options))}}),U=ie;var H=require("seroval");function q(e){return{headers:e.headers,status:e.status,statusText:e.statusText}}var oe=(0,H.createPlugin)({tag:"seroval-plugins/web/Response",extends:[o,n],test(e){return typeof Response=="undefined"?!1:e instanceof Response},parse:{async async(e,r){return{body:await r.parse(e.body?await e.clone().arrayBuffer():null),options:await r.parse(q(e))}},stream(e,r){return{body:r.parse(e.clone().body),options:r.parse(q(e))}}},serialize(e,r){return"new Response("+r.serialize(e.body)+","+r.serialize(e.options)+")"},deserialize(e,r){return new Response(r.deserialize(e.body),r.deserialize(e.options))}}),M=oe;var A=require("seroval"),le=(0,A.createPlugin)({tag:"seroval-plugins/web/URLSearchParams",test(e){return typeof URLSearchParams=="undefined"?!1:e instanceof URLSearchParams},parse:{sync(e,r){return r.parse(e.toString())},async async(e,r){return await r.parse(e.toString())},stream(e,r){return r.parse(e.toString())}},serialize(e,r){return"new URLSearchParams("+r.serialize(e)+")"},deserialize(e,r){return new URLSearchParams(r.deserialize(e))}}),T=le;var _=require("seroval"),pe=(0,_.createPlugin)({tag:"seroval-plugins/web/URL",test(e){return typeof URL=="undefined"?!1:e instanceof URL},parse:{sync(e,r){return r.parse(e.href)},async async(e,r){return await r.parse(e.href)},stream(e,r){return r.parse(e.href)}},serialize(e,r){return"new URL("+r.serialize(e)+")"},deserialize(e,r){return new URL(r.deserialize(e))}}),k=pe;