ot-gateway 0.9.0 → 0.11.0
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/VERSION +1 -1
- package/apps/gateway/src/main.mjs +683 -211
- package/apps/web/out/404/index.html +1 -0
- package/apps/web/out/404.html +1 -1
- package/apps/web/out/__next.__PAGE__.txt +28 -26
- package/apps/web/out/__next._full.txt +23 -21
- package/apps/web/out/__next._tree.txt +2 -2
- package/apps/web/out/_next/static/chunks/03_syxbyimnor.js +1 -0
- package/apps/web/out/_next/static/chunks/1-_c1aqhwim5t.css +1 -0
- package/apps/web/out/_next/static/chunks/10i96w66fwhkr.js +31 -0
- package/apps/web/out/_next/static/chunks/1bh2-eknm9t8k.js +1 -0
- package/apps/web/out/_next/static/chunks/259s9pubapqip.js +1 -0
- package/apps/web/out/_next/static/chunks/25dqruymh00rk.js +1 -0
- package/apps/web/out/_next/static/chunks/2r_w-j--qdreu.js +22 -0
- package/apps/web/out/_next/static/chunks/3b0ql-jh_xg_k.js +12 -0
- package/apps/web/out/_next/static/chunks/3o5cr1y-sws-u.js +1 -0
- package/apps/web/out/_not-found/__next._full.txt +21 -19
- package/apps/web/out/_not-found/__next._not-found.__PAGE__.txt +27 -25
- package/apps/web/out/_not-found/__next._tree.txt +2 -2
- package/apps/web/out/_not-found/index.html +1 -0
- package/apps/web/out/_not-found/index.txt +22 -0
- package/apps/web/out/index.html +1 -1
- package/apps/web/out/index.txt +23 -21
- package/apps/web/out/messages/__next._full.txt +27 -0
- package/apps/web/out/messages/__next._tree.txt +4 -0
- package/apps/web/out/messages/__next.messages.__PAGE__.txt +33 -0
- package/apps/web/out/messages/index.html +1 -0
- package/apps/web/out/messages/index.txt +27 -0
- package/apps/web/out/points/__next._full.txt +27 -0
- package/apps/web/out/points/__next._tree.txt +4 -0
- package/apps/web/out/points/__next.points.__PAGE__.txt +33 -0
- package/apps/web/out/points/index.html +1 -0
- package/apps/web/out/points/index.txt +27 -0
- package/apps/web/out/settings/__next._full.txt +27 -0
- package/apps/web/out/settings/__next._tree.txt +4 -0
- package/apps/web/out/settings/__next.settings.__PAGE__.txt +33 -0
- package/apps/web/out/settings/index.html +1 -0
- package/apps/web/out/settings/index.txt +27 -0
- package/examples/gateway.json +37 -37
- package/package.json +1 -1
- package/packaging/compose.yaml +4 -2
- package/apps/web/out/_next/static/chunks/0csls39kpdzgy.js +0 -22
- package/apps/web/out/_next/static/chunks/162tvyao0-i49.js +0 -12
- package/apps/web/out/_next/static/chunks/29-6f2cs5ih9t.css +0 -1
- package/apps/web/out/_next/static/chunks/3oyy-mvhhfmq3.js +0 -31
- package/apps/web/out/_not-found.html +0 -1
- package/apps/web/out/_not-found.txt +0 -20
- /package/apps/web/out/_next/static/{POtpNv-gjWNowyFSmxfAr → r5hL3CDxDJkHMarR92YKm}/_buildManifest.js +0 -0
- /package/apps/web/out/_next/static/{POtpNv-gjWNowyFSmxfAr → r5hL3CDxDJkHMarR92YKm}/_clientMiddlewareManifest.js +0 -0
- /package/apps/web/out/_next/static/{POtpNv-gjWNowyFSmxfAr → r5hL3CDxDJkHMarR92YKm}/_ssgManifest.js +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,39798,e=>{"use strict";let t,r,n,i,s,a,o,l,u,c,d,f,h,p,m,g,b,y,v,x,w,S,k,_,E,C,I,A,j,T,O,N,M,$,U,B,P,R,F;var L,z,D,H,J,W,q=e.i(94115);let K=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let e=0,n=t.length;e<n;e++)r=t[e](r);return r}}},V={pipe(){return K(this,arguments)}},G=function(){function e(){}return e.prototype=V,e}(),Y=function(e,t){if("function"==typeof e)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,r){return arguments.length>=2?t(e,r):function(r){return t(r,e)}};case 3:return function(e,r,n){return arguments.length>=3?t(e,r,n):function(n){return t(n,e,r)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(e){return t(e,...r)}}}},Z=e=>e,X=e=>()=>e,Q=X(!0),ee=X(!1),et=X(void 0);function er(e){let t=new WeakMap;return r=>{let n=t.get(r);if(void 0!==n)return n;let i=e(r);return t.set(r,i),i}}function en(e){let t=new WeakMap;return r=>{let n=t.get(r);if(void 0!==n)return n;let i=e(r);return t.set(r,i),i!==r&&t.set(i,i),i}}let ei=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");let r=Object.getPrototypeOf(e),n=r;for(;null!==n&&n!==Object.prototype;){let e=Reflect.ownKeys(n);for(let r=0;r<e.length;r++)t.add(e[r]);n=Object.getPrototypeOf(n)}return t.has("constructor")&&"function"==typeof e.constructor&&r===e.constructor.prototype&&t.delete("constructor"),t},es=new WeakSet,ea=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),eo=e=>e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer,el=e=>{try{return new Uint8Array(e)}catch{return}},eu=0;function ec(e){return"string"==typeof e}function ed(e){return"number"==typeof e}function ef(e){return"boolean"==typeof e}function eh(e){return"bigint"==typeof e}function ep(e){return"symbol"==typeof e}function em(e){return"function"==typeof e}function eg(e){return void 0!==e}function eb(e){return null!=e}function ey(e){return!1}function ev(e){return!0}function ex(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ew(e){return"object"==typeof e&&null!==e||em(e)}let eS=Y(2,(e,t)=>ew(e)&&t in e),ek=Y(2,(e,t)=>eS(e,"_tag")&&e._tag===t);function e_(e){return eS(e,Symbol.iterator)||ec(e)}(e,t)=>r=>e(r)||t(r);let eE="~effect/Hash",eC=e=>{switch(typeof e){case"number":return eM(e);case"bigint":return e$(e.toString(10));case"string":return e$(e);case"function":case"object":if(null===e);else if(e instanceof Date){if(Number.isNaN(e.getTime()))return e$("Invalid Date");return e$(e.toISOString())}else{let t;if(e instanceof RegExp)return e$(e.toString());if(es.has(e))return eI(e);let r=eH.get(e);if(void 0!==r)return r;if(eJ.has(e))return eu++,e$("[Circular]");eJ.add(e);let n=eu;try{if(eO(e))t=e[eE]();else if("function"==typeof e)t=eI(e);else if(eo(e)){let r=el(e);t=void 0===r?eI(e):eR(r)}else t=e instanceof DataView?eR(ea(e)):Array.isArray(e)||ArrayBuffer.isView(e)?eR(e):e instanceof Map?eF(e):e instanceof Set?ez(e):eB(e)}finally{eJ.delete(e)}return n===eu&&eH.set(e,t),t}}return eT(eA(e$(String(e))))},eI=e=>(eD.has(e)||eD.set(e,eT(0x100000000*Math.random()|0)),eD.get(e)),eA=e=>(e^=e>>>16,e=Math.imul(e,0x85ebca6b),e^=e>>>13,(e=Math.imul(e,0xc2b2ae35))^e>>>16),ej=Y(2,(e,t)=>eA(Math.imul(e,0x9e3779b1)+Math.imul(t,0x85ebca6b))),eT=e=>0xbfffffff&e|e>>>1&0x40000000,eO=e=>eS(e,eE)&&"function"==typeof e[eE],eN=new DataView(new ArrayBuffer(8)),eM=e=>{let t=0|e;return t===e?eT(t):(eN.setFloat64(0,e!=e?0/0:e),eT(ej(eN.getInt32(0),eN.getInt32(4))))},e$=e=>{let t=5381,r=e.length;for(;r;)t=33*t^e.charCodeAt(--r);return eT(t)},eU=(e,t)=>{let r=12289;for(let n of t)r^=ej(eC(n),eC(e[n]));return eT(r)},eB=e=>eU(e,ei(e)),eP=(e,t)=>r=>{let n=e;for(let e of r)n^=t(e);return eT(n)},eR=e=>{let t=6151;for(let r of e)t=ej(t,eC(r));return eT(t)},eF=eP(e$("Map"),([e,t])=>ej(eC(e),eC(t))),eL=e$("Set"),ez=eP(eL,e=>ej(eL,eC(e))),eD=new WeakMap,eH=new WeakMap,eJ=new WeakSet,eW="~effect/Equal";function eq(){return 1==arguments.length?e=>eK(e,arguments[0]):eK(arguments[0],arguments[1])}function eK(e,t){if(e===t)return!0;if(null==e||null==t)return!1;let r=typeof e;return r===typeof t&&("number"===r&&e!=e&&t!=t||!("object"!==r&&"function"!==r||es.has(e)||es.has(t))&&function(e,t){let r=eG.length;for(let n=r;n-- >0;)if(eG[n]===e&&eY[n]===t)return!0;if(r)return eV(e,t);let n=eZ.get(e);n||eZ.set(e,n=new WeakMap);let i=n.get(t);return void 0===i&&n.set(t,i=eV(e,t)),i}(e,t))}function eV(e,t){eG.push(e),eY.push(t);try{return function(e,t){if(eC(e)!==eC(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let r=e.getTime(),n=t.getTime();return r===n||Number.isNaN(r)&&Number.isNaN(n)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let r=e2(e);if(r!==e2(t)||"function"==typeof e&&!r)return!1;if(r)return e[eW](t);if(Array.isArray(e))return!!Array.isArray(t)&&e.length===t.length&&function(e,t){for(let r=0;r<e.length;r++)if(!eK(e[r],t[r]))return!1;return!0}(e,t);if(eo(e)){if(!eo(t)||e instanceof ArrayBuffer!=t instanceof ArrayBuffer)return!1;let r=el(e),n=el(t);return void 0!==r&&void 0!==n&&eX(r,n)}if(ArrayBuffer.isView(e)){let r=e instanceof DataView;return!!ArrayBuffer.isView(t)&&e.byteLength===t.byteLength&&r===t instanceof DataView&&(r?eX(ea(e),ea(t)):eX(e,t))}else if(e instanceof Map)return t instanceof Map&&e.size===t.size&&eQ(e,t,e0,e1);else if(e instanceof Set)return t instanceof Set&&e.size===t.size&&eQ(e,t,eC,eK);var n=e,i=t;let s=ei(n),a=ei(i);if(s.size!==a.size)return!1;for(let e of s)if(!a.has(e)||!eK(n[e],i[e]))return!1;return!0}(e,t)}finally{eG.pop(),eY.pop()}}let eG=[],eY=[],eZ=new WeakMap;function eX(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function eQ(e,t,r,n){let i=new Map,s=0;for(let e of t){let t=r(e),n=i.get(t);n?n.push(e):i.set(t,[e]),s++}e:for(let t of e){let e=i.get(r(t));if(e){for(let r=0;r<e.length;r++)if(n(t,e[r])){e[r]=e[e.length-1],e.pop(),s--;continue e}}return!1}return 0===s}let e0=e=>eC(e[0]),e1=(e,t)=>eK(e[0],t[0])&&eK(e[1],t[1]),e2=e=>eS(e,eW)&&"function"==typeof e[eW],e3=e=>(es.add(e),e),e5=Symbol.for("~effect/Redactable");function e4(e){return eS(e,e5)?e6(e):e}function e6(e){return e[e5](globalThis[e8]?.context??e7)}let e8="~effect/Fiber/currentFiber",e9=new Map,e7={"~effect/Context":{},base:e9,depth:0,mapUnsafe:e9,pipe(){return K(this,arguments)}};function te(e,t){let r=t?.space??0,n=new WeakSet,i=r?"number"==typeof r?" ".repeat(r):r:"",s=(e,t)=>{let r=e?.constructor;return r&&r!==Object.prototype.constructor&&r.name?`${r.name}(${t})`:t};return function e(r,a=0){try{return function(r,a=0){if("string"==typeof r)return JSON.stringify(r);if("number"==typeof r||null==r||"boolean"==typeof r||"symbol"==typeof r)return String(r);if("bigint"==typeof r)return String(r)+"n";if("object"==typeof r||"function"==typeof r){let o;if(n.has(r))return tt;if(n.add(r),e5 in r)o=e(e6(r),a);else if(Array.isArray(r)){let t,n;o=!i||r.length<=1?`[${r.map(t=>e(t,a)).join(",")}]`:`[
|
|
2
|
-
${t=a+1,i.repeat(t)}${r.map(t=>e(t,a+1)).join(",\n"+(n=a+1,i.repeat(n)))}
|
|
3
|
-
${i.repeat(a)}]`}else if(r instanceof Date)o=tn(r);else if(!t?.ignoreToString&&eS(r,"toString")&&"function"==typeof r.toString&&r.toString!==Object.prototype.toString&&r.toString!==Array.prototype.toString){let t=function(e){try{let t=e.toString();return"string"==typeof t?t:String(t)}catch{return"[toString threw]"}}(r);o=r instanceof Error&&void 0!==r.cause?`${t} (cause: ${e(r.cause,a)})`:t}else if(Symbol.iterator in r)o=`${r.constructor.name}(${e(Array.from(r),a)})`;else{let t=(e=>{try{return Reflect.ownKeys(e)}catch{return["[ownKeys threw]"]}})(r);if(!i||t.length<=1){let n=`{${t.map(t=>`${tr(t)}:${e(ti(r,t),a)}`).join(",")}}`;o=s(r,n)}else{let n=`{
|
|
4
|
-
${t.map(t=>{let n;return`${n=a+1,i.repeat(n)}${tr(t)}: ${e(ti(r,t),a+1)}`}).join(",\n")}
|
|
5
|
-
${i.repeat(a)}}`;o=s(r,n)}}return n.delete(r),o}return String(r)}(r,a)}catch{return("object"==typeof r&&null!==r||"function"==typeof r)&&n.delete(r),"[inspection threw]"}}(e,0)}let tt="[Circular]";function tr(e){return"string"==typeof e?JSON.stringify(e):String(e)}function tn(e){try{return e.toISOString()}catch{return"Invalid Date"}}function ti(e,t){try{return e[t]}catch{return"[property access threw]"}}function ts(e,t){let r=[],n=new WeakMap;return JSON.stringify(e,function(e,t){let i=Object.getOwnPropertyDescriptor(n.get(this)??this,e)?.value,s=eS(i,e5)?e4(i):e4(t);if("bigint"==typeof s)return te(s);if("object"!=typeof s||null===s)return s;let a=s instanceof Error&&!eS(s,"toJSON")?{...s,name:s.name,message:s.message}:s;for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(s))return;if(r.push(s),a!==s&&r.push(a),!function(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}(a)||function(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}(a))return a;let o=function(e){let t=Array.isArray(e)?[]:{};for(let r of Array.isArray(e)?Array.from({length:e.length},(e,t)=>String(t)):Object.keys(e))Object.defineProperty(t,r,{enumerable:!0,get:()=>{let t=Reflect.get(e,r);return Object.getOwnPropertyDescriptor(e,r)?.get!==void 0?e4(t):t}});return t}(a);return n.set(o,a),r.push(o),o},t?.space)??"null"}let ta=Symbol.for("nodejs.util.inspect.custom"),to=e=>{try{if(e=e4(e),eS(e,"toJSON")&&em(e.toJSON)&&0===e.toJSON.length)return e.toJSON();if(Array.isArray(e))return e.map(to);return e}catch{return"[toJSON threw]"}},tl={toJSON(){return to(this)},[ta](){return this.toJSON()},toString(){return te(this.toJSON())}};class tu{[ta](){return this.toJSON()}toString(){return te(this.toJSON())}}let tc=void 0===(n=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"))?Object.isExtensible(Error):Object.hasOwn(n,"writable")?!0===n.writable:void 0!==n.set,td=e=>{tc&&(Error.stackTraceLimit=e)};class tf{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}}let th=(()=>{let e="~effect/Utils/internal",t={[e]:e=>e()},r={[e]:e=>e()},n=Error.stackTraceLimit;if(0===n)return r[e];td(2);let i=t[e](()=>Error());return td(n),i.stack?.includes(e)===!0?t[e]:r[e]})();function tp(e,t,r){"__proto__"===t?Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[t]=r}function tm(e,t){if(!Object.hasOwn(t,"__proto__"))return void Object.assign(e,t);for(let r of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,r)&&tp(e,r,t[r])}let tg="~effect/Effect",tb="~effect/Exit",ty=`${tg}/identifier`,tv=`${tg}/args`,tx=`${tg}/evaluate`,tw=`${tg}/successCont`,tS=`${tg}/failureCont`,tk=`${tg}/ensureCont`,t_=Symbol.for("effect/Effect/Yield"),tE={pipe(){return K(this,arguments)},toJSON(){return{...this}},toString(){return te(this.toJSON(),{ignoreToString:!0,space:2})},[ta](){return this.toJSON()}},tC={[tg]:{_A:Z,_E:Z,_R:Z},...tE,[Symbol.iterator](){return new tf(this)},toJSON(){return{_id:"Effect",op:this[ty],...tv in this?{args:this[tv]}:void 0}}},tI=e=>eS(e,tg),tA="~effect/Cause",tj="~effect/Cause/Reason",tT=e=>eS(e,tA);class tO{constructor(e){this[tA]=tA,this.reasons=e}pipe(){return K(this,arguments)}toJSON(){return{_id:"Cause",reasons:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${te(this.reasons)})`}[ta](){return this.toJSON()}[eW](e){return tT(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,r)=>eq(t,e.reasons[r]))}[eE](){return eR(this.reasons)}}let tN=new WeakMap;class tM{[tj];annotations;_tag;constructor(e,t,r){if(this[tj]=tj,this._tag=e,t!==t$&&"object"==typeof r&&null!==r&&t.size>0){let e=tN.get(r);e&&(t=new Map([...e,...t])),tN.set(r,t)}this.annotations=t}annotate(e,t){if(0===e.mapUnsafe.size)return this;let r=new Map(this.annotations);if(e.mapUnsafe.forEach((e,n)=>{t?.overwrite!==!0&&r.has(n)||r.set(n,e)}),t?.overwrite!==!0&&r.size===this.annotations.size)return this;let n=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return n.annotations=r,n}pipe(){return K(this,arguments)}toString(){return te(this)}[ta](){return this.toString()}}let t$=new Map;class tU extends tM{constructor(e,t=t$){super("Fail",t,e),this.error=e}toString(){return`Fail(${te(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[eW](e){return tJ(e)&&eq(this.error,e.error)&&eq(this.annotations,e.annotations)}[eE](){return ej(e$(this._tag))(ej(eC(this.error))(eC(this.annotations)))}}let tB=e=>new tO(e),tP=Y(2,(e,t)=>{if(0===e.reasons.length)return t;if(0===t.reasons.length)return e;let r=new tO(((e,t)=>{let r=new Map,n=[];for(let i of e.concat(t)){let e=eC(i),t=r.get(e);if(void 0===t)r.set(e,[i]);else{if(t.some(e=>eq(e,i)))continue;t.push(i)}n.push(i)}return n})(e.reasons,t.reasons));return eq(e,r)?e:r}),tR=(e,t)=>{let r=e.reasons.slice();for(let e of t.reasons)tq(e)&&!r.some(t=>tq(t)&&t.fiberId===e.fiberId&&t.annotations===e.annotations)&&r.push(e);return r.length===e.reasons.length?e:new tO(r)},tF=new tO([]),tL=e=>new tO([new tU(e)]);class tz extends tM{constructor(e,t=t$){super("Die",t,e),this.defect=e}toString(){return`Die(${te(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[eW](e){return tW(e)&&eq(this.defect,e.defect)&&eq(this.annotations,e.annotations)}[eE](){return ej(e$(this._tag))(ej(eC(this.defect))(eC(this.annotations)))}}let tD=e=>new tO([new tz(e)]),tH=Y(e=>tT(e[0]),(e,t,r)=>0===t.mapUnsafe.size?e:new tO(e.reasons.map(e=>e.annotate(t,r)))),tJ=e=>"Fail"===e._tag,tW=e=>"Die"===e._tag,tq=e=>"Interrupt"===e._tag;function tK(e){return t2("Effect.evaluate: Not implemented")}let tV=e=>({...tC,[ty]:e.op,[tx]:e[tx]??tK,[tw]:e[tw],[tS]:e[tS],[tk]:e[tk]}),tG=e=>{let t=tV(e),r=function(e){this[tv]=e};return r.prototype=t,function(e){return new r(e)}},tY=e=>{let t={[tb]:tb,_tag:e.op,get[e.prop](){return this[tv]},...tV(e),toString(){return`${e.op}(${te(this[tv])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[tv]}},[eW](e){return eS(e,tb)&&e._tag===this._tag&&eq(this[tv],e[tv])},[eE](){return ej(e$(e.op),eC(this[tv]))}},r=function(e){this[tv]=e};return r.prototype=t,function(e){return new r(e)}},tZ=tY({op:"Success",prop:"value",[tx](e){let t=e.getCont(tw);return t?t[tw](this[tv],e,this):e.yieldWith(this)}}),tX={key:"effect/Cause/StackTrace"},tQ="effect/Cause/InterruptorStackTrace",t0=tY({op:"Failure",prop:"cause",[tx](e){let t=this[tv],r=!1;e.cache.stackFrame&&(t=tH(t,{mapUnsafe:new Map([[tX.key,e.cache.stackFrame]])}),r=!0);let n=e.getCont(tS),i=e._interruptedCause;if(i&&e.interruptible){let s=!1;for(;n&&e.interruptible;)s||=ty in n,n=e.getCont(tS);s&&(t=tB(t.reasons.filter(e=>"Fail"!==e._tag))),t=tR(t,i),r=!0}return n?n[tS](t,e,r?void 0:this):e.yieldWith(r?t0(t):this)}}),t1=e=>t0(tL(e)),t2=e=>t0(tD(e)),t3=tG({op:"WithFiber",[tx](e){return this[tv](e)}}),t5=tG({op:"WithFiberSucceed",[tx](e){let t=this[tv](e),r=e.getCont(tw);return r?r[tw](t,e):e.yieldWith(tZ(t))}}),t4=function(){class e extends globalThis.Error{}let t=tV({op:"YieldableError",[tx](){return t1(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),t6=(i=Symbol.for("effect/Data/Error/plainArgs"),class extends t4{constructor(e){super(e?.message,e?.cause?{cause:e.cause}:void 0),e&&(tm(this,e),Object.defineProperty(this,i,{value:e,enumerable:!1}))}toJSON(){return{...this[i],...this}}}),t8=e=>{class t extends t6{_tag=e}return t.prototype.name=e,t},t9="~effect/Cause/NoSuchElementError";class t7 extends t8("NoSuchElementError"){[t9]=t9;constructor(e){super({message:e})}}let re="~effect/Cause/Done",rt={[re]:re,_tag:"Done",value:void 0},rr=e=>void 0===e?rt:{[re]:re,_tag:"Done",value:e},rn=t1(rt),ri=e=>(t,r)=>t===r||e(t,r),rs=(e,t)=>e===t;function ra(e){return ri((t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0})}let ro="~effect/Option",rl={[ro]:{_A:e=>e},...tE,[Symbol.iterator](){return new tf(this)}},ru=Object.defineProperty(Object.assign(Object.create(rl),{_tag:"Some",_op:"Some",[eW](e){return rf(e)&&rp(e)&&eq(this.value,e.value)},[eE](){return ej(eC(this._tag))(eC(this.value))},toString(){return`some(${te(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:to(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),rc=eC("None"),rd=Object.assign(Object.create(rl),{_tag:"None",_op:"None",valueOrUndefined:void 0,[eW]:e=>rf(e)&&rh(e),[eE]:()=>rc,toString:()=>"none()",toJSON(){return{_id:"Option",_tag:this._tag}}}),rf=e=>eS(e,ro),rh=e=>"None"===e._tag,rp=e=>"Some"===e._tag,rm=Object.create(rd),rg=function(e){this.value=e};rg.prototype=ru;let rb=e=>new rg(e),ry="~effect/Result",rv={[ry]:{_A:e=>e,_E:e=>e},...tE,[Symbol.iterator](){return new tf(this)}},rx=Object.assign(Object.create(rv),{_tag:"Success",_op:"Success",[eW](e){return rS(e)&&r_(e)&&eq(this.success,e.success)},[eE](){return ej(eC(this._tag))(eC(this.success))},toString(){return`success(${te(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:to(this.success)}}}),rw=Object.assign(Object.create(rv),{_tag:"Failure",_op:"Failure",[eW](e){return rS(e)&&rk(e)&&eq(this.failure,e.failure)},[eE](){return ej(eC(this._tag))(eC(this.failure))},toString(){return`failure(${te(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:to(this.failure)}}}),rS=e=>eS(e,ry),rk=e=>"Failure"===e._tag,r_=e=>"Success"===e._tag,rE=function(e){this.failure=e};rE.prototype=rw;let rC=e=>new rE(e),rI=function(e){this.success=e};rI.prototype=rx;let rA=e=>new rI(e);function rj(e){return(t,r)=>t===r?0:e(t,r)}let rT=rj((e,t)=>e<t?-1:1),rO=rj((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),rN=rj((e,t)=>e<t?-1:1),rM=Y(2,(e,t)=>rj((r,n)=>e(t(r),t(n)))),r$=e=>Y(2,(t,r)=>-1===e(t,r)),rU=e=>Y(2,(t,r)=>1===e(t,r)),rB=e=>Y(2,(t,r)=>1!==e(t,r)),rP=e=>Y(2,(t,r)=>-1!==e(t,r)),rR=Y(2,(e,{onNone:t,onSome:r})=>rh(e)?t():r(e.value)),rF=Y(2,(e,t)=>rh(e)?t():e.value),rL=e=>void 0===e?rm:rb(e),rz=rF(et),rD=e=>(...t)=>{try{return rb(e(...t))}catch{return rm}},rH=Y(2,(e,t)=>{if(rp(e))return e.value;throw t()}),rJ=(()=>Error("getOrThrow called on a None"),Y(2,(e,t)=>rh(e)?rm:rb(t(e.value)))),rW=Y(2,(e,t)=>rh(e)?rm:t(e.value)),rq=((e,t)=>rW(e,e=>rJ(t(e),()=>e)),Y(2,(e,t)=>rh(e)?rm:t(e.value)?rb(e.value):rm)),rK="~effect/Context/Service",rV=function(){let e=function(){};Object.setPrototypeOf(e,rG);let t=(t,r)=>(e.key=t,r?.defaultValue&&(e[rZ]=rZ,e.defaultValue=r.defaultValue),r?.make&&(e.make=r.make),r?.fiberCached&&rY.add(t),e);return arguments.length>0?t(arguments[0],arguments[1]):t},rG={[rK]:rK,...tV({op:(M={label:"Service",evaluate(e){return tZ(na(e.context,this))}}).label,[tx]:M.evaluate}),toJSON(){return{_id:"Service",key:this.key}},of:e=>e,context(e){return ne(this,e)},use(e){return t3(t=>e(na(t.context,this)))},useSync(e){return t3(t=>tZ(e(na(t.context,this))))}},rY=new Set,rZ="~effect/Context/Reference",rX="~effect/Context",rQ=(e,t,r,n,i)=>{let s=Object.create(r6);return s.cacheRoot=e??s,s.base=t,s.overlay=r,s.depth=n,s._flat=void 0,s.baseHits=0,s.maxDepth=i,s},r0=(e,t)=>{t&&(r0(e,t.parent),e.set(t.key,t.value))},r1=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return r0(t,e.overlay),e._flat=t},r2=(e,t)=>{let r=new Map(e.mapUnsafe);return t(r),rQ(void 0,r,void 0,0,e.maxDepth)},r3=Symbol(),r5=(e,t)=>{for(let r=e.overlay;r;r=r.parent)if(r.key===t)return r.value;let r=e.base.get(t);return void 0!==r||e.base.has(t)?(e.overlay&&++e.baseHits>=e.base.size&&e.baseHits>=8&&(e.base=r1(e),e.overlay=void 0,e.depth=0),r):r3},r4=(e,t)=>{let r=t?.maxDepth;return rQ(void 0,e,void 0,0,Number.isInteger(r)&&r>=0?r:8)},r6={get mapUnsafe(){return r1(this)},...tE,[rX]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[eW](e){if(!r8(e))return!1;let t=this.mapUnsafe,r=e.mapUnsafe;if(t.size!==r.size)return!1;for(let[e,n]of t)if(!r.has(e)||!eq(n,r.get(e)))return!1;return!0},[eE](){return eM(this.mapUnsafe.size)}},r8=e=>eS(e,rX),r9=e=>!!e[rZ],r7=r4(new Map),ne=(e,t)=>r4(new Map([[e.key,t]])),nt=Y(3,(e,t,r)=>nr(e,t.key,r)),nr=(e,t,r)=>{let n=rY.has(t)?void 0:e.cacheRoot;if(e.depth>=e.maxDepth){let i=new Map(e._flat??e.base);return e._flat||r0(i,e.overlay),i.set(t,r),rQ(n,i,void 0,0,e.maxDepth)}return rQ(n,e.base,{key:t,value:r,parent:e.overlay},e.depth+1,e.maxDepth)},nn=Y(2,(e,t)=>ni(e,t.key)),ni=(e,t)=>{let r=r5(e,t);return r===r3?void 0:r},ns=Y(2,(e,t)=>{let r=r5(e,t.key);if(r===r3){if(r9(t))return nl(t);throw nu(t)}return r}),na=ns,no="~effect/Context/defaultValue",nl=e=>no in e?e[no]:e[no]=e.defaultValue(),nu=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(t.stack){let e=t.stack.split("\n");e.splice(1,3),t.stack=e.join("\n")}return t},nc=Y(2,(e,t)=>{let r=r5(e,t.key);return r!==r3?rb(r):r9(t)?rb(nl(t)):rm}),nd=Y(2,(e,t)=>0===e.mapUnsafe.size?t:0===t.mapUnsafe.size?e:r2(e,e=>t.mapUnsafe.forEach((t,r)=>e.set(r,t)))),nf="~effect/Duration",nh=BigInt(0),np=BigInt(1),nm=BigInt(2),ng=BigInt(10),nb=BigInt(24),ny=BigInt(60),nv=BigInt(1e3),nx=BigInt(1e6),nw=BigInt(1e9),nS=BigInt(6e10),nk=BigInt(36e11),n_=BigInt(864e11),nE=BigInt(6048e11),nC=e=>BigInt(Math.sign(e)*Math.round(Math.abs(e))),nI=e=>Number.isInteger(e)?BigInt(e)*nx:nC(1e6*e),nA=e=>nD(Number.isFinite(e)?nC(e):e),nj=(e,t)=>{let r=Number(e);if(Number.isFinite(r))return r/t;let n=BigInt(t);return Number(e/n)+Number(e%n)/t},nT=(e,t)=>{let r=e.indexOf(".");if(-1===r)return BigInt(e)*t;let n="-"===e[0],i=e.slice(r+1),s=ng**BigInt(i.length),a=(BigInt(e.slice(+!!n,r))*s+BigInt(i))*t;return nO(n?-a:a,s)},nO=(e,t)=>{let r=e<nh?-e:e,n=r/t+(r%t*nm>=t?np:nh);return e<nh?-n:n},nN=(e,t)=>{let r=Number(e)*t;if(!Number.isFinite(r))return nD(r);let n=nT(e,BigInt(t)*nx);return nD(Number.isInteger(r)&&BigInt(r)*nx===n?r:n)},nM=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,n$=e=>{switch(typeof e){case"number":return nY(e);case"bigint":return nG(e);case"string":{if("Infinity"===e)return nK;if("-Infinity"===e)return nV;let t=nM.exec(e);if(!t)break;let[r,n,i]=t;if("nano"===i||"nanos"===i)return nG(nT(n,np));if("micro"===i||"micros"===i)return nG(nT(n,nv));switch(i){case"milli":case"millis":return nN(n,1);case"second":case"seconds":return nN(n,1e3);case"minute":case"minutes":return nN(n,6e4);case"hour":case"hours":return nN(n,36e5);case"day":case"days":return nN(n,864e5);case"week":case"weeks":return nN(n,6048e5)}break}case"object":{if(null===e)break;if(nf in e)return e;if(Array.isArray(e)){if(2!==e.length||!e.every(ed))return nP(e);if(Number.isNaN(e[0])||Number.isNaN(e[1]))return nq;if(-1/0===e[0]||-1/0===e[1])return nV;if(1/0===e[0]||1/0===e[1])return nK;let t=1e9*e[0]+e[1];return Number.isFinite(t)&&Number.isInteger(e[0])&&Number.isInteger(e[1])?nD(BigInt(e[0])*nw+BigInt(e[1])):nA(t)}let t=0;if(e.weeks&&(t+=6048e5*e.weeks),e.days&&(t+=864e5*e.days),e.hours&&(t+=36e5*e.hours),e.minutes&&(t+=6e4*e.minutes),e.seconds&&(t+=1e3*e.seconds),e.milliseconds&&(t+=e.milliseconds),!e.microseconds&&!e.nanoseconds){if(!Number.isFinite(t))return nD(t);let r=nB(e);return void 0===r||BigInt(t)*nx===r?nD(t):nD(r)}let r=1e6*t+(e.microseconds??0)*1e3+(e.nanoseconds??0),n=Number.isFinite(r)?nB(e):void 0;return void 0===n?nA(r):nD(n)}}return nP(e)},nU=e=>!e||Number.isInteger(e),nB=e=>{if(!nU(e.weeks)||!nU(e.days)||!nU(e.hours)||!nU(e.minutes)||!nU(e.seconds)||!nU(e.milliseconds)||!nU(e.microseconds)||!nU(e.nanoseconds))return;let t=nh;return e.weeks&&(t+=BigInt(e.weeks)*nE),e.days&&(t+=BigInt(e.days)*n_),e.hours&&(t+=BigInt(e.hours)*nk),e.minutes&&(t+=BigInt(e.minutes)*nS),e.seconds&&(t+=BigInt(e.seconds)*nw),e.milliseconds&&(t+=BigInt(e.milliseconds)*nx),e.microseconds&&(t+=BigInt(e.microseconds)*nv),e.nanoseconds&&(t+=BigInt(e.nanoseconds)),t},nP=e=>{throw Error(`Invalid Input: ${e}`)},nR={_tag:"Millis",millis:0},nF={_tag:"Infinity"},nL={_tag:"NegativeInfinity"},nz={[nf]:nf,[eE](){switch(this.value._tag){case"Millis":return eC(nI(this.value.millis));case"Nanos":return eC(this.value.nanos);default:return eB(this.value)}},[eW](e){return nH(e)&&n4(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[ta](){return this.toJSON()},pipe(){return K(this,arguments)}},nD=e=>{let t=Object.create(nz);return"number"==typeof e?isNaN(e)||0===e||Object.is(e,-0)?t.value=nR:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:nI(e)}:t.value=e>0?nF:nL:e===nh?t.value=nR:t.value={_tag:"Nanos",nanos:e},t},nH=e=>eS(e,nf),nJ=e=>"Infinity"!==e.value._tag&&"NegativeInfinity"!==e.value._tag,nW=e=>{switch(e.value._tag){case"Millis":return 0===e.value.millis;case"Nanos":return e.value.nanos===nh;case"Infinity":case"NegativeInfinity":return!1}},nq=nD(0),nK=nD(1/0),nV=nD(-1/0),nG=e=>nD(e),nY=e=>nD(e),nZ=e=>nD(1e3*e),nX=e=>n1(n$(e),{onMillis:Z,onNanos:e=>nj(e,1e6),onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),nQ=e=>n1(n$(e),{onMillis:e=>e/1e3,onNanos:e=>nj(e,1e9),onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),n0=e=>{let t=n$(e);switch(t.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return nI(t.value.millis)}},n1=Y(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),n2=Y(3,(e,t,r)=>"Infinity"===e.value._tag||"NegativeInfinity"===e.value._tag||"Infinity"===t.value._tag||"NegativeInfinity"===t.value._tag?r.onInfinity(e,t):"Millis"===e.value._tag?"Millis"===t.value._tag?r.onMillis(e.value.millis,t.value.millis):r.onNanos(n0(e),t.value.nanos):r.onNanos(e.value.nanos,n0(t))),n3=rj((e,t)=>n2(e,t,{onMillis:(e,t)=>e<t?-1:+(e>t),onNanos:(e,t)=>e<t?-1:+(e>t),onInfinity:(e,t)=>e.value._tag===t.value._tag?0:"Infinity"===e.value._tag?1:"NegativeInfinity"===e.value._tag||"Infinity"===t.value._tag?-1:1})),n5=($=n3,Y(2,(e,t)=>e===t||$(e,t)>-1?e:t)),n4=((e,t)=>n2(e,t,{onMillis:(e,t)=>nD(e-t),onNanos:(e,t)=>nD(e-t),onInfinity:(e,t)=>{let r=e.value._tag,n=t.value._tag;return"Infinity"===r?"Infinity"===n?nq:nK:"NegativeInfinity"===r?"NegativeInfinity"===n?nq:nV:"Infinity"===n?nV:nK}}),Y(2,(e,t)=>n2(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}))),n6=e=>e.length>0,n8=e=>e>0?Math.floor(e):0,n9=e=>Math.max(1,n8(e)),n7=e=>{if(em(e))try{return rA(e())}catch(e){return rC(e)}try{return rA(e.try())}catch(t){return rC(e.catch(t))}},ie=Y(2,(e,t)=>rk(e)?rC(t(e.failure)):e),it=Y(2,(e,t)=>r_(e)?rA(t(e.success)):e),ir=Y(2,(e,{onFailure:t,onSuccess:r})=>rk(e)?t(e.failure):r(e.success)),ii=(Y(2,(e,t)=>{if(r_(e))return e.success;throw t(e.failure)}))(Z),is=Y(2,(e,t)=>rk(e)?rC(e.failure):t(e.success)),ia=((e,t)=>{var r,n;let i;return id((r=()=>e,n={length:t},i=n?.length!==void 0?n9(n.length):1/0,{[Symbol.iterator](){let e=0;return{next:()=>e<i?{value:r(e++),done:!1}:{done:!0,value:void 0}}}}))},Y(2,(e,t)=>({[Symbol.iterator](){let r,n=e[Symbol.iterator](),i=!1;return{next(){if(!i){let e=n.next();return e.done?(i=!0,(r=t[Symbol.iterator]()).next()):e}return r.next()}}}}))),io=e=>{let t=e[Symbol.iterator]().next();if(t.done)throw Error("headUnsafe: empty iterable");return t.value},il=Y(2,(e,t)=>{let r=0;for(let n of e){let e=t(n,r);if(ef(e)){if(e)return rb(n)}else if(rp(e))return e;r++}return rm});(e,t,r)=>({[Symbol.iterator](){let n=e[Symbol.iterator](),i=t[Symbol.iterator]();return{next(){let e=n.next(),t=i.next();return e.done||t.done?{done:!0,value:void 0}:{done:!1,value:r(e.value,t.value)}}}}});let iu=Y(2,(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let e=r.next();return e.done?{done:!0,value:void 0}:{done:!1,value:t(e.value,n++)}}}}})),ic=Y(2,(e,t)=>id(iu(e,t))),id=e=>({[Symbol.iterator](){let t,r=e[Symbol.iterator]();return{next:function(){for(;;){if(void 0===t){let e=r.next();if(e.done)return e;t=e.value[Symbol.iterator]()}let e=t.next();if(!e.done)return e;t=void 0}}}}});(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let e=r.next();for(;!e.done;){let i=t(e.value,n++);if(r_(i))return{done:!1,value:i.success};e=r.next()}return{done:!0,value:void 0}}}}});(e,t,r)=>({[Symbol.iterator](){let n,i=[],s=!1,a={[Symbol.iterator](){let e=0;return{next(){if(e<i.length)return{done:!1,value:i[e++]};if(s)return{done:!0,value:void 0};let r=(n??=t[Symbol.iterator]()).next();return r.done?(s=!0,{done:!0,value:void 0}):(i.push(r.value),e++,r)}}}};return ic(e,e=>iu(a,t=>r(e,t)))[Symbol.iterator]()}});let ih=()=>({});(e,t)=>{let r=ih();for(let n of e){let[e,i]=t(n);tp(r,e,i)}return r};let ip=Y(2,(e,t)=>Object.hasOwn(e,t)),im=((e,t,r)=>ip(e,t)?rb({...e,[t]:r(e[t])}):rm,Y(2,(e,t)=>{if(!ip(e,t))return{...e};let r={...e};return delete r[t],r})),ig=Y(2,(e,t)=>{let r={...e};for(let n of ib(e))tp(r,n,t(e[n],n));return r}),ib=e=>Object.keys(e),iy=Y(3,(e,t,r)=>({...e,[t]:r})),iv=globalThis.Array,ix=Y(2,(e,t)=>{let r=n9(e),n=new iv(r);for(let e=0;e<r;e++)n[e]=t(e);return n}),iw=e=>iv.isArray(e)?e:iv.from(e),iS=e=>iv.isArray(e)?e:[e],ik=Y(2,(e,t)=>[t,...e]),i_=Y(2,(e,t)=>[...e,t]),iE=Y(2,(e,t)=>iw(e).concat(iw(t))),iC=iv.isArray;function iI(e,t){return!Number.isFinite(e)||e<0||e>=t.length}let iA=(Y(2,(e,t)=>{let r=Math.floor(t);if(iI(r,e))throw Error(`Index out of bounds: ${r}`);return e[r]}))(0),ij=((e,t)=>{let r,n,i=iw(e);return i.slice(0,(r=t,n=i.length,Math.min(n8(r),n)))},Y(3,(e,t,r)=>{let n=iv.from(e),i=Math.floor(t);if(iI(i,n))return rm;let s=r(n[i]);return n[i]=s,rb(n)})),iT=((e,t)=>{let r=iv.from(e),n=Math.floor(t);return iI(n,r)||r.splice(n,1),r},e=>iv.from(e).reverse()),iO=Y(2,(e,t)=>{let r=iv.from(e);return r.sort(t),r}),iN=Y(3,(e,t,r)=>iv.from(e).map(e=>[e,t(e)]).sort(([,e],[,t])=>r(e,t)).map(([e])=>e)),iM=Y(3,(e,t,r)=>{let n=iw(e),i=iw(t);if(n6(n)&&n6(i)){let e=[r(iA(n),iA(i))],t=Math.min(n.length,i.length);for(let s=1;s<t;s++)e[s]=r(n[s],i[s]);return e}return[]}),i$=((e,t)=>[t(iA(e)),...e.slice(1)],Y(2,(e,t)=>{let r=iw(e);if(n6(r)){let e=r.length,n=Math.round(t)%e;if(iI(Math.abs(n),r)||0===n)return iR(r);if(!(n<0))return i$(r,n-e);{let[e,t]=iP(r,-n);return iE(t,e)}}return[]})),iU=Y(2,(e,t)=>{let r=iw(e);if(n6(r)){let[e,n]=t(r),i=[e],s=n;for(;n6(s);){let[e,r]=t(s);i.push(e),s=r}return i}return[]}),iB=Y(2,(e,t)=>{let r=iv.from(e),n=n8(t);return n6(r)?n>=1?iP(r,n):[[],r]:[r,[]]}),iP=Y(2,(e,t)=>{let r=n9(t);return r>=e.length?[iR(e),[]]:[ik(e.slice(1,r),iA(e)),e.slice(r)]}),iR=e=>e.slice();(e,t)=>{let r=iw(e);return n6(r)?iU(r,iP(t)):[]};(e,t)=>{let r={};for(let n of e){let e=t(n);Object.hasOwn(r,e)?r[e].push(n):tp(r,e,[n])}return r};let iF=(e,t)=>{let r=eC(t),n=e.get(r);if(void 0===n)return e.set(r,[t]),!0;for(let e of n)if(eq(e,t))return!1;return n.push(t),!0},iL=e=>{let t=new Map;for(let r of e)iF(t,r);return t},iz=(e,t)=>{let r=e.get(eC(t));if(void 0===r)return!1;for(let e of r)if(eq(e,t))return!0;return!1},iD=((e,t)=>{let r=iw(e),n=iw(t);return n6(r)?n6(n)?iG(iE(r,n)):r:n},()=>[]),iH=e=>[e],iJ=Y(2,(e,t)=>e.map(t)),iW=Y(2,(e,t)=>{if(0===e.length)return[];let r=[];for(let n=0;n<e.length;n++){let i=t(e[n],n);for(let e=0;e<i.length;e++)r.push(i[e])}return r}),iq=e=>{let t=[];for(let r of e)rp(r)&&t.push(r.value);return t},iK=Y(2,(e,t)=>{let r=iw(e),n=[];for(let e=0;e<r.length;e++)t(r[e],e)&&n.push(r[e]);return n}),iV=Y(2,(e,t)=>{let r=[],n=[],i=0;for(let s of e){let e=t(s,i++);r_(e)?r.push(e.success):n.push(e.failure)}return[r,n]}),iG=((e,t,r)=>iw(e).reduce((e,t,n)=>r(e,t,n),t),e=>{let t=iw(e);if(t.length<2)return[...t];let r=new Map,n=[];for(let e of t)iF(r,e)&&n.push(e);return n});(e,t,r)=>{let n=0,i=t,s=[];for(let t of e){let e=r(i,t,n);i=e[0],s.push(e[1]),n++}return[i,s]},(e,t,r)=>n=>{let i=e(n);if(rk(i))return i;let s=t(n);return rk(s)?s:rA(r(i.success,s.success))};let iY=rV("effect/Scheduler",{fiberCached:!0,defaultValue:()=>new i1}),iZ=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},iX="setImmediate"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},iQ=e=>{try{return iX(e)}catch{return iZ(e)}};class i0{buckets=[];scheduleTask(e,t){let r,n=this.buckets,i=n.length,s=0;for(;s<i&&!(n[s][0]>t);s++)r=n[s];r&&r[0]===t?r[1].push(e):s===i?n.push([t,[e]]):n.splice(s,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}}class i1{executionMode;setImmediate;constructor(e="async",t){this.executionMode=e,this.setImmediate=t??("sync"===e?iZ:iQ)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new i2(this.setImmediate)}}class i2{tasks=new i0;running=void 0;setImmediate;constructor(e=iQ){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),void 0===this.running&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let r=e[t][1];for(let e=0;e<r.length;e++)r[e]()}}flush(){for(;this.tasks.buckets.length>0;)void 0!==this.running&&(this.running(),this.running=void 0),this.runTasks()}}let i3=rV("effect/Scheduler/MaxOpsBeforeYield",{fiberCached:!0,defaultValue:()=>2048}),i5=rV("effect/Scheduler/PreventSchedulerYield",{fiberCached:!0,defaultValue:()=>!1}),i4=class extends G{constructor(e){super(),e&&tm(this,e)}},i6=e=>class extends i4{_tag=e},i8=t6,i9=t8,i7="~effect/encoding/EncodingError";class se extends i9("EncodingError"){[i7]=i7}let st=e=>"string"==typeof e?sf(su.encode(e)):sf(e),sr=e=>{switch(e){case 16:return sa();case 32:return so();default:{let t="";for(let r=e>>>3;r>0;r--)t+=ss();return t}}},sn=Uint8Array.from("0123456789abcdef",e=>e.charCodeAt(0)),si=()=>0x100000000*Math.random()>>>0,ss=()=>{let e=si();return String.fromCharCode(sn[e>>>28],sn[e>>>24&15],sn[e>>>20&15],sn[e>>>16&15],sn[e>>>12&15],sn[e>>>8&15],sn[e>>>4&15],sn[15&e])},sa=()=>{let e=si(),t=si();return String.fromCharCode(sn[e>>>28],sn[e>>>24&15],sn[e>>>20&15],sn[e>>>16&15],sn[e>>>12&15],sn[e>>>8&15],sn[e>>>4&15],sn[15&e],sn[t>>>28],sn[t>>>24&15],sn[t>>>20&15],sn[t>>>16&15],sn[t>>>12&15],sn[t>>>8&15],sn[t>>>4&15],sn[15&t])},so=()=>{let e=si(),t=si(),r=si(),n=si();return String.fromCharCode(sn[e>>>28],sn[e>>>24&15],sn[e>>>20&15],sn[e>>>16&15],sn[e>>>12&15],sn[e>>>8&15],sn[e>>>4&15],sn[15&e],sn[t>>>28],sn[t>>>24&15],sn[t>>>20&15],sn[t>>>16&15],sn[t>>>12&15],sn[t>>>8&15],sn[t>>>4&15],sn[15&t],sn[r>>>28],sn[r>>>24&15],sn[r>>>20&15],sn[r>>>16&15],sn[r>>>12&15],sn[r>>>8&15],sn[r>>>4&15],sn[15&r],sn[n>>>28],sn[n>>>24&15],sn[n>>>20&15],sn[n>>>16&15],sn[n>>>12&15],sn[n>>>8&15],sn[n>>>4&15],sn[15&n])},sl=e=>{let t=new TextEncoder().encode(e);if(t.length%2!=0)return rC(new se({module:"Hex",kind:"Decode",input:e,message:`Length must be a multiple of 2, but is ${t.length}`}));try{let e=t.length/2,r=new Uint8Array(e);for(let n=0;n<e;n++){let e=sh(t[2*n]),i=sh(t[2*n+1]);r[n]=e<<4|i}return rA(r)}catch(t){return rC(new se({module:"Hex",kind:"Decode",input:e,message:t instanceof Error?t.message:"Invalid input"}))}},su=new TextEncoder,sc=new TextDecoder,sd=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),sf=e=>{let t="";for(let r=0;r<e.length;r++)t+=sd[e[r]];return t},sh=e=>{if(48<=e&&e<=57)return e-48;if(97<=e&&e<=102)return e-97+10;if(65<=e&&e<=70)return e-65+10;throw TypeError("Invalid input")},sp="effect/Tracer/ParentSpan";class sm extends(rV())(sp,{fiberCached:!0}){}let sg=rV("effect/Tracer/DisablePropagation",{defaultValue:ee}),sb=rV("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),sy=rV("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),sv="effect/Tracer",sx=rV(sv,{fiberCached:!0,defaultValue:()=>sw}),sw={span:e=>new sS(e)};class sS{_tag="Span";sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(e){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.startTime=e.startTime,this.kind=e.kind,this.sampled=e.sampled,this.status={_tag:"Started",startTime:e.startTime}}get traceId(){return this._traceId??=rz(this.parent)?.traceId??sr(32)}get spanId(){return this._spanId??=sr(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(e,t){"Ended"!==this.status._tag&&(this.status={_tag:"Ended",endTime:e,exit:t,startTime:this.status.startTime})}attribute(e,t){"Ended"!==this.status._tag&&this.attributes.set(e,t)}event(e,t,r){"Ended"!==this.status._tag&&this.events.push([e,t,r??{}])}addLinks(e){"Ended"!==this.status._tag&&this.links.push(...e)}}let sk=rV("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),s_=rV("effect/References/CurrentStackFrame",{fiberCached:!0,defaultValue:et}),sE=rV("effect/References/TracerEnabled",{fiberCached:!0,defaultValue:Q}),sC=rV("effect/References/TracerTimingEnabled",{defaultValue:Q}),sI=rV("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),sA=rV("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),sj=rV("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),sT=rV("effect/References/CurrentLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),sO=rV("effect/References/MinimumLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),sN=rV("effect/References/UnhandledLogLevel",{defaultValue:()=>"Error"}),sM=rV("effect/References/CurrentLogSpans",{defaultValue:()=>[]});class s$ extends tM{constructor(e,t=t$){super("Interrupt",t,"Interrupted"),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[eW](e){return tq(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[eE](){return e$(`${this._tag}:${this.fiberId}`)}}let sU=e=>new tO([new s$(e)]),sB=e=>{for(let t=0;t<e.reasons.length;t++){let r=e.reasons[t];if("Fail"===r._tag)return rA(r.error)}return rC(e)},sP=e=>e.reasons.some(tW)&&e.reasons.some(tJ)?tB(e.reasons.map(e=>"Fail"!==e._tag||eS(e.error,re)?e:new tz(e.error,e.annotations))):e,sR=e=>e.reasons.some(tW)?rC(sP(e)):sB(e),sF=e=>{let t=e.reasons.find(tW);return t?rA(t.defect):rC(e)},sL=e=>{let t;for(let r=0;r<e.reasons.length;r++){let n=e.reasons[r];"Interrupt"===n._tag&&(t??=new Set,void 0!==n.fiberId&&t.add(n.fiberId))}return t?rA(t):rC(e)},sz=Y(2,(e,t)=>{let r=!1,n=e.reasons.map(e=>tJ(e)?(r=!0,new tU(t(e.error),e.annotations)):e);return r?tB(n):e}),sD=e=>{let t;for(let r of e.reasons){if("Fail"===r._tag)return r.error;"Die"===r._tag&&(t??=r)}return void 0!==t?t.defect:new globalThis.Error(e.reasons.length>0?"All fibers interrupted without error":"Empty cause")},sH=(e,t,r,n=new Set)=>{let i,s=typeof e;if(e&&"object"===s){n.add(e);let s=e.cause;if(i=new globalThis.Error(sJ(e),{cause:void 0===s||n.has(s)?void 0:sH(s,void 0,void 0,n)}),"string"==typeof e.name&&(i.name=e.name),"string"==typeof e.stack)i.stack=sq(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?sK(e,t):e}for(let t of(r?.includeCauseInStack&&(i.stack=sY(i)),Object.keys(e)))t in i||(i[t]=e[t])}else{i=new globalThis.Error(!e?`Unknown error: ${e}`:"string"===s?e:ts(e));let r=`${i.name}: ${i.message}`;i.stack=t?sK(r,t):r}return i},sJ=e=>{if("string"==typeof e.message)return e.message;if("function"==typeof e.toString&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return ts(e)},sW=/\((.*)\)/g,sq=(e,t,r)=>{let n=`${t.name}: ${t.message}`,i=(e.startsWith(n)?e.slice(n.length):e).split("\n"),s=[n];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)s.push(i[e]);return r?sK(s.join("\n"),r):s.join("\n")},sK=(e,t)=>{let r=t?.get(tX.key);return r&&(e=`${e}
|
|
6
|
-
${sV(r)}`),e},sV=e=>{let t=[],r=e,n=0;for(;r&&n<10;){let e=r.stack();if(e){let n=e.matchAll(sW),i=!1;for(let[,e]of n)i=!0,t.push(` at ${r.name} (${e})`);i||t.push(` at ${r.name} (${e.replace(/^at /,"")})`)}else t.push(` at ${r.name}`);r=r.parent,n++}return t.join("\n")},sG=e=>(e=>{let t=[],r=[];if(0===e.reasons.length)return t;let n=Error.stackTraceLimit;0!==n&&td(1);try{for(let n of e.reasons){if("Interrupt"===n._tag){r.push(n);continue}t.push(sH("Die"===n._tag?n.defect:n.error,n.annotations,void 0))}if(0===t.length){let e=Error("The fiber was interrupted by:");e.name="InterruptCause",e.stack=((e,t)=>{let r=[`${e.name}: ${e.message}`];for(let e of t){let t=void 0!==e.fiberId?`#${e.fiberId}`:"unknown",n=e.annotations.get(tQ);r.push(` at fiber (${t})`),n&&r.push(sV(n))}return r.join("\n")})(e,r);let n=new globalThis.Error("All fibers interrupted without error",{cause:e});n.name="InterruptError",n.stack=`${n.name}: ${n.message}`,t.push(sH(n,r[0].annotations,void 0))}}finally{0!==n&&td(n)}return t})(e).map(sY).join("\n"),sY=e=>e.cause?`${e.stack} {
|
|
7
|
-
${sZ(e.cause," ")}
|
|
8
|
-
}`:e.stack,sZ=(e,t)=>{let r=e.stack.split("\n"),n=`${t}[cause]: ${r[0]}`;for(let e=1,i=r.length;e<i;e++)n+=`
|
|
9
|
-
${t}${r[e]}`;return e.cause&&(n+=` {
|
|
10
|
-
${sZ(e.cause,`${t} `)}
|
|
11
|
-
${t}}`),n},sX="~effect/Fiber",sQ={_A:Z,_E:Z},s0={id:0},s1=(()=>{try{return globalThis.process?.getBuiltinModule?.("node:async_hooks")?.AsyncResource}catch{return}})(),s2=()=>void 0===s1?void 0:new s1("effect/Fiber"),s3=()=>globalThis[e8];class s5{constructor(e,t=!0){this.setContext(e),this.id=++s0.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[sX](){return sQ}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return na(this.context,e)}addObserver(e){return this._exit?(e(this._exit),et):(void 0===this._observers?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||void 0===this._observers)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let r=sU(e);this.cache.stackFrame&&(r=tH(r,ne(tX,this.cache.stackFrame))),t&&(r=tH(r,t)),this._interruptedCause=this._interruptedCause?tR(this._interruptedCause,r):r,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(ao(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(void 0!==this._asyncContext){let t=this._asyncContext;this._asyncContext=void 0;try{return t.runInAsyncScope(this.evaluate,this,e)}finally{t.emitDestroy()}}if(void 0!==this._yielded){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===t_){this._asyncContext=s2();return}let r=s9.interruptChildren&&s9.interruptChildren(this);if(void 0!==r)return this.evaluate(aD(r,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&(this._parent._children?.delete(this),this._parent=void 0),void 0!==this._observers){let e=this._observers;this._observers=void 0;for(let r=0;r<e.length;r++)e[r](t)}this._stack.length=0,this._children=void 0,this.context=r7;let n=this.cache;(void 0!==n.span||void 0!==n.stackFrame)&&(this.cache={...n,span:void 0,stackFrame:void 0})}runLoop(e){let t=globalThis[e8];globalThis[e8]=this;let r=this._running;this._running=!0;let n=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=ao(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!n&&!e.preventYield&&e.scheduler.shouldYield(this)){n=!0;let e=i;i=aD(ad,()=>e)}if((i=e.tracerContext?e.tracerContext(i,this):i[tx](this))===t_){let e=this._yielded;if(tb in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return t_}}catch(e){if(!eS(i,tx))return t2(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=t2(e)}}finally{this._running=r,globalThis[e8]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,s6;for(;;){let t=this._stack.pop();if(!t)return;let r=t[tk];if(void 0!==r){let n=r.call(t,this);if(n)return n[e]=n,n}if(t[e])return t}}succeedWith(e){if((++this.currentOpCount&s8-1)==0)return tZ(e);let t=this.getCont(tw);return t?t[tw](e,this):this.yieldWith(tZ(e))}yieldWith(e){return this._yielded=e,t_}children(){return this._children??=new Set}pipe(){return K(this,arguments)}setContext(e){let t=this.context;if(this.context=e,void 0!==t&&t.cacheRoot===e.cacheRoot)return;let r=e.cacheRoot,n=r._fiberCache??=s4(e);this.cache?.scheduler!==n.scheduler&&(this._dispatcher=void 0),this.cache=n}get currentSpanLocal(){let e=this.cache.span;return e?._tag==="Span"?e:void 0}}let s4=e=>{let t=ni(e,sv);return{scheduler:na(e,iY),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:na(e,sE),span:ni(e,sp),logLevel:na(e,sT),minimumLogLevel:na(e,sO),stackFrame:na(e,s_),runtimeMetrics:ni(e,"effect/Metric/FiberRuntimeMetrics"),maxOpsBeforeYield:na(e,i3),preventYield:na(e,i5)}},s6={[tw]:(e,t)=>ao(t._interruptedCause),[tS]:(e,t)=>ao(t._interruptedCause)},s8=32,s9={interruptChildren:void 0},s7=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(tQ,e.cache.stackFrame),r4(t)},ae=e=>{if(void 0!==e._children&&0!==e._children.size)return as(e._children)},at=e=>av(t=>{let r,n=e[Symbol.iterator](),i=[];return!function e(){let s=n.next();for(;!s.done;){if(s.value._exit){i.push(s.value._exit),s=n.next();continue}r=s.value.addObserver(t=>{i.push(t),e()});return}t(aa(i))}(),al(()=>r?.())}),ar=e=>e._exit?e._exit:av(t=>e._exit?t(e._exit):al(e.addObserver(t))),an=e=>t3(t=>ai(e,t.id)),ai=Y(e=>eS(e[0],sX),(e,t,r)=>t3(n=>{let i,s=s7(n);return s=s&&r?nd(s,r):s??r,e.interruptUnsafe(t,s),aL((i=e)._exit?aa(i._exit):av(e=>i._exit?e(aa(i._exit)):al(i.addObserver(t=>e(aa(t))))))})),as=e=>t3(t=>{let r=s7(t),n=iD();for(let i of e)i.interruptUnsafe(t.id,r),n.push(i);return aL(at(n))}),aa=tZ,ao=t0,al=tG({op:"Sync",[tx](e){let t=(0,this[tv])(),r=e.getCont(tw);return r?r[tw](t,e):e.yieldWith(tZ(t))}}),au=tG({op:"Suspend",[tx](e){return(0,this[tv])()}}),ac=((e=>e.length>=2||rf(e[0]),(e,t)=>rh(e)?t?ap(t):t1(new t7("Effect.fromOption: Option.none")):aa(e.value)),ir({onFailure:t1,onSuccess:aa})),ad=(tG({op:"Yield",[tx](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(a0)},this[tv]??0),e.yieldWith(()=>{t=!0})}}))(0),af=aa(rm),ah=e=>t2(e),ap=e=>au(()=>t1(e())),am=aa(void 0),ag=e=>{let t="function"==typeof e?e:e.try,r="function"==typeof e?e=>new un(e,"An error occurred in Effect.try"):e.catch;return au(()=>{try{return aa(t())}catch(e){return t1(r(e))}})},ab=(s=tV({op:"Async",[tx](e){let t=!1,r=!1,n=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,n=>{t||(t=!0,r?e.evaluate(n):r=n)},n?.signal);return!1!==r?r:(r=!0,e.yieldWith(()=>{t=!0}),void 0===n&&void 0===i||e._stack.push(ay(()=>(t=!0,n?.abort(),i??a0))),t_)}}),(a=function(e,t){this.register=e,this.withSignal=t}).prototype=s,function(e,t){return new a(e,t)}),ay=tG({op:"AsyncFinalizer",[tk](e){e.interruptible&&(e.interruptible=!1,e._stack.push(lc))},[tS](e,t){return e.reasons.some(tq)?aD(oY(t0(e),this[tv]()),()=>ao(e)):ao(e)}}),av=e=>ab(e,e.length>=2),ax=av(et),aw=(e,t)=>"function"==typeof e?e:t.shift().bind(e.self),aS=(e,...t)=>{let r=aw(e,t),n=0===t.length?function(){return au(()=>aE(r.apply(this,arguments)))}:function(){let e=au(()=>aE(r.apply(this,arguments)));for(let r=0;r<t.length;r++)e=t[r](e,...arguments);return e};return ak(r.length,n)},ak=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),a_=e=>{try{let t,r=e();for(;;){let n=r.next(t);if(n.done)return aa(n.value);let i=n.value;if(i&&"Success"===i._tag){t=i.value;continue}{if(i&&"Failure"===i._tag)return n.value;let t=!0;return au(()=>t?(t=!1,aD(n.value,e=>aE(r,e))):au(()=>aE(e())))}}}catch(e){return ah(e)}},aE=(o=tV({op:"Iterator",[tw](e,t){let r=this.iterator;for(;;){let n=r.next(e);if(n.done)return aa(n.value);if(!aJ(n.value))return t._stack.push(this),n.value;if("Failure"===n.value._tag)return n.value;e=n.value.value}},[tx](e){return this[tw](this.initial,e)}}),(l=function(e,t){this.iterator=e,this.initial=t}).prototype=o,function(e,t){return new l(e,t)}),aC=Y(2,(e,t)=>new aj(e,aT,aa(t))),aI=function(e){return e._stack.push(this),this[tv]},aA=tV({op:"OnSuccess",[tx]:aI}),aj=function(e,t,r){this[tv]=e,this[tw]=t,this.payload=r};aj.prototype=aA;let aT=function(){return this.payload},aO=function(e,t){return t.succeedWith(this.payload)},aN=(()=>{let e=Error.stackTraceLimit;if(0===e)return!1;let t="~effect/Effect/stackProbe";td(1);let r=({[t]:function(){return Error()}})[t]();return td(e),r.stack?.includes("[as "+t+"]")===!0})(),aM=function(e,t){let r=this.payload;return t.succeedWith(aN?r(e):th(()=>r(e)))},a$=function(e){return(0,this.payload)(e)},aU=function(e){return new aj((0,this.payload)(e),aO,e)},aB=function(e){return new aj(this.payload,aO,e)},aP=e=>aq(e,rb),aR=Y(2,(e,t)=>new aj(e,tI(t)?aT:a$,t)),aF=Y(2,(e,t)=>new aj(e,tI(t)?aB:aU,t)),aL=e=>new aj(e,aT,a0),az=Y(e=>tI(e[1]),(e,t,r)=>{let n;return n=[e,t],t3(e=>{let t=new Set;return o9(e,()=>0===t.size?void 0:as(t)),av(i=>{let s=!1,a=0;for(let o of n){if(s)break;let n=a++,l=lA(e,o,!0,!0,!1);t.add(l),l.addObserver(a=>{t.delete(l);let o=!s;s=!0,i(a),o&&r?.onWinner&&r.onWinner({fiber:l,index:n,parentFiber:e})})}})})}),aD=Y(2,(e,t)=>new aj(e,a$,t)),aH=Y(2,(e,t)=>aJ(e)?"Success"===e._tag?t.onSuccess(e.value):t.onFailure(e.cause):oj(e,t)),aJ=e=>void 0!==e[tb],aW=Y(2,(e,t)=>aJ(e)?"Success"===e._tag?t(e.value):e:aD(e,t)),aq=Y(2,(e,t)=>new aj(e,aM,t)),aK=Y(2,(e,t)=>aJ(e)?a1(e,t):aq(e,t)),aV=Y(2,(e,t)=>aJ(e)?a2(e,t):ok(e,t)),aG=Y(2,(e,t)=>aJ(e)?a3(e,t):o_(e,t)),aY=Y(2,(e,t)=>{if(aJ(e)){if("Success"===e._tag)return e;let r=sR(e.cause);return rk(r)?t0(r.failure):t(r.success)}return om(e,t)}),aZ=e=>t0(sU(e)),aX=e=>"Failure"===e._tag?rA(e.cause):rC(e),aQ=e=>"Failure"===e._tag&&e.cause.reasons.some(tq),a0=tZ(void 0),a1=Y(2,(e,t)=>"Success"===e._tag?tZ(t(e.value)):e),a2=Y(2,(e,t)=>"Success"===e._tag?e:t0(sz(e.cause,t))),a3=Y(2,(e,t)=>"Success"===e._tag?tZ(t.onSuccess(e.value)):t0(sz(e.cause,t.onFailure))),a5=Y(2,(e,t)=>"Success"===e._tag?t:e),a4=Y(2,(e,t)=>"Success"===e._tag?t.onSuccess(e.value):t.onFailure(e.cause)),a6=e=>{let t=[];for(let r of e)"Failure"===r._tag&&t.push(...r.cause.reasons);return 0===t.length?a0:t0(tB(t))},a8=Y(2,(e,t)=>t3(r=>{let n=r.context,i=t(n);return n===i||(r.setContext(i),o9(r,()=>{r.setContext(n)})),e})),a9=Y(3,(e,t,r)=>a8(e,e=>{let n=ns(e,t),i=r(n);return n===i?e:nt(e,t,i)})),a7=()=>oe,oe=t3(e=>aa(e.context)),ot=e=>t3(t=>e(t.context)),or=Y(2,(e,t)=>aJ(e)?e:a8(e,nd(t))),on=function(){return 1==arguments.length?Y(2,(e,t)=>oi(e,arguments[0],t)):Y(3,(e,t,r)=>oi(e,t,r)).apply(this,arguments)},oi=(e,t,r)=>a8(e,nt(t,r)),os=Y(3,(e,t,r)=>aD(r,r=>on(e,t,r))),oa=Y(e=>tI(e[1]),(e,t,r)=>oo(e,t,(e,t)=>[e,t],r)),oo=Y(e=>tI(e[1]),(e,t,r,n)=>n?.concurrent?aq(lm([e,t],{concurrency:2}),([e,t])=>r(e,t)):aD(e,e=>aq(t,t=>r(e,t)))),ol=Y(e=>tI(e[0]),(e,t,r)=>l_(e,t,r?e=>t1(r(e)):()=>t1(new t7))),ou=Y(2,(e,t)=>aD(t,t=>t?aP(e):af)),oc=((e,t)=>Array.from({length:t},()=>e),Y(e=>tI(e[0]),(e,t)=>lg({while:Q,body:X(t?.disableYield?e:aD(e,e=>ad)),step:et}))),od=Y(2,(e,t)=>new oh(e,1!==t.length?e=>t(e):t)),of=tV({op:"OnFailure",[tx]:aI}),oh=function(e,t){this[tv]=e,this[tS]=t};oh.prototype=of,(e,t,r)=>od(e,e=>t(e)?r(e):ao(e));let op=Y(3,(e,t,r)=>od(e,e=>{let n=t(e);return rk(n)?ao(n.failure):r(n.success,e)})),om=Y(2,(e,t)=>op(e,sR,e=>t(e))),og=Y(3,(e,t,r)=>od(e,e=>{let n=t(e);return rk(n)?ao(e):aR(r(n.success,e),ao(e))})),ob=Y(2,(e,t)=>og(e,sB,e=>t(e))),oy=((e,t)=>og(e,sF,e=>t(e)),Y(e=>tI(e[0]),(e,t,r,n)=>od(e,e=>{let i=sR(e);return rk(i)?ao(i.failure):t(i.success)?r(i.success):n?n(i.success):ao(e)}))),ov=Y(e=>tI(e[0]),(e,t,r,n)=>od(e,e=>{let i=sR(e);if(rk(i))return ao(i.failure);let s=t(i.success);return rk(s)?n?n(s.failure):ao(e):r(s.success)})),ox=Y(e=>tI(e[0]),(e,t,r,n)=>oy(e,Array.isArray(t)?e=>eS(e,"_tag")&&t.includes(e._tag):ek(t),r,n)),ow=Y(e=>tI(e[0]),(e,t,r)=>{let n;return ov(e,e=>(n??=Object.keys(t),eS(e,"_tag")&&ec(e._tag)&&n.includes(e._tag)?rA(e):rC(e)),e=>t[e._tag](e),r)}),oS=Y(e=>tI(e[0]),(e,t,r,n,i)=>oy(e,e=>ek(e,t)&&eS(e,"reason")&&(void 0!==i||ek(e.reason,r)),e=>{let t=e.reason;return ek(t,r)?n(t,e):i?i(t,e):t1(e)})),ok=Y(2,(e,t)=>od(e,e=>ao(sz(e,t)))),o_=Y(2,(e,t)=>oj(e,{onFailure:e=>ao(sz(e,t.onFailure)),onSuccess:e=>al(()=>t.onSuccess(e))})),oE=e=>"Unhandled"===e?(...e)=>t3(t=>{let r=t.getRef(sN);return void 0===r?am:ud(r)(...e)}):ud(!0===e?void 0:e),oC=Y(e=>tI(e[0]),(e,t)=>{if(!t?.log)return oB(e,{onFailure:e=>am,onSuccess:e=>am});let r=oE(t.log);return oj(e,{onFailure(e){let n=sR(e);return rk(n)?ao(n.failure):void 0===t.message?r(e):r(t.message,e)},onSuccess:e=>am})}),oI=Y(e=>tI(e[0]),(e,t)=>{if(!t?.log)return oj(e,{onFailure:e=>am,onSuccess:e=>am});let r=oE(t.log);return oj(e,{onFailure:e=>void 0===t.message?r(e):r(t.message,e),onSuccess:e=>am})}),oA=e=>oR(e,{onFailure:rC,onSuccess:rA}),oj=Y(2,(e,t)=>new oO(e,1!==t.onSuccess.length?e=>t.onSuccess(e):t.onSuccess,1!==t.onFailure.length?e=>t.onFailure(e):t.onFailure)),oT=tV({op:"OnSuccessAndFailure",[tx]:aI}),oO=function(e,t,r){this[tv]=e,this[tw]=t,this[tS]=r};oO.prototype=oT;let oN=function(e,t){let r=this.payload;return t.succeedWith(aN?r.onSuccess(e):th(()=>r.onSuccess(e)))},oM=(e,t)=>{let r=tV({op:e,[tx]:aI,[tw]:oN,[tS]:t}),n=function(e,t){this[tv]=e,this.payload=t};return n.prototype=r,n},o$=oM("Match",function(e,t){let r=sR(e);if(rk(r))return ao(r.failure);let n=this.payload;return t.succeedWith(aN?n.onFailure(r.success):th(()=>n.onFailure(r.success)))}),oU=oM("MatchCause",function(e,t){let r=this.payload;return t.succeedWith(aN?r.onFailure(e):th(()=>r.onFailure(e)))}),oB=((e,t)=>new oU(e,t),Y(2,(e,t)=>oj(e,{onFailure:e=>{let r=sR(e);return rk(r)?ao(r.failure):t.onFailure(r.success)},onSuccess:t.onSuccess}))),oP=Y(2,(e,t)=>new o$(e,t)),oR=Y(2,(e,t)=>{if(aJ(e)){if("Success"===e._tag)return tZ(t.onSuccess(e.value));let r=sR(e.cause);return rk(r)?t0(r.failure):tZ(t.onFailure(r.success))}return oP(e,t)}),oF=e=>aJ(e)?tZ(e):oL(e),oL=tG({op:"Exit",[tx](e){return e._stack.push(this),this[tv]},[tw]:(e,t,r)=>t.succeedWith(r??tZ(e)),[tS]:(e,t,r)=>t.succeedWith(r??t0(e))}),oz=Y(2,(e,t)=>aR(l3(t),e)),oD=Y(2,(e,t)=>aD(oH(e,t.duration),e=>rh(e)?t.orElse():aa(e.value))),oH=Y(2,(e,t)=>az(aP(e),aC(l3(t),rm))),oJ="~effect/Scope",oW="~effect/Scope/Closeable",oq=rV("effect/Scope"),oK=(e,t)=>t3(r=>(lf(r),oV(e,t)??am)),oV=(e,t)=>{let r=e.state;if("Closed"===r._tag||(e.state={_tag:"Closed",exit:t},void 0!==e.parent&&o1(e.parent,e),"Empty"===r._tag))return;if(void 0!==r.finalizer)return oG(r.finalizer,t);let n=r.finalizers;return 1===n.size?oG(n.values().next().value,t):oZ(e,n,t)},oG=(e,t)=>{try{return e(t)}catch(e){return t2(e)}},oY=(e,t)=>"Success"===e._tag?t:od(t,t=>ao(sP(tP(e.cause,t)))),oZ=aS(function*(e,t,r){let n=[],i=[],s=Array.from(t),a=s3();for(let t=s.length-1;t>=0;t--){let[o,l]=s[t];"sequential"===e.strategy?n.push((yield*oF(oG(l,r)))):o!==a&&i.push(lA(a,oG(l,r),!0,!0,"inherit"))}return i.length>0&&(n=yield*at(i)),yield*a6(n)}),oX=(e,t)=>{let r=o2(t,e);return"Closed"===e.state._tag?r.state=e.state:o0(e,r,e=>oK(r,e)),r},oQ=(e,t)=>au(()=>"Closed"===e.state._tag?t(e.state.exit):(o0(e,{},t),am)),o0=(e,t,r)=>{if("Empty"===e.state._tag)e.state={_tag:"Open",finalizerKey:t,finalizer:r,finalizers:void 0};else if("Open"===e.state._tag){let n=e.state;void 0!==n.finalizer&&(n.finalizers=new Map([[n.finalizerKey,n.finalizer]]),n.finalizerKey=void 0,n.finalizer=void 0),n.finalizers.set(t,r)}},o1=(e,t)=>{if("Open"!==e.state._tag)return;let r=e.state;r.finalizerKey===t?e.state=o3:void 0!==r.finalizers&&(r.finalizers.delete(t),0===r.finalizers.size&&(e.state=o3))},o2=(e="sequential",t)=>({[oW]:oW,[oJ]:oJ,strategy:e,parent:t,state:o3}),o3={_tag:"Empty"},o5=on(oq),o4=e=>au(()=>{let t=o2(void 0,void 0);return o7(e(t),e=>au(()=>oV(t,e)??am))}),o6=(u=tV({op:"OnExit",[tx](e){return e._stack.push(this),this.effect},[tk](e){e.interruptible&&!0!==this.interruptible&&(e._stack.push(lc),e.interruptible=!1)},[tw](e,t,r){let n;r??=tZ(e);try{n=this.onExit(r)}catch(e){n=t2(e)}return n?aD(n,e=>r):r},[tS](e,t,r){let n;r??=t0(e);try{n=this.onExit(r)}catch(e){n=t2(e)}return n?aD(oY(r,n),e=>r):r}}),(c=function(e,t,r){this.effect=e,this.onExit=t,this.interruptible=r}).prototype=u,c),o8=(e,t,r)=>new o6(e,t,r),o9=(e,t)=>{e._stack.push(new o6(void 0,t,void 0))},o7=Y(2,o8),le=Y(2,(e,t)=>o7(e,e=>t)),lt=((e,t,r)=>o7(e,e=>t(e)?r(e):am),Y(3,(e,t,r)=>o7(e,e=>{let n=t(e);return rk(n)?am:r(n.success,e)}))),lr=Y(2,(e,t)=>lt(e,aX,t)),ln=Y(3,(e,t,r)=>o7(e,e=>{if("Failure"!==e._tag)return am;let n=t(e.cause);return rk(n)?am:r(n.success,e.cause)})),li=Y(2,(e,t)=>ln(sL,t)(e)),ls=((e,t)=>al(()=>la(e,"function"==typeof t?e=>nX(n$(t(e))):X(nX(n$(t))))),X(1/0)),la=(e,t)=>{let r,n,i=0,s=(e,t)=>(t.awaiters++,o9(e,()=>{if(!(--t.awaiters>0)&&!t.done)return n===t&&(n=void 0),an(t.fiber)}),ar(t.fiber));return[t3(a=>{if(void 0!==n)return a===n.fiber?ar(n.fiber):s(a,n);if(void 0!==r&&(1/0===i||a.getRef(lZ).currentTimeMillisUnsafe()<i))return r;r=void 0;let o=a.getRef(lZ),l={fiber:new s5(a.context),awaiters:0,done:!1};n=l;let u=s(a,l);return l.fiber.evaluate(o8(e,e=>{if(l.done=!0,n!==l||(n=void 0,aQ(e)))return;let s=t(e);i=1/0===s?1/0:o.currentTimeMillisUnsafe()+s,r=e})),l.fiber._exit??u}),al(()=>{n=void 0,r=void 0})]},lo=t3(e=>ao(sU(e.id))),ll=e=>t3(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(lc)),e)),lu=tG({op:"SetInterruptible",[tk](e){if(e.interruptible=this[tv],e._interruptedCause&&e.interruptible)return()=>ao(e._interruptedCause)}}),lc=lu(!0),ld=lu(!1),lf=e=>{e.interruptible&&(e.interruptible=!1,e._stack.push(lc))},lh=e=>t3(t=>t.interruptible?e:(e=>{if(e.interruptible=!0,e._stack.push(ld),e._interruptedCause)return ao(e._interruptedCause)})(t)??e),lp=e=>t3(t=>t.interruptible?(t.interruptible=!1,t._stack.push(lc),e(lh)):e(Z)),lm=(e,t)=>e_(e)?t?.mode==="result"?lb(e,oA,t):lb(e,Z,t):t?.discard?"result"===t.mode?lb(Object.values(e),oA,t):lb(Object.values(e),Z,t):au(()=>aq(lb(Object.entries(e),([e,r])=>aq(t?.mode==="result"?oA(r):r,t=>[e,t]),{concurrency:t?.concurrency}),Object.fromEntries)),lg=((e=>e_(e[0])&&!tI(e[0]),(e,t,r)=>aq(lb(e,(e,r)=>oA(t(e,r)),r),e=>iV(e,Z))),tG({op:"While",[tw](e,t){return(this[tv].step(e),this[tv].while())?(t._stack.push(this),this[tv].body()):a0},[tx](e){return this[tv].while()?(e._stack.push(this),this[tv].body()):a0}})),lb=Y(e=>"function"==typeof e[1],(e,t,r)=>au(()=>{let n=lv(r?.concurrency);if(1===n)return ly(e,t,r);let i=iw(e),s=i.length;if(0===s)return r?.discard?am:aa([]);let a=r?.discard?void 0:Array(s),o=lk({f:t,out:a},i,{concurrency:n});return o?aC(o,a):aa(a)})),ly=(e,t,r)=>au(()=>{let n=r?.discard?void 0:[],i=e[Symbol.iterator](),s=i.next(),a=0;return aC(lg({while:()=>!s.done,body:()=>t(s.value,a++),step:e=>{n&&n.push(e),s=i.next()}}),n)}),lv=e=>"unbounded"===e?1/0:Math.max(1,e??1),lx=()=>e=>{let t=e.onItem,r=e.step,n=(e,t,n,s,a)=>aD(oF(a),a=>r(e,t[n],a,n)??i(e,t,n+1,s)??am),i=(e,i,s=0,a=i.length)=>{for(;s<a;s++){let o=i[s],l=t(e,o,s);if(!aJ(l))return n(e,i,s,a,l);let u=r(e,o,l,s);if(u)return"Failure"===u._tag?u:void 0}};return i},lw=e=>{let t=e.onItem,r=e.step;return(e,n,i)=>{let s,a,o,l,u,c=0,d=i.end??n.length,f=i.concurrency,h=!1,p=e=>{let t=t2(e);return l=t,h=!0,a&&a.size>0?aD(ll(as(Array.from(a))),()=>l??t):t},m=()=>{let i=!1;for(;!l&&c<d;c++){let d=n[c],g=u??t(e,d,c);if(aJ(g)){if(l=r(e,d,g,c))break}else{if(!s)return av(e=>{let t;s=s3(),a=new Set,u=g,o=e;try{t=m()}catch(t){return e(p(t))}return t?e(t):au(()=>(l??=a0,aD(a?as(a):am,()=>l?._tag==="Failure"?l:am)))});u=void 0;let t=lA(s,g,!0,!0,"inherit");if(t._exit){if(l=r(e,d,t._exit,c))break;continue}a.add(t);let n=c;if(t.addObserver(s=>{a.delete(t);try{if(l){if("Failure"===s._tag){let e=s.cause.reasons.filter(e=>"Interrupt"!==e._tag);if(e.length>0){let t=tB(e);l=t0("Failure"===l._tag?sP(tP(l.cause,t)):t)}}}else{let t=r(e,d,s,n);t&&(l=t,m())}if(i){let e=m();e&&o(e)}else h&&0===a.size&&o(l??am)}catch(e){o(p(e))}}),a.size<f)continue;i=!0,c++;return}}if(h=!0,l){if(a&&a.size>0){let e=s7(s);a.forEach(t=>t.interruptUnsafe(s.id,e));return}if(o||"Failure"===l._tag)return l}else if(o)if(!a)return a0;else 0===a.size&&o(am)};return m()}},lS=()=>e=>lw(e),lk=lw({onItem:(e,t,r)=>e.f(t,r),step(e,t,r,n){if("Failure"===r._tag)return r;e.out&&(e.out[n]=r.value)}}),l_=Y(3,(e,t,r)=>aD(e,e=>t(e)?aa(e):r(e))),lE=((e,t,r)=>aD(e,e=>{let n=t(e);return rk(n)?r(n.failure):aa(n.success)}),Y(e=>e_(e[0])&&!tI(e[0]),(e,t,r)=>aq(lb(e,(e,r)=>{let n=t(e,r);return"boolean"==typeof n?aa(n?rb(e):rm):aq(n,t=>t?rb(e):rm)},r),iq))),lC=Y(e=>e_(e[0])&&!tI(e[0]),(e,t,r)=>au(()=>{let n=[];return aC(lb(e,e=>aq(t(e),e=>{r_(e)&&n.push(e.success)}),{discard:!0,concurrency:r?.concurrency}),n)})),lI=Y(e=>tI(e[0]),(e,t)=>t3(r=>(s9.interruptChildren??=ae,aa(lA(r,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),lA=(e,t,r=!1,n=!1,i=!1)=>{let s="inherit"===i?e.interruptible:!i,a=new s5(e.context,s);return n||(e.children().add(a),a._parent=e),r?a.evaluate(t):(a._asyncContext=s2(),e.currentDispatcher.scheduleTask(()=>a.evaluate(t),0)),a},lj=e=>()=>t3(t=>t===e?am:an(e)),lT=Y(e=>tI(e[0]),(e,t,r)=>t3(n=>{let i="Closed"===t.state._tag?new s5(n.context):lA(n,e,r?.startImmediately,!0,r?.uninterruptible);return i._exit||("Closed"!==t.state._tag?(o0(t,i,lj(i)),i.addObserver(()=>o1(t,i))):i.interruptUnsafe(n.id,s7(n))),aa(i)})),lO=Y(e=>tI(e[0]),(e,t)=>aD(oq,r=>lT(e,r,t))),lN=e=>(t,r)=>{let n=new s5(r?.scheduler?nt(e,iY,r.scheduler):e,r?.uninterruptible!==!0);if(n.evaluate(t),n._exit)return n;if(r?.signal)if(r.signal.aborted)n.interruptUnsafe();else{let e=()=>n.interruptUnsafe();r.signal.addEventListener("abort",e,{once:!0}),n.addObserver(()=>r.signal.removeEventListener("abort",e))}return r?.onFiberStart&&r.onFiberStart(n),n},lM=Y(2,(e,t)=>(e._exit||("Closed"===t.state._tag?e.interruptUnsafe(e.id):(o1(t,e),o0(t,e,lj(e)),e.addObserver(()=>o1(t,e)))),e)),l$=lN(r7),lU=e=>{let t=lN(e);return(e,r)=>{let n=t(e,r);return new Promise(e=>{n.addObserver(t=>e(t))})}},lB=lU(r7),lP=e=>{let t=lU(e);return(e,r)=>t(e,r).then(e=>{if("Failure"===e._tag)throw sD(e.cause);return e.value})},lR=lP(r7),lF=e=>{let t=lN(e);return e=>{if(aJ(e))return e;let r=t(e,{scheduler:new i1("sync")});return r._dispatcher?.flush(),r._exit??t2(new ut(r))}},lL=lF(r7),lz=(d=lF(r7),e=>{let t=d(e);if("Failure"===t._tag)throw sD(t.cause);return t.value}),lD=aa(!0),lH=aa(!1);class lJ{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(0===this.waiters.length)return lD;if(void 0===this.scheduled)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let e=0;e<this.waiters.length;e++)this.scheduled.push(this.waiters[e]);return this.waiters=[],lD}flushScheduled=()=>{if(void 0===this.scheduled)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t](a0)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](a0)}open=t3(e=>this._isOpen?lH:(this._isOpen=!0,this.scheduleUnsafe(e)));release=t3(e=>this._isOpen?lH:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=av(e=>this._isOpen?e(am):(this.waiters.push(e),al(()=>{let t=this.waiters.indexOf(e);-1!==t?this.waiters.splice(t,1):void 0!==this.scheduled&&-1!==(t=this.scheduled.indexOf(e))&&this.scheduled.splice(t,1)})));closeUnsafe(){return!!this._isOpen&&(this._isOpen=!1,!0)}close=al(()=>this.closeUnsafe());whenOpen=e=>aD(this.await,()=>e);isOpen(){return this._isOpen}}let lW=e=>new lJ(e??!1),lq=BigInt(0),lK={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:lq,endTime:lq,exit:a0},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},lV=e=>e?na(e.annotations,sg)?"Span"===e._tag?lV(rz(e.parent)):rm:rb(e):rm,lG=(e,t,r)=>{let n,i=!e.cache.tracerEnabled||r?.annotations&&na(r.annotations,sg),s=r?.parent!==void 0?rb(r.parent):r?.root?rm:lV(e.cache.span);if(i){let e;e={name:t,parent:s,annotations:nt(r?.annotations??r7,sg,!0)},n=Object.assign(Object.create(lK),e)}else{let i=e.cache.tracer??sw,a=e.getRef(lZ),o=e.getRef(sC),l=e.getRef(sI),u=e.getRef(sA),c=r?.level??e.getRef(sb),d=r?.links!==void 0?[...u,...r.links]:0===u.length?[]:u.slice();for(let u in n=i.span({name:t,parent:s,annotations:r?.annotations??r7,links:d,startTime:o?a.currentTimeNanosUnsafe():lq,kind:r?.kind??"internal",root:r?.root??!1,sampled:r?.sampled??((!rp(s)||!1!==s.value.sampled)&&!us(e.getRef(sy),c))}),l)n.attribute(u,l[u]);if(r?.attributes!==void 0)for(let e in r.attributes)n.attribute(e,r.attributes[e])}return n},lY=on(sm),lZ=rV("effect/Clock",{defaultValue:()=>new lX});class lX{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=al(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return l1()}currentTimeNanos=al(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return l0()}monotonicTimeNanos=al(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(nX(e))}sleepMillis(e){return e<=0?ad:Number.isFinite(e)?av(t=>{let r=e>0x7fffffff?this.sleepMillis(e-0x7fffffff):am,n=setTimeout(()=>t(r),Math.min(e,0x7fffffff));return al(()=>clearTimeout(n))}):ax}}let lQ=BigInt(1e6),l0=function(){let e=globalThis.process?.hrtime;if("function"==typeof e?.bigint)return()=>e.bigint();if("u">typeof performance&&"function"==typeof performance.now)return()=>BigInt(Math.round(1e6*performance.now()));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*lQ;return e>t&&(t=e),t}}(),l1=(h=BigInt(1e9),()=>{let e=l0(),t=BigInt(Date.now())*lQ;if(void 0===f)f=t-e;else{let r=f+e;(t>r?t-r:r-t)>h&&(f=t-e)}return f+e}),l2=e=>t3(t=>e(t.getRef(lZ))),l3=e=>l2(t=>t.sleep(n$(e))),l5=l2(e=>e.currentTimeMillis),l4=(e=>e.monotonicTimeNanos,"~effect/Cause/TimeoutError"),l6="~effect/Cause/IllegalArgumentError";class l8 extends t8("IllegalArgumentError"){[l6]=l6;constructor(e){super({message:e})}}let l9="~effect/Cause/ExceededCapacityError";class l7 extends t8("ExceededCapacityError"){[l9]=l9;constructor(e){super({message:e})}}let ue="~effect/Cause/AsyncFiberError";class ut extends t8("AsyncFiberError"){[ue]=ue;constructor(e){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:e})}}let ur="~effect/Cause/UnknownError";class un extends t8("UnknownError"){[ur]=ur;constructor(e,t){super({message:t,cause:e})}}let ui=rV("effect/Console",{defaultValue:()=>globalThis.console}),us=rU(rM(rO,e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}})),ua=rV("effect/Logger/CurrentLoggers",{defaultValue:()=>new Set([uf,uh])}),uo=rV("effect/Logger/LogToStderr",{defaultValue:ee}),ul={"~effect/Logger":{_Message:Z,_Output:Z},pipe(){return K(this,arguments)}},uu=e=>{let t=Object.create(ul);return t.log=e,t},uc=(e,t)=>{let r=e[0].replace(/[\s="]/g,"_");return`${r}=${t-e[1]}ms`},ud=e=>(...t)=>{let r;for(let e=0,n=t.length;e<n;e++){let n=t[e];tT(n)&&(r?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),r=r?tB(r.reasons.concat(n.reasons)):n,e--)}return void 0===r&&(r=tF),t3(n=>{let i=e??n.cache.logLevel;if(us(n.cache.minimumLogLevel,i))return am;let s=n.getRef(lZ),a=n.getRef(ua);if(a.size>0){let e=new Date(s.currentTimeMillisUnsafe());for(let s of a)s.log({cause:r,fiber:n,date:e,logLevel:i,message:t})}return am})},uf=uu(({cause:e,date:t,fiber:r,logLevel:n,message:i})=>{let s=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&s.push(sG(e));let a=t.getTime(),o=r.getRef(sM),l="";for(let e of o)l+=` ${uc(e,a)}`;let u=r.getRef(sj);Object.keys(u).length>0&&s.push(u);let c=r.getRef(ui);(r.getRef(uo)?c.error:c.log)(`[${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}] ${n.toUpperCase()} (#${r.id})${l}:`,...s)}),uh=uu(({cause:e,fiber:t,logLevel:r,message:n})=>{let i=t.getRef(lZ),s=t.getRef(sj),a=t.cache.span;if(void 0===a||"ExternalSpan"===a._tag||"Ended"===a.status._tag)return;let o={};for(let[e,t]of Object.entries(s))tp(o,e,t);o["effect.fiberId"]=t.id,o["effect.logLevel"]=r.toUpperCase(),e.reasons.length>0&&(o["effect.cause"]=sG(e)),a.event(((e,t=2)=>{if("string"==typeof e)return e;try{return"object"==typeof e?ts(e,{space:t}):te(e,{space:t})}catch{return String(e)}})(Array.isArray(n)&&1===n.length?n[0]:n),i.currentTimeNanosUnsafe(),o)}),up=aa(void 0),um=e=>"Failure"===e._tag,ug=function(){this.resumes=void 0,this.effect=void 0};ug.prototype={"~effect/Deferred":{_A:Z,_E:Z},pipe(){return K(this,arguments)}};let ub=()=>new ug,uy=e=>av(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),al(()=>{let r=e.resumes;if(void 0===r)return;let n=r.indexOf(t);n>=0&&r.splice(n,1)}))),uv=Y(2,(e,t)=>al(()=>uS(e,t))),ux=((e,t)=>uv(e,t1(t)),Y(2,(e,t)=>uv(e,t0(t)))),uw=((e,t)=>uv(e,t2(t)),Y(2,(e,t)=>ux(e,sU(t)))),uS=((e,t)=>uv(e,tZ(t)),(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let r=e.resumes;e.resumes=void 0;for(let e=0;e<r.length;e++)r[e](t)}return!0}),uk=((e,t)=>lp(r=>aD(oF(r(e)),e=>uv(t,e))),"~effect/Layer"),u_="~effect/Layer/MemoMap",uE=(e,t)=>"Closed"!==t.state._tag&&(e.observers++,o0(t,{},e.finalizer),!0),uC={[uk]:{_ROut:Z,_E:Z,_RIn:Z},pipe(){return K(this,arguments)}},uI=e=>{let t=Object.create(uC);return t.build=e,t},uA=e=>{let t,r=(t=(t,n)=>t.getOrElseMemoize(r,n,e),uI((e,r)=>{let n=oX(r);return o7(t(e,n),e=>"Failure"===e._tag?oK(n,e):am)}));return r};class uj{get[u_](){return u_}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let r=this.map.get(e);return r?(uE(r,t),r.deferred.effect??uy(r.deferred)):this.parent?.get(e,t)}getOrElseMemoize(e,t,r){return au(()=>{let n;return o8(au(()=>{var i;let s,a=this.get(e,t);if(a)return a;let o=(i=this,s={observers:0,deferred:ub(),scope:o2(void 0,void 0),finalizer:t=>au(()=>--s.observers>0?am:(i.map.delete(e),oK(s.scope,t)))});return uE(o,t)?(n=o.deferred,this.map.set(e,o),r(this,o.scope)):r(this,t)}),e=>{n&&uS(n,e)})})}}let uT=()=>new uj;class uO extends(rV())("effect/Layer/CurrentMemoMap"){static forkOrCreate(e){let t=nn(e,uO);return t?new uj(t):uT()}}let uN=Y(3,(e,t,r)=>on(aq(au(()=>e.build(t,r)),nt(uO,t)),uO,t)),uM=Y(2,(e,t)=>t3(r=>uN(e,uO.forkOrCreate(r.context),t))),u$=e=>uI(X(aa(e))),uU=function(){return 1==arguments.length?e=>uB(arguments[0],e):uB(arguments[0],arguments[1])},uB=(e,t)=>uP(aq(t,t=>ne(e,t))),uP=e=>uA((t,r)=>o5(e,r)),uR=(e,t,r)=>{let n=oX(r,"parallel");return lb(e,e=>e.build(t,oX(n,"sequential")),{concurrency:e.length}).pipe(aq(e=>((...e)=>{let t=new Map;for(let r=0;r<e.length;r++)e[r].mapUnsafe.forEach((e,r)=>{t.set(r,e)});return r4(t)})(...e)))},uF=(e,t,r)=>uA((n,i)=>aD(Array.isArray(t)?uR(t,n,i):t.build(n,i),t=>e.build(n,i).pipe(or(t),aq(e=>r(e,t))))),uL=Y(2,(e,t)=>uF(e,t,Z)),uz=Y(2,(e,t)=>uF(e,t,(e,t)=>nd(t,e))),uD=e=>new tU(e),uH=e=>new tz(e),uJ=e=>void 0===e?rn:t1(rr(e));class uW extends(rV())("effect/Cause/StackTrace"){}let uq="~effect/DateTime",uK="~effect/DateTime/TimeZone",uV={[uq]:uq,pipe(){return K(this,arguments)},[ta](){return this.toString()},toJSON(){return ch(this).toJSON()}},uG={...uV,_tag:"Utc",[eE](){return eM(this.epochMilliseconds)},[eW](e){return u4(e)&&"Utc"===e._tag&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${ch(this).toJSON()})`}},uY={...uV,_tag:"Zoned",[eE](){return ej(eM(this.epochMilliseconds))(eC(this.zone))},[eW](e){return u4(e)&&"Zoned"===e._tag&&this.epochMilliseconds===e.epochMilliseconds&&eq(this.zone,e.zone)},toString(){return`DateTime.Zoned(${cA(this)})`}},uZ={[uK]:uK,[ta](){return this.toString()}},uX={...uZ,_tag:"Named",[eE](){return e$(`Named:${this.id}`)},[eW](e){return u8(e)&&"Named"===e._tag&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},uQ={...uZ,_tag:"Offset",[eE](){return e$(`Offset:${this.offset}`)},[eW](e){return u8(e)&&"Offset"===e._tag&&this.offset===e.offset},toString(){return`TimeZone.Offset(${cg(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},u0={value:void 0,enumerable:!1,writable:!0},u1=new WeakMap,u2=(e,t)=>({get(){return Object.isExtensible(this)?void 0:u1.get(this)?.[e]},set(r){if(Object.isExtensible(this)){for(let e of t)Object.defineProperty(this,e,u0);this[e]=r}else{let t=u1.get(this);void 0===t&&(t={},u1.set(this,t)),t[e]=r}}}),u3=["partsUtc","adjustedEpochMilliseconds","partsAdjusted"];Object.defineProperty(uG,"partsUtc",u2("partsUtc",["partsUtc"])),Object.defineProperties(uY,{partsUtc:u2("partsUtc",u3),adjustedEpochMilliseconds:u2("adjustedEpochMilliseconds",u3),partsAdjusted:u2("partsAdjusted",u3)});let u5=(e,t,r)=>{let n=Object.create(uY);return n.epochMilliseconds=e,n.zone=t,void 0!==r&&(n.partsUtc=r),n},u4=e=>eS(e,uq),u6=e=>u4(e[0]),u8=e=>eS(e,uK);(e,t)=>e.epochMilliseconds===t.epochMilliseconds;let u9=e=>{let t=Object.create(uG);return t.epochMilliseconds=e,t},u7=e=>{let t=e.getTime();if(Number.isNaN(t))throw new l8("Invalid date");return u9(t)},ce=e=>{if(u4(e))return e;if(e instanceof Date)return u7(e);if("object"==typeof e){if("epochMilliseconds"in e)return u7(new Date(e.epochMilliseconds));let t=new Date(0);return cy(t,e),u7(t)}return"string"!=typeof e||ct(e)?u7(new Date(e)):u7(new Date(e+"Z"))},ct=e=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e)||/z$|gmt$/i.test(e),cr=-864e13+432e5,cn=864e13-504e5,ci=rD((e,t)=>{let r,n=t?.timeZone;if(void 0===n&&u4(e)&&"Zoned"===e._tag)return e;let i=ce(e);if(i.epochMilliseconds<cr||i.epochMilliseconds>cn)throw RangeError(`Epoch millis out of range: ${i.epochMilliseconds}`);if(void 0===n&&"object"==typeof e&&"timeZoneId"in e&&(n=e.timeZoneId),void 0===n)r=cu(-60*new Date(i.epochMilliseconds).getTimezoneOffset()*1e3);else if(u8(n))r=n;else if("number"==typeof n)r=cu(n);else{let e=cf(n);if(rh(e))throw new l8(`Invalid time zone: ${n}`);r=e.value}return t?.adjustForTimeZone!==!0?u5(i.epochMilliseconds,r,i.partsUtc):cv(i.epochMilliseconds,r,t?.disambiguation??"compatible")}),cs=rD(ce),ca=/^(.{17,35})\[(.+)\]$/,co=((e,t,r)=>r?.adjustForTimeZone===!0?cv(e.epochMilliseconds,t,r?.disambiguation??"compatible"):u5(e.epochMilliseconds,t,e.partsUtc),new Map),cl={day:"numeric",month:"numeric",year:"numeric",era:"short",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},cu=e=>{let t=Object.create(uQ);return t.offset=e,t},cc=rD(e=>{let t=co.get(e);if(void 0!==t)return t;try{let t=(e=>{let t=e.resolvedOptions().timeZone,r=co.get(t);if(void 0!==r)return r;let n=Object.create(uX);return n.id=t,n.format=e,co.set(t,n),n})(new Intl.DateTimeFormat("en-US",{...cl,timeZone:e}));return co.set(e,t),t}catch{throw new l8(`Invalid time zone: ${e}`)}}),cd=/^(?:GMT)?[+-]/,cf=e=>{if(cd.test(e)){let t=cw(e);return null===t?rm:rb(cu(t))}return cc(e)},ch=e=>new Date(e.epochMilliseconds),cp=e=>{if("Utc"===e._tag)return new Date(e.epochMilliseconds);if("Offset"===e.zone._tag)return new Date(e.epochMilliseconds+e.zone.offset);if(void 0!==e.adjustedEpochMilliseconds)return new Date(e.adjustedEpochMilliseconds);let t=!1,r=e.zone.format.formatToParts(e.epochMilliseconds).filter(e=>"era"===e.type?(t="BC"===e.value,!1):"literal"!==e.type),n=Number(r[2].value),i=new Date(0);return i.setUTCFullYear(t?1-n:n,Number(r[0].value)-1,Number(r[1].value)),i.setUTCHours(Number(r[3].value),Number(r[4].value),Number(r[5].value),r[6]?.type==="fractionalSecond"?Number(r[6].value):(e.epochMilliseconds%1e3+1e3)%1e3),e.adjustedEpochMilliseconds=i.getTime(),i},cm=e=>cp(e).getTime()-cb(e),cg=e=>{let t=Math.abs(e),r=Math.floor(t/36e5),n=Math.round(t%36e5/6e4);return 60===n&&(r+=1,n=0),`${e<0?"-":"+"}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`},cb=e=>e.epochMilliseconds,cy=(e,t)=>{if((void 0!==t.year||void 0!==t.month||void 0!==t.day)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),void 0!==t.month?t.month-1:e.getUTCMonth(),t.day??e.getUTCDate()),void 0!==t.weekDay){let r=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+r)}void 0!==t.hour&&e.setUTCHours(t.hour),void 0!==t.minute&&e.setUTCMinutes(t.minute),void 0!==t.second&&e.setUTCSeconds(t.second),void 0!==t.millisecond&&e.setUTCMilliseconds(t.millisecond)},cv=(e,t,r)=>{if("Offset"===t._tag)return u5(e-t.offset,t);let n=cS(e-864e5,e,t),i=cS(e+864e5,e,t);if(n===i)return u5(e-n,t);let s=n-i;if(n<i){if(cS(e-i,e,t)===i)return u5(e-i,t);let s=u5(e-n,t);if(e!==cp(s).getTime())switch(r){case"reject":{let r=new Date(e).toISOString();throw RangeError(`Gap time: ${r} does not exist in time zone ${t.id}`)}case"earlier":return u5(e-i,t)}return s}if(cS(e-n,e,t)===n){if("earlier"===r||"compatible"===r||cS(e-n+s,e+s,t)===n)return u5(e-n,t);if("reject"===r){let r=new Date(e).toISOString();throw RangeError(`Ambiguous time: ${r} occurs twice in time zone ${t.id}`)}}return u5(e-i,t)},cx=/([+-])(\d{2}):?(\d{2})$/,cw=e=>{let t=cx.exec(e);if(null===t)return null;let[,r,n,i]=t;return("+"===r?1:-1)*(60*Number(n)+Number(i))*6e4},cS=(e,t,r)=>{let n=r.format.formatToParts(e).find(e=>"timeZoneName"===e.type)?.value??"";if("GMT"===n)return 0;let i=cw(n);return null===i?cm(u5(t,r)):i},ck=Y(u6,(e,t,r)=>{if("Utc"===e._tag){let r=ch(e);return t(r),u9(r.getTime())}let n=new Date(cp(e).getTime());return t(n),cv(n.getTime(),e.zone,r?.disambiguation??"compatible")}),c_=Y(2,(e,t)=>cE(e,e=>{let r=new Date(e);return t(r),r.getTime()})),cE=Y(2,(e,t)=>{let r=t(cb(e));return"Utc"===e._tag?u9(r):u5(r,e.zone)}),cC=((e,t)=>t(cp(e)),Y(2,(e,t)=>t(ch(e)))),cI=((e,t)=>{let r=c_(e,e=>{t.milliseconds&&e.setTime(e.getTime()+t.milliseconds),t.seconds&&e.setTime(e.getTime()+1e3*t.seconds),t.minutes&&e.setTime(e.getTime()+60*t.minutes*1e3),t.hours&&e.setTime(e.getTime()+60*t.hours*6e4)});return t.days||t.weeks||t.months||t.years?ck(r,e=>{if(t.days&&e.setUTCDate(e.getUTCDate()+t.days),t.weeks&&e.setUTCDate(e.getUTCDate()+7*t.weeks),t.months){let r=e.getUTCDate();e.setUTCMonth(e.getUTCMonth()+t.months+1,0),r<e.getUTCDate()&&e.setUTCDate(r)}if(t.years){let r=e.getUTCDate(),n=e.getUTCMonth();e.setUTCFullYear(e.getUTCFullYear()+t.years,n+1,0),r<e.getUTCDate()&&e.setUTCDate(r)}}):r},e=>{let t=cp(e);return"Utc"===e._tag?t.toISOString():`${t.toISOString().slice(0,-1)}${cg(cm(e))}`}),cA=e=>"Offset"===e.zone._tag?cI(e):`${cI(e)}[${e.zone.id}]`;(e,t)=>0===t?rm:rb(e/t);class cj{index;length;s;stripped;constructor(e,t=!1){this.s=e,this.stripped=t,this.index=0,this.length=e.length}next(){if(this.done)return{done:!0,value:void 0};let e=this.index;for(;!this.done&&!cT(this.s[this.index]);)this.index=this.index+1;let t=this.index;if(!this.done){let e=this.s[this.index];this.index=this.index+1,!this.done&&cO(e,this.s[this.index])&&(this.index=this.index+1),this.stripped||(t=this.index)}return{done:!1,value:this.s.substring(e,t)}}[Symbol.iterator](){return new cj(this.s,this.stripped)}get done(){return this.index>=this.length}}let cT=e=>{let t=e.charCodeAt(0);return 13===t||10===t},cO=(e,t)=>13===e.charCodeAt(0)&&10===t.charCodeAt(0),cN=((e,t)=>eq(e.tz,t.tz)&&e.and===t.and&&e.onDstOverlap===t.onDstOverlap&&cM(e.seconds,t.seconds)&&cM(e.minutes,t.minutes)&&cM(e.hours,t.hours)&&cM(e.days,t.days)&&cM(e.months,t.months)&&cM(e.weekdays,t.weekdays),ra(rs)),cM=(e,t)=>cN(iw(e),iw(t)),c$=Y(2,(e,t)=>op(e,cR,e=>t(e))),cU=e=>e.reasons.some(cB),cB=e=>"Fail"===e._tag&&eS(e.error,re),cP=e=>{let t,r=!1;for(let n of e.reasons)cB(n)?t??=n.error:"Interrupt"!==n._tag&&(r=!0);return void 0===t?rC(e):r?rC(tB(e.reasons.filter(e=>!cB(e)))):rA(t)},cR=e=>{let t=cP(e);return rk(t)?t:rA(t.success.value)},cF=e=>{let t=cP(e);return rk(t)?t0(t.failure):tZ(t.success.value)},cL=Y(2,(e,t)=>oj(e,{onSuccess:t.onSuccess,onFailure:e=>{let r=cP(e);return rk(r)?t.onFailure(r.failure):t.onDone(r.success.value)}})),cz="~effect/Schedule",cD=rV("effect/Schedule/CurrentMetadata",{defaultValue:X({input:void 0,output:void 0,duration:nq,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),cH={[cz]:{_Out:Z,_In:Z,_Env:Z},pipe(){return K(this,arguments)}},cJ=e=>{let t=Object.create(cH);return t.step=e,t},cW=()=>{let e,t,r=0;return(n,i)=>{void 0===t&&(t=n);let s=n-t,a=void 0===e?0:n-e;return e=n,{input:i,attempt:++r,start:t,now:n,elapsed:s,elapsedSincePrevious:a}}},cq=e=>od(e.step,e=>aa(()=>ao(e))),cK=e=>l2(t=>aq(cq(e),e=>{let r=cW();return n=>au(()=>{let i=t.currentTimeMillisUnsafe();return aD(e(i,n),([e,t])=>{let s=r(i,n);return s.output=e,s.duration=t,aC(l3(t),s)})})})),cV=((e,t)=>cJ(al(()=>{let r,n=0,i=cV(e,({output:e})=>rC(e)),s=cV(t,({output:e})=>rA(e));return function e(t,a){return r?r(t,a):cq(0===n?i:s).pipe(aD(i=>1==++n?(r=(t,n)=>c$(i(t,n),i=>(r=void 0,e(t,n))))(t,a):(r=i)(t,a)))}})),Y(2,(e,t)=>cJ(aq(cq(e),e=>{let r=cW();return(n,i)=>cL(e(n,i),{onSuccess:([e,s])=>{let a=t({...r(n,i),output:e,duration:s});return tI(a)?aq(a,e=>[e,s]):aa([a,s])},onFailure:ao,onDone:e=>{let s=t({...r(n,i),output:e,duration:nq});return tI(s)?aD(s,uJ):uJ(s)}})})))),cG=((e,t)=>cJ(aq(cq(e),e=>{let r=cW();return(n,i)=>aD(e(n,i),([e,s])=>aq(t({...r(n,i),output:e,duration:s}),t=>[e,n$(t)]))})),e=>cJ(aq(cq(e),e=>(t,r)=>cL(e(t,r),{onSuccess:e=>aa([r,e[1]]),onFailure:ao,onDone:()=>uJ(r)})))),cY=Y(2,(e,t)=>cJ(aq(cq(e),e=>{let r=cW();return(n,i)=>aD(e(n,i),e=>{let[s,a]=e,o=t({...r(n,i),output:s,duration:a});return aD(tI(o)?o:aa(o),t=>t?aa(e):uJ(s))})}))),cZ=(U=n$(nq),cJ(aq(aa(e=>aa([e.attempt-1,U])),e=>{let t=cW();return(r,n)=>e(t(r,n))}))),cX="~effect/ExecutionPlan",cQ={[cX]:cX,get captureRequirements(){let e=this;return ot(t=>aa(c0(e.steps.map(e=>({...e,while:e.while?r=>or(e.while(r),t):void 0,schedule:e.schedule?cJ(or(aq(cq(e.schedule),e=>(r,n)=>or(e(r,n),t)),t)):void 0,provide:eS(e.provide,uk)?uL(e.provide,u$(t)):e.provide})))))},pipe(){return K(this,arguments)}},c0=e=>{let t=Object.create(cQ);return t.steps=e,t},c1=Y(e=>tI(e[0]),(e,t,r)=>{let n;return r8(t)?or(e,t):(n=Array.isArray(t)?((...e)=>uA((t,r)=>uR(e,t,r)))(...t):t,o4(t=>aD(r?.local?uN(n,uT(),t):uM(n,t),t=>or(e,t))))}),c2=Y(3,(e,t,r)=>aD(cK(t),t=>{let n=cD.defaultValue(),i=r=>cL(t(r),{onSuccess:t=>aD(on(e,cD,n=t),i),onFailure:ao,onDone:aa});return op(aD(on(e,cD,n),i),sR,e=>r(e,0===n.attempt?rm:rb(n)))})),c3=Y(3,(e,t,r)=>aD(cK(t),t=>{let n,i=cD.defaultValue(),s=op(au(()=>on(e,cD,i)),sR,e=>(n=e,aD(t(e),e=>(i=e,s))));return c$(s,e=>th(()=>r(n,e)))})),c5=Y(2,(e,t)=>c2(e,"function"==typeof t?t(Z):eS(t,cz)?t:c9(t),t1)),c4=Y(2,(e,t)=>c3(e,"function"==typeof t?t(Z):eS(t,cz)?t:c9(t),t1)),c6=Y(3,(e,t,r)=>aD(cK(r),r=>{let n=t=>cL(r(t),{onSuccess:t=>aD(on(e,cD,t),n),onFailure:ao,onDone:aa});return n(t)})),c8=cG(cZ),c9=e=>{let t=e.schedule?cG(e.schedule):c8;return e.while&&(t=cY(t,({input:t})=>{let r=e.while(t);return tI(r)?r:aa(r)})),e.until&&(t=cY(t,({input:t})=>{let r=e.until(t);return tI(r)?aq(r,e=>!e):aa(!r)})),void 0!==e.times&&(t=cY(t,({attempt:t})=>aa(t<=e.times))),t},c7=cY(cZ,({attempt:e})=>aa(e<=1)),de="~effect/MutableHashMap",dt={[de]:de,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${te(Array.from(this))})`},toJSON(){return{_id:"MutableHashMap",values:to(Array.from(this))}},[ta](){return this.toJSON()},pipe(){return K(this,arguments)}},dr=Y(2,(e,t)=>{if(e.backing.has(t))return rb(e.backing.get(t));if(dn(t))return rm;let r=eC(t),n=e.buckets.get(r);return void 0===n?rm:di(e,n,t)}),dn=e=>"object"!=typeof e&&"function"!=typeof e,di=(e,t,r)=>{for(let n=0,i=t.length;n<i;n++)if(eq(r,t[n])){let r=t[n];return rb(e.backing.get(r))}return rm},ds=Y(2,(e,t)=>rp(dr(e,t))),da=Y(3,(e,t,r)=>{if(e.backing.has(t)||dn(t))return e.backing.set(t,r),e;let n=eC(t),i=e.buckets.get(n);if(void 0===i)return e.buckets.set(n,[t]),e.backing.set(t,r),e;let s=dl(i,t);return void 0===s&&(i.push(t),s=t),e.backing.set(s,r),e}),dl=(e,t)=>{for(let r=0,n=e.length;r<n;r++)if(eq(t,e[r]))return e[r]},du=Y(2,(e,t)=>{if(dn(t))return e.backing.delete(t),e;let r=eC(t),n=e.buckets.get(r);if(void 0===n)return e;for(let r=0,i=n.length;r<i;r++){let i=n[r];if(i===t||eq(t,i)){e.backing.delete(i),n.splice(r,1);break}}return 0===n.length&&e.buckets.delete(r),e}),dc=((e,t)=>al(()=>e.completeUnsafe(t)),new WeakSet),dd=new WeakMap,df=rV("effect/Metric/CurrentMetricAttributes",{defaultValue:()=>({})}),dh=rV("effect/Metric/MetricRegistry",{defaultValue:()=>new Map}),dp="~effect/Metric";class dm{[dp]=dp;#e;#t;#r="";id;description;attributes;constructor(e,t,r){this.id=e,this.description=t,this.attributes=r}valueUnsafe(e){return this.hook(e).get(e)}modifyUnsafe(e,t){return this.hook(t).modify(e,t)}updateUnsafe(e,t){return this.hook(t).update(e,t)}hook(e){let t=this.key(e),r=na(e,dh),n=r.get(t);return void 0===n&&(n=this.metadata(this.createHooks()),r.set(t,n)),n.hooks}removeUnsafe(e){na(e,dh).delete(this.key(e))}registerUnsafe(e,t){let r=this.key(e),n=na(e,dh),i=this.metadata({get:t.get,update:et,modify:et});return n.set(r,i),{remove(){n.get(r)===i&&n.delete(r)}}}key(e){let t=na(e,df);if(t!==this.#e){var r;let e;this.#e=t;let n=function(e,t){return{...d_(e),...d_(t)}}(this.attributes,t);this.#t=Object.keys(t).length>0?n:this.attributes,this.#r=(r=this,e=Object.entries(n).sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])),JSON.stringify([r.type,r.id,r.description,e]))}return this.#r}metadata(e){return{id:this.id,type:this.type,description:this.description,attributes:this.#t,hooks:e}}pipe(){return K(this,arguments)}}let dg=BigInt(0);class db extends dm{type="Counter";#n;#i;constructor(e,t){super(e,t?.description,d_(t?.attributes)),this.#n=t?.bigint??!1,this.#i=t?.incremental??!1}createHooks(){let e=this.#n?dg:0,t=this.#i?this.#n?e=>e>=dg:e=>e>=0:e=>!0;return dk(()=>({count:e,incremental:this.#i}),r=>{t(r)&&(e+=r)})}}class dy extends dm{type;metric;mapInput;mapContext;constructor(e,t,r){super(e.id,e.description,e.attributes),this.metric=e,this.mapInput=t,this.mapContext=r,this.type=e.type}createHooks(){return this.metric.createHooks()}valueUnsafe(e){return this.metric.valueUnsafe(this.mapContext(e))}updateUnsafe(e,t){let r=this.mapContext(t);this.metric.updateUnsafe(this.mapInput(e,r),r)}modifyUnsafe(e,t){let r=this.mapContext(t);this.metric.modifyUnsafe(this.mapInput(e,r),r)}removeUnsafe(e){dx(this.metric,this.mapContext(e))}registerUnsafe(e,t){return dw(this.metric,this.mapContext(e),{get:t.get,update:et,modify:et})}}let dv=(e,t)=>new db(e,t),dx=((e,t)=>ot(r=>al(()=>e.updateUnsafe(t,r))),(e,t)=>e.removeUnsafe(t)),dw=(e,t,r)=>e.registerUnsafe(t,r),dS=((e,t)=>new dy(e,t,Z),e=>Array.from(e).map(([e,t])=>`(${e} -> ${t})`).join(", "));function dk(e,t,r){return{get:e,update:t,modify:r??t}}new class e extends dm{type="Gauge";#n;constructor(e,t){super(e,t?.description,d_(t?.attributes)),this.#n=t?.bigint??!1}createHooks(){let e=this.#n?BigInt(0):0;return dk(()=>({value:e}),t=>{e=t},t=>{e+=t})}}("child_fibers_active",{description:"The current count of active child fibers"});function d_(e){return eg(e)&&Array.isArray(e)?e.reduce((e,[t,r])=>(tp(e,t,r),e),{}):e}let dE=e=>ab(function(t,r){e(r).then(e=>t(aa(e)),e=>t(ah(e)))},0!==e.length),dC=e=>{let t="function"==typeof e?e:e.try,r="function"==typeof e?e=>new un(e,"An error occurred in Effect.tryPromise"):e.catch;return ab(function(e,n){let i=e=>au(()=>{try{return t1(th(()=>r(e)))}catch(e){return ah(e)}});try{t(n).then(t=>e(aa(t)),t=>e(i(t)))}catch(t){e(i(t))}},0!==t.length)},dI=(...e)=>{if(1===e.length){let t=e[0];return au(()=>aE(t()))}let[t,r]=e;return au(()=>aE(r.call(t.self)))},dA=e=>au(()=>ao(e())),dj=e=>aD(e,Z),dT=e=>t3(t=>{let r=t.context,n=o2(void 0,void 0);return t.setContext(nt(t.context,oq,n)),o9(t,e=>(t.setContext(r),oV(n,e))),e}),dO=(e,t,r)=>ot(n=>lp(i=>aD(oq,s=>aF(r?.interruptible?i(e):e,e=>oQ(s,r=>or(t(e,r),n)))))),dN=e=>al(()=>la(e,ls)[0]),dM=(e,...t)=>{let r=1===t.length?void 0:t[0],n=t[t.length-1];return t3(t=>{let i=lG(t,e,r),s=t.getRef(lZ),a=t.getRef(sC);return o9(t,e=>al(()=>{"Ended"!==i.status._tag&&i.end(a?s.currentTimeNanosUnsafe():lq,e)})),n(i)})},d$=function(){let e=tI(arguments[0]),t=e?arguments[1]:arguments[0],r=e?arguments[2]:arguments[1],n=Z;if("Span"===t._tag){var i,s;r=(e=>{var t;let r;if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&"boolean"!=typeof e.captureStackTrace)return e;let n=Error.stackTraceLimit;if(0===n&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};td(3);let i=Error();return td(n),{...e,captureStackTrace:(t=()=>i.stack,()=>{if(void 0!==r)return r;let e=t();if(!e)return;let n=e.split("\n");if(void 0!==n[3])return r=n[3].trim()})}})(r),i=t.name,s="function"==typeof(s=r?.captureStackTrace)?s:et,n=a9(s_,e=>({name:i,stack:s,parent:e}))}return e?lY(n(arguments[0]),t):e=>lY(n(e),t)},dU=ud(),dB=ud("Error"),dP=Y(e=>tI(e[0]),(e,...t)=>a9(e,sj,e=>{let r=1===t.length?{...e,...t[0]}:{...e};return 1===t.length||tp(r,t[0],t[1]),r})),dR=Y(2,(e,t)=>aD(l5,r=>a9(e,sM,e=>[[t,r],...e]))),dF=(e,...t)=>{let r=aw(e,t);return ak(r.length,0===t.length?function(){return a_(()=>r.apply(this,arguments))}:function(){let e=a_(()=>r.apply(this,arguments));for(let r of t)e=r(e,...arguments);return e})};e.s(["acquireRelease",0,dO,"acquireUseRelease",0,(e,t,r)=>lp(n=>aD(e,e=>o8(au(()=>n(t(e))),t=>r(e,t),!0))),"addFinalizer",0,e=>aD(oq,t=>ot(r=>oQ(t,t=>or(e(t),r)))),"all",0,lm,"andThen",0,aR,"annotateLogs",0,dP,"as",0,aC,"asSome",0,aP,"asVoid",0,aL,"cached",0,dN,"callback",0,av,"catch",0,om,"catchCause",0,od,"catchCauseFilter",0,op,"catchEager",0,aY,"catchFilter",0,ov,"catchIf",0,oy,"catchReason",0,oS,"catchTag",0,ox,"catchTags",0,ow,"clockWith",0,l2,"context",0,a7,"contextWith",0,ot,"delay",0,oz,"die",0,ah,"ensuring",0,le,"exit",0,oF,"fail",0,t1,"failCause",0,ao,"failCauseSync",0,dA,"failSync",0,ap,"filter",0,lE,"filterMapEffect",0,lC,"filterOrElse",0,l_,"filterOrFail",0,ol,"flatMap",0,aD,"flatMapEager",0,aW,"flatten",0,dj,"fnUntraced",0,aS,"fnUntracedEager",0,dF,"forEach",0,lb,"forever",0,oc,"forkChild",0,lI,"forkIn",0,lT,"forkScoped",0,lO,"fromResult",0,ac,"gen",0,dI,"ignore",0,oC,"ignoreCause",0,oI,"interrupt",0,lo,"isEffect",0,tI,"log",0,dU,"logError",0,dB,"makeSpan",0,(e,t)=>t3(r=>aa(lG(r,e,t))),"map",0,aq,"mapBothEager",0,aG,"mapEager",0,aK,"mapError",0,ok,"mapErrorEager",0,aV,"matchCauseEffect",0,oj,"matchCauseEffectEager",0,aH,"matchEffect",0,oB,"never",0,ax,"onError",0,lr,"onExit",0,o7,"onExitPrimitive",0,o8,"onInterrupt",0,li,"orDie",0,e=>om(e,ah),"promise",0,dE,"provide",0,c1,"provideContext",0,or,"provideService",0,on,"provideServiceEffect",0,os,"raceAll",0,(e,t)=>t3(r=>{let n=new Set;return o9(r,()=>0===n.size?void 0:as(n)),av(i=>{let s=iw(e),a=s.length,o=0,l=!1,u=[],c=(e,n,s)=>{if(o++,"Failure"===e._tag){u.push(...e.cause.reasons),o>=a&&i(ao(sP(tB(u))));return}let c=!l;l=!0,i(e),c&&t?.onWinner&&t.onWinner({fiber:n,index:s,parentFiber:r})};for(let e=0;e<a;e++){let t=lA(r,s[e],!0,!0,!1);if(n.add(t),t.addObserver(r=>{n.delete(t),c(r,t,e)}),l)break}})}),"raceFirst",0,az,"repeat",0,c5,"result",0,oA,"retry",0,c4,"runFork",0,l$,"runForkWith",0,lN,"runPromise",0,lR,"runPromiseExit",0,lB,"runPromiseWith",0,lP,"runSync",0,lz,"runSyncExit",0,lL,"scope",0,oq,"scoped",0,dT,"scopedWith",0,o4,"service",0,e=>e,"serviceOption",0,e=>t3(t=>aa(nc(t.context,e))),"sleep",0,l3,"succeed",0,aa,"succeedNone",0,af,"succeedSome",0,e=>aa(rb(e)),"suspend",0,au,"sync",0,al,"tap",0,aF,"tapError",0,ob,"timeoutOrElse",0,oD,"try",0,ag,"tryPromise",0,dC,"undefined",0,up,"uninterruptible",0,ll,"uninterruptibleMask",0,lp,"updateContext",0,a8,"updateService",0,a9,"useSpan",0,dM,"void",0,am,"when",0,ou,"whileLoop",0,lg,"withFiber",0,t3,"withFiberSucceed",0,t5,"withLogSpan",0,dR,"withParentSpan",0,d$,"yieldNow",0,ad,"zip",0,oa,"zipWith",0,oo],4270);var dL=e.i(4270),dL=dL,dz=dL,dD=e.i(20367),dH=e.i(6655),dL=dL,dz=dL,dJ=dL,dW=dL;let dq=/^[+-]?\d+$/,dK="~effect/BigDecimal",dV={[dK]:dK,[eE](){let e=d3(this);return ej(e$(String(e.value)),eM(e.scale))},[eW](e){return dG(e)&&0===ft(this,e)},toString(){return`BigDecimal(${fo(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[ta](){return this.toJSON()},pipe(){return K(this,arguments)}},dG=e=>eS(e,dK),dY=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let r=Object.create(dV);return r.value=e,r.scale=t,r},dZ=(e,t)=>{let r=dY(e,t);return r.normalized=r,r},dX=BigInt(0),dQ=BigInt(1),d0=BigInt(-1),d1=BigInt(10),d2=dZ(dX,0),d3=e=>{if(void 0===e.normalized)if(e.value===dX)e.normalized=d2;else{let t=`${e.value}`,r=d5(t);e.normalized=dZ(BigInt(t.slice(0,t.length-r)),e.scale-r)}return e.normalized},d5=e=>{let t=e.length;for(;"0"===e[t-1];)t--;return e.length-t},d4=e=>{if(e>2e4)throw RangeError(`Scale alignment must not exceed 20000 digits, got ${e}`);return d1**BigInt(e)},d6=Y(2,(e,t)=>t>e.scale?dY(e.value*d4(t-e.scale),t):t<e.scale?dY(e.value/d4(e.scale-t),t):e),d8=Y(2,(e,t)=>t.value===dX?e:e.value===dX?t:e.scale>t.scale?dY(d6(t,e.scale).value+e.value,e.scale):e.scale<t.scale?dY(d6(e,t.scale).value+t.value,t.scale):dY(e.value+t.value,e.scale)),d9=[dQ],d7=(e,t)=>e===t?0:e<t?-1:1,fe=(e,t)=>{let r=`${e.value<dX?-e.value:e.value}`,n=`${t.value<dX?-t.value:t.value}`,i=BigInt(r.length-n.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==dX)return i<dX?-1:1;let s=Math.max(r.length,n.length);return rT(r.padEnd(s,"0"),n.padEnd(s,"0"))},ft=(e,t)=>{if(e.scale===t.scale)return d7(e.value,t.value);let r=fs(e),n=fs(t);if(r!==n)return r<n?-1:1;if(0===r)return 0;let i=e.scale-t.scale,s=Math.abs(i);if(s>100)return -1===r?fe(t,e):fe(e,t);let a=d9[s]??=d1**BigInt(s);return i>0?d7(e.value,t.value*a):d7(e.value*a,t.value)},fr=rj(ft),fn=r$(fr),fi=rU(fr),fs=e=>e.value===dX?0:e.value<dX?-1:1,fa=ri((e,t)=>0===ft(e,t)),fo=((e,t)=>fa(e,t),e=>{let t=d3(e);if(Math.abs(t.scale)>=16)return fl(t);let r=t.value<dX,n=`${r?-t.value:t.value}`,i=t.scale>0?n.padStart(t.scale+1,"0"):n.padEnd(n.length-t.scale,"0"),s=i.length-t.scale,a=t.scale>0?`${i.slice(0,s)}.${i.slice(s)}`:i;return r?`-${a}`:a}),fl=e=>{if(fu(e))return"0e+0";let t=d3(e),r=`${t.value}`,n=t.value<dX?2:1,i=r.slice(0,n),s=r.slice(n),a=s.length-t.scale;return`${i}${""===s?"":`.${s}`}e${a>=0?"+":""}${a}`},fu=e=>e.value===dX,fc=e=>dG(e[0]),fd=Y(fc,(e,t=0)=>e.scale<=t?e:dY(e.value/d4(e.scale-t),t)),ff=((e,t=0)=>{let r=fd(e,t);return e.value>dX&&fn(r,e)?d8(r,dY(dQ,t)):r},globalThis.BigInt),fh=ff(0),fp=((e,t)=>{let r;for(;t!==fh;){let r=t;t=e%t,e=r}return(r=e)<fh?-r:r},BigInt(0)),fm=BigInt(1),fg=BigInt(1e3),fb=BigInt(1024),fy=[{symbol:"B",factor:fm,names:["B","byte","bytes"]},{symbol:"kB",factor:fg,names:["kB","kilobyte","kilobytes"]},{symbol:"MB",factor:fg**BigInt(2),names:["MB","megabyte","megabytes"]},{symbol:"GB",factor:fg**BigInt(3),names:["GB","gigabyte","gigabytes"]},{symbol:"TB",factor:fg**BigInt(4),names:["TB","terabyte","terabytes"]},{symbol:"PB",factor:fg**BigInt(5),names:["PB","petabyte","petabytes"]},{symbol:"EB",factor:fg**BigInt(6),names:["EB","exabyte","exabytes"]},{symbol:"ZB",factor:fg**BigInt(7),names:["ZB","zettabyte","zettabytes"]},{symbol:"YB",factor:fg**BigInt(8),names:["YB","yottabyte","yottabytes"]},{symbol:"RB",factor:fg**BigInt(9),names:["RB","ronnabyte","ronnabytes"]},{symbol:"QB",factor:fg**BigInt(10),names:["QB","quettabyte","quettabytes"]}],fv=[fy[0],{symbol:"KiB",factor:fb,names:["KiB","kibibyte","kibibytes"]},{symbol:"MiB",factor:fb**BigInt(2),names:["MiB","mebibyte","mebibytes"]},{symbol:"GiB",factor:fb**BigInt(3),names:["GiB","gibibyte","gibibytes"]},{symbol:"TiB",factor:fb**BigInt(4),names:["TiB","tebibyte","tebibytes"]},{symbol:"PiB",factor:fb**BigInt(5),names:["PiB","pebibyte","pebibytes"]},{symbol:"EiB",factor:fb**BigInt(6),names:["EiB","exbibyte","exbibytes"]},{symbol:"ZiB",factor:fb**BigInt(7),names:["ZiB","zebibyte","zebibytes"]},{symbol:"YiB",factor:fb**BigInt(8),names:["YiB","yobibyte","yobibytes"]}],fx=[...fy,...fv.slice(1)],fw=new Map(fx.flatMap(e=>e.names.map(t=>[t,e]))),fS=new Map(fx.map(e=>[e.symbol,e])),fk=e=>{throw Error(`Invalid ByteSize: ${e}`)},f_=e=>!Number.isSafeInteger(e)||e<0?fk(`expected a non-negative safe integer, received ${e}`):BigInt(e),fE=BigInt(Number.MAX_SAFE_INTEGER),fC=(e,t)=>{let r=/^(\d+)(?:\.(\d+))?(?:e([+-]\d+))?$/.exec(e);if(null===r)return;let n=r[2]??"",i=BigInt(r[1]+n)*t,s=Number(r[3]??0)-n.length;if(s>=0)return i*BigInt(10)**BigInt(s);let a=BigInt(10)**BigInt(-s);return i%a===fp?i/a:void 0},fI=e=>{let t=/^\s*(\d+(?:\.\d+)?)\s*([A-Za-z]+)\s*$/.exec(e);if(null===t)return fk(`unsupported syntax ${JSON.stringify(e)}`);let r=fw.get(t[2]);if(void 0===r)return fk(`unsupported unit ${JSON.stringify(t[2])}`);let n=fC(t[1],r.factor);return void 0===n?fk(`${JSON.stringify(e)} does not represent an integral number of bytes`):n},fA=rD(fI),fj=e=>{switch(typeof e){case"bigint":if(e<fp)return fk(`expected a non-negative bigint, received ${e}`);return e;case"number":return f_(e);case"string":return fI(e)}return fk(`unsupported input ${e}`)},fT=rD(fj),fO=e=>((e,t)=>{if("bigint"==typeof e)return e<fp?fk(`expected a non-negative quantity, received ${e}`):e*t.factor;if(fv.includes(t)){let r=e*Number(t.factor);if(Number.isSafeInteger(r)&&r>=0)return BigInt(r)}else{let r=fC(String(e),t.factor);if(void 0!==r&&r<=fE)return r}return fk(`expected an exact non-negative safe-integer byte result, received ${e} ${t.symbol}`)})(e,fS.get("MiB")),fN=e=>e>ff(Number.MAX_SAFE_INTEGER)||e<ff(Number.MIN_SAFE_INTEGER)?rm:rb(Number(e)),fM="~effect/crypto/CryptoError",f$="~effect/crypto/CryptoError/Reason";class fU extends i9("InvalidArgument"){[f$]=f$;get message(){return this.description}}class fB extends i9("InvalidKey"){[f$]=f$;get message(){return this.description}}class fP extends i9("DecryptionFailed"){[f$]=f$;get message(){return"Could not decrypt the data"}}class fR extends i9("Unsupported"){[f$]=f$;get message(){return this.description}}class fF extends i9("NotExtractable"){[f$]=f$;get message(){return this.description}}class fL extends i9("CryptoError"){[fM]=fM;cause="cause"in this.reason?this.reason.cause:void 0;get message(){return`${this.module}.${this.method}: ${this.reason.message}`}}function fz(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}let fD=e=>e?`"${e}" `:"";function fH(e,t=""){if("boolean"!=typeof e)throw TypeError(fD(t)+"expected boolean, got type="+typeof e);return e}function fJ(e,t=""){if("number"!=typeof e)throw TypeError(fD(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(fD(t)+"expected integer >= 0, got "+e);return e}function fW(e,t,r=""){if(fz(e)&&(void 0===t||e.length===t))return e;void 0!==t&&fJ(t,"length");let n=fz(e),i=void 0!==t?` of length ${t}`:"",s=n?`length=${e.length}`:`type=${typeof e}`,a=fD(r)+"expected Uint8Array"+i+", got "+s;if(!n)throw TypeError(a);throw RangeError(a)}let fq=(e,t)=>{if(null===e||"object"!=typeof e||Array.isArray(e))throw TypeError("object"===t?"expected valid options object":`"${t}" expected object, got type=${typeof e}`)};function fK(e,t=!0){if(e.destroyed)throw Error("hash was destroyed");if(t&&e.finished)throw Error("digest() was already called")}function fV(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function fG(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let fY=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],fZ=fY?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function fX(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(fW(t,e,"output"),r&&!fQ(t))throw Error("invalid output, must be aligned");return t}function fQ(e){return e.byteOffset%4==0}function f0(e){return Uint8Array.from(fW(e))}let f1=e=>Uint8Array.from(e.split(""),e=>e.charCodeAt(0)),f2=fZ(fV(f1("expand 16-byte k"))),f3=fZ(fV(f1("expand 32-byte k")));function f5(e,t){return e<<t|e>>>32-t}let f4=Uint32Array.of();function f6(e,t){var r;let{allowShortKeys:n,extendNonceFn:i,counterLength:s,counterRight:a,rounds:o}=(fq(r={allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},"defaults"),fq(t,"opts"),Object.assign(r,t));if("function"!=typeof e)throw Error("core must be a function");return fJ(s),fJ(o),fH(a),fH(n),(t,r,l,u,c=0)=>{let d,f;fW(t,void 0,"key"),fW(r,void 0,"nonce"),fW(l,void 0,"data");let h=l.length,p=void 0!==u;if(u=fX(h,u,!1),p&&function(e,t){if(e.byteLength&&t.byteLength&&e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength&&e.byteOffset<t.byteOffset)throw Error("complex overlap of input and output is not supported")}(l,u),fJ(c),c<0||c>=0xffffffff)throw Error("arx: counter overflow");let m=[],g=t.length;if(32===g)m.push(d=f0(t)),f=f3;else if(16===g&&n)(d=new Uint8Array(32)).set(t),d.set(t,16),f=f2,m.push(d);else throw fW(t,32,"arx key"),Error("invalid key size");fY&&fQ(r)||m.push(r=f0(r));let b=fV(d);if(i){if(24!==r.length)throw Error("arx: extended nonce must be 24 bytes");let e=r.subarray(0,16);if(fY)i(f,b,fV(e),b);else{let t=fZ(Uint32Array.from(f));i(t,b,fV(e),b),fG(t),fZ(b)}r=r.subarray(16)}else fY||fZ(b);let y=16-s;if(y!==r.length)throw Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){let e=new Uint8Array(12);e.set(r,a?0:12-r.length),r=e,m.push(r)}let v=fZ(fV(r));try{return!function(e,t,r,n,i,s,a,o){let l=i.length,u=new Uint8Array(64),c=fV(u),d=fY&&fQ(i)&&fQ(s),f=d?fV(i):f4,h=d?fV(s):f4;if(!fY){for(let d=0;d<l;a++){if(e(t,r,n,c,a,o),fZ(c),a>=0xffffffff)throw Error("arx: counter overflow");let f=Math.min(64,l-d);for(let e=0,t;e<f;e++)s[t=d+e]=i[t]^u[e];d+=f}return}for(let p=0;p<l;a++){if(e(t,r,n,c,a,o),a>=0xffffffff)throw Error("arx: counter overflow");let m=Math.min(64,l-p);if(d&&64===m){let e=p/4;if(p%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)h[r=e+t]=f[r]^c[t];p+=64;continue}for(let e=0,t;e<m;e++)s[t=p+e]=i[t]^u[e];p+=m}}(e,f,b,v,l,u,c,o),u}finally{fG(...m)}}}function f8(e,t){return 255&e[t++]|(255&e[t++])<<8}class f9{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(e){let t=f8(e=f0(fW(e,32,"key")),0),r=f8(e,2),n=f8(e,4),i=f8(e,6),s=f8(e,8),a=f8(e,10),o=f8(e,12),l=f8(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|n<<6)&7939,this.r[3]=(n>>>7|i<<9)&8191,this.r[4]=(i>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|a<<2)&8191,this.r[7]=(a>>>11|o<<5)&8065,this.r[8]=(o>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=f8(e,16+2*t)}process(e,t,r=!1){let{h:n,r:i}=this,s=i[0],a=i[1],o=i[2],l=i[3],u=i[4],c=i[5],d=i[6],f=i[7],h=i[8],p=i[9],m=f8(e,t+0),g=f8(e,t+2),b=f8(e,t+4),y=f8(e,t+6),v=f8(e,t+8),x=f8(e,t+10),w=f8(e,t+12),S=f8(e,t+14),k=n[0]+(8191&m),_=n[1]+((m>>>13|g<<3)&8191),E=n[2]+((g>>>10|b<<6)&8191),C=n[3]+((b>>>7|y<<9)&8191),I=n[4]+((y>>>4|v<<12)&8191),A=n[5]+(v>>>1&8191),j=n[6]+((v>>>14|x<<2)&8191),T=n[7]+((x>>>11|w<<5)&8191),O=n[8]+((w>>>8|S<<8)&8191),N=n[9]+(S>>>5|2048*!r),M=0,$=0+k*s+5*p*_+5*h*E+5*f*C+5*d*I;M=$>>>13,$&=8191,$+=5*c*A+5*u*j+5*l*T+5*o*O+5*a*N,M+=$>>>13,$&=8191;let U=M+k*a+_*s+5*p*E+5*h*C+5*f*I;M=U>>>13,U&=8191,U+=5*d*A+5*c*j+5*u*T+5*l*O+5*o*N,M+=U>>>13,U&=8191;let B=M+k*o+_*a+E*s+5*p*C+5*h*I;M=B>>>13,B&=8191,B+=5*f*A+5*d*j+5*c*T+5*u*O+5*l*N,M+=B>>>13,B&=8191;let P=M+k*l+_*o+E*a+C*s+5*p*I;M=P>>>13,P&=8191,P+=5*h*A+5*f*j+5*d*T+5*c*O+5*u*N,M+=P>>>13,P&=8191;let R=M+k*u+_*l+E*o+C*a+I*s;M=R>>>13,R&=8191,R+=5*p*A+5*h*j+5*f*T+5*d*O+5*c*N,M+=R>>>13,R&=8191;let F=M+k*c+_*u+E*l+C*o+I*a;M=F>>>13,F&=8191,F+=A*s+5*p*j+5*h*T+5*f*O+5*d*N,M+=F>>>13,F&=8191;let L=M+k*d+_*c+E*u+C*l+I*o;M=L>>>13,L&=8191,L+=A*a+j*s+5*p*T+5*h*O+5*f*N,M+=L>>>13,L&=8191;let z=M+k*f+_*d+E*c+C*u+I*l;M=z>>>13,z&=8191,z+=A*o+j*a+T*s+5*p*O+5*h*N,M+=z>>>13,z&=8191;let D=M+k*h+_*f+E*d+C*c+I*u;M=D>>>13,D&=8191,D+=A*l+j*o+T*a+O*s+5*p*N,M+=D>>>13,D&=8191;let H=M+k*p+_*h+E*f+C*d+I*c;M=H>>>13,H&=8191,H+=A*u+j*l+T*o+O*a+N*s,M+=H>>>13,H&=8191,$=8191&(M=(M=(M<<2)+M|0)+$|0),M>>>=13,U+=M,n[0]=$,n[1]=U,n[2]=B,n[3]=P,n[4]=R,n[5]=F,n[6]=L,n[7]=z,n[8]=D,n[9]=H}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let i=(1^n)-1;for(let e=0;e<10;e++)r[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|r[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+t[0];e[0]=65535&s;for(let r=1;r<8;r++)s=(e[r]+t[r]|0)+(s>>>16)|0,e[r]=65535&s;fG(r)}update(e){fK(this),fW(e);let{buffer:t,blockLen:r}=this,n=(e=f0(e)).length;for(let i=0;i<n;){let s=Math.min(r-this.pos,n-i);if(s===r){for(;r<=n-i;i+=r)this.process(e,i);continue}t.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,fG(this.h,this.r,this.buffer,this.pad)}digestInto(e){fK(this);fW(e,void 0,"output");let t=this.outputLen;if(!(e.length>=t))throw RangeError('"output" expected length >= '+t);this.finished=!0;let{buffer:r,h:n}=this,{pos:i}=this;if(i){for(r[i++]=1;i<16;i++)r[i]=0;this.process(r,0,!0)}this.finalize();let s=0;for(let t=0;t<8;t++)e[s++]=n[t]>>>0,e[s++]=n[t]>>>8}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}function f7(e,t,r,n,i,s=20){let a=e[0],o=e[1],l=e[2],u=e[3],c=t[0],d=t[1],f=t[2],h=t[3],p=t[4],m=t[5],g=t[6],b=t[7],y=r[0],v=r[1],x=r[2],w=a,S=o,k=l,_=u,E=c,C=d,I=f,A=h,j=p,T=m,O=g,N=b,M=i,$=y,U=v,B=x;for(let e=0;e<s;e+=2)j=j+(M=f5(M^(w=w+E|0),16))|0,w=w+(E=f5(E^j,12))|0,j=j+(M=f5(M^w,8))|0,E=f5(E^j,7),T=T+($=f5($^(S=S+C|0),16))|0,S=S+(C=f5(C^T,12))|0,T=T+($=f5($^S,8))|0,C=f5(C^T,7),O=O+(U=f5(U^(k=k+I|0),16))|0,k=k+(I=f5(I^O,12))|0,O=O+(U=f5(U^k,8))|0,I=f5(I^O,7),N=N+(B=f5(B^(_=_+A|0),16))|0,_=_+(A=f5(A^N,12))|0,N=N+(B=f5(B^_,8))|0,A=f5(A^N,7),O=O+(B=f5(B^(w=w+C|0),16))|0,w=w+(C=f5(C^O,12))|0,O=O+(B=f5(B^w,8))|0,C=f5(C^O,7),N=N+(M=f5(M^(S=S+I|0),16))|0,S=S+(I=f5(I^N,12))|0,N=N+(M=f5(M^S,8))|0,I=f5(I^N,7),j=j+($=f5($^(k=k+A|0),16))|0,k=k+(A=f5(A^j,12))|0,j=j+($=f5($^k,8))|0,A=f5(A^j,7),T=T+(U=f5(U^(_=_+E|0),16))|0,_=_+(E=f5(E^T,12))|0,T=T+(U=f5(U^_,8))|0,E=f5(E^T,7);let P=0;n[P++]=a+w|0,n[P++]=o+S|0,n[P++]=l+k|0,n[P++]=u+_|0,n[P++]=c+E|0,n[P++]=d+C|0,n[P++]=f+I|0,n[P++]=h+A|0,n[P++]=p+j|0,n[P++]=m+T|0,n[P++]=g+O|0,n[P++]=b+N|0,n[P++]=i+M|0,n[P++]=y+$|0,n[P++]=v+U|0,n[P++]=x+B|0}let he=f6(f7,{counterRight:!1,counterLength:4,allowShortKeys:!1}),ht=f6(f7,{counterRight:!1,counterLength:8,extendNonceFn:function(e,t,r,n){let i=fY?e:fZ(e.slice(0,4)),s=fY?t:fZ(t.slice(0,8)),a=fY?r:fZ(r.slice(0,4)),o=new Uint32Array(16);f7(i,s,a.subarray(1),o,a[0]);let l=0;n[l++]=o[0]-i[0]|0,n[l++]=o[1]-i[1]|0,n[l++]=o[2]-i[2]|0,n[l++]=o[3]-i[3]|0,n[l++]=o[12]-a[0]|0,n[l++]=o[13]-a[1]|0,n[l++]=o[14]-a[2]|0,n[l++]=o[15]-a[3]|0,fZ(n),fY||fG(i,s,a),fG(o)},allowShortKeys:!1}),hr=new Uint8Array(16),hn=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(hr.subarray(r))},hi=new Uint8Array(32);function hs(e,t,r,n,i){var s,a;let o,l;void 0!==i&&fW(i,void 0,"AAD");let u=e(t,r,hi),c=(s=n.length,a=i?i.length:0,fJ(s),fJ(a),fH(!0),(l=new DataView((o=new Uint8Array(16)).buffer,o.byteOffset,o.byteLength)).setBigUint64(0,BigInt(a),!0),l.setBigUint64(8,BigInt(s),!0),o),d=new f9(u);i&&hn(d,i),hn(d,n),d.update(c);let f=d.digest();return fG(u,c),f}let ha=e=>(t,r,n)=>({encrypt(i,s){let a=i.length;(s=fX(a+16,s,!1)).set(i);let o=s.subarray(0,-16);e(t,r,o,o,1);let l=hs(e,t,r,o,n);return s.set(l,a),fG(l),s},decrypt(i,s){s=fX(i.length-16,s,!1);let a=i.subarray(0,-16),o=i.subarray(-16),l=hs(e,t,r,a,n);return!function(e,t){if(e=fW(e),t=fW(t),e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(o,l)?void fG(l):(s.set(i.subarray(0,-16)),e(t,r,s,s,1),fG(l),s)}}),ho=ha(he),hl=ha(ht),hu=rV("effect/crypto/WebCrypto",{defaultValue:()=>globalThis.crypto}),hc=(e,t,r)=>t1(new fL({module:e,method:t,reason:r})),hd=(e,t,r)=>hc(e,t,new fB({description:r}));class hf{reason;constructor(e){this.reason=e}}let hh=(e,t,r,n,i)=>hp(e,t,`${e}.layerWebCrypto`,r,n,i),hp=(e,t,r,n,i,s)=>{let a=hm(t,r,n,i,s);if(void 0===a)throw i;return new fL({module:e,method:t,reason:a})},hm=(e,t,r,n,i)=>{if(n instanceof hf)return n.reason;switch(eS(n,"name")?n.name:void 0){case"DataError":return new fB({description:"Invalid key data",cause:n});case"InvalidAccessError":return new fB({description:`The key cannot be used for ${e}`,cause:n});case"NotSupportedError":return new fR({description:`${t} does not provide ${r}`,cause:n});case"OperationError":return i?.();default:return}},hg=(e,t,r,n,i,s=n=>hh(e,t,r,n))=>au(()=>{let e=n?.subtle;return void 0===e?ah(Error("crypto.subtle is unavailable; browsers expose it only in secure contexts")):dC({try:()=>i(e),catch:s})}),hb=Symbol("~effect/crypto/Key/material"),hy=e=>new Uint8Array(e),hv=e=>e[hb],hx=(e,t)=>({[e]:e,toJSON(){return{_id:t,algorithm:this.algorithm.name}},toString(){return te(this.toJSON())},[ta](){return this.toJSON()}}),hw=(e,t,r)=>e3(Object.create(e,{algorithm:{value:t,enumerable:!0},[hb]:{value:r}})),hS=(e,t,r)=>hw(e,t,{_tag:"Bytes",bytes:r}),hk=e=>t=>t.length===e.keyLength?void 0:`Expected a ${e.keyLength}-byte key for ${e.name}, not ${t.length} bytes`,h_=(e,t,r,n,i,s)=>au(()=>{if(!(i instanceof Uint8Array))return hd(e,t,"Expected the key as a Uint8Array");let a=s(i);return void 0===a?aa(hS(r,n,hy(i))):hd(e,t,a)}),hE=(e,t)=>r=>{let n=r.length;return n===8*t?void 0:`Expected a ${8*t}-bit ${e} key, not ${n} bits`},hC=(e,t,r,n,i,s)=>au(()=>{let a,o=((e,t)=>{if(!eS(e,"type")||!eS(e,"algorithm")||!eS(e,"usages")||!Array.isArray(e.usages))return"Expected a CryptoKey";if(e.algorithm.name!==t.name)return`Expected a ${t.name} key, not ${e.algorithm.name}`;if(e.type!==t.type)return`Expected a ${t.type} key, not ${e.type}`;let r=t.check?.(e.algorithm);if(void 0!==r)return r;let n=e.usages;if("all"===t.usagePolicy){if(!t.usages.every(e=>n.includes(e)))return`Expected a key with the usages ${t.usages.join(" and ")}, not ${n.join(", ")||"none"}`}else if(!t.usages.some(e=>n.includes(e)))return`Expected a key with one of the usages ${t.usages.join(", ")}`})(i,s);return void 0===o?aa(hw(r,(a=i.algorithm.modulusLength,eS(n,"modulusLength")&&void 0!==a&&n.modulusLength!==a?{...n,modulusLength:a}:n),{_tag:"CryptoKey",cryptoKey:i})):hd(e,t,o)}),hI=async(e,t)=>new Uint8Array(await e.exportKey("raw",t)),hA=(e,t,r)=>au(()=>{let n,i,s,a=hv(t);if("Bytes"===a._tag)return aa(hy(a.bytes));if(!a.cryptoKey.extractable)return hc(e,"toBytes",new fF({description:"The CryptoKey is not extractable"}));return n="toBytes",i=t.algorithm.name,s=e=>r(e,a.cryptoKey),hu.use(t=>hg(e,n,i,t,s,t=>hp(e,n,"crypto.subtle",i,t)))}),hj=e=>{let t=new WeakMap;return async(r,n)=>{let i=hv(n);if("CryptoKey"===i._tag)return i.cryptoKey;let s=t.get(n);return void 0===s&&(s=await e(r,i.bytes,n.algorithm),t.set(n,s)),s}},hT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));class hO extends(rV())("effect/crypto/SecureRandom"){}let hN="~effect/crypto/Aead/Key",hM=e=>({encrypt:(t,r,n,i)=>e(t,r,i).encrypt(n),decrypt:(t,r,n,i)=>e(t,r,i).decrypt(n)}),h$={name:"chacha20Poly1305",keyLength:32,nonceLength:12,implementation:hM(ho)},hU={name:"xchacha20Poly1305",keyLength:32,nonceLength:24,implementation:hM(hl)},hB=hx(hN,"Aead.Key");class hP extends(rV())("effect/crypto/Aead"){}let hR=()=>hc("Aead","decrypt",new fP),hF=e=>uU(hP,dI(function*(){let t=yield*hO,r=yield*hu,n=hj((e,t)=>e.importKey("raw",t,"AES-GCM",!1,["encrypt","decrypt"])),i=e.implementations,s=e=>(t,s,a)=>au(()=>{let o,l,u=((e,t,r,n)=>{let i=t.algorithm;if(n.nonce.length!==i.nonceLength)return hc("Aead",e,new fU({description:`${i.name} nonces must contain exactly ${i.nonceLength} bytes`}));if("encrypt"===e){if(void 0===i.implementation&&r.length>0xfffffffe0)return hc("Aead",e,new fU({description:"AES-GCM plaintext cannot exceed 2^36 - 32 bytes"}))}else if(r.length<16)return hR()})(e,t,s,a);if(void 0!==u)return u;let c=void 0!==(o=i?.[t.algorithm.name])&&"Bytes"===hv(t)._tag?o:t.algorithm.implementation;return void 0===c?(l={name:"AES-GCM",iv:a.nonce,tagLength:128,...void 0===a.aad?{}:{additionalData:a.aad}},hg("Aead",e,t.algorithm.name,r,async r=>new Uint8Array(await r[e](l,await n(r,t),s)),r=>hh("Aead",e,t.algorithm.name,r,"decrypt"===e?()=>new fP:void 0))):((e,t,r,n,i)=>{let s=hv(r);if("Bytes"!==s._tag)return hc("Aead",e,new fB({description:`${r.algorithm.name} keys must hold bytes`}));let a=i.aad??new Uint8Array(0);return"encrypt"===e?al(()=>t.encrypt(s.bytes,i.nonce,n,a)):au(()=>{let e=t.decrypt(s.bytes,i.nonce,n,a);return void 0===e?hR():aa(e)})})(e,c,t,s,a)});return hP.of({generateKey:e=>aq(t.randomBytes(e.keyLength),t=>hS(hB,e,t)),encrypt:s("encrypt"),decrypt:s("decrypt")})})),hL=hF({});e.s(["Aead",0,hP,"aes128Gcm",0,{name:"aes128Gcm",keyLength:16,nonceLength:12,implementation:void 0},"aes256Gcm",0,{name:"aes256Gcm",keyLength:32,nonceLength:12,implementation:void 0},"chacha20Poly1305",0,h$,"fromCryptoKey",0,(e,t)=>void 0!==e.implementation?hd("Aead","fromCryptoKey",`${e.name} keys cannot be CryptoKeys`):hC("Aead","fromCryptoKey",hB,e,t,{type:"secret",name:"AES-GCM",usages:["encrypt","decrypt"],usagePolicy:"all",check:hE("AES-GCM",e.keyLength)}),"isKey",0,e=>eS(e,hN),"key",0,(e,t)=>h_("Aead","key",hB,e,t,hk(e)),"layerWebCrypto",0,hL,"layerWebCryptoWith",0,hF,"toBytes",0,e=>hA("Aead",e,hI),"xchacha20Poly1305",0,hU],42913);let hz="~effect/crypto/Cipher/Key",hD=hx(hz,"Cipher.Key");class hH extends(rV())("effect/crypto/Cipher"){}let hJ=uU(hH,dI(function*(){let e=yield*hO,t=yield*hu,r=hj((e,t,r)=>e.importKey("raw",t,r.mode,!1,["encrypt","decrypt"])),n=e=>(n,i,s)=>au(()=>{if(16!==s.iv.length)return hc("Cipher",e,new fU({description:"IVs must contain exactly 16 bytes"}));let a="AES-CBC"===n.algorithm.mode;return"decrypt"===e&&a&&(0===i.length||i.length%16!=0)?hc("Cipher",e,new fP):hg("Cipher",e,n.algorithm.name,t,async t=>{let a,o;return new Uint8Array(await t[e]((a=n.algorithm,o=s.iv,"AES-CTR"===a.mode?{name:"AES-CTR",counter:o,length:128}:{name:"AES-CBC",iv:o}),await r(t,n),i))},t=>hh("Cipher",e,n.algorithm.name,t,"decrypt"===e&&a?()=>new fP:void 0))});return hH.of({generateKey:t=>aq(e.randomBytes(t.keyLength),e=>hS(hD,t,e)),encrypt:n("encrypt"),decrypt:n("decrypt")})}));e.s(["Cipher",0,hH,"aes128Cbc",0,{name:"aes128Cbc",mode:"AES-CBC",keyLength:16},"aes128Ctr",0,{name:"aes128Ctr",mode:"AES-CTR",keyLength:16},"aes256Cbc",0,{name:"aes256Cbc",mode:"AES-CBC",keyLength:32},"aes256Ctr",0,{name:"aes256Ctr",mode:"AES-CTR",keyLength:32},"fromCryptoKey",0,(e,t)=>hC("Cipher","fromCryptoKey",hD,e,t,{type:"secret",name:e.mode,usages:["encrypt","decrypt"],usagePolicy:"all",check:hE(e.mode,e.keyLength)}),"isKey",0,e=>eS(e,hz),"key",0,(e,t)=>h_("Cipher","key",hD,e,t,hk(e)),"layerWebCrypto",0,hJ,"toBytes",0,e=>hA("Cipher",e,hI)],99175);let hW=e=>Uint8Array.of(48,46,2,1,0,48,5,6,3,43,101,e,4,34,4,32),hq=hW(112),hK=e=>t=>{let r=t.hash?.name;return r===e?void 0:`Expected a key for ${e}, not ${r}`},hV=e=>hY("string"==typeof e?hQ.encode(e):e),hG=e=>{let t=h1(e),r=t.length;if(r%4!=0)return rC(new se({kind:"Decode",module:"Base64",input:t,message:`Length must be a multiple of 4, but is ${r}`}));let n=t.indexOf("=");if(-1!==n&&(n<r-2||n===r-2&&"="!==t[r-1]))return rC(new se({kind:"Decode",module:"Base64",input:t,message:"Found a '=' character, but it is not at the end"}));try{let e=t.endsWith("==")?2:+!!t.endsWith("="),n=new Uint8Array(r/4*3-e);for(let e=0,i=0;e<r;e+=4,i+=3){let r=h6(t.charCodeAt(e))<<18|h6(t.charCodeAt(e+1))<<12|h6(t.charCodeAt(e+2))<<6|h6(t.charCodeAt(e+3));n[i]=r>>16,n[i+1]=r>>8&255,n[i+2]=255&r}return rA(n)}catch(e){return rC(new se({kind:"Decode",module:"Base64",input:t,message:e instanceof Error?e.message:"Invalid input"}))}},hY=e=>{let t=e.length,r=Uint8Array.prototype.toBase64;return t>=32&&"function"==typeof r?r.call(e):t<128?hZ(e):hX(e)},hZ=e=>{let t,r=e.length,n="";for(t=2;t<r;t+=3)n+=h2[e[t-2]>>2],n+=h2[(3&e[t-2])<<4|e[t-1]>>4],n+=h2[(15&e[t-1])<<2|e[t]>>6],n+=h2[63&e[t]];return t===r+1&&(n+=h2[e[t-2]>>2],n+=h2[(3&e[t-2])<<4],n+="=="),t===r&&(n+=h2[e[t-2]>>2],n+=h2[(3&e[t-2])<<4|e[t-1]>>4],n+=h2[(15&e[t-1])<<2],n+="="),n},hX=e=>{let t,r=e.length,n=new Uint8Array(4*Math.ceil(r/3)),i=0;for(t=2;t<r;t+=3,i+=4)n[i]=h3[e[t-2]>>2],n[i+1]=h3[(3&e[t-2])<<4|e[t-1]>>4],n[i+2]=h3[(15&e[t-1])<<2|e[t]>>6],n[i+3]=h3[63&e[t]];return t===r+1&&(n[i]=h3[e[t-2]>>2],n[i+1]=h3[(3&e[t-2])<<4],n[i+2]=h5,n[i+3]=h5),t===r&&(n[i]=h3[e[t-2]>>2],n[i+1]=h3[(3&e[t-2])<<4|e[t-1]>>4],n[i+2]=h3[(15&e[t-1])<<2],n[i+3]=h5),h0.decode(n)},hQ=new TextEncoder,h0=new TextDecoder,h1=e=>e.replace(/[\n\r]/g,""),h2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h3=hQ.encode(h2),h5=61,h4=(new Uint8Array(123)).fill(255);for(let e=0;e<h2.length;e++)h4[h2.charCodeAt(e)]=e;h4[61]=0;let h6=e=>{if(e>=h4.length||255===h4[e])throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return h4[e]},h8="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",h9=new Uint8Array(128);for(let e=0;e<h8.length;e++)h9[h8.charCodeAt(e)]=e;let h7=new TextDecoder;e.i(42913),e.i(99175),p=[[7,12,17,22],[5,9,14,20],[4,11,16,23],[6,10,15,21]],Uint8Array.from({length:64},(e,t)=>p[Math.floor(t/16)][t%4]);let pe="~effect/crypto/Mac/Key",pt=hx(pe,"Mac.Key"),pr={MD5:64,"SHA-1":64,"SHA-256":64,"SHA-384":128,"SHA-512":128};class pn extends(rV())("effect/crypto/Mac"){}let pi=e=>uU(pn,dI(function*(){let t=yield*hO,r=yield*hu,n=hj((e,t,r)=>e.importKey("raw",t,{name:"HMAC",hash:r.hash.name},!1,["sign","verify"])),i=e.hmac,s=e=>{if(void 0===i)return;let t=hv(e);return"Bytes"===t._tag?r=>i(e.algorithm.hash.name,t.bytes,r):void 0};return pn.of({generateKey:e=>aq(t.randomBytes(pr[e.hash.name]),t=>hS(pt,e,t)),sign:(e,t)=>{let i=s(e);return void 0!==i?al(()=>i(t)):hg("Mac","sign",e.algorithm.name,r,async r=>new Uint8Array(await r.sign("HMAC",await n(r,e),t)))},verify:(e,t,i)=>{let a=s(e);return void 0!==a?al(()=>pa(a(i),t)):hg("Mac","verify",e.algorithm.name,r,async r=>r.verify("HMAC",await n(r,e),t,i))}})})),ps=pi({}),pa=(e,t)=>{if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r};e.s(["Mac",0,pn,"fromCryptoKey",0,(e,t)=>hC("Mac","fromCryptoKey",pt,e,t,{type:"secret",name:"HMAC",usages:["sign","verify"],usagePolicy:"all",check:t=>{let r=t.hash?.name;return r===e.hash.name?void 0:`Expected an HMAC key for ${e.hash.name}, not ${r}`}}),"hmacSha1",0,{name:"hmacSha1",hash:{name:"SHA-1",outputLength:20,implementation:void 0}},"hmacSha256",0,{name:"hmacSha256",hash:{name:"SHA-256",outputLength:32,implementation:void 0}},"hmacSha384",0,{name:"hmacSha384",hash:{name:"SHA-384",outputLength:48,implementation:void 0}},"hmacSha512",0,{name:"hmacSha512",hash:{name:"SHA-512",outputLength:64,implementation:void 0}},"isKey",0,e=>eS(e,pe),"key",0,(e,t)=>h_("Mac","key",pt,e,t,e=>0===e.length?"An HMAC key cannot be empty":void 0),"layerWebCrypto",0,ps,"layerWebCryptoWith",0,pi,"timingSafeEqual",0,pa,"toBytes",0,e=>hA("Mac",e,hI)],46893),e.i(46893);let po="~effect/crypto/KeyWrap/Key",pl="~effect/crypto/KeyWrap/PrivateKey",pu=hx(po,"KeyWrap.Key"),pc={module:"KeyWrap",specOf:e=>({name:"RSA-OAEP",importParams:{name:"RSA-OAEP",hash:e.hash.name},privateUsages:["decrypt"],publicUsages:["encrypt"],seedPrefix:void 0,publicFormat:"spki",check:hK(e.hash.name)}),privateKeyProto:hx(pl,"KeyWrap.PrivateKey"),publicKeyProto:hx("~effect/crypto/KeyWrap/PublicKey","KeyWrap.PublicKey"),isPrivateKey:e=>eS(e,pl)},pd="~effect/http/Cookies",pf="~effect/http/Cookies/Cookie",ph="~effect/http/Cookies/CookieError";class pp extends i8{}class pm extends i9("CookiesError"){static fromReason(e,t){return new pm({reason:new pp({_tag:e,cause:t})})}[ph]=ph;get message(){return this.reason._tag}}let pg={[pd]:pd,...tl,toJSON(){return{_id:"effect/Cookies",cookies:ig(this.cookies,e=>e.toJSON())}},pipe(){return K(this,arguments)}},pb=e=>{let t=Object.create(pg);return t.cookies=e,t},py=e=>{let t={};for(let r of e)tp(t,r.name,r);return pb(t)},pv=py([]),px=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,pw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,pS=/^[\t ]+|[\t ]+$/g,pk=/^-?[0-9]+$/,p_=/^[\u0009\u0020-\u003a\u003c-\u007e\u0080-\u00ff]+$/,pE=/^[\u0020-\u003a\u003c-\u007e]+$/,pC={[pf]:pf,...tl,toJSON(){return{_id:"effect/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}};function pI(e,t,r){let n=encodeURIComponent(t),i=pA(e,n,r);return void 0!==i?rC(i):rA(Object.assign(Object.create(pC),{name:e,value:t,valueEncoded:n,options:r}))}function pA(e,t,r){return pw.test(e)?t&&!px.test(t)?pm.fromReason("InvalidCookieValue"):r?.domain===void 0||p_.test(r.domain)?r?.path===void 0||pE.test(r.path)?r?.maxAge===void 0||nJ(n$(r.maxAge))?void 0:pm.fromReason("CookieInfinityMaxAge"):pm.fromReason("InvalidCookiePath"):pm.fromReason("InvalidCookieDomain"):pm.fromReason("InvalidCookieName")}(e,t)=>pb({...e.cookies,...t.cookies}),(e,t)=>rL(Object.hasOwn(e.cookies,t)?e.cookies[t]:void 0);let pj=Y(e=>eS(e[0],pd),(e,t,r,n)=>it(pI(t,r,n),r=>pb(iy(e.cookies,t,r)))),pT=Y(e=>eS(e[0],pd),(e,t,r,n)=>pb(iy(e.cookies,t,ii(pI(t,r,n))))),pO=((e=>eS(e[0],pd),(e,t,r)=>pj(e,t,"",{...r,maxAge:0,expires:new Date(0)})),Y(2,(e,t)=>{let r={...e.cookies};for(let[e,n,i]of t){let t=pI(e,n,i);if(rk(t))return t;tp(r,e,t.success)}return rA(pb(r))}));(e,t)=>ii(pO(e,t)),(e,t,r)=>{let n=pN(t);if(void 0===n)return;let i=n.hostname,s="https:"===n.protocol,a=e.filter(e=>{let t=pM(e);return void 0!==t&&(e.options?.hostOnly?i===t:pB(i,t))&&pP(n.pathname,p$(e))&&(e.options?.expires===void 0||e.options.expires.getTime()>r)&&(s||!e.options?.secure)});return 0===a.length?void 0:a.sort((e,t)=>p$(t).length-p$(e).length).map(e=>`${e.name}=${e.valueEncoded}`).join("; ")};let pN=e=>{try{return new URL(e)}catch{return}},pM=e=>e.options?.domain?.replace(/^\./,"").toLowerCase()||void 0,p$=e=>e.options?.path?.startsWith("/")?e.options.path:"/",pU=e=>e.startsWith("[")||/^\d+\.\d+\.\d+\.\d+$/.test(e),pB=(e,t)=>e===t||e.endsWith("."+t)&&!pU(e),pP=(e,t)=>e===t||e.startsWith(t)&&(t.endsWith("/")||"/"===e[t.length]),pR=(e,t,r)=>{var n;let i,s=e.hostname,a=s,o=!0,l=pM(t);if(void 0!==l){if(pU(s)||!pB(s,l))return;if(l.includes("."))a=l,o=!1;else if(l!==s)return}let{maxAge:u,...c}=t.options??{};return Object.assign(Object.create(pC),{name:t.name,value:t.value,valueEncoded:t.valueEncoded,options:{...c,domain:a,hostOnly:o||void 0,path:c.path?.startsWith("/")?c.path:(i=(n=e.pathname).lastIndexOf("/"))<=0?"/":n.slice(0,i),expires:void 0!==u?new Date(r+nX(u)):c.expires}})},pF=e=>{try{return decodeURIComponent(e)}catch(t){return e}},pL=new WeakMap,pz=e=>{if(pL.has(e))return pL.get(e);throw Error("Unable to get redacted value"+(e.label?` with label: "${e.label}"`:""))},pD="~effect/Redacted",pH=e=>eS(e,pD),pJ=(e,t)=>{let r=Object.create(pW);return t?.label&&(r.label=t.label),pL.set(r,e),r},pW={[pD]:{_A:e=>e},label:void 0,...tE,toJSON(){return this.toString()},toString(){return`<redacted${ec(this.label)?":"+this.label:""}>`},[eE](){return eC(pL.get(this))},[eW](e){return pH(e)&&eq(pL.get(this),pL.get(e))}},pq=Symbol.for("~effect/http/Headers"),pK=Object.defineProperties(Object.create(null),{[pq]:{value:pq},[e5]:{value(e){return p2(this,na(e,p5))}},toJSON:{value(){return e4(this)}},[eW]:{value(e){return pG(this,e)}},[eE]:{value(){return eB(this)}},toString:{value:tl.toString},[ta]:{value:tl[ta]}}),pV=e=>Object.assign(Object.create(pK),e),pG=(m=Y(2,(e,t)=>{for(let r of ib(e))if(!ip(t,r)||!rs(e[r],t[r]))return!1;return!0}),(e,t)=>m(e,t)&&m(t,e)),pY=Object.create(pK),pZ=e=>{if(void 0===e)return pY;if(Symbol.iterator in e){let t=Object.create(pK);for(let[r,n]of e)t[r.toLowerCase()]=n;return t}let t=Object.create(pK);for(let[r,n]of Object.entries(e))Array.isArray(n)?t[r.toLowerCase()]=n.join(", "):void 0!==n&&(t[r.toLowerCase()]=n);return t},pX=Y(3,(e,t,r)=>{let n=pV(e);return n[t.toLowerCase()]=r,n}),pQ=Y(2,(e,t)=>pV({...e,...pZ(t)})),p0=Y(2,(e,t)=>{let r=pV(e);return Object.assign(r,t),r}),p1=Y(2,(e,t)=>{let r=pV(e);return delete r[t.toLowerCase()],r}),p2=((e,t)=>{let r=pV(e);for(let e of t)delete r[e.toLowerCase()];return r},Y(2,(e,t)=>{let r={...e},n=t=>{if("string"==typeof t){let n=t.toLowerCase();n in e&&(r[n]=pJ(e[n]))}else for(let n in e)-1!==n.search(t)&&(r[n]=pJ(e[n]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)n(t[e]);else n(t);return r})),p3=(e,t)=>{let r=e.toLowerCase();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i){if(i.toLowerCase()===r)return!0}else if(-1!==e.search(i))return!0}return!1},p5=rV("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),p4="~effect/http/Headers/HeaderParseError";class p6 extends i8{}class p8 extends i9("HeaderParseError"){static fromReason(e,t){return new p8({reason:new p6({_tag:e,input:t})})}[p4]=p4;get message(){return`${this.reason._tag}: ${JSON.stringify(this.reason.input)}`}}let p9=BigInt(1e9),p7=e=>"string"==typeof e?e:pz(e),me=new TextDecoder("utf-8",{ignoreBOM:!0}),mt=e=>new URLSearchParams(me.decode(e).replace(/^\?/,"%3F")),mr=/^\/(?![/\\])/,mn="~effect/http/UrlParams",mi=e=>eS(e,mn),ms={...tE,[mn]:mn,[Symbol.iterator](){return this.params[Symbol.iterator]()},[e5](e){return{_id:"UrlParams",params:Object.fromEntries(my(this,na(e,mA)))}},toJSON(){return e4(this)},[eW](e){return mc(this,e)},[eE](){return eR(this.params.flat())}},ma=e=>{let t=Object.create(ms);return t.params=e,t},mo=e=>{if(mi(e))return e;let t=ml(e),r=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[n,i]=t[e];r.push([`${n[0]}[${n.slice(1).join("][")}]`,i])}else r.push(t[e]);return ma(r)},ml=e=>{let t="function"==typeof e[Symbol.iterator]?iw(e):Object.entries(e),r=[];for(let[e,n]of t)if(Array.isArray(n))for(let t=0;t<n.length;t++)void 0!==n[t]&&r.push([e,mu(n[t])]);else if(null===n||"object"!=typeof n||pH(n))void 0!==n&&r.push([e,mu(n)]);else for(let[t,i]of ml(n))r.push([[e,..."string"==typeof t?[t]:t],i]);return r},mu=e=>pH(e)?e:String(e),mc=ri((e,t)=>md(e.params,t.params)),md=ra((H=[rs,eq],ri((e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!H[r](e[r],t[r]))return!1;return!0}))),mf=ma([]),mh=Y(2,(e,t)=>il(e.params,([e])=>e===t).pipe(rJ(([,e])=>p7(e)))),mp=((e,t,r)=>ma(i_(iK(e.params,([e])=>e!==t),[t,mu(r)])),Y(2,(e,t)=>ma(t(e.params)))),mm=Y(2,(e,t)=>{let r=mo(t).params.slice(),n=new Set;for(let e=0;e<r.length;e++)n.add(r[e][0]);for(let t=0;t<e.params.length;t++)n.has(e.params[t][0])||r.push(e.params[t]);return ma(r)}),mg=((e,t,r)=>ma(i_(e.params,[t,mu(r)])),Y(2,(e,t)=>mp(e,iE(mo(t).params)))),mb=e=>new URLSearchParams(mo(e).params.map(([e,t])=>[e,p7(t)])).toString(),my=Y(2,(e,t)=>{let r=Array.isArray(t)?t:[t];return e.params.map(([e,t])=>[e,"string"==typeof t&&mv(e,r)?pJ(t):t])}),mv=p3,mx=(e,t=mI())=>{e.includes("@")&&(e=m_(e));let r=e.indexOf("?");if(-1===r||0===t.length)return e;let n=e.indexOf("#");if(-1!==n&&n<r)return e;let i=-1===n?e.length:n;return e.slice(0,r+1)+mE(e.slice(r+1,i),t)+e.slice(i)},mw=/^(?:(https?|ftp|wss?):[/\\]*|[a-z][a-z\d+.-]*:\/\/|[/\\]{2,})/i,mS=/[/\\?#]/,mk=/[/?#]/,m_=e=>{let t="",r=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);9===i||10===i||13===i||""===t&&i<=32||(t+=e[n],r.push(n))}let n=mw.exec(t);if(null===n)return e;let i=n[0].length,s=void 0!==n[1]||!n[0].includes(":"),a=t.slice(i),o=a.search(s?mS:mk),l=(-1===o?a:a.slice(0,o)).lastIndexOf("@");return -1===l?e:e.slice(0,r[i])+"REDACTED:REDACTED"+e.slice(r[i+l])},mE=(e,t)=>e.split("&").map(e=>{let r=e.indexOf("=");return -1!==r&&mv(mC(e.slice(0,r)),t)?e.slice(0,r+1)+"REDACTED":e}).join("&"),mC=e=>{if(!e.includes("%")&&!e.includes("+"))return e;try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}},mI=()=>na(globalThis[e8]?.context??r7,mA),mA=rV("effect/http/UrlParams/CurrentRedactedNames",{defaultValue:()=>["X-Amz-Signature","X-Amz-Credential","X-Amz-Security-Token","AWSAccessKeyId","Signature","sig","X-Goog-Signature"]});function mj(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}let mT="~structural",mO="~sentinels",mN="~constructor",mM=er(e=>{let t=mj(e)?.identifier;return"string"==typeof t?t:e.getExpected(mM)}),m$=Symbol(),mU=tZ(m$),mB=tZ(m$),mP=e=>e===m$?rm:rb(e),mR=e=>"None"===e._tag?mU:tZ(e.value),mF="~effect/SchemaIssue/Issue";function mL(e){return eS(e,mF)&&e[mF]===mF}class mz{[mF]=mF;constructor(e,t){t?.reportInput===!0&&e!==m$&&(this.input=e)}}let mD=class extends mz{_tag="Filter";filter;issue;constructor(e,t,r,n){super(r,n),this.filter=e,this.issue=t}},mH=class extends mz{_tag="Encoding";ast;issue;constructor(e,t,r,n){super(r,n),this.ast=e,this.issue=t}},mJ=class extends mz{_tag="Pointer";path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},mW=class extends mz{_tag="MissingKey";annotations;constructor(e){super(),this.annotations=e}},mq=class extends mz{_tag="UnexpectedKey";ast;constructor(e,t,r){super(t,r),this.ast=e}},mK=class extends mz{_tag="Composite";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},mV=class extends mz{_tag="InvalidType";ast;constructor(e,t,r){super(t,r),this.ast=e}},mG=class extends mz{_tag="InvalidValue";annotations;constructor(e,t,r){super(t,r),this.annotations=e}};function mY(e,t,r,n,i){return new mK(e,[new mJ([t],r)],n,i)}let mZ=class extends mz{_tag="Forbidden";annotations;constructor(e,t,r){super(t,r),this.annotations=e}},mX=class extends mz{_tag="AnyOf";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},mQ=class extends mz{_tag="OneOf";ast;successes;constructor(e,t,r,n){super(r,n),this.ast=e,this.successes=t}};function m0(e,t,r){if(mL(e))return e;if("string"==typeof e)return new mG({message:e},t,r);let n="string"==typeof e.issue?new mG({message:e.issue},t,r):e.issue;return new mJ(e.path,n)}let m1=e=>m4(e)??m4(e.issue);function m2(e){return Object.hasOwn(e,"input")?te(e.input):void 0}function m3(e){let t=e.annotations?.expected;return"string"==typeof t?t:void 0}function m5(e,t){let r=m2(t);return void 0===r?`Expected ${e}`:`Expected ${e}, got ${r}`}function m4(e){if("Pointer"===e._tag||"Composite"===e._tag)return;if("Encoding"===e._tag)return m4(e.issue);let t="Filter"===e._tag?e.filter.annotations:"annotations"in e?e.annotations:e.ast.annotations,r=t?.["MissingKey"===e._tag?"messageMissingKey":"UnexpectedKey"===e._tag?"messageUnexpectedKey":"message"];if("string"==typeof r)return r}function m6(e){let t;for(let r of e.reasons){if(!tJ(r)||!mL(r.error))return;t??=r.error}return t}function m8(e,t){let r=m6(e);if(void 0===r)throw Error(t,{cause:e});return r}let m9=(e,t,r)=>{switch(e._tag){case"Passthrough":return aa(t);case"Transform":return aa(rJ(t,e.transform));case"TransformOptional":return aa(e.transform(t));case"TransformEffect":return rh(t)?af:aK(e.transform(t.value,r),rb);case"TransformOptionalEffect":return e.transform(t,r)}},m7=e=>Object.assign(Object.create(V),e),ge=(e,t)=>go((r,n)=>aW(m9(e,r,n),e=>m9(t,e,n)));function gt(e){var t;return t=(t,r)=>{let n={message:e(t)};return rp(t)?new mZ(n,t.value,r):new mZ(n)},go((e,r)=>t1(t(e,r)))}(e,t)=>{if("Passthrough"===e._tag)return t;if("Passthrough"===t._tag)return e;switch(e._tag){case"Transform":switch(t._tag){case"Transform":return gi(r=>t.transform(e.transform(r)));case"TransformOptional":return ga(r=>t.transform(rJ(r,e.transform)));case"TransformEffect":return gs((r,n)=>t.transform(e.transform(r),n));case"TransformOptionalEffect":return ge(e,t)}case"TransformOptional":switch(t._tag){case"Transform":return ga(r=>rJ(e.transform(r),t.transform));case"TransformOptional":return ga(r=>t.transform(e.transform(r)));case"TransformEffect":case"TransformOptionalEffect":return ge(e,t)}case"TransformEffect":switch(t._tag){case"Transform":return gs((r,n)=>aK(e.transform(r,n),t.transform));case"TransformOptional":case"TransformOptionalEffect":return ge(e,t);case"TransformEffect":return gs((r,n)=>aW(e.transform(r,n),e=>t.transform(e,n)))}case"TransformOptionalEffect":return ge(e,t)}};let gr=gt(()=>"Encoding is not supported"),gn=m7({_tag:"Passthrough"});function gi(e){return m7({_tag:"Transform",transform:e})}function gs(e){return m7({_tag:"TransformEffect",transform:e})}function ga(e){return m7({_tag:"TransformOptional",transform:e})}function go(e){return m7({_tag:"TransformOptionalEffect",transform:e})}function gl(){return gi(globalThis.String)}function gu(){return gi(globalThis.Number)}e=>"string"==typeof e||"u">typeof Blob&&e instanceof Blob;function gc(e){return t=>{let r=[];for(let[n,i]of Object.entries(t))!function t(n,i){if(e(i))r.push([n,i]);else if(Array.isArray(i))i.every(e)?i.forEach(e=>{r.push([n,e])}):i.forEach((e,r)=>{t(`${n}[${r}]`,e)});else if("object"==typeof i&&null!==i)for(let[e,r]of Object.entries(i))t(`${n}[${e}]`,r)}(n,i);return r}}let gd=Symbol.for("~effect/Schema/content"),gf="~effect/SchemaTransformation/Transformation",gh=class extends G{[gf]=gf;_tag="Transformation";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new gh(this.encode,this.decode)}},gp=e=>eS(e,gf)&&e[gf]===gf?e:new gh(e.decode,e.encode);function gm(e){return new gh(gs(e.decode),gs(e.encode))}function gg(e){return new gh(gi(e.decode),gi(e.encode))}let gb=new gh(gn,gn),gy=new gh(gu(),gl()),gv=new gh(gs((e,t)=>{try{return aa(globalThis.BigInt(e))}catch{return t1(new mG({expected:"a value that can be converted to a bigint"},e,t))}}),gl());gi(e=>new globalThis.Date(e));let gx=e=>{let t;return ex(e)&&"string"==typeof e.message?(t=Object.hasOwn(e,"cause")?Error(e.message,{cause:gx(e.cause)}):Error(e.message),"string"==typeof e.name&&"Error"!==e.name&&(t.name=e.name),"string"==typeof e.stack&&(t.stack=e.stack),t):e},gw=new gh(gs((e,t)=>aV(ac(hG(e)),()=>new mG({expected:"a valid Base64 string"},e,t))),gi(hV));function gS(e){return t=>t._tag===e}gs((e,t)=>ir(it(hG(e),e=>h0.decode(e)),{onFailure:()=>t1(new mG({expected:"a valid Base64 string"},e,t)),onSuccess:aa})),gi(hV),gs((e,t)=>ir(it((e=>{let t=e.replace(/[\n\r]/g,""),r=t.length,n=t.endsWith("=");if(n?r%4!=0:r%4==1)return rC(new se({module:"Base64Url",kind:"Decode",input:t,message:n?`Padded length should be a multiple of 4, but is ${r}`:`Unpadded length should not be 1 more than a multiple of 4, but is ${r}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return rC(new se({module:"Base64Url",kind:"Decode",input:t,message:"Invalid input"}));let i=n?61===t.charCodeAt(r-2)?r-2:r-1:r,s=-4&i,a=new Uint8Array(Math.floor(3*i/4)),o=0;for(let e=0;e<s;e+=4){let r=h9[t.charCodeAt(e)],n=h9[t.charCodeAt(e+1)],i=h9[t.charCodeAt(e+2)],s=h9[t.charCodeAt(e+3)];a[o++]=r<<2|n>>4,a[o++]=n<<4|i>>2,a[o++]=i<<6|s}if(i>s){let e=h9[t.charCodeAt(s)],r=h9[t.charCodeAt(s+1)];a[o++]=e<<2|r>>4,i-s==3&&(a[o]=r<<4|h9[t.charCodeAt(s+2)]>>2)}return rA(a)})(e),e=>h7.decode(e)),{onFailure:()=>t1(new mG({expected:"a valid Base64Url string"},e,t)),onSuccess:aa})),gi(e=>hV(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")),gs((e,t)=>ir(it(sl(e),e=>sc.decode(e)),{onFailure:()=>t1(new mG({expected:"a valid hexadecimal string"},e,t)),onSuccess:aa})),gi(st),gs((e,t)=>{try{return aa(globalThis.decodeURIComponent(e))}catch{return t1(new mG({expected:"a valid URI component"},e,t))}}),gi(encodeURIComponent);let gk=gS("Declaration"),g_=gS("Null"),gE=gS("Void"),gC=gS("Never"),gI=gS("Literal"),gA=gS("UniqueSymbol"),gj=gS("Arrays"),gT=gS("Objects"),gO=gS("Union"),gN=gS("Suspend"),gM=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},g$={},gU=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,r,n){this.isOptional=e,this.isMutable=t,this.constructorDefault=r,this.annotations=n}},gB="~effect/Schema";class gP{[gB]=gB;annotations;checks;encoding;context;constructor(e,t,r,n){this.annotations=e,this.checks=t,this.encoding=r,this.context=n}toString(){return`<${this._tag}>`}}let gR=class extends gP{_tag="Declaration";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,r,n,i,s,a,o){super(r,n,i,s),this.typeParameters=e,this.run=t,this.encodingChecks=a,this.encodingRun=o}getParser(){let e;return(t,r)=>{if(t===m$)return mU;e??=this.run(this.typeParameters);try{return e(t,this,r)}catch(e){return ah(e)}}}_rebuild(e,t,r,n,i){let s=bD(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&r===this.encodingChecks&&n===this.run&&i===this.encodingRun?this:new gR(s,n,this.annotations,t,void 0,this.context,r,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return"string"==typeof e?e:"<Declaration>"}},gF=new class extends gP{_tag="Null";getParser(){return b0(this,null)}getExpected(){return"null"}},gL=new gM(gF,new gh(gi(()=>void 0),gi(()=>null))),gz=new class extends gP{_tag="Undefined";getParser(){return b0(this,void 0)}toCodecJson(){return bT(this,[gL])}getExpected(){return"undefined"}},gD=new class extends gP{_tag="Void";getParser(){let e=tZ(void 0);return t=>t===m$?mU:e}toCodecJson(){return bT(this,[gL])}getExpected(){return"void"}},gH=class extends gP{_tag="Never";getParser(){return b1(this,ey)}getExpected(){return"never"}},gJ=new gH,gW=new class extends gP{_tag="Unknown";getParser(){return b1(this,ev)}getExpected(){return"unknown"}},gq=class extends gP{_tag="Literal";literal;constructor(e,t,r,n,i){if(super(t,r,n,i),"number"==typeof e&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${te(e)}`);this.literal=e}getParser(){return b0(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return"bigint"==typeof this.literal?gK(this):this}toCodecStringTree(){return"string"==typeof this.literal?this:gK(this)}getExpected(){return"string"==typeof this.literal?JSON.stringify(this.literal):globalThis.String(this.literal)}};function gK(e){let t=globalThis.String(e.literal);return bT(e,[new gM(new gq(t),new gh(gi(()=>e.literal),gi(()=>t)))])}let gV=new class extends gP{_tag="String";getParser(){return b1(this,ec)}matchPart(e,t){let r=this.checks;return r&&!t.disableChecks&&yi(r,e,void 0,this,t)?void 0:e}getExpected(){return"string"}};function gG(e,t){return e.some(e=>e.annotations?.representation?.id===t||"FilterGroup"===e._tag&&gG(e.checks,t))}let gY=new class extends gP{_tag="Number";getParser(){return b1(this,ed)}matchKey(e,t){return this._match(b6,e,t)}matchPart(e,t){return this._match(b4,e,t)}_match(e,t,r){if(!e.test(t))return;let n=globalThis.Number(t);return r.disableChecks||!this.checks?n:yi(this.checks,n,void 0,this,r)?void 0:n}toCodecJson(){return this.checks&&(gG(this.checks,"effect/schema/isFinite")||gG(this.checks,"effect/schema/isInt"))?this:bT(this,[bE])}toCodecStringTree(){return this.toCodecJson()===this?bT(this,[b9]):bT(this,[b7])}getExpected(){return"number"}},gZ=new class extends gP{_tag="Boolean";getParser(){return b1(this,ef)}getExpected(){return"boolean"}},gX=new class extends gP{_tag="Symbol";getParser(){return b1(this,ep)}matchKey(e,t){return t.disableChecks||!this.checks?e:yi(this.checks,e,void 0,this,t)?void 0:e}toCodecStringTree(){return bT(this,[yn])}getExpected(){return"symbol"}},gQ=new class extends gP{_tag="BigInt";getParser(){return b1(this,eh)}matchPart(e,t){if(!ye.test(e))return;let r=globalThis.BigInt(e);return t.disableChecks||!this.checks?r:yi(this.checks,r,void 0,this,t)?void 0:r}toCodecStringTree(){return bT(this,[yt])}getExpected(){return"bigint"}},g0=class extends gP{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor(e,t,r,n,i,s,a,o){super(n,i,s,a),this.isMutable=e,this.elements=t,this.rest=r,this.encodingChecks=o;let l=!1;for(let e=0;e<t.length;e++)if(bY(t[e]))l=!0;else if(l)throw Error("A required element cannot follow an optional element. ts(1257)");if(l&&r.length>1)throw Error("A required element cannot follow an optional element. ts(1257)");for(let e=1;e<r.length;e++)if(bY(r[e]))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(e,t=e){let r,n,i=this,s=i.elements.length,a=Math.max(0,i.rest.length-1);function o(e,t){return t<s?r[t]:t>=e?n[t-e+1]:n[0]}let l=e=>{let{input:t,len:r,options:n}=e;if(0===i.rest.length&&r>s)for(let a=s;a<r;a++){let r=new mq(i,t[a],n),s=new mJ([a],r);if("all"!==n.errors)return t1(new mK(i,[s],t,n));e.issues?e.issues.push(s):e.issues=[s]}return e.issues?t1(new mK(i,e.issues,t,n)):tZ(e.output)},u=(e,t)=>{let r=e.length,n={ast:i,getParser:o,input:e,len:r,tailThreshold:Math.max(s,r-a),output:[],issues:void 0,options:t},c=0===i.rest.length?s:Math.max(r,s+a),d=void 0===t.concurrency?1:lv(t.concurrency),f=1===d?g2(n,e,0,c):g3(n,e,{concurrency:d,end:c});if(!f)return l(n);if(aJ(f))return aW(f,()=>l(n));let h=!0;return au(()=>h?(h=!1,aD(f,()=>l(n))):u(e,t))};return(e,s)=>{if(e===m$)return mU;try{if(!Array.isArray(e))return t1(new mV(i,e,s));return r||(r=i.elements.map(e=>({ast:e,parser:t(e)})),n=i.rest.map(e=>({ast:e,parser:t(e)}))),u(e,s)}catch(e){return ah(e)}}}_rebuild(e,t,r){let n=bD(this.elements,e),i=bD(this.rest,e);return n===this.elements&&i===this.rest&&t===this.checks&&r===this.encodingChecks?this:new g0(this.isMutable,n,i,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return"array"}},g1={onItem(e,t,r){let n=r<e.len?t:m$;return e.getParser(e.tailThreshold,r).parser(n,e.options)},step:function(e,t,r,n){if("Failure"===r._tag)return g5(e,e.ast,n,r);let i=r===mB?t:r[tv];if(i!==m$)e.output[n]=i;else{let t=e.getParser(e.tailThreshold,n);if(bY(t.ast))return;let r=new mJ([n],new mW(t.ast.context?.annotations));if("all"!==e.options.errors)return t1(new mK(e.ast,[r],e.input,e.options));e.issues?e.issues.push(r):e.issues=[r]}}},g2=(lx())(g1),g3=(lS())(g1),g5=(e,t,r,n)=>{if(0===n.cause.reasons.length)return n;let i=m6(n.cause);if(void 0===i)return t0(sz(n.cause,n=>new mK(t,[new mJ([r],n)],e.input,e.options)));let s=new mJ([r],i);if("all"!==e.options.errors)return t1(new mK(t,[s],e.input,e.options));e.issues?e.issues.push(s):e.issues=[s]},g4="[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[Ee][+-]?\\d+)?";function g6(e,t,r=g$){let n,i;return function t(s){switch(s._tag){case"String":case"TemplateLiteral":return(n??=Object.keys(e)).filter(e=>void 0!==s.matchPart(e,r));case"Number":return(n??=Object.keys(e)).filter(e=>void 0!==s.matchKey(e,r));case"Symbol":return(i??=Object.getOwnPropertySymbols(e)).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t)&&void 0!==s.matchKey(t,r));case"Union":return[...new Set(s.types.flatMap(t))];default:return[]}}(b2(bX(t)))}let g8=class{name;type;constructor(e,t){this.name=e,this.type=t}},g9=class{parameter;type;constructor(e,t){if(!(function e(t){switch(t._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return t.types.every(e);default:return!1}}(e)&&function e(t){let r=bN(t);switch(r._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return r.types.every(e);default:return!1}}(e)))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,bY(t)||void 0!==t.encoding&&bY(bX(t)))throw Error("Cannot use `Schema.optionalKey` or `Schema.optional` with index signatures. Index signatures already allow keys to be absent; use `Schema.UndefinedOr` to allow `undefined` values.")}},g7=class extends gP{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,r,n,i,s,a){super(r,n,i,s),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=a}getParser(e,t=e){let r,n,i,s=this,a=s.propertySignatures.length,o=s.indexSignatures.length;if(!a&&!o)return b1(s,eb);let l=()=>(r||(r=s.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),n=o?s.indexSignatures.map(r=>({is:r,parserKey:e(b2(r.parameter)),parserValue:t(r.type)})):void 0),r),u=()=>{let e=new Set(s.propertySignatures.map(e=>"number"==typeof e.name?globalThis.String(e.name):e.name)),t=(t,r,n,i,o)=>{if("Failure"===o._tag)return g5(t,s,r,o)??a0;let l=o===mB?i:o[tv];if(n!==m$&&l!==m$){if(a&&(e.has(r)||e.has("number"==typeof n?globalThis.String(n):n)))return a0;tp(t.out,n,l)}return a0},i=(e,r,n,a)=>{if(!a){let t=n.parserKey(r,e.options);if(!aJ(t))return aD(oF(t),t=>i(e,r,n,t));a=t}if("Failure"===a._tag)return g5(e,s,r,a)??a0;let o=a===mB?r:a[tv],l=e.input[r],u=n.parserValue(l,e.options);return aJ(u)?t(e,r,o,l,u):aD(oF(u),n=>t(e,r,o,l,n))},u=(e,r,n)=>{let i=e.input[r],s=n.parserValue(i,e.options);return aJ(s)?t(e,r,r,i,s):aD(oF(s),n=>t(e,r,r,i,n))},c=o?lS()({onItem:(e,[t,r])=>r.is.parameter===gV?u(e,t,r):i(e,t,r),step:(e,t,r)=>"Failure"===r._tag?r:void 0}):void 0;return dF(function*(t,d){if(t===m$)return m$;if(!("object"==typeof t&&null!==t&&!Array.isArray(t)))return yield*t1(new mV(s,t,d));l();let f={},h={ast:s,input:t,out:f,issues:void 0,options:d},p="all"===d.errors,m="error"===d.onExcessProperty,g=void 0===d.concurrency?1:lv(d.concurrency),b=o&&m?s.indexSignatures.map(e=>g6(t,e.parameter,d)):void 0;if(m){let r=b?new Set(e):e;if(b)for(let e of b)for(let t of e)r.add(t);let n=Reflect.ownKeys(t);for(let e=0;e<n.length;e++){let i=n[e];if(!r.has(i)&&Object.prototype.propertyIsEnumerable.call(t,i)){let e=new mq(s,t[i],d),r=new mJ([i],e);if(!p)return yield*t1(new mK(s,[r],t,d));h.issues?h.issues.push(r):h.issues=[r];continue}}}if(a){let e=1===g?br(h,r):bn(h,r,{concurrency:g});e&&(yield*e)}if(o&&1===g)for(let e=0;e<o;e++){let r=n[e],s=r.is.parameter===gV?u:i,a=b?.[e]??(r.is.parameter===gV?Object.keys(t):g6(t,r.is.parameter,d));for(let e=0;e<a.length;e++){let t=s(h,a[e],r);if(aJ(t)){if("Failure"===t._tag)return yield*t}else yield*t}}else if(c){let e=iD();for(let r=0;r<o;r++){let i=n[r],s=b?.[r]??(i.is.parameter===gV?Object.keys(t):g6(t,i.is.parameter,d));for(let t=0;t<s.length;t++)e.push([s[t],i])}let r=c(h,e,{concurrency:g});r&&(yield*r)}return h.issues?yield*t1(new mK(s,h.issues,t,d)):f})};if(o)return u();let c=(e,t,n)=>{let i=r[t];return aD(oF(n),n=>{let s={...e,out:{...e.out}},a=be(s,i,n);if(a)return a;let o=()=>tZ(s.out),l=br(s,r.slice(t+1));return l?aW(l,o):o()})};return(e,t)=>{if(e===m$)return mU;if("all"===t.errors||void 0!==t.onExcessProperty||void 0!==t.concurrency&&1!==lv(t.concurrency))return(i??=u())(e,t);if(!("object"==typeof e&&null!==e&&!Array.isArray(e)))return t1(new mV(s,e,t));let r=l(),n={},a={ast:s,input:e,out:n,issues:void 0,options:t};try{for(let i=0;i<r.length;i++){let s=r[i],o=s.name,l=bp(e,o),u=l?e[o]:m$,d=s.parser(u,t);if(!aJ(d))return c(a,i,d);if(d===mB){l&&tp(n,o,u);continue}let f=be(a,s,d);if(f)return f}}catch(e){return ah(e)}return tZ(n)}}_rebuild(e,t,r,n){let i=bD(this.propertySignatures,t=>{let r=e(t.type);return r===t.type?t:new g8(t.name,r)}),s=bD(this.indexSignatures,r=>{let n=t(r.parameter),i=e(r.type);return n===r.parameter&&i===r.type?r:new g9(n,i)});return i===this.propertySignatures&&s===this.indexSignatures&&r===this.checks&&n===this.encodingChecks?this:new g7(i,s,this.annotations,r,void 0,this.context,n)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return 0===this.propertySignatures.length&&0===this.indexSignatures.length?"object | array":"object"}};function be(e,t,r){if("Failure"===r._tag)return g5(e,e.ast,t.name,r);if(r===mB)return;let n=r[tv];if(n!==m$)return void tp(e.out,t.name,n);if(delete e.out[t.name],!bY(t.type)){let r=new mJ([t.name],new mW(t.type.context?.annotations));return"all"!==e.options.errors?t1(new mK(e.ast,[r],e.input,e.options)):void(e.issues?e.issues.push(r):e.issues=[r])}}let bt={onItem(e,t){if(!bp(e.input,t.name))return t.parser(m$,e.options);let r=e.input[t.name];return tp(e.out,t.name,r),t.parser(r,e.options)},step:be},br=(lx())(bt),bn=(lS())(bt);function bi(e,t){return e?t?[...e,...t]:e:t}function bs(e,t,r){return new g7(Reflect.ownKeys(e).map(t=>new g8(t,e[t].ast)),[],r,t)}function ba(e){return e.ast}function bo(e,t){return new g0(!1,e.map(e=>e.ast),[],void 0,t)}function bl(e,t,r){return new bm(e.map(ba),t,void 0,r)}let bu=en(e=>{for(;;){if(gN(e))return gW;let t=e.encoding;if(!t)return e.recur?.(bu,Z)??e;if(t.some(e=>"Middleware"===e.transformation._tag&&e.transformation.decode!==Z))return gW;e=t[t.length-1].to}});function bc(e){switch(e._tag){default:return[];case"Declaration":{let t=e.annotations?.[mO];return Array.isArray(t)?t:[]}case"Objects":return e.propertySignatures.flatMap(e=>{let t=e.type;if(!bY(t)){if(gI(t))return[{key:e.name,literal:t.literal}];if(gA(t))return[{key:e.name,literal:t.symbol}]}return[]});case"Arrays":return e.elements.flatMap((e,t)=>{if(!bY(e)){if(gI(e))return[{key:t,literal:e.literal}];if(gA(e))return[{key:t,literal:e.symbol}]}return[]});case"Union":{if(0===e.types.length)return[];let t=e.types.map(e=>bc(bu(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case"Suspend":return bc(e.thunk())}}let bd=new WeakMap,bf=Object.freeze([]),bh=e=>null===e?"null":Array.isArray(e)?"array":typeof e,bp=(e,t)=>"__proto__"===t?Object.hasOwn(e,t):t in e,bm=class extends gP{_tag="Union";types;options;encodingChecks;constructor(e,t,r,n,i,s,a){super(r,n,i,s),this.types=e,this.options=t,this.encodingChecks=a}getParser(e,t){let r,n=this,i=void 0!==t,s=[],a=t=>s[t]??=e(n.types[t]);return(e,t)=>{if(e===m$)return mU;let s=(r??=function(e){let t,r,n,i=bd.get(e);if(i)return i;let s=0,a=!0,o=[];for(let i=0;i<e.length;i++){let l=bu(e[i]);if(gC(l))continue;if(gI(l)||gA(l)){n??=new Map;let e=gI(l)?l.literal:l.symbol;o[i]=e;let t=n.get(e);t||n.set(e,t=[]),t.push(i)}else a=!1;let u=bc(l);if(u.length)for(let{key:e,literal:r}of(t??=new Map,s++,u)){let n=t.get(e);n||t.set(e,n=[new Map,new Set]),n[1].add(i);let s=n[0].get(r);s||n[0].set(r,s=new Set),s.add(i)}else for(let e of(r??={},function e(t){switch(t._tag){case"Null":return["null"];case"Undefined":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return t.propertySignatures.length||t.indexSignatures.length?["object"]:["string","number","boolean","symbol","bigint","object","array","function"];case"Enum":return Array.from(new Set(t.enums.map(([,e])=>typeof e)));case"Literal":return[typeof t.literal];case"Union":return Array.from(new Set(t.types.flatMap(e)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}(l)))(r[e]??=[]).push(i)}let l={},u=e=>l[e]??=Object.freeze(r?.[e]??bf);if(a&&n)n.forEach(Object.freeze),i=e=>n.get(e)??bf;else if(t?.size!==1||r)if(t){let e;for(let r of t)(!e||r[1][0].size>e[1][0].size)&&r[1][1].size===s&&(e=r);i=(n,i)=>{let s,a=bh(n);if(!ew(n))return u(a);let o=new Set(r?.[a]);if(e){let[t,[r]]=e,l=bp(n,t),c=l?n[t]:void 0;if(l&&(!i||void 0!==c)){let e=r.get(c);if(!e)return u(a);for(let t of e)o.add(t);s=t}}if(void 0===s)for(let[e,[r,s]]of t){let t=bp(n,e),a=t?n[e]:void 0;if(t&&(!i||void 0!==a)){let e=r.get(a);if(e)for(let t of e)o.add(t)}else if(i)for(let e of s)o.add(e)}for(let[e,[r,a]]of t){if(e===s)continue;let t=bp(n,e),l=t?n[e]:void 0;if(t&&(!i||void 0!==l)){let e=r.get(l);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else i=e=>{let t=u(bh(e));return n?t.filter(t=>void 0===o[t]||o[t]===e):t};else{let[r,[n]]=t.entries().next().value,s=new Map;for(let[e,t]of n)s.set(e,Object.freeze(Array.from(t)));let a=Object.freeze(e.map((e,t)=>t));i=(e,t)=>{if(ew(e)){let n=bp(e,r)?e[r]:void 0;if(void 0!==n)return s.get(n)??bf;if(t)return a}return bf}}return bd.set(e,i),i}(n.types))(e,i);if(0===s.length)return t1(new mX(n,[],e,t));if(1===s.length){var o,l,u,c;let r=a(s[0])(e,t);return"Success"===r._tag?r:aJ(r)?bg(n,r.cause,e,t):(o=n,l=r,u=e,c=t,od(l,e=>bg(o,e,u,c)))}return function e(t,r,n,i,s){let a={ast:t,parser:r,input:i,out:void 0,successes:t.options?.mode==="oneOf"?[]:void 0,issues:void 0,options:s},o=by(a,n);if(!o)return a.out?a.out:t1(new mX(t,a.issues??[],i,s));if(aJ(o))return bb(o,a);let l=!0;return au(()=>l?(l=!1,bb(o,a)):e(t,r,n,i,s))}(n,a,s,e,t)}}_rebuild(e,t,r){let n=bD(this.types,e);return n===this.types&&t===this.checks&&r===this.encodingChecks?this:new bm(n,this.options,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let r of this.types){let n=r.matchPart(e,t);if(void 0!==n)return n}}getExpected(e){let t=this.annotations?.expected;return"string"==typeof t?t:0===this.types.length?"never":Array.from(new Set(this.types.map(t=>{let r=bX(t);switch(r._tag){case"Arrays":{let t=r.elements.filter(gI);if(t.length>0)return`${bx(r.isMutable)}[ ${t.map(t=>e(t)+(t.context?.isOptional?"?":"")).join(", ")}, ... ]`;break}case"Objects":{let t=r.propertySignatures.filter(e=>gI(e.type));if(t.length>0)return`{ ${t.map(t=>`${bx(t.type.context?.isMutable)}${tr(t.name)}${t.type.context?.isOptional?"?":""}: ${e(t.type)}`).join(", ")}, ... }`}}return e(r)}))).join(" | ")}};function bg(e,t,r,n){let i=m6(t);return i?t1(new mX(e,[i],r,n)):t0(t)}function bb(e,t){return aW(e,e=>t.out===mB?aa(t.input):t.out?t.out:t1(new mX(t.ast,t.issues??[],t.input,t.options)))}let by=(lx())({onItem:(e,t)=>e.parser(t)(e.input,e.options),step(e,t,r){if("Failure"===r._tag){let t=m6(r.cause);if(void 0===t)return r;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),t1(new mQ(e.ast,e.successes,e.input,e.options));if(e.out=r,!e.successes)return a0;e.successes.push(e.ast.types[t])}}}),bv=new bm([new gq("Infinity"),new gq("-Infinity"),new gq("NaN")]);function bx(e){return e?"":"readonly "}let bw=class extends G{_tag="Filter";run;annotations;aborted;constructor(e,t,r=!1){super(),this.run=e,this.annotations=t,this.aborted=r}annotate(e){return new bw(this.run,{...this.annotations,...e},this.aborted)}abort(){return new bw(this.run,this.annotations,!0)}and(e,t){return new bS([this,e],t)}},bS=class extends G{_tag="FilterGroup";checks;annotations;constructor(e,t){super(),this.checks=e,this.annotations=t}annotate(e){return new bS(this.checks,{...this.annotations,...e})}and(e,t){return new bS([this,e],t)}};function bk(e,t,r=!1){return new bw((t,r,n)=>(function(e,t,r,n){if(Array.isArray(t)){if(!n6(t))return;return 1===t.length?m0(t[0],r,n):new mK(e,iJ(t,e=>m0(e,r,n)),r,n)}if(void 0!==t)return"boolean"==typeof t?t?void 0:new mG(void 0,r,n):m0(t,r,n)})(r,e(t,r,n),t,n),t,r)}let b_=bU(gY,[bk(e=>globalThis.Number.isFinite(e),{expected:"a finite number",representation:{id:"effect/schema/isFinite",payload:null},toJsonSchema:()=>({type:"number"}),toCode:()=>({runtime:"Schema.isFinite()"}),arbitraryConstraint:{number:"finite"}})]),bE=new gM(new bm([b_,bv]),new gh(gu(),gi(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function bC(e,t){let r=new globalThis.RegExp(e),n={source:r.source,flags:r.flags};return bk(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n.source}`,representation:{id:"effect/schema/isPattern",payload:n},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[n]},...t})}let bI=new WeakMap;function bA(e,t){let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>"context"===e||"encoding"===e)&&bI.set(r,bj(e)),r}function bj(e){let t=bI.get(e);if(void 0!==t)return t;if(void 0===e.encoding)return e;let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return bI.set(e,r),r}function bT(e,t){return e.encoding===t?e:bA(e,{encoding:t})}function bO(e,t){if(e.context===t)return e;let r=bj(e);return r.context===t&&r.encoding===e.encoding?r:bA(e,{context:t})}function bN(e){return e.encoding?bN(e.encoding[e.encoding.length-1].to):e}function bM(e,t){if(e.checks){let r=e.checks[e.checks.length-1];return b$(e,i_(e.checks.slice(0,-1),r.annotate(t)))}return bA(e,{annotations:{...e.annotations,...t}})}function b$(e,t){if("Suspend"===e._tag&&t)throw Error("Cannot add checks to Suspend");return e.checks===t?e:bA(e,{checks:t})}function bU(e,t){return b$(e,bi(e.checks,t))}function bB(e,t){let r=t(e.to);return r===e.to?e:new gM(r,e.transformation)}function bP(e,t){let r=e[e.length-1],n=bB(r,t);return n===r?e:i_(e.slice(0,e.length-1),n)}function bR(e){return t=>t.encoding?bT(t,bP(t.encoding,e)):t}function bF(e,t){return bR(e=>bO(e,t))(e)}function bL(e){return er(function t(r){return r.encoding?bT(r,bP(r.encoding,t)):e(r)})}function bz(e,t){return en(function r(n){if(n.encoding){let e=n.encoding[n.encoding.length-1];return t?.stopAt?.(e)?n:bT(n,bP(n.encoding,r))}return e(n)})}function bD(e,t){let r;for(let n=0;n<e.length;n++){let i=e[n],s=t(i);if(r)r[n]=s;else if(s!==i){r=Array(e.length);for(let t=0;t<n;t++)r[t]=e[t];r[n]=s}}return r??e}function bH(e,t){let r=e.context?new gU(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new gU(!1,!1,void 0,t);return bO(e,r)}let bJ=en(e=>{let t=e.context?!1===e.context.isOptional?new gU(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new gU(!0,!1);return bW(bO(e,t))}),bW=bR(bJ),bq=er(e=>bJ(new bm([e,gz]))),bK=bR(en(e=>{let t=e.context?!1===e.context.isMutable?new gU(e.context.isOptional,!0,e.context.constructorDefault,e.context.annotations):e.context:new gU(!1,!0);return bK(bO(e,t))}));function bV(e,t,r){let n;return n=new gM(e,r),bT(t,t.encoding?[...t.encoding,n]:[n])}function bG(e,t){let{literals:r,parameters:n}=function(e){let t=[],r=[];function n(e){t.includes(e)||t.push(e)}return!function e(t){switch(t._tag){case"Literal":var i;(ec(i=t.literal)||ed(i)||ep(i))&&n(t.literal);return;case"UniqueSymbol":n(t.symbol);return;case"Enum":for(let[,e]of t.enums)n(e);return;case"Never":return;case"Union":for(let r=0;r<t.types.length;r++)e(t.types[r]);return;default:r.push(t)}}(e),{literals:t,parameters:r}}(e);return new g7(r.map(e=>new g8(e,t)),n.map(e=>new g9(e,t)))}function bY(e){return e.context?.isOptional??!1}let bZ=en(e=>{let t=bj(e);if(t!==e){let r=bZ(t);return r===t&&void 0===e.encoding?e:bO(r,e.context)}let r="recur"in e?e.recur(bZ):e;if("encodingChecks"in r&&r.encodingChecks){let t,n,i=(t=!0,"recur"in e&&e.recur(function e(r){return(t=t&&!r.encoding&&!gN(r))&&"recur"in r&&r.recur(e),r}),t)?r.encodingChecks:(gj(r)||gT(r)||gk(r)&&r.typeParameters.length>0)&&n6(n=r.encodingChecks.flatMap(function e(t){return!function e(t){return t.annotations?.[mT]===!0||"FilterGroup"===t._tag&&t.checks.every(e)}(t)?"FilterGroup"===t._tag?t.checks.flatMap(e):[]:[t]}))?n:void 0;return bA(r,{encodingChecks:void 0,checks:bi(r.checks,i)})}return r}),bX=en(e=>bZ(bQ(e))),bQ=er(e=>{if(e.encoding)return function(e,t){let r=t.length,n=t[r-1],i=[new gM(bQ(bT(e,void 0)),t[0].transformation.flip())];for(let e=1;e<r;e++)i.unshift(new gM(bQ(t[e-1].to),t[e].transformation.flip()));let s=bQ(n.to);return s.encoding?bT(s,[...s.encoding,...i]):bT(s,i)}(e,e.encoding);let t=bj(e);if(t!==e){let r=bQ(t);return r===t?e:bO(r,e.context)}return"flip"in e?e.flip(bQ):"recur"in e?e.recur(bQ):e});function b0(e,t){let r=0===t?mB:tZ(t);return(n,i)=>n===m$?mU:n===t?r:t1(new mV(e,n,i))}function b1(e,t){return(r,n)=>r===m$?mU:t(r)?mB:t1(new mV(e,r,n))}let b2=bz(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(b2)}}),b3=bz(e=>{switch(e._tag){default:return e;case"Symbol":case"UniqueSymbol":return e.toCodecStringTree();case"Union":return e.recur(b3)}}),b5=bz(e=>{switch(e._tag){default:return e;case"Number":case"Literal":case"BigInt":return e.toCodecStringTree();case"Union":return e.recur(b5)}}),b4=new globalThis.RegExp(`^${g4}$`),b6=new globalThis.RegExp(`^(?:${g4}|Infinity|-Infinity|NaN)$`),b8=bU(gV,[bC(b4,{expected:"a string representing a finite number",representation:{id:"effect/schema/isStringFinite",payload:null},toJsonSchema:()=>({pattern:b4.source})})]),b9=new gM(b8,gy),b7=new gM(new bm([b8,bv]),gy),ye=new globalThis.RegExp("^-?\\d+$"),yt=new gM(bU(gV,[bC(ye,{expected:"a string representing a bigint",representation:{id:"effect/schema/isStringBigInt",payload:null},toJsonSchema:()=>({pattern:ye.source}),expected:"a string representing a bigint"})]),gv),yr=new globalThis.RegExp("^Symbol\\(([\\s\\S]*)\\)$"),yn=new gM(bU(gV,[bC(yr,{expected:"a string representing a symbol",representation:{id:"effect/schema/isStringSymbol",payload:null},toJsonSchema:()=>({pattern:yr.source})})]),new gh(gi(e=>globalThis.Symbol.for(yr.exec(e)[1])),gs((e,t)=>void 0!==globalThis.Symbol.keyFor(e)?aa(globalThis.String(e)):t1(new mZ({message:"cannot serialize to string, Symbol is not registered"},e,t)))));function yi(e,t,r,n,i){for(let s=0;s<e.length;s++){let a=e[s];if("FilterGroup"===a._tag){if((r=yi(a.checks,t,r,n,i))&&("all"!==i.errors||r[r.length-1].filter.aborted))break}else{let e=a.run(t,n,i);if(e){let n=new mD(a,e,t,i);if(r?r.push(n):r=[n],"all"!==i.errors||a.aborted)break}}}return r}function ys(e){if(!gk(e))return;let t=e.annotations?.[mN];return em(t)?t(e.typeParameters):void 0}let ya=function(e){return t=>mj(t)?.[e]};function yo(e){return null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e&&globalThis.Number.isFinite(e)}function yl(e){return void 0===e||"string"==typeof e}function yu(e,t){let r=new WeakMap,n=[];e:for(;;){if("object"!=typeof e||null===e){if(!t(e))return!1}else{let t=e,i=r.get(t);if(!1===i)return!1;if(void 0===i){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e))return!1}r.set(t,!1),n.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;n.length>0;){let t=n[n.length-1],i=t.keys;if("number"==typeof i){if(t.index<i){e=t.value[t.index++];continue e}}else if(t.index<i.length){e=t.value[i[t.index++]];continue e}r.set(t.value,!0),n.pop()}return!0}}let yc=new gR([],()=>(e,t,r)=>yu(e,yo)?mB:t1(new mV(t,e,r)),{representation:{id:"effect/schema/Json",payload:null},expected:"JSON value",toCodecJson:()=>void 0,toCodecStringTree:()=>yh}),yd=new gM(yc,gb),yf=new gM(new bm([new g0(!1,[],[yc]),new g7([],[new g9(gV,yc)])]),gb),yh=new gM(new gR([],()=>(e,t,r)=>yu(e,yl)?mB:t1(new mV(t,e,r)),{expected:"StringTree",toCodecStringTree:()=>void 0}),gb),yp=(e,t,r)=>e===mB?r(t):aW(e,r);function ym(e){let t=function(e){if("Middleware"===e._tag)return(t,r,n)=>yg(t===mB?e.decode(tZ(mP(r)),n):e.decode(aK(t,mP),n));let t=e.decode;switch(t._tag){case"Passthrough":return(e,t)=>e===mB?tZ(t):e;case"Transform":{let e=e=>e===m$?mU:tZ(t.transform(e));return(t,r)=>yp(t,r,e)}case"TransformOptional":{let e=e=>mR(t.transform(mP(e)));return(t,r)=>yp(t,r,e)}case"TransformEffect":return(e,r,n)=>yp(e,r,e=>e===m$?mU:t.transform(e,n));case"TransformOptionalEffect":return(e,r,n)=>yp(e,r,e=>yg(t.transform(mP(e),n)))}}(e);return(e,r,n)=>{try{return t(e,r,n)}catch(e){return ah(e)}}}let yg=e=>aW(e,mR),yb=(e,t,r,n)=>od(n,n=>dA(()=>sz(n,n=>new mH(e,n,t,r))));function yy(e,t){let r,n=t(e);return e.context?.constructorDefault===void 0?n:(r=e.context.constructorDefault,(t,i)=>{if(t!==m$&&void 0!==t)return n(t,i);if(aJ(r)&&"Success"===r._tag){let e=n(r[tv],i);return e===mB?r:e}return aW(yb(e,t,i,r),e=>{let t=n(e,i);return t===mB?tZ(e):t})})}function yv(e,t,r,n,i){let s,a,o;if("Declaration"===e._tag)for(let r of e.typeParameters)t(r);let l=r?ys(e):void 0,u=l?(o=ym(l.link.transformation),(e,r)=>e===m$?mU:l.isConstructed(e)?mB:o((a??=t(l.link.to))(e,r),e,r)):n??e.getParser(t,r),c=e.checks,d=e.encoding,f=d?.map(e=>ym(e.transformation)),h=e.encodingChecks;if(!d&&!c&&!h)return u;let p=(t,r)=>{let n=u(t,r);try{if(h&&!r.disableChecks)if(aJ(n)){if("Success"===n._tag){let i=n===mB?t:n[tv];if(t!==m$&&i!==m$){let i=yi(h,t,void 0,e,r);i&&(n=t1(new mK(e,i,t,r)))}}}else n=aD(n,n=>{if(t!==m$&&n!==m$){let n=yi(h,t,void 0,e,r);if(n)return t1(new mK(e,n,t,r))}return aa(n)});if(c&&!r.disableChecks)if(aJ(n)){if("Success"===n._tag){let i=n===mB?t:n[tv];if(i===m$)return n;let s=yi(c,i,void 0,e,r);s&&(n=t1(new mK(e,s,i,r)))}}else n=aD(n,t=>{if(t!==m$){let n=yi(c,t,void 0,e,r);if(n)return t1(new mK(e,n,t,r))}return aa(t)});return n}catch(e){return ah(e)}},m=void 0===i?p:i(p);return d?(r,n)=>{let i=s??=d.map(e=>t(e.to)),a=r,o=i[i.length-1](r,n);for(let e=d.length-1;e>=0;e--)if(o=f[e](o,a,n),0!==e){let t=i[e-1];o="Success"===o._tag?t(a=o[tv],n):aW(o,e=>{let r=t(e,n);return r===mB?tZ(e):r})}if("Success"===o._tag){let e=m(o[tv],n);return e===mB?o:e}return aW(o=yb(e,r,n,o),e=>{let t=m(e,n);return t===mB?tZ(e):t})}:m}let yx=Symbol(),yw=new WeakMap,yS=e=>yA(e).parser,yk=e=>yA(e).makeEffect,y_=e=>yy(e,yk);class yE{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=yv(this.ast,yS)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=yv(this.ast,yk,y_)}}class yC extends yE{compiled;resolve;constructor(e,t,r){super(e),this.compiled=t,this.resolve=r}save(e,t){return Object.defineProperty(this,e,{value:t}),t}operation(e){let t=this.compiled;return"function"==typeof t?t(this.ast,this.resolve,e):t?.[e]}get is(){return this.save("is",this.operation("is"))}get decode(){return this.save("decode",this.operation("decode"))}get make(){return this.save("make",this.operation("make"))}get compiledMakeEffect(){return this.save("compiledMakeEffect",this.operation("makeEffect"))}get decodeEffect(){return this.save("decodeEffect",this.operation("decodeEffect")??yv(this.ast,e=>yI(this.resolve,e,"parser")))}get parser(){var e,t;let r,n=this.decode;return void 0===n?this.decodeEffect:this.save("parser",(e=n,t=()=>this.decodeEffect,(n,i)=>{if(n!==m$)try{let t=e(n,i);if(t!==yx)return t===n?mB:tZ(t)}catch(e){return ah(e)}return(r??=t())(n,i)}))}get makeEffect(){let e=this.compiledMakeEffect;if(void 0!==e)return this.save("makeEffect",e);let t=e=>yI(this.resolve,e,"makeEffect");return this.save("makeEffect",yv(this.ast,t,e=>yy(e,t)))}}function yI(e,t,r){let n,i=e(t);return void 0===i.compiled||Object.hasOwn(i,r)?i[r]:(e,t)=>(n??=i[r])(e,t)}function yA(e){let r=yw.get(e);if(void 0!==r)return r;let n=void 0===t?new yE(e):new yC(e,t(e,yA),yA);return yw.set(e,n),n}function yj(e){let t,r=e.ast;return(e,n)=>(t??=y$(yF,bZ(r)))(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function yT(e){let t=yj(e);return(e,r)=>{let n=lL(t(e,r));return"Success"===n._tag?rb(n.value):(m8(n.cause,"Option adapter can only return none for schema issues"),rm)}}function yO(e,t){let r=y$(yR,e.ast);return void 0===t?r:(e,n)=>r(e,yN(t,n))}let yN=(e,t)=>t?{...e,...t}:e,yM=e=>e===m$?t1(new mG):aa(e);function y$(e,t){let r;return(n,i)=>{let s=(r??=e(t))(n,i??g$);return s===mB?aa(n):aJ(s)?s[tv]===m$?yM(m$):s:aW(s,yM)}}let yU="Constructor adapter can only throw schema issues";function yB(e){throw Error(yU,{cause:tD(e)})}function yP(e,t,r){var n,i;let s=r?.disableChecks?r.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions??g$,a=e.make;if(void 0!==a&&t!==m$){let e;try{e=a(t,s)}catch(e){yB(e)}if(e!==yx&&e!==m$)return e}let o=lL((n=e.makeEffect(t,s),i=t,n===mB?aa(i):aJ(n)?n[tv]===m$?yM(m$):n:aW(n,yM)));if("Success"===o._tag)return o.value;throw Error("Schema validation failed",{cause:m8(o.cause,yU)})}let yR=e=>yA(e).parser,yF=e=>yA(e).makeEffect,yL="~effect/Schema/Schema",yz=Symbol(),yD={[yL]:yL,get make(){var e;let t,r=(e=bZ(this.ast),(r,n)=>yP(t??=yA(e),r,n));return Object.defineProperty(this,"make",{value:r,enumerable:!0}),r},get makeEffect(){let e=yj(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=yT(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return K(this,arguments)},annotate(e){return this.rebuild(bM(this.ast,e))},annotateKey(e){return this.rebuild(bH(this.ast,e))},check(...e){return this.rebuild(bU(this.ast,e))},rebuild(e){return yH(e,this[yz])}};function yH(e,t){let r=Object.setPrototypeOf(function(){},yD);return t&&(Object.hasOwn(t,"name")||Object.hasOwn(t,"length")||Object.hasOwn(t,"__proto__"))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[yz]=t,r.ast=e,r}let yJ=yW(function(e,t){switch(e._tag){case"Declaration":{let r=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!em(r))return bT(e,[yd]);let n=r(e.typeParameters.map(e=>yH(bX(e))));return void 0===n?e:bT(e,[bB(n,t)])}case"Unknown":return bT(e,[yd]);case"ObjectKeyword":return bT(e,[yf]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return yK(e),e.recur(t,b3);case"Union":{let r=yG(e.types);if(r!==e.types)return new bm(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e});function yW(e,t){let r=er(t=>{let r=bO(t,void 0),i=e(r,n);return i===r?null:i}),n=bz(e=>{let t=r(bj(e));if(null===t)return e;let n=bO(t,e.context);return void 0===e.context?n:bF(n,yq(e.context))},t);return n}function yq(e){return void 0===e.constructorDefault?e:new gU(e.isOptional,e.isMutable,void 0,e.annotations)}function yK(e){if(e.propertySignatures.some(e=>"string"!=typeof e.name))throw new globalThis.Error("Objects property names must be strings",{cause:e})}function yV(e){return t=>{let r=[...t].sort((t,r)=>e(bX(t))-e(bX(r)));return r.some((e,r)=>e!==t[r])?r:t}}let yG=yV(e=>{switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}),yY=er(e=>{let t=function(e,t){switch(e._tag){case"Declaration":{let r=e.annotations?.toCodecIso??e.annotations?.toCodec;if(em(r)){let n=r(e.typeParameters.map(e=>yH(e)));return bT(e,[bB(n,t)])}break}case"Arrays":case"Objects":case"Union":case"Suspend":return e.recur(t)}return e}(e,yY);return t!==e&&void 0!==e.context?bF(t,yq(e.context)):t}),yZ=yV(e=>{switch(e._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}),yX=new gM(new gq("null"),new gh(gi(()=>null),gi(()=>"null"))),yQ=new gM(new bm([new gq("true"),new gq("false")]),new gh(gi(e=>"true"===e),gl())),y0=new gh(gi(e=>"string"==typeof e?[e]:e),gn),y1=e=>e.transformation===y0,y2=yW((e,t)=>(function(e,t,r){switch(e._tag){case"Declaration":{let n=e.typeParameters.map(e=>yH(t(bX(e)))),i=e.annotations?.toCodecStringTree;if(em(i)){let r=i(n);if(void 0===r)return e;return bT(e,[bB(r,t)])}let s=e.annotations?.toCodecJson,a=em(s)?s(n):void 0,o=void 0===a?e.annotations?.toCodec:void 0,l=a??(em(o)?o(n):void 0);return void 0===l?r(e):bT(e,[bB(l,t)])}case"Null":return bT(e,[yX]);case"Boolean":return bT(e,[yQ]);case"Unknown":case"ObjectKeyword":return bT(e,[yh]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return yK(e),e.recur(t,b3);case"Union":{let r=yZ(e.types);if(r!==e.types)return new bm(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e})(e,t,e=>{throw new globalThis.Error("Missing structural codec for StringTree",{cause:e})}),{stopAt:y1}),y3=e=>bY(e)?bJ(gW):gW,y5=bz(e=>{var t;let r="Declaration"===(t=e)._tag||"Arrays"===t._tag||"Objects"===t._tag||"Union"===t._tag||"Suspend"===t._tag?t.recur(y5):t;if(gj(r)){let t=bV(new bm([new g0(r.isMutable,r.elements.map(y3),r.rest.map(y3)),gV],{mode:"anyOf"}),r,y0);return bY(e)?bJ(t):t}return r},{stopAt:y1}),y4=bz(e=>{switch(e._tag){case"Objects":return e.recur(e=>y6(y4(e)),Z);case"Arrays":return e.recur(e=>y9(y4(e)));case"Declaration":case"Union":case"Suspend":return e.recur(y4)}return e}),y6=bL(e=>bY(e)?y8(e):y9(e)),y8=bL(e=>gN(e)?e.recur(y8):function(e){if(!gO(e))return!1;let t=e.types[e.types.length-1].encoding?.[0].transformation;return t===vt||t===vr||t===vn}(e)||function e(t){let r=bN(t);switch(r._tag){case"Union":return void 0===r.checks&&r.types.some(e);case"Null":case"Unknown":case"Any":case"Declaration":let n,i;return(n=bZ(yH(bO(r,void 0)).ast),i=e=>{var t;let r;return(r=(t=y$(yR,n),(e,r)=>lL(t(e,r))),i=e=>{let t=r(e,g$);return"Success"===t._tag||(m8(t.cause,"Type guard adapter can only return false for schema issues"),!1)})(e)},e=>i(e))(null)}return!1}(e)?e:y7(e,bV(gF,gJ,vt))),y9=bL(e=>{var t,r;return gN(e)?e.recur(y9):gj(e)&&0===e.elements.length&&1===e.rest.length?y7(e,(t=b$(vi,e.checks),bV(gF,t,vr))):gT(e)&&0===e.propertySignatures.length&&e.indexSignatures.length>0?y7(e,(r=b$(vs,e.checks),bV(gF,r,vn))):e});function y7(e,t){return bO(new bm([bO(e,void 0),t]),e.context)}let ve=e=>new gh(e,gt(()=>"Go nil values are never encoded")),vt=ve(ga(()=>rm)),vr=ve(gi(()=>[])),vn=ve(gi(()=>({}))),vi=new g0(!1,[],[]),vs=bG(gV,gJ),va="~effect/Schema/SchemaError";function vo(e){return eS(e,va)&&e[va]===va}let vl=ri((e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}),vu="~effect/net/NetAddress";class vc extends i9("NetAddressError"){}let vd=e=>eS(e,vu)&&"Ipv4Address"===e._tag,vf=e=>eS(e,vu)&&"Ipv6Address"===e._tag,vh={...tl,_tag:"Ipv4Address",[vu]:vu,[eW](e){return vd(e)&&this.value===e.value},[eE](){return eT(ej(vg,0|this.value))},toString(){return vk(this)},toJSON(){return this.toString()}},vp={...tl,_tag:"Ipv6Address",[vu]:vu,[eW](e){return!!vf(e)&&this.w0===e.w0&&this.w1===e.w1&&this.w2===e.w2&&this.w3===e.w3},[eE](){let e=ej(vb,0|this.w0);return e=ej(e,0|this.w1),e=ej(e,0|this.w2),eT(ej(e,0|this.w3))},toString(){return vk(this)},toJSON(){return this.toString()}},vm={...tl,_tag:"MacAddress",[vu]:vu,[eW](e){let t;return eS(t=e,vu)&&"MacAddress"===t._tag&&vl(this.bytes,e.bytes)},[eE](){return ej(vy,eR(this.bytes))},toString(){return vS(this)},toJSON(){return this.toString()}},vg=e$("Ipv4Address"),vb=e$("Ipv6Address"),vy=e$("MacAddress"),vv=e=>{let t=Object.create(vh);return t.value=e>>>0,Object.freeze(t)},vx=e=>[e>>>24,e>>>16&255,e>>>8&255,255&e],vw=(e,t)=>rC(new vc({input:e,message:t})),vS=e=>Array.from(e.bytes,e=>e.toString(16).padStart(2,"0")).join(":"),vk=e=>{if(vd(e))return vx(e.value).join(".");let t=(e=>{let{w0:t,w1:r,w2:n,w3:i}=e;return[t>>>16,65535&t,r>>>16,65535&r,n>>>16,65535&n,i>>>16,65535&i]})(e);if(v_(e))return`::ffff:${t[6]>>8}.${255&t[6]}.${t[7]>>8}.${255&t[7]}`;let r=-1,n=0,i=-1;for(let e=0;e<=8;e++)e<8&&0===t[e]?-1===i&&(i=e):-1!==i&&(e-i>n&&(r=i,n=e-i),i=-1);if(n<2)return t.map(e=>e.toString(16)).join(":");let s=t.slice(0,r).map(e=>e.toString(16)).join(":"),a=t.slice(r+n).map(e=>e.toString(16)).join(":");return`${s}::${a}`},v_=e=>{let{w0:t,w1:r,w2:n}=e;return 0===t&&0===r&&65535===n},vE=/^[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?$/,vC=/^(?:\d+|0x[0-9a-f]*)$/,vI=e=>{if("."===e)return;let t=e.endsWith(".")?e.slice(0,-1):e;if(0===t.length)return"domain name must not be empty";if(t.length>253)return"domain name must be at most 253 characters";let r=t.split(".");for(let e of r){if(0===e.length)return"domain name labels must not be empty";if(e.length>63)return"domain name labels must be at most 63 characters";if(!vE.test(e))return"domain name labels must contain only letters, digits, hyphens, or underscores and must not start or end with a hyphen"}if(vC.test(r[r.length-1]))return"the last domain name label must not be numeric"},vA=e=>"string"==typeof e&&/^[a-z0-9_.-]+$/.test(e)&&void 0===vI(e),vj="~effect/net/Dns/DnsRecord",vT=e=>Number.isInteger(e)&&e>=0&&e<=255,vO=e=>Number.isInteger(e)&&e>=0&&e<=65535,vN=e=>Number.isInteger(e)&&e>=0&&e<=0xffffffff,vM=e=>"string"==typeof e,v$=e=>nH(e)&&nJ(e)&&vN(nQ(e)),vU={A:{address:vd},AAAA:{address:vf},CAA:{critical:e=>"boolean"==typeof e,tag:e=>vM(e)&&/^[a-z0-9]+$/i.test(e),value:vM},CNAME:{target:vA},MX:{exchange:vA,priority:vO},NAPTR:{order:vO,preference:vO,flags:vM,service:vM,regexp:vM,replacement:vA},NS:{host:vA},PTR:{host:e=>vM(e)&&e.length>0},SOA:{primary:vA,admin:e=>vM(e)&&e.length>0,serial:vN,refresh:v$,retry:v$,expire:v$,minimum:v$},SRV:{target:vA,port:vO,priority:vO,weight:vO},TLSA:{certUsage:vT,selector:vT,matchingType:vT,data:e=>e instanceof Uint8Array&&e.length>0},TXT:{chunks:e=>Array.isArray(e)&&e.length>0&&e.every(vM)}},vB=Object.keys(vU),vP={...tl,[vj]:vj,[eW](e){return eS(e,vj)&&e._tag===this._tag&&Object.keys(this).every(t=>eq(this[t],e[t]))},[eE](){return eU(this,Object.keys(this))},toString(){return vH(this)},toJSON(){return{...this}}},vR=new TextEncoder,vF=e=>`\\${e.toString().padStart(3,"0")}`,vL=e=>{let t='"';for(let r of vR.encode(e))t+=34===r||92===r?`\\${String.fromCharCode(r)}`:r<32||r>126?vF(r):String.fromCharCode(r);return t+'"'},vz=[34,36,40,41,59,64],vD=e=>{let t=vR.encode(e),r="";for(let e=0;e<t.length;e++){let n=t[e];if(92===n){let n=t[e+1];46===n||92===n?(r+=`\\${String.fromCharCode(n)}`,e++):r+="\\\\"}else n<=32||n>126?r+=vF(n):r+=vz.includes(n)?`\\${String.fromCharCode(n)}`:String.fromCharCode(n)}return r},vH=e=>{switch(e._tag){case"A":case"AAAA":return`${e._tag} ${vk(e.address)}`;case"CAA":return`CAA ${128*!!e.critical} ${e.tag} ${vL(e.value)}`;case"CNAME":return`CNAME ${e.target}`;case"MX":return`MX ${e.priority} ${e.exchange}`;case"NAPTR":return`NAPTR ${e.order} ${e.preference} ${vL(e.flags)} ${vL(e.service)} ${vL(e.regexp)} ${e.replacement}`;case"NS":return`NS ${e.host}`;case"PTR":return`PTR ${vD(e.host)}`;case"SOA":return`SOA ${e.primary} ${vD(e.admin)} ${e.serial} ${nQ(e.refresh)} ${nQ(e.retry)} ${nQ(e.expire)} ${nQ(e.minimum)}`;case"SRV":return`SRV ${e.priority} ${e.weight} ${e.port} ${e.target}`;case"TLSA":return`TLSA ${e.certUsage} ${e.selector} ${e.matchingType} ${st(e.data).toUpperCase()}`;case"TXT":return`TXT ${e.chunks.map(vL).join(" ")}`}},vJ="~effect/net/IpInterface",vW={...tl,_tag:"IpInterface",[vJ]:vJ,[eW](e){return eS(e,vJ)&&this.prefixLength===e.prefixLength&&eq(this.address,e.address)},[eE](){return ej(eC(this.address),eM(this.prefixLength))},toString(){return vq(this)},toJSON(){return this.toString()}},vq=e=>`${vk(e.address)}/${e.prefixLength}`,vK="~effect/net/IpNetwork",vV={...tl,_tag:"IpNetwork",[vK]:vK,[eW](e){return eS(e,vK)&&this.prefixLength===e.prefixLength&&eq(this.address,e.address)},[eE](){return ej(eC(this.address),eM(this.prefixLength))},toString(){return vG(this)},toJSON(){return this.toString()}},vG=e=>`${vk(e.address)}/${e.prefixLength}`,vY="~effect/SemVer",vZ="~effect/SemVer/SemVerError";class vX extends i9("SemVerError"){[vZ]=vZ}let vQ=e=>{throw new vX({message:e})},v0=e=>n7({try:e,catch:e=>{if(!eS(e,vZ))throw e;return e}}),v1=(e,t,r)=>ie(v0(()=>r(t)),r=>new vX({message:`Invalid ${e} ${JSON.stringify(t)}: ${r.message}`,input:t})),v2=/^(?:0|[1-9]\d*)$/,v3=/^\d+$/,v5=/^[0-9A-Za-z-]+$/,v4=(e,t)=>!Number.isSafeInteger(e)||e<0?vQ(`${t} must be a non-negative safe integer, received ${e}`):e,v6=(e,t)=>v2.test(e)?v4(Number(e),t):vQ(`${t} must be a non-negative integer without leading zeros, received ${JSON.stringify(e)}`),v8=e=>"number"==typeof e?v4(e,"numeric pre-release identifier"):v5.test(e)?v3.test(e)?v6(e,"numeric pre-release identifier"):e:vQ(`pre-release identifier must be non-empty [0-9A-Za-z-], received ${JSON.stringify(e)}`),v9=e=>v5.test(e)?e:vQ(`build identifier must be non-empty [0-9A-Za-z-], received ${JSON.stringify(e)}`),v7=(e,t)=>rO(e.major,t.major)||rO(e.minor,t.minor)||rO(e.patch,t.patch)||((e,t)=>{if(0===e.length)return+(0!==t.length);if(0===t.length)return -1;let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){let r=e[n],i=t[n];if(r!==i){if("number"==typeof r)return"number"==typeof i?rO(r,i):-1;if("number"==typeof i)return 1;return rT(r,i)}}return rO(e.length,t.length)})(e.prerelease,t.prerelease),xe={[vY]:vY,[eW](e){return xn(e)&&xl(this,e)},[eE](){return e$(xa(this))},toString(){return`SemVer(${xa(this)})`},toJSON(){return{_id:"SemVer",value:xa(this)}},[ta](){return this.toJSON()},pipe(){return K(this,arguments)}},xt=(e,t,r,n,i)=>{let s=Object.create(xe);return s.major=e,s.minor=t,s.patch=r,s.prerelease=n,s.build=i,s},xr=(e,t)=>e>=Number.MAX_SAFE_INTEGER?vQ(`${t} cannot be incremented past Number.MAX_SAFE_INTEGER`):e+1,xn=e=>eS(e,vY),xi=e=>{let t=e,r=[],n=t.indexOf("+");-1!==n&&(r=t.slice(n+1).split(".").map(v9),t=t.slice(0,n));let i=[],s=t.indexOf("-");-1!==s&&(i=t.slice(s+1).split(".").map(v8),t=t.slice(0,s));let a=t.split(".");return 3!==a.length?vQ("expected MAJOR.MINOR.PATCH"):xt(v6(a[0],"major"),v6(a[1],"minor"),v6(a[2],"patch"),i,r)},xs=e=>v1("SemVer",e,xi),xa=e=>{let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease.length>0&&(t+=`-${e.prerelease.join(".")}`),e.build.length>0&&(t+=`+${e.build.join(".")}`),t},xo=ra(rs),xl=ri((e,t)=>e.major===t.major&&e.minor===t.minor&&e.patch===t.patch&&xo(e.prerelease,t.prerelease)&&xo(e.build,t.build)),xu=e=>void 0===e?[0]:[v8(e),0],xc=e=>xn(e[0]),xd=((e,t)=>xt(xr(e.major,"major"),0,0,xu(t),[]),"~effect/SemVerRange"),xf={[xd]:xd,[eW](e){return xh(e)&&x_(this)===x_(e)},[eE](){return e$(x_(this))},toString(){return`SemVerRange(${x_(this)})`},toJSON(){return{_id:"SemVerRange",value:x_(this)}},[ta](){return this.toJSON()},pipe(){return K(this,arguments)}},xh=e=>eS(e,xd),xp=/^(<=|>=|<|>|=|~|\^)?(.*)$/,xm=e=>"x"===e||"X"===e||"*"===e,xg=["major","minor","patch"],xb=e=>{if(0===e.length)return vQ("expected a version after the operator");if(e.includes("+"))return vQ(`build metadata is not allowed in ranges, received ${JSON.stringify(e)}`);let t=e.indexOf("-"),r=(-1===t?e:e.slice(0,t)).split(".");if(r.length>3)return vQ(`expected at most MAJOR.MINOR.PATCH, received ${JSON.stringify(e)}`);let n=[];for(let t=0;t<r.length;t++)if(!xm(r[t])){if(n.length<t)return vQ(`a version component cannot follow a wildcard, received ${JSON.stringify(e)}`);n.push(v6(r[t],xg[t]))}return -1===t?{components:n,prerelease:[]}:n.length<3?vQ(`a pre-release requires MAJOR.MINOR.PATCH, received ${JSON.stringify(e)}`):{components:n,prerelease:e.slice(t+1).split(".").map(v8)}},xy=e=>{let t=e.split(/\s+/).filter(e=>e.length>0);if(0===t.length)return vQ("expected a comparator");if(3===t.length&&"-"===t[1])return[{_tag:"Hyphen",from:xb(t[0]),to:xb(t[2])}];let r=[];for(let e=0;e<t.length;e++){let[,n,i]=xp.exec(t[e]),s=0===i.length&&void 0!==n&&e+1<t.length?t[++e]:i;r.push({_tag:"Comparator",operator:n??"=",version:xb(s)})}return r},xv=e=>{let t=Object.create(xf);return t.sets=e,t},xx=e=>0===e.trim().length?xw:xv(e.split("||").map(xy)),xw=xv([[{_tag:"Comparator",operator:"=",version:{components:[],prerelease:[]}}]]),xS=e=>{if(0===e.components.length)return"*";let t=e.components.join(".");return 0===e.prerelease.length?t:`${t}-${e.prerelease.join(".")}`},xk=e=>"Hyphen"===e._tag?`${xS(e.from)} - ${xS(e.to)}`:`${"="===e.operator?"":e.operator}${xS(e.version)}`,x_=e=>e.sets.map(e=>e.map(xk).join(" ")).join(" || ");function xE(){return(e,t,r)=>xO(new gR(e.map(ba),e=>t(e.map(e=>xO(e))),r))}function xC(e,t){return xE()([],()=>(t,r,n)=>e(t)?aa(t):t1(new mV(r,t,n)),t)}class xI extends i9("SchemaError"){[va]=va;constructor(e){let t=Error.stackTraceLimit;td(0);try{super({issue:e})}finally{td(t)}}get message(){return function e(t,r,n){let i;switch(t._tag){case"Filter":return e(t.issue,r,n??function(e,t){let r=t(e);if(void 0!==r||"InvalidValue"!==e.issue._tag)return r;let n=m3(e.issue);return void 0===n?m5(function e(t){let r=t.annotations?.expected;if("string"==typeof r)return r;switch(t._tag){case"Filter":return"<filter>";case"FilterGroup":return t.checks.map(t=>e(t)).join(" & ")}}(e.filter),e):m5(n,e.issue)}(t,m1));case"Encoding":return e(t.issue,r,n);case"Pointer":return e(t.issue,r+t.path.map(e=>`[${tr(e)}]`).join(""),n);case"Composite":case"AnyOf":if("Composite"===t._tag||t.issues.length>0)return t.issues.map(t=>e(t,r,n)).join("\n");i=n??m4(t)??m5(mM(t.ast),t);break;default:i=n??(e=>{let t=m4(e);if(void 0!==t)return t;switch(e._tag){case"InvalidType":return m5(mM(e.ast),e);case"InvalidValue":{let t=m3(e);if(void 0!==t)return m5(t,e);let r=m2(e);return void 0===r?"Expected a valid value":`Invalid data ${r}`}case"MissingKey":return"Missing key";case"UnexpectedKey":{let t=m2(e);return void 0===t?"Expected no excess property":`Unexpected key with value ${t}`}case"Forbidden":return"Forbidden operation";case"OneOf":{let t=m2(e);return void 0===t?"Expected exactly one member to match":`Expected exactly one member to match the input ${t}`}}})(t)}return r?`${i}
|
|
12
|
-
at ${r}`:i}(this.issue,"")}toJSON(){return{_tag:this._tag,message:this.message}}[ta](){return this.toJSON()}toString(){return`SchemaError(${this.message})`}}function xA(e){var t;return aJ(e)?"Success"===(t=e)._tag?t:t0(sz(t.cause,e=>new xI(e))):od(e,e=>dA(()=>sz(e,e=>new xI(e))))}function xj(e,t){let r=yO(e,t);return(e,t)=>xA(r(e,t))}function xT(e,t){let r,n=(r=y$(yR,bQ(e.ast)),void 0===t?r:(e,n)=>r(e,yN(t,n)));return(e,t)=>xA(n(e,t))}let xO=yH;function xN(e){return eS(e,yL)&&e[yL]===yL}let xM=e=>{let t=xY(e);return xO(bq(e.ast),{schema:t})},x$=e=>xO(bZ(e.ast),{schema:e});function xU(e){let t=xO(new gq(e),{literal:e,transform:r=>t.pipe(xX(xU(r),{decode:gi(()=>r),encode:gi(()=>e)}))});return t}let xB=xO(gJ),xP=xO(gW),xR=xO(gz),xF=xO(gV),xL=xO(gY),xz=xO(gZ),xD=xO(gQ),xH=xO(gD);function xJ(e,t){return xO(e,{fields:t,mapFields(e,t){let r=e(this.fields);return xJ(bs(r,t?.unsafePreserveChecks?this.ast.checks:void 0),r)}})}function xW(e){return xJ(bs(e,void 0),e)}let xq=e=>xO(new g0(!1,[],[e.ast]),{value:e}),xK=e=>xO(new g0(!1,[e.ast],[e.ast]),{value:e});function xV(e,t){return function e(t,r){return xO(t,{members:r,mapMembers(t,r){let n=t(this.members);return e(bl(n,this.ast.options,r?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}(bl(e,t,void 0),e)}function xG(e){let t=e.map(xU);return xO(bl(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return xV(e(this.members))},pick:e=>xG(e),transform:e=>xV(t.map((t,r)=>t.transform(e[r])))})}let xY=e=>xV([e,xR]);function xZ(e){return t=>xO(t.ast,{schema:t,identifier:e})}function xX(e,t){return r=>xO(bV(r.ast,e.ast,t?gp(t):gb),{from:r,to:e})}function xQ(e){var t;return xU(e).pipe((t=aa(e),e=>{var r;let n;return xO((r=e.ast,n=r.context?new gU(r.context.isOptional,r.context.isMutable,t,r.context.annotations):new gU(!1,!1,t),bO(r,n)),{schema:e})}))}function x0(e,t){return xW({_tag:xQ(e),...t})}function x1(e,t){return xC(t=>t instanceof e,t)}function x2(){return(e,t)=>new gM(e.ast,gp(t))}let x3="^\\S[\\s\\S]*\\S$|^\\S$|^$",x5=xO(b_);function x4(e){let t=rP(e.order),r=e.formatter??te;return(n,i)=>bk(e=>t(e,n),{expected:`a value greater than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n},...e.annotate?.(n),...i})}function x6(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${te(e)}`);return e}let x8=x4({order:rO,annotate:e=>({representation:{id:"effect/schema/isGreaterThanOrEqualTo",payload:{minimum:x6(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${te(e)})`})})}),x9=(g=rP((J={order:rO,annotate:e=>{let t=!!e.exclusiveMinimum||void 0,r=!!e.exclusiveMaximum||void 0;return{representation:{id:"effect/schema/isBetween",payload:{minimum:x6(e.minimum),maximum:x6(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>({[t?"exclusiveMinimum":"minimum"]:e.minimum,[r?"exclusiveMaximum":"maximum"]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${te(e.minimum)}, maximum: ${te(e.maximum)}, exclusiveMinimum: ${te(t)}, exclusiveMaximum: ${te(r)} })`})}}}).order),b=rU(J.order),y=rB(J.order),v=r$(J.order),x=J.formatter??te,(e,t)=>{let r=e.exclusiveMinimum?b:g,n=e.exclusiveMaximum?v:y;return bk(t=>r(t,e.minimum)&&n(t,e.maximum),{expected:`a value between ${x(e.minimum)}${e.exclusiveMinimum?" (excluded)":""} and ${x(e.maximum)}${e.exclusiveMaximum?" (excluded)":""}`,arbitraryConstraint:{order:J.order,minimum:e.minimum,maximum:e.maximum,...e.exclusiveMinimum&&{exclusiveMinimum:!0},...e.exclusiveMaximum&&{exclusiveMaximum:!0}},...J.annotate?.(e),...t})}),x7=xL.check(bk(e=>globalThis.Number.isSafeInteger(e),{expected:"an integer",representation:{id:"effect/schema/isInt",payload:null},toJsonSchema:()=>({type:"integer",minimum:globalThis.Number.MIN_SAFE_INTEGER,maximum:globalThis.Number.MAX_SAFE_INTEGER}),toCode:()=>({runtime:"Schema.isInt()"}),arbitraryConstraint:{number:"integer"}})),we=x7.check(x8(0));function wt(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}bk(e=>e.length>=1,{expected:"a value with a length of at least 1",representation:{id:"effect/schema/isMinLength",payload:{minLength:1}},toJsonSchema:({type:e})=>"string"===e?{minLength:1}:"array"===e?{minItems:1}:void 0===e?[{minLength:1,minItems:1},!0]:[{},!0],toCode:()=>({runtime:"Schema.isMinLength(1)"}),[mT]:!0,arbitraryConstraint:{minLength:1},...void 0});let wr=[];function wn(e){var t;let r,n,i=e?.includeStack===!0|2*(e?.excludeCause===!0),s=wr[i];if(void 0!==s)return s;let a=wI.pipe(xX(xP,gg({decode:gx,encode:(t=(e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}})(i),r=new WeakSet,n=e=>{if(e instanceof Error){var i;let s;if(r.has(e))return"[Circular]";r.add(e);let a=(i=n,s={name:e.name,message:"string"==typeof e.message?e.message:""},t?.includeStack&&"string"==typeof e.stack&&(s.stack=e.stack),t?.excludeCause||void 0===e.cause||(s.cause=i(e.cause)),s);return r.delete(e),a}try{let t=ts(e);return void 0===t?te(e):JSON.parse(t)}catch{return te(e)}})})));return wr[i]=a,a}let wi=xF.annotate({expected:"a string that will be decoded as JSON"});function ws(e,t){var r,n;return wi.pipe(xX(e,new gh((r=t??{},gs((e,t)=>ag({try:()=>JSON.parse(e,r?.reviver),catch:()=>new mG({expected:"a valid JSON string"},e,t)}))),(Object.defineProperty(n=gs((e,r)=>ag({try:()=>{let r=JSON.stringify(e,t?.replacer,t?.space);if(void 0===r)throw TypeError("Value cannot be represented as JSON");return r},catch:()=>new mG({expected:"a JSON-serializable value"},e,r)})),gd,{value:{mediaType:"application/json",preserveSchema:t?.reviver===void 0&&t?.replacer===void 0}}),n))))}let wa=ws(xP),wo=(xF.annotate({expected:"a string that will be decoded as a finite number"})).pipe(xX(x5,gy));w=new globalThis.RegExp(x3),bk(e=>e.trim()===e,{expected:"a string with no leading or trailing whitespace",representation:{id:"effect/schema/isTrimmed",payload:null},toJsonSchema:()=>({pattern:w.source}),toCode:()=>({runtime:"Schema.isTrimmed()"}),arbitraryConstraint:{patterns:[{source:x3,flags:""}]}});let wl=xF.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),wu=x1(globalThis.Uint8Array,{representation:{id:"effect/schema/Uint8Array",payload:null},toCode:()=>({runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"}),expected:"Uint8Array",toCodecJson:()=>x2()(wl,gw)});gs((e,t)=>ir(sl(e),{onFailure:()=>t1(new mG({expected:"a valid hexadecimal string"},e,t)),onSuccess:aa})),gi(st);function wc(e,t){return xO(xE()([e,t],([e,t])=>(r,n,i)=>{if(!eS(r,tj))return t1(new mV(n,r,i));switch(r._tag){case"Fail":return aG(yO(e)(r.error,i),{onSuccess:uD,onFailure:e=>mY(n,"error",e,r,i)});case"Die":return aG(yO(t)(r.defect,i),{onSuccess:uH,onFailure:e=>mY(n,"defect",e,r,i)});case"Interrupt":return aa(r)}},{representation:{id:"effect/schema/CauseReason",payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.CauseReason(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Failure<${e[0].Type}, ${e[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause.Failure",toCodec:([e,t])=>x2()(xV([xW({_tag:xU("Fail"),error:e}),xW({_tag:xU("Die"),defect:t}),xW({_tag:xU("Interrupt"),fiberId:xY(x5)})]),gg({decode:e=>{switch(e._tag){case"Fail":return uD(e.error);case"Die":return uH(e.defect);case"Interrupt":return new s$(e.fiberId)}},encode:e=>{switch(e._tag){case"Fail":return{_tag:"Fail",error:e.error};case"Die":return{_tag:"Die",defect:e.defect};case"Interrupt":return{_tag:"Interrupt",fiberId:e.fiberId}}}}))}).ast,{error:e,defect:t})}function wd(e,t){return xO(xE()([e,t],([e,t])=>{let r=xq(wc(e,t));return(e,t,n)=>tT(e)?aG(yO(r)(e.reasons,n),{onSuccess:tB,onFailure:r=>mY(t,"reasons",r,e,n)}):t1(new mV(t,e,n))},{representation:{id:"effect/schema/Cause",payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Cause(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Cause<${e[0].Type}, ${e[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause",toCodec:([e,t])=>x2()(xq(wc(e,t)),gg({decode:tB,encode:({reasons:e})=>e}))}).ast,{error:e,defect:t})}let wf=gm({decode:(e,t)=>rR(cs(e),{onNone:()=>t1(new mG({expected:"a valid UTC DateTime string"},e,t)),onSome:e=>aa(u9(e.epochMilliseconds))}),encode:e=>aa(ch(e).toISOString())}),wh=["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"];function wp(e,t){return x7.check(x9({minimum:e,maximum:t}))}e=>u4(e)&&"Utc"===e._tag;let wm=xC(nH,{representation:{id:"effect/schema/Duration",payload:null},toCode:()=>({runtime:"Schema.Duration",Type:"Duration.Duration",importDeclarations:['import * as Duration from "effect/Duration"']}),expected:"Duration",toCodecJson:()=>x2()(xV([xW({_tag:xU("Infinity")}),xW({_tag:xU("NegativeInfinity")}),xW({_tag:xU("Nanos"),value:xD}),xW({_tag:xU("Millis"),value:x7})]),gg({decode:e=>{switch(e._tag){case"Infinity":return nK;case"NegativeInfinity":return nV;case"Nanos":return nG(e.value);case"Millis":return nY(e.value)}},encode:e=>{switch(e.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:e.value.nanos};case"Millis":return{_tag:"Millis",value:e.value.millis}}}}))});e=>eS(e,pf);let wg=xC(mi,{representation:{id:"effect/http/UrlParams",payload:null},toCode:()=>({runtime:"Schema.UrlParams",Type:"UrlParams.UrlParams",importDeclarations:['import * as UrlParams from "effect/http/UrlParams"']}),expected:"UrlParams",toEquivalence:()=>mc,toCodec:()=>{var e;return x2()(xq(function e(t,r){return xO(t,{elements:r,mapElements(t,r){let n=t(this.elements);return e(bo(n,r?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}(bo(e=[xF,xF]),e)),gg({decode:ma,encode:e=>e.params.map(([e,t])=>[e,p7(t)])}))}}),wb=wg.pipe(xX((L=xF,z=xV([xF,xK(xF)]),xO(bG(L.ast,z.ast),{key:L,value:z})),gg({decode:e=>{let t={};for(let[r,n]of e.params){let e=p7(n);if(Object.hasOwn(t,r)){let n=t[r];"string"==typeof n?tp(t,r,[n,e]):n.push(e)}else tp(t,r,e)}return t},encode:mo}))),wy=(e,t)=>gm({decode:(t,r)=>aV(ac(e(t)),e=>new mG({message:e.message},t,r)),encode:e=>aa(t(e))}),wv=((B=(D=/^[0-9]*[A-Za-z-][0-9A-Za-z-]*$/).source,P=D.flags,R=/^[dg]*uy?$/.test(P),F=""===P?`new globalThis.RegExp(${te(B)})`:`new globalThis.RegExp(${te(B)}, ${te(P)})`,bC(D,{toJsonSchema:()=>R?{pattern:P.endsWith("y")?`^(?:${B})`:B}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${F})`})})),globalThis.Symbol.for("immer-draftable")),wx={};function ww(e,t){return new e(t,{"~payload":{token:wx,value:t}})}function wS(e){return`~effect/Schema/Class/${e}`}let wk=e=>(t,r)=>(function e(t,r,n,i,s){var a,o,l;let u,c=(a=n,o=r,l=i,e=>{if(void 0!==u)return u;let t=wS(o),r=r=>r instanceof e||eS(r,t),n=new gh(gi(t=>ww(e,t)),gn);return u=xX(xO(new gR([a.ast],()=>(e,t,n)=>r(e)?aa(e):t1(new mV(t,e,n)),{identifier:o,[mN]:([e])=>({isConstructed:r,link:new gM(e,n)}),toCodec:([e])=>new gM(e.ast,n),toEquivalence:([e])=>e,toFormatter:([t])=>r=>`${e.identifier}(${t(r)})`,[mO]:bc(a.ast),...l})),n)(a)}),d=wS(r),f=class extends t{constructor(...[e,t]){let r=t?.["~payload"],i=r?.token===wx?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:wx,value:i}})}static [yL]=yL;get[d](){return d}static [wv]=!0;static identifier=r;static fields=n.fields;static get ast(){return c(this).ast}static pipe(){return K(this,arguments)}static rebuild(e){return c(this).rebuild(e)}static make(e,t){return function(e,t,r,n){let i=yA(e),s=ys(e);if(void 0===s||void 0!==i.make||void 0!==i.compiledMakeEffect)return yP(i,t,r);if(s.isConstructed(t))return t;let a=yP((i.resolve??yA)(s.link.to),t,r);try{return n(a)}catch(e){yB(e)}}(bZ(c(this).ast),e??{},t,e=>ww(this,e))}static makeOption(e,t){return yT(c(this))(e??{},t)}static makeEffect(e,t){return c(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(bM(this.ast,e))}static annotateKey(e){return this.rebuild(bH(this.ast,e))}static check(...e){return this.rebuild(bU(this.ast,e))}static extend(t){return(r,i)=>{let a=xN(r)?r:xW(r),o={...n.fields,...a.fields},l=bs(o,n.ast.checks,{identifier:t});return e(this,t,xJ(bU(l,a.ast.checks),o),i,s)}}static mapFields(e,t){return n.mapFields(e,t)}};return void 0!==s&&Object.assign(f.prototype,s(r)),f})(t6,e,xN(t)?t:xW(t),r,e=>({name:e})),w_=e=>(t,r,n)=>{let i=xN(r)?r.mapFields(e=>({_tag:xQ(t),...e}),{unsafePreserveChecks:!0}):x0(t,r);return wk(e??t)(i,n)},wE=function(e){return yH(yJ(e.ast),{schema:e})},wC=function(e){return yH(y2(e.ast),{schema:e})},wI=xO(bM(yc,{toCode:()=>({runtime:"Schema.Json",Type:"Schema.Json"})}));e.s(["Array",0,xq,"Boolean",0,xz,"Cause",0,wd,"Defect",0,wn,"Error",0,wk,"FiniteFromString",0,wo,"Int",0,x7,"JsonFromUrlParamsField",0,(e,t)=>wg.pipe(xX(ws(xP,t),gm({decode:t=>rR(mh(t,e),{onNone:()=>t1(new mJ([e],new mW(void 0))),onSome:aa}),encode:t=>aa(ma([[e,t]]))}))),"Literal",0,xU,"Literals",0,xG,"Never",0,xB,"NonEmptyArray",0,xK,"Number",0,xL,"RecordFromUrlParams",0,wb,"SchemaError",0,xI,"String",0,xF,"Struct",0,xW,"TaggedError",0,w_,"Uint8Array",0,wu,"Undefined",0,xR,"UndefinedOr",0,xY,"Union",0,xV,"Unknown",0,xP,"UnknownFromJsonString",0,wa,"Void",0,xH,"brand",0,xZ,"declare",0,xC,"decodeEffect",0,xj,"decodeTo",0,xX,"decodeUnknownEffect",0,xj,"encodeEffect",0,xT,"encodeSync",0,function(e,t){let r=xT(e,t);return(e,t)=>(function(e){let t=lL(e);if("Success"===t._tag)return t.value;throw function(e,t){let r;for(let n of e.reasons){if(!tJ(n)||!vo(n.error))throw new globalThis.Error(t,{cause:e});r??=n.error}if(void 0===r)throw new globalThis.Error(t,{cause:e});return r}(t.cause,"Sync adapter can only throw schema errors")})(r(e,t))},"encodeUnknownEffect",0,xT,"fromJsonString",0,ws,"instanceOf",0,x1,"isBetweenLength",0,function(e,t,r){return e=wt(e),t=wt(t),bk(r=>r.length>=e&&r.length<=t,{expected:e===t?`a value with a length of ${e}`:`a value with a length between ${e} and ${t}`,representation:{id:"effect/schema/isBetweenLength",payload:{minimum:e,maximum:t}},toJsonSchema:({type:r})=>"string"===r?0===t||Math.ceil(e/2)>t?{minLength:Math.ceil(e/2),maxLength:t}:[{minLength:Math.ceil(e/2),maxLength:t},!0]:"array"===r?{minItems:e,maxItems:t}:void 0===r?[{minLength:Math.ceil(e/2),maxLength:t,minItems:e,maxItems:t},!0]:[{},!0],toCode:()=>({runtime:`Schema.isBetweenLength(${e}, ${t})`}),[mT]:!0,arbitraryConstraint:{minLength:e,maxLength:t},...r})},"isSchema",0,xN,"link",0,x2,"make",0,xO,"optional",0,xM,"optionalKey",0,e=>xO(bJ(e.ast),{schema:e}),"tag",0,xQ,"toCodecJson",0,wE,"toCodecStringTree",0,wC,"toType",0,x$],94831);var wA=e.i(94831),wA=wA,wj=wA,wT=wA,wO=wA,wN=wA,wM=wA,w$=wA,wU=wA,wB=wA,wP=wA,wR=wA;function wF(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e}let wL=function(){};wL.prototype=Object.create(null);class wz{handlers=[];unconstrainedHandler;find(){return this.unconstrainedHandler}add(e){var t;let r,n={params:e.params,handler:e.handler,createParams:0===(r=(t=e.params).length)?()=>Object.create(null):function(e){let n=Object.create(null);for(let i=0;i<r;i++)n[t[i]]=e[i];return n}};this.handlers.push(n),this.unconstrainedHandler=this.handlers[0]}}class wD{isLeafNode=!1;routes;handlerStorage;addRoute(e){void 0===this.routes?this.routes=[e]:this.routes.push(e),void 0===this.handlerStorage&&(this.handlerStorage=new wz),this.isLeafNode=!0,this.handlerStorage.add(e)}}class wH extends wD{staticChildren=Object.create(null);findStaticMatchingChild(e,t){let r=this.staticChildren[e.charAt(t)];if(void 0!==r&&r.matchPrefix(e,t))return r}getStaticChild(e,t=0){if(e.length===t)return this;let r=this.findStaticMatchingChild(e,t);if(void 0!==r)return r.getStaticChild(e,t+r.prefix.length)}createStaticChild(e){if(0===e.length)return this;let t=this.staticChildren[e.charAt(0)];if(t){let r=1;for(;r<t.prefix.length;r++)if(e.charCodeAt(r)!==t.prefix.charCodeAt(r)){t=t.split(this,r);break}return t.createStaticChild(e.slice(r))}let r=e.charAt(0);return this.staticChildren[r]=new wJ(e),this.staticChildren[r]}}class wJ extends wH{_tag="StaticNode";constructor(e){super(),this.setPrefix(e)}prefix;matchPrefix;parametricChildren=[];wildcardChild;setPrefix(e){if(this.prefix=e,1===e.length)this.matchPrefix=(e,t)=>!0;else{let t=e.slice(1);this.matchPrefix=(e,r)=>e.startsWith(t,r+1)}}getParametricChild(e){if(void 0===e)return this.parametricChildren.find(e=>!1===e.isRegex);let t=e.source;return this.parametricChildren.find(e=>void 0!==e.regex&&e.regex.source===t)}createParametricChild(e,t,r){let n=this.getParametricChild(e);return void 0!==n?n.nodePaths.add(r):(n=new wW(e,t,r),this.parametricChildren.push(n),this.parametricChildren.sort((e,t)=>e.isRegex?t.isRegex?void 0===e.staticSuffix?1:void 0===t.staticSuffix?-1:t.staticSuffix.endsWith(e.staticSuffix)?1:e.staticSuffix.endsWith(t.staticSuffix)?-1:0:-1:1)),n}createWildcardChild(){return void 0===this.wildcardChild&&(this.wildcardChild=new wq),this.wildcardChild}split(e,t){let r=this.prefix.slice(0,t),n=this.prefix.slice(t);this.setPrefix(n);let i=new wJ(r);return i.staticChildren[n.charAt(0)]=this,e.staticChildren[r.charAt(0)]=i,i}getNextNode(e,t,r,n){let i=this.findStaticMatchingChild(e,t),s=0;if(void 0===i){if(0===this.parametricChildren.length)return this.wildcardChild;i=this.parametricChildren[0],s=1}void 0!==this.wildcardChild&&r.push({paramsCount:n,brotherPathIndex:t,brotherNode:this.wildcardChild});for(let e=this.parametricChildren.length-1;e>=s;e--)r.push({paramsCount:n,brotherPathIndex:t,brotherNode:this.parametricChildren[e]});return i}}class wW extends wH{_tag="ParametricNode";regex;staticSuffix;constructor(e,t,r){super(),this.regex=e,this.staticSuffix=t,this.isRegex=!!e,this.nodePaths=new Set([r])}isRegex;nodePaths;getNextNode(e,t){return this.findStaticMatchingChild(e,t)}}class wq extends wD{_tag="WildcardNode";getNextNode(e,t,r,n){}}function wK(e,t){let r=1;for(;t<e.length;){if("\\"===e[++t]){t++;continue}if(")"===e[t]?r--:"("===e[t]&&r++,!r)return t}throw TypeError('Invalid regexp expression in "'+e+'"')}let wV="~effect/Chunk";function wG(e,t,r,n,i){for(let s=t;s<Math.min(e.length,t+i);s++)r[n+s-t]=e[s];return r}let wY=[],wZ=ri((e,t)=>{if(e.length!==t.length)return!1;let r=w3(e),n=w3(t);for(let e=0;e<r.length;e++)if(!eq(r[e],n[e]))return!1;return!0}),wX={[wV]:{_A:e=>e},toString(){return`Chunk(${te(w3(this))})`},toJSON(){return{_id:"Chunk",values:to(w3(this))}},[ta](){return this.toJSON()},[eW](e){return w0(e)&&wZ(this,e)},[eE](){return eR(w3(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return wY[Symbol.iterator]();default:return w3(this)[Symbol.iterator]()}},pipe(){return K(this,arguments)}},wQ=e=>{let t=Object.create(wX);switch(t.backing=e,e._tag){case"IEmpty":t.length=0,t.depth=0,t.left=t,t.right=t;break;case"IConcat":t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break;case"IArray":t.length=e.array.length,t.depth=0,t.left=w1,t.right=w1;break;case"ISingleton":t.length=1,t.depth=0,t.left=w1,t.right=w1;break;case"ISlice":t.length=e.length,t.depth=0,t.left=w1,t.right=w1}return t},w0=e=>eS(e,wV),w1=wQ({_tag:"IEmpty"}),w2=(e,t,r)=>{switch(e.backing._tag){case"IArray":wG(e.backing.array,0,t,r,e.length);break;case"IConcat":w2(e.left,t,r),w2(e.right,t,r+e.left.length);break;case"ISingleton":t[r]=e.backing.a;break;case"ISlice":wG(w3(e.backing.chunk),e.backing.offset,t,r,e.length)}},w3=e=>{switch(e.backing._tag){case"IEmpty":return wY;case"IArray":return e.backing.array;default:{let t=Array(e.length);return w2(e,t,0),e.backing={_tag:"IArray",array:t},e.left=w1,e.right=w1,e.depth=0,t}}},w5=e=>0===e.length?w1:1===e.length?wQ({_tag:"ISingleton",a:e[0]}):wQ({_tag:"IArray",array:e}),w4=(e,t)=>{switch(e.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${t}`);case"ISingleton":return e.backing.a;case"IArray":return e.backing.array[t];case"IConcat":return t<e.left.length?w4(e.left,t):w4(e.right,t-e.left.length);case"ISlice":return w4(e.backing.chunk,t+e.backing.offset)}},w6=Y(2,(e,t)=>{let r=n8(t);if(r<=0)return w1;if(r>=e.length)return e;switch(e.backing._tag){case"ISlice":return wQ({_tag:"ISlice",chunk:e.backing.chunk,length:r,offset:e.backing.offset});case"IConcat":if(r>e.left.length)return wQ({_tag:"IConcat",left:e.left,right:w6(e.right,r-e.left.length)});return w6(e.left,r);default:return wQ({_tag:"ISlice",chunk:e,offset:0,length:r})}}),w8=Y(2,(e,t)=>{let r=n8(t);if(r<=0)return e;if(r>=e.length)return w1;switch(e.backing._tag){case"ISlice":return wQ({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+r,length:e.backing.length-r});case"IConcat":if(r>e.left.length)return w8(e.right,r-e.left.length);return wQ({_tag:"IConcat",left:w8(e.left,r),right:e.right});default:return wQ({_tag:"ISlice",chunk:e,offset:r,length:e.length-r})}}),w9=Y(2,(e,t)=>{if("IEmpty"===e.backing._tag)return t;if("IEmpty"===t.backing._tag)return e;let r=t.depth-e.depth;if(1>=Math.abs(r))return wQ({_tag:"IConcat",left:e,right:t});if(r<-1)if(e.left.depth>=e.right.depth){let r=w9(e.right,t);return wQ({_tag:"IConcat",left:e.left,right:r})}else{let r=w9(e.right.right,t);if(r.depth===e.depth-3){let t=wQ({_tag:"IConcat",left:e.right.left,right:r});return wQ({_tag:"IConcat",left:e.left,right:t})}{let t=wQ({_tag:"IConcat",left:e.left,right:e.right.left});return wQ({_tag:"IConcat",left:t,right:r})}}if(t.right.depth>=t.left.depth)return wQ({_tag:"IConcat",left:w9(e,t.left),right:t.right});{let r=w9(e,t.left.left);if(r.depth===t.depth-3){let e=wQ({_tag:"IConcat",left:r,right:t.left.right});return wQ({_tag:"IConcat",left:e,right:t.right})}{let e=wQ({_tag:"IConcat",left:t.left.right,right:t.right});return wQ({_tag:"IConcat",left:r,right:e})}}});(e,t)=>{let r=n9(t),n=[],i=[];return w3(e).forEach(e=>{i.push(e),i.length>=r&&(n.push(w5(i)),i=[])}),i.length>0&&n.push(w5(i)),w5(n)},(e,t,r)=>(function(e,...t){return K(e,t)})(ij(w3(e),t,r),rJ(w5));let w7="~effect/MutableRef",Se={[w7]:w7,...tE,toJSON(){return{_id:"MutableRef",current:to(this.current)}}},St=e=>{let t=Object.create(Se);return t.current=e,t},Sr=((e,t)=>{let r=e.current;return e.current=t,r},Y(2,(e,t)=>(e.current=t,e))),Sn=((e,t)=>(e.current=t,e.current),Symbol.for("effect/MutableList/Empty")),Si=()=>({head:void 0,tail:void 0,length:0}),Ss=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},Sa=()=>({array:[],mutable:!0,offset:0,next:void 0}),So=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=Sa(),e.tail=e.tail.next):e.head=e.tail=Sa(),e.tail.array.push(t),e.length++},Sl=(e,t)=>{e.head={array:[t],mutable:!0,offset:0,next:e.head},e.tail||(e.tail=e.head),e.length++},Su=(e,t,r=!1)=>{if(0===t.length)return 0;let n={array:t,mutable:r,offset:0,next:void 0};return e.head?e.tail=e.tail.next=n:e.head=e.tail=n,e.length+=t.length,t.length},Sc=e=>{e.head=e.tail=void 0,e.length=0},Sd=(e,t)=>{if((t=n8(t))<=0||!e.head)return[];if((t=Math.min(t,e.length))===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return Sc(e),t}let r=Array(t),n=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(r[n++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,n===t)return e.head=i.offset===i.array.length&&i.next?i.next:i,e.length-=t,0===e.length?Sc(e):Ss(e),r;i=i.next}return Sc(e),r},Sf=(e,t)=>{if((t=n8(t))<=0||!e.head)return;if((t=Math.min(t,e.length))===e.length&&e.head?.offset===0&&!e.head.next)return void Sc(e);let r=0,n=e.head;for(;n;){let i=n.array.length-n.offset;if(r+i>t){n.offset+=t-r,e.head=n,e.length-=t,Ss(e);return}r+=i,n=n.next}Sc(e)},Sh=e=>{if(!e.head)return Sn;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:Sc(e):Ss(e),t},Sp=(e,t)=>{if((t=n8(t))<=0)return[];let r=Math.min(t,e.length),n=Array(r),i=0,s=e.head;for(;s;){for(let e=s.offset;e<s.array.length;e++)if(n[i++]=s.array[e],i===r)return n;s=s.next}return n},Sm=(e,t)=>{let r=[],n=e.head,i=0;for(;n;){for(let e=n.offset;e<n.array.length;e++)t(n.array[e],i++)&&r.push(n.array[e]);n=n.next}0===r.length?Sc(e):(e.head=e.tail={array:r,mutable:!0,offset:0,next:void 0},e.length=r.length)},Sg=e=>al(()=>SL(e.atomicPubSub(),new Map,o2(void 0,void 0),lW(!1),St(!1),e.strategy(),St(rm))),Sb=e=>{var t;let r,n="number"==typeof e?{capacity:e}:e;if(Sz(n.capacity),1/0===n.capacity)return Sy(n);let i=n.replay&&n.replay>0?new SK(Math.ceil(n.replay)):void 0;if(1===n.capacity)return new S$(i);return Math.max((r=Math.pow(2,Math.ceil(Math.log2(t=n.capacity))))<t?2*r:r,2)===n.capacity?new SN(n.capacity,i):new ST(n.capacity,i)},Sy=e=>{let t=e?.replay;return new SB(t&&t>0?new SK(Math.ceil(t)):void 0)},Sv=e=>ll(t3(t=>(Sr(e.shutdownFlag,!0),oK(e.scope,aZ(t.id)).pipe(aR(e.strategy.shutdown),ou(e.shutdownHook.open),aL)))),Sx=Y(2,(e,t)=>al(()=>Sw(e,t))),Sw=Y(2,(e,t)=>{if(e.shutdownFlag.current||rp(e.ended.current))return!1;if(Sr(e.ended,rb(t)),e.strategy instanceof SD){let t;for(let[r,n,i]of Sd(t=e.strategy.publishers,t.length))i&&uS(n,tZ(!1))}let r=tZ(t);for(let t of e.subscribers.values())for(let e of t){let t;for(;(t=Sh(e))!==Sn;)uS(t,r)}return e.subscribers.clear(),!0}),SS=Y(2,(e,t)=>au(()=>e.shutdownFlag.current||rp(e.ended.current)?aa(!1):e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),aa(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[t],e.shutdownFlag,e.ended))),Sk=Y(2,(e,t)=>au(()=>{if(e.shutdownFlag.current||rp(e.ended.current))return aa(!1);let r=e.pubsub.publishAll(t);return(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),0===r.length)?aa(!0):e.strategy.handleSurplus(e.pubsub,e.subscribers,r,e.shutdownFlag,e.ended)})),S_=e=>au(()=>{if(e.shutdownFlag.current)return lo;if(e.replayWindow.remaining>0)return aa(e.replayWindow.take());let t=0===e.pollers.length?e.subscription.poll():Sn;return t===Sn?SE(e):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),aa(t))}),SE=e=>av(t=>{if(e.shutdownFlag.current)return t(lo);if(rp(e.ended.current)){let r=0===e.pollers.length?e.subscription.poll():Sn;return r!==Sn?(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),t(aa(r))):t(aa(e.ended.current.value))}let r=ub(),n=e.subscribers.get(e.subscription);return(n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),So(e.pollers,r),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),r.effect)?t(r.effect):(r.resumes=[t],al(()=>{let t;return t=e.pollers,Sm(t,e=>e!==r)}))}),SC=Y(2,(e,t)=>au(()=>{let r;if(e.shutdownFlag.current)return lo;let n=n8(t);if(e.replayWindow.remaining>=n)return aa(e.replayWindow.takeN(n));e.replayWindow.remaining>0&&(n-=(r=e.replayWindow.takeAll()).length);let i=0===e.pollers.length?e.subscription.pollUpTo(n):[];return e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),r?aa(r.concat(i)):aa(i)})),SI=Symbol.for("effect/PubSub/AbsentValue"),SA=(e,t,r)=>{e.has(t)||e.set(t,new Set),e.get(t).add(r)},Sj=(e,t,r)=>{if(!e.has(t))return;let n=e.get(t);n.delete(r),0===n.size&&e.delete(t)};class ST{array;replayIndices;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(e,t){this.capacity=e,this.replayBuffer=t,this.array=Array.from({length:e}),this.replayIndices=t?Array.from({length:e}):[],this.subscribers=Array.from({length:e})}replayWindow(){return this.replayBuffer?new SV(this.replayBuffer):SG}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(e){if(this.isFull())return!1;let t=this.replayBuffer?.offer(e);if(0!==this.subscriberCount){let r=this.publisherIndex%this.capacity;this.array[r]=e,void 0!==t&&(this.replayIndices[r]=t),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(e){if(0===this.subscriberCount)return this.replayBuffer&&this.replayBuffer.offerAll(e),[];let t=iw(e),r=t.length,n=this.publisherIndex-this.subscribersIndex,i=Math.min(r,this.capacity-n);if(0===i)return t;let s=0,a=this.publisherIndex+i;for(;this.publisherIndex!==a;){let e=t[s++],r=this.publisherIndex%this.capacity;this.array[r]=e;let n=this.replayBuffer?.offer(e);void 0!==n&&(this.replayIndices[r]=n),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return t.slice(s)}slide(){if(this.subscribersIndex!==this.publisherIndex){let e=this.subscribersIndex%this.capacity,t=this.array[e];this.array[e]=SI,this.subscribers[e]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(t,this.replayIndices[e])}}subscribe(){return this.subscriberCount+=1,new SO(this,this.publisherIndex,!1)}}class SO{self;subscriberIndex;unsubscribed;constructor(e,t,r){this.self=e,this.subscriberIndex=t,this.unsubscribed=r}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return Sn;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let e=this.subscriberIndex%this.self.capacity,t=this.self.array[e];return this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=SI,this.self.subscribersIndex+=1),this.subscriberIndex+=1,t}return Sn}pollUpTo(e){if(e=n8(e),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let t=this.self.publisherIndex-this.subscriberIndex,r=Math.min(e,t);if(r<=0)return[];let n=[],i=this.subscriberIndex+r;for(;this.subscriberIndex!==i;){let e=this.subscriberIndex%this.self.capacity,t=this.self.array[e];this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=SI,this.self.subscribersIndex+=1),n.push(t),this.subscriberIndex+=1}return n}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let e=this.subscriberIndex%this.self.capacity;this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=SI,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}}class SN{array;replayIndices;mask;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(e,t){this.capacity=e,this.replayBuffer=t,this.array=Array.from({length:e}),this.replayIndices=t?Array.from({length:e}):[],this.mask=e-1,this.subscribers=Array.from({length:e})}replayWindow(){return this.replayBuffer?new SV(this.replayBuffer):SG}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(e){if(this.isFull())return!1;let t=this.replayBuffer?.offer(e);if(0!==this.subscriberCount){let r=this.publisherIndex&this.mask;this.array[r]=e,void 0!==t&&(this.replayIndices[r]=t),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(e){if(0===this.subscriberCount)return this.replayBuffer&&this.replayBuffer.offerAll(e),[];let t=iw(e),r=t.length,n=this.publisherIndex-this.subscribersIndex,i=Math.min(r,this.capacity-n);if(0===i)return t;let s=0,a=this.publisherIndex+i;for(;this.publisherIndex!==a;){let e=t[s++],r=this.publisherIndex&this.mask;this.array[r]=e;let n=this.replayBuffer?.offer(e);void 0!==n&&(this.replayIndices[r]=n),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return t.slice(s)}slide(){if(this.subscribersIndex!==this.publisherIndex){let e=this.subscribersIndex&this.mask,t=this.array[e];this.array[e]=SI,this.subscribers[e]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(t,this.replayIndices[e])}}subscribe(){return this.subscriberCount+=1,new SM(this,this.publisherIndex,!1)}}class SM{self;subscriberIndex;unsubscribed;constructor(e,t,r){this.self=e,this.subscriberIndex=t,this.unsubscribed=r}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return Sn;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let e=this.subscriberIndex&this.self.mask,t=this.self.array[e];return this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=SI,this.self.subscribersIndex+=1),this.subscriberIndex+=1,t}return Sn}pollUpTo(e){if(e=n8(e),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let t=this.self.publisherIndex-this.subscriberIndex,r=Math.min(e,t);if(r<=0)return[];let n=[],i=this.subscriberIndex+r;for(;this.subscriberIndex!==i;){let e=this.subscriberIndex&this.self.mask,t=this.self.array[e];this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=SI,this.self.subscribersIndex+=1),n.push(t),this.subscriberIndex+=1}return n}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let e=this.subscriberIndex&this.self.mask;this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=SI,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}}class S${publisherIndex=0;subscriberCount=0;subscribers=0;value=SI;replayIndex=0;capacity=1;replayBuffer;constructor(e){this.replayBuffer=e}replayWindow(){return this.replayBuffer?new SV(this.replayBuffer):SG}pipe(){return K(this,arguments)}isEmpty(){return 0===this.subscribers}isFull(){return!this.isEmpty()}size(){return+!this.isEmpty()}publish(e){if(this.isFull())return!1;let t=this.replayBuffer?.offer(e);return 0!==this.subscriberCount&&(this.value=e,void 0!==t&&(this.replayIndex=t),this.subscribers=this.subscriberCount,this.publisherIndex+=1),!0}publishAll(e){if(0===this.subscriberCount)return this.replayBuffer&&this.replayBuffer.offerAll(e),[];let t=iw(e);return 0===t.length?t:this.publish(t[0])?t.slice(1):t}slide(){if(this.isFull()){let e=this.value;this.subscribers=0,this.value=SI,this.replayBuffer?.slide(e,this.replayIndex)}}subscribe(){return this.subscriberCount+=1,new SU(this,this.publisherIndex,!1)}}class SU{self;subscriberIndex;unsubscribed;constructor(e,t,r){this.self=e,this.subscriberIndex=t,this.unsubscribed=r}isEmpty(){return this.unsubscribed||0===this.self.subscribers||this.subscriberIndex===this.self.publisherIndex}size(){return+!this.isEmpty()}poll(){if(this.isEmpty())return Sn;let e=this.self.value;return this.self.subscribers-=1,0===this.self.subscribers&&(this.self.value=SI),this.subscriberIndex=this.self.publisherIndex,e}pollUpTo(e){return 1>n8(e)||this.isEmpty()?[]:[this.poll()]}unsubscribe(){this.unsubscribed||(this.unsubscribed=!0,this.self.subscriberCount-=1,0!==this.self.subscribers&&this.subscriberIndex!==this.self.publisherIndex&&(this.self.subscribers-=1,0===this.self.subscribers&&(this.self.value=SI)))}}class SB{publisherHead={value:SI,replayIndex:void 0,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=Number.MAX_SAFE_INTEGER;replayBuffer;constructor(e){this.replayBuffer=e}replayWindow(){return this.replayBuffer?new SV(this.replayBuffer):SG}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish(e){let t=this.replayBuffer?.offer(e),r=this.publisherTail.subscribers;return 0!==r&&(this.publisherTail.next={value:e,replayIndex:t,subscribers:r,next:null},this.publisherTail=this.publisherTail.next,this.publisherIndex+=1),!0}publishAll(e){if(0!==this.publisherTail.subscribers)for(let t of e)this.publish(t);else this.replayBuffer&&this.replayBuffer.offerAll(e);return[]}slide(){if(this.publisherHead!==this.publisherTail){let e=this.publisherHead.next,t=e.value;this.publisherHead=this.publisherHead.next,this.publisherHead.value=SI,this.subscribersIndex+=1,this.replayBuffer?.slide(t,e.replayIndex)}}subscribe(){return this.publisherTail.subscribers+=1,new SP(this,this.publisherTail,this.publisherIndex,!1)}}class SP{self;subscriberHead;subscriberIndex;unsubscribed;constructor(e,t,r,n){this.self=e,this.subscriberHead=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){if(this.unsubscribed)return!0;let e=!0,t=!0;for(;t;)this.subscriberHead===this.self.publisherTail?t=!1:this.subscriberHead.next.value!==SI?(e=!1,t=!1):(this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1);return e}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return Sn;let e=!0,t=Sn;for(;e;)if(this.subscriberHead===this.self.publisherTail)e=!1;else{let r=this.subscriberHead.next.value;r!==SI&&(t=r,this.subscriberHead.subscribers-=1,0===this.subscriberHead.subscribers&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=SI,this.self.subscribersIndex+=1),e=!1),this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return t}pollUpTo(e){e=n8(e);let t=[],r=0;for(;r!==e;){let n=this.poll();n===Sn?r=e:(t.push(n),r+=1)}return t}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.publisherTail.subscribers-=1;this.subscriberHead!==this.self.publisherTail;)this.subscriberHead.next.value!==SI&&(this.subscriberHead.subscribers-=1,0===this.subscriberHead.subscribers&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=SI,this.self.subscribersIndex+=1)),this.subscriberHead=this.subscriberHead.next}}class SR{"~effect/PubSub/Subscription"={_A:Z};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(e,t,r,n,i,s,a,o,l){this.pubsub=e,this.subscribers=t,this.subscription=r,this.pollers=n,this.shutdownHook=i,this.shutdownFlag=s,this.strategy=a,this.replayWindow=o,this.ended=l}pipe(){return K(this,arguments)}}class SF{"~effect/PubSub"={_A:Z};pubsub;subscribers;scope;shutdownHook;shutdownFlag;strategy;ended;constructor(e,t,r,n,i,s,a){this.pubsub=e,this.subscribers=t,this.scope=r,this.shutdownHook=n,this.shutdownFlag=i,this.strategy=s,this.ended=a}pipe(){return K(this,arguments)}}let SL=(e,t,r,n,i,s,a)=>new SF(e,t,r,n,i,s,a),Sz=e=>{if(e<=0||1/0!==e&&!Number.isInteger(e))throw Error(`Cannot construct PubSub with capacity of ${e}`)};class SD{publishers=Si();get shutdown(){return t3(e=>{let t;return lb(Sd(t=this.publishers,t.length),([t,r,n])=>n?uw(r,e.id):am,{concurrency:"unbounded",discard:!0})})}handleSurplus(e,t,r,n,i){return av(s=>{if(rp(i.current))return s(aa(!1));let a=ub();return this.offerUnsafe(r,a),this.onPubSubEmptySpaceUnsafe(e,t),this.completeSubscribersUnsafe(e,t),n.current?(this.removeUnsafe(a),s(lo)):a.effect?s(a.effect):(a.resumes=[s],al(()=>this.removeUnsafe(a)))})}onPubSubEmptySpaceUnsafe(e,t){let r=!0;for(;r&&!e.isFull();){let n=Sh(this.publishers);if(n===Sn)r=!1;else{let[r,i,s]=n,a=e.publish(r);a||Sl(this.publishers,n),this.completeSubscribersUnsafe(e,t),a&&s&&uS(i,tZ(!0))}}}completePollersUnsafe(e,t,r,n){return SW(this,e,t,r,n)}completeSubscribersUnsafe(e,t){return Sq(this,e,t)}offerUnsafe(e,t){let r=e[Symbol.iterator](),n=r.next();if(!n.done)for(;;){let e=n.value;if((n=r.next()).done){So(this.publishers,[e,t,!0]);break}So(this.publishers,[e,t,!1])}}removeUnsafe(e){Sm(this.publishers,([t,r])=>r!==e)}}class SH{get shutdown(){return am}handleSurplus(e,t,r,n){return aa(!1)}onPubSubEmptySpaceUnsafe(e,t){}completePollersUnsafe(e,t,r,n){return SW(this,e,t,r,n)}completeSubscribersUnsafe(e,t){return Sq(this,e,t)}}class SJ{get shutdown(){return am}handleSurplus(e,t,r,n,i){return al(()=>!rp(i.current)&&(this.slidingPublishUnsafe(e,r),this.completeSubscribersUnsafe(e,t),!0))}onPubSubEmptySpaceUnsafe(e,t){}completePollersUnsafe(e,t,r,n){return SW(this,e,t,r,n)}completeSubscribersUnsafe(e,t){return Sq(this,e,t)}slidingPublishUnsafe(e,t){let r=t[Symbol.iterator](),n=r.next();if(!n.done&&e.capacity>0){let t=n.value,i=!0;for(;i;){e.slide();let s=e.publish(t);s&&(n=r.next())&&!n.done?t=n.value:s&&(i=!1)}}}}let SW=(e,t,r,n,i)=>{let s=!0;for(;s&&!n.isEmpty();){let a=Sh(i);if(a===Sn)Sj(r,n,i),0===i.length?s=!1:SA(r,n,i);else{let s=n.poll();s===Sn?Sl(i,a):(uS(a,tZ(s)),e.onPubSubEmptySpaceUnsafe(t,r))}}},Sq=(e,t,r)=>{for(let[n,i]of r)for(let s of i)e.completePollersUnsafe(t,r,n,s)};class SK{capacity;head={value:SI,index:0,next:null};tail=this.head;slideValues=[];size=0;index=0;publisherIndex=0;constructor(e){this.capacity=e}slide(e,t){this.slideValues[this.index%this.capacity]={value:e,index:t},this.index++}offer(e){let t=this.publisherIndex++;if(this.tail.value=e,this.tail.index=t,this.tail.next={value:SI,index:0,next:null},this.tail=this.tail.next,this.size===this.capacity){let e=this.head;this.head=e.next,e.next=null,e.value=SI}else this.size+=1;return t}offerAll(e){for(let t of e)this.offer(t)}}class SV{buffer;values;index=0;remaining;slideIndex;newestIndex=-1;constructor(e){this.buffer=e,this.remaining=e.size,this.slideIndex=e.index,this.values=Array(this.remaining);let t=e.head;for(let e=0;e<this.remaining;e++)this.values[e]=t.value,this.newestIndex=t.index,t=t.next}close(){this.values.length=0,this.remaining=0}sync(){let e=this.buffer.index-this.slideIndex;if(0===e||0===this.remaining)return;let t=Math.min(e,this.buffer.capacity),r=this.buffer.index-t;for(let e=0;e<t;e++){let t=this.buffer.slideValues[(r+e)%this.buffer.capacity];t.index>this.newestIndex&&(this.index=(this.index+1)%this.values.length,this.values[(this.index+this.remaining-1)%this.values.length]=t.value,this.newestIndex=t.index)}this.slideIndex=this.buffer.index}take(){if(0===this.remaining)return;this.sync();let e=this.values[this.index];return this.values[this.index]=SI,this.index=(this.index+1)%this.values.length,this.remaining--,0===this.remaining&&this.close(),e}takeN(e){let t=Math.min(e=n8(e),this.remaining),r=Array(t);for(let e=0;e<t;e++)r[e]=this.take();return r}takeAll(){return this.takeN(this.remaining)}}let SG={remaining:0,take:()=>void 0,takeN:()=>[],takeAll:()=>[],close:()=>void 0},SY={_A:Z,_E:Z},SZ={"~effect/Queue":SY,"~effect/Queue/Enqueue":SY,"~effect/Queue/Dequeue":SY,...tE,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:kn(this)}}},SX=e=>t3(t=>{let r=Object.create(SZ);return r.dispatcher=t.currentDispatcher,r.capacity=e?.capacity??1/0,r.strategy=e?.strategy??"suspend",r.messages=Si(),r.scheduleRunning=!1,r.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},aa(r)}),SQ=e=>SX({capacity:e}),S0=Y(2,(e,t)=>au(()=>S1(e,t)?ks:"Open"===e.state._tag&&"suspend"===e.strategy?kp(e,t):ki)),S1=(e,t)=>"Open"===e.state._tag&&(e.messages.length>=e.capacity?"sliding"===e.strategy?(Sh(e.messages),So(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(So(e.messages,t),kl(e),!0):(So(e.messages,t),ku(e),!0)),S2=Y(2,(e,t)=>av(r=>{let n=S3(e,t);return 0===n.length||"dropping"===e.strategy?r(tZ(n)):km(e,{_tag:"Array",remaining:n,offset:0,resume:r})})),S3=(e,t)=>{if("Open"!==e.state._tag)return iw(t);if(1/0===e.capacity||"sliding"===e.strategy)return Su(e.messages,Array.from(t),!0),"sliding"===e.strategy&&Sd(e.messages,e.messages.length-e.capacity),ku(e),[];let r=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(0===r)return iw(t);let n=[],i=0;for(let s of t)i<r?So(e.messages,s):n.push(s),i++;return ku(e),n},S5=Y(2,(e,t)=>al(()=>S4(e,t))),S4=(e,t)=>{if("Open"!==e.state._tag)return!1;let r=a5(t0(t),ka);return 0===e.state.offers.size&&0===e.messages.length?kv(e,r):(e.state={...e.state,_tag:"Closing",exit:r},ku(e)),!0},S6=e=>S5(e,tL(rr())),S8=e=>S4(e,tL(rr())),S9=e=>al(()=>S7(e)),S7=e=>{if("Done"===e.state._tag)return!1;Sc(e.messages);let t=e.state.offers;for(let r of(kv(e,"Open"===e.state._tag?ko:e.state.exit),t))kg(r);return!0},ke=Y(3,(e,t,r)=>(t=n8(t),r=n8(r),kd(()=>kc(e,t,r)??aR(kh(e,()=>kf(e,t)),ke(e,t,r))))),kt=e=>kd(()=>kr(e)??aR(kh(e,()=>kf(e,1)),kt(e))),kr=e=>{if("Done"===e.state._tag)return e.state.exit;if(e.messages.length>0){let t=Sh(e.messages);return ky(e),tZ(t)}if(e.capacity<=0&&e.state.offers.size>0){let t=kb(e.state.offers);return ky(e),tZ(t)}},kn=e=>"Done"===e.state._tag?0:e.messages.length,ki=tZ(!1),ks=tZ(!0),ka=t1(rr()),ko=aZ(),kl=e=>{if("Done"!==e.state._tag&&0!==e.state.takers.size){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(a0),0===e.messages.length))break}},ku=e=>{e.scheduleRunning||"Done"===e.state._tag||0===e.state.takers.size||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,kl(e)},0))},kc=(e,t,r)=>{if("Done"===e.state._tag)return e.state.exit;if(r<=0||t<=0)return tZ([]);if(!kf(e,t))return;let n=e.messages.length>0?Sd(e.messages,r):[kb(e.state.offers)];return ky(e),tZ(n)},kd=tG({op:"QueueTake",[tx](e){let t=this[tv]();return eS(t,tb)?t[tx](e):t}}),kf=(e,t)=>e.messages.length>=("Closing"===e.state._tag?1:Math.min(t,e.capacity||1))||e.capacity<=0&&"Done"!==e.state._tag&&e.state.offers.size>0,kh=(e,t)=>av(r=>{if("Done"===e.state._tag)return r(e.state.exit);if(t())return r(a0);let n={ready:t,resume:r};return e.state.takers.add(n),al(()=>{"Done"!==e.state._tag&&e.state.takers.delete(n)})}),kp=(e,t)=>av(r=>S1(e,t)?r(ks):km(e,{_tag:"Single",message:t,resume:r})),km=(e,t)=>{if("Open"!==e.state._tag)return kg(t);let r=e.state.offers;return r.add(t),al(()=>{"Done"!==e.state._tag&&(r.delete(t),"Closing"===e.state._tag&&0===r.size&&0===e.messages.length&&kv(e,e.state.exit))})},kg=e=>"Single"===e._tag?e.resume(ki):e.resume(tZ(e.remaining.slice(e.offset))),kb=e=>{let t=e.values().next().value;if("Single"===t._tag)return e.delete(t),t.resume(ks),t.message;let r=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(tZ([]))),r},ky=e=>{if("Done"===e.state._tag)return cU(e.state.exit.cause);if(0===e.state.offers.size)return"Closing"===e.state._tag&&0===e.messages.length&&(kv(e,e.state.exit),cU(e.state.exit.cause));for(let t of e.state.offers){let r=e.capacity-e.messages.length;if(r<=0)break;if("Single"===t._tag)So(e.messages,t.message),e.state.offers.delete(t),t.resume(ks);else{for(;t.offset<t.remaining.length;t.offset++){if(0===r)return!1;So(e.messages,t.remaining[t.offset]),r--}e.state.offers.delete(t),t.resume(tZ([]))}let n=e.state;if("Done"===n._tag)return cU(n.exit.cause)}return!1},kv=(e,t)=>{if("Done"===e.state._tag)return;let r=e.state;for(let n of(e.state={_tag:"Done",exit:t},r.takers))n.resume(t);for(let e of(r.takers.clear(),r.awaiters))e(t);r.awaiters.clear()},kx=e=>new kk(e),kw=e=>{for(let t of e.waiters)if(t.permits<=e.free)return t},kS=(e,t,r,n=Z)=>t3(i=>{if(e.free>=t&&void 0===kw(e))return e.taken+=t,r();let s={permits:t,resume:void 0},a=()=>{e.waiters.delete(s)&&e.releaseUnsafe(i,0)};e.waiters.add(s),o9(i,a);let o=aD(n(av(t=>{kw(e)===s?t(am):s.resume=t})),()=>kw(e)!==s?o:(e.taken+=t,a(),r()));return o});class kk{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){return kS(this,e,()=>aa(e))}takeScoped(e){return lp(t=>aD(oq,r=>kS(this,e,()=>oQ(r,X(this.release(e))),t)))}takeIfAvailable(e){return au(()=>this.free<e?aa(!1):(this.taken+=e,aa(!0)))}releaseUnsafe(e,t){return this.taken-=t,this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{let e=this.free;for(let t of Array.from(this.waiters)){if(!this.waiters.has(t)||t.permits>e)continue;e-=t.permits;let r=t.resume;t.resume=void 0,r?.(am)}},0),this.free}resize(e){return t3(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),am))}release(e){return t3(t=>aa(this.releaseUnsafe(t,e)))}get releaseAll(){return t3(e=>aa(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>lp(r=>kS(this,e,()=>o8(r(t),()=>{this.releaseUnsafe(s3(),e)},!0),r))}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>lp(r=>this.free<e?af:(this.taken+=e,o8(r(aP(t)),()=>{this.releaseUnsafe(s3(),e)},!0)))}}let k_=e=>eS(e,tb)?"Success"===e._tag?uJ(e.value):e:aa(e),kE="~effect/Channel",kC={[kE]:{_Env:Z,_InErr:Z,_InElem:Z,_OutErr:Z,_OutElem:Z},pipe(){return K(this,arguments)}},kI=e=>{let t=Object.create(kC);return t.transform=(t,r)=>od(e(t,r),e=>aa(ao(e))),t},kA=(e,t)=>kI((r,n)=>aD(kO(e)(r,n),e=>t(e,n))),kj=e=>kI((t,r)=>e),kT=e=>kI(aS(function*(t,r){let n=oX(r),i=e=>oK(n,cF(e)),s=yield*lr(e(t,r,n),i);return lr(s,i)})),kO=e=>e.transform,kN=4096,kM=e=>kI((t,r)=>au(()=>kO(e())(t,r))),k$=kj(aa(uJ())),kU=e=>kj(aa(t1(e))),kB=e=>kj(aD(e,()=>uJ())),kP=Y(2,(e,t)=>kA(e,e=>al(()=>{let r=0;return aq(e,e=>t(e,r++))}))),kR=Y(2,(e,t)=>kA(e,e=>aa(c$(e,e=>aD(t(e),uJ))))),kF=e=>void 0===e||"unbounded"!==e&&e<=1,kL=Y(e=>eS(e[0],kE),(e,t,r)=>kF(r?.concurrency)?kz(e,t):kD(e,t,r)),kz=(e,t)=>kI((r,n)=>{let i=0;return aq(kO(e)(r,n),aD(e=>t(e,i++)))}),kD=(e,t,r)=>kT(aS(function*(n,i,s){let a=0,o=yield*kO(e)(n,i),l="unbounded"===r.concurrency?Number.MAX_SAFE_INTEGER:Math.min(r.concurrency,Number.MAX_SAFE_INTEGER),u=yield*SQ(0);yield*oQ(s,X(S9(u)));let c=lN((yield*a7())),d=lM(s);if(r.unordered){let e=kx(l),r=X(e.release(1)),n=oj({onFailure:e=>aD(S5(u,e),r),onSuccess:e=>aD(S0(u,e),r)});yield*e.take(1).pipe(aD(()=>o),aD(e=>{let r=a++;return d(c(n(au(()=>t(e,r))))),am}),oc({disableYield:!0}),od(t=>e.withPermits(l-1)(S5(u,t))),lT(s))}else{let e,r=yield*SQ(l-2);yield*oQ(s,X(S9(r))),yield*kt(r).pipe(dj,aD(e=>S0(u,e)),oc({disableYield:!0}),od(e=>S5(u,e)),lT(s));let n=t=>{"Success"!==t._tag&&(e=t.cause,S4(u,t.cause))};yield*o.pipe(aD(i=>{if(e)return ao(e);let s=a++,o=c(au(()=>t(i,s)));return d(o),o.addObserver(n),S0(r,ar(o))}),oc({disableYield:!0}),od(e=>S0(r,t0(e)).pipe(aR(S5(r,e)))),lT(s))}return kt(u)})),kH=Y(e=>eS(e[0],kE),(e,t,r)=>kF(r?.concurrency)?kJ(e,t):kW(e,t,r)),kJ=(e,t)=>kI((r,n)=>aq(kO(e)(r,n),e=>{let i,s,a=aD(e,e=>(s??=oX(n),aW(kO(t(e))(r,s),e=>i=o(e)))),o=c$(e=>{if(i=void 0,"Empty"===s.state._tag)return a;let t=oK(s,a0);return s=void 0,aD(t,()=>a)});return au(()=>i??a)})),kW=(e,t,r)=>e.pipe(kP(t),k4(r)),kq=((e,t)=>kI((r,n)=>al(()=>{let i,s=oX(n),a=aD(kO(e)(r,s),e=>i=c$(e,e=>oK(s,a0).pipe(aD(()=>kO(t(e))(r,n)),aD(e=>(i=e,e)))));return au(()=>i??a)})),e=>kA(e,e=>{let t,r=0,n=au(function n(){if(void 0===t)return aD(e,e=>{switch(e.length){case 0:return n();case 1:return aa(e[0]);default:return t=e,aa(e[r++])}});let i=t[r++];return r>=t.length&&(t=void 0,r=0),aa(i)});return aa(n)})),kK=((e,t)=>cK("function"==typeof t?t(Z):t).pipe(aq(t=>{let r=cD.defaultValue();return kK(_d(e,cD,al(()=>r)),e=>um(e)?ao(e.cause):t(e.value).pipe(aq(e=>{r=e}),c$(()=>uJ(e.value))))}),_r),(e,t)=>kI((r,n)=>al(()=>{let i,s=()=>{let a=oX(n);return aD(kO(e)(r,a),e=>i=od(e,e=>{let r=cF(e);return oK(a,r).pipe(aD(()=>t(r,n)),aD(s))}))};return au(()=>i??s())}))),kV=((e,t)=>kA(e,(e,r)=>aq(aq(cK(t),e=>t=>aq(e(t),e=>e.output)),t=>aF(e,t))),Y(2,(e,t)=>kI((r,n)=>aq(kO(e)(r,n),e=>aD(e,function r(n){return t(n)?aa(n):aD(e,r)}))))),kG=((e,t)=>kA(e,e=>aa(aD(e,function r(n){let i=[];for(let e=0;e<n.length;e++)t(n[e])&&i.push(n[e]);return n6(i)?aa(i):aD(e,r)}))),Y(e=>eS(e[0],kE),(e,t,r,n)=>kI((i,s)=>aq(kO(e)(i,s),e=>{let i,s,a=t(),o=0,l=oj(e,{onFailure(e){s=e;let t=n?.onHalt&&n.onHalt(a);return t&&t.length>0?aa([a,t]):ao(e)},onSuccess(e){let t=r(a,e);return iC(t)?aa(t):t}});return au(function e(){if(void 0===i)return s?ao(s):aD(l,([t,r])=>(a=t,0===r.length)?e():1===r.length?aa(r[0]):(i=r,e()));let t=i[o++];return o>=i.length&&(i=void 0,o=0),aa(t)})})))),kY=((e,t,r)=>kI((n,i)=>aq(kO(e)(n,i),e=>{let n=t,i=!0;return au(()=>i?(i=!1,aa(n)):aq(aD(e,e=>r(n,e)),e=>n=e))})),Y(2,(e,t)=>kI((r,n)=>{let i=oX(n);return aq(kO(e)(r,i),e=>{let s=e.pipe(od(e=>{if(cU(e))return ao(e);let a=i;return i=oX(n),oK(a,t0(e)).pipe(aR(kO(t(e))(r,i)),aD(e=>(s=e,e)))}));return au(()=>s)})}))),kZ=((e,t)=>kX(e,sF,t),Y(2,(e,t)=>kY(e,e=>kB(aD(t(e),t=>ao(e)))))),kX=((e,t,r)=>kY(e,e=>t(e)?r(e):kj(ao(e))),Y(3,(e,t,r)=>kY(e,e=>{let n=t(e);return rk(n)?kj(ao(n.failure)):r(n.success,e)}))),kQ=Y(2,(e,t)=>kX(e,sR,e=>t(e))),k0=Y(2,(e,t)=>kA(e,e=>aa(ob(e,e=>eS(e,re)?am:aL(t(e)))))),k1=Y(e=>eS(e[0],kE),(e,t,r,n)=>kQ(e,e=>t(e)?r(e):n?n(e):kU(e))),k2=Y(e=>eS(e[0],kE),(e,t,r,n)=>kQ(e,e=>{let i=t(e);return rk(i)?n?n(i.failure):kU(i.failure):r(i.success)})),k3=((e=>eS(e[0],kE),(e,t,r,n,i)=>kQ(e,e=>{if(ek(e,t)&&eS(e,"reason")){let t=e.reason;return ek(t,r)?n(t,e):i?i(t,e):kU(e)}return kU(e)})),Y(2,(e,t)=>kA(e,e=>aa(ok(e,e=>eS(e,re)?e:t(e)))))),k5=((e=>eS(e[0],kE),(e,t)=>{if(!t?.log)return kQ(e,()=>k$);let r=oE(t.log);return kQ(kZ(e,e=>e.reasons.some(tJ)?r(e):am),()=>k$)}),e=>kY(e,()=>k$)),k4=((e=>eS(e[0],kE),(e,t)=>{if(!t?.log)return k5(e);let r=oE(t.log);return k5(kZ(e,e=>r(e)))}),Y(2,(e,{bufferSize:t=16,concurrency:r,switch:n=!1})=>kT(aS(function*(i,s,a){let o="unbounded"===r?Number.MAX_SAFE_INTEGER:Math.max(1,r),l=n?void 0:kx(o),u=yield*al(()=>lW(!0)),c=new Map,d=yield*SQ(t);yield*oQ(a,X(S9(d)));let f=yield*kO(e)(i,s);return yield*dI(function*(){for(;;){let e;l&&(c.size<o?yield*l.take(1):(e=yield*lI(f),yield*az(l.take(1),aR(ar(e),ax))));let t=void 0===e?yield*f:yield*ar(e),r=oX(a),n=yield*kO(t)(i,r);for(;c.size>=o;){let[e,t]=io(c);c.delete(e),0===c.size&&(yield*u.open),yield*an(e),yield*oI(oK(t,aZ()))}let s=yield*n.pipe(aF(()=>ad),aD(e=>S0(d,e)),oc({disableYield:!0}),lr(aS(function*(e){let t=cF(e),n=yield*oF(oK(r,t));if(!c.has(s))return;let i=a6([t,n]);um(i)&&(yield*S5(d,i.cause)),c.delete(s),l&&(yield*l.release(1)),0===c.size&&(yield*u.open)})),lI);u.closeUnsafe(),c.set(s,r)}}).pipe(od(e=>r_(cP(e))?u.whenOpen(S5(d,e)):S5(d,e)),lT(a)),kt(d)})))),k6=Y(e=>eS(e[0],kE)&&eS(e[1],kE),(e,t,r)=>kT(aS(function*(n,i,s){let a=r?.haltStrategy??"both",o=yield*SQ(0);yield*oQ(s,X(S9(o)));let l=0;function u(e,t){if(l++,!cU(t))return S5(o,t);switch(a){case"both":return 2===l?S5(o,t):am;case"left":case"right":return e===a?S5(o,t):am;case"either":return S5(o,t)}}let c=(e,t,r)=>kO(t)(n,r).pipe(aD(e=>e.pipe(aD(e=>S0(o,e)),oc)),lr(t=>o8(cF(t),e=>oK(r,e)).pipe(oj({onFailure:t=>u(e,t),onSuccess:()=>u(e,t)}))),lT(s));return yield*c("left",e,oX(s)),yield*c("right",t,oX(s)),kt(o)}))),k8=Y(2,(e,t)=>k6(e,kB(t),{haltStrategy:"left"})),k9=Y(2,(e,t)=>kI((r,n)=>aD(kO(e)(r,n),e=>kO(t)(e,n)))),k7=((e,t)=>kI((r,n)=>aD(kO(e)(r,n),e=>aq(kO(t)(_e(e),n),_t))),e=>"Die"===e._tag&&eS(e.defect,re)&&tT(e.defect.value)),_e=e=>od(e,e=>cU(e)?ao(e):ah(rr(e))),_t=e=>od(e,e=>{let t;return ao((t=e).reasons.some(k7)?tB(t.reasons.flatMap(e=>k7(e)?e.defect.value.reasons:[e])):t)}),_r=e=>kI((t,r)=>{let n;return aa(au(()=>n||e.pipe(o5(r),aD(e=>kO(e)(t,r)),aD(e=>n=e))))}),_n=((e,t)=>kI(aS(function*(r,n){let i=yield*kO(e)(r,n),s=yield*SX({capacity:"unbounded"===t.capacity?void 0:t.capacity,strategy:"unbounded"===t.capacity?void 0:t.strategy});return yield*oQ(n,X(S9(s))),yield*i.pipe(aD(e=>S0(s,e)),oc({disableYield:!0}),lr(e=>S5(s,e)),lT(n)),kt(s)})),Y(2,(e,t)=>k6(e,kj(aa(aD(t,uJ))),{haltStrategy:"either"}))),_i=((e,t)=>kT(aS(function*(r,n,i){let s=yield*kO(e)(r,n),a=yield*lT(t,i,{startImmediately:!0});return au(()=>{let e=a.pollUnsafe();return void 0===e?s:a4(e,{onFailure:ao,onSuccess:uJ})})})),Y(2,(e,t)=>kT((r,n,i)=>oQ(i,t).pipe(aR(kO(e)(r,n)))))),_s=Y(2,(e,t)=>_r(aC(t,e))),_a=Y(2,(e,t)=>kA(e,e=>al(()=>{let r=!0,n=aF(e,e=>(r=!1,t(e)));return au(()=>r?n:e)}))),_o=((e,t)=>kA(e,e=>aa(c$(e,e=>aD(t,()=>uJ(e))))),Y(2,(e,t)=>_i(e,e=>t))),_l=(e,t,r)=>au(()=>{let n=o2(void 0,void 0);return c$(aD(kO(e)(uJ(),n),t),r||aa).pipe(o7(e=>oK(n,e)))}),_u=Y(2,(e,t)=>kI((r,n)=>aq(or(kO(e)(r,n),t),or(t)))),_c=Y(3,(e,t,r)=>kI((n,i)=>aq(on(kO(e)(n,i),t,r),on(t,r)))),_d=Y(3,(e,t,r)=>kI((n,i)=>aD(r,r=>kO(_c(e,t,r))(n,i)))),_f=Y(e=>eS(e[0],kE),(e,t,r)=>r8(t)?_u(e,t):kI((n,i)=>aD(r?.local?uN(t,uT(),i):uM(t,i),t=>aq(or(kO(e)(n,i),t),or(t))))),_h=Y(2,(e,t)=>kI((r,n)=>ot(i=>kO(_u(e,t(i)))(r,n)))),_p=Y(2,(e,t)=>_l(e,e=>oc(aD(e,t),{disableYield:!0}))),_m=((e,t)=>_l(e,e=>e.pipe(aD(t),aD(e=>e?am:uJ()),oc({disableYield:!0}))),e=>aq(_g(e,()=>({bytes:0,arrays:[]}),(e,t)=>{for(let r=0;r<t.length;r++)e.bytes+=t[r].length,e.arrays.push(t[r]);return e}),({arrays:e,bytes:t})=>{let r=new Uint8Array(t),n=0;for(let t=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r})),_g=Y(3,(e,t,r)=>au(()=>{let n=t();return _l(e,e=>lg({while:Q,body:()=>e,step:e=>{n=r(n,e)}}),()=>aa(n))}));(e,t,r)=>au(()=>{let n=t();return _l(e,e=>lg({while:Q,body:X(e.pipe(aD(e=>r(n,e)),aq(e=>{n=e}))),step:et}),()=>aa(n))});let _b=(e,t)=>kO(e)(uJ(),t),_y=Y(e=>eS(e[0],kE),(e,t)=>lp(r=>_p(e,e=>S2(t,e)).pipe(r,oF,aD(e=>("Success"===e._tag?S8(t):S4(t,e.cause),am)))));e=>eS(e[0],kE);let _v=e=>{let t,r,n,i;return dO("unbounded"===e.capacity?(t=e,Sg({atomicPubSub:()=>Sy(t),strategy:()=>new SH})):"dropping"===e.strategy?(r=e,Sg({atomicPubSub:()=>Sb(r),strategy:()=>new SH})):"sliding"===e.strategy?(n=e,Sg({atomicPubSub:()=>Sb(n),strategy:()=>new SJ})):(i=e,Sg({atomicPubSub:()=>Sb(i),strategy:()=>new SD})),Sv)},_x=Y(e=>eS(e[0],kE),(e,t,r)=>_p(e,e=>Sk(t,e)).pipe(r?.shutdownOnEnd===!0?le(Sv(t)):Z)),_w=Y(2,aS(function*(e,t){let r=yield*_v(t);return yield*_p(e,e=>SS(r,e)).pipe(o7(e=>Sx(r,e)),lO),r})),_S=function(e){this.channel=e};_S.prototype={"~effect/Stream":{_R:Z,_E:Z,_A:Z},pipe(){return K(this,arguments)}};let _k=((e,t)=>lp(r=>{let n;if("Closed"===e.state._tag)return lo;let i=e.state,s=s3(),a=dr(i.map,t);if("Some"===a._tag)n=a.value,n.refCount++;else{if(Number.isFinite(e.capacity)&&e.state.map.backing.size>=e.capacity)return t1(new l7(`RcMap attempted to exceed capacity of ${e.capacity}`));(n={deferred:ub(),scope:o2(void 0,void 0),idleTimeToLive:e.idleTimeToLive(t),finalizer:void 0,fiber:void 0,expiresAt:0,refCount:1}).finalizer=_E(e,t,n),da(i.map,t,n);let r=new Map(e.context.mapUnsafe);s.context.mapUnsafe.forEach((e,t)=>{r.set(t,e)}),r.set(oq.key,n.scope);let a=r4(r);au(()=>e.lookup(t)).pipe(lN(a),lM(n.scope)).addObserver(r=>{aQ(r)&&_k(e,t,n,a),uS(n.deferred,r)})}return oQ(ns(s.context,oq),X(n.finalizer)).pipe(aR(r(uy(n.deferred))))}),(e,t,r,n)=>{if("Closed"===e.state._tag)return;let i=dr(e.state.map,t);"None"===i._tag||i.value!==r||(du(e.state.map,t),r.refCount>0||__(r).pipe(oI({log:"Unhandled",message:"Unhandled error in RcMap finalizer"}),lN(n),lM(e.scope)))}),__=e=>e.fiber?an(e.fiber).pipe(aR(oK(e.scope,a0))):oK(e.scope,a0),_E=(e,t,r)=>t3(n=>{if(r.refCount--,r.refCount>0)return am;if("Closed"===e.state._tag)return __(r);let i=dr(e.state.map,t);if("None"===i._tag||i.value!==r)return __(r);if(nW(r.idleTimeToLive))return du(e.state.map,t),__(r);if(!nJ(r.idleTimeToLive))return am;let s=n.getRef(lZ);return r.expiresAt=s.currentTimeMillisUnsafe()+nX(r.idleTimeToLive),r.fiber||(r.fiber=lp(function n(i){let a=s.currentTimeMillisUnsafe(),o=r.expiresAt-a;if(o<=0){if("Closed"===e.state._tag||r.refCount>0)return am;let n=dr(e.state.map,t);return"None"===n._tag||n.value!==r?am:(du(e.state.map,t),oI(oK(r.scope,a0),{log:"Unhandled",message:"Unhandled error in RcMap finalizer"}))}return aD(i(s.sleep(nY(o))),()=>n(i))}).pipe(le(al(()=>{r.fiber=void 0})),lN(n.context),lM(e.scope))),am}),_C=((e,t)=>l2(r=>{if("Closed"===e.state._tag)return am;let n=dr(e.state.map,t);if("None"===n._tag||nW(n.value.idleTimeToLive))return am;let i=n.value;return i.expiresAt=r.currentTimeMillisUnsafe()+nX(i.idleTimeToLive),am}),{_tag:"Empty"}),_I=aa([void 0]),_A={"~effect/Sink":{_A:Z,_In:Z,_L:Z,_E:Z,_R:Z},pipe(){return K(this,arguments)}},_j=e=>{let t=Object.create(_A);return t.transform=e,t};(e,t)=>_T(e,([e,r])=>[t(e),r]),(e,t)=>_j((r,n)=>e.transform(aD(r,t),n));let _T=Y(2,(e,t)=>_j((r,n)=>aq(e.transform(r,n),t))),_O=(e,t)=>_j((r,n)=>t(e.transform(r,n))),_N=((e,t)=>_O(e,aD(t)),e=>new _S(e)),_M=(e,t)=>_N(kI((r,n)=>aD(_b(e.channel,n),e=>t(e,n)))),_$=e=>e.channel,_U=_N(k$),_B=e=>{let t=_N(kM(()=>e().channel));return _P.set(t,e),t},_P=new WeakMap,_R=e=>_N(kj(ao(tD(e)))),_F=e=>_N(_r(aq(ll(ot(t=>{let r,n,i,s,a,o,l=na(t,oq),u=oX(e.scope),c=(r=e.pubsub,n=e.subscribers,i=e.strategy,s=e.ended,new SR(r,n,r.subscribe(),Si(),lW(!1),St(!1),i,r.replayWindow(),s));return(o=u,a=c,oQ(o,X(ll(t3(e=>{let t;return Sr(a.shutdownFlag,!0),lb(Sd(t=a.pollers,t.length),t=>uw(t,e.id),{discard:!0,concurrency:"unbounded"}).pipe(aF(()=>al(()=>{a.subscribers.delete(a.subscription),a.subscription.unsubscribe(),a.replayWindow.close(),a.strategy.onPubSubEmptySpaceUnsafe(a.pubsub,a.subscribers)})),ou(a.shutdownHook.open),aL)}))))).pipe(aR(oQ(l,e=>oK(u,e))),aC(c))})),e=>kj(aa(aD(S_(e),k_)))))),_L=e=>_N(kI((t,r)=>{var n;let i,s,a,o;return i=(n={scope:r,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd}).readable.getReader(),s=n.exit??St(void 0),a=au(()=>s.current?s.current:oj(dC({try:()=>i.read(),catch:n.onError}),{onFailure:e=>s.current??ao(e),onSuccess:({done:e,value:t})=>s.current?s.current:e?uJ():aa(iH(t))})),aC((o=n.scope,oQ(o,X(n.releaseLockOnEnd?al(()=>i.releaseLock()):dE(()=>i.cancel().catch(e=>i.closed.then(()=>Promise.reject(e),et))).pipe(le(al(()=>i.releaseLock())))))),a)})),_z=Y(2,(e,t)=>_B(()=>{let r=0;return _N(kP(e.channel,iJ(e=>t(e,r++))))})),_D=Y(2,(e,t)=>_N(kP(e.channel,t))),_H=Y(e=>eS(e[0],"~effect/Stream"),(e,t,r)=>e.channel.pipe(kq,kL(t,r),kP(iH),_N)),_J=Y(2,(e,t)=>_N(kL(e.channel,t))),_W=((e=>eS(e[0],"~effect/Stream"),(e,t,r)=>_H(e,e=>aC(t(e),e),r)),Y(e=>eS(e[0],"~effect/Stream"),(e,t,r)=>e.channel.pipe(kq,kH(e=>t(e).channel,r),_N))),_q=((e=>eS(e[0],"~effect/Stream"),(e,t)=>_W(e,Z,t)),new WeakMap),_K=Y(e=>eS(e[0],"~effect/Stream")&&eS(e[1],"~effect/Stream"),(e,t,r)=>_N(k6(_$(e),_$(t),r))),_V=((e,t)=>e.channel.pipe(k8(t),_N),Y(3,(e,t,r)=>_N(kT(aS(function*(n,i){let s,a,o=yield*_b(e.channel,i),l=yield*_b(t.channel,i),u=dI(function*(){let e,t=yield*lT(o,i),r=yield*lT(l,i);return yield*(e=[t,r],av(t=>{let r=Array.from(e);if(0===r.length)return t(aa(iD()));let n=Array(r.length),i=iD(),s=()=>{for(let e=0;e<i.length;e++)r[e].removeObserver(i[e])},a=0,o=!1;for(let e=0;e<r.length&&!o;e++){let l=i=>{if(a++,"Failure"===i._tag)return o=!0,s(),t(i);n[e]=i.value,a===r.length&&t(aa(n))};i.push(l),r[e].addObserver(l)}return al(()=>{o=!0,s()})}))});return dI(function*(){let[e,t]=s?[s,a??(yield*l)]:a?[(yield*o),a]:yield*u,[n,i,c]=r(e,t);return s=n6(i)?i:void 0,a=n6(c)?c:void 0,n})}))))),_G=(e=>eS(e[0],"~effect/Stream"),Y(2,(e,t)=>e.channel.pipe(kY(e=>t(e).channel),_N))),_Y=((e,t)=>e.channel.pipe(kZ(t),_N),Y(2,(e,t)=>_N(kQ(e.channel,e=>t(e).channel)))),_Z=((e,t)=>e.channel.pipe(k0(t),_N),Y(e=>eS(e[0],"~effect/Stream"),(e,t,r,n)=>_N(k1(_$(e),t,e=>r(e).channel,n&&(e=>n(e).channel))))),_X=((e=>eS(e[0],"~effect/Stream"),(e,t,r,n)=>_N(k2(_$(e),t,e=>r(e).channel,n&&(e=>n(e).channel)))),Y(2,(e,t)=>_N(k3(e.channel,t)))),_Q=((e=>eS(e[0],"~effect/Stream"),(e,t,r)=>_M(e,(e,n)=>al(()=>{let n=0,i=!1;return aD(au(()=>i?uJ():e),e=>{let s=e.findIndex(e=>t(e,n++));if(s>=0){i=!0;let t=e.slice(0,r?.excludeLast?s:s+1);return n6(t)?aa(t):uJ()}return aa(e)})}))),iD()),_0=((e,t)=>{let r=t.burst??0;return"enforce"===t.strategy?_0(e,t.cost,t.units,t.duration,r):_1(e,t.cost,t.units,t.duration,r)},(e,t,r,n,i)=>_M(e,e=>l2(s=>{let a=nX(n$(n)),o=r+i<0?1/0:r+i,l=r,u=s.currentTimeMillisUnsafe();return aa(aD(e,function n(i){return aD(t(i),t=>{let c=s.currentTimeMillisUnsafe(),d=l+(c-u)/a*r,f=d<0?o:Math.min(d,o);return t<=f?(l=f-t,u=c,aa(i)):aD(e,n)})}))}))),_1=(e,t,r,n,i)=>_M(e,e=>l2(s=>{let a=nX(n$(n)),o=r+i<0?1/0:r+i,l=r,u=s.monotonicTimeNanosUnsafe();return aa(aD(e,e=>aD(t(e),t=>{let n=s.monotonicTimeNanosUnsafe(),i=Number(n-u)/1e6,c=Math.min(l+i/a*r,o)-t;if(c>=0)return l=c,u=n,aa(e);let d=Math.max(0,-c/r*a);return d>0?aD(l3(d),()=>(l=c,u=n,aa(e))):(l=c,u=n,aa(e))})))})),_2=((e,t,r)=>_N(kT(aS(function*(n,i,s){let a,o=yield*_b(e.channel,i),l=lW(!1),u=Symbol(),c=yield*SX({capacity:0});yield*o.pipe(l.whenOpen,aD(e=>(l.closeUnsafe(),S0(c,e))),oc,od(e=>S5(c,e)),lT(s));let d=yield*lZ,f=yield*cq(r),h=lW(!1),p=d.currentTimeMillisUnsafe(),m=0,g=rm,b=e=>(h.openUnsafe()&&(m=d.currentTimeMillisUnsafe()),aa(e)),y=h.await.pipe(aD(()=>f(p,g)),aD(([,e])=>l3(e)),aD(()=>S0(c,u)),c$(()=>S6(c)),aD(()=>ax)),v=au(()=>{if(void 0!==a){let e=a;return a=void 0,b(e)}return"Open"===c.state._tag&&l.openUnsafe(),aD(kt(c),e=>e===u?uJ():b(e))}),x=aD(([e,t])=>{if(h.isOpen())p+=d.currentTimeMillisUnsafe()-m;else if("Done"===c.state._tag)return uJ();return g=rb(e),a=t,aa(iH(e))});return au(()=>{if("Done"===c.state._tag&&void 0===a)return c.state.exit;h.closeUnsafe();let e=x(au(()=>_7(t,v,s)));return"Open"===c.state._tag?az(e,y):e})}))),Y(2,(e,t)=>_N(k9(e.channel,t)))),_3=Y(e=>eS(e[0],"~effect/Stream"),(e,t)=>{let r;return e.channel.pipe(k9((r=t?.encoding,kI((e,t)=>al(()=>{let t=new TextDecoder(r,void 0),n={stream:!0},i=e.pipe(aq(iJ(e=>t.decode(e,n))),c$(e=>{i=uJ(e);let r=t.decode();return r.length>0?aa(iH(r)):i}));return au(()=>i)})))),_N)}),_5=((e,t)=>_D(e,(e,r)=>{let n=0===r?[]:[t],i=e.length-1;for(let r=0;r<e.length;r++)r===i?n.push(e[r]):n.push(e[r],t);return n}),Y(2,(e,t)=>_N(_n(e.channel,t)))),_4=((e,t)=>_N(_i(e.channel,t)),Y(2,(e,t)=>_N(_o(e.channel,t)))),_6=((e=>eS(e[0],"~effect/Stream"),(e,t,r)=>_N(_f(e.channel,t,r))),Y(2,(e,t)=>_N(_u(e.channel,t)))),_8=Y(3,(e,t,r)=>_N(_d(e.channel,t,r))),_9=((e,t)=>_N(_h(e.channel,t)),Y(2,(e,t)=>o4(r=>_b(e.channel,r).pipe(aD(e=>_7(t,e,r)),aq(([e])=>e))))),_7=(e,t,r)=>_t(e.transform(_e(t),r)),Ee=Y(2,(e,t)=>_p(e.channel,e=>{let r=0;return lg({while:()=>r<e.length,body:()=>t(e[r++]),step:et})})),Et=Y(e=>eS(e[0],"~effect/Stream"),(e,t,r)=>{let n,i,s=!1,a=lW(!1),o=r?.signal,l=()=>i.interruptUnsafe();return new ReadableStream({start(r){(i=l$(or(_p(kA(e.channel,e=>aa(a.whenOpen(e))),e=>al(()=>{a.closeUnsafe();for(let t=0;t<e.length;t++)r.enqueue(e[t]);n(),n=void 0})),t))).addObserver(e=>{o?.removeEventListener("abort",l),s||("Failure"===e._tag&&o?.aborted!==!0?r.error(sD(e.cause)):r.close())}),void 0!==o&&void 0===i.pollUnsafe()&&(o.aborted?l():o.addEventListener("abort",l,{once:!0}))},pull:()=>new Promise(e=>{n=e,a.openUnsafe()}),cancel(){if(i)return s=!0,lR(aL(an(i)))}},r?.strategy)}),Er=Y(e=>eS(e[0],"~effect/Stream"),(e,t)=>Et(e,r7,t)),En=Y(e=>eS(e[0],"~effect/Stream"),(e,t)=>aq(a7(),r=>Et(e,r,t))),Ei=Y(2,(e,t)=>_w(e.channel,t)),Es=(e,t)=>[e.codePointAt(0),t.codePointAt(0)],Ea={alnum:[...Es("0","9"),...Es("A","Z"),...Es("a","z")],alpha:[...Es("A","Z"),...Es("a","z")],blank:[9,9,32,32],cntrl:[0,31,127,127],digit:Es("0","9"),graph:[33,126],lower:Es("a","z"),print:[32,126],punct:[33,47,58,64,91,96,123,126],space:[9,13,32,32],upper:Es("A","Z"),word:[...Es("0","9"),...Es("A","Z"),95,95,...Es("a","z")],xdigit:[...Es("0","9"),...Es("A","F"),...Es("a","f")]},Eo=(e,t,r,n,i)=>{if(i>64)return;let s=[],a="";for(let o=t;o<r;o++){let t=n.get(o);if(void 0===t){"\\"===e[o]&&o+1<r&&(a+=e[o++]),a+=e[o];continue}let l=[],u=o+1;for(let r of[...t.commas,t.close]){let t=Eo(e,u,r,n,i+1);if(void 0===t)return;l.push(t),u=r+1}""!==a&&(s.push(a),a=""),s.push(l),o=t.close}return""!==a&&s.push(a),s},El=e=>{let t=1;for(let r of e)if("string"!=typeof r){let e=0;for(let t of r)e+=El(t);if((t*=e)>1e4)return 1/0}return t},Eu=e=>{let t=[""];for(let r of e)if("string"==typeof r)t=t.map(e=>e+r);else{let e=r.flatMap(Eu);t=t.flatMap(t=>e.map(e=>t+e))}return t},Ec="~effect/PlatformError";class Ed extends i9("BadArgument"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:""}`}}class Ef extends i9("PlatformError"){constructor(e){"cause"in e?super({reason:e,cause:e.cause}):super({reason:e})}[Ec]=Ec;get message(){return this.reason.message}}let Eh=e=>new Ef(new Ed(e)),Ep=rV("effect/FileSystem"),Em="~effect/http/HttpBody";class Eg{[Em];constructor(){this[Em]=Em}[ta](){return this.toJSON()}toString(){return te(this,{ignoreToString:!0})}}let Eb=new class extends Eg{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}};class Ey extends Eg{_tag="Uint8Array";contentType;contentLength;text;_body;constructor(e,t,r,n){super(),this._body=e,this.text=n,this.contentType=t,this.contentLength=r}get body(){return this._body??=Ew(this.text)}toJSON(){return{_id:"effect/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}let Ev=new TextEncoder,Ex=globalThis.Buffer,Ew=void 0!==Ex?e=>Ex.from(e,"utf8"):e=>Ev.encode(e),ES=(e,t)=>{if("string"!=typeof e&&(e=void 0===e?"":String(e)),void 0!==Ex)return new Ey(void 0,t??"text/plain",Ex.byteLength(e,"utf8"),e);let r=Ev.encode(e);return new Ey(r,t??"text/plain",r.length,e)};class Ek extends Eg{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(e){super(),this.formData=e}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}class E_ extends Eg{_tag="Stream";stream;contentType;contentLength;constructor(e,t,r){super(),this.stream=e,this.contentType=t,this.contentLength=r}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}let EE=(e,t,r)=>new E_(e,t??"application/octet-stream",r),EC=(e,t,r)=>{let n=fT(e);return rp(n)?aa(n.value):t1(Eh({module:"HttpBody",method:r,description:`Invalid ${t}: ${e}`}))},EI=e=>{switch(e._tag){case"Weak":return`W/"${e.value}"`;case"Strong":return`"${e.value}"`}};class EA extends(rV())("effect/http/Etag/Generator"){}let Ej="~effect/ErrorReporter/ignore",ET="~effect/http/HttpClientError";class EO extends i9("HttpClientError"){constructor(e){"cause"in e.reason?super({...e,cause:e.reason.cause}):super(e)}[ET]=ET;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}let EN=e=>e.endsWith("Error")?e.slice(0,-5):e,EM=(e,t,r)=>t?`${e}: ${t} (${r})`:`${e} error (${r})`,E$=e=>`${e.method} ${mx(e.url)}`,EU=(e,t)=>({...t,request:{_id:"HttpClientRequest",method:e.request.method,url:mx(e.request.url)},..."response"in e?{response:{_id:"HttpClientResponse",status:e.response.status}}:void 0});class EB extends i9("TransportError"){get methodAndUrl(){return E$(this.request)}get message(){return EM(EN(this._tag),this.description,this.methodAndUrl)}toJSON(){return EU(this,super.toJSON())}}class EP extends i9("EncodeError"){get methodAndUrl(){return E$(this.request)}get message(){return EM(EN(this._tag),this.description,this.methodAndUrl)}toJSON(){return EU(this,super.toJSON())}}class ER extends i9("InvalidUrlError"){get methodAndUrl(){return E$(this.request)}get message(){return EM(EN(this._tag),this.description,this.methodAndUrl)}toJSON(){return EU(this,super.toJSON())}}class EF extends i9("StatusCodeError"){get methodAndUrl(){return E$(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return EM(EN(this._tag),this.description,e)}toJSON(){return EU(this,super.toJSON())}}class EL extends i9("DecodeError"){get methodAndUrl(){return E$(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return EM(EN(this._tag),this.description,e)}toJSON(){return EU(this,super.toJSON())}}class Ez extends i9("EmptyBodyError"){get methodAndUrl(){return E$(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return EM(EN(this._tag),this.description,e)}toJSON(){return EU(this,super.toJSON())}}let ED=(e,t)=>"Empty"===t._tag||"FormData"===t._tag?p1(p1(e,"content-type"),"content-length"):EH(e=void 0===t.contentType?p1(e,"content-type"):pX(e,"content-type",t.contentType),t),EH=(e,t)=>{let r="Empty"===t._tag||"FormData"===t._tag?void 0:t.contentLength;return void 0===r?p1(e,"content-length"):pX(e,"content-length",r.toString())};class EJ extends i9("UrlError"){}let EW=(e,t,r)=>n7({try:()=>{let n=new URL(e,Eq());for(let e=0;e<t.params.length;e++){let[r,i]=t.params[e];void 0!==i&&n.searchParams.append(r,p7(i))}return void 0!==r&&(n.hash=r),n},catch:e=>new EJ({cause:e})}),Eq=()=>{if("location"in globalThis&&void 0!==globalThis.location&&void 0!==globalThis.location.origin&&void 0!==globalThis.location.pathname){let e=location.origin+location.pathname;try{return new URL(e).href}catch{}}},EK=((e,t)=>{let r=new URL(e);return t(r),r},"~effect/http/HttpClientRequest"),EV={[EK]:EK,...tl,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:mx(this.url),urlParams:this.urlParams,hash:this.hash,headers:e4(this.headers),body:this.body.toJSON()}},pipe(){return K(this,arguments)}};function EG(e,t,r,n,i,s){let a=Object.create(EV);return a.method=e,a.url=t,a.urlParams=r,a.hash=n,a.headers=i,a.body=s,a}let EY=EG("GET","",mf,rm,pY,Eb),EZ=e=>(t,r)=>EX(EY,{method:e,url:t,...r??void 0}),EX=Y(2,(e,t)=>{let r=e;return t.method&&(r=EQ(r,t.method)),t.url&&(r=E6(r,t.url)),t.headers&&(r=E1(r,t.headers)),t.urlParams&&(r=E7(r,t.urlParams)),t.hash&&(r=Ct(r,t.hash)),t.body&&(r=Cr(r,t.body)),t.accept&&(r=E3(r,t.accept)),t.acceptJson&&(r=E5(r)),r}),EQ=Y(2,(e,t)=>EG(t,e.url,e.urlParams,e.hash,e.headers,e.body)),E0=Y(3,(e,t,r)=>EG(e.method,e.url,e.urlParams,e.hash,pX(e.headers,t,r),e.body)),E1=Y(2,(e,t)=>EG(e.method,e.url,e.urlParams,e.hash,pQ(e.headers,t),e.body)),E2=Y(2,(e,t)=>EG(e.method,e.url,e.urlParams,e.hash,t(e.headers),e.body)),E3=((e,t)=>E2(e,p1(t)),Y(2,(e,t)=>E0(e,"Accept",t))),E5=E3("application/json"),E4=Y(2,(e,t)=>EG(e.method,e.url,e.urlParams,e.hash,pX(pX(e.headers,"connection","Upgrade"),"upgrade",t),e.body)),E6=Y(2,(e,t)=>{let r;if("string"==typeof t)return EG(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),i=mo(n.searchParams),s=null==(r=""===n.hash?void 0:n.hash.slice(1))?rm:rb(r);return n.search="",n.hash="",EG(e.method,n.toString(),i,s,e.headers,e.body)}),E8=Y(2,(e,t)=>""===t?e:EG(e.method,E9(t,e.url),e.urlParams,e.hash,e.headers,e.body)),E9=(e,t)=>{let r=e.endsWith("/"),n=t.startsWith("/");return r&&n?e+t.slice(1):r||n?e+t:e+"/"+t},E7=Y(2,(e,t)=>EG(e.method,e.url,mm(e.urlParams,t),e.hash,e.headers,e.body)),Ce=Y(2,(e,t)=>EG(e.method,e.url,mg(e.urlParams,t),e.hash,e.headers,e.body)),Ct=Y(2,(e,t)=>EG(e.method,e.url,e.urlParams,rb(t),e.headers,e.body)),Cr=Y(2,(e,t)=>EG(e.method,e.url,e.urlParams,e.hash,ED(e.headers,t),t)),Cn=Y(2,(e,t)=>Cr(e,new Ek(t)));function Ci(e){let t=EW(e.url,e.urlParams,rz(e.hash));return r_(t)?rb(t.success):rm}let Cs="~effect/http/HttpIncomingMessage",Ca=rV("effect/http/HttpIncomingMessage/MaxBodySize",{defaultValue:()=>void 0}),Co=(e,t)=>({...t,headers:e4(e.headers),remoteAddress:e.remoteAddress}),Cl="~effect/http/HttpClientResponse/WebSource",Cu="~effect/http/HttpClientResponse";(e,t)=>au(()=>t(e.status)?aa(e):t1(new EO({reason:new EF({response:e,request:e.request,description:"invalid status code"})})));class Cc extends tu{[Cs];[Cu];request;source;constructor(e,t){super(),this.request=e,this.source=t,this[Cs]=Cs,this[Cu]=Cu}toJSON(){return Co(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get url(){if(this.source.url)return this.source.url.split("#")[0];let e=Ci(this.request);return rh(e)?"":(e.value.hash="",e.value.href)}get headers(){return pZ(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=(e=>{let t=[];for(let r of"string"==typeof e?[e]:e){let e=function(e){let t=e.split(";").map(e=>e.trim()).filter(e=>""!==e);if(0===t.length)return;let r=t[0].indexOf("=");if(-1===r)return;let n=t[0].slice(0,r).replace(pS,"");if(!pw.test(n))return;let i=t[0].slice(r+1).replace(pS,""),s=pF(i);if(1===t.length)return Object.assign(Object.create(pC),{name:n,value:s,valueEncoded:i});let a={};for(let e=1;e<t.length;e++){let r=t[e],n=r.indexOf("="),i=-1===n?r:r.slice(0,n).trim(),s=-1===n?void 0:r.slice(n+1).trim();switch(i.toLowerCase()){case"domain":{if(void 0===s)break;let e=s.trim().replace(/^\./,"");e&&(a.domain=e);break}case"expires":{if(void 0===s)break;let e=new Date(s);isNaN(e.getTime())||(a.expires=e);break}case"max-age":if(void 0===s||!pk.test(s))break;a.maxAge=nZ(parseInt(s,10));break;case"path":if(void 0===s)break;"/"===s[0]&&(a.path=s);break;case"priority":if(void 0===s)break;switch(s.toLowerCase()){case"low":a.priority="low";break;case"medium":a.priority="medium";break;case"high":a.priority="high"}break;case"httponly":a.httpOnly=!0;break;case"secure":a.secure=!0;break;case"partitioned":a.partitioned=!0;break;case"samesite":if(void 0===s)break;switch(s.toLowerCase()){case"lax":a.sameSite="lax";break;case"strict":a.sameSite="strict";break;case"none":a.sameSite="none"}}}return Object.assign(Object.create(pC),{name:n,value:s,valueEncoded:i,options:Object.keys(a).length>0?a:void 0})}(r.trim());e&&t.push(e)}return py(t)})(this.source.headers.getSetCookie?.()??[])}get remoteAddress(){return rm}[Cl](){return this.source}get stream(){return this.source.body?_L({evaluate:()=>this.source.body,onError:e=>new EO({reason:new EL({request:this.request,response:this,cause:e})})}):_N(kU(new EO({reason:new Ez({request:this.request,response:this,description:"can not create stream from empty body"})})))}get json(){return aD(this.text,e=>ag({try:()=>""===e?null:JSON.parse(e),catch:e=>new EO({reason:new EL({request:this.request,response:this,cause:e})})}))}textBody;get text(){return this.textBody??=aq(this.arrayBuffer,e=>new TextDecoder().decode(e))}get urlParamsBody(){return aD(this.arrayBuffer,e=>ag({try:()=>mo(mt(e)),catch:e=>new EO({reason:new EL({request:this.request,response:this,cause:e})})}))}formDataBody;get formData(){return this.formDataBody??=dC({try:()=>this.source.formData(),catch:e=>new EO({reason:new EL({request:this.request,response:this,cause:e})})}).pipe(dN,lz)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody||(this.arrayBufferBody=dC({try:()=>this.source.arrayBuffer(),catch:e=>new EO({reason:new EL({request:this.request,response:this,cause:e})})}).pipe(dN,lz)),this.arrayBufferBody}get upgrade(){return t1(new EO({reason:new EF({request:this.request,response:this,description:"fetch cannot hand over the connection of an HTTP upgrade"})}))}pipe(){return K(this,arguments)}}let Cd=Object.getPrototypeOf(pY),Cf="~effect/http/HttpServerResponse",Ch=e=>Cy({status:e?.status??204,statusText:e?.statusText,headers:e?.headers?pZ(e.headers):void 0,cookies:e?.cookies}),Cp=Y(2,(e,t)=>Cy({...e,headers:p1(e.headers,t)})),Cm=Y(2,(e,t)=>Cy(e,pQ(e.headers,t))),Cg=Y(2,(e,t)=>Cy({...e,body:t},ED(e.headers,t))),Cb={...tE,[Cf]:Cf,[Ej]:!0,toJSON(){return{_id:"HttpServerResponse",status:this.status,statusText:this.statusText,headers:e4(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},Cy=(e,t)=>{let r=Object.create(Cb);if(r.status=e.status,r.statusText=e.statusText,r.cookies=e.cookies??pv,r.body=e.body??Eb,"Empty"!==r.body._tag&&(r.body.contentType||void 0!==r.body.contentLength)){let n=void 0!==t,i=n?t:void 0===e.headers||e.headers===pY?Object.create(Cd):Object.setPrototypeOf({...e.headers},pK);r.body.contentType&&(!n||void 0===i["content-type"])&&(i["content-type"]=r.body.contentType),void 0===r.body.contentLength||n&&void 0!==i["content-length"]||(i["content-length"]=r.body.contentLength.toString()),r.headers=i}else r.headers=t??e.headers??pY;return r},Cv=(new Set((S={algorithms:["gzip","deflate"],transform:e=>{let t;return t=e,e=>e.pipeThrough(new CompressionStream(t))}}).algorithms),{"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/x-python":["py"],"text/x-shellscript":["sh"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]});Object.freeze(Cv);class Cx extends(rV())("effect/http/HttpPlatform"){}let Cw=e=>{let t=e?.headers?pZ(e.headers):pY;return e?.contentType?pX(t,"content-type",e.contentType):t},CS=(e,t)=>{let r=fT(e);return rp(r)?aa(r.value):t1(Eh({module:"HttpPlatform",method:"fileResponse",description:`Invalid ${t}: ${e}`}))},Ck=(e,t)=>{let r=Number(e);return Number.isSafeInteger(r)?aa(r):t1(Eh({module:"HttpPlatform",method:"fileResponse",description:`${t} exceeds the safe integer range: ${e}`}))},C_="~effect/http/HttpServerRespondable",CE=Ch({status:400}),CC=Ch({status:404}),CI="~effect/http/HttpServerError";class CA extends i9("HttpServerError"){constructor(e){"cause"in e.reason?super({...e,cause:e.reason.cause}):super(e)}[CI]=CI;stack=`${this.name}: ${this.message}`;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}[C_](){return this.reason[C_]()}get[Ej](){return this.reason[Ej]??!1}get message(){return this.reason.message}}class Cj extends i9("RequestParseError"){[C_](){return aa(Ch({status:"BodyTooLarge"===this.reason?413:400}))}get methodAndUrl(){return CN(this.request)}get message(){return CM(this._tag,this.description,this.methodAndUrl)}}class CT extends i9("ResponseError"){[C_](){return aa(Ch({status:500}))}get methodAndUrl(){return CN(this.request)}get message(){let e=`${this._tag} (${this.response.status} ${this.methodAndUrl})`;return this.description?`${e}: ${this.description}`:e}}class CO extends(rV())("effect/http/HttpServerError/ClientAbort"){static annotation=(this.context(!0)).pipe(nt(uW,{name:"ClientAbort",stack:et,parent:void 0}))}let CN=e=>`${e.method} ${(e=>{if("*"===e||mr.test(e)){var t;let r,n;return r=(t=e).indexOf("?"),n=t.indexOf("#"),-1===r?-1===n?t:t.slice(0,n):-1===n?t.slice(0,r):t.slice(0,Math.min(r,n))}try{return new URL(e,"http://localhost").pathname}catch{return"<invalid URL>"}})(e.url)}`,CM=(e,t,r)=>{let n=`${e} (${r})`;return t?`${n}: ${t}`:n},C$=Ch({status:500}),CU=aa(C$),CB=aa(Ch({status:499})),CP=aa(Ch({status:503})),CR="~effect/socket/Socket",CF=rV("effect/socket/Socket"),CL=new TextEncoder,Cz="~effect/socket/Socket/SocketError";class CD extends(wk("effect/socket/Socket/SocketReadError"))({_tag:xQ("SocketReadError"),cause:wn()}){message="An error occurred during Read"}class CH extends(wk("effect/socket/Socket/SocketWriteError"))({_tag:xQ("SocketWriteError"),cause:wn()}){message="An error occurred during Write"}class CJ extends(wk("effect/socket/Socket/SocketOpenError"))({_tag:xQ("SocketOpenError"),kind:xG(["Unknown","Timeout"]),cause:wn()}){get message(){return"Timeout"===this.kind?'timeout waiting for "open"':"An error occurred during Open"}}class CW extends(wk("effect/socket/Socket/SocketUpgradeError"))({_tag:xQ("SocketUpgradeError"),cause:xM(wn())}){static unsupported=()=>t1(new CV({reason:new CW({})}));get message(){return void 0===this.cause?"Socket does not support TLS upgrade":"An error occurred during TLS upgrade"}}class Cq extends(wk("effect/socket/Socket/SocketCloseError"))({_tag:xQ("SocketCloseError"),code:x7,closeReason:xM(xF)}){get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}let CK=xV([CD,CH,CJ,CW,Cq]);class CV extends(w_(Cz))("SocketError",{_tag:xQ("SocketError"),reason:CK}){constructor(e){"cause"in e.reason?super({...e,cause:e.reason.cause}):super(e)}[Cz]=Cz;static is(e){return eS(e,Cz)}message=this.reason.message}let CG="~effect/Path",CY=rV("effect/Path");function CZ(e,t){let r,n="",i=0,s=-1,a=0;for(let o=0;o<=e.length;++o){if(o<e.length)r=e.charCodeAt(o);else if(47===r)break;else r=47;if(47===r){if(s===o-1||1===a);else if(s!==o-1&&2===a){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){let e=n.lastIndexOf("/");if(e!==n.length-1){-1===e?(n="",i=0):i=(n=n.slice(0,e)).length-1-n.lastIndexOf("/"),s=o,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,s=o,a=0;continue}}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),i=o-s-1;s=o,a=0}else 46===r&&-1!==a?++a:a=-1}return n}let CX=function(){let e,t="",r=!1;for(let n=arguments.length-1;n>=-1&&!r;n--){let i;if(n>=0)i=arguments[n];else{let t=globalThis.process;void 0===e&&"process"in globalThis&&"object"==typeof t&&null!==t&&"function"==typeof t.cwd&&(e=t.cwd()),i=e}0!==i.length&&(t=i+"/"+t,r=47===i.charCodeAt(0))}if(t=CZ(t,!r),r)if(t.length>0)return"/"+t;else return"/";return t.length>0?t:"."},CQ=/%/g,C0=/\\/g,C1=/\n/g,C2=/\r/g,C3=/\t/g,C5=(k={resolve:CX,normalize(e){if(0===e.length)return".";let t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return(0!==(e=CZ(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t)?"/"+e:e},isAbsolute:e=>e.length>0&&47===e.charCodeAt(0),join(){let e;if(0==arguments.length)return".";for(let t=0;t<arguments.length;++t){let r=arguments[t];r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":C5.normalize(e)},relative(e,t){if(e===t||(e=C5.resolve(e),t=C5.resolve(t),e===t))return"";let r=1;for(;r<e.length&&47===e.charCodeAt(r);++r);let n=e.length,i=n-r,s=1;for(;s<t.length&&47===t.charCodeAt(s);++s);let a=t.length-s,o=i<a?i:a,l=-1,u=0;for(;u<=o;++u){if(u===o){if(a>o){if(47===t.charCodeAt(s+u))return t.slice(s+u+1);else if(0===u)return t.slice(s+u)}else i>o&&(47===e.charCodeAt(r+u)?l=u:0===u&&(l=0));break}let n=e.charCodeAt(r+u);if(n!==t.charCodeAt(s+u))break;47===n&&(l=u)}let c="";for(u=r+l+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===c.length?c+="..":c+="/..");return c.length>0?c+t.slice(s+l):(s+=l,47===t.charCodeAt(s)&&++s,t.slice(s))},dirname(e){if(0===e.length)return".";let t=e.charCodeAt(0),r=47===t,n=-1,i=!0;for(let r=e.length-1;r>=1;--r)if(47===(t=e.charCodeAt(r))){if(!i){n=r;break}}else i=!1;return -1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename(e,t){let r,n=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let a=t.length-1,o=-1;for(r=e.length-1;r>=0;--r){let l=e.charCodeAt(r);if(47===l){if(!s){n=r+1;break}}else -1===o&&(s=!1,o=r+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=o))}return n===i?i=o:-1===i&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){n=r+1;break}}else -1===i&&(s=!1,i=r+1);return -1===i?"":e.slice(n,i)},extname(e){let t=-1,r=0,n=-1,i=!0,s=0;for(let a=e.length-1;a>=0;--a){let o=e.charCodeAt(a);if(47===o){if(!i){r=a+1;break}continue}-1===n&&(i=!1,n=a+1),46===o?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1)}return -1===t||-1===n||0===s||1===s&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){var t;let r,n;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return r=e.dir||e.root,n=e.base||(e.name||"")+((t=e.ext)?t.startsWith(".")?t:`.${t}`:""),r?r===e.root?r+n:r+"/"+n:n},parse(e){let t,r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;let n=e.charCodeAt(0),i=47===n;i?(r.root="/",t=1):t=0;let s=-1,a=0,o=-1,l=!0,u=e.length-1,c=0;for(;u>=t;--u){if(47===(n=e.charCodeAt(u))){if(!l){a=u+1;break}continue}-1===o&&(l=!1,o=u+1),46===n?-1===s?s=u:1!==c&&(c=1):-1!==s&&(c=-1)}return -1===s||-1===o||0===c||1===c&&s===o-1&&s===a+1?-1!==o&&(0===a&&i?r.base=r.name=e.slice(1,o):r.base=r.name=e.slice(a,o)):(0===a&&i?(r.name=e.slice(1,s),r.base=e.slice(1,o)):(r.name=e.slice(a,s),r.base=e.slice(a,o)),r.ext=e.slice(s,o)),a>0?r.dir=e.slice(0,a-1):i&&(r.dir="/"),r},sep:"/",fromFileUrl:function(e){if("file:"!==e.protocol)return t1(new Ed({module:"Path",method:"fromFileUrl",description:"URL must be of scheme file"}));if(""!==e.hostname)return t1(new Ed({module:"Path",method:"fromFileUrl",description:"Invalid file URL host"}));let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)return t1(new Ed({module:"Path",method:"fromFileUrl",description:"must not include encoded / characters"}))}return ag({try:()=>decodeURIComponent(t),catch:e=>new Ed({module:"Path",method:"fromFileUrl",cause:e})})},toFileUrl:function(e){var t;let r=new URL("file://"),n=CX(e);return 47===e.charCodeAt(e.length-1)&&"/"!==n[n.length-1]&&(n+="/"),(t=n).includes("%")&&(t=t.replace(CQ,"%25")),t.includes("\\")&&(t=t.replace(C0,"%5C")),t.includes("\n")&&(t=t.replace(C1,"%0A")),t.includes("\r")&&(t=t.replace(C2,"%0D")),t.includes(" ")&&(t=t.replace(C3,"%09")),r.pathname=t,aa(r)},toNamespacedPath:Z},CY.of({...k,[CG]:CG,resolveWithin(e,t){if(""!==k.parse(t).root)return rm;let r=k.resolve(e),n=k.resolve(r,t),i=k.relative(r,n);return".."===i||i.startsWith(`..${k.sep}`)||k.isAbsolute(i)?rm:rb(n)}})),C4={value:"",parameters:Object.create(null)},C6={...C4,filename:void 0},C8=new Uint8Array(256);for(let e of"!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")C8[e.charCodeAt(0)]=1;let C9=new Uint8Array(256);C9[9]=1;for(let e=32;e<=126;e++)C9[e]=1;for(let e=128;e<=255;e++)C9[e]=1;let C7=new TextDecoder("utf-8"),Ie="~effect/http/Multipart",It="~effect/http/Multipart/MultipartError";class Ir extends i8{}let In={FileTooLarge:413,FieldTooLarge:413,BodyTooLarge:413,TooManyParts:413,InternalError:500,Parse:400};class Ii extends i9("MultipartError"){static fromReason(e,t){return new Ii({reason:new Ir({_tag:e,cause:t})})}[It]=It;[Ej]=!0;[C_](){return aa(Ch({status:In[this.reason._tag]}))}get message(){return this.reason._tag}}class Is extends tu{[Ie];constructor(){super(),this[Ie]=Ie}}class Ia extends tu{[Ie];_tag="Field";contentType="text/plain";key;value;constructor(e,t){super(),this[Ie]=Ie,this.key=e,this.value=t}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class Io extends tu{[Ie];_tag="File";key;name;contentType;content;contentEffect;constructor(e,t){super(),this[Ie]=Ie,this.key=e,this.name=t.name,this.contentType=t.type,this.content=_L({evaluate:()=>t.stream(),onError:e=>Ii.fromReason("InternalError",e)}),this.contentEffect=dC({try:()=>t.arrayBuffer().then(e=>new Uint8Array(e)),catch:e=>Ii.fromReason("InternalError",e)})}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}e=>"u">typeof ReadableStream&&e instanceof ReadableStream;let Il=rV("effect/http/HttpEffect/CurrentRequestState"),Iu={"http:":80,"https:":443,"ws:":80,"wss:":443},Ic=(e,t,r)=>{let n=mx(t.search,r).slice(1);if(e.attribute("url.full",mx(t.href,r)),e.attribute("url.path",t.pathname),""!==n&&e.attribute("url.query",n),e.attribute("url.scheme",t.protocol.slice(0,-1)),""!==t.hostname){e.attribute("server.address",t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname);let r=""===t.port?Iu[t.protocol]:Number(t.port);void 0!==r&&e.attribute("server.port",r)}},Id=(e,t,r,n,i)=>{for(let s in r)n(s,t)&&e.attribute(`http.${t}.header.${s}`,p3(s,i)?"<redacted>":r[s])},If=rV("effect/http/HttpMiddleware/TracerDisabledWhen",{defaultValue:()=>ee}),Ih=rV("@effect/platform/HttpMiddleware/SpanNameGenerator",{defaultValue:()=>e=>e.method}),Ip=rV("effect/http/HttpMiddleware/TracerHeaderFilter",{defaultValue:()=>ee});({...tE,toJSON(){return{_id:"Ref",ref:this.ref}}}),(e,t)=>al(()=>{e.ref.current=t(e.ref.current)});let Im="~effect/http/HttpClient",Ig=rV("effect/HttpClient"),Ib=((e,t)=>Iy(aD(r=>t(e.postprocess(aa(r)),r)),e.preprocess),Y(2,(e,t)=>Iy(r=>t(e.postprocess(r)),e.preprocess))),Iy=(e,t)=>{let r=Object.create(Iv);return r.preprocess=t,r.postprocess=e,r.execute=function(r){return e(t(r))},r},Iv={[Im]:Im,pipe(){return K(this,arguments)},...tl,toJSON:()=>({_id:"effect/HttpClient"}),...Object.fromEntries([["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"],["QUERY","query"]].map(([e,t])=>[t,function(t,r){return this.execute(EZ(e)(t,r))}]))},Ix=Y(2,(e,t)=>Iy(e.postprocess,r=>aq(e.preprocess(r),t))),Iw=rV("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>ee}),IS=rV("effect/http/HttpClient/TracerHeaderFilter",{defaultValue:()=>ee}),Ik=rV("effect/http/HttpClient/TracerPropagationEnabled",{defaultValue:Q}),I_=rV("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>e.method}),IE=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{try{e.abort()}catch{}});return{register(t,r){e.register(t,r,t)},unregister(t){e.unregister(t)}}}let e=new WeakMap;return{register(t,r){e.set(t,setTimeout(()=>r.abort(),5e3))},unregister(t){let r=e.get(t);void 0!==r&&(clearTimeout(r),e.delete(t))}}})(),IC=new WeakMap,II=new WeakMap,IA=(e,t,r)=>(r||(IE.register(e,t),e=new Ij(e,t)),II.set(e,t),e);class Ij{original;controller;constructor(e,t){this.original=e,this.controller=t}[Cu]=Cu;[Cs]=Cs;applyInterrupt(e){return au(()=>(IE.unregister(this.original),li(e,()=>al(()=>{this.controller.abort()}))))}get request(){return this.original.request}get url(){return this.original.url}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get upgrade(){return this.applyInterrupt(this.original.upgrade)}[Cl](){let e,t=(e=this.original,e[Cl]?.());return void 0!==t&&IE.unregister(this.original),t}get stream(){return _B(()=>(IE.unregister(this.original),_4(this.original.stream,al(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[ta](){return this.original[ta]()}pipe(){return K(this,arguments)}}let IT=rV("effect/http/HttpRouter"),IO="~effect/http/HttpRouter/Route",IN=e=>({...e,uninterruptible:e.uninterruptible??!1,prefix:"string"==typeof e.prefix?rb(e.prefix):e.prefix??rm,[IO]:IO}),IM=e=>e.endsWith("/")?e.slice(0,-1):e,I$=Y(2,(e,t)=>(t=IM(t),"*"===e)?`${t}/*`:"/"===e?t:t+e),IU=((e,t)=>IN({...e,path:I$(e.path,t),prefix:rR(e.prefix,{onNone:()=>IM(t),onSome:e=>I$(e,t)})}),(e,t)=>t?.global?uP(aC(dI(function*(){let t=yield*IT,r=tI(e)?yield*e:e;yield*t.addGlobalMiddleware(r)}),r7)):new IR(tI(e)?uP(aq(e,e=>r4(new Map([[IP,e]])))):u$(r4(new Map([[IP,e]]))))),IB=0,IP="effect/http/HttpRouter/MiddlewareFn";class IR{"~effect/http/HttpRouter/Middleware"={};layerFn;dependencies;constructor(e,t){this.layerFn=e,this.dependencies=t;let r=`effect/http/HttpRouter/Middleware-${++IB}`;this.layer=uP(dI({self:this},function*(){let e=yield*a7(),t=[ni(e,IP)];if(this.dependencies){let r=yield*uO,n=na(e,oq),i=yield*uN(this.dependencies,r,n);t.push(...IL(i))}return r4(new Map([[r,t]]))})).pipe(uL(this.layerFn))}layer;combine(e){return new IR(this.layerFn,this.dependencies?uz(this.dependencies,e.layer):e.layer)}}let IF=new WeakMap,IL=e=>{let t=IF.get(e);if(t)return t;let r=iD(),n=0;for(let[t,i]of e.mapUnsafe)t.startsWith("effect/http/HttpRouter/Middleware-")&&(r.push(i),i.length>n&&(n=i.length));if(0===r.length)t=[];else{let e=new Set;for(let t=n-1;t>=0;t--)for(let n of r)t<n.length&&e.add(n[t]);t=iw(e).reverse()}return IF.set(e,t),t};((function(){return 0==arguments.length?IU:IU(arguments[0],arguments[1])})(e=>t3(t=>{let r=nn(t.context,Il);return void 0!==r&&(r.loggerDisabled=!0),e}))).layer;let Iz=(e,t)=>()=>{let r=xj(xK(e),t);return kI((e,t)=>aa(aD(e,e=>r(e))))},ID=((e,t)=>{let r;return(r=t.inputSchema,()=>{let e=xT(xK(r));return kI((t,r)=>aa(aD(t,t=>e(t))))})().pipe(k9(e),k9(Iz(t.outputSchema)()))},"~effect/encoding/Sse/SseError");class IH extends i9("EventTooLarge"){get message(){return`Pending SSE event exceeded the maximum size of ${this.maxEventSize}`}}class IJ extends i9("SseError"){[ID]=ID;get message(){return this.reason.message}}let IW=(e,t,r)=>k9(kI((e,r)=>al(()=>{let r,n=[],i=function(e,t){let r,n,i,s,a,o,l,u=t?.maxEventSize??0xa00000,c=t?.dispatchEmptyNamedEvents===!0,d=0;return f(),{feed:function(t){if(0===t.length)return;r&&t.startsWith(Iq)&&(t=t.slice(Iq.length)),r=!1;let h=t.length,p=d,m=0;for(;m<h;){if(s&&(s=!1,t.charCodeAt(m)===IK)){++m;continue}let r=m;for(;r<h;){let e=t.charCodeAt(r);if(e===IV||e===IK)break;++r}if(r===h){n.push(t.slice(m)),i+=h-m;break}s=t.charCodeAt(r)===IV;let u=t.slice(m,r);if(n.length>0&&(n.push(u),u=n.join(""),n=[],i=0),function(t){if(0===t.length){let t=void 0!==o&&""!==o,r=o||"message",n=l;o=void 0,l="",(n.length>0||c&&t)&&e({_tag:"Event",id:a,event:r,data:n.slice(0,-1)});return}let r=t.indexOf(":"),n=t,i="";r>=0&&(n=t.slice(0,r),i=t.slice(t.charCodeAt(r+1)===IG?r+2:r+1)),"data"===n?l+=i+"\n":"event"===n?o=i:"id"!==n||i.includes("\0")?"retry"===n&&/^\d+$/.test(i)&&e(new IQ({duration:nY(parseInt(i,10)),lastEventId:a})):a=i}(u),d!==p)return;m=r+1}if(i+l.length>u){let e=new IJ({reason:new IH({maxEventSize:u})});return f(),e}},reset:f};function f(){d++,r=!0,n=[],i=0,s=!1,a=void 0,o=void 0,l=""}}(e=>{"Retry"===e._tag?r=e:n.push(e)},t),s=aD(e,e=>{for(let t=0;t<e.length;t++){let r=i.feed(e[t]);if(void 0!==r)return t1(r)}return am});return au(function e(){if(n6(n)){let e=n;return n=[],aa(e)}return r?t1(r):aD(s,e)})})),Iz(IY.pipe(xX(e,IZ)),r)()),Iq="\uFEFF",IK=10,IV=13,IG=32,IY=xW({_tag:xQ("Event"),id:xY(xF),event:xF,data:xF}),IZ=gg({decode:e=>void 0===e.id?{event:e.event,data:e.data}:{id:e.id,event:e.event,data:e.data},encode:e=>({_tag:"Event",id:e.id,event:e.event??"message",data:e.data})}),IX="~effect/encoding/Sse/Retry";class IQ extends i6("Retry"){[IX]=IX;static is(e){return eS(e,IX)}static filter(e){return IQ.is(e)?rA(e):rC(e)}}let I0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,OK:200,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};function I1(e){let t=e.toLowerCase().trim(),r=t.indexOf(";");return -1===r?t:t.slice(0,r).trim()}function I2(e){let t="string"==typeof e?I0[e]:e;return e=>void 0===Al(e.ast)?e.annotateKey({httpApiStatus:t}):e.annotate({httpApiStatus:t})}let I3=xH.pipe(I2(204)),I5=e=>xN(e)&&eS(e,"~effect/http-api/HttpApiSchema/Stream"),I4=e=>I5(e)&&"StreamSse"===e._tag,I6=e=>I5(e)&&"StreamUint8Array"===e._tag,I8=e=>I5(e)&&"StreamNdjson"===e._tag,I9="~effect/http-api/HttpApiSchema/Upgrade",I7=(xC(e=>eS(e,CR))).pipe(I2(101)),Ae=e=>xN(e)&&eS(e,I9),At="~effect/http-api/HttpApiSchema/WithHeaders",Ar="~effect/http-api/HttpApiSchema/WithHeadersValue",An=e=>({[Ar]:Ar,body:e.body,headers:e.headers}),Ai=e=>xN(e)&&eS(e,At),As=e=>{if(gE(e)||gE(bX(e)))return!0;let t=e.encoding?.[0].to;return void 0!==t&&gE(t)},Aa=ya("~httpApiEncoding"),Ao=ya("~httpApiWithHeaders");function Al(e){if(e.checks)for(let t=e.checks.length-1;t>=0;t--){let r=e.checks[t];if(r.annotations&&"httpApiStatus"in r.annotations)return r.annotations;if("FilterGroup"===r._tag){let e=Al(r);if(void 0!==e)return e}}let t=e.annotations;return t&&"httpApiStatus"in t?t:void 0}function Au(e){let t=Al(e);return void 0!==t?t.httpApiStatus:e.context?.annotations?.httpApiStatus}let Ac={_tag:"Json",contentType:"application/json"},Ad={_tag:"FormUrlEncoded",contentType:"application/x-www-form-urlencoded"};function Af(e,t){let r=Aa(e);return r||(wF(t)?Ac:Ad)}function Ah(e){let t=Aa(e)??Ac;if("Multipart"===t._tag)throw Error("Multipart is not supported in response");return t}function Ap(e){return Ai(e)?Au(e.ast)??Au(e.schema.ast)??200:Au(e.ast)??200}function Am(e){return Ai(e)&&void 0===Aa(e.ast)?Ah(e.schema.ast):Ah(e.ast)}function Ag(e){return Ai(e)?Au(e.ast)??Au(e.schema.ast)??500:Au(e.ast)??500}function Ab(e){let t=wC(e);return t.rebuild(Ax(t.ast))}let Ay=new gh(gn,ga(rq(eg))),Av=er(e=>{if("Undefined"===e._tag)return new gH(e.annotations,void 0,void 0,e.context);if("Suspend"===e._tag)return e.recur(Av);if("Union"!==e._tag)return e;let t=bD(e.types,Av);if(t===e.types)return e;let r=t.filter(e=>"Never"!==e._tag);return 1===r.length&&void 0===e.checks&&void 0===e.annotations?bO(r[0],e.context):new bm(r,e.options,e.annotations,e.checks,void 0,e.context)}),Ax=bz(e=>{if("Union"===e._tag||"Suspend"===e._tag)return e.recur(Ax);if("Objects"!==e._tag)return e;let t=bD(e.propertySignatures,e=>{let t=bX(e.type);if(!bY(t))return e;let r=Av(t);return r===t?e:new g8(e.name,bV(r,e.type,Ay))});return t===e.propertySignatures?e:new g7(t,e.indexSignatures,e.annotations,e.checks,void 0,e.context,e.encodingChecks)}),Aw="~effect/http-api/HttpApiEndpoint";function AS(e){let t=[];for(let{schemas:r}of e.payload.values())t.push(...r);return t}function Ak(e){let t=Array.from(e.success);return n6(t)?t:[I3]}function A_(e){let t=new Set(e.error),r=e.disableCodecs?Z:AT;for(let n of e.middlewares)for(let e of n.error)t.add(r(e));return Array.from(t)}let AE={[Aw]:Aw,pipe(){return K(this,arguments)},prefix(e){return AI({...AC(this),path:I$(this.path,e)})},middleware(e){return AI({...AC(this),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return AI({...AC(this),annotations:nt(this.annotations,e,t)})},annotateMerge(e){return AI({...AC(this),annotations:nd(this.annotations,e)})}},AC=e=>({identifier:e.identifier,path:e.path,method:e.method,params:e.params,query:e.query,headers:e.headers,payload:e.payload,success:e.success,error:e.error,annotations:e.annotations,middlewares:e.middlewares,disableCodecs:e.disableCodecs});function AI(e){function t(){}return Object.setPrototypeOf(t,AE),Object.assign(t,e)}function AA(e,t){if(void 0!==e)return t(xN(e)?e:xW(e))}let Aj="effect/http-api/stream/failure",AT=er(e=>{var t,r;let n,i;if(I5(e))return e;if(Ae(e)){let t,r;return void 0===e.headers?e:(t=e.protocol,r=Ab(e.headers),xO(I7.ast,{[I9]:I9,protocol:t,headers:r}))}if(Ai(e)){let r=I5(e.schema)?e.schema:AM(e.schema,Am(e));return t=Ab(e.headers),xO(e.ast,{[At]:At,schema:r,headers:t})}return n=Ah((r=e).ast),void 0===(i=Ao(r.ast))?AM(r,n):r.annotate({"~httpApiWithHeaders":{...i,bodyCodec:AM(i.body,n),headersCodec:Ab(i.headers)}})});function AO(e,t){let r=e.get(t);return void 0===r&&(r={bufferedContentTypes:new Set,noContent:!1},e.set(t,r)),r}function AN(e,t){let r=new Map;for(let n of e){let e=t(n),i=Ao(n.ast),s=Ai(n)?n.schema:i?.body??n,a=As(s.ast)?"":I1(I5(s)?s.contentType:Am(n).contentType),o=r.get(e);void 0===o&&(o={headerContentType:void 0,plainContentTypes:new Set},r.set(e,o));let l=()=>Error(`Cannot combine a response with headers with another response for status ${e} and content-type: ${a||"<no content>"}`);if(Ai(n)||void 0!==i){if(void 0!==o.headerContentType)throw Error(`Cannot declare multiple responses with headers for status ${e}`);if(o.plainContentTypes.has(a))throw l();o.headerContentType=a}else{if(o.headerContentType===a)throw l();o.plainContentTypes.add(a)}}}function AM(e,t){switch(t._tag){case"Json":return wE(e);case"FormUrlEncoded":return wC(e);case"Text":case"Uint8Array":return e}}function A$(e,t){if(!wF(t))return Ab(e);switch(Af(e.ast,t)._tag){case"Json":return wE(e);case"FormUrlEncoded":return wC(e);case"Text":case"Uint8Array":case"Multipart":return e}}e.s(["get",0,(e,t,r)=>{let n=r?.disableCodecs??!1,i=n?Z:Ab,s=function(e,t){let r=new Map;if(void 0===e)return r;let n=Array.isArray(e)?e:xN(e)?[e]:[xW(e).pipe(e=>{var t;return t={_tag:"FormUrlEncoded"},e.annotate({"~httpApiEncoding":{_tag:t._tag,contentType:t.contentType??function(e){switch(e){case"Multipart":return"multipart/form-data";case"Json":return"application/json";case"FormUrlEncoded":return"application/x-www-form-urlencoded";case"Uint8Array":return"application/octet-stream";case"Text":return"text/plain"}}(t._tag)}})})],i=t?Z:A$,s=!1;for(let e of n){if(I5(e)){if(I4(e))throw Error("StreamSse is response-only and cannot be used as a payload");if(!wF("GET"))throw Error("GET endpoints cannot declare a streaming payload");if(s)throw Error("Multiple streaming payloads are not supported");for(let t of(s=!0,e.contentTypes)){let n=I1(t);if(r.has(n))throw Error(`Cannot combine buffered and streaming payloads for content-type: ${t}`);r.set(n,{encoding:{_tag:"Stream",contentType:t},schemas:[e]})}continue}let t=Af(e.ast,"GET"),n=I1(t.contentType),a=r.get(n);if(a){if("Stream"===a.encoding._tag)throw Error(`Cannot combine buffered and streaming payloads for content-type: ${t.contentType}`);if(a.encoding._tag!==t._tag)throw Error(`Multiple payload encodings for content-type: ${t.contentType}`);if("Multipart"===a.encoding._tag)throw Error(`Multiple multipart payloads for content-type: ${t.contentType}`);a.schemas.push(i(e,"GET"))}else r.set(n,{encoding:t,schemas:[i(e,"GET")]})}return r}(r?.payload,n);return AI({identifier:e,path:t,method:"GET",params:AA(r?.params,i),query:AA(r?.query,i),headers:AA(r?.headers,i),payload:s,success:function(e,t,r){if(void 0===e)return new Set;let n=iS(e);return function(e,t){let r=e.filter(Ae);if(r.length>1)throw Error("Cannot declare more than one upgrade");let n=1===r.length;if(n){!1;for(let{encoding:e}of t.values())if("Stream"===e._tag||"Multipart"===e._tag&&"stream"===e.mode)throw Error("Upgrade endpoints cannot declare a streaming payload")}let i=!1,s=new Map;for(let t of e){if(Ae(t))continue;let e=Ai(t)?t.schema:t,r=Ap(t);if(n&&101===r)throw Error("Cannot combine an upgrade with another success response for status: 101");if(I5(e)){if(n)throw Error("Cannot combine an upgrade with a streaming success response");if(function(e,t){if("HEAD"===t)throw Error("HEAD endpoints cannot declare streaming success responses");if(I4(e)&&function e(t,r){if(r.has(t))return!1;if(r.add(t),gO(t))return t.types.some(t=>e(t,r));if(gN(t))return e(t.thunk(),r);if(!gT(t))return!1;let n=t.propertySignatures.find(e=>"event"===e.name);return void 0!==n&&function e(t,r){if(r.has(t))return!1;r.add(t);let n=bX(t);return n!==t?e(n,r):gI(t)?t.literal===Aj:gO(t)?t.types.some(t=>e(t,r)):!!gN(t)&&e(t.thunk(),r)}(n.type,r)}(bX(e.events.ast),new Set))throw Error(`SSE event name is reserved: ${Aj}`)}(e,"GET"),i)throw Error("Multiple streaming success responses are not supported");i=!0;let t=AO(s,r);if(t.noContent)throw Error(`Cannot combine no-content and streaming success responses for status: ${r}`);for(let n of e.contentTypes)if(t.bufferedContentTypes.has(I1(n)))throw Error(`Cannot combine buffered and streaming success responses for status ${r} and content-type: ${n}`);s.set(r,{...t,stream:e})}else{let n=AO(s,r),i=As(e.ast);if(void 0!==n.stream){if(i)throw Error(`Cannot combine no-content and streaming success responses for status: ${r}`);let e=Am(t),s=I1(e.contentType);if(n.stream.contentTypes.some(e=>I1(e)===s))throw Error(`Cannot combine buffered and streaming success responses for status ${r} and content-type: ${e.contentType}`)}i||n.bufferedContentTypes.add(I1(Am(t).contentType)),n.noContent=n.noContent||i}}AN(e,Ap)}(n,t),new Set(r?n:n.map(AT))}(r?.success,s,n),error:function(e,t){if(void 0===e)return new Set;let r=iS(e);for(let e of r){let t=Ai(e)?e.schema:e;if(I5(t))throw Error("Streaming schemas are not supported in error responses");if(Ae(t))throw Error("Upgrade schemas are not supported in error responses")}return AN(r,Ag),new Set(t?r:r.map(AT))}(r?.error,n),annotations:r7,middlewares:new Set,disableCodecs:n})},"getErrorSchemas",0,A_,"getPayloadSchemas",0,AS,"getSuccessSchemas",0,Ak],63002);let AU="~effect/http-api/HttpApi",AB={[AU]:AU,pipe(){return K(this,arguments)},add(...e){let t={...this.groups};for(let r of e)tp(t,r.identifier,r);return AR({...AP(this),groups:t})},addHttpApi(e){let t={...this.groups};for(let r of Object.keys(e.groups)){let n=e.groups[r];tp(t,r,n.annotateMerge(nd(e.annotations,n.annotations)))}return AR({...AP(this),groups:t})},prefix(e){return AR({...AP(this),groups:ig(this.groups,t=>t.prefix(e))})},middleware(e){return AR({...AP(this),groups:ig(this.groups,t=>t.middleware(e))})},annotate(e,t){return AR({...AP(this),annotations:nt(this.annotations,e,t)})},annotateMerge(e){return AR({...AP(this),annotations:nd(this.annotations,e)})}},AP=e=>({identifier:e.identifier,groups:e.groups,annotations:e.annotations}),AR=e=>{function t(){}return Object.setPrototypeOf(t,AB),Object.assign(t,e)},AF=(e,t)=>{for(let r of Object.values(e.groups)){let n=nd(e.annotations,r.annotations);for(let e of(t.onGroup({group:r,mergedAnnotations:n}),Object.values(r.endpoints)))(!t.predicate||t.predicate({endpoint:e,group:r}))&&t.onEndpoint({group:r,endpoint:e,middleware:e.middlewares,mergedAnnotations:nd(n,e.annotations),successes:AL(Ak(e),Ap),errors:AL(A_(e),Ag)})}},AL=(e,t)=>{let r=new Map;return e.forEach(function(e){let n=Ai(e)?e.schema:e;if(I5(n)||Ae(n))return;let i=t(e),s=r.get(i);void 0===s?r.set(i,[e]):s.push(e)}),r};class Az extends(rV())("effect/http-api/HttpApi/ParseOptions"){}class AD extends(rV())("effect/http-api/HttpApi/ParamsParseOptions"){}class AH extends(rV())("effect/http-api/HttpApi/QueryParseOptions"){}class AJ extends(rV())("effect/http-api/HttpApi/HeadersParseOptions"){}class AW extends(rV())("effect/http-api/HttpApi/PayloadParseOptions"){}class Aq extends(rV())("effect/http-api/HttpApi/SuccessParseOptions"){}class AK extends(rV())("effect/http-api/HttpApi/ErrorParseOptions"){}let AV=e=>{let t=nn(e,Az);return{params:nn(e,AD)??t,query:nn(e,AH)??t,headers:nn(e,AJ)??t,payload:nn(e,AW)??t,success:nn(e,Aq)??t,error:nn(e,AK)??t}};e.s(["getSlotParseOptions",0,AV,"make",0,e=>AR({identifier:e,groups:{},annotations:r7}),"reflect",0,AF],44322);var AG=e.i(44322),AG=AG,AY=e.i(63002),AY=AY;let AZ="~effect/http-api/HttpApiGroup",AX={[AZ]:AZ,add(...e){let t={...this.endpoints};for(let r of e)tp(t,r.identifier,r);return A0({...AQ(this),endpoints:t})},prefix(e){return A0({...AQ(this),endpoints:ig(this.endpoints,t=>t.prefix(e))})},middleware(e){return A0({...AQ(this),endpoints:ig(this.endpoints,t=>t.middleware(e))})},annotateMerge(e){return A0({...AQ(this),annotations:nd(this.annotations,e)})},annotate(e,t){return A0({...AQ(this),annotations:nt(this.annotations,e,t)})},annotateEndpointsMerge(e){return A0({...AQ(this),endpoints:ig(this.endpoints,t=>t.annotateMerge(e))})},annotateEndpoints(e,t){return A0({...AQ(this),endpoints:ig(this.endpoints,r=>r.annotate(e,t))})},pipe(){return K(this,arguments)}},AQ=e=>({identifier:e.identifier,topLevel:e.topLevel,endpoints:e.endpoints,annotations:e.annotations}),A0=e=>{function t(){}return Object.setPrototypeOf(t,AX),t.key=`effect/http-api/HttpApiGroup/${e.identifier}`,Object.assign(t,e)};e.s(["make",0,(e,t)=>A0({identifier:e,topLevel:t?.topLevel??!1,endpoints:{},annotations:r7})],10147);var A1=e.i(10147),A1=A1;let A2=wA.Struct({id:wj.String,name:wj.String,unit:wT.optionalKey(wj.String),writable:wO.Boolean,value:wT.optionalKey(wN.Union([wM.Number,wO.Boolean])),ts:wT.optionalKey(wM.Number)}),A3=wA.Struct({id:wj.String,protocol:w$.Literals(["modbus-tcp","bacnet-ip","simulator"]),status:w$.Literals(["starting","ok","failing"]),pollIntervalMs:wM.Number,reason:wT.optionalKey(wj.String),lastSuccess:wT.optionalKey(wM.Number),points:wU.Array(A2)}),A5=wA.Struct({at:wM.Number,device:wj.String,point:wj.String,status:w$.Literals(["written","rejected","failed"]),reason:wT.optionalKey(wj.String)}),A4=wA.Struct({version:wj.String,node:wj.String,memoryBytes:wM.Number,heapBytes:wM.Number,cpuPercent:wM.Number,eventLoopLagMs:wA.Struct({p99:wM.Number,max:wM.Number}),clockSteps:wM.Number,openFds:wT.optionalKey(wM.Number),temperatureC:wT.optionalKey(wM.Number),throttled:wT.optionalKey(wA.Struct({now:wU.Array(wj.String),watched:wU.Array(wj.String)})),diskFreeBytes:wT.optionalKey(wM.Number)}),A6=wA.Struct({topic:wj.String,payload:wj.String,truncated:wO.Boolean,retained:wO.Boolean,at:wM.Number,count:wM.Number}),A8=wA.Struct({site:wj.String,building:wj.String,id:wj.String,since:wM.Number,now:wM.Number,broker:wA.Struct({url:wj.String,connected:wO.Boolean}),buffer:wT.optionalKey(wA.Struct({path:wj.String,rows:wM.Number,maxRows:wM.Number,dropped:wM.Number})),host:wT.optionalKey(A4),devices:wU.Array(A3),commands:wU.Array(A5)}),A9=wA.Struct({messages:wU.Array(A6),droppedTopics:wM.Number}),A7=wA.Struct({t:wM.Number,min:wM.Number,max:wM.Number,avg:wM.Number,count:wM.Number}),je=wA.Struct({device:wj.String,point:wj.String,from:wM.Number,to:wM.Number,stepMs:wM.Number,resolution:w$.Literals(["read","minute"]),buckets:wU.Array(A7)});class jt extends wB.TaggedError()("HistoryUnavailable",{message:wj.String},{httpApiStatus:404}){}class jr extends wB.TaggedError()("HistoryQueryInvalid",{message:wj.String},{httpApiStatus:400}){}class jn extends A1.make("status").add(AY.get("status","/api/status",{success:A8})).add(AY.get("messages","/api/messages",{success:A9})).add(AY.get("history","/api/history",{query:{device:wj.String,point:wj.String,from:wP.optional(wR.FiniteFromString),to:wP.optional(wR.FiniteFromString),buckets:wP.optional(wR.FiniteFromString)},success:je,error:[jt,jr]})){}class ji extends AG.make("ot-gateway").add(jn){}var js=dL,dW=dL,ja=dL,jo=dL,jl=dL,ju=dL,jc=dL,jd=dL;let jf=rV("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch}),jh=rV("effect/http/FetchHttpClient/StreamBodyFallback",{defaultValue:()=>"error"});class jp extends(rV())("effect/http/FetchHttpClient/RequestInit"){}let jm=(_=(e,t,n,i)=>{let s;if(void 0!==e.headers.upgrade)return t1(new EO({reason:new EB({request:e,description:"fetch cannot send an HTTP upgrade request"})}));let a=i.getRef(jf),o=nn(i.context,jp)??{},l=o.headers?p0(pZ(o.headers),e.headers):e.headers;l["content-length"]&&(l=p1(l,"content-length"));let u=al(()=>s?.abort()),c=r=>aq(dC({try:()=>a(t,{...o,method:e.method,headers:l,body:r,duplex:"u">typeof ReadableStream&&r instanceof ReadableStream?"half":void 0,signal:s?AbortSignal.any([n,s.signal]):n}),catch:t=>new EO({reason:new EB({request:e,cause:t})})}),t=>{let r=new Cc(e,t);return s?(null===t.body&&s.abort(),Object.create(r,{...Object.fromEntries(["arrayBuffer","text","json","formData","urlParamsBody"].map(e=>[e,{get:()=>le(r[e],u)}])),stream:{get:()=>_4(r.stream,u)}})):r}).pipe(lr(()=>u));switch(e.body._tag){case"Raw":case"Uint8Array":return c(e.body.body);case"FormData":return c(e.body.formData);case"Stream":if(r??=(()=>{try{let e=!1,t=new ReadableStream,r=new Request("https://example.com",{method:"POST",body:t,get duplex(){return e=!0,"half"}});return(e||r.body===t)&&!r.headers.has("Content-Type")}catch{return!1}})()){s=new AbortController;let t=AbortSignal.any([n,s.signal]),r=av(e=>{let r=()=>e(lo);return t.aborted?void r():(t.addEventListener("abort",r,{once:!0}),al(()=>t.removeEventListener("abort",r)))});return aD(En(_5(e.body.stream,r)),c)}if("error"===i.getRef(jh))return t1(new EO({reason:new EP({request:e,description:"Streaming request bodies are not supported in this runtime"})}));return aq(_m(e.body.stream.channel),e=>e.buffer).pipe(ok(t=>new EO({reason:new EP({request:e,cause:t})})),aD(c))}return c(void 0)},Iy(e=>aD(e,e=>t3(t=>{let r=IC.get(e),n=r??new AbortController,i=EW(e.url,e.urlParams,rz(e.hash));if(rk(i))return t1(new EO({reason:new ER({request:e,cause:i.failure})}));let s=i.success;if(t.getRef(sg)||t.getRef(Iw)(e)){let i=_(e,s,n.signal,t);return r?aq(i,e=>IA(e,n,!0)):lp(e=>oj(e(i),{onSuccess:e=>aa(IA(e,n,!1)),onFailure:e=>(e.reasons.some(tq)&&n.abort(),ao(e))}))}return dM(t.getRef(I_)(e),{kind:"client"},i=>{var a,o;let l;i.attribute("http.request.method",e.method);let u=t.getRef(p5);Ic(i,s,(a=e.urlParams,o=t.getRef(mA),0===(l=a.params.filter(([,e])=>"string"!=typeof e).map(([e])=>e)).length?o:[...o,...new URLSearchParams(l.map(e=>[e,""])).keys()]));let c=t.getRef(IS);return Id(i,"request",e.headers,c,u),e=t.getRef(Ik)?E1(e,Object.setPrototypeOf({b3:`${i.traceId}-${i.spanId}-${i.sampled?"1":"0"}${rR(i.parent,{onNone:()=>"",onSome:e=>`-${e.spanId}`})}`,traceparent:`00-${i.traceId.padStart(32,"0")}-${i.spanId}-${i.sampled?"01":"00"}`},pK)):e,lp(a=>a(_(e,s,n.signal,t)).pipe(d$(i,{captureStackTrace:!1}),oj({onSuccess:s=>(i.attribute("http.response.status_code",s.status),Id(i,"response",s.headers,c,u),s.status>=400&&s.status<600&&(i.attribute("error.type",String(s.status)),((e,t,r,n)=>{let i,s=Error.stackTraceLimit;td(0);try{i=t1(new EO({reason:new EF({request:r,response:n})}))}finally{td(s)}t.end(e.getRef(sC)?e.getRef(lZ).currentTimeNanosUnsafe():BigInt(0),i)})(t,i,e,s)),aa(IA(s,n,void 0!==r))),onFailure:e=>(!r&&e.reasons.some(tq)&&n.abort(),ao(e))})))})})),aa)),jg=(E=aa(jm),uU(Ig)(ot(e=>aq(E,t=>Ib(t,a8(t=>nd(e,t)))))));e.s(["layer",0,jg],53660);var jb=e.i(53660),jb=jb;let jy="~effect/encoding/Ndjson/NdjsonError",jv=new TextEncoder,jx=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});class jw extends i9("NdjsonError"){[jy]=jy;get message(){return this.kind}}let jS=()=>kI((e,t)=>aa(aD(e,e=>{try{return aa(iH(e.map(e=>{let t=JSON.stringify(e);if(void 0===t)throw TypeError("Value cannot be represented as JSON");return t}).join("\n")+"\n"))}catch(e){return t1(new jw({kind:"Pack",cause:e}))}}))),jk=()=>kP(jS(),iJ(e=>jv.encode(e))),j_=(e,t,r)=>{let n,i,s=(e,t)=>(n=t,n6(e))?aa(e):void 0!==t?t1(t):void 0,a=au(()=>void 0!==n?t1(n):void 0!==i?uJ(i.leftover):cL(e,{onSuccess:e=>{let r=[];return s(r,t(e,r))??a},onFailure:ao,onDone:e=>{i={leftover:e};let t=[];return s(t,r(t))??uJ(e)}}));return a},jE=(e,t,r,n)=>{if(!(r&&/^[ \t]*$/.test(e)))try{t.push(JSON.parse(e))}catch(e){return new jw({kind:"Unpack",reason:"InvalidJson",unterminated:n,cause:e})}},jC=()=>void 0,jI=new Uint8Array(0),jA=e=>kI((t,r)=>al(()=>{let r=e?.ignoreEmptyLines===!0,n=e?.maxLineBytes??1/0,i=new TextDecoder("utf-8",{fatal:!0}),s=[],a=0,o=!1,l=(e,t,r)=>{if(0===a)return e.subarray(t,r);let n=new Uint8Array(a+r-t),i=0;for(let e of s)n.set(e,i),i+=e.length;return n.set(e.subarray(t,r),i),s=[],a=0,n},u=(e,t,n)=>{let s;try{s=i.decode(e)}catch(e){return new jw({kind:"Unpack",reason:"InvalidUtf8",unterminated:n,cause:e})}let a=i!==jx;if(i=jx,!a||!n||0!==s.length)return jE(s,t,r,n)};return j_(t,(e,t)=>{for(let r of e){let e=0;for(let i=0;i<r.length;i++){let s=r[i];if(10===s||13===s){if(10===s&&o)e=i+1;else{let n=u(l(r,e,i),t,!1);if(void 0!==n)return n;e=i+1}o=13===s}else if(o=!1,a+i+1-e>n)return new jw({kind:"Unpack",reason:"LineTooLarge",unterminated:!1,cause:RangeError(`NDJSON line exceeds maxLineBytes of ${n}`)})}e<r.length&&(s.push(r.slice(e)),a+=r.length-e)}},e=>0===a?void 0:u(l(jI,0,0),e,!0))})),jj=((e=>eS(e[0],kE),(e,t)=>k9(k9(jk(),e),jA(t))),Y(2,(e,t)=>void 0===e?void 0:t(e))),jT=new Set,jO="~effect/http-api/HttpApiClient/Upgraded",jN=(e,t)=>{if(void 0===t||!e.includes(":"))return t=>e;let r=function(e){if(void 0===e)return jT;let t=bN(e.ast);return gT(t)&&0===t.indexSignatures.length?new Set(t.propertySignatures.map(e=>String(e.name))):void 0}(t);return t=>(function(e,t,r){let n=/::|:(\w+)/g,i="",s=0;for(let a=n.exec(e);null!==a;a=n.exec(e)){let o=a[1];if(void 0===o||void 0!==t&&!t.has(o))continue;let l=n.lastIndex;"("===e[l]&&(l=wK(e,l)+1);let u="?"===e[l];u&&l++;let c=r(o,u),d=a.index;void 0===c&&"/"===e[d-1]&&d--,i+=e.slice(s,d)+(c??""),n.lastIndex=l,s=l}return i+e.slice(s)})(e,r,(e,r)=>{let n=t[e];if("."===n||".."===n)throw Error(`Invalid path parameter: ${e}`);if(void 0!==n)return encodeURIComponent(n);if(!r)throw Error(`Missing path parameter: ${e}`)})};function jM(e,t,r){let n=e.some(e=>Ai(e)||void 0!==Ao(e.ast)),i=xj(n?xV(e.map(e=>{var n,i,s;let a,o,l,u;return n=e,i=t,s=r,l=xj(jV((o=void 0!==(a=Ao(n.ast))?{body:a.bodyCodec,headers:a.headersCodec,toValue:a.transformation.decode}:Ai(n)?{body:n.schema,headers:n.headers,toValue:An}:{body:n,headers:xP,toValue:e=>e.body}).body).pipe(xX(o.body)),i),u=xj(o.headers,s),j$.pipe(xX(Ai(n)?n:x$(n),gm({decode:e=>lm({body:l(e.body),headers:u(e.headers)}).pipe(aq(o.toValue),ok(e=>e.issue)),encode:(e,t)=>t1(new mZ({message:"Decode only schema"},e,t))})))})):xV(e.map(function(e){return jV(e).pipe(xX(e))})),t);return e=>aD(e.arrayBuffer,n?t=>i({body:t,headers:e.headers}):i)}let j$=xW({body:xP,headers:xP}),jU=e=>{let{endpoint:t,errors:r,successes:n,mergedAnnotations:i}=e,s=AV(i),a={orElse:jG},o=new Map;for(let[e,t]of r.entries())for(let[r,n]of jR(t).entries())jB(o,e,r,jM(n,s.error,s.headers));for(let[e,t]of o.entries()){let r=jP(t);a[e]=e=>aD(od(r(e),t=>ao(tP(tL(new EO({reason:new EF({request:e.request,response:e})})),t))),t1)}let l=new Map;for(let[e,t]of n.entries())for(let[r,n]of jR(t).entries())jB(l,e,r,jM(n,s.success,s.headers));for(let e of function(e){let t=[];for(let r of e.success)I5(Ai(r)?r.schema:r)&&t.push(r);return t}(t)){let t=jL(e)?e.schema:e,r=Ap(e),n=function(e,t,r){let n=jL(e),i=function(e,t){if(I6(e))return e=>e.stream;if(I8(e)){let r,n=xj(wE(e.schema),t),i=rH(fN(r=e.maxElementBytes),()=>Error(`ByteSize exceeds Number.MAX_SAFE_INTEGER: ${r}`));return e=>e.stream.pipe(_2(jA({ignoreEmptyLines:!0,maxLineBytes:i})),_X(t=>eS(t,jy)?"LineTooLarge"!==t.reason?jH(t):new EO({reason:new EL({request:e.request,response:e,description:`NDJSON line exceeds maxElementBytes of ${i} bytes`})}):t),_H(e=>n(e)))}let r=function(e,t){let r=xV([xW({id:xM(xF),event:xU(jF),data:ws(wE(wd(e.error,wn())))}),e.events]),n=IW(r,void 0,t);return e=>void 0===e?n:IW(r,e,t)}(e,t);return(t,n)=>(function(e,t,r){let n=_M(e.pipe(_3,_2(r)),e=>al(()=>{let t;return au(()=>void 0!==t?ao(t):aD(e,e=>{for(let r=0;r<e.length;r++){let n=e[r];if(n.event===jF&&tT(n.data)){if(0===r)return ao(n.data);t=n.data,e=e.slice(0,r);break}}return aa(e)}))}));return"data"===t.sseMode?_z(n,e=>e.data):n})(t.stream,e,r(n))}(n?e.schema:e,t),s=(e,t)=>aq(a7(),r=>_6(i(e,t),r));if(!n)return s;let a=xj(e.headers,r);return(e,t)=>aD(a(e.headers),r=>aq(s(e,t),e=>An({body:e,headers:r})))}(e,s.success,s.headers);for(let e of t.contentTypes)jB(l,r,e,n)}for(let[e,t]of l.entries())a[e]=jP(t);let u=jz(t);if(void 0!==u){let e=void 0===u.headers?aa:xj(u.headers,s.headers);a[101]=t=>lp(r=>aD(t.upgrade,n=>r(e(t.headers)).pipe(aq(e=>({[jO]:jO,headers:e,socket:n})),lr(()=>oC(dT(n.reader))))))}return(e,t)=>(a[e.status]??a.orElse)(e,t)};function jB(e,t,r,n){let i=I1(r),s=e.get(t);void 0===s?e.set(t,[{contentType:i,decode:n}]):s.push({contentType:i,decode:n})}function jP(e){let t=e[0];return void 0!==t&&e.every(e=>e.decode===t.decode)?t.decode:(t,r)=>{var n,i;let s,a=I1(t.headers["content-type"]??""),o=e.find(e=>e.contentType===a);return void 0===o?(n=t,i=a,s=Array.from(new Set(e.map(e=>e.contentType))).join(", "),t1(new EO({reason:new EL({request:n.request,response:n,description:`Unsupported response content-type for status ${n.status}: ${i||"<missing>"}. Expected one of: ${s}`})}))):o.decode(t,r)}}function jR(e){let t=new Map;for(let r of e){let e=As((Ai(r)?r.schema:r).ast)?"":I1(Am(r).contentType),n=t.get(e);void 0===n?t.set(e,[r]):n.push(r)}return t}let jF="effect/http-api/stream/failure",jL=e=>Ai(e);function jz(e){for(let t of e.success)if(Ae(t))return t}let jD=e=>eS(e,jy)&&"Pack"===e.kind,jH=e=>new xI(new mG({message:"InvalidUtf8"===e.reason?"Expected valid UTF-8":e.unterminated?"Expected a valid JSON line, got an unterminated final line":"Expected a valid JSON line"})),jJ=x1(globalThis.ArrayBuffer,{expected:"ArrayBuffer"}),jW=jJ.pipe(xX(wu,gg({decode:e=>new Uint8Array(e),encode:e=>e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))),jq=jJ.pipe(xX(xF,gg({decode:e=>new TextDecoder().decode(e),encode(e){let t=new TextEncoder().encode(e);return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}}))),jK=jq.pipe(xX(xV([(xU("")).pipe(xX(xR,gg({decode:()=>void 0,encode:()=>""}))),wa])));function jV(e){switch(Ah(e.ast)._tag){case"Json":return g_(bX(e.ast))?jK.pipe(xX(xP,gg({decode:e=>void 0===e?null:e,encode:e=>null===e?void 0:e}))):jK;case"FormUrlEncoded":return jq.pipe(xX(wb,gg({decode:e=>mo(new URLSearchParams(e)),encode:mb})));case"Uint8Array":return jW;case"Text":return jq}}let jG=e=>t1(new EO({reason:new EL({request:e.request,response:e,description:"undeclared status code"})})),jY=xC(e=>eS(e,Em)),jZ=new WeakMap;e.s(["make",0,(e,t)=>aD(Ig,r=>{var n,i;let s,a;return n=e,i={...t,httpClient:t?.transformClient?t.transformClient(r):r},a={},(s={...i,onGroup({group:e}){e.topLevel||tp(a,e.identifier,{})},onEndpoint({endpoint:e,endpointFn:t,group:r}){tp(r.topLevel?a:a[r.identifier],e.identifier,t)}},dI(function*(){let e=yield*a7(),t=s.httpClient.pipe(s?.baseUrl===void 0?Z:Ix(E8(s.baseUrl.toString())));AF(n,{predicate:s?.predicate,onGroup(e){s.onGroup?.(e)},onEndpoint(r){var n,i;let a,{group:o,endpoint:l,mergedAnnotations:u}=r,c=AV(u),d=jN(l.path,l.params),f=jz(l),h=jU(r),p=jj(l.params,e=>xT(e,c.params)),m=[];for(let e of AS(l))I6(e)||I8(e)?a=e:m.push(e);let g=jj(a,e=>({contentType:e.contentType,encode:function(e,t){if(I6(e))return e=>e;let r=xT(xK(wE(e.schema)),t);return e=>e.pipe(_J(e=>r(e)),_2(jk()),_Z(jD,_R))}(e,c.payload)})),b=n6(m)?xT(wF(l.method)?(n=m,i=l.method,xV(n.map(e=>(function(e,t){let r=e.ast,n=jZ.get(r);if(void 0!==n)return n;let i=Af(r,t),s=jY.pipe(xX(e,gm({decode:(e,t)=>t1(new mZ({message:"Encode only schema"},e,t)),encode(e,t){switch(i._tag){case"Multipart":return t1(new mZ({message:"Payload must be a FormData"},e,t));case"Json":try{let t=JSON.stringify(e);return aa(ES(t,i.contentType))}catch{return t1(new mG({expected:"a JSON-serializable request body"},e,t))}case"Text":if("string"!=typeof e)return t1(new mG({message:"Expected a string"},e,t));return aa(ES(e,i.contentType));case"FormUrlEncoded":let r,n;if(!ex(e))return t1(new mG({message:"Expected a record"},e,t));return aa((r=mo(e),n=i.contentType,ES(mb(mo(r)),n??"application/x-www-form-urlencoded")));case"Uint8Array":let s;if(!(e instanceof Uint8Array))return t1(new mG({message:"Expected a Uint8Array"},e,t));return aa(new Ey(s=e,i.contentType??"application/octet-stream",s.length))}}})));return jZ.set(r,s),s})(e,i)))):xV(m),c.payload):void 0,y=jj(l.headers,e=>xT(e,c.headers)),v=jj(l.query,e=>xT(e,c.query)),x=Array.from(r.middleware,e=>`${e.key}/Client`),w=aS(function*(r){let n=EZ(l.method)(l.path);if(void 0!==r){if(void 0!==p&&(n=E6(n,d((yield*p(r.params))))),void 0!==g&&eS(r.payload,"~effect/Stream")){let e=yield*a7();n=Cr(n,EE(_6(g.encode(r.payload),e),g.contentType))}else if(void 0!==b)n=wF(l.method)?r.payload instanceof FormData?Cn(n,r.payload):Cr(n,(yield*b(r.payload))):Ce(n,(yield*b(r.payload)));else if(void 0!==g)return yield*new xI(new mG({message:"Expected a Stream payload"},r.payload));void 0!==y&&(n=E1(n,(yield*y(r.headers)))),void 0!==v&&(n=Ce(n,(yield*v(r.query))))}void 0!==f&&(n=E4(n,f.protocol));let i=yield*function r(n,i,s,a,o){if(-1===o)return t.execute(s);let l=e.mapUnsafe.get(a[o]);return void 0===l?r(n,i,s,a,o-1):l({endpoint:i,group:n,request:s,next:e=>r(n,i,e,a,o-1)})}(o,l,n,x,x.length-1);if(r?.responseMode==="response-only")return i;let a=h(i,r?.sseOptions),u=yield*void 0===s.transformResponse?a:s.transformResponse(a);return r?.responseMode==="decoded-and-response"?[u,i]:u});s.onEndpoint({...r,endpointFn:w})}})})).pipe(aC(a))})],62780);var jX=e.i(62780),jX=jX,jl=dL,jc=dL,jd=dL,js=dL,ju=dL,wB=wA,wj=wA,jb=jb,jX=jX;class jQ extends wB.TaggedError()("StatusUnavailable",{message:wj.String}){}let j0=jX.make(ji,{baseUrl:window.location.origin}),j1=e=>e.pipe(jl.mapError(e=>new jQ({message:e.message})),jc.timeoutOrElse({duration:"3 seconds",orElse:()=>jd.fail(new jQ({message:"no answer within 3 s"}))})),j2=j0.pipe(js.flatMap(e=>e.status.status()),ju.provide(jb.layer),j1),j3=j0.pipe(js.flatMap(e=>e.status.messages()),ju.provide(jb.layer),j1),j5={DEG_C:"°C",DEG_F:"°F",PERCENT:"%",KiloW:"kW",W:"W","KiloW-HR":"kWh",V:"V",A:"A",PA:"Pa",BAR:"bar","M3-PER-HR":"m³/h","L-PER-SEC":"l/s",PPM:"ppm"},j4=e=>{if(void 0===e)return"";let t=e.replace(/^unit:/,"");return j5[t]??t},j6=e=>void 0===e?"–":"boolean"==typeof e?e?"on":"off":Math.abs(e)>=1e3||Number.isInteger(e)?e.toLocaleString():e.toFixed(2),j8=(e,t)=>{if(void 0===e)return"never";let r=Math.max(0,(t-e)/1e3);return r<60?"under a minute":r<3600?`${Math.floor(r/60)} min`:r<86400?`${Math.floor(r/3600)} h`:`${Math.floor(r/86400)} d`},j9=(e,t)=>{let r=new Date(e),n=r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"});return r.toDateString()===new Date(t).toDateString()?n:`${r.toLocaleDateString([],{month:"short",day:"numeric"})} ${n}`},j7=e=>{let t=["B","KB","MB","GB","TB"],r=e,n=0;for(;r>=1e3&&n<t.length-1;)r/=1e3,n++;return`${r>=100||0===n?Math.round(r):r.toFixed(1)} ${t[n]}`},Te=[{id:"15m",label:"15 min",ms:9e5},{id:"1h",label:"1 h",ms:36e5},{id:"24h",label:"24 h",ms:864e5},{id:"7d",label:"7 days",ms:6048e5}],Tt=jX.make(ji,{baseUrl:window.location.origin}),Tr=(e,t,r=4)=>{if(e===t){let n=.05*Math.abs(e)||1;return Tr(e-n,t+n,r)}let n=(t-e)/r,i=10**Math.floor(Math.log10(n)),s=([1,2,5,10].find(e=>e*i>=n)??10)*i,a=Math.floor(e/s)*s,o=[];for(let e=0;;e++){let r=Number((a+e*s).toPrecision(12));if(o.push(r),r>=t)return o}},Tn=[6e4,3e5,9e5,18e5,36e5,108e5,216e5,864e5],Ti=(e,t)=>t?`${Math.round(100*e)} % on`:Number(e.toPrecision(4)).toLocaleString(),Ts=({series:e,unit:t,boolean:r,label:n})=>{let[i,s]=(()=>{let e=(0,dD.useRef)(null),[t,r]=(0,dD.useState)(0);return(0,dD.useEffect)(()=>{let t=e.current;if(null===t)return;let n=new ResizeObserver(([e])=>r(e?.contentRect.width??0));return n.observe(t),()=>n.disconnect()},[]),[e,t]})(),[a,o]=(0,dD.useState)(void 0),{buckets:l,stepMs:u,from:c,to:d}=e,f=l.map(e=>e.min),h=l.map(e=>e.max),p=r?[0,1]:Tr(Math.min(...f),Math.max(...h)),m=p[0]??0,g=p.at(-1)??1,b=Math.max(0,s-48-12),y=e=>48+(e+u/2-c)/(d-c)*b,v=e=>8+(g-e)/(g-m||1)*120,x=((e,t,r=5)=>{let n=Tn.find(n=>(t-e)/n<=r)??864e5,i=6e4*new Date(e).getTimezoneOffset(),s=[];for(let r=Math.ceil((e-i)/n)*n+i;r<=t;r+=n)s.push(r);return{ticks:s,step:n}})(c,d),w=((e,t)=>{let r=[],n=[];for(let i of e){let e=n.at(-1);void 0!==e&&i.t-e.t>2*t&&(r.push(n),n=[]),n.push(i)}return n.length>0&&r.push(n),r})(l,u),S=void 0===a?void 0:((e,t)=>{let r;for(let n of e)(void 0===r||Math.abs(n.t-t)<Math.abs(r.t-t))&&(r=n);return r})(l,a),k=j4(t);return(0,q.jsxs)("div",{ref:i,className:"relative",children:[0===l.length?(0,q.jsx)("p",{className:"flex h-[150px] items-center justify-center text-sm text-muted-foreground",children:"No reads in this range yet."}):0===s?(0,q.jsx)("div",{className:"h-[150px]"}):(0,q.jsxs)("svg",{"aria-label":`${n}: ${l.length} buckets, ${Ti(m,r)} to ${Ti(g,r)}`,className:"block touch-none select-none",height:150,onPointerLeave:()=>o(void 0),onPointerMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left-48)/b;o(r<0||r>1?void 0:c+r*(d-c)-u/2)},role:"img",width:s,children:[p.map(e=>(0,q.jsxs)("g",{children:[(0,q.jsx)("line",{stroke:"var(--border)",x1:48,x2:s-12,y1:v(e),y2:v(e)}),(0,q.jsx)("text",{className:"fill-muted-foreground text-[11px] tabular-nums",textAnchor:"end",x:42,y:v(e)+4,children:r?1===e?"on":"off":e.toLocaleString()})]},e)),x.ticks.map(e=>(0,q.jsx)("text",{className:"fill-muted-foreground text-[11px] tabular-nums",textAnchor:"middle",x:48+(e-c)/(d-c)*b,y:144,children:x.step>=864e5?new Date(e).toLocaleDateString([],{weekday:"short",day:"numeric"}):new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},e)),w.map(e=>{let t=e.map(e=>`${y(e.t)},${v(e.max)}`),n=e.toReversed().map(e=>`${y(e.t)},${v(e.min)}`),i=e.map((e,t)=>0===t?`M${y(e.t)},${v(e.avg)}`:r?`H${y(e.t)}V${v(e.avg)}`:`L${y(e.t)},${v(e.avg)}`);return(0,q.jsxs)("g",{children:[r?null:(0,q.jsx)("polygon",{fill:"var(--series-1)",fillOpacity:.14,points:[...t,...n].join(" ")}),(0,q.jsx)("path",{d:i.join(" "),fill:"none",stroke:"var(--series-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2}),1===e.length?(0,q.jsx)("circle",{cx:y(e[0]?.t??0),cy:v(e[0]?.avg??0),fill:"var(--series-1)",r:3}):null]},e[0]?.t)}),void 0===S?null:(0,q.jsxs)("g",{pointerEvents:"none",children:[(0,q.jsx)("line",{stroke:"var(--muted-foreground)",strokeDasharray:"3 3",x1:y(S.t),x2:y(S.t),y1:8,y2:128}),(0,q.jsx)("circle",{cx:y(S.t),cy:v(S.avg),fill:"var(--series-1)",r:4,stroke:"var(--card)",strokeWidth:2})]})]}),void 0===S?null:(0,q.jsxs)("div",{className:"pointer-events-none absolute top-0 z-10 rounded-md border bg-card text-card-foreground px-2.5 py-1.5 text-xs shadow-md",style:{left:Math.min(Math.max(y(S.t)+10,0),Math.max(0,s-170)),minWidth:150},children:[(0,q.jsx)("div",{className:"text-muted-foreground tabular-nums",children:new Date(S.t).toLocaleString([],{weekday:"short",hour:"2-digit",minute:"2-digit",second:u<6e4?"2-digit":void 0})}),(0,q.jsxs)("div",{className:"font-mono tabular-nums",children:[Ti(S.avg,r)," ",r?"":k]}),r||1===S.count?null:(0,q.jsxs)("div",{className:"text-muted-foreground tabular-nums",children:[j6(Number(S.min.toPrecision(4)))," – ",j6(Number(S.max.toPrecision(4)))," ",k]}),(0,q.jsxs)("div",{className:"text-muted-foreground tabular-nums",children:[S.count.toLocaleString()," ",1===S.count?"read":"reads"]})]})]})},Ta=({point:e,history:t})=>{let r="boolean"==typeof e.value;return(0,q.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border p-3",children:[(0,q.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,q.jsxs)("div",{className:"min-w-0",children:[(0,q.jsx)("h3",{className:"truncate font-mono text-sm",children:e.id}),(0,q.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.name})]}),(0,q.jsxs)("p",{className:"shrink-0 font-mono text-2xl font-semibold tabular-nums",children:[j6(e.value)," ",(0,q.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:j4(e.unit)})]})]}),void 0===t?(0,q.jsx)("div",{className:"h-[150px] animate-pulse rounded-md bg-muted"}):"off"===t._tag?(0,q.jsx)("p",{className:"flex h-[150px] items-center justify-center text-sm text-muted-foreground",children:t.message}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ts,{boolean:r,label:e.id,series:t.series,unit:e.unit}),0===t.series.buckets.length?null:(0,q.jsxs)("details",{className:"text-xs",children:[(0,q.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"Table"}),(0,q.jsx)("div",{className:"mt-2 max-h-48 overflow-y-auto",children:(0,q.jsxs)("table",{className:"w-full tabular-nums",children:[(0,q.jsx)("thead",{className:"sticky top-0 bg-card text-muted-foreground",children:(0,q.jsxs)("tr",{children:[(0,q.jsx)("th",{className:"text-left font-normal",children:"Time"}),(0,q.jsx)("th",{className:"text-right font-normal",children:"Avg"}),(0,q.jsx)("th",{className:"text-right font-normal",children:"Min"}),(0,q.jsx)("th",{className:"text-right font-normal",children:"Max"}),(0,q.jsx)("th",{className:"text-right font-normal",children:"Reads"})]})}),(0,q.jsx)("tbody",{className:"font-mono",children:t.series.buckets.toReversed().map(e=>(0,q.jsxs)("tr",{children:[(0,q.jsx)("td",{children:new Date(e.t).toLocaleString([],{dateStyle:"short",timeStyle:"medium"})}),(0,q.jsx)("td",{className:"text-right",children:Number(e.avg.toPrecision(4))}),(0,q.jsx)("td",{className:"text-right",children:Number(e.min.toPrecision(4))}),(0,q.jsx)("td",{className:"text-right",children:Number(e.max.toPrecision(4))}),(0,q.jsx)("td",{className:"text-right",children:e.count})]},e.t))})]})})]})]})]})},To=({device:e,header:t,transitionName:r,morph:n,onClose:i})=>{let s=(0,dD.useRef)(null),[a,o]=(0,dD.useState)(Te[1]),l=((e,t)=>{let[r,n]=(0,dD.useState)({}),i=e.points.map(e=>e.id).join(",");return(0,dD.useEffect)(()=>{let r,s=!1;n({});let a=i.split(",").filter(e=>""!==e),o=()=>dL.runPromise(dz.result(dJ.forEach(a,r=>{let n,i;return(n=e.id,i=Date.now(),Tt.pipe(js.flatMap(e=>e.status.history({query:{device:n,point:r,from:i-t.ms,to:i,buckets:240}})),dW.map(e=>({_tag:"series",series:e})),ja.catchTags({HistoryUnavailable:e=>jo.succeed({_tag:"off",message:e.message}),HistoryQueryInvalid:e=>jo.succeed({_tag:"off",message:e.message})}),jl.mapError(e=>new jQ({message:e.message})),ju.provide(jb.layer),jc.timeoutOrElse({duration:"5 seconds",orElse:()=>jd.fail(new jQ({message:"no answer within 5 s"}))}))).pipe(dW.map(e=>[r,e]))},{concurrency:4}))).then(e=>{s||(n(t=>"Success"===e._tag?{points:new Map(e.success)}:{...void 0===t.points?{}:{points:t.points},unreachable:e.failure.message}),r=setTimeout(()=>void o(),t.ms<=36e5?5e3:6e4))});return o(),()=>{s=!0,void 0!==r&&clearTimeout(r)}},[e.id,i,t]),r})(e,a),u=[...l.points?.values()??[]].some(e=>"series"===e._tag&&e.series.buckets.some(e=>e.count>1));return(0,dD.useEffect)(()=>{let e=s.current;if(null!==e)return e.open||e.showModal(),()=>e.close()},[]),(0,q.jsx)("dialog",{"aria-label":`${e.id}: values and history`,className:`device-dialog ${n?"morphing":""} m-auto max-h-[calc(100dvh-2rem)] w-[min(64rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border bg-card p-0 text-card-foreground shadow-2xl`,onCancel:e=>{e.preventDefault(),i()},onClick:e=>{e.target===e.currentTarget&&i()},ref:s,style:{viewTransitionName:r},children:(0,q.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,q.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,q.jsx)("div",{className:"min-w-0 flex-1",children:t}),(0,q.jsx)("button",{"aria-label":"Close",className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-muted hover:text-foreground",onClick:i,type:"button",children:"✕"})]}),(0,q.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,q.jsx)("div",{className:"inline-flex rounded-md border p-0.5",role:"group","aria-label":"Range",children:Te.map(e=>(0,q.jsx)("button",{"aria-pressed":e.id===a.id,className:`rounded px-3 py-1 text-sm ${e.id===a.id?"bg-muted font-medium":"text-muted-foreground hover:text-foreground"}`,onClick:()=>o(e),type:"button",children:e.label},e.id))}),(0,q.jsx)("p",{className:"text-xs text-muted-foreground",children:void 0!==l.unreachable?`history not reachable: ${l.unreachable}`:u?"line: average · band: lowest to highest read":"every read"})]}),(0,q.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:e.points.map(e=>(0,q.jsx)(Ta,{history:l.points?.get(e.id),point:e},e.id))})]})})};function Tl(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n}let Tu=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Tc=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Td=[],Tf=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],i=r.nextPart.get(n);if(i){let r=Tf(e,t+1,i);if(r)return r}let s=r.validators;if(null===s)return;let a=0===t?e.join("-"):e.slice(t).join("-"),o=s.length;for(let e=0;e<o;e++){let t=s[e];if(t.validator(a))return t.classGroupId}},Th=(e,t)=>{let r=Tc();for(let n in e)Tp(e[n],r,n,t);return r},Tp=(e,t,r,n)=>{let i=e.length;for(let s=0;s<i;s++)Tm(e[s],t,r,n)},Tm=(e,t,r,n)=>{"string"==typeof e?Tg(e,t,r):"function"==typeof e?Tb(e,t,r,n):Ty(e,t,r,n)},Tg=(e,t,r)=>{(""===e?t:Tv(t,e)).classGroupId=r},Tb=(e,t,r,n)=>{Tx(e)?Tp(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},Ty=(e,t,r,n)=>{let i=Object.entries(e),s=i.length;for(let e=0;e<s;e++){let[s,a]=i[e];Tp(a,Tv(t,s),r,n)}},Tv=(e,t)=>{let r=e,n=t.split("-"),i=n.length;for(let e=0;e<i;e++){let t=n[e],i=r.nextPart.get(t);i||(i=Tc(),r.nextPart.set(t,i)),r=i}return r},Tx=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Tw=[],TS=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),Tk=/\s+/,T_=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=T_(e[n]))&&(r&&(r+=" "),r+=t);return r},TE=[],TC=e=>{let t=t=>t[e]||TE;return t.isThemeGetter=!0,t.themeKey=e,t},TI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,TA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Tj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,TN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,TM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,T$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,TU=e=>Tj.test(e),TB=e=>!!e&&!Number.isNaN(Number(e)),TP=e=>!!e&&Number.isInteger(Number(e)),TR=e=>e.endsWith("%")&&TB(e.slice(0,-1)),TF=e=>TT.test(e),TL=()=>!0,Tz=e=>TO.test(e)&&!TN.test(e),TD=()=>!1,TH=e=>TM.test(e),TJ=e=>T$.test(e),TW=e=>!TV(e)&&!T2(e),Tq=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),TK=e=>Oe(e,Oi,TD),TV=e=>TI.test(e),TG=e=>Oe(e,Os,Tz),TY=e=>Oe(e,Oa,TB),TZ=e=>Oe(e,Ol,TL),TX=e=>Oe(e,Oo,TD),TQ=e=>Oe(e,Or,TD),T0=e=>Oe(e,On,TJ),T1=e=>Oe(e,Ou,TH),T2=e=>TA.test(e),T3=e=>Ot(e,Os),T5=e=>Ot(e,Oo),T4=e=>Ot(e,Or),T6=e=>Ot(e,Oi),T8=e=>Ot(e,On),T9=e=>Ot(e,Ou,!0),T7=e=>Ot(e,Ol,!0),Oe=(e,t,r)=>{let n=TI.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},Ot=(e,t,r=!1)=>{let n=TA.exec(e);return!!n&&(n[1]?t(n[1]):r)},Or=e=>"position"===e||"percentage"===e,On=e=>"image"===e||"url"===e,Oi=e=>"length"===e||"size"===e||"bg-size"===e,Os=e=>"length"===e,Oa=e=>"number"===e,Oo=e=>"family-name"===e,Ol=e=>"number"===e||"weight"===e,Ou=e=>"shadow"===e,Oc=(W=()=>{let e=TC("color"),t=TC("font"),r=TC("text"),n=TC("font-weight"),i=TC("tracking"),s=TC("leading"),a=TC("breakpoint"),o=TC("container"),l=TC("spacing"),u=TC("radius"),c=TC("shadow"),d=TC("inset-shadow"),f=TC("text-shadow"),h=TC("drop-shadow"),p=TC("blur"),m=TC("perspective"),g=TC("aspect"),b=TC("ease"),y=TC("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),T2,TV],S=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],_=()=>[T2,TV,l],E=()=>[TU,"full","auto",..._()],C=()=>[TP,"none","subgrid",T2,TV],I=()=>["auto",{span:["full",TP,T2,TV]},TP,T2,TV],A=()=>[TP,"auto",T2,TV],j=()=>["auto","min","max","fr",T2,TV],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",..._()],M=()=>[TU,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],$=()=>[o,TU,"screen","full","dvw","lvw","svw","min","max","fit",..._()],U=()=>[TU,"screen","full","lh","dvh","lvh","svh","min","max","fit",..._()],B=()=>[e,T2,TV],P=()=>[...x(),T4,TQ,{position:[T2,TV]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",T6,TK,{size:[T2,TV]}],L=()=>[TR,T3,TG],z=()=>["","none","full",u,T2,TV],D=()=>["",TB,T3,TG],H=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[TB,TR,T4,TQ],q=()=>["","none",p,T2,TV],K=()=>["none",TB,T2,TV],V=()=>["none",TB,T2,TV],G=()=>[TB,T2,TV],Y=()=>[TU,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[TF],breakpoint:[TF],color:[TL],container:[TF],"drop-shadow":[TF],ease:["in","out","in-out"],font:[TW],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[TF],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[TF],shadow:[TF],spacing:["px",TB],text:[TF],"text-shadow":[TF],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",TU,TV,T2,g]}],container:["container"],"container-type":[{"@container":["","normal","size",T2,TV]}],"container-named":[Tq],columns:[{columns:[TB,"auto",TV,T2,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[TP,"auto",T2,TV]}],basis:[{basis:[TU,"full","auto",o,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[TB,TU,"auto","initial","none",TV]}],grow:[{grow:["",TB,T2,TV]}],shrink:[{shrink:["",TB,T2,TV]}],order:[{order:[TP,"first","last","none",T2,TV]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pbs:[{pbs:_()}],pbe:[{pbe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[o,"screen",...M()]}],"min-w":[{"min-w":[o,"screen","none",...M()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh","none",...M()]}],"font-size":[{text:["base",r,T3,TG]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,T7,TZ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",TR,TV]}],"font-family":[{font:[T5,TX,t]}],"font-features":[{"font-features":[TV]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,T2,TV]}],"line-clamp":[{"line-clamp":[TB,"none",T2,TY]}],leading:[{leading:["none",s,..._()]}],"list-image":[{"list-image":["none",T2,TV]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",T2,TV]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[TB,"from-font","auto",T2,TG]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[TB,"auto",T2,TV]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"tab-size":[{tab:[TP,T2,TV]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T2,TV]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",T2,TV]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},TP,T2,TV],radial:["",T2,TV],conic:["",TP,T2,TV]},T8,T0]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-bs":[{"border-bs":D()}],"border-w-be":[{"border-be":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[TB,T2,TV]}],"outline-w":[{outline:["",TB,T3,TG]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",c,T9,T1]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",d,T9,T1]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[TB,TG]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",f,T9,T1]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[TB,T2,TV]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[TB]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[T2,TV]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[TB]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",T2,TV]}],filter:[{filter:["","none",T2,TV]}],blur:[{blur:q()}],brightness:[{brightness:[TB,T2,TV]}],contrast:[{contrast:[TB,T2,TV]}],"drop-shadow":[{"drop-shadow":["","none",h,T9,T1]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",TB,T2,TV]}],"hue-rotate":[{"hue-rotate":[TB,T2,TV]}],invert:[{invert:["",TB,T2,TV]}],saturate:[{saturate:[TB,T2,TV]}],sepia:[{sepia:["",TB,T2,TV]}],"backdrop-filter":[{"backdrop-filter":["","none",T2,TV]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[TB,T2,TV]}],"backdrop-contrast":[{"backdrop-contrast":[TB,T2,TV]}],"backdrop-grayscale":[{"backdrop-grayscale":["",TB,T2,TV]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[TB,T2,TV]}],"backdrop-invert":[{"backdrop-invert":["",TB,T2,TV]}],"backdrop-opacity":[{"backdrop-opacity":[TB,T2,TV]}],"backdrop-saturate":[{"backdrop-saturate":[TB,T2,TV]}],"backdrop-sepia":[{"backdrop-sepia":["",TB,T2,TV]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",T2,TV]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[TB,"initial",T2,TV]}],ease:[{ease:["linear","initial",b,T2,TV]}],delay:[{delay:[TB,T2,TV]}],animate:[{animate:["none",y,T2,TV]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,T2,TV]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[T2,TV,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[TP,T2,TV]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",T2,TV]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mbs":[{"scroll-mbs":_()}],"scroll-mbe":[{"scroll-mbe":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pbs":[{"scroll-pbs":_()}],"scroll-pbe":[{"scroll-pbe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",T2,TV]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[TB,T3,TG,TY]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},T=e=>{let t=I(e);if(t)return t;let r=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:a}=t,o=[],l=e.trim().split(Tk),u="";for(let e=l.length-1;e>=0;e-=1){let t,c=l[e],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=r(c);if(d){u=c+(u.length>0?" "+u:u);continue}let g=!!m;if(g){let e=(t=n(p.substring(0,m)))&&a[t]?n(p):void 0;e&&e!==t&&(t=e,g=!1)}else t=n(p);if(!t){if(!g||!(t=n(p))){u=c+(u.length>0?" "+u:u);continue}g=!1}let b=0===f.length?"":1===f.length?f[0]:s(f).join(":"),y=h?b+"!":b,v=y+t;if(o.indexOf(v)>-1)continue;o.push(v);let x=i(t,g);for(let e=0;e<x.length;++e){let t=x[e];o.push(y+t)}u=c+(u.length>0?" "+u:u)}return u})(e,C);return A(e,r),r},j=e=>{var t;let r;return I=(C={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),i=(i,s)=>{r[i]=s,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(i(e,t),t):void 0},set(e,t){e in r?r[e]=t:i(e,t)}}})((t=[].reduce((e,t)=>t(e),W())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,i=0,s=0,a=e.length;for(let o=0;o<a;o++){let a=e[o];if(0===n&&0===i){if(":"===a){r.push(e.slice(s,o)),s=o+1;continue}if("/"===a){t=o;continue}}"["===a?n++:"]"===a?n--:"("===a?i++:")"===a&&i--}let o=0===r.length?e:e.slice(s),l=o,u=!1;return o.endsWith("!")?(l=o.slice(0,-1),u=!0):o.startsWith("!")&&(l=o.slice(1),u=!0),TS(r,u,l,t&&t>s?t-s:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):TS(Tw,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(t),sortModifiers:(r=new Map,t.orderSensitiveModifiers.forEach((e,t)=>{r.set(e,1e6+t)}),e=>{let t=[],n=[];for(let i=0;i<e.length;i++){let s=e[i],a="["===s[0],o=r.has(s);a||o?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(s)):n.push(s)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let e=0;e<r.length;e++)t[r[e]]=!0;return t})(t),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return Th(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,i;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(i=t.slice(0,n))?"arbitrary.."+i:void 0)}let n=e.split("-"),i=+(""===n[0]&&n.length>1);return Tf(n,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],i=r[e];if(t){if(i){let e=Array(i.length+t.length);for(let t=0;t<i.length;t++)e[t]=i[t];for(let r=0;r<t.length;r++)e[i.length+r]=t[r];return e}return t}return i||Td}return r[e]||Td}}})(t)}).cache.get,A=C.cache.set,j=T,T(e)},(...e)=>j(((...e)=>{let t,r,n=0,i="";for(;n<e.length;)(t=e[n++])&&(r=T_(t))&&(i&&(i+=" "),i+=r);return i})(...e))),Od=(O="inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap",N={variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",success:"border-transparent bg-success text-white",warning:"border-transparent bg-warning text-black",outline:"text-foreground"}},defaultVariants:{variant:"default"}},e=>{var t;if((null==N?void 0:N.variants)==null)return Tl(O,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:r,defaultVariants:n}=N,i=Object.keys(r).map(t=>{let i=null==e?void 0:e[t],s=null==n?void 0:n[t];if(null===i)return null;let a=Tu(i)||Tu(s);return r[t][a]}),s=e&&Object.entries(e).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return Tl(O,i,null==N||null==(t=N.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:r,className:i,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...s}[t]):({...n,...s})[t]===r})?[...e,r,i]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)}),Of=({className:e,variant:t,...r})=>(0,q.jsx)("span",{"data-slot":"badge",className:((...e)=>Oc(Tl(e)))(Od({variant:t}),e),...r}),Oh=({className:e,...t})=>(0,q.jsx)("div",{"data-slot":"card",className:((...e)=>Oc(Tl(e)))("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...t}),Op=({className:e,...t})=>(0,q.jsx)("div",{"data-slot":"card-header",className:((...e)=>Oc(Tl(e)))("grid auto-rows-min items-start gap-1.5 px-5",e),...t}),Om=({className:e,...t})=>(0,q.jsx)("div",{"data-slot":"card-title",className:((...e)=>Oc(Tl(e)))("leading-none font-semibold",e),...t}),Og=({className:e,...t})=>(0,q.jsx)("div",{"data-slot":"card-description",className:((...e)=>Oc(Tl(e)))("text-sm text-muted-foreground",e),...t}),Ob=({className:e,...t})=>(0,q.jsx)("div",{"data-slot":"card-content",className:((...e)=>Oc(Tl(e)))("px-5",e),...t}),Oy=({className:e,...t})=>(0,q.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,q.jsx)("table",{"data-slot":"table",className:((...e)=>Oc(Tl(e)))("w-full caption-bottom text-sm",e),...t})}),Ov=({className:e,...t})=>(0,q.jsx)("thead",{"data-slot":"table-header",className:((...e)=>Oc(Tl(e)))("[&_tr]:border-b",e),...t}),Ox=({className:e,...t})=>(0,q.jsx)("tbody",{"data-slot":"table-body",className:((...e)=>Oc(Tl(e)))("[&_tr:last-child]:border-0",e),...t}),Ow=({className:e,...t})=>(0,q.jsx)("tr",{"data-slot":"table-row",className:((...e)=>Oc(Tl(e)))("border-b transition-colors hover:bg-muted/50",e),...t}),OS=({className:e,...t})=>(0,q.jsx)("th",{"data-slot":"table-head",className:((...e)=>Oc(Tl(e)))("h-9 px-2 text-left align-middle font-medium whitespace-nowrap text-muted-foreground",e),...t}),Ok=({className:e,...t})=>(0,q.jsx)("td",{"data-slot":"table-cell",className:((...e)=>Oc(Tl(e)))("p-2 align-middle whitespace-nowrap",e),...t}),O_=({point:e,now:t})=>{let[r]=(0,dD.useState)(e.ts),n=void 0!==e.ts&&e.ts!==r;return(0,q.jsxs)("span",{className:`rounded px-1 ${n?"motion-safe:animate-[value-changed_1.2s_ease-out]":""}`,title:void 0===e.ts?"nothing sent yet":`changed ${j9(e.ts,t)}`,children:[j6(e.value)," ",(0,q.jsx)("span",{className:"text-muted-foreground",children:j4(e.unit)})]},e.ts)},OE={"modbus-tcp":"Modbus TCP","bacnet-ip":"BACnet/IP",simulator:"Simulated"},OC=({device:e,now:t})=>{let r=((e,t)=>{if("failing"===e.status)return{_tag:"failing",reason:e.reason??"failing",lastSuccess:e.lastSuccess};if("starting"===e.status)return{_tag:"starting"};let r=Math.max(3*e.pollIntervalMs,15e3);return void 0!==e.lastSuccess&&t-e.lastSuccess<=r?{_tag:"live"}:{_tag:"late",lastSuccess:e.lastSuccess}})(e,t);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,q.jsx)(Om,{className:"font-mono",children:e.id}),(e=>{switch(e._tag){case"live":return(0,q.jsx)(Of,{variant:"success",children:"ok"});case"starting":return(0,q.jsx)(Of,{variant:"secondary",children:"starting"});case"late":return(0,q.jsx)(Of,{variant:"warning",children:"late"});case"failing":return(0,q.jsx)(Of,{variant:"destructive",children:e.reason})}})(r)]}),(0,q.jsxs)(Og,{children:[OE[e.protocol]," · ",((e,t,r)=>{let n,i=`read ${(n=e.pollIntervalMs/1e3)<60?`every ${Number(n.toFixed(1))} s`:n<3600?`every ${Number((n/60).toFixed(1))} min`:`every ${Number((n/3600).toFixed(1))} h`}`;switch(t._tag){case"live":case"starting":return i;case"late":case"failing":return void 0===t.lastSuccess?`${i} \xb7 no answer yet`:`${i} \xb7 no answer for ${j8(t.lastSuccess,r)}`}})(e,r,t)]})]})},OI=e=>`device-${e.id}`,OA=({device:e,now:t,open:r,onOpen:n})=>(0,q.jsxs)(Oh,{"aria-haspopup":"dialog","aria-label":`${e.id}: open history`,className:"cursor-pointer transition-shadow hover:shadow-md hover:ring-1 hover:ring-ring/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},role:"button",style:{viewTransitionName:r?"none":OI(e)},tabIndex:0,children:[(0,q.jsx)(Op,{children:(0,q.jsx)(OC,{device:e,now:t})}),(0,q.jsx)(Ob,{children:(0,q.jsxs)(Oy,{children:[(0,q.jsx)(Ov,{children:(0,q.jsxs)(Ow,{children:[(0,q.jsx)(OS,{children:"Point"}),(0,q.jsx)(OS,{className:"text-right",children:"Value"})]})}),(0,q.jsx)(Ox,{children:e.points.map(e=>(0,q.jsxs)(Ow,{children:[(0,q.jsx)(Ok,{children:(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)("span",{title:e.name,children:e.id}),e.writable?(0,q.jsx)(Of,{variant:"outline",children:"writable"}):null]})}),(0,q.jsx)(Ok,{className:"text-right font-mono tabular-nums",children:(0,q.jsx)(O_,{point:e,now:t},e.id)})]},e.id))})]})})]}),Oj=()=>"function"==typeof document.startViewTransition&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches,OT=e=>{if(!Oj())return e();document.startViewTransition(()=>(0,dH.flushSync)(e))},OO=({buffer:e,stale:t})=>{let r,n=e=>t?"page is not reaching the gateway":e;return void 0===e?(0,q.jsx)(Oh,{children:(0,q.jsxs)(Op,{children:[(0,q.jsx)(Og,{children:"Buffer"}),(0,q.jsx)(Om,{className:"text-2xl",children:"off"}),(0,q.jsx)(Og,{children:n("values are lost while the broker is down")})]})}):(0,q.jsx)(Oh,{children:(0,q.jsxs)(Op,{children:[(0,q.jsx)(Og,{children:"Buffer"}),(0,q.jsxs)(Om,{className:"text-2xl tabular-nums",children:[e.rows.toLocaleString(),"/",e.maxRows.toLocaleString()]}),(0,q.jsx)(Og,{className:e.dropped>0&&!t?"text-destructive":"",children:n(e.dropped>0?`${e.dropped.toLocaleString()} dropped since start`:0===e.rows?"messages waiting for the broker":`messages waiting for the broker (${(r=e.rows/e.maxRows*100)<1?`${Math.max(r,.1).toFixed(1)} %`:`${Math.round(r)} %`} full)`)})]})})},ON=({status:e,stale:t})=>{let r=e.devices.filter(e=>"failing"===e.status).length,n=e.devices.filter(e=>"ok"===e.status).length;return(0,q.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,q.jsx)(Oh,{children:(0,q.jsxs)(Op,{children:[(0,q.jsx)(Og,{children:"Broker"}),(0,q.jsx)(Om,{className:`text-2xl ${e.broker.connected?"":"text-destructive"}`,children:e.broker.connected?"connected":"disconnected"}),(0,q.jsx)(Og,{className:"truncate",title:e.broker.url,children:e.broker.connected?`to ${e.broker.url}`:void 0===e.buffer?`${e.broker.url}: values are lost until it is back`:`${e.broker.url}: values wait in the buffer`})]})}),(0,q.jsx)(Oh,{children:(0,q.jsxs)(Op,{children:[(0,q.jsx)(Og,{children:"Devices"}),(0,q.jsxs)(Om,{className:"text-2xl tabular-nums",children:[n,"/",e.devices.length]}),(0,q.jsx)(Og,{className:r>0?"text-destructive":"",children:r>0?`devices answering, ${r} failing`:n===e.devices.length?"devices answering":`devices answering, ${e.devices.length-n} starting`})]})}),(0,q.jsx)(OO,{buffer:e.buffer,stale:t})]})},OM=({label:e,value:t,warn:r})=>(0,q.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,q.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),(0,q.jsx)("span",{className:`font-mono text-sm tabular-nums ${!0===r?"text-amber-600 dark:text-amber-400":""}`,children:t})]}),O$=({host:e})=>{let t=e.throttled?.now??[];return(0,q.jsxs)(Oh,{children:[(0,q.jsxs)(Op,{children:[(0,q.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,q.jsx)(Om,{children:"Host"}),(0,q.jsxs)("div",{className:"flex flex-wrap gap-2",children:[t.length>0?(0,q.jsx)("span",{className:"text-xs text-muted-foreground",children:"in the last minute"}):null,t.map(e=>(0,q.jsx)(Of,{variant:"destructive",children:e.replaceAll("_"," ")},e))]})]}),(0,q.jsxs)(Og,{children:["gateway ",e.version," · Node ",e.node,void 0===e.throttled||e.throttled.watched.includes("throttled")?null:" · power: under-voltage only (this kernel shows no throttling; vcgencmd get_throttled does)"]})]}),(0,q.jsx)(Ob,{children:(0,q.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,q.jsx)(OM,{label:"Memory",value:j7(e.memoryBytes)}),(0,q.jsx)(OM,{label:"CPU",value:`${e.cpuPercent.toFixed(1)} %`}),(0,q.jsx)(OM,{label:"Event loop lag (max, 1 min)",value:`${e.eventLoopLagMs.max} ms`,warn:e.eventLoopLagMs.max>=1e3}),(0,q.jsx)(OM,{label:"Temperature",value:void 0===e.temperatureC?"–":`${e.temperatureC.toFixed(1)} \xb0C`,warn:(e.temperatureC??0)>=80}),(0,q.jsx)(OM,{label:"Buffer disk free",value:void 0===e.diskFreeBytes?"–":j7(e.diskFreeBytes),warn:void 0!==e.diskFreeBytes&&e.diskFreeBytes<0x4000000}),(0,q.jsx)(OM,{label:"Open files",value:void 0===e.openFds?"–":String(e.openFds)}),(0,q.jsx)(OM,{label:"Clock steps",value:String(e.clockSteps),warn:e.clockSteps>0}),(0,q.jsx)(OM,{label:"Heap",value:j7(e.heapBytes)})]})})]})},OU={value:"default",metadata:"secondary",health:"outline","command result":"warning",other:"outline"},OB=({now:e,prefix:t})=>{let r=(()=>{let[e,t]=(0,dD.useState)(void 0);return(0,dD.useEffect)(()=>{let e,r=!1,n=()=>dL.runPromise(dz.result(j3)).then(i=>{r||("Success"===i._tag&&t(i.success),e=setTimeout(()=>void n(),2e3))});return n(),()=>{r=!0,void 0!==e&&clearTimeout(e)}},[]),e})();return void 0===r?(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}):0===r.messages.length?(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing published yet."}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Oy,{children:[(0,q.jsx)(Ov,{children:(0,q.jsxs)(Ow,{children:[(0,q.jsx)(OS,{children:"Topic"}),(0,q.jsx)(OS,{children:"Latest payload"}),(0,q.jsx)(OS,{className:"text-right",children:"Messages"}),(0,q.jsx)(OS,{className:"text-right",children:"Sent at"})]})}),(0,q.jsx)(Ox,{children:r.messages.map(r=>{let n,i="$gateway"===(n=r.topic.split("/"))[2]&&"health"===n[4]?"health":4===n.length?"value":5===n.length&&"$meta"===n[4]?"metadata":6===n.length&&"$set"===n[4]&&"result"===n[5]?"command result":"other";return(0,q.jsxs)(Ow,{children:[(0,q.jsx)(Ok,{className:"align-top",children:(0,q.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,q.jsxs)("span",{className:"font-mono text-xs",children:[(0,q.jsx)("span",{className:"text-muted-foreground",children:t}),r.topic.slice(t.length)]}),(0,q.jsxs)("div",{className:"flex gap-1",children:[(0,q.jsx)(Of,{variant:OU[i],children:i}),r.retained?(0,q.jsx)(Of,{variant:"outline",title:"The broker keeps it and gives it to every subscriber that connects later",children:"retained"}):null]})]})}),(0,q.jsx)(Ok,{className:"max-w-md align-top",children:(0,q.jsxs)("code",{className:"block truncate font-mono text-xs",title:r.payload,children:[r.payload,r.truncated?"…":""]})}),(0,q.jsx)(Ok,{className:"text-right align-top tabular-nums",children:r.count.toLocaleString()}),(0,q.jsx)(Ok,{className:"text-right align-top text-muted-foreground",children:j9(r.at,e)})]},r.topic)})})]}),r.droppedTopics>0?(0,q.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:[r.droppedTopics.toLocaleString()," more topics are not shown: the gateway keeps the latest message of at most ",r.messages.length.toLocaleString(),"."]}):null]})},OP=({status:e})=>{let t=e.devices.reduce((e,t)=>e+t.points.length,0),[r,n]=(0,dD.useState)(t<=50),i=`${e.site}/${e.building}/`;return(0,q.jsxs)(Oh,{children:[(0,q.jsxs)(Op,{children:[(0,q.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,q.jsx)(Om,{children:"Messages"}),(0,q.jsx)("button",{type:"button",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",onClick:()=>n(e=>!e),children:r?"Hide":"Show"})]}),(0,q.jsxs)(Og,{children:["What the gateway publishes to the broker, the latest message on each topic: what a client subscribed to"," ",(0,q.jsxs)("code",{className:"font-mono",children:[i,"#"]})," receives. A value goes to"," ",(0,q.jsx)("code",{className:"font-mono",children:"site/building/device/point"})," as its publish mode says (every read, once per interval, or when it changes), its metadata (name, unit, Brick class) to"," ",(0,q.jsx)("code",{className:"font-mono",children:"…/$meta"}),", and the gateway's health to"," ",(0,q.jsxs)("code",{className:"font-mono",children:["…/$gateway/",e.id,"/health"]}),"."]})]}),r?(0,q.jsx)(Ob,{children:(0,q.jsx)(OB,{now:e.now,prefix:i})}):null]})},OR=({status:e})=>(0,q.jsxs)(Oh,{children:[(0,q.jsxs)(Op,{children:[(0,q.jsx)(Om,{children:"Recent commands"}),(0,q.jsx)(Og,{children:"Commands arrive over MQTT on …/point/$set; this page only shows them."})]}),(0,q.jsx)(Ob,{children:0===e.commands.length?(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"No commands since the gateway started."}):(0,q.jsxs)(Oy,{children:[(0,q.jsx)(Ov,{children:(0,q.jsxs)(Ow,{children:[(0,q.jsx)(OS,{children:"When"}),(0,q.jsx)(OS,{children:"Point"}),(0,q.jsx)(OS,{children:"Outcome"})]})}),(0,q.jsx)(Ox,{children:e.commands.map(t=>(0,q.jsxs)(Ow,{children:[(0,q.jsx)(Ok,{className:"text-muted-foreground",children:j9(t.at,e.now)}),(0,q.jsxs)(Ok,{className:"font-mono",children:[t.device,"/",t.point]}),(0,q.jsx)(Ok,{children:(0,q.jsxs)(Of,{variant:"written"===t.status?"success":"rejected"===t.status?"warning":"destructive",children:[t.status,void 0===t.reason?"":`: ${t.reason}`]})})]},`${t.at}-${t.device}-${t.point}`))})]})})]}),OF=({load:e})=>{switch(e._tag){case"loading":return null;case"unreachable":return(0,q.jsx)(Of,{variant:"destructive",children:"gateway unreachable"});case"ok":return(0,q.jsxs)(Of,{variant:"outline",title:"The page asks the gateway every 2 s",children:[(0,q.jsx)("span",{"aria-hidden":"true",className:"size-2 rounded-full bg-success motion-safe:animate-pulse"}),"Live"]})}};e.s(["default",0,()=>{let[e,t]=(0,dD.useState)({_tag:"loading"}),[r,n]=(0,dD.useState)(void 0);(0,dD.useEffect)(()=>{let e,r=!1,n=()=>dL.runPromise(dz.result(j2)).then(i=>{r||(t(e=>"Success"===i._tag?{_tag:"ok",status:i.success}:{_tag:"unreachable",..."ok"===e._tag?{last:e.status}:"unreachable"===e._tag&&void 0!==e.last?{last:e.last}:{}}),e=setTimeout(()=>void n(),2e3))});return n(),()=>{r=!0,void 0!==e&&clearTimeout(e)}},[]);let i="ok"===e._tag?e.status:"unreachable"===e._tag?e.last:void 0,s=i?.devices.find(e=>e.id===r);return(0,q.jsxs)("main",{className:"mx-auto flex max-w-6xl flex-col gap-6 p-4 sm:p-8",children:[(0,q.jsxs)("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"OT Gateway"}),void 0===i?null:(0,q.jsxs)("p",{className:"text-sm text-muted-foreground",children:[i.site," / ",i.building," · gateway ",i.id," · up ",j8(i.since,i.now)]})]}),(0,q.jsx)(OF,{load:e})]}),void 0===i?(0,q.jsx)("p",{className:"text-muted-foreground",children:"loading"===e._tag?"Loading…":"The gateway does not answer."}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ON,{status:i,stale:"ok"!==e._tag}),void 0===i.host?null:(0,q.jsx)(O$,{host:i.host}),(0,q.jsx)("section",{className:"grid gap-4 lg:grid-cols-2",children:i.devices.map(e=>(0,q.jsx)(OA,{device:e,now:i.now,onOpen:()=>OT(()=>n(e.id)),open:e.id===r},e.id))}),void 0===s?null:(0,q.jsx)(To,{device:s,header:(0,q.jsx)(OC,{device:s,now:i.now}),morph:Oj(),onClose:()=>OT(()=>n(void 0)),transitionName:OI(s)}),(0,q.jsx)(OP,{status:i}),(0,q.jsx)(OR,{status:i})]})]})}],39798)},22484,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),a=s[0],o=s[1],u=new i((a+o)*3/4-o),c=0,d=o>0?a-4:a;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],a=0,o=n-i;a<o;a+=16383)s.push(function(e,t,n){for(var i,s=[],a=t;a<n;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,a,a+16383>o?o:a+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=s.length;a<o;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),i=r(321),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var s=0|h(n,i),l=a(s),u=l.write(n,i);return u!==s&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,r);var p=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(e).length;default:if(i)return n?-1:E(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i,s,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=T[e[s]];return i}(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,s=t,a=r,0===s&&a===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var s,a=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(s=r;s<o;s++)if(u(e,s)===u(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===l)return c*a}else -1!==c&&(s-=s-c),c=-1}else for(r+l>o&&(r=o-l),s=r;s>=0;s--){for(var d=!0,f=0;f<l;f++)if(u(e,s+f)!==u(t,f)){d=!1;break}if(d)return s}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(j(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),j(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(j(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(j(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,a=r-t,l=Math.min(s,a),u=this.slice(n,i),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){s=u[d],a=c[d];break}return s<a?-1:+(a<s)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function y(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,a,o,l,u=e[i],c=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(s=e[i+1]))==128&&(l=(31&u)<<6|63&s)>127&&(c=l);break;case 3:s=e[i+1],a=e[i+2],(192&s)==128&&(192&a)==128&&(l=(15&u)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:s=e[i+1],a=e[i+2],o=e[i+3],(192&s)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=d}var f=n,h=f.length;if(h<=4096)return String.fromCharCode.apply(String,f);for(var p="",m=0;m<h;)p+=String.fromCharCode.apply(String,f.slice(m,m+=4096));return p}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function w(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,t,r,n,s){return t*=1,r>>>=0,s||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,s){return t*=1,r>>>=0,s||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,s,a,o,l,u,c,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o,l=parseInt(t.substr(2*a,2),16);if((o=l)!=o)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return i=t,s=r,A(E(e,this.length-i),this,i,s);case"ascii":return a=t,o=r,A(C(e),this,a,o);case"latin1":case"binary":return function(e,t,r,n){return A(C(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,A(I(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,A(function(e,t){for(var r,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,d);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;x(this,e,t,r,i,0)}var s=1,a=0;for(this[t]=255&e;++a<r&&(s*=256);)this[t+a]=e/s&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;x(this,e,t,r,i,0)}var s=r-1,a=1;for(this[t+s]=255&e;--s>=0&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%l]}return this};var _=/[^+/0-9A-Za-z-_]/g;function E(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function C(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function I(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var T=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},321:function(e,t){t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-c)-1,h>>=-c,c+=o;c>0;s=256*s+e[t+d],d+=f,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===s)s=1-u;else{if(s===l)return a?0/0:(h?-1:1)*2e308;a+=Math.pow(2,n),s-=u}return(h?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,l,u=8*s-i-1,c=(1<<u)-1,d=c>>1,f=5960464477539062e-23*(23===i),h=n?0:s-1,p=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(o=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=c?(o=0,a=c):a+d>=1?(o=(t*l-1)*Math.pow(2,i),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&o,h+=p,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;e[r+h]=255&a,h+=p,a/=256,u-=8);e[r+h-p]|=128*m}}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},a=!0;try{n[e](r,r.exports,s),a=!1}finally{a&&delete i[e]}return r.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.4.4_@types+node@22.20.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/next/dist/compiled/buffer/",t.exports=s(230)}]);
|