@seanmozeik/tripwire 0.6.5 → 0.6.7

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/dist/tripwire.js CHANGED
@@ -1,96 +1,96 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun @bytecode @bun-cjs
3
- (function(exports, require, module, __filename, __dirname) {var lA=Object.create;var{getPrototypeOf:rA,defineProperty:R9,getOwnPropertyNames:qW,getOwnPropertyDescriptor:oA}=Object,DW=Object.prototype.hasOwnProperty;function BW(Q){return this[Q]}var nA,iA,O=(Q,X,Y)=>{var J=Q!=null&&typeof Q==="object";if(J){var $=X?nA??=new WeakMap:iA??=new WeakMap,Z=$.get(Q);if(Z)return Z}Y=Q!=null?lA(rA(Q)):{};let G=X||!Q||!Q.__esModule?R9(Y,"default",{value:Q,enumerable:!0}):Y;for(let K of qW(Q))if(!DW.call(G,K))R9(G,K,{get:BW.bind(Q,K),enumerable:!0});if(J)$.set(Q,G);return G},aA=(Q)=>{var X=(_W??=new WeakMap).get(Q),Y;if(X)return X;if(X=R9({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var J of qW(Q))if(!DW.call(X,J))R9(X,J,{get:BW.bind(Q,J),enumerable:!(Y=oA(Q,J))||Y.enumerable})}return _W.set(Q,X),X},_W,n2=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var sA=(Q)=>Q;function tA(Q,X){this[Q]=sA.bind(null,X)}var G6=(Q,X)=>{for(var Y in X)R9(Q,Y,{get:X[Y],enumerable:!0,configurable:!0,set:tA.bind(X,Y)})};var yM=n2((r60,kM)=>{var ar=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],vM=/[\n\r\u2028\u2029]/,sr=/[\s#!"$&'():;<=>@\\^`|]/g;kM.exports=function(X){return X.map(function(Y){if(Y==="")return"''";if(Y&&typeof Y==="object"){if(Y.op==="glob"){if(typeof Y.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(vM.test(Y.pattern))throw TypeError("glob `pattern` must not contain line terminators");return Y.pattern.replace(sr,"\\$&")}if(typeof Y.op==="string"){if(ar.indexOf(Y.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(Y.op));return Y.op.replace(/[\s\S]/g,"\\$&")}if(typeof Y.comment==="string"){if(vM.test(Y.comment))throw TypeError("`comment` must not contain line terminators");return"#"+Y.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(Y)&&!/'/.test(Y))return"'"+Y.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Y))return'"'+Y.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Y).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var cM=n2((o60,pM)=>{var dM="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",bM=new RegExp("^"+dM+"$"),gM="|&;()<> \\t",tr='"((\\\\"|[^"])*?)"',er="'((\\\\'|[^'])*?)'",Qo=/^#$/,hM="'",mM='"',sK="$",Y5="",Xo=4294967296;for(f2=0;f2<4;f2++)Y5+=(Xo*Math.random()).toString(16);var f2,Yo=new RegExp("^"+Y5);function Jo(Q,X){var Y=X.lastIndex,J=[],$;while($=X.exec(Q))if(J.push($),X.lastIndex===$.index)X.lastIndex+=1;return X.lastIndex=Y,J}function $o(Q,X,Y){var J=typeof Q==="function"?Q(Y):Q[Y];if(typeof J>"u"&&Y!="")J="";else if(typeof J>"u")J="$";if(typeof J==="object")return X+Y5+JSON.stringify(J)+Y5;return X+J}function Zo(Q,X,Y){if(!Y)Y={};var J=Y.escape||"\\",$="(\\"+J+`['"`+gM+`]|[^\\s'"`+gM+"])+",Z=new RegExp(["("+dM+")","("+$+"|"+tr+"|"+er+")+"].join("|"),"g"),G=Jo(Q,Z);if(G.length===0)return[];if(!X)X={};var K=!1;return G.map(function(W){var H=W[0];if(!H||K)return;if(bM.test(H))return{op:H};var _=!1,V=!1,q="",D=!1,U;function P(){U+=1;var w,R,i=H.charAt(U);if(i==="{"){if(U+=1,H.charAt(U)==="}")throw Error("Bad substitution: "+H.slice(U-2,U+1));if(w=H.indexOf("}",U),w<0)throw Error("Bad substitution: "+H.slice(U));R=H.slice(U,w),U=w}else if(/[*@#?$!_-]/.test(i))R=i,U+=1;else{var $1=H.slice(U);if(w=$1.match(/[^\w\d_]/),!w)R=$1,U=H.length;else R=$1.slice(0,w.index),U+=w.index-1}return $o(X,"",R)}for(U=0;U<H.length;U++){var L=H.charAt(U);if(D=D||!_&&(L==="*"||L==="?"),V)q+=L,V=!1;else if(_)if(L===_)_=!1;else if(_==hM)q+=L;else if(L===J)if(U+=1,L=H.charAt(U),L===mM||L===J||L===sK)q+=L;else q+=J+L;else if(L===sK)q+=P();else q+=L;else if(L===mM||L===hM)_=L;else if(bM.test(L))return{op:H};else if(Qo.test(L)){K=!0;var M={comment:Q.slice(W.index+U+1)};if(q.length)return[q,M];return[M]}else if(L===J)V=!0;else if(L===sK)q+=P();else q+=L}if(D)return{op:"glob",pattern:q};return q}).reduce(function(W,H){return typeof H>"u"?W:W.concat(H)},[])}pM.exports=function(X,Y,J){var $=Zo(X,Y,J);if(typeof Y!=="function")return $;return $.reduce(function(Z,G){if(typeof G==="object")return Z.concat(G);var K=G.split(RegExp("("+Y5+".*?"+Y5+")","g"));if(K.length===1)return Z.concat(K[0]);return Z.concat(K.filter(Boolean).map(function(W){if(Yo.test(W))return JSON.parse(W.split(Y5)[1]);return W}))},[])}});var fM=n2((tK)=>{tK.quote=yM();tK.parse=cM()});var _i={};G6(_i,{runRulesSync:()=>WW,runRules:()=>Zi,normalizeToolName:()=>VW,decide:()=>HW,collectPreToolUseRules:()=>cA,collectPostToolUseRules:()=>fA});module.exports=aA(_i);var a7={};G6(a7,{runMain:()=>ux});var L1={};G6(L1,{squash:()=>j6,reasonAnnotations:()=>lT,prettyErrors:()=>AT,pretty:()=>iJ,map:()=>qT,makeInterruptReason:()=>WQ,makeFailReason:()=>GQ,makeDieReason:()=>KQ,isUnknownError:()=>cT,isTimeoutError:()=>ST,isReason:()=>nJ,isNoSuchElementError:()=>wT,isInterruptReason:()=>KT,isIllegalArgumentError:()=>kT,isFailReason:()=>ZT,isExceededCapacityError:()=>yT,isDone:()=>y7,isDieReason:()=>GT,isCause:()=>oJ,isAsyncFiberError:()=>mT,interruptors:()=>NT,interrupt:()=>_T,hasInterruptsOnly:()=>k7,hasInterrupts:()=>PT,hasFails:()=>BT,hasDies:()=>zT,fromReasons:()=>ZQ,findInterrupt:()=>RT,findFail:()=>UT,findErrorOption:()=>OT,findError:()=>E8,findDie:()=>FT,findDefect:()=>LT,filterInterruptors:()=>MT,fail:()=>HT,empty:()=>WT,done:()=>b7,die:()=>VT,combine:()=>DT,annotations:()=>rT,annotate:()=>uT,UnknownErrorTypeId:()=>pT,UnknownError:()=>fT,TypeId:()=>JT,TimeoutErrorTypeId:()=>ET,TimeoutError:()=>xT,StackTrace:()=>Mq,ReasonTypeId:()=>$T,NoSuchElementErrorTypeId:()=>CT,NoSuchElementError:()=>TT,InterruptorStackTrace:()=>Aq,IllegalArgumentErrorTypeId:()=>vT,IllegalArgumentError:()=>HQ,ExceededCapacityErrorTypeId:()=>bT,ExceededCapacityError:()=>gT,DoneTypeId:()=>IT,Done:()=>jT,AsyncFiberErrorTypeId:()=>hT,AsyncFiberError:()=>dT});var X0=(Q,X)=>{switch(X.length){case 0:return Q;case 1:return X[0](Q);case 2:return X[1](X[0](Q));case 3:return X[2](X[1](X[0](Q)));case 4:return X[3](X[2](X[1](X[0](Q))));case 5:return X[4](X[3](X[2](X[1](X[0](Q)))));case 6:return X[5](X[4](X[3](X[2](X[1](X[0](Q))))));case 7:return X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q)))))));case 8:return X[7](X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q))))))));case 9:return X[8](X[7](X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q)))))))));default:{let Y=Q;for(let J=0,$=X.length;J<$;J++)Y=X[J](Y);return Y}}},eA={pipe(){return X0(this,arguments)}},K6=function(){function Q(){}return Q.prototype=eA,Q}();var B=function(Q,X){if(typeof Q==="function")return function(){return Q(arguments)?X.apply(this,arguments):(Y)=>X(Y,...arguments)};switch(Q){case 0:case 1:throw RangeError(`Invalid arity ${Q}`);case 2:return function(Y,J){if(arguments.length>=2)return X(Y,J);return function($){return X($,Y)}};case 3:return function(Y,J,$){if(arguments.length>=3)return X(Y,J,$);return function(Z){return X(Z,Y,J)}};default:return function(){if(arguments.length>=Q)return X.apply(this,arguments);let Y=arguments;return function(J){return X(J,...Y)}}}};var g=(Q)=>Q;var Z1=(Q)=>()=>Q,P4=Z1(!0),AX=Z1(!1),i2=Z1(null),N8=Z1(void 0),Z5=N8;function a2(Q,...X){return X0(Q,X)}function UW(Q,X,Y,J,$,Z,G,K,W){switch(arguments.length){case 1:return Q;case 2:return function(){return X(Q.apply(this,arguments))};case 3:return function(){return Y(X(Q.apply(this,arguments)))};case 4:return function(){return J(Y(X(Q.apply(this,arguments))))};case 5:return function(){return $(J(Y(X(Q.apply(this,arguments)))))};case 6:return function(){return Z($(J(Y(X(Q.apply(this,arguments))))))};case 7:return function(){return G(Z($(J(Y(X(Q.apply(this,arguments)))))))};case 8:return function(){return K(G(Z($(J(Y(X(Q.apply(this,arguments))))))))};case 9:return function(){return W(K(G(Z($(J(Y(X(Q.apply(this,arguments)))))))))}}return}function p0(Q){let X=new WeakMap;return(Y)=>{if(X.has(Y))return X.get(Y);let J=Q(Y);return X.set(Y,J),J}}var M9=(Q)=>{let X=new Set(Reflect.ownKeys(Q));if(Q.constructor===Object)return X;if(Q instanceof Error)X.delete("stack");let Y=Object.getPrototypeOf(Q),J=Y;while(J!==null&&J!==Object.prototype){let $=Reflect.ownKeys(J);for(let Z=0;Z<$.length;Z++)X.add($[Z]);J=Object.getPrototypeOf(J)}if(X.has("constructor")&&typeof Q.constructor==="function"&&Y===Q.constructor.prototype)X.delete("constructor");return X},G5=new WeakSet;function X8(Q){return typeof Q==="string"}function A9(Q){return typeof Q==="number"}function OW(Q){return typeof Q==="boolean"}function zW(Q){return typeof Q==="bigint"}function s2(Q){return typeof Q==="symbol"}function wX(Q){return X8(Q)||A9(Q)||s2(Q)}function Y8(Q){return typeof Q==="function"}function FW(Q){return Q===void 0}function G1(Q){return Q!==void 0}function CX(Q){return Q!=null}function LW(Q){return!1}function t2(Q){return!0}function M1(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function e2(Q){return typeof Q==="object"&&Q!==null||Y8(Q)}var N=B(2,(Q,X)=>e2(Q)&&(X in Q)),W6=B(2,(Q,X)=>N(Q,"_tag")&&Q._tag===X);function PW(Q){return Q instanceof Error}function d8(Q){return N(Q,Symbol.iterator)||X8(Q)}var K0="~effect/interfaces/Hash",t=(Q)=>{switch(typeof Q){case"number":return p8(Q);case"bigint":return T0(Q.toString(10));case"boolean":return T0(String(Q));case"symbol":return T0(String(Q));case"string":return T0(Q);case"undefined":return T0("undefined");case"function":case"object":if(Q===null)return T0("null");else if(Q instanceof Date)return T0(Q.toISOString());else if(Q instanceof RegExp)return T0(Q.toString());else{if(G5.has(Q))return TX(Q);if(X3.has(Q))return X3.get(Q);let X=Jw(Q,()=>{if(Qw(Q))return Q[K0]();else if(typeof Q==="function")return TX(Q);else if(Array.isArray(Q)||ArrayBuffer.isView(Q))return w9(Q);else if(Q instanceof Map)return Xw(Q);else if(Q instanceof Set)return Yw(Q);return $3(Q)});return X3.set(Q,X),X}default:throw Error(`BUG: unhandled typeof ${typeof Q} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},TX=(Q)=>{if(!Q3.has(Q))Q3.set(Q,p8(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return Q3.get(Q)},u0=B(2,(Q,X)=>Q*53^X),IX=(Q)=>Q&3221225471|Q>>>1&1073741824,Qw=(Q)=>N(Q,K0),p8=(Q)=>{if(Q!==Q)return T0("NaN");if(Q===1/0)return T0("Infinity");if(Q===-1/0)return T0("-Infinity");let X=Q|0;if(X!==Q)X^=Q*4294967295;while(Q>4294967295)X^=Q/=4294967295;return IX(X)},T0=(Q)=>{let X=5381,Y=Q.length;while(Y)X=X*33^Q.charCodeAt(--Y);return IX(X)},J3=(Q,X)=>{let Y=12289;for(let J of X)Y^=u0(t(J),t(Q[J]));return IX(Y)},$3=(Q)=>J3(Q,M9(Q)),Z3=(Q,X)=>(Y)=>{let J=Q;for(let $ of Y)J^=X($);return IX(J)},w9=Z3(6151,t),Xw=Z3(T0("Map"),([Q,X])=>u0(t(Q),t(X))),Yw=Z3(T0("Set"),t),Q3=new WeakMap,X3=new WeakMap,Y3=new WeakSet;function Jw(Q,X){if(Y3.has(Q))return T0("[Circular]");Y3.add(Q);let Y=X();return Y3.delete(Q),Y}var W0="~effect/interfaces/Equal";function n(){if(arguments.length===1)return(Q)=>H6(Q,arguments[0]);return H6(arguments[0],arguments[1])}function H6(Q,X){if(Q===X)return!0;if(Q==null||X==null)return!1;let Y=typeof Q;if(Y!==typeof X)return!1;if(Y==="number"&&Q!==Q&&X!==X)return!0;if(Y!=="object"&&Y!=="function")return!1;if(G5.has(Q)||G5.has(X))return!1;return Gw(Q,X,Zw)}function $w(Q,X,Y){let J=G3.has(Q),$=K3.has(X);if(J&&$)return!0;if(J||$)return!1;G3.add(Q),K3.add(X);let Z=Y();return G3.delete(Q),K3.delete(X),Z}var G3=new WeakSet,K3=new WeakSet;function Zw(Q,X){if(t(Q)!==t(X))return!1;else if(Q instanceof Date){if(!(X instanceof Date))return!1;return Q.toISOString()===X.toISOString()}else if(Q instanceof RegExp){if(!(X instanceof RegExp))return!1;return Q.toString()===X.toString()}let Y=RW(Q),J=RW(X);if(Y!==J)return!1;let $=Y&&J;if(typeof Q==="function"&&!$)return!1;return $w(Q,X,()=>{if($)return Q[W0](X);else if(Array.isArray(Q)){if(!Array.isArray(X)||Q.length!==X.length)return!1;return Kw(Q,X)}else if(ArrayBuffer.isView(Q)){if(!ArrayBuffer.isView(X)||Q.byteLength!==X.byteLength)return!1;return Ww(Q,X)}else if(Q instanceof Map){if(!(X instanceof Map)||Q.size!==X.size)return!1;return Vw(Q,X)}else if(Q instanceof Set){if(!(X instanceof Set)||Q.size!==X.size)return!1;return _w(Q,X)}return Hw(Q,X)})}function Gw(Q,X,Y){let J=jX.get(Q);if(!J)J=new WeakMap,jX.set(Q,J);else if(J.has(X))return J.get(X);let $=Y(Q,X);J.set(X,$);let Z=jX.get(X);if(!Z)Z=new WeakMap,jX.set(X,Z);return Z.set(Q,$),$}var jX=new WeakMap;function Kw(Q,X){for(let Y=0;Y<Q.length;Y++)if(!H6(Q[Y],X[Y]))return!1;return!0}function Ww(Q,X){if(Q.length!==X.length)return!1;for(let Y=0;Y<Q.length;Y++)if(Q[Y]!==X[Y])return!1;return!0}function Hw(Q,X){let Y=M9(Q),J=M9(X);if(Y.size!==J.size)return!1;for(let $ of Y)if(!J.has($)||!H6(Q[$],X[$]))return!1;return!0}function EX(Q,X){return function(J,$){for(let[Z,G]of J){let K=!1;for(let[W,H]of $)if(Q(Z,W)&&X(G,H)){K=!0;break}if(!K)return!1}return!0}}var Vw=EX(H6,H6);function SX(Q){return function(Y,J){for(let $ of Y){let Z=!1;for(let G of J)if(Q($,G)){Z=!0;break}if(!Z)return!1}return!0}}var _w=SX(H6),RW=(Q)=>N(Q,W0),xX=()=>n;var NW=(Q)=>{return G5.add(Q),Q};var vX=Symbol.for("~effect/Redactable"),qw=(Q)=>N(Q,vX);function C9(Q){if(qw(Q))return W3(Q);return Q}function W3(Q){return Q[vX](globalThis[K5]?.context??Dw)}var K5="~effect/Fiber/currentFiber",Dw={"~effect/Context":{},mapUnsafe:new Map,pipe(){return X0(this,arguments)}};function v(Q,X){let Y=X?.space??0,J=new WeakSet,$=!Y?"":typeof Y==="number"?" ".repeat(Y):Y,Z=(H)=>$.repeat(H),G=(H,_)=>{let V=H?.constructor;return V&&V!==Object.prototype.constructor&&V.name?`${V.name}(${_})`:_},K=(H)=>{try{return Reflect.ownKeys(H)}catch{return["[ownKeys threw]"]}};function W(H,_=0){if(Array.isArray(H)){if(J.has(H))return MW;if(J.add(H),!$||H.length<=1)return`[${H.map((q)=>W(q,_)).join(",")}]`;let V=H.map((q)=>W(q,_+1)).join(`,
4
- `+Z(_+1));return`[
5
- ${Z(_+1)}${V}
6
- ${Z(_)}]`}if(H instanceof Date)return H3(H);if(!X?.ignoreToString&&N(H,"toString")&&typeof H.toString==="function"&&H.toString!==Object.prototype.toString&&H.toString!==Array.prototype.toString){let V=Bw(H);if(H instanceof Error&&H.cause)return`${V} (cause: ${W(H.cause,_)})`;return V}if(typeof H==="string")return JSON.stringify(H);if(typeof H==="number"||H==null||typeof H==="boolean"||typeof H==="symbol")return String(H);if(typeof H==="bigint")return String(H)+"n";if(typeof H==="object"||typeof H==="function"){if(J.has(H))return MW;if(J.add(H),vX in H)return v(W3(H));if(Symbol.iterator in H)return`${H.constructor.name}(${W(Array.from(H),_)})`;let V=K(H);if(!$||V.length<=1){let D=`{${V.map((U)=>`${R4(U)}:${W(H[U],_)}`).join(",")}}`;return G(H,D)}let q=`{
7
- ${V.map((D)=>`${Z(_+1)}${R4(D)}: ${W(H[D],_+1)}`).join(`,
3
+ (function(exports, require, module, __filename, __dirname) {var eC=Object.create;var{getPrototypeOf:Qj,defineProperty:YQ,getOwnPropertyNames:vK,getOwnPropertyDescriptor:Xj}=Object,xK=Object.prototype.hasOwnProperty;function bK(Q){return this[Q]}var Yj,$j,z=(Q,X,Y)=>{var $=Q!=null&&typeof Q==="object";if($){var J=X?Yj??=new WeakMap:$j??=new WeakMap,Z=J.get(Q);if(Z)return Z}Y=Q!=null?eC(Qj(Q)):{};let G=X||!Q||!Q.__esModule?YQ(Y,"default",{value:Q,enumerable:!0}):Y;for(let W of vK(Q))if(!xK.call(G,W))YQ(G,W,{get:bK.bind(Q,W),enumerable:!0});if($)J.set(Q,G);return G},Jj=(Q)=>{var X=(SK??=new WeakMap).get(Q),Y;if(X)return X;if(X=YQ({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var $ of vK(Q))if(!xK.call(X,$))YQ(X,$,{get:bK.bind(Q,$),enumerable:!(Y=Xj(Q,$))||Y.enumerable})}return SK.set(Q,X),X},SK,r3=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var Zj=(Q)=>Q;function Gj(Q,X){this[Q]=Zj.bind(null,X)}var p6=(Q,X)=>{for(var Y in X)YQ(Q,Y,{get:X[Y],enumerable:!0,configurable:!0,set:Gj.bind(X,Y)})};var uA=r3((TX0,cA)=>{var ka=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],fA=/[\n\r\u2028\u2029]/,ya=/[\s#!"$&'():;<=>@\\^`|]/g;cA.exports=function(X){return X.map(function(Y){if(Y==="")return"''";if(Y&&typeof Y==="object"){if(Y.op==="glob"){if(typeof Y.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(fA.test(Y.pattern))throw TypeError("glob `pattern` must not contain line terminators");return Y.pattern.replace(ya,"\\$&")}if(typeof Y.op==="string"){if(ka.indexOf(Y.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(Y.op));return Y.op.replace(/[\s\S]/g,"\\$&")}if(typeof Y.comment==="string"){if(fA.test(Y.comment))throw TypeError("`comment` must not contain line terminators");return"#"+Y.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(Y)&&!/'/.test(Y))return"'"+Y.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Y))return'"'+Y.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Y).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var sA=r3((IX0,aA)=>{var nA="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",lA=new RegExp("^"+nA+"$"),oA="|&;()<> \\t",ga='"((\\\\"|[^"])*?)"',ha="'((\\\\'|[^'])*?)'",ma=/^#$/,rA="'",iA='"',OK="$",y9="",da=4294967296;for(f3=0;f3<4;f3++)y9+=(da*Math.random()).toString(16);var f3,pa=new RegExp("^"+y9);function fa(Q,X){var Y=X.lastIndex,$=[],J;while(J=X.exec(Q))if($.push(J),X.lastIndex===J.index)X.lastIndex+=1;return X.lastIndex=Y,$}function ca(Q,X,Y){var $=typeof Q==="function"?Q(Y):Q[Y];if(typeof $>"u"&&Y!="")$="";else if(typeof $>"u")$="$";if(typeof $==="object")return X+y9+JSON.stringify($)+y9;return X+$}function ua(Q,X,Y){if(!Y)Y={};var $=Y.escape||"\\",J="(\\"+$+`['"`+oA+`]|[^\\s'"`+oA+"])+",Z=new RegExp(["("+nA+")","("+J+"|"+ga+"|"+ha+")+"].join("|"),"g"),G=fa(Q,Z);if(G.length===0)return[];if(!X)X={};var W=!1;return G.map(function(H){var K=H[0];if(!K||W)return;if(lA.test(K))return{op:K};var V=!1,_=!1,q="",D=!1,B;function F(){B+=1;var w,A,s=K.charAt(B);if(s==="{"){if(B+=1,K.charAt(B)==="}")throw Error("Bad substitution: "+K.slice(B-2,B+1));if(w=K.indexOf("}",B),w<0)throw Error("Bad substitution: "+K.slice(B));A=K.slice(B,w),B=w}else if(/[*@#?$!_-]/.test(s))A=s,B+=1;else{var L=K.slice(B);if(w=L.match(/[^\w\d_]/),!w)A=L,B=K.length;else A=L.slice(0,w.index),B+=w.index-1}return ca(X,"",A)}for(B=0;B<K.length;B++){var N=K.charAt(B);if(D=D||!V&&(N==="*"||N==="?"),_)q+=N,_=!1;else if(V)if(N===V)V=!1;else if(V==rA)q+=N;else if(N===$)if(B+=1,N=K.charAt(B),N===iA||N===$||N===OK)q+=N;else q+=$+N;else if(N===OK)q+=F();else q+=N;else if(N===iA||N===rA)V=N;else if(lA.test(N))return{op:K};else if(ma.test(N)){W=!0;var M={comment:Q.slice(H.index+B+1)};if(q.length)return[q,M];return[M]}else if(N===$)_=!0;else if(N===OK)q+=F();else q+=N}if(D)return{op:"glob",pattern:q};return q}).reduce(function(H,K){return typeof K>"u"?H:H.concat(K)},[])}aA.exports=function(X,Y,$){var J=ua(X,Y,$);if(typeof Y!=="function")return J;return J.reduce(function(Z,G){if(typeof G==="object")return Z.concat(G);var W=G.split(RegExp("("+y9+".*?"+y9+")","g"));if(W.length===1)return Z.concat(W[0]);return Z.concat(W.filter(Boolean).map(function(H){if(pa.test(H))return JSON.parse(H.split(y9)[1]);return H}))},[])}});var tA=r3((FK)=>{FK.quote=uA();FK.parse=sA()});var it={};p6(it,{runRulesSync:()=>TK,runRules:()=>ft,normalizeToolName:()=>EK,decide:()=>IK,collectPreToolUseRules:()=>sC,collectPostToolUseRules:()=>tC});module.exports=Jj(it);var pY={};p6(pY,{runMain:()=>Hk});var B1={};p6(B1,{squash:()=>CY,reasonAnnotations:()=>tI,prettyErrors:()=>SI,pretty:()=>iJ,map:()=>Z4,makeInterruptReason:()=>lQ,makeFailReason:()=>cQ,makeDieReason:()=>uQ,isUnknownError:()=>nI,isTimeoutError:()=>hI,isReason:()=>oJ,isNoSuchElementError:()=>vI,isInterruptReason:()=>zI,isIllegalArgumentError:()=>pI,isFailReason:()=>pQ,isExceededCapacityError:()=>fI,isDone:()=>TY,isDieReason:()=>BI,isCause:()=>lJ,isAsyncFiberError:()=>oI,interruptors:()=>II,interrupt:()=>RI,hasInterruptsOnly:()=>AY,hasInterrupts:()=>jI,hasFails:()=>LI,hasDies:()=>PI,fromReasons:()=>fQ,findInterrupt:()=>TI,findFail:()=>MI,findErrorOption:()=>wI,findError:()=>jY,findDie:()=>AI,findDefect:()=>CI,filterInterruptors:()=>EI,fail:()=>OI,empty:()=>rJ,done:()=>IY,die:()=>FI,combine:()=>NI,annotations:()=>eI,annotate:()=>sI,UnknownErrorTypeId:()=>iI,UnknownError:()=>aI,TypeId:()=>DI,TimeoutErrorTypeId:()=>gI,TimeoutError:()=>mI,StackTrace:()=>dD,ReasonTypeId:()=>UI,NoSuchElementErrorTypeId:()=>xI,NoSuchElementError:()=>bI,InterruptorStackTrace:()=>pD,IllegalArgumentErrorTypeId:()=>dI,IllegalArgumentError:()=>oQ,ExceededCapacityErrorTypeId:()=>cI,ExceededCapacityError:()=>uI,DoneTypeId:()=>kI,Done:()=>yI,AsyncFiberErrorTypeId:()=>lI,AsyncFiberError:()=>rI});var H0=(Q,X)=>{switch(X.length){case 0:return Q;case 1:return X[0](Q);case 2:return X[1](X[0](Q));case 3:return X[2](X[1](X[0](Q)));case 4:return X[3](X[2](X[1](X[0](Q))));case 5:return X[4](X[3](X[2](X[1](X[0](Q)))));case 6:return X[5](X[4](X[3](X[2](X[1](X[0](Q))))));case 7:return X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q)))))));case 8:return X[7](X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q))))))));case 9:return X[8](X[7](X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q)))))))));default:{let Y=Q;for(let $=0,J=X.length;$<J;$++)Y=X[$](Y);return Y}}},Wj={pipe(){return H0(this,arguments)}},f6=function(){function Q(){}return Q.prototype=Wj,Q}();var U=function(Q,X){if(typeof Q==="function")return function(){return Q(arguments)?X.apply(this,arguments):(Y)=>X(Y,...arguments)};switch(Q){case 0:case 1:throw RangeError(`Invalid arity ${Q}`);case 2:return function(Y,$){if(arguments.length>=2)return X(Y,$);return function(J){return X(J,Y)}};case 3:return function(Y,$,J){if(arguments.length>=3)return X(Y,$,J);return function(Z){return X(Z,Y,$)}};default:return function(){if(arguments.length>=Q)return X.apply(this,arguments);let Y=arguments;return function($){return X($,...Y)}}}};var u=(Q)=>Q;var V1=(Q)=>()=>Q,n4=V1(!0),O7=V1(!1),i3=V1(null),i8=V1(void 0),h9=i8;function n3(Q,...X){return H0(Q,X)}function s0(Q){let X=new WeakMap;return(Y)=>{if(X.has(Y))return X.get(Y);let $=Q(Y);return X.set(Y,$),$}}var JQ=(Q)=>{let X=new Set(Reflect.ownKeys(Q));if(Q.constructor===Object)return X;if(Q instanceof Error)X.delete("stack");let Y=Object.getPrototypeOf(Q),$=Y;while($!==null&&$!==Object.prototype){let J=Reflect.ownKeys($);for(let Z=0;Z<J.length;Z++)X.add(J[Z]);$=Object.getPrototypeOf($)}if(X.has("constructor")&&typeof Q.constructor==="function"&&Y===Q.constructor.prototype)X.delete("constructor");return X},m9=new WeakSet;function C8(Q){return typeof Q==="string"}function ZQ(Q){return typeof Q==="number"}function kK(Q){return typeof Q==="boolean"}function yK(Q){return typeof Q==="bigint"}function a3(Q){return typeof Q==="symbol"}function F7(Q){return C8(Q)||ZQ(Q)||a3(Q)}function r1(Q){return typeof Q==="function"}function gK(Q){return Q===void 0}function _1(Q){return Q!==void 0}function R7(Q){return Q!=null}function hK(Q){return!1}function s3(Q){return!0}function j1(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function t3(Q){return typeof Q==="object"&&Q!==null||r1(Q)}var C=U(2,(Q,X)=>t3(Q)&&(X in Q)),c6=U(2,(Q,X)=>C(Q,"_tag")&&Q._tag===X);function mK(Q){return Q instanceof Error}function B4(Q){return C(Q,Symbol.iterator)||C8(Q)}var D0="~effect/interfaces/Hash",X0=(Q)=>{switch(typeof Q){case"number":return z4(Q);case"bigint":return b0(Q.toString(10));case"boolean":return b0(String(Q));case"symbol":return b0(String(Q));case"string":return b0(Q);case"undefined":return b0("undefined");case"function":case"object":if(Q===null)return b0("null");else if(Q instanceof Date)return b0(Q.toISOString());else if(Q instanceof RegExp)return b0(Q.toString());else{if(m9.has(Q))return N7(Q);if(Q$.has(Q))return Q$.get(Q);let X=_j(Q,()=>{if(Hj(Q))return Q[D0]();else if(typeof Q==="function")return N7(Q);else if(Array.isArray(Q)||ArrayBuffer.isView(Q))return GQ(Q);else if(Q instanceof Map)return Kj(Q);else if(Q instanceof Set)return Vj(Q);return $$(Q)});return Q$.set(Q,X),X}default:throw Error(`BUG: unhandled typeof ${typeof Q} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},N7=(Q)=>{if(!e3.has(Q))e3.set(Q,z4(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return e3.get(Q)},X1=U(2,(Q,X)=>Q*53^X),L7=(Q)=>Q&3221225471|Q>>>1&1073741824,Hj=(Q)=>C(Q,D0),z4=(Q)=>{if(Q!==Q)return b0("NaN");if(Q===1/0)return b0("Infinity");if(Q===-1/0)return b0("-Infinity");let X=Q|0;if(X!==Q)X^=Q*4294967295;while(Q>4294967295)X^=Q/=4294967295;return L7(X)},b0=(Q)=>{let X=5381,Y=Q.length;while(Y)X=X*33^Q.charCodeAt(--Y);return L7(X)},Y$=(Q,X)=>{let Y=12289;for(let $ of X)Y^=X1(X0($),X0(Q[$]));return L7(Y)},$$=(Q)=>Y$(Q,JQ(Q)),J$=(Q,X)=>(Y)=>{let $=Q;for(let J of Y)$^=X(J);return L7($)},GQ=J$(6151,X0),Kj=J$(b0("Map"),([Q,X])=>X1(X0(Q),X0(X))),Vj=J$(b0("Set"),X0),e3=new WeakMap,Q$=new WeakMap,X$=new WeakSet;function _j(Q,X){if(X$.has(Q))return b0("[Circular]");X$.add(Q);let Y=X();return X$.delete(Q),Y}var U0="~effect/interfaces/Equal";function o(){if(arguments.length===1)return(Q)=>u6(Q,arguments[0]);return u6(arguments[0],arguments[1])}function u6(Q,X){if(Q===X)return!0;if(Q==null||X==null)return!1;let Y=typeof Q;if(Y!==typeof X)return!1;if(Y==="number"&&Q!==Q&&X!==X)return!0;if(Y!=="object"&&Y!=="function")return!1;if(m9.has(Q)||m9.has(X))return!1;return Uj(Q,X,Dj)}function qj(Q,X,Y){let $=Z$.has(Q),J=G$.has(X);if($&&J)return!0;if($||J)return!1;Z$.add(Q),G$.add(X);let Z=Y();return Z$.delete(Q),G$.delete(X),Z}var Z$=new WeakSet,G$=new WeakSet;function Dj(Q,X){if(X0(Q)!==X0(X))return!1;else if(Q instanceof Date){if(!(X instanceof Date))return!1;return Q.toISOString()===X.toISOString()}else if(Q instanceof RegExp){if(!(X instanceof RegExp))return!1;return Q.toString()===X.toString()}let Y=dK(Q),$=dK(X);if(Y!==$)return!1;let J=Y&&$;if(typeof Q==="function"&&!J)return!1;return qj(Q,X,()=>{if(J)return Q[U0](X);else if(Array.isArray(Q)){if(!Array.isArray(X)||Q.length!==X.length)return!1;return Bj(Q,X)}else if(ArrayBuffer.isView(Q)){if(!ArrayBuffer.isView(X)||Q.byteLength!==X.byteLength)return!1;return zj(Q,X)}else if(Q instanceof Map){if(!(X instanceof Map)||Q.size!==X.size)return!1;return Fj(Q,X)}else if(Q instanceof Set){if(!(X instanceof Set)||Q.size!==X.size)return!1;return Rj(Q,X)}return Oj(Q,X)})}function Uj(Q,X,Y){let $=M7.get(Q);if(!$)$=new WeakMap,M7.set(Q,$);else if($.has(X))return $.get(X);let J=Y(Q,X);$.set(X,J);let Z=M7.get(X);if(!Z)Z=new WeakMap,M7.set(X,Z);return Z.set(Q,J),J}var M7=new WeakMap;function Bj(Q,X){for(let Y=0;Y<Q.length;Y++)if(!u6(Q[Y],X[Y]))return!1;return!0}function zj(Q,X){if(Q.length!==X.length)return!1;for(let Y=0;Y<Q.length;Y++)if(Q[Y]!==X[Y])return!1;return!0}function Oj(Q,X){let Y=JQ(Q),$=JQ(X);if(Y.size!==$.size)return!1;for(let J of Y)if(!$.has(J)||!u6(Q[J],X[J]))return!1;return!0}function w7(Q,X){return function($,J){for(let[Z,G]of $){let W=!1;for(let[H,K]of J)if(Q(Z,H)&&X(G,K)){W=!0;break}if(!W)return!1}return!0}}var Fj=w7(u6,u6);function P7(Q){return function(Y,$){for(let J of Y){let Z=!1;for(let G of $)if(Q(J,G)){Z=!0;break}if(!Z)return!1}return!0}}var Rj=P7(u6),dK=(Q)=>C(Q,U0);var pK=(Q)=>{return m9.add(Q),Q};var A7=Symbol.for("~effect/Redactable"),Nj=(Q)=>C(Q,A7);function WQ(Q){if(Nj(Q))return W$(Q);return Q}function W$(Q){return Q[A7](globalThis[d9]?.context??Lj)}var d9="~effect/Fiber/currentFiber",Lj={"~effect/Context":{},mapUnsafe:new Map,pipe(){return H0(this,arguments)}};function P(Q,X){let Y=X?.space??0,$=new WeakSet,J=!Y?"":typeof Y==="number"?" ".repeat(Y):Y,Z=(K)=>J.repeat(K),G=(K,V)=>{let _=K?.constructor;return _&&_!==Object.prototype.constructor&&_.name?`${_.name}(${V})`:V},W=(K)=>{try{return Reflect.ownKeys(K)}catch{return["[ownKeys threw]"]}};function H(K,V=0){if(Array.isArray(K)){if($.has(K))return fK;if($.add(K),!J||K.length<=1)return`[${K.map((q)=>H(q,V)).join(",")}]`;let _=K.map((q)=>H(q,V+1)).join(`,
4
+ `+Z(V+1));return`[
5
+ ${Z(V+1)}${_}
6
+ ${Z(V)}]`}if(K instanceof Date)return H$(K);if(!X?.ignoreToString&&C(K,"toString")&&typeof K.toString==="function"&&K.toString!==Object.prototype.toString&&K.toString!==Array.prototype.toString){let _=Mj(K);if(K instanceof Error&&K.cause)return`${_} (cause: ${H(K.cause,V)})`;return _}if(typeof K==="string")return JSON.stringify(K);if(typeof K==="number"||K==null||typeof K==="boolean"||typeof K==="symbol")return String(K);if(typeof K==="bigint")return String(K)+"n";if(typeof K==="object"||typeof K==="function"){if($.has(K))return fK;if($.add(K),A7 in K)return P(W$(K));if(Symbol.iterator in K)return`${K.constructor.name}(${H(Array.from(K),V)})`;let _=W(K);if(!J||_.length<=1){let D=`{${_.map((B)=>`${O4(B)}:${H(K[B],V)}`).join(",")}}`;return G(K,D)}let q=`{
7
+ ${_.map((D)=>`${Z(V+1)}${O4(D)}: ${H(K[D],V+1)}`).join(`,
8
8
  `)}
9
- ${Z(_)}}`;return G(H,q)}return String(H)}return W(Q,0)}var MW="[Circular]";function R4(Q){return typeof Q==="string"?JSON.stringify(Q):String(Q)}function kX(Q){return Q.map((X)=>`[${R4(X)}]`).join("")}function H3(Q){try{return Q.toISOString()}catch{return"Invalid Date"}}function Bw(Q){try{let X=Q.toString();return typeof X==="string"?X:String(X)}catch{return"[toString threw]"}}function V6(Q,X){let Y=[];return JSON.stringify(Q,function(J,$){let Z=C9($);if(typeof Z!=="object"||Z===null)return Z;while(Y.length>0&&Y[Y.length-1]!==this)Y.pop();if(Y.includes(Z))return;return Y.push(Z),Z},X?.space)}var n0=Symbol.for("nodejs.util.inspect.custom"),K1=(Q)=>{try{if(N(Q,"toJSON")&&Y8(Q.toJSON)&&Q.toJSON.length===0)return Q.toJSON();else if(Array.isArray(Q))return Q.map(K1)}catch{return"[toJSON threw]"}return C9(Q)},AW=(Q,X=2)=>{if(typeof Q==="string")return Q;try{return typeof Q==="object"?V6(Q,{space:X}):String(Q)}catch{return String(Q)}},ji={toJSON(){return K1(this)},[n0](){return this.toJSON()},toString(){return v(this.toJSON())}};class N4{called=!1;self;constructor(Q){this.self=Q}next(Q){return this.called?{value:Q,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new N4(this.self)}}var W5="~effect/Utils/internal",wW={[W5]:(Q)=>{return Q()}},Ow={[W5]:(Q)=>{try{return Q()}finally{}}},zw=wW[W5](()=>Error().stack)?.includes(W5)===!0,J0=zw?wW[W5]:Ow[W5];var M8="~effect/Effect",_6="~effect/Exit",Fw={_A:g,_E:g,_R:g},TW=`${M8}/identifier`,e=`${M8}/args`,x0=`${M8}/evaluate`,A1=`${M8}/successCont`,J8=`${M8}/failureCont`,M4=`${M8}/ensureCont`,A4=Symbol.for("effect/Effect/Yield"),c8={pipe(){return X0(this,arguments)},toJSON(){return{...this}},toString(){return v(this.toJSON(),{ignoreToString:!0,space:2})},[n0](){return this.toJSON()}},IW={[K0](){return J3(this,Object.keys(this))},[W0](Q){let X=Object.keys(this),Y=Object.keys(Q);if(X.length!==Y.length)return!1;for(let J=0;J<X.length;J++)if(X[J]!==Y[J]&&!n(this[X[J]],Q[X[J]]))return!1;return!0}},Lw={[M8]:Fw,...c8,[Symbol.iterator](){return new N4(this)},toJSON(){return{_id:"Effect",op:this[TW],...e in this?{args:this[e]}:void 0}}},d=(Q)=>N(Q,M8),V3=(Q)=>N(Q,_6),H5="~effect/Cause",V5="~effect/Cause/Reason",_5=(Q)=>N(Q,H5),jW=(Q)=>N(Q,V5);class f8{[H5];reasons;constructor(Q){this[H5]=H5,this.reasons=Q}pipe(){return X0(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map((Q)=>Q.toJSON())}}toString(){return`Cause(${v(this.reasons)})`}[n0](){return this.toJSON()}[W0](Q){return _5(Q)&&this.reasons.length===Q.reasons.length&&this.reasons.every((X,Y)=>n(X,Q.reasons[Y]))}[K0](){return w9(this.reasons)}}var CW=new WeakMap;class I9{[V5];annotations;_tag;constructor(Q,X,Y){if(this[V5]=V5,this._tag=Q,X!==j9&&typeof Y==="object"&&Y!==null&&X.size>0){let J=CW.get(Y);if(J)X=new Map([...J,...X]);CW.set(Y,X)}this.annotations=X}annotate(Q,X){if(Q.mapUnsafe.size===0)return this;let Y=new Map(this.annotations);Q.mapUnsafe.forEach(($,Z)=>{if(X?.overwrite!==!0&&Y.has(Z))return;Y.set(Z,$)});let J=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return J.annotations=Y,J}pipe(){return X0(this,arguments)}toString(){return v(this)}[n0](){return this.toString()}}var j9=new Map;class q5 extends I9{error;constructor(Q,X=j9){super("Fail",X,Q);this.error=Q}toString(){return`Fail(${v(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[W0](Q){return w4(Q)&&n(this.error,Q.error)&&n(this.annotations,Q.annotations)}[K0](){return u0(T0(this._tag))(u0(t(this.error))(t(this.annotations)))}}var u8=(Q)=>new f8(Q),yX=new f8([]),_3=(Q)=>new f8([new q5(Q)]);class bX extends I9{defect;constructor(Q,X=j9){super("Die",X,Q);this.defect=Q}toString(){return`Die(${v(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[W0](Q){return D6(Q)&&n(this.defect,Q.defect)&&n(this.annotations,Q.annotations)}[K0](){return u0(T0(this._tag))(u0(t(this.defect))(t(this.annotations)))}}var q3=(Q)=>new f8([new bX(Q)]),D5=B((Q)=>_5(Q[0]),(Q,X,Y)=>{if(X.mapUnsafe.size===0)return Q;return new f8(Q.reasons.map((J)=>J.annotate(X,Y)))}),w4=(Q)=>Q._tag==="Fail",D6=(Q)=>Q._tag==="Die",B6=(Q)=>Q._tag==="Interrupt";function Pw(Q){return w8("Effect.evaluate: Not implemented")}var l8=(Q)=>({...Lw,[TW]:Q.op,[x0]:Q[x0]??Pw,[A1]:Q[A1],[J8]:Q[J8],[M4]:Q[M4]}),u1=(Q)=>{let X=l8(Q);return function(){let Y=Object.create(X);return Y[e]=Q.single===!1?arguments:arguments[0],Y}},EW=(Q)=>{let X={...l8(Q),[_6]:_6,_tag:Q.op,get[Q.prop](){return this[e]},toString(){return`${Q.op}(${v(this[e])})`},toJSON(){return{_id:"Exit",_tag:Q.op,[Q.prop]:this[e]}},[W0](Y){return V3(Y)&&Y._tag===this._tag&&n(this[e],Y[e])},[K0](){return u0(T0(Q.op),t(this[e]))}};return function(Y){let J=Object.create(X);return J[e]=Y,J}},c0=EW({op:"Success",prop:"value",[x0](Q){let X=Q.getCont(A1);return X?X[A1](this[e],Q,this):Q.yieldWith(this)}}),E9={key:"effect/Cause/StackTrace"},SW={key:"effect/Cause/InterruptorStackTrace"},w1=EW({op:"Failure",prop:"cause",[x0](Q){let X=this[e],Y=!1;if(Q.currentStackFrame)X=D5(X,{mapUnsafe:new Map([[E9.key,Q.currentStackFrame]])}),Y=!0;let J=Q.getCont(J8);while(Q.interruptible&&Q._interruptedCause&&J)J=Q.getCont(J8);return J?J[J8](X,Q,Y?void 0:this):Q.yieldWith(Y?this:w1(X))}}),A8=(Q)=>w1(_3(Q)),w8=(Q)=>w1(q3(Q)),c=u1({op:"WithFiber",[x0](Q){return this[e](Q)}}),Rw=function(){class Q extends globalThis.Error{}let X=l8({op:"YieldableError",[x0](){return A8(this)}});return delete X.toString,Object.assign(Q.prototype,X),Q}(),gX=function(){let Q=Symbol.for("effect/Data/Error/plainArgs");return class extends Rw{constructor(Y){super(Y?.message,Y?.cause?{cause:Y.cause}:void 0);if(Y)Object.assign(this,Y),Object.defineProperty(this,Q,{value:Y,enumerable:!1})}toJSON(){return{...this[Q],...this}}}}(),r8=(Q)=>{class X extends gX{_tag=Q}return X.prototype.name=Q,X},T9="~effect/Cause/NoSuchElementError",hX=(Q)=>N(Q,T9);class C8 extends r8("NoSuchElementError"){[T9]=T9;constructor(Q){super({message:Q})}}var q6="~effect/Cause/Done",S9=(Q)=>N(Q,q6),xW={[q6]:q6,_tag:"Done",value:void 0},D3=(Q)=>{if(Q===void 0)return xW;return{[q6]:q6,_tag:"Done",value:Q}},Nw=A8(xW),vW=(Q)=>{if(Q===void 0)return Nw;return A8(D3(Q))};var kW=(Q)=>l8({op:Q.label,[x0]:Q.evaluate});function yW(Q){return{combine:Q}}function o8(Q,X,Y){return{combine:Q,initialValue:X,combineAll:Y??((J)=>{let $=X;for(let Z of J)$=Q($,Z);return $})}}var i0=(Q)=>(X,Y)=>X===Y||Q(X,Y);function bW(Q){return i0((X,Y)=>{if(X.length!==Y.length)return!1;for(let J=0;J<X.length;J++)if(!Q(X[J],Y[J]))return!1;return!0})}var gW=(Q)=>B(3,(X,Y,J)=>Q(X,($)=>({...$,[Y]:J($)}))),hW=(Q)=>B(2,(X,Y)=>Q(X,(J)=>({[Y]:J}))),mW=(Q,X)=>B(3,(Y,J,$)=>X(Y,(Z)=>Q($(Z),(G)=>({...Z,[J]:G}))));var dW="~effect/data/Option",pW={[dW]:{_A:(Q)=>Q},...c8,[Symbol.iterator](){return new N4(this)}},cW=Object.assign(Object.create(pW),{_tag:"Some",_op:"Some",[W0](Q){return dX(Q)&&U3(Q)&&n(this.value,Q.value)},[K0](){return u0(t(this._tag))(t(this.value))},toString(){return`some(${v(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:K1(this.value)}}});Object.defineProperty(cW,"valueOrUndefined",{get(){return this.value}});var Cw=t("None"),Tw=Object.assign(Object.create(pW),{_tag:"None",_op:"None",valueOrUndefined:void 0,[W0](Q){return dX(Q)&&B3(Q)},[K0](){return Cw},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),dX=(Q)=>N(Q,dW),B3=(Q)=>Q._tag==="None",U3=(Q)=>Q._tag==="Some",fW=Object.create(Tw),uW=(Q)=>{let X=Object.create(cW);return X.value=Q,X};var lW="~effect/data/Result",rW={[lW]:{_A:(Q)=>Q,_E:(Q)=>Q},...c8,[Symbol.iterator](){return new N4(this)}},jw=Object.assign(Object.create(rW),{_tag:"Success",_op:"Success",[W0](Q){return pX(Q)&&z3(Q)&&n(this.success,Q.success)},[K0](){return u0(t(this._tag))(t(this.success))},toString(){return`success(${v(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:K1(this.success)}}}),Ew=Object.assign(Object.create(rW),{_tag:"Failure",_op:"Failure",[W0](Q){return pX(Q)&&O3(Q)&&n(this.failure,Q.failure)},[K0](){return u0(t(this._tag))(t(this.failure))},toString(){return`failure(${v(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:K1(this.failure)}}}),pX=(Q)=>N(Q,lW),O3=(Q)=>Q._tag==="Failure",z3=(Q)=>Q._tag==="Success",oW=(Q)=>{let X=Object.create(Ew);return X.failure=Q,X},nW=(Q)=>{let X=Object.create(jw);return X.success=Q,X};function x9(Q){return(X,Y)=>X===Y?0:Q(X,Y)}var U1=x9((Q,X)=>{if(globalThis.Number.isNaN(Q)&&globalThis.Number.isNaN(X))return 0;if(globalThis.Number.isNaN(Q))return-1;if(globalThis.Number.isNaN(X))return 1;return Q<X?-1:1});var T8=x9((Q,X)=>Q<X?-1:1);var F3=B(2,(Q,X)=>x9((Y,J)=>Q(X(Y),X(J)))),B5=F3(U1,(Q)=>Q.getTime());var cX=(Q)=>B(2,(X,Y)=>Q(X,Y)===-1),U5=(Q)=>B(2,(X,Y)=>Q(X,Y)===1),fX=(Q)=>B(2,(X,Y)=>Q(X,Y)!==1),uX=(Q)=>B(2,(X,Y)=>Q(X,Y)!==-1);var b=()=>fW,F=uW,iW=dX,I0=B3,O1=U3,S1=B(2,(Q,{onNone:X,onSome:Y})=>I0(Q)?X():Y(Q.value));var rX=B(2,(Q,X)=>I0(Q)?X():Q.value);var aW=(Q)=>Q==null?b():F(Q),sW=(Q)=>Q===void 0?b():F(Q),tW=(Q)=>Q===null?b():F(Q);var L3=rX(i2),U6=rX(N8),O6=(Q)=>(...X)=>{try{return F(Q(...X))}catch{return b()}};var I4=B(2,(Q,X)=>I0(Q)?b():F(X(Q.value)));var xw=B(2,(Q,X)=>I0(Q)?b():X(Q.value));var O5=xw(g);var z5=B(2,(Q,X)=>I0(Q)?b():X(Q.value)?F(Q.value):b()),eW=(Q)=>i0((X,Y)=>I0(X)?I0(Y):I0(Y)?!1:Q(X.value,Y.value));var QH="~effect/Context/Service",l1=function(){let Q=Error.stackTraceLimit;Error.stackTraceLimit=2;let X=Error();Error.stackTraceLimit=Q;function Y(){}let J=Y;if(Object.setPrototypeOf(J,vw),Object.defineProperty(J,"stack",{get(){return X.stack}}),arguments.length>0){if(J.key=arguments[0],arguments[1]?.defaultValue)J[oX]=oX,J.defaultValue=arguments[1].defaultValue;return J}return function($,Z){if(J.key=$,Z?.make)J.make=Z.make;return J}},vw={[QH]:QH,...kW({label:"Service",evaluate(Q){return c0(x1(Q.context,this))}}),toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},of(Q){return Q},context(Q){return nX(this,Q)},use(Q){return c((X)=>Q(x1(X.context,this)))},useSync(Q){return c((X)=>c0(Q(x1(X.context,this))))}},oX="~effect/Context/Reference",XH="~effect/Context",j4=(Q)=>{let X=Object.create(kw);return X.mapUnsafe=Q,X.mutable=!1,X},kw={...c8,[XH]:{_Services:(Q)=>Q},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([Q,X])=>({key:Q,value:X}))}},[W0](Q){if(!R3(Q)||this.mapUnsafe.size!==Q.mapUnsafe.size)return!1;for(let X of this.mapUnsafe.keys())if(!Q.mapUnsafe.has(X)||!n(this.mapUnsafe.get(X),Q.mapUnsafe.get(X)))return!1;return!0},[K0](){return p8(this.mapUnsafe.size)}},R3=(Q)=>N(Q,XH);var YH=(Q)=>N(Q,oX),$8=()=>yw,yw=j4(new Map),nX=(Q,X)=>j4(new Map([[Q.key,X]])),Z8=B(3,(Q,X,Y)=>KH(Q,(J)=>{J.set(X.key,Y)}));var JH=B(3,(Q,X,Y)=>{if(Q.mapUnsafe.has(X.key))return Q.mapUnsafe.get(X.key);return YH(X)?iX(X):Y()});var z6=B(2,(Q,X)=>{if(!Q.mapUnsafe.has(X.key)){if(oX in X)return iX(X);throw bw(X)}return Q.mapUnsafe.get(X.key)}),x1=z6,$H=(Q,X)=>{if(!Q.mapUnsafe.has(X.key))return iX(X);return Q.mapUnsafe.get(X.key)},P3="~effect/Context/defaultValue",iX=(Q)=>{if(P3 in Q)return Q[P3];return Q[P3]=Q.defaultValue()},bw=(Q)=>{let X=Error(`Service not found${Q.key?`: ${String(Q.key)}`:""}`);if(Q.stack){let Y=Q.stack.split(`
10
- `);if(Y.length>2){let J=Y[2].match(/at (.*)/);if(J)X.message=X.message+` (defined at ${J[1]})`}}if(X.stack){let Y=X.stack.split(`
9
+ ${Z(V)}}`;return G(K,q)}return String(K)}return H(Q,0)}var fK="[Circular]";function O4(Q){return typeof Q==="string"?JSON.stringify(Q):String(Q)}function C7(Q){return Q.map((X)=>`[${O4(X)}]`).join("")}function H$(Q){try{return Q.toISOString()}catch{return"Invalid Date"}}function Mj(Q){try{let X=Q.toString();return typeof X==="string"?X:String(X)}catch{return"[toString threw]"}}function l6(Q,X){let Y=[];return JSON.stringify(Q,function($,J){let Z=WQ(J);if(typeof Z!=="object"||Z===null)return Z;while(Y.length>0&&Y[Y.length-1]!==this)Y.pop();if(Y.includes(Z))return;return Y.push(Z),Z},X?.space)}var W1=Symbol.for("nodejs.util.inspect.custom"),R1=(Q)=>{try{if(C(Q,"toJSON")&&r1(Q.toJSON)&&Q.toJSON.length===0)return Q.toJSON();else if(Array.isArray(Q))return Q.map(R1)}catch{return"[toJSON threw]"}return WQ(Q)},cK=(Q,X=2)=>{if(typeof Q==="string")return Q;try{return typeof Q==="object"?l6(Q,{space:X}):String(Q)}catch{return String(Q)}},qe={toJSON(){return R1(this)},[W1](){return this.toJSON()},toString(){return P(this.toJSON())}};class a4{called=!1;self;constructor(Q){this.self=Q}next(Q){return this.called?{value:Q,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new a4(this.self)}}var Pj=()=>{let X={["~effect/Utils/internal"]:(J)=>{return J()}},Y={["~effect/Utils/internal"]:(J)=>{try{return J()}finally{}}};return X["~effect/Utils/internal"](()=>Error().stack)?.includes("~effect/Utils/internal")===!0?X["~effect/Utils/internal"]:Y["~effect/Utils/internal"]},V0=Pj();function b(Q,X,Y){if(X==="__proto__")Object.defineProperty(Q,X,{value:Y,writable:!0,enumerable:!0,configurable:!0});else Q[X]=Y}function j7(Q,X){for(let Y of Reflect.ownKeys(X))if(Object.prototype.propertyIsEnumerable.call(X,Y))b(Q,Y,X[Y])}var n8="~effect/Effect",o6="~effect/Exit",Aj={_A:u,_E:u,_R:u},lK=`${n8}/identifier`,J0=`${n8}/args`,c0=`${n8}/evaluate`,I1=`${n8}/successCont`,K8=`${n8}/failureCont`,s4=`${n8}/ensureCont`,i6=Symbol.for("effect/Effect/Yield"),F4={pipe(){return H0(this,arguments)},toJSON(){return{...this}},toString(){return P(this.toJSON(),{ignoreToString:!0,space:2})},[W1](){return this.toJSON()}},oK={[D0](){return Y$(this,Object.keys(this))},[U0](Q){let X=Object.keys(this),Y=Object.keys(Q);if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++)if(X[$]!==Y[$]||!o(this[X[$]],Q[X[$]]))return!1;return!0}},Cj={[n8]:Aj,...F4,[Symbol.iterator](){return new a4(this)},toJSON(){return{_id:"Effect",op:this[lK],...J0 in this?{args:this[J0]}:void 0}}},r=(Q)=>C(Q,n8),K$=(Q)=>C(Q,o6),p9="~effect/Cause",f9="~effect/Cause/Reason",c9=(Q)=>C(Q,p9),rK=(Q)=>C(Q,f9);class R4{[p9];reasons;constructor(Q){this[p9]=p9,this.reasons=Q}pipe(){return H0(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map((Q)=>Q.toJSON())}}toString(){return`Cause(${P(this.reasons)})`}[W1](){return this.toJSON()}[U0](Q){return c9(Q)&&this.reasons.length===Q.reasons.length&&this.reasons.every((X,Y)=>o(X,Q.reasons[Y]))}[D0](){return GQ(this.reasons)}}var uK=new WeakMap;class KQ{[f9];annotations;_tag;constructor(Q,X,Y){if(this[f9]=f9,this._tag=Q,X!==VQ&&typeof Y==="object"&&Y!==null&&X.size>0){let $=uK.get(Y);if($)X=new Map([...$,...X]);uK.set(Y,X)}this.annotations=X}annotate(Q,X){if(Q.mapUnsafe.size===0)return this;let Y=new Map(this.annotations);Q.mapUnsafe.forEach((J,Z)=>{if(X?.overwrite!==!0&&Y.has(Z))return;Y.set(Z,J)});let $=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return $.annotations=Y,$}pipe(){return H0(this,arguments)}toString(){return P(this)}[W1](){return this.toString()}}var VQ=new Map;class u9 extends KQ{error;constructor(Q,X=VQ){super("Fail",X,Q);this.error=Q}toString(){return`Fail(${P(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[U0](Q){return t4(Q)&&o(this.error,Q.error)&&o(this.annotations,Q.annotations)}[D0](){return X1(b0(this._tag))(X1(X0(this.error))(X0(this.annotations)))}}var N4=(Q)=>new R4(Q),T7=new R4([]),V$=(Q)=>new R4([new u9(Q)]);class I7 extends KQ{defect;constructor(Q,X=VQ){super("Die",X,Q);this.defect=Q}toString(){return`Die(${P(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[U0](Q){return n6(Q)&&o(this.defect,Q.defect)&&o(this.annotations,Q.annotations)}[D0](){return X1(b0(this._tag))(X1(X0(this.defect))(X0(this.annotations)))}}var _$=(Q)=>new R4([new I7(Q)]),l9=U((Q)=>c9(Q[0]),(Q,X,Y)=>{if(X.mapUnsafe.size===0)return Q;return new R4(Q.reasons.map(($)=>$.annotate(X,Y)))}),t4=(Q)=>Q._tag==="Fail",n6=(Q)=>Q._tag==="Die",a6=(Q)=>Q._tag==="Interrupt";function jj(Q){return j8("Effect.evaluate: Not implemented")}var L4=(Q)=>({...Cj,[lK]:Q.op,[c0]:Q[c0]??jj,[I1]:Q[I1],[K8]:Q[K8],[s4]:Q[s4]}),V8=(Q)=>{let X=L4(Q);return function(){let Y=Object.create(X);return Y[J0]=Q.single===!1?arguments:arguments[0],Y}},iK=(Q)=>{let X={...L4(Q),[o6]:o6,_tag:Q.op,get[Q.prop](){return this[J0]},toString(){return`${Q.op}(${P(this[J0])})`},toJSON(){return{_id:"Exit",_tag:Q.op,[Q.prop]:this[J0]}},[U0](Y){return K$(Y)&&Y._tag===this._tag&&o(this[J0],Y[J0])},[D0](){return X1(b0(Q.op),X0(this[J0]))}};return function(Y){let $=Object.create(X);return $[J0]=Y,$}},t0=iK({op:"Success",prop:"value",[c0](Q){let X=Q.getCont(I1);return X?X[I1](this[J0],Q,this):Q.yieldWith(this)}}),E7={key:"effect/Cause/StackTrace"},q$={key:"effect/Cause/InterruptorStackTrace"},g1=iK({op:"Failure",prop:"cause",[c0](Q){let X=this[J0],Y=!1;if(Q.currentStackFrame)X=l9(X,{mapUnsafe:new Map([[E7.key,Q.currentStackFrame]])}),Y=!0;let $=Q.getCont(K8);while(Q.interruptible&&Q._interruptedCause&&$)$=Q.getCont(K8);return $?$[K8](X,Q,Y?void 0:this):Q.yieldWith(Y?g1(X):this)}}),a8=(Q)=>g1(V$(Q)),j8=(Q)=>g1(_$(Q)),e=V8({op:"WithFiber",[c0](Q){return this[J0](Q)}}),Tj=function(){class Q extends globalThis.Error{}let X=L4({op:"YieldableError",[c0](){return a8(this)}});return delete X.toString,Object.assign(Q.prototype,X),Q}(),S7=function(){let Q=Symbol.for("effect/Data/Error/plainArgs");return class extends Tj{constructor(Y){super(Y?.message,Y?.cause?{cause:Y.cause}:void 0);if(Y)j7(this,Y),Object.defineProperty(this,Q,{value:Y,enumerable:!1})}toJSON(){return{...this[Q],...this}}}}(),M4=(Q)=>{class X extends S7{_tag=Q}return X.prototype.name=Q,X},HQ="~effect/Cause/NoSuchElementError",v7=(Q)=>C(Q,HQ);class s8 extends M4("NoSuchElementError"){[HQ]=HQ;constructor(Q){super({message:Q})}}var r6="~effect/Cause/Done",_Q=(Q)=>C(Q,r6),nK={[r6]:r6,_tag:"Done",value:void 0},D$=(Q)=>{if(Q===void 0)return nK;return{[r6]:r6,_tag:"Done",value:Q}},Ij=a8(nK),aK=(Q)=>{if(Q===void 0)return Ij;return a8(D$(Q))};var sK=(Q)=>L4({op:Q.label,[c0]:Q.evaluate});var Sj=()=>{let Q=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(Q===void 0)return Object.isExtensible(Error);return Object.hasOwn(Q,"writable")?Q.writable===!0:Q.set!==void 0},vj=Sj(),Q6=()=>Error.stackTraceLimit,i1=(Q)=>{if(vj)Error.stackTraceLimit=Q};function tK(Q){return{combine:Q}}function w4(Q,X,Y){return{combine:Q,initialValue:X,combineAll:Y??(($)=>{let J=X;for(let Z of $)J=Q(J,Z);return J})}}var H1=(Q)=>(X,Y)=>X===Y||Q(X,Y),bj=(Q,X)=>Q===X,eK=()=>bj;function QV(Q){return H1((X,Y)=>{if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++)if(!Q(X[$],Y[$]))return!1;return!0})}var XV=(Q)=>U(3,(X,Y,$)=>Q(X,(J)=>({...J,[Y]:$(J)}))),YV=(Q)=>U(2,(X,Y)=>Q(X,($)=>({[Y]:$}))),$V=(Q,X)=>U(3,(Y,$,J)=>X(Y,(Z)=>Q(J(Z),(G)=>({...Z,[$]:G}))));var JV="~effect/data/Option",ZV={[JV]:{_A:(Q)=>Q},...F4,[Symbol.iterator](){return new a4(this)}},yj=Object.defineProperty(Object.assign(Object.create(ZV),{_tag:"Some",_op:"Some",[U0](Q){return b7(Q)&&B$(Q)&&o(this.value,Q.value)},[D0](){return X1(X0(this._tag))(X0(this.value))},toString(){return`some(${P(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:R1(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),gj=X0("None"),hj=Object.assign(Object.create(ZV),{_tag:"None",_op:"None",valueOrUndefined:void 0,[U0](Q){return b7(Q)&&U$(Q)},[D0](){return gj},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),b7=(Q)=>C(Q,JV),U$=(Q)=>Q._tag==="None",B$=(Q)=>Q._tag==="Some",GV=Object.create(hj),WV=(Q)=>{let X=Object.create(yj);return X.value=Q,X};var HV="~effect/data/Result",KV={[HV]:{_A:(Q)=>Q,_E:(Q)=>Q},...F4,[Symbol.iterator](){return new a4(this)}},dj=Object.assign(Object.create(KV),{_tag:"Success",_op:"Success",[U0](Q){return k7(Q)&&O$(Q)&&o(this.success,Q.success)},[D0](){return X1(X0(this._tag))(X0(this.success))},toString(){return`success(${P(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:R1(this.success)}}}),pj=Object.assign(Object.create(KV),{_tag:"Failure",_op:"Failure",[U0](Q){return k7(Q)&&z$(Q)&&o(this.failure,Q.failure)},[D0](){return X1(X0(this._tag))(X0(this.failure))},toString(){return`failure(${P(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:R1(this.failure)}}}),k7=(Q)=>C(Q,HV),z$=(Q)=>Q._tag==="Failure",O$=(Q)=>Q._tag==="Success",VV=(Q)=>{let X=Object.create(pj);return X.failure=Q,X},_V=(Q)=>{let X=Object.create(dj);return X.success=Q,X};function s6(Q){return(X,Y)=>X===Y?0:Q(X,Y)}var D1=s6((Q,X)=>{if(globalThis.Number.isNaN(Q)&&globalThis.Number.isNaN(X))return 0;if(globalThis.Number.isNaN(Q))return-1;if(globalThis.Number.isNaN(X))return 1;return Q<X?-1:1});var _8=s6((Q,X)=>Q<X?-1:1);var F$=U(2,(Q,X)=>s6((Y,$)=>Q(X(Y),X($)))),t6=F$(D1,(Q)=>Q.getTime());var o9=(Q)=>U(2,(X,Y)=>Q(X,Y)===-1),Y6=(Q)=>U(2,(X,Y)=>Q(X,Y)===1),qQ=(Q)=>U(2,(X,Y)=>Q(X,Y)!==1),DQ=(Q)=>U(2,(X,Y)=>Q(X,Y)!==-1);var d=()=>GV,R=WV,y7=b7,I0=U$,L1=B$,T8=U(2,(Q,{onNone:X,onSome:Y})=>I0(Q)?X():Y(Q.value));var g7=U(2,(Q,X)=>I0(Q)?X():Q.value);var qV=(Q)=>Q==null?d():R(Q),DV=(Q)=>Q===void 0?d():R(Q),UV=(Q)=>Q===null?d():R(Q);var R$=g7(i3),e6=g7(i8),Q9=(Q)=>(...X)=>{try{return R(Q(...X))}catch{return d()}};var $6=U(2,(Q,X)=>I0(Q)?d():R(X(Q.value)));var cj=U(2,(Q,X)=>I0(Q)?d():X(Q.value));var i9=cj(u);var n9=U(2,(Q,X)=>I0(Q)?d():X(Q.value)?R(Q.value):d()),BV=(Q)=>H1((X,Y)=>I0(X)?I0(Y):I0(Y)?!1:Q(X.value,Y.value));var zV="~effect/Context/Service",q8=function(){let Q=Q6();i1(2);let X=Error();i1(Q);function Y(){}let $=Y;if(Object.setPrototypeOf($,uj),Object.defineProperty($,"stack",{get(){return X.stack}}),arguments.length>0){if($.key=arguments[0],arguments[1]?.defaultValue)$[h7]=h7,$.defaultValue=arguments[1].defaultValue;return $}return function(J,Z){if($.key=J,Z?.make)$.make=Z.make;return $}},uj={[zV]:zV,...sK({label:"Service",evaluate(Q){return t0(n1(Q.context,this))}}),toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},of(Q){return Q},context(Q){return m7(this,Q)},use(Q){return e((X)=>Q(n1(X.context,this)))},useSync(Q){return e((X)=>t0(Q(n1(X.context,this))))}},h7="~effect/Context/Reference",OV="~effect/Context",J6=(Q)=>{let X=Object.create(lj);return X.mapUnsafe=Q,X.mutable=!1,X},lj={...F4,[OV]:{_Services:(Q)=>Q},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([Q,X])=>({key:Q,value:X}))}},[U0](Q){if(!L$(Q)||this.mapUnsafe.size!==Q.mapUnsafe.size)return!1;for(let X of this.mapUnsafe.keys())if(!Q.mapUnsafe.has(X)||!o(this.mapUnsafe.get(X),Q.mapUnsafe.get(X)))return!1;return!0},[D0](){return z4(this.mapUnsafe.size)}},L$=(Q)=>C(Q,OV);var oj=(Q)=>C(Q,h7),D8=()=>rj,rj=J6(new Map),m7=(Q,X)=>J6(new Map([[Q.key,X]])),a1=U(3,(Q,X,Y)=>MV(Q,($)=>{$.set(X.key,Y)}));var FV=U(2,(Q,X)=>Q.mapUnsafe.get(X.key)),t8=U(2,(Q,X)=>{if(!Q.mapUnsafe.has(X.key)){if(h7 in X)return M$(X);throw ij(X)}return Q.mapUnsafe.get(X.key)}),n1=t8,RV=(Q,X)=>{if(!Q.mapUnsafe.has(X.key))return M$(X);return Q.mapUnsafe.get(X.key)},N$="~effect/Context/defaultValue",M$=(Q)=>{if(N$ in Q)return Q[N$];return Q[N$]=Q.defaultValue()},ij=(Q)=>{let X=Error(`Service not found${Q.key?`: ${String(Q.key)}`:""}`);if(Q.stack){let Y=Q.stack.split(`
10
+ `);if(Y.length>2){let $=Y[2].match(/at (.*)/);if($)X.message=X.message+` (defined at ${$[1]})`}}if(X.stack){let Y=X.stack.split(`
11
11
  `);Y.splice(1,3),X.stack=Y.join(`
12
- `)}return X},ZH=B(2,(Q,X)=>{if(Q.mapUnsafe.has(X.key))return F(Q.mapUnsafe.get(X.key));return YH(X)?F(iX(X)):b()}),aX=B(2,(Q,X)=>{if(Q.mapUnsafe.size===0)return X;if(X.mapUnsafe.size===0)return Q;return KH(Q,(Y)=>{X.mapUnsafe.forEach((J,$)=>Y.set($,J))})}),GH=(...Q)=>{let X=new Map;for(let Y=0;Y<Q.length;Y++)Q[Y].mapUnsafe.forEach((J,$)=>{X.set($,J)});return j4(X)};var KH=(Q,X)=>{if(Q.mutable)return X(Q.mapUnsafe),Q;let Y=new Map(Q.mapUnsafe);return X(Y),j4(Y)},_0=l1;var N3=(Q)=>Q.length>0;var l=nW,f=oW;var WH=pX,u=O3,C1=z3;var HH=(Q,X)=>i0((Y,J)=>u(Y)?u(J)&&X(Y.failure,J.failure):C1(J)&&Q(Y.success,J.success));var F5=B(2,(Q,X)=>u(Q)?f(X(Q.failure)):l(Q.success)),F6=B(2,(Q,X)=>C1(Q)?l(X(Q.success)):f(Q.failure)),o1=B(2,(Q,{onFailure:X,onSuccess:Y})=>u(Q)?X(Q.failure):Y(Q.success));var v9=B(2,(Q,X)=>u(Q)?X(Q.failure):Q.success);var sX=B(2,(Q,X)=>u(Q)?f(Q.failure):X(Q.success));var Za={[Symbol.iterator](){return hw}},hw={next(){return{done:!0,value:void 0}}};var VH=B(2,(Q,X)=>({[Symbol.iterator](){let Y=Q[Symbol.iterator](),J=0;return{next(){let $=Y.next();while(!$.done){if(X($.value,J++))return{done:!1,value:$.value};$=Y.next()}return{done:!0,value:void 0}}}}}));var dw=()=>({}),M3=(Q)=>Object.keys(Q).length===0;var L5=B(2,(Q,X)=>{let Y={...Q};for(let J of qH(Q))Y[J]=X(Q[J],J);return Y});var _H=B(2,(Q,X)=>{let Y=dw();for(let J of qH(Q))if(X(Q[J],J))Y[J]=Q[J];return Y});var qH=(Q)=>Object.keys(Q);var P5=globalThis.Array;var w3=(Q)=>new P5(Q);var W1=(Q)=>P5.isArray(Q)?Q:P5.from(Q),DH=(Q)=>P5.isArray(Q)?Q:[Q];var tX=B(2,(Q,X)=>[...Q,X]),pw=B(2,(Q,X)=>W1(Q).concat(W1(X)));var Ha=P5.isArray;var K8=N3,L6=N3;function cw(Q,X){return Q<0||Q>=X.length}var fw=B(2,(Q,X)=>{let Y=Math.floor(X);if(cw(Y,Q))throw Error(`Index out of bounds: ${Y}`);return Q[Y]});var uw=fw(0);var lw=(Q)=>Q.slice(1);var k9=B(2,(Q,X)=>{let Y=P5.from(Q);return Y.sort(X),Y});var rw=B(3,(Q,X,Y)=>{let J=W1(Q),$=W1(X);if(L6(J)){if(L6($))return j3(Y)(pw(J,$));return J}return $}),C3=B(2,(Q,X)=>rw(Q,X,xX()));var T3=()=>[];var E4=B(2,(Q,X)=>Q.map(X));var BH=(Q)=>{let X=[];for(let Y of Q)if(O1(Y))X.push(Y.value);return X};var I3=B(2,(Q,X)=>{let Y=[],J=[],$=0;for(let Z of Q){let G=X(Z,$++);if(C1(G))J.push(G.success);else Y.push(G.failure)}return[Y,J]});var j3=B(2,(Q,X)=>{let Y=W1(Q);if(L6(Y)){let J=[uw(Y)],$=lw(Y);for(let Z of $)if(J.every((G)=>!X(Z,G)))J.push(Z);return J}return[]});var ow=o8((Q,X)=>Q.concat(X),[]);function UH(){return ow}var eX="~effect/time/Duration",nw=BigInt(0);var FH=BigInt(1000),iw=BigInt(1e6);var aw=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,v1=(Q)=>{switch(typeof Q){case"number":return S4(Q);case"bigint":return a8(Q);case"string":{if(Q==="Infinity")return i8;if(Q==="-Infinity")return P6;let X=aw.exec(Q);if(!X)break;let[Y,J,$]=X,Z=Number(J);switch($){case"nano":case"nanos":return a8(BigInt(J));case"micro":case"micros":return QC(BigInt(J));case"milli":case"millis":return S4(Z);case"second":case"seconds":return XC(Z);case"minute":case"minutes":return YC(Z);case"hour":case"hours":return JC(Z);case"day":case"days":return $C(Z);case"week":case"weeks":return ZC(Z)}break}case"object":{if(Q===null)break;if(eX in Q)return Q;if(Array.isArray(Q)){if(Q.length!==2||!Q.every(A9))return OH(Q);if(Number.isNaN(Q[0])||Number.isNaN(Q[1]))return R5;if(Q[0]===-1/0||Q[1]===-1/0)return P6;if(Q[0]===1/0||Q[1]===1/0)return i8;return H1(BigInt(Math.round(Q[0]*1e9))+BigInt(Math.round(Q[1])))}let X=Q,Y=0;if(X.weeks)Y+=X.weeks*604800000;if(X.days)Y+=X.days*86400000;if(X.hours)Y+=X.hours*3600000;if(X.minutes)Y+=X.minutes*60000;if(X.seconds)Y+=X.seconds*1000;if(X.milliseconds)Y+=X.milliseconds;if(!X.microseconds&&!X.nanoseconds)return H1(Y);let J=BigInt(Y)*iw;if(X.microseconds)J+=BigInt(X.microseconds)*FH;if(X.nanoseconds)J+=BigInt(X.nanoseconds);return H1(J)}}return OH(Q)},OH=(Q)=>{throw Error(`Invalid Input: ${Q}`)},LH=O6(v1),zH={_tag:"Millis",millis:0},sw={_tag:"Infinity"},tw={_tag:"NegativeInfinity"},ew={[eX]:eX,[K0](){return $3(this.value)},[W0](Q){return S3(Q)&&KC(this,Q)},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"}}},[n0](){return this.toJSON()},pipe(){return X0(this,arguments)}},H1=(Q)=>{let X=Object.create(ew);if(typeof Q==="number")if(isNaN(Q)||Q===0||Object.is(Q,-0))X.value=zH;else if(!Number.isFinite(Q))X.value=Q>0?sw:tw;else if(!Number.isInteger(Q))X.value={_tag:"Nanos",nanos:BigInt(Math.round(Q*1e6))};else X.value={_tag:"Millis",millis:Q};else if(Q===nw)X.value=zH;else X.value={_tag:"Nanos",nanos:Q};return X},S3=(Q)=>N(Q,eX);var R5=H1(0),i8=H1(1/0),P6=H1(-1/0),a8=(Q)=>H1(Q),QC=(Q)=>H1(Q*FH),S4=(Q)=>H1(Q),XC=(Q)=>H1(Q*1000),YC=(Q)=>H1(Q*60000),JC=(Q)=>H1(Q*3600000),$C=(Q)=>H1(Q*86400000),ZC=(Q)=>H1(Q*604800000),x4=(Q)=>GC(v1(Q),{onMillis:g,onNanos:(X)=>Number(X)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var E3=(Q)=>{let X=v1(Q);switch(X.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return X.value.nanos;case"Millis":return BigInt(Math.round(X.value.millis*1e6))}},PH=O6(E3);var GC=B(2,(Q,X)=>{switch(Q.value._tag){case"Millis":return X.onMillis(Q.value.millis);case"Nanos":return X.onNanos(Q.value.nanos);case"Infinity":return X.onInfinity();case"NegativeInfinity":return(X.onNegativeInfinity??X.onInfinity)()}}),RH=B(3,(Q,X,Y)=>{if(Q.value._tag==="Infinity"||Q.value._tag==="NegativeInfinity"||X.value._tag==="Infinity"||X.value._tag==="NegativeInfinity")return Y.onInfinity(Q,X);if(Q.value._tag==="Millis")return X.value._tag==="Millis"?Y.onMillis(Q.value.millis,X.value.millis):Y.onNanos(E3(Q),X.value.nanos);else return Y.onNanos(Q.value.nanos,E3(X))});var x3=(Q,X)=>RH(Q,X,{onMillis:(Y,J)=>Y===J,onNanos:(Y,J)=>Y===J,onInfinity:(Y,J)=>Y.value._tag===J.value._tag});var NH=B(2,(Q,X)=>RH(Q,X,{onMillis:(Y,J)=>H1(Y-J),onNanos:(Y,J)=>H1(Y-J),onInfinity:(Y,J)=>{let $=Y.value._tag,Z=J.value._tag;if($==="Infinity")return Z==="Infinity"?R5:i8;if($==="NegativeInfinity")return Z==="NegativeInfinity"?R5:P6;return Z==="Infinity"?P6:i8}}));var KC=B(2,(Q,X)=>x3(Q,X));var M5=B(2,(Q,X)=>(Y)=>{let J=Q(Y);if(u(J))return f(Y);let $=X(J.success);if(u($))return f(Y);return $}),MH=(Q)=>(X)=>{let Y=Q(X);return u(Y)?b():F(Y.success)};var y9=_0("effect/Scheduler",{defaultValue:()=>new A5}),wH="setImmediate"in globalThis?(Q)=>{let X=globalThis.setImmediate(Q);return()=>globalThis.clearImmediate(X)}:(Q)=>{let X=setTimeout(Q,0);return()=>clearTimeout(X)};class CH{buckets=[];scheduleTask(Q,X){let Y=this.buckets,J=Y.length,$,Z=0;for(;Z<J;Z++){if(Y[Z][0]>X)break;$=Y[Z]}if($&&$[0]===X)$[1].push(Q);else if(Z===J)Y.push([X,[Q]]);else Y.splice(Z,0,[X,[Q]])}drain(){let Q=this.buckets;return this.buckets=[],Q}}class A5{executionMode;setImmediate;constructor(Q="async",X=wH){this.executionMode=Q,this.setImmediate=X}shouldYield(Q){return Q.currentOpCount>=Q.maxOpsBeforeYield}makeDispatcher(){return new TH(this.setImmediate)}}class TH{tasks=new CH;running=void 0;setImmediate;constructor(Q=wH){this.setImmediate=Q}scheduleTask(Q,X){if(this.tasks.scheduleTask(Q,X),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let Q=this.tasks.drain();for(let X=0;X<Q.length;X++){let Y=Q[X][1];for(let J=0;J<Y.length;J++)Y[J]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var IH=_0("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),jH=_0("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var v3="effect/Tracer/ParentSpan";class Q7 extends l1()(v3){}var WC=(Q)=>Q;var X7=_0("effect/Tracer/DisablePropagation",{defaultValue:AX}),xH=_0("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),vH=_0("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),k3="effect/Tracer",Y7=_0(k3,{defaultValue:()=>WC({span:(Q)=>new kH(Q)})});class kH{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(Q){this.name=Q.name,this.parent=Q.parent,this.annotations=Q.annotations,this.links=Q.links,this.startTime=Q.startTime,this.kind=Q.kind,this.sampled=Q.sampled,this.status={_tag:"Started",startTime:Q.startTime},this.attributes=new Map,this.traceId=U6(Q.parent)?.traceId??SH(32),this.spanId=SH(16)}end(Q,X){this.status={_tag:"Ended",endTime:Q,exit:X,startTime:this.status.startTime}}attribute(Q,X){this.attributes.set(Q,X)}event(Q,X,Y){this.events.push([Q,X,Y??{}])}addLinks(Q){this.links.push(...Q)}}var SH=function(){return function(Y){let J="";for(let $=0;$<Y;$++)J+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return J}}();var yH="effect/observability/Metric/FiberRuntimeMetricsKey";var J7=_0("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),bH=_0("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),b9=_0("effect/References/CurrentStackFrame",{defaultValue:N8}),$7=_0("effect/References/TracerEnabled",{defaultValue:P4}),g9=_0("effect/References/TracerTimingEnabled",{defaultValue:P4}),h9=_0("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),m9=_0("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),s8=_0("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),y3=_0("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),b3=_0("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var Z7=_0("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var G7=(Q)=>{if(Q?.captureStackTrace===!1)return Q;else if(Q?.captureStackTrace!==void 0&&typeof Q.captureStackTrace!=="boolean")return Q;let X=Error.stackTraceLimit;Error.stackTraceLimit=3;let Y=Error();return Error.stackTraceLimit=X,{...Q,captureStackTrace:qC(()=>Y.stack)}},g3=(Q)=>(X)=>{let Y;return()=>{if(Y!==void 0)return Y;let J=X();if(!J)return;let $=J.split(`
13
- `);if($[Q]!==void 0)return Y=$[Q].trim(),Y}},qC=g3(3);var gH="dev";class l3 extends I9{fiberId;constructor(Q,X=j9){super("Interrupt",X,"Interrupted");this.fiberId=Q}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[W0](Q){return B6(Q)&&this.fiberId===Q.fiberId&&this.annotations===Q.annotations}[K0](){return u0(T0(`${this._tag}:${this.fiberId}`))(TX(this.annotations))}}var lH=(Q)=>new l3(Q),I5=(Q)=>new f8([new l3(Q)]),r3=(Q)=>Q.reasons.some(w4),o3=(Q)=>{let X=Q.reasons.find(w4);return X?l(X):f(Q)},a1=(Q)=>{for(let X=0;X<Q.reasons.length;X++){let Y=Q.reasons[X];if(Y._tag==="Fail")return l(Y.error)}return f(Q)},rH=MH(a1),W7=(Q)=>Q.reasons.some(D6),oH=(Q)=>{let X=Q.reasons.find(D6);return X?l(X):f(Q)},o9=(Q)=>{let X=Q.reasons.find(D6);return X?l(X.defect):f(Q)},H7=(Q)=>Q.reasons.some(B6),nH=(Q)=>{let X=Q.reasons.find(B6);return X?l(X):f(Q)},V7=(Q)=>{let X;for(let Y=0;Y<Q.reasons.length;Y++){let J=Q.reasons[Y];if(J._tag!=="Interrupt")continue;if(X??=new Set,J.fiberId!==void 0)X.add(J.fiberId)}return X?l(X):f(Q)},iH=(Q)=>{let X=V7(Q);return u(X)?DC:X.success},DC=new Set,aH=(Q)=>Q.reasons.length>0&&Q.reasons.every(B6),sH=(Q)=>j4(Q.annotations),tH=(Q)=>{let X=new Map;for(let Y of Q.reasons)if(Y.annotations.size>0)for(let[J,$]of Y.annotations)X.set(J,$);return j4(X)},n3=B(2,(Q,X)=>{if(Q.reasons.length===0)return X;else if(X.reasons.length===0)return Q;let Y=new f8(C3(Q.reasons,X.reasons));return n(Q,Y)?Q:Y}),eH=B(2,(Q,X)=>{let Y=!1,J=Q.reasons.map(($)=>{if(w4($))return Y=!0,new q5(X($.error));return $});return Y?u8(J):Q}),BC=(Q)=>{let X={Fail:[],Die:[],Interrupt:[]};for(let Y=0;Y<Q.reasons.length;Y++)X[Q.reasons[Y]._tag].push(Q.reasons[Y]);return X},_7=(Q)=>{let X=BC(Q);if(X.Fail.length>0)return X.Fail[0].error;else if(X.Die.length>0)return X.Die[0].defect;else if(X.Interrupt.length>0)return new globalThis.Error("All fibers interrupted without error");return new globalThis.Error("Empty cause")},i3=(Q)=>{let X=[],Y=[];if(Q.reasons.length===0)return X;let J=Error.stackTraceLimit;Error.stackTraceLimit=1;for(let $ of Q.reasons){if($._tag==="Interrupt"){Y.push($);continue}X.push(h3($._tag==="Die"?$.defect:$.error,$.annotations))}if(X.length===0){let $=Error("The fiber was interrupted by:");$.name="InterruptCause",$.stack=FC($,Y);let Z=new globalThis.Error("All fibers interrupted without error",{cause:$});Z.name="InterruptError",Z.stack=`${Z.name}: ${Z.message}`,X.push(h3(Z,Y[0].annotations))}return Error.stackTraceLimit=J,X},h3=(Q,X)=>{let Y=typeof Q,J;if(Q&&Y==="object"){if(J=new globalThis.Error(UC(Q),{cause:Q.cause?h3(Q.cause):void 0}),typeof Q.name==="string")J.name=Q.name;if(typeof Q.stack==="string")J.stack=zC(Q.stack,J,X);else{let $=`${J.name}: ${J.message}`;J.stack=X?QV($,X):$}for(let $ of Object.keys(Q))if(!($ in J))J[$]=Q[$]}else J=new globalThis.Error(!Q?`Unknown error: ${Q}`:Y==="string"?Q:V6(Q));return J},UC=(Q)=>{if(typeof Q.message==="string")return Q.message;else if(typeof Q.toString==="function"&&Q.toString!==Object.prototype.toString&&Q.toString!==Array.prototype.toString)try{return Q.toString()}catch{}return V6(Q)},OC=/\((.*)\)/g,zC=(Q,X,Y)=>{let J=`${X.name}: ${X.message}`,$=(Q.startsWith(J)?Q.slice(J.length):Q).split(`
14
- `),Z=[J];for(let G=1;G<$.length;G++){if(/(?:Generator\.next|~effect\/Effect)/.test($[G]))break;Z.push($[G])}return Y?QV(Z.join(`
12
+ `)}return X},NV=U(2,(Q,X)=>{if(Q.mapUnsafe.has(X.key))return R(Q.mapUnsafe.get(X.key));return oj(X)?R(M$(X)):d()}),d7=U(2,(Q,X)=>{if(Q.mapUnsafe.size===0)return X;if(X.mapUnsafe.size===0)return Q;return MV(Q,(Y)=>{X.mapUnsafe.forEach(($,J)=>Y.set(J,$))})}),LV=(...Q)=>{let X=new Map;for(let Y=0;Y<Q.length;Y++)Q[Y].mapUnsafe.forEach(($,J)=>{X.set(J,$)});return J6(X)};var MV=(Q,X)=>{if(Q.mutable)return X(Q.mapUnsafe),Q;let Y=new Map(Q.mapUnsafe);return X(Y),J6(Y)},R0=q8;var w$=(Q)=>Q.length>0;var t=_V,i=VV;var wV=(Q)=>{if(r1(Q))try{return t(Q())}catch(X){return i(X)}else try{return t(Q.try())}catch(X){return i(Q.catch(X))}};var PV=k7,_0=z$,E1=O$;var AV=(Q,X)=>H1((Y,$)=>_0(Y)?_0($)&&X(Y.failure,$.failure):E1($)&&Q(Y.success,$.success));var a9=U(2,(Q,X)=>_0(Q)?i(X(Q.failure)):t(Q.success)),X9=U(2,(Q,X)=>E1(Q)?t(X(Q.success)):i(Q.failure)),B8=U(2,(Q,{onFailure:X,onSuccess:Y})=>_0(Q)?X(Q.failure):Y(Q.success));var UQ=U(2,(Q,X)=>_0(Q)?X(Q.failure):Q.success);var p7=U(2,(Q,X)=>_0(Q)?i(Q.failure):X(Q.success));var le={[Symbol.iterator](){return aj}},aj={next(){return{done:!0,value:void 0}}};var CV=U(2,(Q,X)=>({[Symbol.iterator](){let Y=Q[Symbol.iterator](),$=0;return{next(){let J=Y.next();while(!J.done){if(X(J.value,$++))return{done:!1,value:J.value};J=Y.next()}return{done:!0,value:void 0}}}}}));var f7=U(2,(Q,X)=>{let Y={...Q};for(let $ of tj(Q))b(Y,$,X(Q[$],$));return Y});var tj=(Q)=>Object.keys(Q);var s9=globalThis.Array;var P$=(Q)=>new s9(Q);var M1=(Q)=>s9.isArray(Q)?Q:s9.from(Q),TV=(Q)=>s9.isArray(Q)?Q:[Q];var c7=U(2,(Q,X)=>[...Q,X]),ej=U(2,(Q,X)=>M1(Q).concat(M1(X)));var ae=s9.isArray;var e8=w$,Z6=w$;var BQ=U(2,(Q,X)=>{let Y=s9.from(Q);return Y.sort(X),Y});var QT=(Q,X)=>{let Y=X0(X),$=Q.get(Y);if($===void 0)return Q.set(Y,[X]),!0;for(let J of $)if(o(J,X))return!1;return $.push(X),!0};var A$=U(2,(Q,X)=>{let Y=M1(Q),$=M1(X);if(Z6(Y))return Z6($)?l7(ej(Y,$)):Y;return $});var u7=()=>[];var Q4=U(2,(Q,X)=>Q.map(X));var C$=(Q)=>{let X=[];for(let Y of Q)if(L1(Y))X.push(Y.value);return X};var j$=U(2,(Q,X)=>{let Y=[],$=[],J=0;for(let Z of Q){let G=X(Z,J++);if(E1(G))$.push(G.success);else Y.push(G.failure)}return[Y,$]});var l7=(Q)=>{let X=M1(Q);if(X.length<2)return[...X];let Y=new Map,$=[];for(let J of X)if(QT(Y,J))$.push(J);return $};var XT=w4((Q,X)=>Q.concat(X),[]);function IV(){return XT}var o7="~effect/time/Duration",YT=BigInt(0),$T=BigInt(1);var JT=BigInt(1000);var r7=(Q)=>BigInt(Q<0?Math.ceil(Q-0.5):Math.floor(Q+0.5)),xV=(Q)=>r7(Q*1e6),EV=(Q,X)=>Q.includes(".")?r7(Number(Q)*Number(X)):BigInt(Q)*X;var ZT=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,s1=(Q)=>{switch(typeof Q){case"number":return G6(Q);case"bigint":return Y4(Q);case"string":{if(Q==="Infinity")return P4;if(Q==="-Infinity")return Y9;let X=ZT.exec(Q);if(!X)break;let[Y,$,J]=X;if(J==="nano"||J==="nanos")return Y4(EV($,$T));if(J==="micro"||J==="micros")return Y4(EV($,JT));let Z=Number($);switch(J){case"milli":case"millis":return G6(Z);case"second":case"seconds":return KT(Z);case"minute":case"minutes":return VT(Z);case"hour":case"hours":return _T(Z);case"day":case"days":return qT(Z);case"week":case"weeks":return DT(Z)}break}case"object":{if(Q===null)break;if(o7 in Q)return Q;if(Array.isArray(Q)){if(Q.length!==2||!Q.every(ZQ))return SV(Q);if(Number.isNaN(Q[0])||Number.isNaN(Q[1]))return t9;if(Q[0]===-1/0||Q[1]===-1/0)return Y9;if(Q[0]===1/0||Q[1]===1/0)return P4;return S1(r7(Q[0]*1e9+Q[1]))}let X=Q,Y=0;if(X.weeks)Y+=X.weeks*604800000;if(X.days)Y+=X.days*86400000;if(X.hours)Y+=X.hours*3600000;if(X.minutes)Y+=X.minutes*60000;if(X.seconds)Y+=X.seconds*1000;if(X.milliseconds)Y+=X.milliseconds;if(!X.microseconds&&!X.nanoseconds)return S1(Y);return S1(r7(Y*1e6+(X.microseconds??0)*1000+(X.nanoseconds??0)))}}return SV(Q)},SV=(Q)=>{throw Error(`Invalid Input: ${Q}`)},bV=Q9(s1),vV={_tag:"Millis",millis:0},GT={_tag:"Infinity"},WT={_tag:"NegativeInfinity"},HT={[o7]:o7,[D0](){return $$(this.value)},[U0](Q){return I$(Q)&&BT(this,Q)},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"}}},[W1](){return this.toJSON()},pipe(){return H0(this,arguments)}},S1=(Q)=>{let X=Object.create(HT);if(typeof Q==="number")if(isNaN(Q)||Q===0||Object.is(Q,-0))X.value=vV;else if(!Number.isFinite(Q))X.value=Q>0?GT:WT;else if(!Number.isInteger(Q))X.value={_tag:"Nanos",nanos:xV(Q)};else X.value={_tag:"Millis",millis:Q};else if(Q===YT)X.value=vV;else X.value={_tag:"Nanos",nanos:Q};return X},I$=(Q)=>C(Q,o7);var t9=S1(0),P4=S1(1/0),Y9=S1(-1/0),Y4=(Q)=>S1(Q);var G6=(Q)=>S1(Q),KT=(Q)=>S1(Q*1000),VT=(Q)=>S1(Q*60000),_T=(Q)=>S1(Q*3600000),qT=(Q)=>S1(Q*86400000),DT=(Q)=>S1(Q*604800000),W6=(Q)=>UT(s1(Q),{onMillis:u,onNanos:(X)=>Number(X)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var T$=(Q)=>{let X=s1(Q);switch(X.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return X.value.nanos;case"Millis":return xV(X.value.millis)}},kV=Q9(T$);var UT=U(2,(Q,X)=>{switch(Q.value._tag){case"Millis":return X.onMillis(Q.value.millis);case"Nanos":return X.onNanos(Q.value.nanos);case"Infinity":return X.onInfinity();case"NegativeInfinity":return(X.onNegativeInfinity??X.onInfinity)()}}),yV=U(3,(Q,X,Y)=>{if(Q.value._tag==="Infinity"||Q.value._tag==="NegativeInfinity"||X.value._tag==="Infinity"||X.value._tag==="NegativeInfinity")return Y.onInfinity(Q,X);if(Q.value._tag==="Millis")return X.value._tag==="Millis"?Y.onMillis(Q.value.millis,X.value.millis):Y.onNanos(T$(Q),X.value.nanos);else return Y.onNanos(Q.value.nanos,T$(X))});var E$=(Q,X)=>yV(Q,X,{onMillis:(Y,$)=>Y===$,onNanos:(Y,$)=>Y===$,onInfinity:(Y,$)=>Y.value._tag===$.value._tag});var gV=U(2,(Q,X)=>yV(Q,X,{onMillis:(Y,$)=>S1(Y-$),onNanos:(Y,$)=>S1(Y-$),onInfinity:(Y,$)=>{let J=Y.value._tag,Z=$.value._tag;if(J==="Infinity")return Z==="Infinity"?t9:P4;if(J==="NegativeInfinity")return Z==="NegativeInfinity"?t9:Y9;return Z==="Infinity"?Y9:P4}}));var BT=U(2,(Q,X)=>E$(Q,X));var Q5=U(2,(Q,X)=>(Y)=>{let $=Q(Y);if(_0($))return i(Y);let J=X($.success);if(_0(J))return i(Y);return J}),hV=(Q)=>(X)=>{let Y=Q(X);return _0(Y)?d():R(Y.success)};var zQ=R0("effect/Scheduler",{defaultValue:()=>new X5}),dV="setImmediate"in globalThis?(Q)=>{let X=globalThis.setImmediate(Q);return()=>globalThis.clearImmediate(X)}:(Q)=>{let X=setTimeout(Q,0);return()=>clearTimeout(X)};class pV{buckets=[];scheduleTask(Q,X){let Y=this.buckets,$=Y.length,J,Z=0;for(;Z<$;Z++){if(Y[Z][0]>X)break;J=Y[Z]}if(J&&J[0]===X)J[1].push(Q);else if(Z===$)Y.push([X,[Q]]);else Y.splice(Z,0,[X,[Q]])}drain(){let Q=this.buckets;return this.buckets=[],Q}}class X5{executionMode;setImmediate;constructor(Q="async",X=dV){this.executionMode=Q,this.setImmediate=X}shouldYield(Q){return Q.currentOpCount>=Q.maxOpsBeforeYield}makeDispatcher(){return new fV(this.setImmediate)}}class fV{tasks=new pV;running=void 0;setImmediate;constructor(Q=dV){this.setImmediate=Q}scheduleTask(Q,X){if(this.tasks.scheduleTask(Q,X),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let Q=this.tasks.drain();for(let X=0;X<Q.length;X++){let Y=Q[X][1];for(let $=0;$<Y.length;$++)Y[$]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var cV=R0("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),uV=R0("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var S$="effect/Tracer/ParentSpan";class i7 extends q8()(S$){}var zT=(Q)=>Q;var n7=R0("effect/Tracer/DisablePropagation",{defaultValue:O7}),rV=R0("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),iV=R0("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),v$="effect/Tracer",a7=R0(v$,{defaultValue:()=>zT({span:(Q)=>new nV(Q)})});class nV{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(Q){this.name=Q.name,this.parent=Q.parent,this.annotations=Q.annotations,this.links=Q.links,this.startTime=Q.startTime,this.kind=Q.kind,this.sampled=Q.sampled,this.status={_tag:"Started",startTime:Q.startTime},this.attributes=new Map,this.traceId=e6(Q.parent)?.traceId??oV(32),this.spanId=oV(16)}end(Q,X){this.status={_tag:"Ended",endTime:Q,exit:X,startTime:this.status.startTime}}attribute(Q,X){this.attributes.set(Q,X)}event(Q,X,Y){this.events.push([Q,X,Y??{}])}addLinks(Q){this.links.push(...Q)}}var oV=function(){return function(Y){let $="";for(let J=0;J<Y;J++)$+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return $}}();var aV="effect/observability/Metric/FiberRuntimeMetricsKey";var sV=R0("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),OQ=R0("effect/References/CurrentStackFrame",{defaultValue:i8}),s7=R0("effect/References/TracerEnabled",{defaultValue:n4}),FQ=R0("effect/References/TracerTimingEnabled",{defaultValue:n4}),RQ=R0("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),NQ=R0("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),A4=R0("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),x$=R0("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),b$=R0("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var t7=R0("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var e7=(Q)=>{if(Q?.captureStackTrace===!1)return Q;else if(Q?.captureStackTrace!==void 0&&typeof Q.captureStackTrace!=="boolean")return Q;let X=Q6();i1(3);let Y=Error();return i1(X),{...Q,captureStackTrace:NT(()=>Y.stack)}},k$=(Q)=>(X)=>{let Y;return()=>{if(Y!==void 0)return Y;let $=X();if(!$)return;let J=$.split(`
13
+ `);if(J[Q]!==void 0)return Y=J[Q].trim(),Y}},NT=k$(3);var tV="dev";class u$ extends KQ{fiberId;constructor(Q,X=VQ){super("Interrupt",X,"Interrupted");this.fiberId=Q}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[U0](Q){return a6(Q)&&this.fiberId===Q.fiberId&&this.annotations===Q.annotations}[D0](){return X1(b0(`${this._tag}:${this.fiberId}`))(N7(this.annotations))}}var Z_=(Q)=>new u$(Q),J5=(Q)=>new R4([new u$(Q)]),l$=(Q)=>Q.reasons.some(t4),o$=(Q)=>{let X=Q.reasons.find(t4);return X?t(X):i(Q)},z8=(Q)=>{for(let X=0;X<Q.reasons.length;X++){let Y=Q.reasons[X];if(Y._tag==="Fail")return t(Y.error)}return i(Q)},G_=hV(z8),XY=(Q)=>Q.reasons.some(n6),W_=(Q)=>{let X=Q.reasons.find(n6);return X?t(X):i(Q)},TQ=(Q)=>{let X=Q.reasons.find(n6);return X?t(X.defect):i(Q)},YY=(Q)=>Q.reasons.some(a6),H_=(Q)=>{let X=Q.reasons.find(a6);return X?t(X):i(Q)},$Y=(Q)=>{let X;for(let Y=0;Y<Q.reasons.length;Y++){let $=Q.reasons[Y];if($._tag!=="Interrupt")continue;if(X??=new Set,$.fiberId!==void 0)X.add($.fiberId)}return X?t(X):i(Q)},K_=(Q)=>{let X=$Y(Q);return _0(X)?LT:X.success},LT=new Set,V_=(Q)=>Q.reasons.length>0&&Q.reasons.every(a6),__=(Q)=>J6(Q.annotations),q_=(Q)=>{let X=new Map;for(let Y of Q.reasons)if(Y.annotations.size>0)for(let[$,J]of Y.annotations)X.set($,J);return J6(X)},r$=U(2,(Q,X)=>{if(Q.reasons.length===0)return X;else if(X.reasons.length===0)return Q;let Y=new R4(A$(Q.reasons,X.reasons));return o(Q,Y)?Q:Y}),D_=U(2,(Q,X)=>{let Y=!1,$=Q.reasons.map((J)=>{if(t4(J))return Y=!0,new u9(X(J.error));return J});return Y?N4($):Q}),MT=(Q)=>{let X={Fail:[],Die:[],Interrupt:[]};for(let Y=0;Y<Q.reasons.length;Y++)X[Q.reasons[Y]._tag].push(Q.reasons[Y]);return X},JY=(Q)=>{let X=MT(Q);if(X.Fail.length>0)return X.Fail[0].error;else if(X.Die.length>0)return X.Die[0].defect;else if(X.Interrupt.length>0)return new globalThis.Error("All fibers interrupted without error");return new globalThis.Error("Empty cause")},i$=(Q,X)=>{let Y=[],$=[];if(Q.reasons.length===0)return Y;let J=Q6();i1(1);for(let Z of Q.reasons){if(Z._tag==="Interrupt"){$.push(Z);continue}Y.push(g$(Z._tag==="Die"?Z.defect:Z.error,Z.annotations,X))}if(Y.length===0){let Z=Error("The fiber was interrupted by:");Z.name="InterruptCause",Z.stack=CT(Z,$);let G=new globalThis.Error("All fibers interrupted without error",{cause:Z});G.name="InterruptError",G.stack=`${G.name}: ${G.message}`,Y.push(g$(G,$[0].annotations,X))}return i1(J),Y},g$=(Q,X,Y)=>{let $=typeof Q,J;if(Q&&$==="object"){if(J=new globalThis.Error(wT(Q),{cause:Q.cause?g$(Q.cause):void 0}),typeof Q.name==="string")J.name=Q.name;if(typeof Q.stack==="string")J.stack=AT(Q.stack,J,X);else{let Z=`${J.name}: ${J.message}`;J.stack=X?U_(Z,X):Z}if(Y?.includeCauseInStack)J.stack=z_(J);for(let Z of Object.keys(Q))if(!(Z in J))J[Z]=Q[Z]}else J=new globalThis.Error(!Q?`Unknown error: ${Q}`:$==="string"?Q:l6(Q));return J},wT=(Q)=>{if(typeof Q.message==="string")return Q.message;else if(typeof Q.toString==="function"&&Q.toString!==Object.prototype.toString&&Q.toString!==Array.prototype.toString)try{return Q.toString()}catch{}return l6(Q)},PT=/\((.*)\)/g,AT=(Q,X,Y)=>{let $=`${X.name}: ${X.message}`,J=(Q.startsWith($)?Q.slice($.length):Q).split(`
14
+ `),Z=[$];for(let G=1;G<J.length;G++){if(/(?:Generator\.next|~effect\/Effect)/.test(J[G]))break;Z.push(J[G])}return Y?U_(Z.join(`
15
15
  `),Y):Z.join(`
16
- `)},QV=(Q,X)=>{let Y=X?.get(E9.key);if(Y)Q=`${Q}
17
- ${XV(Y)}`;return Q},FC=(Q,X)=>{let Y=[`${Q.name}: ${Q.message}`];for(let J of X){let $=J.fiberId!==void 0?`#${J.fiberId}`:"unknown",Z=J.annotations.get(SW.key);if(Y.push(` at fiber (${$})`),Z)Y.push(XV(Z))}return Y.join(`
18
- `)},XV=(Q)=>{let X=[],Y=Q,J=0;while(Y&&J<10){let $=Y.stack();if($){let Z=$.matchAll(OC),G=!1;for(let[,K]of Z)G=!0,X.push(` at ${Y.name} (${K})`);if(!G)X.push(` at ${Y.name} (${$.replace(/^at /,"")})`)}else X.push(` at ${Y.name}`);Y=Y.parent,J++}return X.join(`
19
- `)},q7=(Q)=>i3(Q).map((X)=>X.cause?`${X.stack} {
20
- ${YV(X.cause," ")}
21
- }`:X.stack).join(`
22
- `),YV=(Q,X)=>{let Y=Q.stack.split(`
23
- `),J=`${X}[cause]: ${Y[0]}`;for(let $=1,Z=Y.length;$<Z;$++)J+=`
24
- ${X}${Y[$]}`;if(Q.cause)J+=` {
25
- ${YV(Q.cause,`${X} `)}
26
- ${X}}`;return J},m3=`~effect/Fiber/${gH}`,LC={_A:g,_E:g},PC={id:0},D7=()=>globalThis[K5];class a3{constructor(Q,X=!0){this[m3]=LC,this.setContext(Q),this.id=++PC.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=X,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this.runtimeMetrics?.recordFiberStart(this.context)}[m3];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(Q){return $H(this.context,Q)}addObserver(Q){if(this._exit)return Q(this._exit),Z5;return this._observers.push(Q),()=>{let X=this._observers.indexOf(Q);if(X>=0)this._observers.splice(X,1)}}interruptUnsafe(Q,X){if(this._exit)return;let Y=I5(Q);if(this.currentStackFrame)Y=D5(Y,nX(E9,this.currentStackFrame));if(X)Y=D5(Y,X);if(this._interruptedCause=this._interruptedCause?n3(this._interruptedCause,Y):Y,this.interruptible)this.evaluate(M0(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(Q){if(this._exit)return;else if(this._yielded!==void 0){let J=this._yielded;this._yielded=void 0,J()}let X=this.runLoop(Q);if(X===A4)return;let Y=d3.interruptChildren&&d3.interruptChildren(this);if(Y!==void 0)return this.evaluate(C(Y,()=>X));this._exit=X,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let J=0;J<this._observers.length;J++)this._observers[J](X);this._observers.length=0}runLoop(Q){let X=globalThis[K5];globalThis[K5]=this;let Y=!1,J=Q;this.currentOpCount=0;let $=++this.currentLoopCount;try{while(!0){if(this.currentOpCount++,!Y&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){Y=!0;let Z=J;J=C(E5,()=>Z)}if(J=this.currentTracerContext?this.currentTracerContext(J,this):J[x0](this),$!==this.currentLoopCount)return A4;else if(J===A4){let Z=this._yielded;if(_6 in Z)return this._yielded=void 0,Z;return A4}}}catch(Z){if(!N(J,x0))return w8(`Fiber.runLoop: Not a valid effect: ${String(J)}`);return this.runLoop(w8(Z))}finally{globalThis[K5]=X}}getCont(Q){while(!0){let X=this._stack.pop();if(!X)return;let Y=X[M4]&&X[M4](this);if(Y)return Y[Q]=Y,Y;if(X[Q])return X}}yieldWith(Q){return this._yielded=Q,A4}children(){return this._children??=new Set}pipe(){return X0(this,arguments)}setContext(Q){this.context=Q;let X=this.getRef(y9);if(X!==this.currentScheduler)this.currentScheduler=X,this._dispatcher=void 0;this.currentSpan=Q.mapUnsafe.get(v3),this.currentLogLevel=this.getRef(y3),this.minimumLogLevel=this.getRef(b3),this.currentStackFrame=Q.mapUnsafe.get(b9.key),this.maxOpsBeforeYield=this.getRef(IH),this.currentPreventYield=this.getRef(jH),this.runtimeMetrics=Q.mapUnsafe.get(yH);let Y=Q.mapUnsafe.get(k3);this.currentTracerContext=Y?Y.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var d3={interruptChildren:void 0},B7=(Q)=>{if(!Q.currentStackFrame)return;let X=new Map;return X.set(E9.key,Q.currentStackFrame),j4(X)},RC=(Q)=>{if(Q._children===void 0||Q._children.size===0)return;return w5(Q._children)},NC=(Q)=>{let X=Q;if(X._exit)return A(X._exit);return T1((Y)=>{if(X._exit)return Y(A(X._exit));return $0(Q.addObserver((J)=>Y(A(J))))})},s3=(Q)=>T1((X)=>{let Y=Q[Symbol.iterator](),J=[],$=void 0;function Z(){let G=Y.next();while(!G.done){if(G.value._exit){J.push(G.value._exit),G=Y.next();continue}$=G.value.addObserver((K)=>{J.push(K),Z()});return}X(A(J))}return Z(),$0(()=>$?.())});var MC=(Q)=>c((X)=>AC(Q,X.id)),AC=B((Q)=>N(Q[0],m3),(Q,X,Y)=>c((J)=>{let $=B7(J);return $=$&&Y?aX($,Y):$??Y,Q.interruptUnsafe(X,$),n9(NC(Q))})),w5=(Q)=>c((X)=>{let Y=B7(X);for(let J of Q)J.interruptUnsafe(X.id,Y);return n9(s3(Q))});var A=c0,M0=w1,F0=A8,$0=u1({op:"Sync",[x0](Q){let X=this[e](),Y=Q.getCont(A1);return Y?Y[A1](X,Q):Q.yieldWith(c0(X))}}),a=u1({op:"Suspend",[x0](Q){return this[e]()}}),JV=S1({onNone:()=>F0(new C8("Effect.fromOption: Option.none")),onSome:A}),j5=o1({onFailure:F0,onSuccess:A}),$V=(Q)=>Q==null?F0(new C8):A(Q),t3=u1({op:"Yield",[x0](Q){let X=!1;return Q.currentDispatcher.scheduleTask(()=>{if(X)return;Q.evaluate(i1)},this[e]??0),Q.yieldWith(()=>{X=!0})}}),E5=t3(0),e3=(Q)=>A(F(Q)),U7=A(b()),ZV=(Q)=>a(()=>M0(J0(Q))),N6=(Q)=>w8(Q),O7=(Q)=>a(()=>F0(J0(Q))),Y0=A(void 0);var GV=(Q)=>a(()=>{try{return A(J0(Q.try))}catch(X){return F0(J0(()=>Q.catch(X)))}});var QJ=(Q)=>XJ(function(X,Y){J0(()=>Q(Y)).then((J)=>X(A(J)),(J)=>X(N6(J)))},Q.length!==0),KV=(Q)=>{let X=typeof Q==="function"?Q:Q.try,Y=typeof Q==="function"?(J)=>new v7(J,"An error occurred in Effect.tryPromise"):Q.catch;return XJ(function(J,$){try{J0(()=>X($)).then((Z)=>J(A(Z)),(Z)=>J(F0(J0(()=>Y(Z)))))}catch(Z){J(F0(J0(()=>Y(Z))))}},eval.length!==0)},WV=(Q)=>c((X)=>Q(X.id)),HV=c(A),VV=WV(A),XJ=u1({op:"Async",single:!1,[x0](Q){let X=J0(()=>this[e][0].bind(Q.currentScheduler)),Y=!1,J=!1,$=this[e][1]?new AbortController:void 0,Z=X((G)=>{if(Y)return;if(Y=!0,J)Q.evaluate(G);else J=G},$?.signal);if(J!==!1)return J;if(J=!0,Q._yielded=()=>{Y=!0},$===void 0&&Z===void 0)return A4;return Q._stack.push(wC(()=>{return Y=!0,$?.abort(),Z??i1})),A4}}),wC=u1({op:"AsyncFinalizer",[M4](Q){if(Q.interruptible)Q.interruptible=!1,Q._stack.push(T7)},[J8](Q,X){return H7(Q)?C(this[e](),()=>M0(Q)):M0(Q)}}),T1=(Q)=>XJ(Q,Q.length>=2),YJ=T1(Z5),_V=(...Q)=>a(()=>C5(Q.length===1?Q[0]():Q[1].call(Q[0].self))),JJ=(Q,...X)=>{let Y=X.length===0?function(){return a(()=>C5(Q.apply(this,arguments)))}:function(){let J=a(()=>C5(Q.apply(this,arguments)));for(let $=0;$<X.length;$++)J=X[$](J,...arguments);return J};return $J(Q.length,Y)},$J=(Q,X)=>Object.defineProperty(X,"length",{value:Q,configurable:!0}),hH=g3(2),qV=function(){let Q=typeof arguments[0]==="string",X=Q?arguments[0]:"Effect.fn",Y=Q?arguments[1]:void 0,J=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let $=new globalThis.Error;if(globalThis.Error.stackTraceLimit=J,Q)return(Z,...G)=>mH(X,Z,$,G,Q,Y);return mH(X,arguments[0],$,Array.prototype.slice.call(arguments,1),Q,Y)},mH=(Q,X,Y,J,$,Z)=>{let G=typeof X==="function"?X:J.pop().bind(X.self);return $J(G.length,function(...K){let W=a(()=>{let V=G.apply(this,arguments);return d(V)?V:C5(V)});for(let V=0;V<J.length;V++)W=J[V](W,...K);if(!d(W))return W;let H=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let _=new globalThis.Error;return globalThis.Error.stackTraceLimit=H,e8($?p9(Q,Z,(V)=>u3(W,V)):W,b9,(V)=>({name:Q,stack:hH(()=>_.stack),parent:{name:`${Q} (definition)`,stack:hH(()=>Y.stack),parent:V}}))})},DV=(Q,...X)=>$J(Q.length,X.length===0?function(){return dH(()=>Q.apply(this,arguments))}:function(){let Y=dH(()=>Q.apply(this,arguments));for(let J of X)Y=J(Y);return Y}),dH=(Q)=>{try{let X=Q(),Y=void 0;while(!0){let J=X.next(Y);if(J.done)return A(J.value);let $=J.value;if($&&$._tag==="Success"){Y=$.value;continue}else if($&&$._tag==="Failure")return J.value;else{let Z=!0;return a(()=>{if(Z)return Z=!1,C(J.value,(G)=>C5(X,G));else return a(()=>C5(Q()))})}}}catch(X){return N6(X)}},C5=u1({op:"Iterator",single:!1,[A1](Q,X){let Y=this[e][0];while(!0){let J=Y.next(Q);if(J.done)return A(J.value);if(!V1(J.value))return X._stack.push(this),J.value;else if(J.value._tag==="Failure")return J.value;Q=J.value.value}},[x0](Q){return this[A1](this[e][1],Q)}}),k1=B(2,(Q,X)=>{let Y=A(X);return C(Q,(J)=>Y)}),z7=(Q)=>L0(Q,F),BV=(Q)=>A6(Q,{onFailure:A,onSuccess:F0}),t8=B(2,(Q,X)=>C(Q,(Y)=>d(X)?X:J0(()=>X(Y)))),M6=B(2,(Q,X)=>C(Q,(Y)=>k1(d(X)?X:J0(()=>X(Y)),Y))),n9=(Q)=>C(Q,(X)=>i1),UV=(Q)=>s1(Q,F0),ZJ=(Q,X)=>c((Y)=>T1((J)=>{let $=W1(Q),Z=$.length,G=0,K=!1,W=new Set,H=[],_=(V,q,D)=>{if(G++,V._tag==="Failure"){if(H.push(...V.cause.reasons),G>=Z)J(M0(u8(H)));return}let U=!K;if(K=!0,J(W.size===0?V:C(w6(w5(W)),()=>V)),U&&X?.onWinner)X.onWinner({fiber:q,index:D,parentFiber:Y})};for(let V=0;V<Z;V++){let q=C6(Y,$[V],!0,!0,!1);if(W.add(q),q.addObserver((D)=>{W.delete(q),_(D,q,V)}),K)break}return w5(W)})),GJ=(Q,X)=>c((Y)=>T1((J)=>{let $=!1,Z=new Set,G=(W)=>{$=!0,J(Z.size===0?W:C(w6(w5(Z)),()=>W))},K=0;for(let W of Q){if($)break;let H=K++,_=C6(Y,W,!0,!0,!1);Z.add(_),_.addObserver((V)=>{Z.delete(_);let q=!$;if(G(V),q&&X?.onWinner)X.onWinner({fiber:_,index:H,parentFiber:Y})})}return w5(Z)})),OV=B((Q)=>d(Q[1]),(Q,X,Y)=>ZJ([Q,X],Y)),F7=B((Q)=>d(Q[1]),(Q,X,Y)=>GJ([Q,X],Y)),C=B(2,(Q,X)=>{let Y=Object.create(CC);return Y[e]=Q,Y[A1]=X.length!==1?(J)=>X(J):X,Y}),CC=l8({op:"OnSuccess",[x0](Q){return Q._stack.push(this),this[e]}}),zV=B(2,(Q,X)=>{if(V1(Q))return Q._tag==="Success"?X.onSuccess(Q.value):X.onFailure(Q.cause);return I8(Q,X)}),V1=(Q)=>(_6 in Q),FV=B(2,(Q,X)=>{if(V1(Q))return Q._tag==="Success"?X(Q.value):Q;return C(Q,X)}),LV=(Q)=>C(Q,g),L0=B(2,(Q,X)=>C(Q,(Y)=>A(J0(()=>X(Y))))),PV=B(2,(Q,X)=>V1(Q)?HJ(Q,X):L0(Q,X)),RV=B(2,(Q,X)=>V1(Q)?VJ(Q,X):PJ(Q,X)),NV=B(2,(Q,X)=>V1(Q)?_J(Q,X):RJ(Q,X)),MV=B(2,(Q,X)=>{if(V1(Q)){if(Q._tag==="Success")return Q;let Y=a1(Q.cause);if(u(Y))return Q;return X(Y.success)}return y1(Q,X)}),AV=(Q)=>w1(I5(Q)),S5=(Q)=>Q._tag==="Success",wV=(Q)=>Q._tag==="Success"?l(Q):f(Q),CV=(Q)=>Q._tag==="Success"?l(Q.value):f(Q),KJ=(Q)=>Q._tag==="Failure",TV=(Q)=>Q._tag==="Failure"?l(Q):f(Q),i9=(Q)=>Q._tag==="Failure"?l(Q.cause):f(Q),WJ=M5(i9,a1),IV=M5(i9,o9),jV=(Q)=>Q._tag==="Failure"&&H7(Q.cause),EV=(Q)=>Q._tag==="Failure"&&W7(Q.cause),SV=(Q)=>Q._tag==="Failure"&&r3(Q.cause),i1=c0(void 0),HJ=B(2,(Q,X)=>Q._tag==="Success"?c0(X(Q.value)):Q),VJ=B(2,(Q,X)=>{if(Q._tag==="Success")return Q;let Y=a1(Q.cause);if(u(Y))return Q;return A8(X(Y.success))}),_J=B(2,(Q,X)=>{if(Q._tag==="Success")return c0(X.onSuccess(Q.value));let Y=a1(Q.cause);if(u(Y))return Q;return A8(X.onFailure(Y.success))}),TC=B(2,(Q,X)=>S5(Q)?c0(X):Q);var xV=B(2,(Q,X)=>S5(Q)?X.onSuccess(Q.value):X.onFailure(Q.cause)),vV=TC(void 0),qJ=(Q)=>{let X=[];for(let Y of Q)if(Y._tag==="Failure")X.push(...Y.cause.reasons);return X.length===0?i1:w1(u8(X))},kV=(Q)=>S5(Q)?F(Q.value):b(),yV=(Q)=>KJ(Q)?F(Q.cause):b(),bV=(Q)=>{let X=WJ(Q);return u(X)?b():F(X.success)},gV=(Q)=>Q,hV=(Q)=>c((X)=>A(ZH(X.context,Q))),IC=(Q)=>c((X)=>X.context.mapUnsafe.has(Q.key)?A(z6(X.context,Q)):F0(new C8)),a9=B(2,(Q,X)=>c((Y)=>{let J=Y.context,$=X(J);if(J===$)return Q;return Y.setContext($),v5(Q,()=>{Y.setContext(J);return})})),e8=B(3,(Q,X,Y)=>a9(Q,(J)=>{let $=z6(J,X),Z=Y($);if($===Z)return J;return Z8(J,X,Z)})),DJ=()=>jC,jC=c((Q)=>A(Q.context)),k4=(Q)=>c((X)=>Q(X.context)),Q4=B(2,(Q,X)=>{if(V1(Q))return Q;return a9(Q,aX(X))}),z1=function(){if(arguments.length===1)return B(2,(Q,X)=>pH(Q,arguments[0],X));return B(3,(Q,X,Y)=>pH(Q,X,Y)).apply(this,arguments)},pH=(Q,X,Y)=>a9(Q,(J)=>{if(J.mapUnsafe.get(X.key)===Y)return J;return Z8(J,X,Y)}),L7=B(3,(Q,X,Y)=>C(Y,(J)=>z1(Q,X,J))),mV=z1(J7),BJ=B((Q)=>d(Q[1]),(Q,X,Y)=>UJ(Q,X,(J,$)=>[J,$],Y)),UJ=B((Q)=>d(Q[1]),(Q,X,Y,J)=>J?.concurrent?L0(I7([Q,X],{concurrency:2}),([$,Z])=>J0(()=>Y($,Z))):C(Q,($)=>L0(X,(Z)=>J0(()=>Y($,Z))))),dV=B((Q)=>d(Q[0]),(Q,X,Y)=>gJ(Q,X,Y?(J)=>F0(Y(J)):()=>F0(new C8))),pV=B(2,(Q,X)=>C(X,(Y)=>Y?z7(Q):U7)),OJ=B(2,(Q,X)=>Array.from({length:X},()=>Q)),cV=B((Q)=>d(Q[0]),(Q,X,Y)=>I7(OJ(Q,X),Y)),P7=B((Q)=>d(Q[0]),(Q,X)=>b4({while:P4,body:Z1(X?.disableYield?Q:C(Q,(Y)=>E5)),step:Z5})),s1=B(2,(Q,X)=>{let Y=Object.create(EC);return Y[e]=Q,Y[J8]=X.length!==1?(J)=>X(J):X,Y}),EC=l8({op:"OnFailure",[x0](Q){return Q._stack.push(this),this[e]}}),zJ=B(3,(Q,X,Y)=>s1(Q,(J)=>{if(!X(J))return M0(J);return J0(()=>Y(J))})),x5=B(3,(Q,X,Y)=>s1(Q,(J)=>{let $=X(J);return u($)?M0($.failure):J0(()=>Y($.success,J))})),y1=B(2,(Q,X)=>x5(Q,a1,(Y)=>X(Y))),fV=(Q)=>A6(Q,{onFailure:(X)=>hX(X)?U7:F0(X),onSuccess:e3}),uV=B(2,(Q,X)=>x5(Q,o9,X)),lV=B(2,(Q,X)=>s1(Q,(Y)=>t8(J0(()=>X(Y)),M0(Y)))),rV=B(3,(Q,X,Y)=>zJ(Q,X,(J)=>t8(J0(()=>Y(J)),M0(J)))),R7=B(3,(Q,X,Y)=>s1(Q,(J)=>{let $=X(J);if(u($))return M0(J);return t8(J0(()=>Y($.success,J)),M0(J))})),FJ=B(2,(Q,X)=>R7(Q,a1,(Y)=>X(Y))),oV=B(3,(Q,X,Y)=>{let J=Array.isArray(X)?($)=>N($,"_tag")&&X.includes($._tag):W6(X);return FJ(Q,($)=>J($)?Y($):Y0)}),nV=B(2,(Q,X)=>R7(Q,o9,(Y)=>X(Y))),s9=B((Q)=>d(Q[0]),(Q,X,Y,J)=>s1(Q,($)=>{let Z=a1($);if(u(Z))return M0(Z.failure);if(!X(Z.success))return J?J0(()=>J(Z.success)):M0($);return J0(()=>Y(Z.success))})),N7=B((Q)=>d(Q[0]),(Q,X,Y,J)=>s1(Q,($)=>{let Z=a1($);if(u(Z))return M0(Z.failure);let G=X(Z.success);if(u(G))return J?J0(()=>J(G.failure)):M0($);return J0(()=>Y(G.success))})),LJ=B((Q)=>d(Q[0]),(Q,X,Y,J)=>{let $=Array.isArray(X)?(Z)=>N(Z,"_tag")&&X.includes(Z._tag):W6(X);return s9(Q,$,Y,J)}),iV=B((Q)=>d(Q[0]),(Q,X,Y)=>{let J;return N7(Q,($)=>{return J??=Object.keys(X),N($,"_tag")&&X8($._tag)&&J.includes($._tag)?l($):f($)},($)=>J0(()=>X[$._tag]($)),Y)}),aV=B((Q)=>d(Q[0]),(Q,X,Y,J,$)=>s9(Q,(Z)=>W6(Z,X)&&N(Z,"reason"),(Z)=>{let G=Z.reason;if(W6(G,Y))return J(G,Z);return $?J0(()=>$(G,Z)):F0(Z)})),sV=B((Q)=>d(Q[0]),(Q,X,Y,J)=>{let $;return s9(Q,(Z)=>W6(Z,X)&&N(Z,"reason")&&N(Z.reason,"_tag")&&X8(Z.reason._tag),(Z)=>{let G=Z.reason;if($??=Object.keys(Y),$.includes(G._tag))return J0(()=>Y[G._tag](G,Z));return J?J0(()=>J(G,Z)):F0(Z)})}),tV=B(2,(Q,X)=>N7(Q,(Y)=>{if(W6(Y,X)&&N(Y,"reason"))return l(Y.reason);return f(Y)},F0));var PJ=B(2,(Q,X)=>y1(Q,(Y)=>O7(()=>X(Y)))),RJ=B(2,(Q,X)=>A6(Q,{onFailure:(Y)=>O7(()=>X.onFailure(Y)),onSuccess:(Y)=>$0(()=>X.onSuccess(Y))})),NJ=(Q)=>y1(Q,N6),eV=B(2,(Q,X)=>y1(Q,(Y)=>$0(X))),Q_=(Q)=>a(()=>{let X=Q[Symbol.iterator](),Y=X.next();if(Y.done)return N6(Error("Received an empty collection of effects"));function J($){let Z=X.next();if(Z.done)return $.value;return y1($.value,(G)=>J(Z))}return J(Y)}),MJ=(Q)=>y1(Q,(X)=>C(E5,()=>MJ(Q))),X_=B((Q)=>d(Q[0]),(Q,X)=>{if(!X?.log)return A6(Q,{onFailure:(J)=>Y0,onSuccess:(J)=>Y0});let Y=W8(X.log===!0?void 0:X.log);return I8(Q,{onFailure(J){let $=o3(J);return u($)?M0($.failure):X.message===void 0?Y(J):Y(X.message,J)},onSuccess:(J)=>Y0})}),Y_=B((Q)=>d(Q[0]),(Q,X)=>{if(!X?.log)return I8(Q,{onFailure:(J)=>Y0,onSuccess:(J)=>Y0});let Y=W8(X.log===!0?void 0:X.log);return I8(Q,{onFailure:(J)=>X.message===void 0?Y(J):Y(X.message,J),onSuccess:(J)=>Y0})}),J_=(Q)=>M7(Q,{onFailure:b,onSuccess:F}),v4=(Q)=>t9(Q,{onFailure:f,onSuccess:l}),I8=B(2,(Q,X)=>{let Y=Object.create(SC);return Y[e]=Q,Y[A1]=X.onSuccess.length!==1?(J)=>X.onSuccess(J):X.onSuccess,Y[J8]=X.onFailure.length!==1?(J)=>X.onFailure(J):X.onFailure,Y}),SC=l8({op:"OnSuccessAndFailure",[x0](Q){return Q._stack.push(this),this[e]}}),AJ=B(2,(Q,X)=>I8(Q,{onFailure:(Y)=>$0(()=>X.onFailure(Y)),onSuccess:(Y)=>$0(()=>X.onSuccess(Y))})),A6=B(2,(Q,X)=>I8(Q,{onFailure:(Y)=>{let J=Y.reasons.find(w4);return J?J0(()=>X.onFailure(J.error)):M0(Y)},onSuccess:X.onSuccess})),M7=B(2,(Q,X)=>A6(Q,{onFailure:(Y)=>$0(()=>X.onFailure(Y)),onSuccess:(Y)=>$0(()=>X.onSuccess(Y))})),t9=B(2,(Q,X)=>{if(V1(Q)){if(Q._tag==="Success")return c0(X.onSuccess(Q.value));let Y=a1(Q.cause);if(u(Y))return Q;return c0(X.onFailure(Y.success))}return M7(Q,X)}),$_=B(2,(Q,X)=>{if(V1(Q)){if(Q._tag==="Success")return c0(X.onSuccess(Q.value));return c0(X.onFailure(Q.cause))}return AJ(Q,X)}),e9=(Q)=>V1(Q)?c0(Q):xC(Q),xC=u1({op:"Exit",[x0](Q){return Q._stack.push(this),this[e]},[A1](Q,X,Y){return A(Y??c0(Q))},[J8](Q,X,Y){return A(Y??w1(Q))}}),Z_=t9({onFailure:()=>!0,onSuccess:()=>!1}),G_=t9({onFailure:()=>!1,onSuccess:()=>!0}),K_=B(2,(Q,X)=>t8(I6(X),Q)),wJ=B(2,(Q,X)=>F7(Q,C(I6(X.duration),X.orElse))),W_=B(2,(Q,X)=>wJ(Q,{duration:X,orElse:()=>F0(new S7)})),H_=B(2,(Q,X)=>F7(z7(Q),k1(I6(X),b()))),V_=(Q)=>T6((X)=>{let Y=X.currentTimeNanosUnsafe();return L0(Q,(J)=>[a8(X.currentTimeNanosUnsafe()-Y),J])}),p3="~effect/Scope",c3="~effect/Scope/Closeable",QQ=l1("effect/Scope"),CJ=(Q,X)=>a(()=>A7(Q,X)??Y0),A7=(Q,X)=>{if(Q.state._tag==="Closed")return;let Y={_tag:"Closed",exit:X};if(Q.state._tag==="Empty"){Q.state=Y;return}let{finalizers:J}=Q.state;if(Q.state=Y,J.size===0)return;else if(J.size===1)return J.values().next().value(X);return vC(Q,J,X)},vC=JJ(function*(Q,X,Y){let J=[],$=[],Z=Array.from(X.values()),G=D7();for(let K=Z.length-1;K>=0;K--){let W=Z[K];if(Q.strategy==="sequential")J.push(yield*e9(W(Y)));else $.push(C6(G,W(Y),!0,!0,"inherit"))}if($.length>0)J=yield*s3($);return yield*qJ(J)});var __=(Q,X)=>{let Y=XQ(X);if(Q.state._tag==="Closed")return Y.state=Q.state,Y;let J={};return K7(Q,J,($)=>CJ(Y,$)),K7(Y,J,($)=>$0(()=>q_(Q,J))),Y},y4=(Q,X)=>{return a(()=>{if(Q.state._tag==="Closed")return X(Q.state.exit);return K7(Q,{},X),Y0})};var K7=(Q,X,Y)=>{if(Q.state._tag==="Empty")Q.state={_tag:"Open",finalizers:new Map([[X,Y]])};else if(Q.state._tag==="Open")Q.state.finalizers.set(X,Y)},q_=(Q,X)=>{if(Q.state._tag==="Open")Q.state.finalizers.delete(X)},XQ=(Q="sequential")=>({[c3]:c3,[p3]:p3,strategy:Q,state:kC}),kC={_tag:"Empty"};var YQ=QQ;var TJ=(Q)=>c((X)=>{let Y=X.context,J=XQ();return X.setContext(Z8(X.context,QQ,J)),v5(Q,($)=>{return X.setContext(Y),A7(J,$)})});var w7=(Q)=>a(()=>{let X=XQ();return F1(Q(X),(Y)=>a(()=>A7(X,Y)??Y0))}),C7=(Q,X,Y)=>k4((J)=>JQ(($)=>C(YQ,(Z)=>M6(Y?.interruptible?$(Q):Q,(G)=>y4(Z,(K)=>Q4(X(G,K),J)))))),IJ=(Q)=>C(YQ,(X)=>k4((Y)=>y4(X,(J)=>Q4(Q(J),Y)))),v5=u1({op:"OnExit",single:!1,[x0](Q){return Q._stack.push(this),this[e][0]},[M4](Q){if(Q.interruptible&&this[e][2]!==!0)Q._stack.push(T7),Q.interruptible=!1},[A1](Q,X,Y){Y??=c0(Q);let J=this[e][1](Y);return J?C(J,($)=>Y):Y},[J8](Q,X,Y){Y??=w1(Q);let J=this[e][1](Y);return J?C(J,($)=>Y):Y}}),F1=B(2,v5),D_=B(2,(Q,X)=>F1(Q,(Y)=>X)),jJ=B(3,(Q,X,Y)=>F1(Q,(J)=>{if(!X(J))return Y0;return Y(J)})),EJ=B(3,(Q,X,Y)=>F1(Q,(J)=>{let $=X(J);return u($)?Y0:Y($.success,J)})),SJ=B(2,(Q,X)=>EJ(Q,i9,X)),B_=B(3,(Q,X,Y)=>jJ(Q,(J)=>{if(J._tag!=="Failure")return!1;return X(J.cause)},(J)=>Y(J.cause))),xJ=B(3,(Q,X,Y)=>F1(Q,(J)=>{if(J._tag!=="Failure")return Y0;let $=X(J.cause);return u($)?Y0:Y($.success,J.cause)})),U_=B(2,(Q,X)=>xJ(V7,X)(Q)),O_=(Q,X,Y)=>JQ((J)=>C(Q,($)=>v5(J(X($)),(Z)=>Y($,Z),!0))),z_=(Q)=>C7(Q,(X)=>N(X,Symbol.asyncDispose)?QJ(()=>X[Symbol.asyncDispose]()):$0(()=>X[Symbol.dispose]())),vJ=B(2,(Q,X)=>$0(()=>{let Y=x4(v1(X)),J=Number.isFinite(Y),$=gC(!1),Z=0,G=!1,K,W=C($.await,()=>K);return[c((H)=>{let _=H.getRef(j8),V=J?_.currentTimeMillisUnsafe():0;if(G||V<Z)return K??W;return G=!0,$.closeUnsafe(),K=void 0,F1(Q,(q)=>$0(()=>{G=!1,Z=_.currentTimeMillisUnsafe()+Y,K=q,$.openUnsafe()}))}),$0(()=>{Z=0,$.closeUnsafe(),K=void 0})]})),kJ=B(2,(Q,X)=>L0(vJ(Q,X),(Y)=>Y[0])),F_=(Q)=>kJ(Q,i8),L_=c((Q)=>M0(I5(Q.id))),w6=(Q)=>c((X)=>{if(!X.interruptible)return Q;return X.interruptible=!1,X._stack.push(T7),Q}),P_=u1({op:"SetInterruptible",[M4](Q){if(Q.interruptible=this[e],Q._interruptedCause&&Q.interruptible)return()=>M0(Q._interruptedCause)}}),T7=P_(!0),R_=P_(!1),yJ=(Q)=>c((X)=>{if(X.interruptible)return Q;if(X.interruptible=!0,X._stack.push(R_),X._interruptedCause)return M0(X._interruptedCause);return Q}),JQ=(Q)=>c((X)=>{if(!X.interruptible)return Q(g);return X.interruptible=!1,X._stack.push(T7),Q(yJ)}),N_=(Q)=>c((X)=>{if(X.interruptible)return Q(g);return X.interruptible=!0,X._stack.push(R_),Q(w6)}),M_=L0(C7($0(()=>new AbortController),(Q)=>$0(()=>Q.abort())),(Q)=>Q.signal),I7=(Q,X)=>{if(d8(Q))return X?.mode==="result"?n1(Q,v4,X):n1(Q,g,X);else if(X?.discard)return X.mode==="result"?n1(Object.values(Q),v4,X):n1(Object.values(Q),g,X);return a(()=>{let Y={};return k1(n1(Object.entries(Q),([J,$])=>L0(X?.mode==="result"?v4($):$,(Z)=>{Y[J]=Z}),{discard:!0,concurrency:X?.concurrency}),Y)})},bJ=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>L0(n1(Q,(J,$)=>v4(X(J,$)),Y),(J)=>I3(J,g))),A_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>C(bJ(Q,X,{concurrency:Y?.concurrency}),([J,$])=>{if(K8(J))return F0(J);return Y?.discard?Y0:A($)})),w_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X)=>a(()=>{let Y=Q[Symbol.iterator](),J=Y.next();if(!J.done)return C_(Y,0,X,J.value);return A(b())})),C_=(Q,X,Y,J)=>C(Y(J,X),($)=>{if($)return A(F(J));let Z=Q.next();if(!Z.done)return C_(Q,X+1,Y,Z.value);return A(b())}),T_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X)=>a(()=>{let Y=Q[Symbol.iterator](),J=Y.next();if(!J.done)return I_(Y,0,X,J.value);return A(b())})),I_=(Q,X,Y,J)=>C(Y(J,X),($)=>{if(C1($))return A(F($.success));let Z=Q.next();if(!Z.done)return I_(Q,X+1,Y,Z.value);return A(b())}),b4=u1({op:"While",[A1](Q,X){if(this[e].step(Q),this[e].while())return X._stack.push(this),this[e].body();return i1},[x0](Q){if(this[e].while())return Q._stack.push(this),this[e].body();return i1}}),n1=B((Q)=>typeof Q[1]==="function",(Q,X,Y)=>c((J)=>{let $=Y?.concurrency==="inherit"?J.getRef(J7):Y?.concurrency??1,Z=$==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,$);if(Z===1)return yC(Q,X,Y);let G=W1(Q),K=G.length;if(K===0)return Y?.discard?Y0:A([]);let W=Y?.discard?void 0:Array(K),H=bC({f:X,out:W},G,{concurrency:Z});return H?k1(H,W):A(W)})),yC=(Q,X,Y)=>a(()=>{let J=Y?.discard?void 0:[],$=Q[Symbol.iterator](),Z=$.next(),G=0;return k1(b4({while:()=>!Z.done,body:()=>X(Z.value,G++),step:(K)=>{if(J)J.push(K);Z=$.next()}}),J)}),j_=(Q)=>{let{onItem:X,step:Y}=Q;return(J,$,Z)=>{let G=Z?.start??0,K=Z?.end??$.length,W=Z?.concurrency??1,H=!1,_,V,q,D=!1,U,P,L=()=>{let M=!1;for(;!U&&G<K;G++){let w=$[G],R=P??X(J,w,G);if(V1(R)){if(U=Y(J,w,R,G),U)break}else if(W===1)return C(e9(R),(i)=>{return U=Y(J,w,i,G),G++,U??L()??Y0});else if(!_)return T1((i)=>{_=D7(),P=R,q=i;let $1=L();if($1)return i($1);return a(()=>{return U=i1,D=!0,V?w5(V):Y0})});else{P=void 0;let i=C6(_,R,!0,!0,"inherit");if(i._exit){if(U=Y(J,w,i._exit,G),U)break;continue}if(V)V.add(i);else V=new Set([i]);let $1=G;if(i.addObserver(($5)=>{if(V.delete(i),U){if(!D&&$5._tag==="Failure")for(let D1 of $5.cause.reasons)if(D1._tag==="Interrupt")continue;else if(U._tag==="Failure")U.cause.reasons.push(D1);else U=w1(u8([D1]))}else{let D1=Y(J,w,$5,$1);if(D1)U=D1._tag==="Failure"?w1(u8(D1.cause.reasons.slice())):D1,L()}if(M){let D1=L();if(D1)q(D1)}else if(H&&V.size===0)q(U??Y0)}),V.size<W)continue;M=!0,G++;return}}if(H=!0,U){if(V&&V.size>0){let w=B7(_);V.forEach((R)=>R.interruptUnsafe(_.id,w));return}if(q||U._tag==="Failure")return U}else if(q){if(!V)return i1;else if(V.size===0)q(Y0)}};return L()}},$Q=()=>j_,bC=j_({onItem(Q,X,Y){return Q.f(X,Y)},step(Q,X,Y,J){if(Y._tag==="Failure")return Y;else if(Q.out)Q.out[J]=Y.value}}),gJ=B(3,(Q,X,Y)=>C(Q,(J)=>X(J)?A(J):Y(J))),hJ=B(3,(Q,X,Y)=>C(Q,(J)=>{let $=X(J);return u($)?Y($.failure):A($.success)})),E_=B((Q)=>d(Q[0]),(Q,X,Y)=>hJ(Q,X,Y?(J)=>F0(Y(J)):()=>F0(new C8))),S_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>a(()=>{let J=[];return k1(n1(Q,($,Z)=>{let G=X($,Z);if(typeof G==="boolean"){if(G)J.push($);return Y0}return L0(G,(K)=>{if(K)J.push($)})},{discard:!0,concurrency:Y?.concurrency}),J)})),x_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X)=>a(()=>{let Y=[];for(let J of Q){let $=X(J);if(C1($))Y.push($.success)}return A(Y)})),v_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>a(()=>{let J=[];return k1(n1(Q,($)=>L0(X($),(Z)=>{if(C1(Z))J.push(Z.success)}),{discard:!0,concurrency:Y?.concurrency}),J)})),k_=A({}),y_=hW(L0),b_=mW(L0,C),g_=gW(L0);var h_=B((Q)=>d(Q[0]),(Q,X)=>c((Y)=>{return XT(),A(C6(Y,Q,X?.startImmediately,!1,X?.uninterruptible??!1))})),C6=(Q,X,Y=!1,J=!1,$=!1)=>{let Z=$==="inherit"?Q.interruptible:!$,G=new a3(Q.context,Z);if(Y)G.evaluate(X);else Q.currentDispatcher.scheduleTask(()=>G.evaluate(X),0);if(!J&&!G._exit)Q.children().add(G),G.addObserver(()=>Q._children.delete(G));return G},m_=B((Q)=>d(Q[0]),(Q,X)=>c((Y)=>A(C6(Y,Q,X?.startImmediately,!0,X?.uninterruptible)))),d_=(Q)=>c((X)=>{let Y=X._children&&W1(X._children);return F1(Q,(J)=>{let $=X._children;if($===void 0||$.size===0)return Y0;else if(Y)$=VH($,(Z)=>!Y.includes(Z));return n9(s3($))})}),mJ=B((Q)=>d(Q[0]),(Q,X,Y)=>c((J)=>{let $=C6(J,Q,Y?.startImmediately,!0,Y?.uninterruptible);if(!$._exit)if(X.state._tag!=="Closed"){let Z={};K7(X,Z,()=>WV((K)=>K===$.id?Y0:MC($))),$.addObserver(()=>q_(X,Z))}else $.interruptUnsafe(J.id,B7(J));return A($)})),p_=B((Q)=>d(Q[0]),(Q,X)=>C(YQ,(Y)=>mJ(Q,Y,X))),X4=(Q)=>(X,Y)=>{let J=new a3(Y?.scheduler?Z8(Q,y9,Y.scheduler):Q,Y?.uninterruptible!==!0);if(J.evaluate(X),J._exit)return J;if(Y?.signal)if(Y.signal.aborted)J.interruptUnsafe();else{let $=()=>J.interruptUnsafe();Y.signal.addEventListener("abort",$,{once:!0}),J.addObserver(()=>Y.signal.removeEventListener("abort",$))}if(Y?.onFiberStart)Y.onFiberStart(J);return J};var c_=X4($8()),dJ=(Q)=>{let X=X4(Q);return(Y,J)=>{let $=X(Y,J);if(J?.onExit)$.addObserver(J.onExit);return(Z)=>{return $.interruptUnsafe(Z)}}},f_=dJ($8()),j7=(Q)=>{let X=X4(Q);return(Y,J)=>{let $=X(Y,J);return new Promise((Z)=>{$.addObserver((G)=>Z(G))})}},u_=j7($8()),pJ=(Q)=>{let X=j7(Q);return(Y,J)=>X(Y,J).then(($)=>{if($._tag==="Failure")throw _7($.cause);return $.value})},l_=pJ($8()),E7=(Q)=>{let X=X4(Q);return(Y)=>{if(V1(Y))return Y;let J=new A5("sync"),$=X(Y,{scheduler:J});return $.currentDispatcher?.flush(),$._exit??w8(new x7($))}},r_=E7($8()),cJ=(Q)=>{let X=E7(Q);return(Y)=>{let J=X(Y);if(J._tag==="Failure")throw _7(J.cause);return J.value}},o_=cJ($8()),cH=A(!0),fH=A(!1);class n_{waiters=[];scheduled=!1;isOpen;constructor(Q){this.isOpen=Q}scheduleUnsafe(Q){if(this.scheduled||this.waiters.length===0)return cH;return this.scheduled=!0,Q.currentDispatcher.scheduleTask(this.flushWaiters,0),cH}flushWaiters=()=>{this.scheduled=!1;let Q=this.waiters;this.waiters=[];for(let X=0;X<Q.length;X++)Q[X](i1)};open=c((Q)=>{if(this.isOpen)return fH;return this.isOpen=!0,this.scheduleUnsafe(Q)});release=c((Q)=>this.isOpen?fH:this.scheduleUnsafe(Q));openUnsafe(){if(this.isOpen)return!1;return this.isOpen=!0,this.flushWaiters(),!0}await=T1((Q)=>{if(this.isOpen)return Q(Y0);return this.waiters.push(Q),$0(()=>{let X=this.waiters.indexOf(Q);if(X!==-1)this.waiters.splice(X,1)})});closeUnsafe(){if(!this.isOpen)return!1;return this.isOpen=!1,!0}close=$0(()=>this.closeUnsafe());whenOpen=(Q)=>C(this.await,()=>Q)}var gC=(Q)=>new n_(Q??!1);var i_=c((Q)=>A(Q.getRef(Y7))),a_=B(2,(Q,X)=>z1(Q,Y7,X)),s_=z1($7),t_=z1(g9),f3=BigInt(0),hC={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:f3,endTime:f3,exit:i1},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},mC=(Q)=>Object.assign(Object.create(hC),Q),e_=(Q)=>{if(!Q)return b();return x1(Q.annotations,X7)?Q._tag==="Span"?e_(U6(Q.parent)):b():F(Q)},fJ=(Q,X,Y)=>{let J=!Q.getRef($7)||Y?.annotations&&x1(Y.annotations,X7),$=Y?.parent!==void 0?F(Y.parent):Y?.root?b():e_(Q.currentSpan),Z;if(J)Z=mC({name:X,parent:$,annotations:Z8(Y?.annotations??$8(),X7,!0)});else{let G=Q.getRef(Y7),K=Q.getRef(j8),W=Q.getRef(g9),H=Q.getRef(h9),_=Q.getRef(m9),V=Y?.level??Q.getRef(xH),q=Y?.links!==void 0?[..._,...Y.links]:_.slice();Z=G.span({name:X,parent:$,annotations:Y?.annotations??$8(),links:q,startTime:W?K.currentTimeNanosUnsafe():BigInt(0),kind:Y?.kind??"internal",root:Y?.root??I0($),sampled:Y?.sampled??(O1($)&&$.value.sampled===!1?!1:!zq(Q.getRef(vH),V))});for(let[D,U]of Object.entries(H))Z.attribute(D,U);if(Y?.attributes!==void 0)for(let[D,U]of Object.entries(Y.attributes))Z.attribute(D,U)}return Z},Qq=(Q,X)=>c((Y)=>A(fJ(Y,Q,X))),d9=(Q,X)=>w6(c((Y)=>{let J=z6(Y.context,QQ),$=fJ(Y,Q,X??{}),Z=Y.getRef(j8),G=Y.getRef(g9);return k1(y4(J,(K)=>pC($,K,Z,G)),$)})),Xq=function(){let Q=typeof arguments[0]!=="string",X=Q?arguments[1]:arguments[0],Y=G7(Q?arguments[2]:arguments[1]);if(Q){let J=arguments[0];return C(d9(X,Y),($)=>T5(J,$,Y))}return(J)=>C(d9(X,Y),($)=>T5(J,$,Y))},dC=(Q,X)=>{return X=typeof X==="function"?X:N8,e8(b9,(Y)=>({name:Q,stack:X,parent:Y}))},Yq=h9,Jq=m9,$q=B((Q)=>d(Q[0]),(Q,X,Y={})=>{let $=(Array.isArray(X)?X:[X]).map((Z)=>({span:Z,attributes:Y}));return e8(Q,m9,(Z)=>[...Z,...$])}),pC=(Q,X,Y,J)=>$0(()=>{if(Q.status._tag==="Ended")return;Q.end(J?Y.currentTimeNanosUnsafe():f3,X)}),p9=(Q,...X)=>{let Y=X.length===1?void 0:X[0],J=X[X.length-1];return c(($)=>{let Z=fJ($,Q,Y),G=$.getRef(j8);return F1(J0(()=>J(Z)),(K)=>$0(()=>{if(Z.status._tag==="Ended")return;Z.end(G.currentTimeNanosUnsafe(),K)}))})},u3=z1(Q7),T5=function(){let Q=d(arguments[0]),X=Q?arguments[1]:arguments[0],Y=Q?arguments[2]:arguments[1],J=g;if(X._tag==="Span")Y=G7(Y),J=dC(X.name,Y?.captureStackTrace);if(Q)return u3(J(arguments[0]),X);return($)=>u3(J($),X)},Zq=function(){let Q=typeof arguments[0]!=="string",X=Q?arguments[1]:arguments[0],Y=G7(arguments[2]);if(Q){let Z=arguments[0];return p9(X,arguments[2],(G)=>T5(Z,G,Y))}let J=typeof arguments[1]==="function"?arguments[1]:void 0,$=J?void 0:arguments[1];return(Z,...G)=>p9(X,J?J(...G):$,(K)=>T5(Z,K,Y))},Gq=B((Q)=>d(Q[0]),(Q,...X)=>e8(Q,h9,(Y)=>{let J={...Y};if(X.length===1)Object.assign(J,X[0]);else J[X[0]]=X[1];return J})),Kq=(...Q)=>c((X)=>{let Y=X.currentSpanLocal;if(Y)if(Q.length===1)for(let[J,$]of Object.entries(Q[0]))Y.attribute(J,$);else Y.attribute(Q[0],Q[1]);return Y0}),Wq=c((Q)=>{let X=Q.currentSpanLocal;return X?A(X):F0(new C8)}),Hq=IC(Q7),j8=_0("effect/Clock",{defaultValue:()=>new Vq}),cC=2147483647;class Vq{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=$0(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return fC()}currentTimeNanos=$0(()=>this.currentTimeNanosUnsafe());sleep(Q){let X=x4(Q);if(X<=0)return E5;return T1((Y)=>{if(X>cC)return;let J=setTimeout(()=>Y(Y0),X);return $0(()=>clearTimeout(J))})}}var uH=function(){let Q=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*Q;else if(typeof performance.timeOrigin==="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));let X=BigInt(Date.now())*Q-BigInt(Math.round(performance.now()*1e6));return()=>X+BigInt(Math.round(performance.now()*1e6))}(),fC=function(){let Q=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!Q)return uH;let X=uH()-Q.bigint();return()=>X+Q.bigint()}(),T6=(Q)=>c((X)=>Q(X.getRef(j8))),I6=(Q)=>T6((X)=>X.sleep(v1(Q))),_q=T6((Q)=>Q.currentTimeMillis);var c9="~effect/Cause/TimeoutError",qq=(Q)=>N(Q,c9);class S7 extends r8("TimeoutError"){[c9]=c9;constructor(Q){super({message:Q})}}var f9="~effect/Cause/IllegalArgumentError",Dq=(Q)=>N(Q,f9);class uJ extends r8("IllegalArgumentError"){[f9]=f9;constructor(Q){super({message:Q})}}var u9="~effect/Cause/ExceededCapacityError",Bq=(Q)=>N(Q,u9);class lJ extends r8("ExceededCapacityError"){[u9]=u9;constructor(Q){super({message:Q})}}var l9="~effect/Cause/AsyncFiberError",Uq=(Q)=>N(Q,l9);class x7 extends r8("AsyncFiberError"){[l9]=l9;constructor(Q){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:Q})}}var r9="~effect/Cause/UnknownError",Oq=(Q)=>N(Q,r9);class v7 extends r8("UnknownError"){[r9]=r9;constructor(Q,X){super({message:X,cause:Q})}}var uC=_0("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),lC=(Q)=>{switch(Q){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},rC=F3(U1,lC),zq=U5(rC),rJ=_0("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([eC,QT])}),oC=_0("effect/Logger/LogToStderr",{defaultValue:AX}),Fq=function(){let Q=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return w6(c((X)=>{let Y=X.getRef(s8),J={...Y};for(let $=0;$<Q.length;$++){let[Z,G]=Q[$];J[Z]=G}return X.setContext(Z8(X.context,s8,J)),y4(z6(X.context,QQ),($)=>{let Z=X.getRef(s8),G={...Z};for(let K=0;K<Q.length;K++){let[W,H]=Q[K];if(Z[W]!==H)continue;if(W in Y)G[W]=Y[W];else delete G[W]}return X.setContext(Z8(X.context,s8,G)),Y0})}))},nC="~effect/Logger",iC={[nC]:{_Message:g,_Output:g},pipe(){return X0(this,arguments)}},Lq=(Q)=>{let X=Object.create(iC);return X.log=Q,X},aC=(Q)=>Q.replace(/[\s="]/g,"_"),sC=(Q,X)=>{return`${aC(Q[0])}=${X-Q[1]}ms`};var W8=(Q)=>(...X)=>{let Y=void 0;for(let J=0,$=X.length;J<$;J++){let Z=X[J];if(_5(Z)){if(Y)X.splice(J,1);else X=X.slice(0,J).concat(X.slice(J+1));Y=Y?u8(Y.reasons.concat(Z.reasons)):Z,J--}}if(Y===void 0)Y=yX;return c((J)=>{let $=Q??J.currentLogLevel;if(zq(J.minimumLogLevel,$))return Y0;let Z=J.getRef(j8),G=J.getRef(rJ);if(G.size>0){let K=new Date(Z.currentTimeMillisUnsafe());for(let W of G)W.log({cause:Y,fiber:J,date:K,logLevel:$,message:X})}return Y0})};var R6={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},Ea={None:[],All:[],Trace:[R6.gray],Debug:[R6.blue],Info:[R6.green],Warn:[R6.yellow],Error:[R6.red],Fatal:[R6.bgBrightRed,R6.black]};var tC=(Q)=>`${Q.getHours().toString().padStart(2,"0")}:${Q.getMinutes().toString().padStart(2,"0")}:${Q.getSeconds().toString().padStart(2,"0")}.${Q.getMilliseconds().toString().padStart(3,"0")}`,Pq=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,Sa=Pq&&process.stdout.isTTY===!0,xa=Pq||"Deno"in globalThis;var eC=Lq(({cause:Q,date:X,fiber:Y,logLevel:J,message:$})=>{let Z=Array.isArray($)?$.slice():[$];if(Q.reasons.length>0)Z.push(q7(Q));let G=X.getTime(),K=Y.getRef(Z7),W="";for(let q of K)W+=` ${sC(q,G)}`;let H=Y.getRef(s8);if(Object.keys(H).length>0)Z.push(H);let _=Y.getRef(uC);(Y.getRef(oC)?_.error:_.log)(`[${tC(X)}] ${J.toUpperCase()} (#${Y.id})${W}:`,...Z)}),QT=Lq(({cause:Q,fiber:X,logLevel:Y,message:J})=>{let $=X.getRef(j8),Z=X.getRef(s8),G=X.currentSpan;if(G===void 0||G._tag==="ExternalSpan")return;let K={};for(let[W,H]of Object.entries(Z))K[W]=H;if(K["effect.fiberId"]=X.id,K["effect.logLevel"]=Y.toUpperCase(),Q.reasons.length>0)K["effect.cause"]=q7(Q);G.event(AW(Array.isArray(J)&&J.length===1?J[0]:J),$.currentTimeNanosUnsafe(),K)});function XT(){d3.interruptChildren??=RC}var Rq=A(void 0);var Nq=B((Q)=>d(Q[0]),(Q,X)=>SJ(Q,(Y)=>c((J)=>{return YT(J,Y,X?.defectsOnly),Y0}))),YT=(Q,X,Y)=>{let J=Q.getRef(bH);if(J.size===0)return;if(Y&&!W7(X))return;let $={cause:X,fiber:Q,timestamp:Q.getRef(j8).currentTimeNanosUnsafe()};J.forEach((Z)=>Z.report($))};var JT=H5,$T=V5,oJ=_5,nJ=jW,ZT=w4,GT=D6,KT=B6,ZQ=u8,WT=yX,HT=_3,VT=q3,_T=I5,GQ=(Q)=>new q5(Q),KQ=(Q)=>new bX(Q),WQ=lH,k7=aH,qT=eH,DT=n3,j6=_7,BT=r3,UT=o3,E8=a1,OT=rH,zT=W7,FT=oH,LT=o9,PT=H7,RT=nH,NT=iH,MT=V7,AT=i3,iJ=q7,wT=hX,CT=T9,TT=C8,y7=S9,IT=q6,jT=D3,b7=vW,ET=c9,ST=qq,xT=S7,vT=f9,kT=Dq,HQ=uJ,yT=Bq,bT=u9,gT=lJ,hT=l9,mT=Uq,dT=x7,pT=r9,cT=Oq,fT=v7,uT=D5,lT=sH,rT=tH;class Mq extends l1()("effect/Cause/StackTrace"){}class Aq extends l1()("effect/Cause/InterruptorStackTrace"){}var U0={};G6(U0,{zipWith:()=>oj,zip:()=>rj,yieldNowWith:()=>yj,yieldNow:()=>kj,withTracerTiming:()=>yS,withTracerEnabled:()=>kS,withTracer:()=>vS,withSpanScoped:()=>oS,withSpan:()=>rS,withParentSpan:()=>nS,withLogger:()=>Rx,withLogSpan:()=>Ax,withFiber:()=>bD,withExecutionPlan:()=>LE,withErrorReporting:()=>PE,withConcurrency:()=>JS,whileLoop:()=>xD,when:()=>dE,void:()=>h4,validate:()=>Lj,useSpan:()=>lS,updateService:()=>XS,updateContext:()=>QS,unwrapReason:()=>ej,uninterruptibleMask:()=>cD,uninterruptible:()=>MS,undefined:()=>Aj,txRetry:()=>kx,tx:()=>Ex,tryPromise:()=>C$,try:()=>m4,trackSuccesses:()=>Cx,trackErrors:()=>Tx,trackDuration:()=>jx,trackDefects:()=>Ix,track:()=>wx,tracer:()=>xS,timeoutOrElse:()=>wE,timeoutOption:()=>AE,timeout:()=>ME,timed:()=>IE,tapErrorTag:()=>VE,tapError:()=>hD,tapDefect:()=>mD,tapCauseIf:()=>_E,tapCauseFilter:()=>qE,tapCause:()=>n7,tap:()=>gD,sync:()=>kD,suspend:()=>vD,succeedSome:()=>o7,succeedNone:()=>x8,succeed:()=>h,spanLinks:()=>pS,spanAnnotations:()=>dS,sleep:()=>TE,serviceOption:()=>eE,service:()=>tE,scopedWith:()=>GS,scoped:()=>ZS,scope:()=>$S,scheduleFrom:()=>fD,schedule:()=>SS,satisfiesSuccessType:()=>bx,satisfiesServicesType:()=>hx,satisfiesErrorType:()=>gx,sandbox:()=>OE,runSyncWith:()=>Vx,runSyncExitWith:()=>_x,runSyncExit:()=>i7,runSync:()=>d4,runPromiseWith:()=>Kx,runPromiseExitWith:()=>Hx,runPromiseExit:()=>Wx,runPromise:()=>MQ,runForkWith:()=>$x,runFork:()=>m5,runCallbackWith:()=>Zx,runCallback:()=>Gx,retryOrElse:()=>UE,retry:()=>BE,result:()=>dj,requestUnsafe:()=>aS,request:()=>iS,replicateEffect:()=>ES,replicate:()=>jS,repeatOrElse:()=>IS,repeat:()=>TS,raceFirst:()=>xE,raceAllFirst:()=>EE,raceAll:()=>jE,race:()=>SE,provideServiceEffect:()=>YS,provideService:()=>dD,provideContext:()=>sE,provide:()=>aE,promise:()=>Mj,partition:()=>Fj,orElseSucceed:()=>RE,orDie:()=>HE,option:()=>pj,onInterrupt:()=>NS,onExitPrimitive:()=>US,onExitIf:()=>OS,onExitFilter:()=>zS,onExit:()=>x$,onErrorIf:()=>DS,onErrorFilter:()=>BS,onError:()=>qS,never:()=>wj,matchEffect:()=>lE,matchEager:()=>S$,matchCauseEffectEager:()=>fE,matchCauseEffect:()=>uE,matchCauseEager:()=>cE,matchCause:()=>pE,match:()=>E$,mapErrorEager:()=>X1,mapError:()=>KE,mapEager:()=>x6,mapBothEager:()=>a0,mapBoth:()=>WE,map:()=>j$,makeSpanScoped:()=>uS,makeSpan:()=>fS,logWithLevel:()=>Bx,logWarning:()=>zx,logTrace:()=>Px,logInfo:()=>Fx,logFatal:()=>Ox,logError:()=>v$,logDebug:()=>Lx,log:()=>Ux,linkSpans:()=>cS,let:()=>Ij,isSuccess:()=>oE,isFailure:()=>rE,isEffect:()=>Y4,interruptibleMask:()=>AS,interruptible:()=>RS,interrupt:()=>pD,ignoreCause:()=>FE,ignore:()=>zE,gen:()=>Ej,fromResult:()=>I$,fromOption:()=>bj,fromNullishOr:()=>gj,forkScoped:()=>eS,forkIn:()=>tS,forkDetach:()=>Qx,forkChild:()=>sS,forever:()=>CS,forEach:()=>Nj,fnUntracedEager:()=>AQ,fnUntraced:()=>qx,fn:()=>Dx,flip:()=>lj,flatten:()=>hj,flatMapEager:()=>_8,flatMap:()=>RQ,firstSuccessOf:()=>NE,findFirstFilter:()=>Rj,findFirst:()=>Pj,filterOrFail:()=>hE,filterOrElse:()=>bE,filterMapOrFail:()=>mE,filterMapOrElse:()=>gE,filterMapEffect:()=>yE,filterMap:()=>kE,filter:()=>vE,fiberId:()=>Jx,fiber:()=>Yx,failSync:()=>Sj,failCauseSync:()=>vj,failCause:()=>xj,fail:()=>y,exit:()=>NQ,eventually:()=>DE,ensuring:()=>_S,effectify:()=>yx,die:()=>yD,delay:()=>CE,currentSpan:()=>hS,currentParentSpan:()=>mS,contextWith:()=>iE,context:()=>nE,clockWith:()=>uD,catchTags:()=>aj,catchTag:()=>ij,catchReasons:()=>tj,catchReason:()=>sj,catchNoSuchElement:()=>$E,catchIf:()=>YE,catchFilter:()=>JE,catchEager:()=>d5,catchDefect:()=>XE,catchCauseIf:()=>ZE,catchCauseFilter:()=>GE,catchCause:()=>QE,catch:()=>nj,callback:()=>T$,cachedWithTTL:()=>LS,cachedInvalidateWithTTL:()=>PS,cached:()=>FS,bindTo:()=>Tj,bind:()=>jj,awaitAllChildren:()=>Xx,asVoid:()=>uj,asSome:()=>fj,as:()=>cj,annotateSpans:()=>bS,annotateLogsScoped:()=>Mx,annotateLogs:()=>Nx,annotateCurrentSpan:()=>gS,andThen:()=>mj,all:()=>zj,addFinalizer:()=>VS,acquireUseRelease:()=>HS,acquireRelease:()=>KS,acquireDisposable:()=>WS,abortSignal:()=>wS,TypeId:()=>Oj,Transaction:()=>PQ,Do:()=>Cj});var V8={};G6(V8,{void:()=>sJ,succeed:()=>VQ,match:()=>$I,mapError:()=>g7,mapBoth:()=>GI,map:()=>ZI,isSuccess:()=>H8,isFailure:()=>tJ,isExit:()=>aJ,interrupt:()=>nT,hasInterrupts:()=>sT,hasFails:()=>iT,hasDies:()=>aT,getSuccess:()=>h7,getCause:()=>HI,findErrorOption:()=>VI,findError:()=>YI,findDefect:()=>JI,filterValue:()=>eT,filterSuccess:()=>tT,filterFailure:()=>QI,filterCause:()=>XI,failCause:()=>_Q,fail:()=>k5,die:()=>oT,asVoidAll:()=>WI,asVoid:()=>KI});var aJ=V3,VQ=c0,_Q=w1,k5=A8,oT=w8,nT=AV,sJ=i1;var H8=S5,tJ=KJ,iT=SV,aT=EV,sT=jV,tT=wV,eT=CV,QI=TV,XI=i9,YI=WJ,JI=IV,$I=xV,ZI=HJ,g7=VJ,GI=_J,KI=vV,WI=qJ,h7=kV,HI=yV,VI=bV;var _I="~effect/Deferred";var qI={[_I]:{_A:g,_E:g},pipe(){return X0(this,arguments)}},wq=()=>{let Q=Object.create(qI);return Q.resumes=void 0,Q.effect=void 0,Q};var Cq=(Q)=>T1((X)=>{if(Q.effect)return X(Q.effect);return Q.resumes??=[],Q.resumes.push(X),$0(()=>{let Y=Q.resumes.indexOf(X);Q.resumes.splice(Y,1)})});var DI=B(2,(Q,X)=>$0(()=>BI(Q,X))),Tq=DI;var BI=(Q,X)=>{if(Q.effect)return!1;if(Q.effect=X,Q.resumes){for(let Y=0;Y<Q.resumes.length;Y++)Q.resumes[Y](X);Q.resumes=void 0}return!0};var Iq=s8;var jq=Z7;var Eq=XQ;var m7=__,eJ=CJ;var xq="~effect/Layer",Sq="~effect/Layer/MemoMap",zI=(Q,X)=>{return Q.observers++,t8(y4(X,(Y)=>Q.finalizer(Y)),Q.effect)},vq=(Q)=>N(Q,xq),FI={[xq]:{_ROut:g,_E:g,_RIn:g},pipe(){return X0(this,arguments)}},kq=(Q)=>{let X=Object.create(FI);return X.build=Q,X},yq=(Q)=>kq((X,Y)=>{let J=m7(Y);return F1(Q(X,J),($)=>$._tag==="Failure"?eJ(J,$):Y0)});var LI=(Q,X,Y,J)=>{let $=Eq(),Z=wq(),G={observers:1,effect:Cq(Z),finalizer:(K)=>a(()=>{if(G.observers--,G.observers===0)return Q.map.delete(X),eJ($,K);return Y0})};return Q.map.set(X,G),y4(Y,G.finalizer).pipe(C(()=>J(Q,$)),F1((K)=>{return G.effect=K,Tq(Z,K)}))};class bq{get[Sq](){return Sq}parent;constructor(Q){this.parent=Q}map=new Map;get(Q,X){let Y=this.map.get(Q);if(Y)return zI(Y,X);return this.parent?.get(Q,X)}getOrElseMemoize(Q,X,Y){let J=this.get(Q,X);if(J)return J;return LI(this,Q,X,Y)}}var Q$=()=>new bq;class d7 extends l1()("effect/Layer/CurrentMemoMap"){static getOrCreate=JH(this,Q$)}var X$=B(3,(Q,X,Y)=>z1(L0(Q.build(X,Y),Z8(d7,X)),d7,X));var gq=B(2,(Q,X)=>c((Y)=>X$(Q,d7.getOrCreate(Y.context),X)));var hq=(Q)=>kq(Z1(A(Q)));var mq=(Q,X,Y)=>{let J=m7(Y,"parallel");return n1(Q,($)=>$.build(X,m7(J,"sequential")),{concurrency:Q.length}).pipe(L0(($)=>GH(...$)))},dq=(...Q)=>yq((X,Y)=>mq(Q,X,Y));var PI=(Q,X,Y)=>yq((J,$)=>C(Array.isArray(X)?mq(X,J,$):X.build(J,$),(Z)=>Q.build(J,$).pipe(Q4(Z),L0((G)=>Y(G,Z))))),pq=B(2,(Q,X)=>PI(Q,X,g));var fq="~effect/ExecutionPlan";var RI={[fq]:fq,get captureRequirements(){let Q=this;return k4((X)=>A(NI(Q.steps.map((Y)=>({...Y,provide:vq(Y.provide)?pq(Y.provide,hq(X)):Y.provide})))))},pipe(){return X0(this,arguments)}},NI=(Q)=>{let X=Object.create(RI);return X.steps=Q,X};var uq=_0("effect/ExecutionPlan/CurrentMetadata",{defaultValue:Z1({attempt:0,stepIndex:0})});var lq=class extends K6{constructor(Q){super();if(Q)Object.assign(this,Q)}};var rq=r8;var p7="~effect/time/DateTime",c7="~effect/time/DateTime/TimeZone",iq={[p7]:p7,pipe(){return X0(this,arguments)},[n0](){return this.toString()},toJSON(){return UQ(this).toJSON()}},AI={...iq,_tag:"Utc",[K0](){return p8(this.epochMilliseconds)},[W0](Q){return b5(Q)&&Q._tag==="Utc"&&this.epochMilliseconds===Q.epochMilliseconds},toString(){return`DateTime.Utc(${UQ(this).toJSON()})`}},wI={...iq,_tag:"Zoned",[K0](){return u0(p8(this.epochMilliseconds))(t(this.zone))},[W0](Q){return b5(Q)&&Q._tag==="Zoned"&&this.epochMilliseconds===Q.epochMilliseconds&&n(this.zone,Q.zone)},toString(){return`DateTime.Zoned(${U$(this)})`}},aq={[c7]:c7,[n0](){return this.toString()}},CI={...aq,_tag:"Named",[K0](){return T0(`Named:${this.id}`)},[W0](Q){return E6(Q)&&Q._tag==="Named"&&this.id===Q.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},TI={...aq,_tag:"Offset",[K0](){return T0(`Offset:${this.offset}`)},[W0](Q){return E6(Q)&&Q._tag==="Offset"&&this.offset===Q.offset},toString(){return`TimeZone.Offset(${q$(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},S8=(Q,X,Y)=>{let J=Object.create(wI);return J.epochMilliseconds=Q,J.zone=X,Object.defineProperty(J,"partsUtc",{value:Y,enumerable:!1,writable:!0}),Object.defineProperty(J,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(J,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),J},b5=(Q)=>N(Q,p7);var E6=(Q)=>N(Q,c7),sq=(Q)=>E6(Q)&&Q._tag==="Offset",tq=(Q)=>E6(Q)&&Q._tag==="Named",eq=(Q)=>Q._tag==="Utc",$$=(Q)=>Q._tag==="Zoned",QD=i0((Q,X)=>Q.epochMilliseconds===X.epochMilliseconds);var Z$=(Q)=>{let X=Object.create(AI);return X.epochMilliseconds=Q,Object.defineProperty(X,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),X},y5=(Q)=>{let X=Q.getTime();if(Number.isNaN(X))throw new HQ("Invalid date");return Z$(X)},G$=(Q)=>{if(b5(Q))return Q;else if(Q instanceof Date)return y5(Q);else if(typeof Q==="object"){if("epochMilliseconds"in Q)return Z$(Q.epochMilliseconds);let X=new Date(0);return yI(X,Q),y5(X)}else if(typeof Q==="string"&&!II(Q))return y5(new Date(Q+"Z"));return y5(new Date(Q))},II=(Q)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(Q),jI=-8639999956800000,EI=8639999949600000,K$=(Q,X)=>{let Y=X?.timeZone;if(Y===void 0&&b5(Q)&&$$(Q))return Q;let J=G$(Q);if(J.epochMilliseconds<jI||J.epochMilliseconds>EI)throw RangeError(`Epoch millis out of range: ${J.epochMilliseconds}`);if(Y===void 0&&typeof Q==="object"&&"timeZoneId"in Q)Y=Q.timeZoneId;let $;if(Y===void 0){let Z=new Date(J.epochMilliseconds).getTimezoneOffset()*-60*1000;$=BQ(Z)}else if(E6(Y))$=Y;else if(typeof Y==="number")$=BQ(Y);else{let Z=V$(Y);if(I0(Z))throw new HQ(`Invalid time zone: ${Y}`);$=Z.value}if(X?.adjustForTimeZone!==!0)return S8(J.epochMilliseconds,$,J.partsUtc);return bI(J.epochMilliseconds,$,X?.disambiguation??"compatible")},Y$=O6(K$),XD=O6(G$),SI=/^(.{17,35})\[(.+)\]$/,YD=(Q)=>{let X=SI.exec(Q);if(X===null){let $=B$(Q);return $!==null?Y$(Q,{timeZone:$}):b()}let[,Y,J]=X;return Y$(Y,{timeZone:J})};var JD=(Q)=>Z$(Q.epochMilliseconds);var DQ=new Map,xI={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},vI=(Q)=>{let X=Q.resolvedOptions().timeZone;if(DQ.has(X))return DQ.get(X);let Y=Object.create(CI);return Y.id=X,Y.format=Q,DQ.set(X,Y),Y},W$=(Q)=>{if(DQ.has(Q))return DQ.get(Q);try{return vI(new Intl.DateTimeFormat("en-US",{...xI,timeZone:Q}))}catch{throw new HQ(`Invalid time zone: ${Q}`)}},BQ=(Q)=>{let X=Object.create(TI);return X.offset=Q,X},H$=O6(W$);var kI=/^(?:GMT|[+-])/,V$=(Q)=>{if(kI.test(Q)){let X=B$(Q);return X===null?b():F(BQ(X))}return H$(Q)},$D=(Q)=>{if(Q._tag==="Offset")return q$(Q.offset);return Q.id};var UQ=(Q)=>new Date(Q.epochMilliseconds),f7=(Q)=>{if(Q._tag==="Utc")return new Date(Q.epochMilliseconds);else if(Q.zone._tag==="Offset")return new Date(Q.epochMilliseconds+Q.zone.offset);else if(Q.adjustedEpochMilliseconds!==void 0)return new Date(Q.adjustedEpochMilliseconds);let X=Q.zone.format.formatToParts(Q.epochMilliseconds).filter((J)=>J.type!=="literal"),Y=new Date(0);return Y.setUTCFullYear(Number(X[2].value),Number(X[0].value)-1,Number(X[1].value)),Y.setUTCHours(Number(X[3].value),Number(X[4].value),Number(X[5].value),Number(X[6].value)),Q.adjustedEpochMilliseconds=Y.getTime(),Y},_$=(Q)=>{return f7(Q).getTime()-D$(Q)},q$=(Q)=>{let X=Math.abs(Q),Y=Math.floor(X/3600000),J=Math.round(X%3600000/60000);if(J===60)Y+=1,J=0;return`${Q<0?"-":"+"}${String(Y).padStart(2,"0")}:${String(J).padStart(2,"0")}`},ZD=(Q)=>q$(_$(Q)),D$=(Q)=>Q.epochMilliseconds;var yI=(Q,X)=>{if(X.year!==void 0)Q.setUTCFullYear(X.year);if(X.month!==void 0)Q.setUTCMonth(X.month-1);if(X.day!==void 0)Q.setUTCDate(X.day);if(X.weekDay!==void 0){let Y=X.weekDay-Q.getUTCDay();Q.setUTCDate(Q.getUTCDate()+Y)}if(X.hour!==void 0)Q.setUTCHours(X.hour);if(X.minute!==void 0)Q.setUTCMinutes(X.minute);if(X.second!==void 0)Q.setUTCSeconds(X.second);if(X.millisecond!==void 0)Q.setUTCMilliseconds(X.millisecond)};var nq=86400000,bI=(Q,X,Y)=>{if(X._tag==="Offset")return S8(Q-X.offset,X);let J=qQ(Q-nq,Q,X),$=qQ(Q+nq,Q,X);if(J===$)return S8(Q-J,X);let Z=J<$,G=J-$;if(Z){if(qQ(Q-$,Q,X)===$)return S8(Q-$,X);let H=S8(Q-J,X),_=f7(H).getTime();if(Q!==_)switch(Y){case"reject":{let V=new Date(Q).toISOString();throw RangeError(`Gap time: ${V} does not exist in time zone ${X.id}`)}case"earlier":return S8(Q-$,X);case"compatible":case"later":return H}return H}if(qQ(Q-J,Q,X)===J){if(Y==="earlier"||Y==="compatible")return S8(Q-J,X);if(qQ(Q-J+G,Q+G,X)===J)return S8(Q-J,X);if(Y==="reject"){let H=new Date(Q).toISOString();throw RangeError(`Ambiguous time: ${H} occurs twice in time zone ${X.id}`)}}return S8(Q-$,X)},gI=/([+-])(\d{2}):(\d{2})$/,B$=(Q)=>{let X=gI.exec(Q);if(X===null)return null;let[,Y,J,$]=X;return(Y==="+"?1:-1)*(Number(J)*60+Number($))*60*1000},qQ=(Q,X,Y)=>{let J=Y.format.formatToParts(Q).find((Z)=>Z.type==="timeZoneName")?.value??"";if(J==="GMT")return 0;let $=B$(J);if($===null)return _$(S8(X,Y));return $};var GD=(Q)=>UQ(Q).toISOString();var J$=(Q)=>{let X=f7(Q);return Q._tag==="Utc"?X.toISOString():`${X.toISOString().slice(0,-1)}${ZD(Q)}`},U$=(Q)=>Q.zone._tag==="Offset"?J$(Q):`${J$(Q)}[${Q.zone.id}]`;var ea=globalThis.Number;var WD=B(2,(Q,X)=>{let Y=KD(Q),J=KD(X),$=Y>J?Y:J,Z=parseInt(Q.toFixed($).replace(".","")),G=parseInt(X.toFixed($).replace(".",""));return Z%G/Math.pow(10,$)});function KD(Q){let X=Q.toString(),Y=X.indexOf("e-");if(Y!==-1){let J=parseInt(X.slice(Y+2));return(X.slice(0,Y).split(".")[1]||"").length+J}return(X.split(".")[1]||"").length}var HD=o8((Q,X)=>Math.max(Q,X),-1/0),VD=o8((Q,X)=>Math.min(Q,X),1/0);var Qs=globalThis.String;var _D=(Q)=>Q.trim();var O$=B(2,(Q,X)=>x5(Q,cI,(Y)=>X(Y)));var pI=M5(E8,(Q)=>y7(Q)?l(Q):f(Q));var cI=M5(E8,(Q)=>y7(Q)?l(Q.value):f(Q));var qD=B(2,(Q,X)=>I8(Q,{onSuccess:X.onSuccess,onFailure:(Y)=>{let J=pI(Y);return!u(J)?X.onDone(J.success.value):X.onFailure(J.failure)}}));var BD="~effect/Schedule";var S6=_0("effect/Schedule/CurrentMetadata",{defaultValue:Z1({input:void 0,output:void 0,duration:R5,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),fI={[BD]:{_Out:g,_In:g,_Env:g},pipe(){return X0(this,arguments)}},z$=(Q)=>N(Q,BD),F$=(Q)=>{let X=Object.create(fI);return X.step=Q,X},L$=()=>{let Q=0,X,Y;return(J,$)=>{if(Y===void 0)Y=J;let Z=J-Y,G=X===void 0?0:J-X;return X=J,{input:$,attempt:++Q,start:Y,now:J,elapsed:Z,elapsedSincePrevious:G}}},uI=(Q)=>F$(L0(Q,(X)=>{let Y=L$();return(J,$)=>X(Y(J,$))})),P$=(Q)=>s1(Q.step,(X)=>A(()=>M0(X))),u7=(Q)=>T6((X)=>L0(P$(Q),(Y)=>{let J=L$();return($)=>a(()=>{let Z=X.currentTimeMillisUnsafe();return C(Y(Z,$),([G,K])=>{let W=J(Z,$);return W.output=G,W.duration=K,k1(I6(K),W)})})}));var R$=(Q)=>F$(L0(P$(Q),(X)=>(Y,J)=>qD(X(Y,J),{onSuccess:($)=>A([J,$[1]]),onFailure:M0,onDone:()=>b7(J)}))),UD=(Q)=>OQ(N$,({attempt:X})=>A(X<=Q));var lI=(Q)=>{let X=v1(Q);return uI(A((Y)=>A([Y.attempt-1,X])))};var OQ=B(2,(Q,X)=>F$(L0(P$(Q),(Y)=>{let J=L$();return($,Z)=>C(Y($,Z),(G)=>{let[K,W]=G,H=X({...J($,Z),output:K,duration:W});return C(d(H)?H:A(H),(_)=>_?A(G):b7(K))})})));var N$=lI(R5);var rI=(Q,X,Y)=>w7((J)=>C(Y?.local?X$(X,Q$(),J):gq(X,J),($)=>Q4(Q,$))),l7=B((Q)=>d(Q[0]),(Q,X,Y)=>R3(X)?Q4(Q,X):rI(Q,Array.isArray(X)?dq(...X):X,Y));var M$=B(3,(Q,X,Y)=>C(u7(X),(J)=>{let $=S6.defaultValue();return y1(P7(M6(C(a(()=>z1(Q,S6,$)),J),(Z)=>$0(()=>{$=Z})),{disableYield:!0}),(Z)=>S9(Z)?A(Z.value):Y(Z,$.attempt===0?b():F($)))})),A$=B(3,(Q,X,Y)=>C(u7(X),(J)=>{let $=S6.defaultValue(),Z,G=y1(a(()=>z1(Q,S6,$)),(K)=>{return Z=K,C(J(K),(W)=>{return $=W,G})});return O$(G,(K)=>J0(()=>Y(Z,K)))})),FD=B(2,(Q,X)=>{let Y=typeof X==="function"?X(g):z$(X)?X:FQ(X);return M$(Q,Y,F0)}),zQ=B(2,(Q,X)=>{let Y=typeof X==="function"?X(g):z$(X)?X:FQ(X);return A$(Q,Y,F0)}),LD=B(3,(Q,X,Y)=>C(u7(Y),(J)=>{let $=S6.defaultValue(),Z=a(()=>z1(Q,S6,$));return y1(C(J(X),(G)=>{$=G;let K=Z1(C(Z,J));return b4({while:P4,body:K,step(W){$=W}})}),(G)=>S9(G)?A(G.value):F0(G))})),oI=R$(N$),FQ=(Q)=>{let X=Q.schedule?R$(Q.schedule):oI;if(Q.while)X=OQ(X,({input:Y})=>{let J=Q.while(Y);return d(J)?J:A(J)});if(Q.until)X=OQ(X,({input:Y})=>{let J=Q.until(Y);return d(J)?L0(J,($)=>!$):A(!J)});if(Q.times!==void 0)X=OQ(X,({attempt:Y})=>A(Y<=Q.times));return X};var ND=B(2,(Q,X)=>a(()=>{let Y=0,J={attempt:0,stepIndex:0},$=L7(uq,$0(()=>{return J={attempt:J.attempt+1,stepIndex:Y},J})),Z;return C(b4({while:()=>Y<X.steps.length&&(Z===void 0||u(Z)),body(){let G=X.steps[Y],K=$(l7(Q,G.provide));if(Z){let W=!1,H=K;K=a(()=>{if(W)return H;return W=!0,j5(Z)}),K=zQ(K,RD(G,!1))}else{let W=RD(G,!0);K=W?zQ(K,W):K}return v4(K)},step(G){Z=G,Y++}}),()=>j5(Z))})),RD=(Q,X)=>{if(!X)return FQ({schedule:Q.schedule?Q.schedule:Q.attempts?void 0:nI,times:Q.attempts,while:Q.while});else if(Q.attempts===1||!(Q.schedule||Q.attempts))return;return FQ({schedule:Q.schedule,while:Q.while,times:Q.attempts?Q.attempts-1:void 0})},nI=UD(1);var aI="~effect/Request",sI=NW({_E:(Q)=>Q,_A:(Q)=>Q,_R:(Q)=>Q}),Os={...IW,[aI]:sI};var MD=(Q)=>Q;var wD=B(2,(Q,X)=>{let Y=(J)=>T1(($)=>{let Z=TD(J,Q,$,D7());return tI(J,Z)});return d(X)?C(X,Y):Y(X)}),CD=(Q,X)=>{let Y=TD(X.resolver,Q,X.onExit,{context:X.context,currentScheduler:x1(X.context,y9)});return()=>ID(X.resolver,Y)},r7=[],w$=new WeakMap,TD=(Q,X,Y,J)=>{let $=w$.get(Q);if(!$)$=new Map,w$.set(Q,$);let Z,G=!1,K=MD({request:X,context:J.context,uninterruptible:!1,completeUnsafe(H){if(G)return;G=!0,Y(H),Z?.entrySet.delete(K)}});if(Q.preCheck!==void 0&&!Q.preCheck(K))return K;let W=Q.batchKey(K);if(Z=$.get(W),!Z){if(r7.length>0)Z=r7.pop(),Z.key=W,Z.resolver=Q,Z.map=$;else{let H={key:W,resolver:Q,map:$,entrySet:new Set,entries:new Set,delayEffect:C(a(()=>H.resolver.delay),(_)=>AD(H)),run:F1(a(()=>H.resolver.runAll(Array.from(H.entries),H.key)),(_)=>{for(let V of H.entrySet)V.completeUnsafe(_._tag==="Success"?w8(Error("Effect.request: RequestResolver did not complete request",{cause:V.request})):_);if(H.entries.clear(),r7.length<128)H.entrySet.clear(),H.key=void 0,H.fiber=void 0,H.resolver=void 0,H.map=void 0,r7.push(H);return Y0})};Z=H}$.set(W,Z),Z.fiber=X4(J.context)(Z.delayEffect,{scheduler:J.currentScheduler})}if(Z.entrySet.add(K),Z.entries.add(K),Z.resolver.collectWhile(Z.entries))return K;return Z.fiber.interruptUnsafe(J.id),Z.fiber=X4(J.context)(AD(Z),{scheduler:J.currentScheduler}),K},ID=(Q,X)=>{if(X.uninterruptible)return;let Y=w$.get(Q);if(!Y)return;let J=Q.batchKey(X.request),$=Y.get(J);if(!$)return;if($.entries.delete(X),$.entrySet.delete(X),$.entries.size===0)Y.delete(J),$.fiber?.interruptUnsafe()},tI=(Q,X)=>$0(()=>ID(Q,X));function AD(Q){if(!Q.map.has(Q.key))return Y0;return Q.map.delete(Q.key),Q.run}var Yj="effect/Metric/CurrentMetricAttributes",Jj=_0(Yj,{defaultValue:()=>({})}),$j="~effect/observability/Metric/MetricRegistryKey",Zj=_0($j,{defaultValue:()=>new Map}),jD="~effect/observability/Metric";class g5{[jD]=jD;#Q=new WeakMap;#X;id;description;attributes;constructor(Q,X,Y){this.id=Q,this.description=X,this.attributes=Y}valueUnsafe(Q){return this.hook(Q).get(Q)}modifyUnsafe(Q,X){return this.hook(X).modify(Q,X)}updateUnsafe(Q,X){return this.hook(X).update(Q,X)}hook(Q){let X=x1(Q,Jj);if(Object.keys(X).length===0){if(G1(this.#X))return this.#X.hooks;return this.#X=this.getOrCreate(Q,this.attributes),this.#X.hooks}let Y=Bj(this.attributes,X),J=this.#Q.get(Y);if(G1(J))return J.hooks;return J=this.getOrCreate(Q,Y),this.#Q.set(Y,J),J.hooks}getOrCreate(Q,X){let Y=_j(this,X),J=x1(Q,Zj);if(J.has(Y))return J.get(Y);let $=this.createHooks(),Z={id:this.id,type:this.type,description:this.description,attributes:g4(X),hooks:$};return J.set(Y,Z),Z}pipe(){return X0(this,arguments)}}var ED=BigInt(0);class Gj extends g5{type="Counter";#Q;#X;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X?.bigint??!1,this.#X=X?.incremental??!1}createHooks(){let Q=this.#Q?ED:0,X=this.#X?this.#Q?(J)=>J>=ED:(J)=>J>=0:(J)=>!0;return LQ(()=>({count:Q,incremental:this.#X}),(J)=>{if(X(J))Q=Q+J})}}class Kj extends g5{type="Gauge";#Q;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X?.bigint??!1}createHooks(){let Q=this.#Q?BigInt(0):0;return LQ(()=>({value:Q}),(J)=>{Q=J},(J)=>{Q=Q+J})}}class Wj extends g5{type="Frequency";#Q;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X?.preregisteredWords}createHooks(){let Q=new Map;if(G1(this.#Q))for(let Y of this.#Q)Q.set(Y,0);return LQ(()=>({occurrences:Q}),(Y)=>{let J=Q.get(Y)??0;Q.set(Y,J+1)})}}class Hj extends g5{type="Histogram";#Q;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X.boundaries}createHooks(){let Q=this.#Q,X=Q.length,Y=new Uint32Array(X+1),J=new Float64Array(X),$=0,Z=0,G=Number.MAX_VALUE,K=Number.MIN_VALUE;E4(k9(Q,U1),(_,V)=>{J[V]=_});let W=(_)=>{let V=0,q=X;while(V!==q){let D=Math.floor(V+(q-V)/2),U=J[D];if(_<=U)q=D;else V=D;if(q===V+1)if(_<=J[V])q=V;else V=q}if(Y[V]=Y[V]+1,$=$+1,Z=Z+_,_<G)G=_;if(_>K)K=_},H=()=>{let _=w3(X),V=0;for(let q=0;q<X;q++){let D=J[q],U=Y[q];V=V+U,_[q]=[D,V]}return _};return LQ(()=>({buckets:H(),count:$,min:G,max:K,sum:Z}),W)}}class Vj extends g5{type="Summary";#Q;#X;#Y;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=Math.max(x4(v1(X.maxAge)),0),this.#X=X.maxSize,this.#Y=X.quantiles}createHooks(){let Q=k9(this.#Y,U1),X=w3(this.#X);for(let V of this.#Y)if(V<0||V>1)throw Error(`Quantile must be between 0 and 1, found: ${V}`);let Y=0,J=0,$=0,Z=Number.MAX_VALUE,G=Number.MIN_VALUE,K=(V)=>{let q=[],D=0;while(D<this.#X){let L=X[D];if(G1(L)){let[M,w]=L,R=V-M;if(R>=0&&R<=this.#Q)q.push(w)}D=D+1}let U=k9(q,U1),P=U.length;if(P===0)return Q.map((L)=>[L,void 0]);return Q.map((L)=>{if(L<=0)return[L,U[0]];if(L>=1)return[L,U[P-1]];let M=Math.ceil(L*P)-1;return[L,U[M]]})},W=(V,q)=>{if(this.#X>0){let D=Y%this.#X;X[D]=[q,V],Y=Y+1}if(J=J+1,$=$+V,V<Z)Z=V;if(V>G)G=V};return LQ((V)=>{let q=x1(V,j8);return{quantiles:K(q.currentTimeMillisUnsafe()),count:J,min:Z,max:G,sum:$}},([V,q])=>W(V,q))}}var h5=B(2,(Q,X)=>k4((Y)=>$0(()=>Q.updateUnsafe(X,Y))));function _j(Q,X){let Y=`${Q.type}:${Q.id}`;if(G1(Q.description))Y+=`:${Q.description}`;if(G1(X))Y+=`:${qj(X)}`;return Y}function LQ(Q,X,Y){return{get:Q,update:X,modify:Y??X}}function qj(Q){return Dj(Array.isArray(Q)?Q:Object.entries(Q))}function Dj(Q){return Q.map(([X,Y])=>`${X}=${Y}`).join(",")}function Bj(Q,X){return{...g4(Q),...g4(X)}}function g4(Q){if(G1(Q)&&Array.isArray(Q))return Q.reduce((X,[Y,J])=>{return X[Y]=J,X},{});return Q}var Oj=M8,Y4=d,zj=I7,Fj=bJ,Lj=A_,Pj=w_,Rj=T_,Nj=n1,xD=b4,Mj=QJ,C$=KV,h=A,x8=U7,o7=e3,vD=a,kD=$0,h4=Y0;var Aj=Rq;var T$=T1,wj=YJ,Cj=k_,Tj=y_,Ij=g_;var jj=b_,Ej=_V,y=F0,Sj=O7,xj=M0,vj=ZV,yD=N6,m4=GV;var kj=E5,yj=t3,bD=c,I$=j5,bj=JV,gj=$V,RQ=C,hj=LV,mj=t8,gD=M6,dj=v4,pj=J_,NQ=e9,j$=L0,cj=k1,fj=z7,uj=n9,lj=BV,rj=BJ,oj=UJ,nj=y1;var ij=LJ,aj=iV,sj=aV,tj=sV,ej=tV,QE=s1,XE=uV,YE=s9,JE=N7,$E=fV,ZE=zJ,GE=x5,KE=PJ,WE=RJ,HE=NJ,hD=FJ,VE=oV,n7=lV,_E=rV,qE=R7,mD=nV,DE=MJ,BE=zQ,UE=A$,OE=UV,zE=X_,FE=Y_,LE=ND,PE=Nq,RE=eV,NE=Q_,ME=W_,AE=H_,wE=wJ,CE=K_,TE=I6,IE=V_,jE=ZJ,EE=GJ,SE=OV,xE=F7,vE=S_,kE=x_,yE=v_,bE=gJ,gE=hJ,hE=dV,mE=E_,dE=pV,E$=M7,S$=t9,pE=AJ,cE=$_,fE=zV,uE=I8,lE=A6,rE=Z_,oE=G_,nE=DJ,iE=k4,aE=l7,sE=Q4,tE=gV,eE=hV,QS=a9,XS=e8,dD=z1,YS=L7,JS=mV,$S=YQ,ZS=TJ,GS=w7,KS=C7,WS=z_,HS=O_,VS=IJ,_S=D_,qS=SJ,DS=B_,BS=xJ,US=v5,x$=F1,OS=jJ,zS=EJ,FS=F_,LS=kJ,PS=vJ,pD=L_,RS=yJ,NS=U_,MS=w6,cD=JQ,AS=N_,wS=M_,CS=P7,TS=FD,IS=M$,jS=OJ,ES=cV,SS=B(2,(Q,X)=>fD(Q,void 0,X)),fD=LD,xS=i_,vS=a_,kS=s_,yS=t_,bS=Gq,gS=Kq,hS=Wq,mS=Hq,dS=Yq,pS=Jq,cS=$q,fS=Qq,uS=d9,lS=p9,rS=Zq,oS=Xq,nS=T5,iS=wD,aS=CD,sS=h_,tS=mJ,eS=p_,Qx=m_,Xx=d_,Yx=HV,Jx=VV,m5=c_,$x=X4,Zx=dJ,Gx=f_,MQ=l_,Kx=pJ,Wx=u_,Hx=j7,d4=o_,Vx=cJ,i7=r_,_x=E7,qx=JJ,Dx=qV,uD=T6,Bx=W8,Ux=W8(),Ox=W8("Fatal"),zx=W8("Warn"),v$=W8("Error"),Fx=W8("Info"),Lx=W8("Debug"),Px=W8("Trace"),Rx=B(2,(Q,X)=>e8(Q,rJ,(Y)=>new Set([...Y,X]))),Nx=B((Q)=>Y4(Q[0]),(Q,...X)=>e8(Q,Iq,(Y)=>{let J={...Y};if(X.length===1)Object.assign(J,X[0]);else J[X[0]]=X[1];return J})),Mx=Fq,Ax=B(2,(Q,X)=>C(_q,(Y)=>e8(Q,jq,(J)=>{return[[X,Y],...J]}))),wx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>x$(Q,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return h5(X,$)})),Cx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>gD(Q,(J)=>{let $=Y===void 0?J:Y(J);return h5(X,$)})),Tx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>hD(Q,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return h5(X,$)})),Ix=B((Q)=>Y4(Q[0]),(Q,X,Y)=>mD(Q,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return h5(X,$)})),jx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>uD((J)=>{let $=J.currentTimeNanosUnsafe();return x$(Q,()=>{let Z=J.currentTimeNanosUnsafe(),G=NH(v1(Z),v1($)),K=Y===void 0?G:J0(()=>Y(G));return h5(X,K)})}));class PQ extends l1()("effect/Effect/Transaction"){}var Ex=(Q)=>bD((X)=>{if(X.context.mapUnsafe.has(PQ.key))return Q;let Y={journal:new Map,retry:!1},J;return cD(($)=>RQ(xD({while:()=>!J,body:Z1($(Q).pipe(dD(PQ,Y),n7(()=>{if(!Y.retry)return h4;return $(xx(Y))}),NQ)),step(Z){if(Y.retry||!Sx(Y))return SD(Y);if(H8(Z))vx(X,Y);else SD(Y);J=Z}}),()=>J))}),Sx=(Q)=>{for(let[X,{version:Y}]of Q.journal)if(X.version!==Y)return!1;return!0},xx=(Q)=>vD(()=>{let X={},Y=Array.from(Q.journal.keys()),J=()=>{for(let $ of Y)$.pending.delete(X)};return T$(($)=>{let Z=()=>{J(),$(h4)};for(let G of Y)G.pending.set(X,Z);return kD(J)})});function vx(Q,X){for(let[Y,{value:J}]of X.journal){if(J!==Y.value)Y.version=Y.version+1,Y.value=J;for(let $ of Y.pending.values())Q.currentDispatcher.scheduleTask($,0);Y.pending.clear()}}function SD(Q){Q.retry=!1,Q.journal.clear()}var kx=RQ(PQ,(Q)=>{return Q.retry=!0,pD}),yx=(Q,X,Y)=>(...J)=>T$(($)=>{try{Q(...J,(Z,G)=>{if(Z)$(y(X?X(Z,J):Z));else $(h(G))})}catch(Z){$(Y?y(Y(Z,J)):yD(Z))}}),bx=()=>(Q)=>Q,gx=()=>(Q)=>Q,hx=()=>(Q)=>Q,x6=PV,X1=RV,a0=NV,_8=FV,d5=MV,AQ=DV;var mx=(Q,X)=>{if(H8(Q))return X(0);if(k7(Q.cause))return X(130);return X(dx(j6(Q.cause)))},oD=(Q)=>B((X)=>Y4(X[0]),(X,Y)=>{let J=Y?.disableErrorReporting===!0?m5(X):m5(n7(X,(Z)=>{if(k7(Z))return h4;return px(j6(Z))?v$(Z):h4}));try{let Z=globalThis.setInterval(Z5,2147483647);J.addObserver(()=>{clearInterval(Z)})}catch{}let $=Y?.teardown??mx;return Q({fiber:J,teardown:$})}),lD="~effect/Runtime/errorExitCode",dx=(Q)=>{if(typeof Q==="object"&&Q!==null&&lD in Q){let X=Q[lD];if(typeof X==="number")return X}return 1},rD="~effect/Runtime/errorReported",px=(Q)=>{if(typeof Q==="object"&&Q!==null&&rD in Q){let X=Q[rD];if(typeof X==="boolean")return X}return!0};var nD=oD(({fiber:Q,teardown:X})=>{let Y=!1;Q.addObserver(($)=>{process.removeListener("SIGINT",J),process.removeListener("SIGTERM",J),X($,(Z)=>{if(Y||Z!==0)process.exit(Z)})});function J(){Y=!0,Q.interruptUnsafe(Q.id)}process.on("SIGINT",J),process.on("SIGTERM",J)});var ux=nD;var E={};G6(E,{withDecodingDefaultTypeKey:()=>ju,withDecodingDefaultType:()=>Eu,withDecodingDefaultKey:()=>lK,withDecodingDefault:()=>TN,withConstructorDefault:()=>CN,toType:()=>N1,toTaggedUnion:()=>IN,toStandardSchemaV1:()=>hf,toStandardJSONSchemaV1:()=>mf,toRepresentation:()=>NM,toJsonSchemaDocument:()=>MM,toIsoSource:()=>pr,toIsoFocus:()=>cr,toIso:()=>dr,toFormatter:()=>Tr,toEquivalence:()=>jr,toEncoderXml:()=>xr,toEncoded:()=>O9,toDifferJsonPatch:()=>ur,toCodecStringTree:()=>IM,toCodecJson:()=>AM,toCodecIso:()=>CM,toArbitraryLazy:()=>RM,toArbitrary:()=>wr,tagDefaultOmit:()=>Su,tag:()=>Q5,suspend:()=>RN,revealCodec:()=>bf,revealBottom:()=>xf,resolveAnnotationsKey:()=>ir,resolveAnnotations:()=>nr,requiredKey:()=>Qu,required:()=>Xu,refine:()=>Mu,redact:()=>oK,readonlyKey:()=>Ju,overrideToFormatter:()=>Cr,overrideToEquivalence:()=>Ir,overrideToCodecIso:()=>fr,optionalKey:()=>X6,optional:()=>U9,mutableKey:()=>Yu,mutable:()=>Ru,middlewareEncoding:()=>MN,middlewareDecoding:()=>fK,makeIsMultipleOf:()=>xN,makeIsLessThanOrEqualTo:()=>PX,makeIsLessThan:()=>LX,makeIsGreaterThanOrEqualTo:()=>FX,makeIsGreaterThan:()=>zX,makeIsBetween:()=>RX,makeFilterGroup:()=>ku,makeFilter:()=>z0,make:()=>T,link:()=>N0,isUppercased:()=>ru,isUnique:()=>fN,isUncapitalized:()=>iu,isUint32:()=>Xl,isUUID:()=>mu,isULID:()=>pu,isTrimmed:()=>jN,isStringSymbol:()=>gu,isStringFinite:()=>yu,isStringBigInt:()=>bu,isStartsWith:()=>fu,isSizeBetween:()=>Ll,isSchemaError:()=>gf,isSchema:()=>v2,isPropertyNames:()=>Ml,isPropertiesLengthBetween:()=>Nl,isPattern:()=>z9,isNonEmpty:()=>pN,isMultipleOf:()=>eu,isMinSize:()=>zl,isMinProperties:()=>Pl,isMinLength:()=>dN,isMaxSize:()=>Fl,isMaxProperties:()=>Rl,isMaxLength:()=>Ol,isLowercased:()=>ou,isLessThanOrEqualToDate:()=>Zl,isLessThanOrEqualToBigInt:()=>Hl,isLessThanOrEqualToBigDecimal:()=>Bl,isLessThanOrEqualTo:()=>tu,isLessThanDate:()=>$l,isLessThanBigInt:()=>Wl,isLessThanBigDecimal:()=>Dl,isLessThan:()=>su,isLengthBetween:()=>cN,isInt32:()=>Ql,isInt:()=>g2,isIncludes:()=>lu,isGreaterThanOrEqualToDate:()=>Jl,isGreaterThanOrEqualToBigInt:()=>mN,isGreaterThanOrEqualToBigDecimal:()=>ql,isGreaterThanOrEqualTo:()=>vN,isGreaterThanDate:()=>Yl,isGreaterThanBigInt:()=>Kl,isGreaterThanBigDecimal:()=>_l,isGreaterThan:()=>au,isGUID:()=>du,isFinite:()=>SN,isEndsWith:()=>uu,isDateValid:()=>kN,isCapitalized:()=>nu,isBetweenDate:()=>Gl,isBetweenBigInt:()=>Vl,isBetweenBigDecimal:()=>Ul,isBetween:()=>rK,isBase64Url:()=>cu,isBase64:()=>EN,is:()=>YN,instanceOf:()=>z4,fromURLSearchParams:()=>el,fromJsonString:()=>ZM,fromFormData:()=>tl,fromBrand:()=>Au,flip:()=>vK,fieldsAssign:()=>Du,extendTo:()=>Uu,encodeUnknownSync:()=>DN,encodeUnknownResult:()=>_N,encodeUnknownPromise:()=>qN,encodeUnknownOption:()=>VN,encodeUnknownExit:()=>HN,encodeUnknownEffect:()=>x2,encodeTo:()=>uK,encodeSync:()=>tf,encodeResult:()=>af,encodePromise:()=>sf,encodeOption:()=>nf,encodeKeys:()=>Bu,encodeExit:()=>of,encodeEffect:()=>WN,encode:()=>Iu,decodeUnknownSync:()=>KN,decodeUnknownResult:()=>ZN,decodeUnknownPromise:()=>GN,decodeUnknownOption:()=>$N,decodeUnknownExit:()=>JN,decodeUnknownEffect:()=>S2,decodeTo:()=>p,decodeSync:()=>rf,decodeResult:()=>uf,decodePromise:()=>lf,decodeOption:()=>ff,decodeExit:()=>cf,decodeEffect:()=>pf,decode:()=>Tu,declareConstructor:()=>f1,declare:()=>O4,check:()=>Nu,catchEncodingWithContext:()=>wN,catchEncoding:()=>Cu,catchDecodingWithContext:()=>AN,catchDecoding:()=>wu,brand:()=>NN,asserts:()=>df,asClass:()=>ef,annotateKey:()=>yf,annotateEncoded:()=>kf,annotate:()=>vf,Void:()=>Vu,UnknownFromJsonString:()=>sl,Unknown:()=>gK,UniqueSymbol:()=>qu,UniqueArray:()=>Pu,Union:()=>J1,UndefinedOr:()=>y2,Undefined:()=>mK,Uint8ArrayFromHex:()=>qr,Uint8ArrayFromBase64Url:()=>_r,Uint8ArrayFromBase64:()=>Vr,Uint8Array:()=>d2,URLSearchParams:()=>WM,URLFromString:()=>fl,URL:()=>QM,TupleWithRest:()=>zu,Tuple:()=>B9,Trimmed:()=>VM,Trim:()=>Jr,Tree:()=>lr,TimeZoneOffset:()=>Or,TimeZoneNamedFromString:()=>zr,TimeZoneNamed:()=>DM,TimeZoneFromString:()=>Fr,TimeZone:()=>UM,TemplateLiteralParser:()=>Gu,TemplateLiteral:()=>Zu,TaggedUnion:()=>xu,TaggedStruct:()=>b2,TaggedErrorClass:()=>Ar,TaggedClass:()=>Mr,Symbol:()=>ON,StructWithRest:()=>Ou,Struct:()=>R0,StringFromUriComponent:()=>Kr,StringFromHex:()=>Gr,StringFromBase64Url:()=>Zr,StringFromBase64:()=>$r,String:()=>o,StandardSchemaV1FailureResult:()=>Wr,SchemaError:()=>g8,Result:()=>xl,RegExp:()=>cl,RedactedFromValue:()=>vl,Redacted:()=>uN,Record:()=>zN,ReadonlySet:()=>ml,ReadonlyMap:()=>gl,PropertyKey:()=>bK,OptionFromUndefinedOr:()=>Tl,OptionFromOptionalNullOr:()=>Sl,OptionFromOptionalKey:()=>jl,OptionFromOptional:()=>El,OptionFromNullishOr:()=>Il,OptionFromNullOr:()=>Cl,Option:()=>X5,Opaque:()=>vu,ObjectKeyword:()=>_u,NumberFromString:()=>Qr,Number:()=>Y6,NullishOr:()=>PN,NullOr:()=>cK,Null:()=>hK,NonEmptyString:()=>Al,NonEmptyArray:()=>Fu,Never:()=>Wu,MutableJson:()=>or,Literals:()=>pK,Literal:()=>t0,Json:()=>aK,Int:()=>HM,HashSet:()=>dl,HashMap:()=>hl,FormData:()=>KM,FiniteFromString:()=>Xr,Finite:()=>m2,File:()=>GM,Exit:()=>bl,ErrorClass:()=>PM,Error:()=>kl,Enum:()=>Ku,DurationFromString:()=>rl,DurationFromNanos:()=>nl,DurationFromMillis:()=>il,Duration:()=>h2,Defect:()=>yl,DateValid:()=>YM,DateTimeZonedFromString:()=>Lr,DateTimeZoned:()=>zM,DateTimeUtcFromString:()=>Br,DateTimeUtcFromMillis:()=>Ur,DateTimeUtcFromDate:()=>Dr,DateTimeUtc:()=>p2,DateFromString:()=>ul,Date:()=>nK,Class:()=>LM,Chunk:()=>pl,Char:()=>wl,CauseReason:()=>kK,Cause:()=>yK,BooleanFromBit:()=>Hr,Boolean:()=>UN,BigIntFromString:()=>Yr,BigInt:()=>k2,BigDecimalFromString:()=>al,BigDecimal:()=>$M,ArrayEnsure:()=>Lu,Array:()=>f0,Any:()=>Hu});var iD=/^[+-]?\d+$/,k$="~effect/BigDecimal",lx={[k$]:k$,[K0](){let Q=g$(this);return u0(t(Q.value),p8(Q.scale))},[W0](Q){return b$(Q)&&ox(this,Q)},toString(){return`BigDecimal(${k8(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[n0](){return this.toJSON()},pipe(){return X0(this,arguments)}},b$=(Q)=>N(Q,k$),v6=(Q,X)=>{let Y=Object.create(lx);return Y.value=Q,Y.scale=X,Y},sD=(Q,X)=>{if(Q!==v8&&Q%y$===v8)throw RangeError("Value must be normalized");let Y=v6(Q,X);return Y.normalized=Y,Y},v8=BigInt(0);var y$=BigInt(10),tD=sD(v8,0);var g$=(Q)=>{if(Q.normalized===void 0)if(Q.value===v8)Q.normalized=tD;else{let X=`${Q.value}`,Y=0;for(let Z=X.length-1;Z>=0;Z--)if(X[Z]==="0")Y++;else break;if(Y===0)Q.normalized=Q;let J=BigInt(X.substring(0,X.length-Y)),$=Q.scale-Y;Q.normalized=sD(J,$)}return Q.normalized},s7=B(2,(Q,X)=>{if(X>Q.scale)return v6(Q.value*y$**BigInt(X-Q.scale),X);if(X<Q.scale)return v6(Q.value/y$**BigInt(Q.scale-X),X);return Q});var p5=x9((Q,X)=>{let Y=U1(aD(Q),aD(X));if(Y!==0)return Y;if(Q.scale>X.scale)return T8(Q.value,s7(X,Q.scale).value);if(Q.scale<X.scale)return T8(s7(Q,X.scale).value,X.value);return T8(Q.value,X.value)});var aD=(Q)=>Q.value===v8?0:Q.value<v8?-1:1,rx=(Q)=>Q.value<v8?v6(-Q.value,Q.scale):Q;var h$=i0((Q,X)=>{if(Q.scale>X.scale)return s7(X,Q.scale).value===Q.value;if(Q.scale<X.scale)return s7(Q,X.scale).value===X.value;return Q.value===X.value}),ox=B(2,(Q,X)=>h$(Q,X));var eD=(Q)=>{if(Q==="")return F(tD);let X,Y,J=Q.search(/[eE]/);if(J!==-1){let W=Q.slice(J+1);if(X=Q.slice(0,J),Y=Number(W),X===""||!Number.isSafeInteger(Y)||!iD.test(W))return b()}else X=Q,Y=0;let $,Z,G=X.search(/\./);if(G!==-1){let W=X.slice(0,G),H=X.slice(G+1);$=`${W}${H}`,Z=H.length}else $=X,Z=0;if(!iD.test($))return b();let K=Z-Y;if(!Number.isSafeInteger(K))return b();return F(v6(BigInt($),K))};var k8=(Q)=>{let X=g$(Q);if(Math.abs(X.scale)>=16)return nx(X);let Y=X.value<v8,J=Y?`${X.value}`.substring(1):`${X.value}`,$,Z;if(X.scale>=J.length)$="0",Z="0".repeat(X.scale-J.length)+J;else{let K=J.length-X.scale;if(K>J.length){let W=K-J.length;$=`${J}${"0".repeat(W)}`,Z=""}else Z=J.slice(K),$=J.slice(0,K)}let G=Z===""?$:`${$}.${Z}`;return Y?`-${G}`:G},nx=(Q)=>{if(ix(Q))return"0e+0";let X=g$(Q),Y=`${rx(X).value}`,J=Y.slice(0,1),$=Y.slice(1),Z=`${ax(X)?"-":""}${J}`;if($!=="")Z+=`.${$}`;let G=$.length-X.scale;return`${Z}e${G>=0?"+":""}${G}`};var ix=(Q)=>Q.value===v8,ax=(Q)=>Q.value<v8;var XB="~effect/collections/Chunk";function sx(Q,X,Y,J,$){for(let Z=X;Z<Math.min(Q.length,X+$);Z++)Y[J+Z-X]=Q[Z];return Y}var YB=[],d$=(Q)=>i0((X,Y)=>X.length===Y.length&&wQ(X).every((J,$)=>Q(J,CQ(Y,$)))),tx=d$(n),ex={[XB]:{_A:(Q)=>Q},toString(){return`Chunk(${v(wQ(this))})`},toJSON(){return{_id:"Chunk",values:K1(wQ(this))}},[n0](){return this.toJSON()},[W0](Q){return t7(Q)&&tx(this,Q)},[K0](){return w9(wQ(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return YB[Symbol.iterator]();default:return wQ(this)[Symbol.iterator]()}},pipe(){return X0(this,arguments)}},p$=(Q)=>{let X=Object.create(ex);switch(X.backing=Q,Q._tag){case"IEmpty":{X.length=0,X.depth=0,X.left=X,X.right=X;break}case"IConcat":{X.length=Q.left.length+Q.right.length,X.depth=1+Math.max(Q.left.depth,Q.right.depth),X.left=Q.left,X.right=Q.right;break}case"IArray":{X.length=Q.array.length,X.depth=0,X.left=J4,X.right=J4;break}case"ISingleton":{X.length=1,X.depth=0,X.left=J4,X.right=J4;break}case"ISlice":{X.length=Q.length,X.depth=Q.chunk.depth+1,X.left=J4,X.right=J4;break}}return X},t7=(Q)=>N(Q,XB),J4=p$({_tag:"IEmpty"}),Qv=()=>J4;var Xv=(Q)=>p$({_tag:"ISingleton",a:Q}),e7=(Q)=>t7(Q)?Q:Jv(W1(Q)),m$=(Q,X,Y)=>{switch(Q.backing._tag){case"IArray":{sx(Q.backing.array,0,X,Y,Q.length);break}case"IConcat":{m$(Q.left,X,Y),m$(Q.right,X,Y+Q.left.length);break}case"ISingleton":{X[Y]=Q.backing.a;break}case"ISlice":{let J=0,$=Y;while(J<Q.length)X[$]=CQ(Q,J),J+=1,$+=1;break}}};var Yv=(Q)=>{switch(Q.backing._tag){case"IEmpty":return YB;case"IArray":return Q.backing.array;default:{let X=Array(Q.length);return m$(Q,X,0),Q.backing={_tag:"IArray",array:X},Q.left=J4,Q.right=J4,Q.depth=0,X}}},wQ=Yv;var Jv=(Q)=>Q.length===0?Qv():Q.length===1?Xv(Q[0]):p$({_tag:"IArray",array:Q});var CQ=B(2,(Q,X)=>{let Y=Math.floor(X);switch(Q.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${Y}`);case"ISingleton":{if(X!==0)throw Error(`Index out of bounds: ${Y}`);return Q.backing.a}case"IArray":{if(Y>=Q.length||Y<0)throw Error(`Index out of bounds: ${Y}`);return Q.backing.array[Y]}case"IConcat":return Y<Q.left.length?CQ(Q.left,Y):CQ(Q.right,Y-Q.left.length);case"ISlice":return CQ(Q.backing.chunk,Y+Q.backing.offset)}});var JB=(Q)=>Q.length;var c$=b5,$B=E6,ZB=sq,GB=tq,KB=eq,WB=$$,f$=QD;var HB=y5;var VB=K$;var QY=XD,_B=YD;var XY=JD;var u$=W$,TQ=BQ,qB=H$;var DB=V$,p4=$D;var BB=UQ;var UB=D$;var OB=GD;var YY=U$;var zB="~effect/encoding/EncodingError";class c4 extends rq("EncodingError"){[zB]=zB}var $Y=(Q)=>typeof Q==="string"?r$(i$.encode(Q)):r$(Q),c5=(Q)=>{let X=TB(Q),Y=X.length;if(Y%4!==0)return f(new c4({kind:"Decode",module:"Base64",input:X,message:`Length must be a multiple of 4, but is ${Y}`}));let J=X.indexOf("=");if(J!==-1&&(J<Y-2||J===Y-2&&X[Y-1]!=="="))return f(new c4({kind:"Decode",module:"Base64",input:X,message:"Found a '=' character, but it is not at the end"}));try{let $=X.endsWith("==")?2:X.endsWith("=")?1:0,Z=new Uint8Array(3*(Y/4)-$);for(let G=0,K=0;G<Y;G+=4,K+=3){let W=JY(X.charCodeAt(G))<<18|JY(X.charCodeAt(G+1))<<12|JY(X.charCodeAt(G+2))<<6|JY(X.charCodeAt(G+3));Z[K]=W>>16,Z[K+1]=W>>8&255,Z[K+2]=W&255}return l(Z)}catch($){return f(new c4({kind:"Decode",module:"Base64",input:X,message:$ instanceof Error?$.message:"Invalid input"}))}},NB=(Q)=>F6(c5(Q),(X)=>a$.decode(X)),MB=(Q)=>typeof Q==="string"?LB(i$.encode(Q)):LB(Q),o$=(Q)=>{let X=TB(Q),Y=X.length;if(Y%4===1)return f(new c4({module:"Base64Url",kind:"Decode",input:X,message:`Length should be a multiple of 4, but is ${Y}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(X))return f(new c4({module:"Base64Url",kind:"Decode",input:X,message:"Invalid input"}));let J=Y%4===2?`${X}==`:Y%4===3?`${X}=`:X;return J=J.replace(/-/g,"+").replace(/_/g,"/"),c5(J)},AB=(Q)=>F6(o$(Q),(X)=>a$.decode(X)),wB=(Q)=>typeof Q==="string"?PB(i$.encode(Q)):PB(Q),n$=(Q)=>{let X=new TextEncoder().encode(Q);if(X.length%2!==0)return f(new c4({module:"Hex",kind:"Decode",input:Q,message:`Length must be a multiple of 2, but is ${X.length}`}));try{let Y=X.length/2,J=new Uint8Array(Y);for(let $=0;$<Y;$++){let Z=RB(X[$*2]),G=RB(X[$*2+1]);J[$]=Z<<4|G}return l(J)}catch(Y){return f(new c4({module:"Hex",kind:"Decode",input:Q,message:Y instanceof Error?Y.message:"Invalid input"}))}},CB=(Q)=>F6(n$(Q),(X)=>a$.decode(X)),i$=new TextEncoder,a$=new TextDecoder,TB=(Q)=>Q.replace(/[\n\r]/g,""),r$=(Q)=>{let X=Q.length,Y="",J;for(J=2;J<X;J+=3)Y+=$4[Q[J-2]>>2],Y+=$4[(Q[J-2]&3)<<4|Q[J-1]>>4],Y+=$4[(Q[J-1]&15)<<2|Q[J]>>6],Y+=$4[Q[J]&63];if(J===X+1)Y+=$4[Q[J-2]>>2],Y+=$4[(Q[J-2]&3)<<4],Y+="==";if(J===X)Y+=$4[Q[J-2]>>2],Y+=$4[(Q[J-2]&3)<<4|Q[J-1]>>4],Y+=$4[(Q[J-1]&15)<<2],Y+="=";return Y};function JY(Q){if(Q>=FB.length)throw TypeError(`Invalid character ${String.fromCharCode(Q)}`);let X=FB[Q];if(X===255)throw TypeError(`Invalid character ${String.fromCharCode(Q)}`);return X}var $4=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],FB=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],LB=(Q)=>r$(Q).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),PB=(Q)=>{let X="";for(let Y=0;Y<Q.length;++Y)X+=Zv[Q[Y]];return X},RB=(Q)=>{if(48<=Q&&Q<=57)return Q-48;if(97<=Q&&Q<=102)return Q-97+10;if(65<=Q&&Q<=70)return Q-65+10;throw TypeError("Invalid input")},Zv=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var GY="~effect/collections/HashMap",q8=5,SQ=1<<q8,Gv=SQ/4,jB=SQ/2,Kv=SQ-1,Wv=(Q)=>{return Q=Q-(Q>>>1&1431655765),Q=(Q&858993459)+(Q>>>2&858993459),(Q+(Q>>>4)&252645135)*16843009>>>24},IQ=(Q,X)=>Q>>>X&Kv,f4=(Q,X)=>1<<IQ(Q,X),ZY=(Q,X)=>Wv(Q&X-1);function EB(Q,X,Y,J,$,Z){if(X>32)throw Error("HashMap: max depth exceeded");let G=f4(Y,X),K=f4($,X);if(G===K){let _=EB(Q,X+q8,Y,J,$,Z);return new y8(Q,G,[_])}let W=G|K,H=G>>>0<K>>>0?[J,Z]:[Z,J];return new y8(Q,W,H)}class f5{canEdit(Q){return this.edit===Q}}class SB extends f5{_tag="EmptyNode";edit=0;get size(){return 0}get(Q,X,Y){return b()}has(Q,X,Y){return!1}set(Q,X,Y,J,$,Z){return Z.value=!0,new Z4(Q,Y,J,$)}remove(Q,X,Y,J,$){return this}iterator(){return[][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}canEdit(Q){return!1}}class Z4 extends f5{_tag="LeafNode";edit;hash;key;value;constructor(Q,X,Y,J){super();this.edit=Q,this.hash=X,this.key=Y,this.value=J}get size(){return 1}get(Q,X,Y){if(this.hash===X&&n(this.key,Y))return F(this.value);return b()}has(Q,X,Y){return this.hash===X&&n(this.key,Y)}set(Q,X,Y,J,$,Z){if(this.hash===Y&&n(this.key,J)){if(n(this.value,$))return this;if(this.canEdit(Q))return this.value=$,this;return new Z4(Q,Y,J,$)}if(Z.value=!0,this.hash===Y)return new jQ(Q,Y,[[this.key,this.value],[J,$]]);let G=f4(Y,X),K=f4(this.hash,X);if(G===K)return new y8(Q,G,[this.set(Q,X+q8,Y,J,$,Z)]);let W=G|K,H=G>>>0<K>>>0?[new Z4(Q,Y,J,$),this]:[this,new Z4(Q,Y,J,$)];return new y8(Q,W,H)}remove(Q,X,Y,J,$){if(this.hash===Y&&n(this.key,J)){$.value=!0;return}return this}iterator(){return[[this.key,this.value]][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class jQ extends f5{_tag="CollisionNode";edit;hash;entries;constructor(Q,X,Y){super();this.edit=Q,this.hash=X,this.entries=Y}get size(){return this.entries.length}get(Q,X,Y){if(this.hash!==X)return b();for(let[J,$]of this.entries)if(n(J,Y))return F($);return b()}has(Q,X,Y){if(this.hash!==X)return!1;for(let[J]of this.entries)if(n(J,Y))return!0;return!1}set(Q,X,Y,J,$,Z){if(this.hash!==Y)return Z.value=!0,EB(Q,X,this.hash,this,Y,new Z4(Q,Y,J,$));for(let G=0;G<this.entries.length;G++)if(n(this.entries[G][0],J)){if(n(this.entries[G][1],$))return this;if(this.canEdit(Q))return this.entries[G]=[J,$],this;let K=[...this.entries];return K[G]=[J,$],new jQ(Q,this.hash,K)}if(Z.value=!0,this.canEdit(Q))return this.entries.push([J,$]),this;return new jQ(Q,this.hash,[...this.entries,[J,$]])}remove(Q,X,Y,J,$){if(this.hash!==Y)return this;let Z=this.entries.findIndex(([K])=>n(K,J));if(Z===-1)return this;if($.value=!0,this.entries.length===1)return;if(this.entries.length===2){let K=this.entries[Z===0?1:0];return new Z4(Q,this.hash,K[0],K[1])}if(this.canEdit(Q))return this.entries.splice(Z,1),this;let G=[...this.entries];return G.splice(Z,1),new jQ(Q,this.hash,G)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class y8 extends f5{_tag="IndexedNode";edit;_size;bitmap;children;constructor(Q,X,Y){super();this.edit=Q,this.bitmap=X,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((Q,X)=>Q+X.size,0);return this._size}get(Q,X,Y){let J=f4(X,Q);if((this.bitmap&J)===0)return b();let $=ZY(this.bitmap,J);return this.children[$].get(Q+q8,X,Y)}has(Q,X,Y){let J=f4(X,Q);if((this.bitmap&J)===0)return!1;let $=ZY(this.bitmap,J);return this.children[$].has(Q+q8,X,Y)}set(Q,X,Y,J,$,Z){let G=f4(Y,X),K=ZY(this.bitmap,G);if((this.bitmap&G)!==0){let W=this.children[K],H=W.set(Q,X+q8,Y,J,$,Z);if(W===H)return this;if(this.canEdit(Q))return this.children[K]=H,this;let _=[...this.children];return _[K]=H,new y8(Q,this.bitmap,_)}else{Z.value=!0;let W=new Z4(Q,Y,J,$),H=this.bitmap|G;if(this.canEdit(Q)){if(this.children.splice(K,0,W),this.bitmap=H,this._size=void 0,this.children.length>jB)return this.expand(Q,H,this.children);return this}let _=[...this.children];if(_.splice(K,0,W),_.length>jB)return this.expand(Q,H,_);return new y8(Q,H,_)}}remove(Q,X,Y,J,$){let Z=f4(Y,X);if((this.bitmap&Z)===0)return this;let G=ZY(this.bitmap,Z),K=this.children[G],W=K.remove(Q,X+q8,Y,J,$);if(!$.value)return this;if(W===void 0){let _=this.bitmap^Z;if(_===0)return;if(this.children.length===2){let q=this.children[G===0?1:0];if(q._tag==="LeafNode")return q}if(this.canEdit(Q))return this.children.splice(G,1),this.bitmap=_,this._size=void 0,this;let V=[...this.children];return V.splice(G,1),new y8(Q,_,V)}if(K===W)return this;if(this.canEdit(Q))return this.children[G]=W,this;let H=[...this.children];return H[G]=W,new y8(Q,this.bitmap,H)}expand(Q,X,Y){let J=new globalThis.Array(SQ),$=0;for(let Z=0;Z<SQ;Z++)if((X&1<<Z)!==0)J[Z]=Y[$++];return new EQ(Q,Y.length,J)}iterator(){let Q=0,X;return{next:()=>{while(Q<this.children.length){if(!X)X=this.children[Q].iterator();let Y=X.next();if(!Y.done)return Y;X=void 0,Q++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class EQ extends f5{_tag="ArrayNode";edit;_size;count;children;constructor(Q,X,Y){super();this.edit=Q,this.count=X,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((Q,X)=>Q+(X?.size??0),0);return this._size}get(Q,X,Y){let J=IQ(X,Q),$=this.children[J];return $?$.get(Q+q8,X,Y):b()}has(Q,X,Y){let J=IQ(X,Q),$=this.children[J];return $?$.has(Q+q8,X,Y):!1}set(Q,X,Y,J,$,Z){let G=IQ(Y,X),K=this.children[G];if(K){let W=K.set(Q,X+q8,Y,J,$,Z);if(K===W)return this;if(this.canEdit(Q))return this.children[G]=W,this;let H=[...this.children];return H[G]=W,new EQ(Q,this.count,H)}else{Z.value=!0;let W=new Z4(Q,Y,J,$);if(this.canEdit(Q))return this.children[G]=W,this.count++,this._size=void 0,this;let H=[...this.children];return H[G]=W,new EQ(Q,this.count+1,H)}}remove(Q,X,Y,J,$){let Z=IQ(Y,X),G=this.children[Z];if(!G)return this;let K=G.remove(Q,X+q8,Y,J,$);if(!$.value)return this;let W=this.count-(K?0:1);if(W<Gv)return this.pack(Q,Z,K);if(G===K)return this;if(this.canEdit(Q)){if(this.children[Z]=K,!K)this.count=W;return this._size=void 0,this}let H=[...this.children];return H[Z]=K,new EQ(Q,W,H)}pack(Q,X,Y){let J=[],$=0,Z=1;for(let G=0;G<this.children.length;G++){let K=G===X?Y:this.children[G];if(K)J.push(K),$|=Z;Z<<=1}return new y8(Q,$,J)}iterator(){let Q=0,X;return{next:()=>{while(Q<this.children.length){let Y=this.children[Q];if(!Y){Q++;continue}if(!X)X=Y.iterator();let J=X.next();if(!J.done)return J;X=void 0,Q++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class KY{[GY]=GY;_editable;_edit;_root;_size;constructor(Q,X,Y,J){this._editable=Q,this._edit=X,this._root=Y,this._size=J}get size(){return this._size}[Symbol.iterator](){return this._root.iterator()}[W0](Q){if(s$(Q)){let X=Q;if(this.size!==X.size)return!1;for(let[Y,J]of this){let $=a2(Q,kB(Y));if(I0($)||!n(J,$.value))return!1}return!0}return!1}[K0](){let Q=T0("HashMap");for(let[X,Y]of this)Q=Q^t(X)+t(Y);return Q}[n0](){return K1(this)}toString(){return`HashMap(${v(Array.from(this))})`}toJSON(){return{_id:"HashMap",values:Array.from(this).map(([Q,X])=>[K1(Q),K1(X)])}}pipe(){return X0(this,arguments)}}var xB=new SB,s$=(Q)=>N(Q,GY),t$=()=>new KY(!1,0,xB,0);var vB=(Q)=>{let X=xB,Y=0,J={value:!1};for(let[$,Z]of Q){let G=t($);if(J.value=!1,X=X.set(NaN,0,G,$,Z,J),J.value)Y++}return new KY(!1,0,X,Y)};var kB=B(2,(Q,X)=>{return Q._root.get(0,t(X),X)});var e$=B(2,(Q,X)=>{return Q._root.has(0,t(X),X)});var QZ=B(3,(Q,X,Y)=>{let J=Q,$=t(X),Z={value:!1},G=J._editable?J._edit:NaN,K=J._root.set(G,0,$,X,Y,Z);if(J._editable){if(J._root=K,Z.value)J._size++;return Q}if(J._root===K)return Q;return new KY(!1,J._edit,K,J._size+(Z.value?1:0))}),XZ=(Q)=>{let X=Q[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){let Y=X.next();if(Y.done)return{done:!0,value:void 0};return{done:!1,value:Y.value[0]}}}};var yB=(Q)=>{let X=Q[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return X.next()}}},WY=(Q)=>Q.size;var gB=s$;var HY=vB;var _v=yB,VY=(Q)=>Array.from(_v(Q)),hB=WY;var xQ="~effect/collections/HashSet",Dv={[K0](){return t(xQ)},[W0](Q){return YZ(Q)&&_Y(this)===_Y(Q)&&pB(this,(X)=>dB(Q,X))},[Symbol.iterator](){return XZ(JZ(this))},toString(){return`HashSet(${v(Array.from(this))})`},toJSON(){return{_id:"HashSet",values:K1(Array.from(this))}},[n0](){return this.toJSON()},pipe(){return X0(this,arguments)}},Bv=(Q)=>{let X=Object.create(Dv);return X[xQ]=xQ,X.keyMap=Q,X},YZ=(Q)=>N(Q,xQ),JZ=(Q)=>Q.keyMap;var mB=(Q)=>{let X=t$();for(let Y of Q)X=QZ(X,Y,!0);return Bv(X)},dB=(Q,X)=>e$(JZ(Q),X);var _Y=(Q)=>WY(JZ(Q));var pB=(Q,X)=>{for(let Y of Q)if(!X(Y))return!1;return!0};var qY=mB,cB=YZ;var fB=_Y;function D8(Q){return Q.checks?Q.checks[Q.checks.length-1].annotations:Q.annotations}function DY(Q){return(X)=>D8(X)?.[Q]}var u5=DY("identifier"),$Z=DY("title");var uB=DY("brands"),BY=p0((Q)=>{let X=u5(Q);if(typeof X==="string")return X;return Q.getExpected(BY)});var N00=globalThis.Boolean;var lB=o8((Q,X)=>Q||X,!1);function l5(Q,X,Y){if(X==="__proto__")Object.defineProperty(Q,X,{value:Y,writable:!0,enumerable:!0,configurable:!0});else Q[X]=Y;return Q}var M00=globalThis.RegExp;var UY=(Q)=>Q.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var y6=new WeakMap,oB=(Q)=>{if(y6.has(Q))return y6.get(Q);else throw Error("Unable to get redacted value"+(Q.label?` with label: "${Q.label}"`:""))};var nB="~effect/data/Redacted",ZZ=(Q)=>N(Q,nB),G4=(Q,X)=>{let Y=Object.create(Pv);if(X?.label)Y.label=X.label;return y6.set(Y,Q),Y},Pv={[nB]:{_A:(Q)=>Q},label:void 0,...c8,toJSON(){return this.toString()},toString(){return`<redacted${X8(this.label)?":"+this.label:""}>`},[K0](){return t(y6.get(this))},[W0](Q){return ZZ(Q)&&n(y6.get(this),y6.get(Q))}},r5=oB;var iB=(Q)=>i0((X,Y)=>Q(r5(X),r5(Y)));var GZ="~effect/SchemaIssue/Issue";function Rv(Q){return N(Q,GZ)}class t1{[GZ]=GZ;toString(){return Mv(this)}}class zY extends t1{_tag="Filter";actual;filter;issue;constructor(Q,X,Y){super();this.actual=Q,this.filter=X,this.issue=Y}}class HZ extends t1{_tag="Encoding";ast;actual;issue;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issue=Y}}class A0 extends t1{_tag="Pointer";path;issue;constructor(Q,X){super();this.path=Q,this.issue=X}}class yQ extends t1{_tag="MissingKey";annotations;constructor(Q){super();this.annotations=Q}}class FY extends t1{_tag="UnexpectedKey";ast;actual;constructor(Q,X){super();this.ast=Q,this.actual=X}}class q0 extends t1{_tag="Composite";ast;actual;issues;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issues=Y}}class v0 extends t1{_tag="InvalidType";ast;actual;constructor(Q,X){super();this.ast=Q,this.actual=X}}class G0 extends t1{_tag="InvalidValue";actual;annotations;constructor(Q,X){super();this.actual=Q,this.annotations=X}}class o5 extends t1{_tag="Forbidden";actual;annotations;constructor(Q,X){super();this.actual=Q,this.annotations=X}}class LY extends t1{_tag="AnyOf";ast;actual;issues;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issues=Y}}class VZ extends t1{_tag="OneOf";ast;actual;successes;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.successes=Y}}function KZ(Q,X){if(Rv(X))return X;if(typeof X==="string")return new G0(F(Q),{message:X});let Y=typeof X.issue==="string"?new G0(F(Q),{message:X.issue}):X.issue;return new A0(X.path,Y)}function tB(Q,X){if(X===void 0)return;if(typeof X==="boolean")return X?void 0:new G0(F(Q));return KZ(Q,X)}function eB(Q,X,Y){if(Array.isArray(Y)){if(L6(Y)){if(Y.length===1)return KZ(Q,Y[0]);return new q0(X,F(Q),E4(Y,(J)=>KZ(Q,J)))}return}return tB(Q,Y)}var QU=(Q)=>{let X=kQ(Q);if(X!==void 0)return X;switch(Q._tag){case"InvalidType":return WZ(BY(Q.ast),sB(Q.actual));case"InvalidValue":return`Invalid data ${sB(Q.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${v(Q.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${v(Q.actual)}`}},XU=(Q)=>{return kQ(Q.issue)??kQ(Q)};function YU(Q){return(X)=>({issues:b6(X,[],Q?.leafHook??QU,Q?.checkHook??XU)})}function WZ(Q,X){return`Expected ${Q}, got ${X}`}function b6(Q,X,Y,J){switch(Q._tag){case"Filter":{let $=J(Q);if($!==void 0)return[{path:X,message:$}];switch(Q.issue._tag){case"InvalidValue":return[{path:X,message:WZ(JU(Q.filter),v(Q.actual))}];default:return b6(Q.issue,X,Y,J)}}case"Encoding":return b6(Q.issue,X,Y,J);case"Pointer":return b6(Q.issue,[...X,...Q.path],Y,J);case"Composite":return Q.issues.flatMap(($)=>b6($,X,Y,J));case"AnyOf":{let $=kQ(Q);if(Q.issues.length===0){if($!==void 0)return[{path:X,message:$}];let Z=WZ(BY(Q.ast),v(Q.actual));return[{path:X,message:Z}]}return Q.issues.flatMap((Z)=>b6(Z,X,Y,J))}default:return[{path:X,message:Y(Q)}]}}function JU(Q){let X=Q.annotations?.expected;if(typeof X==="string")return X;switch(Q._tag){case"Filter":return"<filter>";case"FilterGroup":return Q.checks.map((Y)=>JU(Y)).join(" & ")}}function Nv(){return(Q)=>b6(Q,[],QU,XU).map(Av).join(`
27
- `)}var Mv=Nv();function Av(Q){let X=Q.message;if(Q.path&&Q.path.length>0){let Y=kX(Q.path);X+=`
28
- at ${Y}`}return X}function kQ(Q){switch(Q._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return vQ(Q.ast.annotations);case"InvalidValue":case"Forbidden":return vQ(Q.annotations);case"MissingKey":return vQ(Q.annotations,"messageMissingKey");case"UnexpectedKey":return vQ(Q.ast.annotations,"messageUnexpectedKey");case"Filter":return vQ(Q.filter.annotations);case"Encoding":return kQ(Q.issue)}}function vQ(Q,X="message"){let Y=Q?.[X];if(typeof Y==="string")return Y}function sB(Q){if(I0(Q))return"no value provided";return v(Q.value)}function OY(Q){switch(Q._tag){case"MissingKey":return Q;case"Forbidden":return new o5(I4(Q.actual,G4),Q.annotations);case"Filter":return new zY(G4(Q.actual),Q.filter,OY(Q.issue));case"Pointer":return new A0(Q.path,OY(Q.issue));case"Encoding":case"InvalidType":case"InvalidValue":case"Composite":return new G0(I4(Q.actual,G4));case"AnyOf":case"OneOf":case"UnexpectedKey":return new G0(F(G4(Q.actual)))}}class K4 extends K6{run;constructor(Q){super();this.run=Q}map(Q){return new K4((X,Y)=>this.run(X,Y).pipe(x6(I4(Q))))}compose(Q){if($U(this))return Q;if($U(Q))return this;return new K4((X,Y)=>this.run(X,Y).pipe(_8((J)=>Q.run(J,Y))))}}function wv(Q){return new K4((X)=>y(Q(X)))}function _Z(Q){return wv((X)=>new o5(X,{message:Q(X)}))}var ZU=new K4(h);function $U(Q){return Q.run===ZU.run}function b1(){return ZU}function qZ(Q){return new K4((X,Y)=>I0(X)?x8:Q(X.value,Y))}function r(Q){return PY(I4(Q))}function j1(Q){return qZ((X,Y)=>Q(X,Y).pipe(x6(F)))}function PY(Q){return new K4((X)=>h(Q(X)))}function DZ(){return new K4(()=>x8)}function gQ(Q){return new K4((X)=>{let Y=z5(X,G1);return O1(Y)?h(Y):x6(Q,F)})}function g6(){return r(globalThis.String)}function RY(){return r(globalThis.Number)}function GU(){return r(globalThis.BigInt)}function KU(){return r((Q)=>new globalThis.Date(Q))}function WU(){return r(_D)}function HU(Q){return qZ((X)=>m4({try:()=>F(JSON.parse(X,Q?.reviver)),catch:(Y)=>new G0(F(X),{message:globalThis.String(Y)})}))}function VU(Q){return qZ((X)=>m4({try:()=>F(JSON.stringify(X,Q?.replacer,Q?.space)),catch:(Y)=>new G0(F(X),{message:globalThis.String(Y)})}))}function _U(Q){let X=Q?.separator??",";return r((Y)=>Y===""?[]:Y.split(X))}function BZ(){return r($Y)}function NY(){return r(MB)}function MY(){return r(wB)}function qU(){return j1((Q)=>X1(I$(c5(Q)),(X)=>new G0(F(Q),{message:X.message})))}function DU(){return j1((Q)=>o1(NB(Q),{onFailure:(X)=>y(new G0(F(Q),{message:X.message})),onSuccess:h}))}function BU(){return j1((Q)=>o1(o$(Q),{onFailure:(X)=>y(new G0(F(Q),{message:X.message})),onSuccess:h}))}function UU(){return j1((Q)=>o1(AB(Q),{onFailure:(X)=>y(new G0(F(Q),{message:X.message})),onSuccess:h}))}function OU(){return j1((Q)=>o1(n$(Q),{onFailure:(X)=>y(new G0(F(Q),{message:X.message})),onSuccess:h}))}function zU(){return j1((Q)=>o1(CB(Q),{onFailure:(X)=>y(new G0(F(Q),{message:X.message})),onSuccess:h}))}function FU(){return r(encodeURIComponent)}function LU(){return j1((Q)=>{try{return h(globalThis.decodeURIComponent(Q))}catch(X){return y(new G0(F(Q),{message:X instanceof URIError?X.message:"Invalid URI component"}))}})}function UZ(){return j1((Q)=>{return S1(QY(Q),{onNone:()=>y(new G0(F(Q),{message:"Invalid DateTime input"})),onSome:(X)=>h(XY(X))})})}function PU(){return r((Q)=>AU(Array.from(Q.entries())))}var Cv=wU((Q)=>typeof Q==="string"||typeof Blob<"u"&&Q instanceof Blob);function RU(){return r((Q)=>{let X=new FormData;if(typeof Q==="object"&&Q!==null)Cv(Q).forEach(([J,$])=>{X.append(J,$)});return X})}function NU(){return r((Q)=>AU(Array.from(Q.entries())))}var Tv=wU(X8);function MU(){return r((Q)=>{if(typeof Q==="object"&&Q!==null)return new URLSearchParams(Tv(Q));return new URLSearchParams})}var Iv=/^\d+$/;function jv(Q){if(Q==="")return[""];let X=Q.replace(/\[(.*?)\]/g,".$1"),Y=X.split("."),J=X.startsWith(".")?1:0;return Y.slice(J).map(($)=>Iv.test($)?globalThis.Number($):$)}function AU(Q){let X={};return Q.forEach(([Y,J])=>{let $=jv(Y),Z=X;$.forEach((G,K)=>{let W=K===$.length-1;if(Array.isArray(Z)&&G==="")if(W)Z.push(J);else{let H=$[K+1],_=typeof H==="number"||H==="",V=Z.length;if(Z[V]===void 0)Z[V]=_?[]:{};Z=Z[V]}else if(W)if(Array.isArray(Z[G]))Z[G].push(J);else if(Object.prototype.hasOwnProperty.call(Z,G))Z[G]=[Z[G],J];else Z[G]=J;else{let H=$[K+1],_=typeof H==="number"||H==="";if(Z[G]===void 0)Z[G]=_?[]:{};Z=Z[G]}})}),X}function wU(Q){return(X)=>{let Y=[];function J($,Z){if(Q(Z))Y.push([$,Z]);else if(Array.isArray(Z))if(Z.every(Q))Z.forEach((K)=>{Y.push([$,K])});else Z.forEach((K,W)=>{J(`${$}[${W}]`,K)});else if(typeof Z==="object"&&Z!==null)for(let[G,K]of Object.entries(Z))J(`${$}[${G}]`,K)}for(let[$,Z]of Object.entries(X))J($,Z);return Y}}class hQ{_tag="Middleware";decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new hQ(this.encode,this.decode)}}var zZ="~effect/SchemaTransformation/Transformation";class H0{[zZ]=zZ;_tag="Transformation";decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new H0(this.encode,this.decode)}compose(Q){return new H0(this.decode.compose(Q.decode),Q.encode.compose(this.encode))}}function Ev(Q){return N(Q,zZ)}var AY=(Q)=>{if(Ev(Q))return Q;return new H0(Q.decode,Q.encode)};function e1(Q){return new H0(j1(Q.decode),j1(Q.encode))}function j0(Q){return new H0(r(Q.decode),r(Q.encode))}function wY(Q){return new H0(PY(Q.decode),PY(Q.encode))}function CU(){return new H0(WU(),b1())}var Sv=new H0(b1(),b1());function h6(){return Sv}var n5=new H0(RY(),g6()),CY=new H0(GU(),g6()),FZ=new H0(KU(),r(H3)),TU=e1({decode:(Q)=>S1(LH(Q),{onNone:()=>y(new G0(F(Q),{message:`Invalid Duration string: ${Q}`})),onSome:h}),encode:(Q)=>h(globalThis.String(Q))}),IU=e1({decode:(Q)=>h(a8(Q)),encode:(Q)=>S1(PH(Q),{onNone:()=>y(new G0(F(Q),{message:`Unable to encode ${Q} into a bigint`})),onSome:(X)=>h(X)})}),jU=j0({decode:(Q)=>S4(Q),encode:(Q)=>x4(Q)}),xv=(Q)=>M1(Q)&&typeof Q.message==="string",EU=(Q)=>{let Y=Object.hasOwn(Q,"cause")?Error(Q.message,{cause:xU(Q.cause)}):Error(Q.message);if(typeof Q.name==="string"&&Q.name!=="Error")Y.name=Q.name;if(typeof Q.stack==="string")Y.stack=Q.stack;return Y},vv=(Q)=>{try{let X=V6(Q);return X===void 0?v(Q):JSON.parse(X)}catch{return v(Q)}},kv=(Q,X,Y)=>{let J={name:Q.name,message:typeof Q.message==="string"?Q.message:""};if(X?.includeStack&&typeof Q.stack==="string")J.stack=Q.stack;if(!X?.excludeCause&&Q.cause!==void 0)J.cause=Y(Q.cause);return J},SU=(Q)=>{let X=new WeakSet,Y=(J)=>{if(PW(J)){if(X.has(J))return"[Circular]";X.add(J);let $=kv(J,Q,Y);return X.delete(J),$}return vv(J)};return Y},xU=(Q)=>xv(Q)?EU(Q):Q,vU=(Q)=>j0({decode:EU,encode:(X)=>SU(Q)(X)}),kU=(Q)=>j0({decode:xU,encode:SU(Q)});function yU(){return j0({decode:tW,encode:L3})}function bU(){return j0({decode:sW,encode:U6})}function gU(Q){return j0({decode:aW,encode:Q?.onNoneEncoding===null?L3:U6})}function hU(){return wY({decode:F,encode:O5})}function mU(){return wY({decode:(Q)=>Q.pipe(z5(G1),F),encode:O5})}var LZ=e1({decode:(Q)=>m4({try:()=>new URL(Q),catch:()=>new G0(F(Q),{message:`Invalid URL string: ${Q}`})}),encode:(Q)=>h(Q.href)}),PZ=e1({decode:(Q)=>{let X=eD(Q);return I0(X)?y(new G0(F(Q),{message:`Invalid BigDecimal string: ${Q}`})):h(X.value)},encode:(Q)=>h(k8(Q))}),RZ=new H0(qU(),BZ()),dU=new H0(DU(),BZ()),pU=new H0(UU(),NY()),cU=new H0(zU(),MY()),fU=new H0(LU(),FU()),uU=new H0(HU(),VU()),lU=new H0(PU(),RU()),rU=new H0(NU(),MU()),oU=j0({decode:(Q)=>TQ(Q),encode:(Q)=>Q.offset}),NZ=e1({decode:(Q)=>{return S1(qB(Q),{onNone:()=>y(new G0(F(Q),{message:`Invalid IANA time zone: ${Q}`})),onSome:h})},encode:(Q)=>h(Q.id)}),MZ=e1({decode:(Q)=>{return S1(DB(Q),{onNone:()=>y(new G0(F(Q),{message:`Invalid time zone: ${Q}`})),onSome:h})},encode:(Q)=>h(p4(Q))}),AZ=e1({decode:(Q)=>{return S1(QY(Q),{onNone:()=>y(new G0(F(Q),{message:`Invalid UTC DateTime string: ${Q}`})),onSome:(X)=>h(XY(X))})},encode:(Q)=>h(OB(Q))}),wZ=e1({decode:(Q)=>{return S1(_B(Q),{onNone:()=>y(new G0(F(Q),{message:`Invalid Zoned DateTime string: ${Q}`})),onSome:h})},encode:(Q)=>h(YY(Q))});function d6(Q){return(X)=>X._tag===Q}function YO(Q){return N(Q,dQ)&&Q[dQ]===dQ}var b8=d6("Declaration");var yv=d6("Never");var TY=d6("Literal"),bv=d6("UniqueSymbol");var jY=d6("Arrays"),JO=d6("Objects"),EY=d6("Union");class B0{to;transformation;constructor(Q,X){this.to=Q,this.transformation=X}}var a5={};class W4{isOptional;isMutable;defaultValue;annotations;constructor(Q,X,Y=void 0,J=void 0){this.isOptional=Q,this.isMutable=X,this.defaultValue=Y,this.annotations=J}}var dQ="~effect/Schema";class k0{[dQ]=dQ;annotations;checks;encoding;context;constructor(Q=void 0,X=void 0,Y=void 0,J=void 0){this.annotations=Q,this.checks=X,this.encoding=Y,this.context=J}toString(){return`<${this._tag}>`}}class p6 extends k0{_tag="Declaration";typeParameters;run;constructor(Q,X,Y,J,$,Z){super(Y,J,$,Z);this.typeParameters=Q,this.run=X}getParser(){let Q=this.run(this.typeParameters);return(X,Y)=>{if(I0(X))return x8;return x6(Q(X.value,this,Y),F)}}recur(Q){let X=i5(this.typeParameters,Q);return X===this.typeParameters?this:new p6(X,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){let Q=this.annotations?.expected;if(typeof Q==="string")return Q;return"<Declaration>"}}class $O extends k0{_tag="Null";getParser(){return aQ(this,null)}getExpected(){return"null"}}var s5=new $O;class ZO extends k0{_tag="Undefined";getParser(){return aQ(this,void 0)}toCodecJson(){return D0(this,[GO])}getExpected(){return"undefined"}}var GO=new B0(s5,new H0(r(()=>{return}),r(()=>null))),TZ=new ZO;class KO extends k0{_tag="Void";getParser(){return aQ(this,void 0)}toCodecJson(){return D0(this,[GO])}getExpected(){return"void"}}var WO=new KO;class HO extends k0{_tag="Never";getParser(){return O8(this,LW)}getExpected(){return"never"}}var VO=new HO;class _O extends k0{_tag="Any";getParser(){return O8(this,t2)}getExpected(){return"any"}}var qO=new _O;class DO extends k0{_tag="Unknown";getParser(){return O8(this,t2)}getExpected(){return"unknown"}}var m6=new DO;class BO extends k0{_tag="ObjectKeyword";getParser(){return O8(this,e2)}getExpected(){return"object | array | function"}}var UO=new BO;class IZ extends k0{_tag="Enum";enums;constructor(Q,X,Y,J,$){super(X,Y,J,$);this.enums=Q}getParser(){let Q=new Set(this.enums.map(([,X])=>X));return O8(this,(X)=>Q.has(X))}toCodecStringTree(){if(this.enums.some(([Q,X])=>typeof X==="number")){let Q=Object.fromEntries(this.enums.map(([X,Y])=>[globalThis.String(Y),Y]));return D0(this,[new B0(new h1(Object.keys(Q).map((X)=>new g1(X)),"anyOf"),new H0(r((X)=>Q[X]),g6()))])}return this}getExpected(){return this.enums.map(([Q,X])=>JSON.stringify(X)).join(" | ")}}function OO(Q){switch(Q._tag){case"String":case"Number":case"BigInt":case"Literal":case"TemplateLiteral":return!0;case"Union":return Q.types.every(OO);default:return!1}}class jZ extends k0{_tag="TemplateLiteral";parts;encodedParts;constructor(Q,X,Y,J,$){super(X,Y,J,$);let Z=[];for(let G of Q){let K=Y1(G);if(OO(K))Z.push(K);else throw Error(`Invalid TemplateLiteral part ${K._tag}`)}this.parts=Q,this.encodedParts=Z}getParser(Q){let X=Q(this.asTemplateLiteralParser());return(Y,J)=>a0(X(Y,J),{onSuccess:()=>Y,onFailure:($)=>new q0(this,Y,[$])})}getExpected(){return"string"}asTemplateLiteralParser(){let Q=new H4(!1,this.parts.map(fO),[]),X=cY(this);return pY(c6,Q,new H0(j1((Y)=>{let J=X.exec(Y);if(J)return h(J.slice(1,this.parts.length+1));return y(new G0(F(Y),{message:`Expected a value matching ${X.source}, got ${v(Y)}`}))}),r((Y)=>Y.join(""))))}}class EZ extends k0{_tag="UniqueSymbol";symbol;constructor(Q,X,Y,J,$){super(X,Y,J,$);this.symbol=Q}getParser(){return aQ(this,this.symbol)}toCodecStringTree(){return D0(this,[rO])}getExpected(){return globalThis.String(this.symbol)}}class g1 extends k0{_tag="Literal";literal;constructor(Q,X,Y,J,$){super(X,Y,J,$);if(typeof Q==="number"&&!globalThis.Number.isFinite(Q))throw Error(`A numeric literal must be finite, got ${v(Q)}`);this.literal=Q}getParser(){return aQ(this,this.literal)}toCodecJson(){return typeof this.literal==="bigint"?iU(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:iU(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function iU(Q){let X=globalThis.String(Q.literal);return D0(Q,[new B0(new g1(X),new H0(r(()=>Q.literal),r(()=>X)))])}class zO extends k0{_tag="String";getParser(){return O8(this,X8)}getExpected(){return"string"}}var c6=new zO;class FO extends k0{_tag="Number";getParser(){return O8(this,A9)}toCodecJson(){if(this.checks&&(mQ(this.checks,"isFinite")||mQ(this.checks,"isInt")))return this;return D0(this,[uv])}toCodecStringTree(){if(this.checks&&(mQ(this.checks,"isFinite")||mQ(this.checks,"isInt")))return D0(this,[nv]);return D0(this,[iv])}getExpected(){return"number"}}function mQ(Q,X){return Q.some((Y)=>{switch(Y._tag){case"Filter":return Y.annotations?.meta?._tag===X;case"FilterGroup":return mQ(Y.checks,X)}})}var SZ=new FO;class LO extends k0{_tag="Boolean";getParser(){return O8(this,OW)}getExpected(){return"boolean"}}var PO=new LO;class RO extends k0{_tag="Symbol";getParser(){return O8(this,s2)}toCodecStringTree(){return D0(this,[rO])}getExpected(){return"symbol"}}var NO=new RO;class MO extends k0{_tag="BigInt";getParser(){return O8(this,zW)}toCodecStringTree(){return D0(this,[av])}getExpected(){return"bigint"}}var AO=new MO;class H4 extends k0{_tag="Arrays";isMutable;elements;rest;constructor(Q,X,Y,J,$,Z,G){super(J,$,Z,G);this.isMutable=Q,this.elements=X,this.rest=Y;let K=X.findIndex(E0);if(K!==-1&&(X.slice(K+1).some((W)=>!E0(W))||Y.length>1))throw Error("A required element cannot follow an optional element. ts(1257)");if(Y.length>1&&Y.slice(1).some(E0))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(Q){let X=this,Y=X.elements.map((H)=>({ast:H,parser:Q(H)})),J=X.rest.map((H)=>({ast:H,parser:Q(H)})),$=Y.length,[Z,...G]=J,K=G.length;function W(H,_){if(_<$)return Y[_];else if(_>=H)return G[_-H];return Z}return AQ(function*(H,_){if(H._tag==="None")return H;let V=H.value;if(!Array.isArray(V))return yield*y(new v0(X,H));let q=V.length,D={ast:X,getParser:W,oinput:H,len:q,tailThreshold:hv(q,$,K),output:new globalThis.Array(q),issues:void 0,options:_},U=xZ(_?.concurrency),P=gv(D,V,{concurrency:U?.concurrency,end:X.rest.length===0?$:Math.max(q,$+K)});if(P)yield*P;if(X.rest.length===0&&q>$)for(let L=$;L<=q-1;L++){let M=new A0([L],new FY(X,V[L]));if(_.errors==="all")if(D.issues)D.issues.push(M);else D.issues=[M];else return yield*y(new q0(X,H,[M]))}if(D.issues)return yield*y(new q0(X,H,D.issues));return F(D.output)})}recur(Q){let X=i5(this.elements,Q),Y=i5(this.rest,Q);return X===this.elements&&Y===this.rest?this:new H4(this.isMutable,X,Y,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}var gv=$Q()({onItem(Q,X,Y){let J=Y<Q.len?F(X):b();return Q.getParser(Q.tailThreshold,Y).parser(J,Q.options)},step(Q,X,Y,J){if(Y._tag==="Failure")return IY(Q,Q.ast,J,Y);else if(Y.value._tag==="Some")Q.output[J]=Y.value.value;else{let $=Q.getParser(Q.tailThreshold,J);if(E0($.ast))return;let Z=new A0([J],new yQ($.ast.context?.annotations));if(Q.options.errors==="all")if(Q.issues)Q.issues.push(Z);else Q.issues=[Z];else return k5(new q0(Q.ast,Q.oinput,[Z]))}}});function hv(Q,X,Y){return Math.max(X,Q-Y)}var xZ=(Q)=>{return Q=Q==="unbounded"?1/0:Q??1,Q>1?{concurrency:Q}:void 0},IY=(Q,X,Y,J)=>{let $=E8(J.cause);if(u($))return J;let Z=new A0([Y],$.success);if(Q.options.errors==="all")if(Q.issues)Q.issues.push(Z);else Q.issues=[Z];else return k5(new q0(X,Q.oinput,[Z]))},cQ="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",mv=new globalThis.RegExp(`(?:${cQ}|Infinity|-Infinity|NaN)`);function f6(Q,X){let Y=Y1(X);switch(Y._tag){case"String":return Object.keys(Q);case"TemplateLiteral":{let J=cY(Y);return Object.keys(Q).filter(($)=>J.test($))}case"Symbol":return Object.getOwnPropertySymbols(Q);case"Number":return Object.keys(Q).filter((J)=>mv.test(J));case"Union":return[...new Set(Y.types.flatMap((J)=>f6(Q,J)))];default:return[]}}class SY{name;type;constructor(Q,X){this.name=Q,this.type=X}}class xY{decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new xY(this.encode,this.decode)}}class vZ{parameter;type;merge;constructor(Q,X,Y){if(this.parameter=Q,this.type=X,this.merge=Y,E0(X)&&!hO(X))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class fQ extends k0{_tag="Objects";propertySignatures;indexSignatures;constructor(Q,X,Y,J,$,Z){super(Y,J,$,Z);this.propertySignatures=Q,this.indexSignatures=X;let G=Q.map((K)=>K.name).filter((K,W,H)=>H.indexOf(K)!==W);if(G.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(G)}. ts(2300)`)}getParser(Q){let X=this,Y=[],J=new Set,$=[];for(let K of X.propertySignatures)Y.push(K.name),J.add(K.name),$.push({ps:K,parser:Q(K.type),name:K.name,type:K.type});let Z=X.indexSignatures.length;if(X.propertySignatures.length===0&&X.indexSignatures.length===0)return O8(X,CX);let G=Z>0?$Q()({onItem:AQ(function*(K,[W,H]){let V=Q(cO(H.parameter))(F(W),K.options),q=V1(V)?V:yield*NQ(V);if(q._tag==="Failure"){let M=IY(K,X,W,q);if(M)yield*M;return}let D=F(K.input[W]),P=Q(H.type)(D,K.options),L=V1(P)?P:yield*NQ(P);if(L._tag==="Failure"){let M=IY(K,X,W,L);if(M)yield*M;return}else if(q.value._tag==="Some"&&L.value._tag==="Some"){let M=q.value.value,w=L.value.value;if(H.merge&&H.merge.decode&&Object.hasOwn(K.out,M)){let[R,i]=H.merge.decode.combine([M,K.out[M]],[M,w]);l5(K.out,R,i)}else l5(K.out,M,w)}}),step:(K,W,H)=>H._tag==="Failure"?H:void 0}):void 0;return AQ(function*(K,W){if(K._tag==="None")return K;let H=K.value;if(!(typeof H==="object"&&H!==null&&!Array.isArray(H)))return yield*y(new v0(X,K));let _={},V={ast:X,oinput:K,input:H,out:_,issues:void 0,options:W},q=W.errors==="all",D=W.onExcessProperty==="error",U=W.onExcessProperty==="preserve",P;if(X.indexSignatures.length===0&&(D||U)){P=Reflect.ownKeys(H);for(let w=0;w<P.length;w++){let R=P[w];if(!J.has(R))if(D){let i=new A0([R],new FY(X,H[R]));if(q){if(V.issues)V.issues.push(i);else V.issues=[i];continue}else return yield*y(new q0(X,K,[i]))}else l5(_,R,H[R])}}let L=xZ(W?.concurrency),M=dv(V,$,L);if(M)yield*M;if(G){let w=T3();for(let i=0;i<Z;i++){let $1=X.indexSignatures[i],$5=f6(H,$1.parameter);for(let D1=0;D1<$5.length;D1++){let uA=$5[D1];w.push([uA,$1])}}let R=G(V,w,L);if(R)yield*R}if(V.issues)return yield*y(new q0(X,K,V.issues));if(W.propertyOrder==="original"){let w=(P??Reflect.ownKeys(H)).concat(Y),R={};for(let i of w)if(Object.hasOwn(_,i))l5(R,i,_[i]);return F(R)}return F(_)})}rebuild(Q,X){let Y=i5(this.propertySignatures,($)=>{let Z=Q($.type);return Z===$.type?$:new SY($.name,Z)}),J=i5(this.indexSignatures,($)=>{let Z=Q($.parameter),G=Q($.type),K=X?$.merge?.flip():$.merge;return Z===$.parameter&&G===$.type&&K===$.merge?$:new vZ(Z,G,K)});return Y===this.propertySignatures&&J===this.indexSignatures?this:new fQ(Y,J,this.annotations,this.checks,void 0,this.context)}flip(Q){return this.rebuild(Q,!0)}recur(Q){return this.rebuild(Q,!1)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}}var dv=$Q()({onItem(Q,X){let Y=Object.hasOwn(Q.input,X.name)?F(Q.input[X.name]):b();return X.parser(Y,Q.options)},step(Q,X,Y){if(Y._tag==="Failure")return IY(Q,Q.ast,X.name,Y);else if(Y.value._tag==="Some")l5(Q.out,X.name,Y.value.value);else if(!E0(X.type)){let J=new A0([X.name],new yQ(X.type.context?.annotations));if(Q.options.errors==="all"){if(Q.issues)Q.issues.push(J);else Q.issues=[J];return}else return k5(new q0(Q.ast,Q.oinput,[J]))}}});function pv(Q,X){if(!Q)return X.checks;if(!X.checks)return Q;return[...Q,...X.checks]}function vY(Q,X,Y){return new fQ(Reflect.ownKeys(Q).map((J)=>{return new SY(J,Q[J].ast)}),[],Y,X)}function uQ(Q){return Q.ast}function kZ(Q,X=void 0){return new H4(!1,Q.map((Y)=>Y.ast),[],void 0,X)}function kY(Q,X,Y){return new h1(Q.map(uQ),X,void 0,Y)}function wO(Q,X){if(Q.encoding||X.some((Z)=>Z.encoding))throw Error("StructWithRest does not support encodings");let{propertySignatures:Y,indexSignatures:J,checks:$}=Q;for(let Z of X)Y=Y.concat(Z.propertySignatures),J=J.concat(Z.indexSignatures),$=pv($,Z);return new fQ(Y,J,void 0,$)}function CO(Q,X){if(Q.encoding)throw Error("TupleWithRest does not support encodings");return new H4(Q.isMutable,Q.elements,X,void 0,Q.checks)}function TO(Q){switch(Q._tag){case"Null":return["null"];case"Undefined":case"Void":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 Q.propertySignatures.length||Q.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(Q.enums.map(([,X])=>typeof X)));case"Literal":return[typeof Q.literal];case"Union":return Array.from(new Set(Q.types.flatMap(TO)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function lQ(Q){switch(Q._tag){default:return[];case"Declaration":{let X=Q.annotations?.["~sentinels"];return Array.isArray(X)?X:[]}case"Objects":return Q.propertySignatures.flatMap((X)=>{let Y=X.type;if(!E0(Y)){if(TY(Y))return[{key:X.name,literal:Y.literal}];if(bv(Y))return[{key:X.name,literal:Y.symbol}]}return[]});case"Arrays":return Q.elements.flatMap((X,Y)=>{return TY(X)&&!E0(X)?[{key:Y,literal:X.literal}]:[]});case"Suspend":return lQ(Q.thunk())}}var aU=new WeakMap;function cv(Q){let X=aU.get(Q);if(X)return X;X={};for(let Y of Q){let J=Y1(Y);if(yv(J))continue;let $=TO(J),Z=lQ(J);X.byType??={};for(let G of $)(X.byType[G]??=[]).push(Y);if(Z.length>0){X.bySentinel??=new Map;for(let{key:G,literal:K}of Z){let W=X.bySentinel.get(G);if(!W)X.bySentinel.set(G,W=new Map);let H=W.get(K);if(!H)W.set(K,H=[]);H.push(Y)}}else{X.otherwise??={};for(let G of $)(X.otherwise[G]??=[]).push(Y)}}return aU.set(Q,X),X}function sU(Q){return(X)=>{let Y=Y1(X);return Y._tag==="Literal"?Y.literal===Q:Y._tag==="UniqueSymbol"?Y.symbol===Q:!0}}function rQ(Q,X){let Y=cv(X),J=Q===null?"null":Array.isArray(Q)?"array":typeof Q;if(Y.bySentinel){let $=Y.otherwise?.[J]??[];if(J==="object"||J==="array"){for(let[Z,G]of Y.bySentinel)if(Object.hasOwn(Q,Z)){let K=G.get(Q[Z]);if(K)return[...K,...$].filter(sU(Q))}}return $}return(Y.byType?.[J]??[]).filter(sU(Q))}class h1 extends k0{_tag="Union";types;mode;constructor(Q,X,Y,J,$,Z){super(Y,J,$,Z);this.types=Q,this.mode=X}getParser(Q){let X=this;return(Y,J)=>{if(Y._tag==="None")return h(Y);let $=Y.value,Z=rQ($,X.types),G={ast:X,recur:Q,oinput:Y,input:$,out:void 0,successes:[],issues:void 0,options:J},K=xZ(J?.concurrency),W=fv(G,Z,K);if(!W)return G.out?h(G.out):y(new LY(X,$,G.issues??[]));return RQ(W,(H)=>{return G.out?h(G.out):y(new LY(X,$,G.issues??[]))})}}recur(Q){let X=i5(this.types,Q);return X===this.types?this:new h1(X,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(Q){let X=this.annotations?.expected;if(typeof X==="string")return X;if(this.types.length===0)return"never";let Y=this.types.map((J)=>{let $=Y1(J);switch($._tag){case"Arrays":{let Z=$.elements.filter(TY);if(Z.length>0)return`${tU($.isMutable)}[ ${Z.map((G)=>Q(G)+eU(G.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let Z=$.propertySignatures.filter((G)=>TY(G.type));if(Z.length>0)return`{ ${Z.map((G)=>`${tU(G.type.context?.isMutable)}${R4(G.name)}${eU(G.type.context?.isOptional)}: ${Q(G.type)}`).join(", ")}, ... }`;break}}return Q($)});return Array.from(new Set(Y)).join(" | ")}}var fv=$Q()({onItem(Q,X){return Q.recur(X)(Q.oinput,Q.options)},step(Q,X,Y){if(Y._tag==="Failure"){let J=E8(Y.cause);if(u(J))return Y;if(Q.issues)Q.issues.push(J.success);else Q.issues=[J.success]}else{if(Q.out&&Q.ast.mode==="oneOf")return Q.successes.push(X),k5(new VZ(Q.ast,Q.input,Q.successes));if(Q.out=Y.value,Q.successes.push(X),Q.ast.mode==="anyOf")return sJ}}}),IO=new h1([new g1("Infinity"),new g1("-Infinity"),new g1("NaN")],"anyOf"),uv=new B0(new h1([SZ,IO],"anyOf"),new H0(RY(),r((Q)=>globalThis.Number.isFinite(Q)?Q:globalThis.String(Q))));function tU(Q){return Q?"":"readonly "}function eU(Q){return Q?"?":""}function u6(Q){let X=!1,Y;return()=>{if(X)return Y;return Y=Q(),X=!0,Y}}class yY extends k0{_tag="Suspend";thunk;constructor(Q,X,Y,J,$){super(X,Y,J,$);this.thunk=u6(Q)}getParser(Q){return Q(this.thunk())}recur(Q){return new yY(()=>Q(this.thunk()),this.annotations,this.checks,void 0,this.context)}getExpected(Q){return Q(this.thunk())}}class pQ extends K6{_tag="Filter";run;annotations;aborted;constructor(Q,X=void 0,Y=!1){super();this.run=Q,this.annotations=X,this.aborted=Y}annotate(Q){return new pQ(this.run,{...this.annotations,...Q},this.aborted)}abort(){return new pQ(this.run,this.annotations,!0)}and(Q,X){return new u4([this,Q],X)}}class u4 extends K6{_tag="FilterGroup";checks;annotations;constructor(Q,X=void 0){super();this.checks=Q,this.annotations=X}annotate(Q){return new u4(this.checks,{...this.annotations,...Q})}and(Q,X){return new u4([this,Q],X)}}function yZ(Q,X,Y=!1){return new pQ((J,$,Z)=>eB(J,$,Q(J,$,Z)),X,Y)}function bY(Q,X){return new pQ((Y)=>Q(Y)?void 0:new G0(F(Y)),X,!0)}function oQ(Q,X){let Y=Q.source;return yZ((J)=>Q.test(J),{expected:`a string matching the RegExp ${Y}`,meta:{_tag:"isPattern",regExp:Q},toArbitraryConstraint:{string:{patterns:[Q.source]}},...X})}function gY(Q,X){let Y=Object.getOwnPropertyDescriptors(Q);return X(Y),Object.create(Object.getPrototypeOf(Q),Y)}function D0(Q,X){if(Q.encoding===X)return Q;return gY(Q,(Y)=>{Y.encoding.value=X})}function hY(Q,X){if(Q.context===X)return Q;return gY(Q,(Y)=>{Y.context.value=X})}function nQ(Q){return Q.encoding?nQ(Q.encoding[Q.encoding.length-1].to):Q}function l6(Q,X){if(Q.checks){let Y=Q.checks[Q.checks.length-1];return mY(Q,tX(Q.checks.slice(0,-1),Y.annotate(X)))}return gY(Q,(Y)=>{Y.annotations.value={...Y.annotations.value,...X}})}function mY(Q,X){if(Q.checks===X)return Q;return gY(Q,(Y)=>{Y.checks.value=X})}function l4(Q,X){return mY(Q,Q.checks?[...Q.checks,...X]:X)}function jO(Q,X){let Y=Q,J=Y[Y.length-1],$=X(J.to);if($!==J.to)return tX(Q.slice(0,Q.length-1),new B0($,J.transformation));return Q}function EO(Q){return(X)=>X.encoding?D0(X,jO(X.encoding,Q)):X}function SO(Q,X){return bZ(Q,X,U8(Q))}function xO(Q,X){return bZ(Y1(Q),X,Q)}function bZ(Q,X,Y){let J=new B0(Q,X);return D0(Y,Y.encoding?[...Y.encoding,J]:[J])}function vO(Q,X){let Y=uB(Q),J=Y?[...Y,X]:[X];return l6(Q,{brands:J})}function i5(Q,X){let Y=!1,J=Array(Q.length);for(let $=0;$<Q.length;$++){let Z=Q[$],G=X(Z);if(G!==Z)Y=!0;J[$]=G}return Y?J:Q}function iQ(Q,X){let Y=Q.context?new W4(Q.context.isOptional,Q.context.isMutable,Q.context.defaultValue,{...Q.context.annotations,...X}):new W4(!1,!1,void 0,X);return hY(Q,Y)}var t5=EO(dY);function dY(Q){let X=Q.context?Q.context.isOptional===!1?new W4(!0,Q.context.isMutable,Q.context.defaultValue,Q.context.annotations):Q.context:new W4(!0,!1);return t5(hY(Q,X))}var lv=EO(gZ);function gZ(Q){let X=Q.context?Q.context.isMutable===!1?new W4(Q.context.isOptional,!0,Q.context.defaultValue,Q.context.annotations):Q.context:new W4(!1,!0);return lv(hY(Q,X))}function kO(Q,X){let Y=new H0(gQ(X),b1()),J=[new B0(m6,Y)],$=Q.context?new W4(Q.context.isOptional,Q.context.isMutable,J,Q.context.annotations):new W4(!1,!1,J);return hY(Q,$)}function pY(Q,X,Y){return bZ(Q,Y,X)}function yO(Q){switch(Q._tag){case"Literal":return{literals:wX(Q.literal)?[Q.literal]:[],parameters:[]};case"UniqueSymbol":return{literals:[Q.symbol],parameters:[]};case"String":case"Number":case"Symbol":case"TemplateLiteral":return{literals:[],parameters:[Q]};case"Union":{let X={literals:[],parameters:[]};for(let Y=0;Y<Q.types.length;Y++){let J=yO(Q.types[Y]);X.literals=X.literals.concat(J.literals),X.parameters=X.parameters.concat(J.parameters)}return X}}return{literals:[],parameters:[]}}function bO(Q,X,Y){let{literals:J,parameters:$}=yO(Q);return new fQ(J.map((Z)=>new SY(Z,X)),$.map((Z)=>new vZ(Z,X,Y)))}function E0(Q){return Q.context?.isOptional??!1}function gO(Q){return Q.context?.isMutable??!1}var U8=p0((Q)=>{if(Q.encoding)return U8(D0(Q,void 0));let X=Q;return X.recur?.(U8)??X}),Y1=p0((Q)=>{return U8(B8(Q))});function rv(Q,X){let Y=X,J=Y.length,$=Y[J-1],Z=[new B0(B8(D0(Q,void 0)),Y[0].transformation.flip())];for(let K=1;K<J;K++)Z.unshift(new B0(B8(Y[K-1].to),Y[K].transformation.flip()));let G=B8($.to);if(G.encoding)return D0(G,[...G.encoding,...Z]);else return D0(G,Z)}var B8=p0((Q)=>{if(Q.encoding)return rv(Q,Q.encoding);let X=Q;return X.flip?.(B8)??X.recur?.(B8)??X});function hO(Q){switch(Q._tag){case"Undefined":return!0;case"Union":return Q.types.some(hO);default:return!1}}function mO(Q,X){return Q.encodedParts.map((Y)=>ov(Y,dO(Y),X)).join("")}var cY=p0((Q)=>{return new globalThis.RegExp(`^${mO(Q,!0)}$`)});function dO(Q){switch(Q._tag){case"Literal":return UY(globalThis.String(Q.literal));case"String":return hZ;case"Number":return cQ;case"BigInt":return lO;case"TemplateLiteral":return mO(Q,!1);case"Union":return Q.types.map(dO).join("|")}}function ov(Q,X,Y){if(EY(Q)){if(!Y)return`(?:${X})`}else if(!Y)return X;return`(${X})`}function aQ(Q,X){let Y=o7(X);return(J)=>{if(J._tag==="None")return x8;return J.value===X?Y:y(new v0(Q,J))}}function O8(Q,X){return(Y)=>{if(Y._tag==="None")return x8;return X(Y.value)?h(Y):y(new v0(Q,Y))}}var pO=p0((Q)=>{return new h1(Q.enums.map((X)=>new g1(X[1],{title:X[0]})),"anyOf")});function r6(Q){function X(Y){return Y.encoding?D0(Y,jO(Y.encoding,X)):Q(Y)}return p0(X)}var cO=r6((Q)=>{switch(Q._tag){default:return Q;case"Number":return Q.toCodecStringTree();case"Union":return Q.recur(cO)}}),fO=r6((Q)=>{switch(Q._tag){default:return Q;case"String":case"TemplateLiteral":return Q;case"BigInt":case"Number":case"Literal":return Q.toCodecStringTree();case"Union":return Q.recur(fO)}}),hZ="[\\s\\S]*?",QO=new globalThis.RegExp(`^${cQ}$`);function mZ(Q){return oQ(QO,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:QO},...Q})}var uO=l4(c6,[mZ()]),nv=new B0(uO,n5),iv=new B0(new h1([uO,IO],"anyOf"),n5),lO="-?\\d+",XO=new globalThis.RegExp(`^${lO}$`);function dZ(Q){return oQ(XO,{expected:"a string representing a bigint",meta:{_tag:"isStringBigInt",regExp:XO},...Q})}var pZ=l4(c6,[dZ({expected:"a string representing a bigint"})]),av=new B0(pZ,CY),sv="Symbol\\((.*)\\)",CZ=new globalThis.RegExp(`^${sv}$`),tv=l4(c6,[cZ()]),rO=new B0(tv,new H0(r((Q)=>globalThis.Symbol.for(CZ.exec(Q)[1])),j1((Q)=>{if(globalThis.Symbol.keyFor(Q)!==void 0)return h(globalThis.String(Q));return y(new o5(F(Q),{message:"cannot serialize to string, Symbol is not registered"}))})));function cZ(Q){return oQ(CZ,{expected:"a string representing a symbol",meta:{_tag:"isStringSymbol",regExp:CZ},...Q})}function sQ(Q,X,Y,J,$){for(let Z=0;Z<Q.length;Z++){let G=Q[Z];if(G._tag==="FilterGroup")sQ(G.checks,X,Y,J,$);else{let K=G.run(X,J,$);if(K){if(Y.push(new zY(X,G,K)),G.aborted||$?.errors!=="all")return}}}}function oO(Q,X){let Y=[];if(sQ(Q,X,Y,m6,{errors:"all"}),K8(Y)){let J=new q0(m6,F(X),Y);return f(J)}return l(X)}var e5="~effect/Schema/Class",m1="~structural";function ev(Q){let X=new Set,Y=new Set;return J(Q);function J($){if($===null||typeof $==="string"||typeof $==="boolean")return!0;if(typeof $==="number")return globalThis.Number.isFinite($);if(typeof $!=="object"||$===void 0)return!1;if(X.has($))return!1;if(Y.has($))return!0;X.add($);let Z=Array.isArray($)?$.every(J):Object.keys($).every((G)=>J($[G]));if(X.delete($),Z)Y.add($);return Z}}var fY=new p6([],()=>(Q,X)=>ev(Q)?h(Q):y(new v0(X,F(Q))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new B0(m6,h6()),toArbitrary:()=>(Q)=>Q.jsonValue()}),nO=l6(fY,{typeConstructor:{_tag:"effect/MutableJson"},generation:{runtime:"Schema.MutableJson",Type:"Schema.MutableJson"}}),iO=new B0(s5,new H0(b1(),r(()=>null))),aO=new B0(fY,h6());function Qk(Q){let X=new Set;return Y(Q);function Y(J){if(J===void 0||typeof J==="string")return!0;if(typeof J!=="object"||J===null)return!1;if(X.has(J))return!1;if(X.add(J),Array.isArray(J))return J.every(Y);return Object.keys(J).every(($)=>Y(J[$]))}}var Xk=new p6([],()=>(Q,X)=>Qk(Q)?h(Q):y(new v0(X,F(Q))),{expected:"StringTree",toCodecStringTree:()=>new B0(m6,h6())}),sO=new B0(Xk,h6());var tO=B(2,(Q,X)=>{return uZ(Q,(Y,J)=>X.includes(Y)?[Y,J]:void 0)}),eO=B(2,(Q,X)=>{return uZ(Q,(Y,J)=>!X.includes(Y)?[Y,J]:void 0)}),Qz=B(2,(Q,X)=>{return{...Q,...X}});var fZ=B(2,(Q,X)=>{return uZ(Q,(Y,J)=>[Object.hasOwn(X,Y)?X[Y]:Y,J])});var _1=(Q)=>Q;function uZ(Q,X){let Y={};for(let J in Q){let $=X(J,Q[J]);if($){let[Z,G]=$;Y[Z]=G}}return Y}function Xz(Q,X){let Y=X?.omitKeyWhen??(()=>!1);return yW((J,$)=>{let Z=Reflect.ownKeys(Q),G={};for(let K of Z){let W=Q[K].combine(J[K],$[K]);if(Y(W))continue;G[K]=W}return G})}function tQ(Q){return o8((X,Y)=>{if(X===void 0)return Y;if(Y===void 0)return X;return Q.combine(X,Y)},void 0)}function uY(Q,X){if(X.length>0)Q+=`
29
- at ${kX(X)}`;return Error(Q)}var Yz=new WeakMap;function Jz(Q,X,Y){return X.map((J)=>($)=>J.run($,Q,a5)===void 0).reduce((J,$)=>J.filter($),Y)}function Jk(Q){return Q?.comparator!==void 0}function $z(Q,X,Y){let J=X.constraints?.array,$=Jk(J)?Q.uniqueArray(Y,J):Q.array(Y,J);if(X.isSuspend)return Q.oneof({maxDepth:2,depthIdentifier:""},Q.constant([]),$);return $}var Zz=tQ(HD),Gz=tQ(VD),r4=tQ(lB),$k=tQ(UH()),Zk=Xz({isInteger:r4,max:Gz,maxExcluded:r4,maxLength:Gz,min:Zz,minExcluded:r4,minLength:Zz,noDefaultInfinity:r4,noInteger:r4,noInvalidDate:r4,noNaN:r4,patterns:$k,comparator:r4},{omitKeyWhen:FW});function Gk(Q,X,Y){let J=X[Q];return{...X,[Q]:J?Zk.combine(J,Y):Y}}var Kk={string:null,number:null,bigint:null,array:null,date:null};function Wk(Q){return Q in Kk}function Kz(Q){let X=Q.map((Y)=>Y.annotations?.toArbitraryConstraint).filter(G1);return(Y)=>{let J=X.reduce(($,Z)=>{let G=Object.keys(Z);for(let K of G)if(Wk(K))$=Gk(K,$,Z[K]);return $},Y.constraints||{});return{...Y,constraints:J}}}function rZ(Q){return{...Q,constraints:void 0}}function Hk(Q){let X={};if(Q.min!==void 0)X.min=Q.minExcluded?Math.floor(Q.min)+1:Math.ceil(Q.min);if(Q.max!==void 0)X.max=Q.maxExcluded?Math.ceil(Q.max)-1:Math.floor(Q.max);return X}function oZ(Q){if(Q)return Q.flatMap((X)=>{switch(X._tag){case"Filter":return[X];case"FilterGroup":return oZ(X.checks)}});return[]}var Wz=p0((Q)=>{return z8(Q,[])});function z8(Q,X){let Y=D8(Q)?.toArbitrary;if(Y){let J=b8(Q)?Q.typeParameters.map((G)=>z8(G,X)):[],$=oZ(Q.checks),Z=Kz($);return(G,K)=>Jz(Q,$,Y(J.map((W)=>W(G,rZ(K))))(G,Z(K)))}if(Q.checks){let J=oZ(Q.checks),$=Kz(J),Z=z8(mY(Q,void 0),X);return(G,K)=>Jz(Q,J,Z(G,$(K)))}return Vk(Q,X)}function Vk(Q,X){switch(Q._tag){case"Never":case"Declaration":throw uY(`Unsupported AST ${Q._tag}`,X);case"Null":return(Y)=>Y.constant(null);case"Void":case"Undefined":return(Y)=>Y.constant(void 0);case"Unknown":case"Any":return(Y)=>Y.anything();case"String":return(Y,J)=>{let $=J.constraints?.string,Z=$?.patterns;if(Z)return Y.oneof(...Z.map((G)=>Y.stringMatching(new RegExp(G))));return Y.string($)};case"Number":return(Y,J)=>{let $=J.constraints?.number;if($?.isInteger)return Y.integer(Hk($));return Y.float($)};case"Boolean":return(Y)=>Y.boolean();case"BigInt":return(Y,J)=>Y.bigInt(J.constraints?.bigint??{});case"Symbol":return(Y)=>Y.string().map(Symbol.for);case"Literal":return(Y)=>Y.constant(Q.literal);case"UniqueSymbol":return(Y)=>Y.constant(Q.symbol);case"ObjectKeyword":return(Y)=>Y.oneof(Y.object(),Y.array(Y.anything()));case"Enum":return z8(pO(Q),X);case"TemplateLiteral":return(Y)=>Y.stringMatching(cY(Q));case"Arrays":return(Y,J)=>{let $=rZ(J),Z=Q.elements.map((K,W)=>{let H=z8(K,[...X,W])(Y,$);if(!E0(K))return H.map(F);return H.chain((_)=>Y.boolean().map((V)=>V?F(_):b()))}),G=Y.tuple(...Z).map(BH);if(L6(Q.rest)){let K=Q.elements.length,[W,...H]=Q.rest.map((V,q)=>z8(V,[...X,K+q])(Y,$)),_=$z(Y,Q.elements.length===0?J:$,W);if(G=G.chain((V)=>{if(V.length<K)return Y.constant(V);return _.map((q)=>[...V,...q])}),H.length>0){let V=Y.tuple(...H);G=G.chain((q)=>{if(q.length<K)return Y.constant(q);return V.map((D)=>[...q,...D])})}}return G};case"Objects":return(Y,J)=>{let $=rZ(J),Z={},G=[];for(let W of Q.propertySignatures){let H=W.name;if(!E0(W.type))G.push(H);Z[H]=z8(W.type,[...X,H])(Y,$)}let K=Y.record(Z,{requiredKeys:G});for(let W of Q.indexSignatures){let H=Y.tuple(z8(W.parameter,X)(Y,$),z8(W.type,X)(Y,$)),_=$z(Y,Q.propertySignatures.length===0?J:$,H);K=K.chain((V)=>{return _.map((q)=>{return{...Object.fromEntries(q),...V}})})}return K};case"Union":return(Y,J)=>Y.oneof(...Q.types.map(($)=>z8($,X)(Y,J)));case"Suspend":{let Y=Yz.get(Q);if(Y)return Y;let J=u6(()=>z8(Q.thunk(),X)),$=(Z,G)=>Z.constant(null).chain(()=>J()(Z,{...G,isSuspend:!0}));return Yz.set(Q,$),$}}}var eQ=p0((Q)=>{switch(Q._tag){case"Declaration":{let X=Q.annotations?.[e5];if(Y8(X)){let Y=X(Q.typeParameters),J=eQ(Y.to);return D0(Q,J===Y.to?[Y]:[new B0(J,Y.transformation)])}return Q}case"Objects":case"Arrays":return Q.recur((X)=>{let Y=X.context?.defaultValue;if(Y)return D0(eQ(X),Y);return eQ(X)});case"Suspend":return Q.recur(eQ);default:return Q}});function rY(Q){let X=eQ(U8(Q.ast)),Y=X9(X);return(J,$)=>{return Y(J,$?.disableChecks?$?.parseOptions?{...$.parseOptions,disableChecks:!0}:{disableChecks:!0}:$?.parseOptions)}}function oY(Q){let X=rY(Q);return(Y,J)=>{return h7(i7(X(Y,J)))}}function Hz(Q){let X=rY(Q);return(Y,J)=>{return d4(X1(X(Y,J),($)=>Error($.toString(),{cause:$})))}}function Vz(Q){return QX(Q.ast)}function QX(Q){let X=Y9(X9(U8(Q)));return(Y)=>{return H8(X(Y,a5))}}function _z(Q){let X=X9(Q);return(Y,J)=>{return d4(S$(X(Y,J),{onSuccess:()=>{return},onFailure:g}))}}function qz(Q,X){let J=Y9(X9(U8(Q.ast)))(X,a5);if(tJ(J)){let $=E8(J.cause);if(u($))throw j6($.failure);throw Error($.success.toString(),{cause:$.success})}}function h0(Q,X){let Y=X9(Q.ast);return X===void 0?Y:(J,$)=>Y(J,Lz(X,$))}var nZ=h0;function Dz(Q,X){return Y9(h0(Q,X))}function Bz(Q,X){return Pz(h0(Q,X))}function Uz(Q,X){return Rz(h0(Q,X))}function qk(Q,X){return Nz(h0(Q,X))}var iZ=qk;function Q9(Q,X){let Y=X9(B8(Q.ast));return X===void 0?Y:(J,$)=>Y(J,Lz(X,$))}function Oz(Q,X){return Y9(Q9(Q,X))}function zz(Q,X){return Pz(Q9(Q,X))}function Fz(Q,X){return Rz(Q9(Q,X))}function Dk(Q,X){return Nz(Q9(Q,X))}var aZ=Dk,Lz=(Q,X)=>X===void 0?Q:{...Q,...X};function X9(Q){let X=lY(Q);return(Y,J)=>_8(X(F(Y),J??a5),($)=>{if($._tag==="None")return y(new G0($));return h($.value)})}function Y9(Q){return(X,Y)=>i7(Q(X,Y))}function Pz(Q){let X=Y9(Q);return(Y,J)=>h7(X(Y,J))}function Rz(Q){let X=Y9(Q);return(Y,J)=>{let $=X(Y,J);if(H8($))return l($.value);let Z=E8($.cause);if(u(Z))throw j6(Z.failure);return f(Z.success)}}function Nz(Q){return(X,Y)=>d4(X1(Q(X,Y),(J)=>Error(J.toString(),{cause:J})))}var lY=p0((Q)=>{let X,Y=D8(Q)?.parseOptions;if(!Q.context&&!Q.encoding&&!Q.checks)return($,Z)=>{if(X??=Q.getParser(lY),Y)Z={...Z,...Y};return X($,Z)};let J=jY(Q)||JO(Q)||b8(Q)&&Q.typeParameters.length>0;return($,Z)=>{if(Y)Z={...Z,...Y};let G=Q.encoding,K;if(G){let H=G,_=H.length;for(let V=_-1;V>=0;V--){let q=H[V],D=q.to,U=lY(D);if(K=K?_8(K,(P)=>U(P,Z)):U($,Z),q.transformation._tag==="Transformation"){let P=q.transformation.decode;K=_8(K,(L)=>P.run(L,Z))}else K=q.transformation.decode(K,Z)}K=X1(K,(V)=>new HZ(Q,$,V))}X??=Q.getParser(lY);let W=K?_8(K,(H)=>X(H,Z)):X($,Z);if(Q.checks&&!Z?.disableChecks){let H=Q.checks;if(Z?.errors==="all"&&J&&O1($))W=d5(W,(_)=>{let V=[];sQ(H.filter((D)=>D.annotations?.[m1]),$.value,V,Q,Z);let q=K8(V)?_._tag==="Composite"&&_.ast===Q?new q0(Q,_.actual,[..._.issues,...V]):new q0(Q,$,[_,...V]):_;return y(q)});W=_8(W,(_)=>{if(O1(_)){let V=_.value,q=[];if(sQ(H,V,q,Q,Z),K8(q))return y(new q0(Q,_,q))}return h(_)})}return W}});var Mz=p0((Q)=>{return o4(Q,[])});function o4(Q,X){let Y=D8(Q)?.toEquivalence;if(Y)return Y(b8(Q)?Q.typeParameters.map((J)=>o4(J,X)):[]);switch(Q._tag){case"Never":throw uY(`Unsupported AST ${Q._tag}`,X);case"Declaration":case"Null":case"Undefined":case"Void":case"Unknown":case"Any":case"String":case"Number":case"Boolean":case"BigInt":case"Symbol":case"Literal":case"UniqueSymbol":case"ObjectKeyword":case"Enum":case"TemplateLiteral":return n;case"Arrays":{let J=Q.elements.map((G,K)=>o4(G,[...X,K])),$=Q.elements.length,Z=Q.rest.map((G,K)=>o4(G,[...X,$+K]));return i0((G,K)=>{if(!Array.isArray(G)||!Array.isArray(K))return!1;let W=G.length;if(W!==K.length)return!1;let H=0;for(;H<Math.min(W,Q.elements.length);H++)if(!J[H](G[H],K[H]))return!1;if(Z.length>0){let[_,...V]=Z;for(;H<W-V.length;H++)if(!_(G[H],K[H]))return!1;for(let q=0;q<V.length;q++)if(H+=q,!V[q](G[H],K[H]))return!1}return!0})}case"Objects":{if(Q.propertySignatures.length===0&&Q.indexSignatures.length===0)return n;let J=Q.propertySignatures.map((Z)=>o4(Z.type,[...X,Z.name])),$=Q.indexSignatures.map((Z)=>o4(Z.type,X));return i0((Z,G)=>{if(!M1(Z)||!M1(G))return!1;for(let K=0;K<J.length;K++){let W=Q.propertySignatures[K],H=W.name,_=Object.hasOwn(Z,H),V=Object.hasOwn(G,H);if(E0(W.type)){if(_!==V)return!1}if(_&&V&&!J[K](Z[H],G[H]))return!1}for(let K=0;K<$.length;K++){let W=Q.indexSignatures[K],H=f6(Z,W.parameter),_=f6(G,W.parameter);if(H.length!==_.length)return!1;for(let V=0;V<H.length;V++){let q=H[V];if(!Object.hasOwn(G,q)||!$[K](Z[q],G[q]))return!1}}return!0})}case"Union":return i0((J,$)=>{let Z=rQ(J,Q.types),G=Z.map(QX);for(let K=0;K<Z.length;K++){let W=G[K];if(W(J)&&W($))return o4(Z[K],X)(J,$)}return!1});case"Suspend":{let J=u6(()=>o4(Q.thunk(),X));return i0(($,Z)=>J()($,Z))}}}function nY(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}function Az(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}var iY="~effect/Schema/Schema",Uk={[iY]:iY,pipe(){return X0(this,arguments)},annotate(Q){return this.rebuild(l6(this.ast,Q))},annotateKey(Q){return this.rebuild(iQ(this.ast,Q))},check(...Q){return this.rebuild(l4(this.ast,Q))}};function n6(Q,X){let Y=Object.create(Uk);if(X)Object.assign(Y,X);return Y.ast=Q,Y.rebuild=(J)=>n6(J,X),Y.makeEffect=UW(rY(Y),X1((J)=>new g8(J))),Y.make=Hz(Y),Y.makeOption=oY(Y),Y}var aY="~effect/Schema/SchemaError";class g8{[aY]=aY;_tag="SchemaError";name="SchemaError";issue;constructor(Q){this.issue=Q}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}var sY=tZ(Ok);function Ok(Q){switch(Q._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function tZ(Q){return(X)=>{let Y=new Map;for(let Z=0;Z<X.length;Z++)Y.set(Y1(X[Z]),Z);let J=[...X].sort((Z,G)=>{Z=Y1(Z),G=Y1(G);let K=Q(Z),W=Q(G);if(K!==W)return K-W;return Y.get(Z)-Y.get(G)});if(!J.some((Z,G)=>Z!==X[G]))return X;return J}}function Cz(Q){let{references:X,representations:Y}=zk([Q]);return{representation:Y[0],references:X}}function zk(Q){let X={},Y=new Map,J=new Set,$=new Set;return{representations:E4(Q,(V)=>K(V)),references:X};function G(V){let q=V,D=0;while(J.has(q))q=`${V}${++D}`;return J.add(q),q}function K(V,q){let D=Y.get(V);if(D!==void 0)return{_tag:"Reference",$ref:D};let U=nQ(V),P=u5(V)??q;if(V!==U)return K(U,P);if(P!==void 0){let w=G(P);Y.set(V,w);let R=H(V),i=X[P];if(i!==void 0&&n(R,i))return Y.set(V,P),{_tag:"Reference",$ref:P};return X[w]=R,{_tag:"Reference",$ref:w}}if($.has(V)){let w=G(`${V._tag}_`);return Y.set(V,w),{_tag:"Reference",$ref:w}}$.add(V);let L=H(V);$.delete(V);let M=Y.get(V);if(M!==void 0)return X[M]=L,{_tag:"Reference",$ref:M};return L}function W(V){let q=V.annotations?.toCodecJson??V.annotations?.toCodec;if(Y8(q)){let D=V.typeParameters.map((P)=>n6(Y1(P))),U=q(D);return D0(V,[U])}return s5}function H(V){let q=XX(V.annotations);switch(V._tag){case"Declaration":{let D=K(W(V));return{_tag:"Declaration",typeParameters:V.typeParameters.map((U)=>K(U)),encodedSchema:D,checks:_(V.checks),...q}}case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"Boolean":case"Symbol":return{_tag:V._tag,...q};case"String":{let D=V.annotations?.contentMediaType,U=V.annotations?.contentSchema;return{_tag:V._tag,checks:_(V.checks),...q,...typeof D==="string"&&YO(U)?{contentSchema:K(U)}:void 0}}case"Number":case"BigInt":return{_tag:V._tag,checks:_(V.checks),...q};case"Literal":return{_tag:V._tag,literal:V.literal,...q};case"UniqueSymbol":return{_tag:V._tag,symbol:V.symbol,...q};case"ObjectKeyword":return{_tag:V._tag,...q};case"Enum":return{_tag:V._tag,enums:V.enums,...q};case"TemplateLiteral":return{_tag:V._tag,parts:V.parts.map((D)=>K(D)),...q};case"Arrays":return{_tag:V._tag,elements:V.elements.map((D)=>{let U=nQ(D);return{isOptional:E0(U),type:K(D),...XX(U.context?.annotations)}}),rest:V.rest.map((D)=>K(D)),checks:_(V.checks),...q};case"Objects":return{_tag:V._tag,propertySignatures:V.propertySignatures.map((D)=>{let U=nQ(D.type);return{name:D.name,type:K(D.type),isOptional:E0(U),isMutable:gO(U),...XX(U.context?.annotations)}}),indexSignatures:V.indexSignatures.map((D)=>({parameter:K(D.parameter),type:K(D.type)})),checks:_(V.checks),...q};case"Union":{let D=sY(V.types);return{_tag:V._tag,types:D.map((U)=>K(U)),mode:V.mode,...q}}case"Suspend":return{_tag:"Suspend",checks:[],thunk:K(V.thunk()),...q}}}function _(V){if(!V)return[];return V.map(q).filter((D)=>D!==void 0);function q(D){switch(D._tag){case"Filter":{let U=D.annotations?.meta;if(U)return{_tag:"Filter",meta:U._tag==="isPropertyNames"?{_tag:"isPropertyNames",propertyNames:K(U.propertyNames)}:U,...XX(D.annotations)};return}case"FilterGroup":{let U=_(D.checks);if(K8(U))return{_tag:"FilterGroup",checks:U,...XX(D.annotations)}}}}}}var Fk=new Set(["~structural","~sentinels","meta","toArbitrary","toArbitraryConstraint","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecIso",e5]),Lk=new Set(["title","description","default","examples","readOnly","writeOnly","format","contentEncoding","contentMediaType","contentSchema"]);function XX(Q){if(Q!==void 0){let X=_H(Q,(Y,J)=>!Fk.has(J));if(!M3(X))return{annotations:X}}return}function Tz(Q,X){let{definitions:Y,dialect:J,schemas:$}=Pk({representations:[Q.representation],references:Q.references},X),Z=$[0];return{dialect:J,schema:Z,definitions:Y}}function Pk(Q,X){let Y=X?.generateDescriptions??!1,J=X?.additionalProperties??!1,$=X?.includeAnnotationKey,Z=L5(Q.references,(D)=>G(D));return{dialect:"draft-2020-12",schemas:E4(Q.representations,(D)=>G(D)),definitions:Z};function G(D){let U=K(D);if("annotations"in D){let P=H(D.annotations);if(P)U={...U,...P}}if("checks"in D){let P=_(D.checks,U.type);for(let L of P)U=eZ(U,L)}return U}function K(D){switch(D._tag){case"Any":case"Unknown":case"ObjectKeyword":return{};case"Void":case"Undefined":return{type:"null"};case"BigInt":return{type:"string",allOf:[{pattern:"^-?\\d+$"}]};case"Symbol":case"UniqueSymbol":return{type:"string",allOf:[{pattern:"^Symbol\\((.*)\\)$"}]};case"Declaration":return G(D.encodedSchema);case"Suspend":return G(D.thunk);case"Reference":return{$ref:`#/$defs/${nY(D.$ref)}`};case"Null":return{type:"null"};case"Never":return{not:{}};case"String":{let U={type:"string"};if(D.contentMediaType!==void 0)U.contentMediaType=D.contentMediaType;if(D.contentSchema!==void 0)U.contentSchema=G(D.contentSchema);return U}case"Number":return QG(D.checks,"isInt")?{type:"integer"}:QG(D.checks,"isFinite")?{type:"number"}:{anyOf:[{type:"number"},{type:"string",enum:["NaN"]},{type:"string",enum:["Infinity"]},{type:"string",enum:["-Infinity"]}]};case"Boolean":return{type:"boolean"};case"Literal":{let U=D.literal;if(typeof U==="string")return{type:"string",enum:[U]};if(typeof U==="number")return{type:"number",enum:[U]};if(typeof U==="boolean")return{type:"boolean",enum:[U]};return{type:"string",enum:[String(U)]}}case"Enum":return G({_tag:"Union",types:D.enums.map(([U,P])=>({_tag:"Literal",literal:P,annotations:{title:U}})),mode:"anyOf",annotations:D.annotations});case"TemplateLiteral":return{type:"string",pattern:`^${D.parts.map(tY).join("")}$`};case"Arrays":{if(D.rest.length>1)throw new globalThis.Error("Generating a JSON Schema for post-rest elements is not supported");let U={type:"array"},P=D.elements.length,L=D.elements.map((M)=>{if(M.isOptional)P--;let w=G(M.type),R=H(M.annotations);return R?eZ(w,R):w});if(L.length>0){if(U.prefixItems=L,U.maxItems=D.elements.length,P>0)U.minItems=P}else U.items=!1;if(D.rest.length>0){delete U.maxItems;let M=G(D.rest[0]);if(Object.keys(M).length>0)U.items=M;else delete U.items}return U}case"Objects":{if(D.propertySignatures.length===0&&D.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let U={type:"object"},P={},L=[];for(let w of D.propertySignatures){let R=w.name;if(typeof R!=="string")throw new globalThis.Error(`Unsupported property signature name: ${v(R)}`);let i=G(w.type),$1=H(w.annotations);if(P[R]=$1?eZ(i,$1):i,!w.isOptional)L.push(R)}if(Object.keys(P).length>0)U.properties=P;if(L.length>0)U.required=L;U.additionalProperties=J;let M={};for(let w of D.indexSignatures){let R=G(w.type);if(Object.keys(R).length===1&&"not"in R)R=!1;let i=q(w.parameter);if(i.length>0)for(let $1 of i)M[$1]=R;else U.additionalProperties=R}if(Object.keys(M).length>0)U.patternProperties=M,delete U.additionalProperties;if(M1(U.additionalProperties)&&M3(U.additionalProperties))delete U.additionalProperties;return U}case"Union":{let U=D.types.map(G);if(U.length===0)return{not:{}};if(U.length>1){let P=W(U);if(P)return P}return D.mode==="anyOf"?{anyOf:U}:{oneOf:U}}}}function W(D){let U,P=[];for(let L of D){if(Object.keys(L).length!==2||L.type===void 0||!Array.isArray(L.enum)||L.enum.length===0)return;if(U===void 0)U=L.type;else if(L.type!==U)return;for(let w of L.enum)P.push(w)}return{type:U,enum:P}}function H(D){if(D===void 0)return;let U={};if(typeof D.title==="string")U.title=D.title;if(typeof D.description==="string")U.description=D.description;else if(Y&&typeof D.expected==="string")U.description=D.expected;if(D.default!==void 0)U.default=D.default;if(Array.isArray(D.examples))U.examples=D.examples;if(typeof D.readOnly==="boolean")U.readOnly=D.readOnly;if(typeof D.writeOnly==="boolean")U.writeOnly=D.writeOnly;if(typeof D.format==="string")U.format=D.format;if(typeof D.contentEncoding==="string")U.contentEncoding=D.contentEncoding;if(typeof D.contentMediaType==="string")U.contentMediaType=D.contentMediaType;if($)for(let[P,L]of Object.entries(D)){if(L===void 0)continue;if(Lk.has(P))continue;if(!$(P))continue;U[P]=L}if(Object.keys(U).length>0)return U}function _(D,U){return D.map(P).filter((L)=>L!==void 0);function P(L){switch(L._tag){case"Filter":return V(L,U);case"FilterGroup":{let M=L.checks.map(P).filter((i)=>i!==void 0);if(M.length===0)return;let w={allOf:M},R=H(L.annotations);if(R)w={...w,...R};return w}}}}function V(D,U){let P=D.meta;if(!P)return;let L=w(P),M=H(D.annotations);if(M)L={...L,...M};return L;function w(R){switch(R._tag){case"isMinLength":return U==="array"?{minItems:R.minLength}:{minLength:R.minLength};case"isMaxLength":return U==="array"?{maxItems:R.maxLength}:{maxLength:R.maxLength};case"isLengthBetween":return U==="array"?{allOf:[{minItems:R.minimum},{maxItems:R.maximum}]}:{allOf:[{minLength:R.minimum},{maxLength:R.maximum}]};case"isPattern":case"isGUID":case"isULID":case"isBase64":case"isBase64Url":case"isStartsWith":case"isEndsWith":case"isIncludes":case"isUppercased":case"isLowercased":case"isCapitalized":case"isUncapitalized":case"isTrimmed":case"isStringFinite":case"isStringBigInt":case"isStringSymbol":return{pattern:R.regExp.source};case"isUUID":return{pattern:R.regExp.source,format:"uuid"};case"isFinite":case"isInt":return;case"isMultipleOf":return{multipleOf:R.divisor};case"isGreaterThanOrEqualTo":return{minimum:R.minimum};case"isLessThanOrEqualTo":return{maximum:R.maximum};case"isGreaterThan":return{exclusiveMinimum:R.exclusiveMinimum};case"isLessThan":return{exclusiveMaximum:R.exclusiveMaximum};case"isBetween":return{[R.exclusiveMinimum?"exclusiveMinimum":"minimum"]:R.minimum,[R.exclusiveMaximum?"exclusiveMaximum":"maximum"]:R.maximum};case"isUnique":return{uniqueItems:!0};case"isMinProperties":return{minProperties:R.minProperties};case"isMaxProperties":return{maxProperties:R.maxProperties};case"isPropertiesLengthBetween":return{minProperties:R.minimum,maxProperties:R.maximum};case"isPropertyNames":return{propertyNames:G(R.propertyNames)};case"isDateValid":return{format:"date-time"}}}}function q(D){switch(D._tag){default:throw new globalThis.Error(`Unsupported index signature parameter: ${D._tag}`);case"Reference":return q(Q.references[D.$ref]);case"String":return Rk(D);case"TemplateLiteral":return[`^${D.parts.map(tY).join("")}$`];case"Union":return D.types.flatMap(q)}}}function Rk(Q){return X(Q.checks);function X(Y){return Y.flatMap((J)=>{switch(J._tag){case"Filter":{if("regExp"in J.meta)return[J.meta.regExp.source];return[]}case"FilterGroup":return X(J.checks)}})}}function QG(Q,X){return Q.some((Y)=>{switch(Y._tag){case"Filter":return Y.meta._tag===X;case"FilterGroup":return QG(Y.checks,X)}})}function eZ(Q,X){if(Object.keys(Q).length===0)return X;let Y=Object.keys(X).length;if(Y===0)return Q;let J=Array.isArray(X.allOf)&&Y===1?X.allOf:[X];if(Array.isArray(Q.allOf))return{...Q,allOf:[...Q.allOf,...J]};if(typeof Q.$ref==="string")return{allOf:[Q,...J]};return{...Q,allOf:J}}function tY(Q){switch(Q._tag){case"Literal":return UY(globalThis.String(Q.literal));case"String":return hZ;case"Number":return cQ;case"TemplateLiteral":return Q.parts.map(tY).join("");case"Union":return Q.types.map(tY).join("|");default:throw new globalThis.Error("Unsupported part",{cause:Q})}}function eY(Q,X){if(Object.is(Q,X))return[];let Y=[];if(Array.isArray(Q)&&Array.isArray(X)){let J=Q.length,$=X.length,Z=Math.min(J,$);for(let G=0;G<Z;G++){let K=`/${G}`,W=eY(Q[G],X[G]);for(let H of W)Iz(H,K),Y.push(H)}for(let G=J-1;G>=$;G--)Y.push({op:"remove",path:`/${G}`});for(let G=J;G<$;G++)Y.push({op:"add",path:`/${G}`,value:X[G]});return Y}if(Q2(Q)&&Q2(X)){let J=Object.keys(Q),$=Object.keys(X),Z=Array.from(new Set([...J,...$])).sort();for(let G of Z){let W=`/${nY(G)}`,H=Object.hasOwn(Q,G),_=Object.hasOwn(X,G);if(H&&_){let V=eY(Q[G],X[G]);for(let q of V)Iz(q,W),Y.push(q)}else if(!H&&_)Y.push({op:"add",path:W,value:X[G]});else if(H&&!_)Y.push({op:"remove",path:W})}return Y}return Y.push({op:"replace",path:"",value:X}),Y}function Ez(Q,X){let Y=X;for(let J of Q)switch(J.op){case"replace":{Y=J.path===""?J.value:jz(Y,J.path,J.value,"replace");break}case"add":{Y=Ak(Y,J.path,J.value);break}case"remove":{Y=jz(Y,J.path,void 0,"remove");break}}return Y}function Iz(Q,X){Q.path=Q.path===""?X:X+Q.path}function Q2(Q){return M1(Q)}function Mk(Q){if(Q==="")return[];if(Q.charCodeAt(0)!==47)throw Error(`Invalid JSON Pointer, it must start with "/": ${v(Q)}`);return Q.split("/").slice(1).map(Az)}function XG(Q){if(!/^(0|[1-9]\d*)$/.test(Q))throw Error(`Invalid array index: "${Q}"`);return Number(Q)}function Ak(Q,X,Y){if(X==="")return Y;let J=Sz(Q,X);if(J===null)throw Error(`Cannot add at "${X}" (parent not found or not a container).`);let{lastToken:$,parent:Z,stack:G}=J;if(Array.isArray(Z)){let K=$==="-"?Z.length:XG($);if(K<0||K>Z.length)throw Error(`Array index out of bounds at "${X}".`);let W=Z.slice();return W.splice(K,0,Y),X2(G,W)}if(Q2(Z)){let K={...Z};return K[$]=Y,X2(G,K)}throw Error(`Cannot add at "${X}" (parent not found or not a container).`)}function jz(Q,X,Y,J){if(X===""){if(J==="remove"||Y===void 0)throw Error("Unsupported operation at the root");return Y}let $=Sz(Q,X);if($===null)throw Error(`Cannot ${J} at "${X}" (parent not found or not a container).`);let{lastToken:Z,parent:G,stack:K}=$;if(Array.isArray(G)){if(Z==="-")throw Error(`"-" is not valid for ${J} at "${X}".`);let W=XG(Z);if(W<0||W>=G.length)throw Error(`Array index out of bounds at "${X}".`);let H=G.slice();if(J==="remove")H.splice(W,1);else H[W]=Y;return X2(K,H)}if(Q2(G)){if(!Object.hasOwn(G,Z))throw Error(`Property "${Z}" does not exist at "${X}".`);let W={...G};if(J==="remove")delete W[Z];else W[Z]=Y;return X2(K,W)}throw Error(`Cannot ${J} at "${X}" (parent not found or not a container).`)}function Sz(Q,X){let Y=Mk(X);if(Y.length===0)return null;let J=Y[Y.length-1],$=[],Z=Q;for(let G=0;G<Y.length-1;G++){let K=Y[G];if(Z==null)return null;if(Array.isArray(Z)){let W=XG(K);if(W<0||W>=Z.length)return null;$.push({container:Z,token:W}),Z=Z[W];continue}if(Z&&typeof Z==="object"){if(!Object.hasOwn(Z,K))return null;$.push({container:Z,token:K}),Z=Z[K];continue}return null}return{stack:$,parent:Z,lastToken:J}}function X2(Q,X){let Y=X;for(let J=Q.length-1;J>=0;J--){let{container:$,token:Z}=Q[J];if(Array.isArray($)){let G=$.slice();G[Z]=Y,Y=G}else{let G={...$};G[Z]=Y,Y=G}}return Y}var Ck=/^#\/\$defs(?=\/|$)/;function vz(Q){return{dialect:"draft-07",schema:xz(Q.schema),definitions:L5(Q.definitions,xz)}}function xz(Q){return X(Q);function X(J){return Y(YG(J,($)=>$.replace(Ck,"#/definitions")),!0)}function Y(J,$){if(Array.isArray(J))return J.map((H)=>Y(H,!1));if(!M1(J))return J;let Z=J,G={},K=void 0,W=void 0;for(let H of Object.keys(Z)){let _=Z[H];switch(H){case"$ref":case"type":case"required":case"enum":case"const":case"title":case"description":case"default":case"examples":case"format":case"pattern":case"minimum":case"maximum":case"exclusiveMinimum":case"exclusiveMaximum":case"minLength":case"maxLength":case"minItems":case"maxItems":case"minProperties":case"maxProperties":case"multipleOf":case"uniqueItems":G[H]=_;break;case"properties":case"patternProperties":{let V=Tk(_,Y);G[H]=V??_;break}case"additionalProperties":case"propertyNames":G[H]=Y(_,!1);break;case"allOf":case"anyOf":case"oneOf":G[H]=Array.isArray(_)?_.map((V)=>Y(V,!1)):_;break;case"prefixItems":K=_;break;case"items":W=_;break;default:break}}if(K!==void 0)if(Array.isArray(K)){if(G.items=K.map((H)=>Y(H,!1)),W!==void 0)G.additionalItems=Y(W,!1)}else G.items=Y(K,!1);else if(W!==void 0)G.items=Y(W,!1);return G}}function YG(Q,X){if(Array.isArray(Q))return Q.map((J)=>YG(J,X));if(!M1(Q))return Q;let Y={};for(let J of Object.keys(Q)){let $=Q[J];if(J==="$ref")Y[J]=typeof $==="string"?X($):$;else if(Array.isArray($)||M1($))Y[J]=YG($,X);else Y[J]=$}return Y}function Tk(Q,X){if(!M1(Q))return;let Y={};for(let J of Object.keys(Q))Y[J]=X(Q[J],!1);return Y}function yz(Q,X){return F8(new mz(Q,X))}function kz(Q,X){return F8(new $G(Q,X))}class bz{_tag="IdentityNode"}var gz=new bz;class hz{_tag="CompositionNode";nodes;constructor(Q){this.nodes=Q}}class mz{_tag="IsoNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class $G{_tag="LensNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class dz{_tag="PrismNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class ZG{_tag="OptionalNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class GG{_tag="PathNode";path;constructor(Q){this.path=Q}}class J2{_tag="CheckNode";checks;constructor(Q){this.checks=Q}}function jk(Q,X){let Y=Q[Q.length-1];if(Y){if(Y._tag==="PathNode"&&X._tag==="PathNode"){Q[Q.length-1]=new GG([...Y.path,...X.path]);return}if(Y._tag==="CheckNode"&&X._tag==="CheckNode"){Q[Q.length-1]=new J2([...Y.checks,...X.checks]);return}}Q.push(X)}function JG(Q,X){if(Q._tag==="IdentityNode")return;if(Q._tag==="CompositionNode"){for(let Y=0;Y<Q.nodes.length;Y++)JG(Q.nodes[Y],X);return}jk(X,Q)}function i6(Q,X){let Y=[];switch(JG(Q,Y),JG(X,Y),Y.length){case 0:return gz;case 1:return Y[0];default:return new hz(Y)}}function Ek(Q,X){return F8(new ZG(Q,X))}class YX{node;getResult;replaceResult;constructor(Q,X,Y){this.node=Q,this.getResult=X,this.replaceResult=Y}replace(Q,X){return v9(this.replaceResult(Q,X),()=>X)}modify(Q){return(X)=>v9(sX(this.getResult(X),(Y)=>this.replaceResult(Q(Y),X)),()=>X)}compose(Q){return F8(i6(this.node,Q.node))}key(Q){return F8(i6(this.node,new GG([Q])))}optionalKey(Q){return F8(i6(this.node,new $G((X)=>X[Q],(X,Y)=>{let J=$2(Y);if(X===void 0)if(Array.isArray(J)&&typeof Q==="number")J.splice(Q,1);else delete J[Q];else J[Q]=X;return J})))}check(...Q){return F8(i6(this.node,new J2(Q)))}refine(Q,X){return F8(i6(this.node,new J2([bY(Q,X)])))}tag(Q){return F8(i6(this.node,new dz((X)=>X._tag===Q?l(X):f(`Expected ${v(Q)} tag, got ${v(X._tag)}`),g)))}at(Q,...X){let Y=f(`Key ${v(Q)} not found`);return F8(i6(this.node,new ZG((J)=>Object.hasOwn(J,Q)?l(J[Q]):Y,(J,$)=>{if(Object.hasOwn($,Q)){let Z=$2($);return Z[Q]=J,l(Z)}else return Y})))}pick(Q){return this.compose(kz(tO(Q),(X,Y)=>({...Y,...X})))}omit(Q){return this.compose(kz(eO(Q),(X,Y)=>({...Y,...X})))}notUndefined(){return this.refine(G1,{expected:"a value other than `undefined`"})}forEach(Q){let X=Q(Z2());return Ek((Y)=>F6(this.getResult(Y),(J)=>{let $=[];for(let Z=0;Z<J.length;Z++){let G=X.getResult(J[Z]);if(C1(G))$.push(G.success)}return $}),(Y,J)=>sX(this.getResult(J),($)=>{let Z=[];for(let K=0;K<$.length;K++)if(C1(X.getResult($[K])))Z.push(K);if(Y.length!==Z.length)return f(`each: replacement length mismatch: ${Y.length} !== ${Z.length}`);let G=$.slice();for(let K=0;K<Z.length;K++){let W=Z[K],H=X.replaceResult(Y[K],$[W]);if(u(H))return f(`each: could not set element ${W}`);G[W]=H.success}return this.replaceResult(G,J)}))}modifyAll(Q){return(X)=>v9(sX(this.getResult(X),(Y)=>this.replaceResult(Y.map(Q),X)),()=>X)}}class pz extends YX{get;set;constructor(Q,X,Y){super(Q,(J)=>l(X(J)),(J)=>l(Y(J)));this.get=X,this.set=Y}replace(Q,X){return this.set(Q)}modify(Q){return(X)=>this.set(Q(this.get(X)))}}class cz extends YX{get;constructor(Q,X,Y){super(Q,(J)=>l(X(J)),(J,$)=>l(Y(J,$)));this.get=X,this.replace=Y}modify(Q){return(X)=>this.replace(Q(this.get(X)),X)}}class fz extends YX{set;constructor(Q,X,Y){super(Q,X,(J,$)=>l(Y(J)));this.set=Y}replace(Q,X){return this.set(Q)}modify(Q){return(X)=>v9(F6(this.getResult(X),(Y)=>this.set(Q(Y))),()=>X)}}function F8(Q){let X=uz(Q);switch(X._tag){case"IsoNode":return new pz(Q,X.get,X.set);case"LensNode":return new cz(Q,X.get,X.set);case"PrismNode":return new fz(Q,X.get,X.set);case"OptionalNode":return new YX(Q,X.get,X.set)}}function $2(Q){if(Array.isArray(Q))return Q.slice();if(typeof Q==="object"&&Q!==null){let X=Object.getPrototypeOf(Q);if(X!==Object.prototype&&X!==null)throw Error("Cannot clone object with non-Object constructor or null prototype");return{...Q}}return Q}var uz=p0((Q)=>{switch(Q._tag){case"IdentityNode":return{_tag:"IsoNode",get:g,set:g};case"IsoNode":case"LensNode":case"PrismNode":case"OptionalNode":return{_tag:Q._tag,get:Q.get,set:Q.set};case"PathNode":return{_tag:"LensNode",get:(X)=>{let Y=Q.path,J=X;for(let $=0,Z=Y.length;$<Z;$++)J=J[Y[$]];return J},set:(X,Y)=>{let J=Q.path,$=$2(Y),Z=$,G=0;for(;G<J.length-1;G++){let W=J[G];Z[W]=$2(Z[W]),Z=Z[W]}let K=J[G];return Z[K]=X,$}};case"CheckNode":return{_tag:"PrismNode",get:(X)=>F5(oO(Q.checks,X),String),set:g};case"CompositionNode":{let X=Q.nodes.map(uz),Y=X.reduce((J,$)=>Sk(J,$._tag),"IsoNode");return{_tag:Y,get:(J)=>{for(let $=0;$<X.length;$++){let Z=X[$],G=Z.get(J);if(Y2(Z._tag)){if(u(G))return G;J=G.success}else J=G}return Y2(Y)?l(J):J},set:(J,$)=>{let Z=$,G=X.length,K=Array(G+1);K[0]=$;for(let W=0;W<G;W++){let H=X[W];if(Y2(H._tag)){let _=H.get($);if(u(_))return Y==="OptionalNode"?_:Z;$=_.success}else $=H.get($);K[W+1]=$}for(let W=G-1;W>=0;W--){let H=X[W];if(lz(H._tag))J=H.set(J);else if(H._tag==="LensNode")J=H.set(J,K[W]);else{let _=H.set(J,K[W]);if(u(_))return _;J=_.success}}return Y==="OptionalNode"?l(J):J}}}}});function Y2(Q){return Q==="PrismNode"||Q==="OptionalNode"}function lz(Q){return Q==="IsoNode"||Q==="PrismNode"}function Sk(Q,X){switch(Q){case"IsoNode":return X;case"LensNode":return Y2(X)?"OptionalNode":"LensNode";case"PrismNode":return lz(X)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var xk=F8(gz);function Z2(){return xk}var xK={};G6(xK,{webUrl:()=>mc,webSegment:()=>xR,webQueryParameters:()=>kR,webPath:()=>vR,webFragments:()=>SR,webAuthority:()=>jR,uuid:()=>Cc,uniqueArray:()=>e6,ulid:()=>Lc,uint8ClampedArray:()=>LR,uint8Array:()=>FR,uint32Array:()=>zR,uint16Array:()=>OR,tuple:()=>Q0,toStringMethod:()=>R8,subarray:()=>Vc,stringify:()=>b0,stringMatching:()=>Rf,string:()=>d0,stream:()=>t4,statistics:()=>Ug,sparseArray:()=>PR,shuffledSubarray:()=>_c,set:()=>RR,schedulerFor:()=>ec,scheduler:()=>tc,scheduledModelRun:()=>ac,sample:()=>Dg,resetConfigureGlobal:()=>zb,record:()=>QK,readConfigureGlobal:()=>P8,property:()=>Pb,pre:()=>rk,option:()=>B4,oneof:()=>l0,object:()=>lp,noShrink:()=>T2,noBias:()=>w2,nat:()=>a4,modelRun:()=>nc,mixedCase:()=>Mp,memo:()=>zp,maxSafeNat:()=>Bd,maxSafeInteger:()=>GR,mapToConstant:()=>q9,map:()=>XK,lorem:()=>Dp,limitShrink:()=>If,letrec:()=>HR,jsonValue:()=>wR,json:()=>ap,ipV6:()=>WR,ipV4Extended:()=>KR,ipV4:()=>TK,integer:()=>O0,int8Array:()=>UR,int32Array:()=>BR,int16Array:()=>DR,infiniteStream:()=>ep,hash:()=>C2,hasToStringMethod:()=>VK,hasCloneMethod:()=>s6,hasAsyncToStringMethod:()=>_K,getDepthContextFor:()=>UK,gen:()=>Pg,func:()=>Vd,float64Array:()=>qR,float32Array:()=>_R,float:()=>JR,falsy:()=>og,entityGraph:()=>Zp,emailAddress:()=>Lm,double:()=>j2,domain:()=>MK,dictionary:()=>LK,defaultReportMessage:()=>IP,date:()=>mP,createDepthIdentifier:()=>OK,context:()=>ig,constantFrom:()=>m8,constant:()=>y0,configureGlobal:()=>Ob,compareFunc:()=>Kd,compareBooleanFunc:()=>Zd,commands:()=>fc,cloneMethod:()=>r0,cloneIfNeeded:()=>K9,clone:()=>Gh,check:()=>SP,chainUntil:()=>Xh,boolean:()=>BX,bigUint64Array:()=>Xf,bigInt64Array:()=>Qf,bigInt:()=>e4,base64String:()=>Gc,asyncToStringMethod:()=>D4,asyncStringify:()=>qK,asyncProperty:()=>Lb,asyncModelRun:()=>ic,asyncDefaultReportMessage:()=>jP,assert:()=>_g,array:()=>P0,anything:()=>AR,__version:()=>Ef,__type:()=>jf,__commitHash:()=>Sf,VerbosityLevel:()=>Rb,Value:()=>k,Stream:()=>s,Random:()=>DK,PreconditionFailure:()=>Q6,ExecutionStatus:()=>fb,Arbitrary:()=>C0});var kk=class Q{constructor(X){this.seed=X}clone(){return new Q(this.seed)}next(){let X=KG(this.seed),Y=WG(X),J=KG(X),$=WG(J);return this.seed=KG(J),WG(this.seed)+($+(Y<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function KG(Q){return Math.imul(Q,214013)+2531011&4294967295}function WG(Q){return(Q&-2147483649)>>16}function rz(Q){return new kk(Q)}var yk=class Q{constructor(X,Y){this.states=X,this.index=Y}clone(){return new Q(this.states.slice(),this.index)}next(){let X=this.states[this.index];return X^=X>>>11,X^=X<<7&2636928640,X^=X<<15&4022730752,X^=X>>>18,this.index=G2(this.states,this.index),X}getState(){return[this.index,...this.states]}jump(){let X=this.states.slice(),Y=this.index;this.index=G2(this.states,this.index);for(let J=19932;J>0;--J){if("SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000".charCodeAt(J/6|0)-48&1<<J%6)oz(this.states,this.index,X,Y);this.index=G2(this.states,this.index)}oz(this.states,this.index,X,Y)}};function oz(Q,X,Y,J){let $=0;if(J>=X){for(;$<624-J;$++)Q[$+X]^=Y[$+J];for(;$<624-X;$++)Q[$+X]^=Y[$+J-624];for(;$<624;$++)Q[$+X-624]^=Y[$+J-624]}else{for(;$<624-X;$++)Q[$+X]^=Y[$+J];for(;$<624-J;$++)Q[$+X-624]^=Y[$+J];for(;$<624;$++)Q[$+X-624]^=Y[$+J-624]}}function G2(Q,X){if(X<227){let Y=Q[X]&2147483648|Q[X+1]&2147483647;return Q[X]=Q[X+397]^Y>>>1^-(Y&1)&2567483615,X+1}else if(X<623){let Y=Q[X]&2147483648|Q[X+1]&2147483647;return Q[X]=Q[X+397-624]^Y>>>1^-(Y&1)&2567483615,X+1}else{let Y=Q[X]&2147483648|Q[0]&2147483647;return Q[X]=Q[396]^Y>>>1^-(Y&1)&2567483615,0}}function bk(Q){for(let X=0;X!==624;++X)G2(Q,X)}function nz(Q){let X=[Q|0];for(let Y=1;Y!==624;++Y){let J=X[Y-1]^X[Y-1]>>>30;X.push(Math.imul(1812433253,J)+Y|0)}return bk(X),new yk(X,0)}var gk=class Q{constructor(X,Y,J,$){this.s01=X,this.s00=Y,this.s11=J,this.s10=$}clone(){return new Q(this.s01,this.s00,this.s11,this.s10)}next(){let X=this.s00^this.s00<<23,Y=this.s01^(this.s01<<23|this.s00>>>9),J=X^this.s10^(X>>>18|Y<<14)^(this.s10>>>5|this.s11<<27),$=Y^this.s11^Y>>>18^this.s11>>>5,Z=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=$,this.s10=J,Z}jump(){let X=0,Y=0,J=0,$=0,Z=[1667051007,2321340297,1548169110,304075285];for(let G=0;G!==4;++G)for(let K=1;K;K<<=1){if(Z[G]&K)X^=this.s01,Y^=this.s00,J^=this.s11,$^=this.s10;this.next()}this.s01=X,this.s00=Y,this.s11=J,this.s10=$}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function HG(Q){return new gk(-1,~Q,Q|0,0)}var hk=class Q{constructor(X,Y,J,$){this.s01=X,this.s00=Y,this.s11=J,this.s10=$}clone(){return new Q(this.s01,this.s00,this.s11,this.s10)}next(){let X=this.s00+this.s10|0,Y=this.s10^this.s00,J=this.s11^this.s01,$=this.s00,Z=this.s01;return this.s00=$<<24^Z>>>8^Y^Y<<16,this.s01=Z<<24^$>>>8^J^(J<<16|Y>>>16),this.s10=J<<5^Y>>>27,this.s11=Y<<5^J>>>27,X}jump(){let X=0,Y=0,J=0,$=0,Z=[3639956645,3750757012,1261568508,386426335];for(let G=0;G!==4;++G)for(let K=1;K;K<<=1){if(Z[G]&K)X^=this.s01,Y^=this.s00,J^=this.s11,$^=this.s10;this.next()}this.s01=X,this.s00=Y,this.s11=J,this.s10=$}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function iz(Q){return new hk(-1,~Q,Q|0,0)}function az(Q,X){for(let Y=0;Y!==X;++Y)Q.next()}var sz=BigInt,mk=4294967296n;function ez(Q,X,Y){let J=Y-X+1n,$=mk,Z=1;while($<J)$<<=32n,++Z;let G=tz(Z,Q);if(G<J)return G+X;if(G+J<$)return G%J+X;let K=$-$%J;while(G>=K)G=tz(Z,Q);return G%J+X}function tz(Q,X){let Y=sz(X.next()+2147483648);for(let J=1;J<Q;++J){let $=X.next();Y=(Y<<32n)+sz($+2147483648)}return Y}function JX(Q,X){let Y=X>2?~~(4294967296/X)*X:4294967296,J=Q.next()+2147483648;while(J>=Y)J=Q.next()+2147483648;return J%X}function VG(Q,X){if(X<0){let Y=-X;Q.sign=-1,Q.data[0]=~~(Y/4294967296),Q.data[1]=Y>>>0}else Q.sign=1,Q.data[0]=~~(X/4294967296),Q.data[1]=X>>>0;return Q}function dk(Q,X,Y){let J=X.data[1],$=X.data[0],Z=X.sign,G=Y.data[1],K=Y.data[0],W=Y.sign;if(Q.sign=1,Z===1&&W===-1){let P=J+G,L=$+K+(P>4294967295?1:0);return Q.data[0]=L>>>0,Q.data[1]=P>>>0,Q}let H=J,_=$,V=G,q=K;if(Z===-1)H=G,_=K,V=J,q=$;let D=0,U=H-V;if(U<0)D=1,U=U>>>0;return Q.data[0]=_-q-D,Q.data[1]=U,Q}function pk(Q,X,Y){let J=Y[0]+1;X[0]=JX(Q,J),X[1]=JX(Q,4294967296);while(X[0]>=Y[0]&&(X[0]!==Y[0]||X[1]>=Y[1]))X[0]=JX(Q,J),X[1]=JX(Q,4294967296);return X}var ck=Number.MAX_SAFE_INTEGER,fk={sign:1,data:[0,0]},uk={sign:1,data:[0,0]},QF={sign:1,data:[0,0]},_G=[0,0];function lk(Q,X,Y,J){let $=J<=ck?VG(QF,J):dk(QF,VG(fk,Y),VG(uk,X));if($.data[1]===4294967295)$.data[0]+=1,$.data[1]=0;else $.data[1]+=1;return pk(Q,_G,$.data),_G[0]*4294967296+_G[1]+X}function K2(Q,X,Y){let J=Y-X;if(J<=4294967295)return JX(Q,J+1)+X;return lk(Q,X,Y,J)}var XF=Symbol.for("fast-check/PreconditionFailure"),Q6=class extends Error{constructor(Q=!1){super();this.interruptExecution=Q,this.footprint=XF}static isFailure(Q){return Q!==null&&Q!==void 0&&Q.footprint===XF}};function rk(Q){if(!Q)throw new Q6}var ok=class{[Symbol.iterator](){return this}next(Q){return{value:Q,done:!0}}},nk=new ok;function ik(){return nk}function*ak(Q,X){for(let Y of Q)yield X(Y)}function*sk(Q,X){for(let Y of Q)yield*X(Y)}function*tk(Q,X){for(let Y of Q)if(X(Y))yield Y}function*ek(Q,X){for(let Y=0;Y<X;++Y){let J=Q.next();if(J.done)break;yield J.value}}function*Qy(Q,X){let Y=Q.next();while(!Y.done&&X(Y.value))yield Y.value,Y=Q.next()}function*Xy(Q,X){for(let Y=Q.next();!Y.done;Y=Q.next())yield Y.value;for(let Y of X)for(let J=Y.next();!J.done;J=Y.next())yield J.value}var Yy=Symbol.iterator,s=class Q{static nil(){return new Q(ik())}static of(...X){return new Q(X[Yy]())}constructor(X){this.g=X}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(X){return new Q(ak(this.g,X))}flatMap(X){return new Q(sk(this.g,X))}dropWhile(X){let Y=!1;function*J($){if(Y||!X($))Y=!0,yield $}return this.flatMap(J)}drop(X){if(X<=0)return this;let Y=0;function J(){return Y++<X}return this.dropWhile(J)}takeWhile(X){return new Q(Qy(this.g,X))}take(X){return new Q(ek(this.g,X))}filter(X){return new Q(tk(this.g,X))}every(X){for(let Y of this.g)if(!X(Y))return!1;return!0}has(X){for(let Y of this.g)if(X(Y))return[!0,Y];return[!1,null]}join(...X){return new Q(Xy(this.g,X))}getNthOrLast(X){let Y=X,J=null;for(let $ of this.g){if(Y--===0)return $;J=$}return J}};function t4(Q){return new s(Q)}var r0=Symbol.for("fast-check/cloneMethod");function s6(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&r0 in Q&&typeof Q[r0]==="function"}function K9(Q){return s6(Q)?Q[r0]():Q}var Jy=Object.defineProperty,k=class{constructor(Q,X,Y){if(this.value_=Q,this.context=X,this.hasToBeCloned=Y!==void 0||s6(Q),this.readOnce=!1,this.value=Q,this.hasToBeCloned)Jy(this,"value",{get:Y!==void 0?Y:this.getValue,enumerable:!1,configurable:!1})}getValue(){if(this.hasToBeCloned){if(!this.readOnce)return this.readOnce=!0,this.value_;return this.value_[r0]()}return this.value_}},C0=class{filter(Q){return new Gy(this,Q)}map(Q,X){return new Zy(this,Q,X)}chain(Q){return new $y(this,Q)}},$y=class extends C0{constructor(Q,X){super();this.arb=Q,this.chainer=X}generate(Q,X){let Y=Q.clone(),J=this.arb.generate(Q,X);return this.valueChainer(J,Q,Y,X)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(this.isSafeContext(X))return(!X.stoppedForOriginal?this.arb.shrink(X.originalValue,X.originalContext).map((Y)=>this.valueChainer(Y,X.clonedMrng.clone(),X.clonedMrng,X.originalBias)):s.nil()).join(X.chainedArbitrary.shrink(Q,X.chainedContext).map((Y)=>{let J={...X,chainedContext:Y.context,stoppedForOriginal:!0};return new k(Y.value_,J)}));return s.nil()}valueChainer(Q,X,Y,J){let $=this.chainer(Q.value_),Z=$.generate(X,J),G={originalBias:J,originalValue:Q.value_,originalContext:Q.context,stoppedForOriginal:!1,chainedArbitrary:$,chainedContext:Z.context,clonedMrng:Y};return new k(Z.value_,G)}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalBias"in Q&&"originalValue"in Q&&"originalContext"in Q&&"stoppedForOriginal"in Q&&"chainedArbitrary"in Q&&"chainedContext"in Q&&"clonedMrng"in Q}},Zy=class extends C0{constructor(Q,X,Y){super();this.arb=Q,this.mapper=X,this.unmapper=Y,this.bindValueMapper=(J)=>this.valueMapper(J)}generate(Q,X){let Y=this.arb.generate(Q,X);return this.valueMapper(Y)}canShrinkWithoutContext(Q){if(this.unmapper!==void 0)try{let X=this.unmapper(Q);return this.arb.canShrinkWithoutContext(X)}catch{return!1}return!1}shrink(Q,X){if(this.isSafeContext(X))return this.arb.shrink(X.originalValue,X.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let Y=this.unmapper(Q);return this.arb.shrink(Y,void 0).map(this.bindValueMapper)}return s.nil()}mapperWithCloneIfNeeded(Q){let X=Q.value,Y=this.mapper(X);if(Q.hasToBeCloned&&(typeof Y==="object"&&Y!==null||typeof Y==="function")&&Object.isExtensible(Y)&&!s6(Y))Object.defineProperty(Y,r0,{get:()=>()=>this.mapperWithCloneIfNeeded(Q)[0]});return[Y,X]}valueMapper(Q){let[X,Y]=this.mapperWithCloneIfNeeded(Q);return new k(X,{originalValue:Y,originalContext:Q.context})}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalValue"in Q&&"originalContext"in Q}},Gy=class extends C0{constructor(Q,X){super();this.arb=Q,this.refinement=X,this.bindRefinementOnValue=(Y)=>this.refinementOnValue(Y)}generate(Q,X){while(!0){let Y=this.arb.generate(Q,X);if(this.refinementOnValue(Y))return Y}}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)&&this.refinement(Q)}shrink(Q,X){return this.arb.shrink(Q,X).filter(this.bindRefinementOnValue)}refinementOnValue(Q){return this.refinement(Q.value)}};function XP(Q){return typeof Q==="object"&&Q!==null&&"generate"in Q&&"shrink"in Q&&"canShrinkWithoutContext"in Q}function YP(Q){if(!XP(Q))throw Error("Unexpected value received: not an instance of Arbitrary")}var JP=Function.prototype.apply,qG=Symbol("apply");function Ky(Q){try{return Q.apply}catch{return}}function Wy(Q,X,Y){let J=Q;J[qG]=JP;let $=J[qG](X,Y);return delete J[qG],$}function V0(Q,X,Y){if(Ky(Q)===JP)return Q.apply(X,Y);return Wy(Q,X,Y)}var $P=Array,j=BigInt,Hy=BigInt64Array,Vy=BigUint64Array,ZP=Boolean,N2=Date,S=Error,GP=Float32Array,KP=Float64Array,_y=Int8Array,qy=Int16Array,Dy=Int32Array,_4=Number,P1=String,W9=Set,By=Uint8Array,Uy=Uint8ClampedArray,Oy=Uint16Array,zy=Uint32Array,Fy=encodeURIComponent,q4=Map,U2=Symbol,YF=Array.prototype.forEach,JF=Array.prototype.indexOf,$F=Array.prototype.join,ZF=Array.prototype.map,GF=Array.prototype.flat,KF=Array.prototype.filter,WF=Array.prototype.push,HF=Array.prototype.pop,VF=Array.prototype.splice,_F=Array.prototype.slice,qF=Array.prototype.sort,DF=Array.prototype.every;function Ly(Q){try{return Q.forEach}catch{return}}function Py(Q){try{return Q.indexOf}catch{return}}function Ry(Q){try{return Q.join}catch{return}}function Ny(Q){try{return Q.map}catch{return}}function My(Q){try{return Q.flat}catch{return}}function Ay(Q){try{return Q.filter}catch{return}}function wy(Q){try{return Q.push}catch{return}}function Cy(Q){try{return Q.pop}catch{return}}function Ty(Q){try{return Q.splice}catch{return}}function Iy(Q){try{return Q.slice}catch{return}}function jy(Q){try{return Q.sort}catch{return}}function Ey(Q){try{return Q.every}catch{return}}function WP(Q,X){if(Ly(Q)===YF)return Q.forEach(X);return V0(YF,Q,[X])}function V4(Q,...X){if(Py(Q)===JF)return Q.indexOf(...X);return V0(JF,Q,X)}function w0(Q,...X){if(Ry(Q)===$F)return Q.join(...X);return V0($F,Q,X)}function Z0(Q,X){if(Ny(Q)===ZF)return Q.map(X);return V0(ZF,Q,[X])}function Sy(Q,X){if(My(Q)===GF)return[].flat(),Q.flat(X);return V0(GF,Q,[X])}function xy(Q,X){if(Ay(Q)===KF)return Q.filter(X);return V0(KF,Q,[X])}function x(Q,...X){if(wy(Q)===WF)return Q.push(...X);return V0(WF,Q,X)}function HP(Q){if(Cy(Q)===HF)return Q.pop();return V0(HF,Q,[])}function VP(Q,...X){if(Ty(Q)===VF)return Q.splice(...X);return V0(VF,Q,X)}function s0(Q,...X){if(Iy(Q)===_F)return Q.slice(...X);return V0(_F,Q,X)}function _P(Q,...X){if(jy(Q)===qF)return Q.sort(...X);return V0(qF,Q,X)}function qP(Q,...X){if(Ey(Q)===DF)return Q.every(...X);return V0(DF,Q,X)}var BF=Date.prototype.getTime,UF=Date.prototype.toISOString;function vy(Q){try{return Q.getTime}catch{return}}function ky(Q){try{return Q.toISOString}catch{return}}function M2(Q){if(vy(Q)===BF)return Q.getTime();return V0(BF,Q,[])}function yy(Q){if(ky(Q)===UF)return Q.toISOString();return V0(UF,Q,[])}var OF=Set.prototype.add,zF=Set.prototype.has;function by(Q){try{return Q.add}catch{return}}function gy(Q){try{return Q.has}catch(X){return}}function WX(Q,X){if(by(Q)===OF)return Q.add(X);return V0(OF,Q,[X])}function A2(Q,X){if(gy(Q)===zF)return Q.has(X);return V0(zF,Q,[X])}var FF=WeakMap.prototype.set,LF=WeakMap.prototype.get;function hy(Q){try{return Q.set}catch(X){return}}function my(Q){try{return Q.get}catch(X){return}}function dy(Q,X,Y){if(hy(Q)===FF)return Q.set(X,Y);return V0(FF,Q,[X,Y])}function py(Q,X){if(my(Q)===LF)return Q.get(X);return V0(LF,Q,[X])}var PF=Map.prototype.set,RF=Map.prototype.get,NF=Map.prototype.has;function cy(Q){try{return Q.set}catch(X){return}}function fy(Q){try{return Q.get}catch(X){return}}function uy(Q){try{return Q.has}catch(X){return}}function L8(Q,X,Y){if(cy(Q)===PF)return Q.set(X,Y);return V0(PF,Q,[X,Y])}function c1(Q,X){if(fy(Q)===RF)return Q.get(X);return V0(RF,Q,[X])}function ly(Q,X){if(uy(Q)===NF)return Q.has(X);return V0(NF,Q,[X])}var MF=String.prototype.split,AF=String.prototype.startsWith,wF=String.prototype.endsWith,CF=String.prototype.substring,TF=String.prototype.toLowerCase,IF=String.prototype.toUpperCase,jF=String.prototype.padStart,EF=String.prototype.charCodeAt,SF=String.prototype.normalize,xF=String.prototype.replace;function ry(Q){try{return Q.split}catch{return}}function oy(Q){try{return Q.startsWith}catch{return}}function ny(Q){try{return Q.endsWith}catch{return}}function iy(Q){try{return Q.substring}catch{return}}function ay(Q){try{return Q.toLowerCase}catch{return}}function sy(Q){try{return Q.toUpperCase}catch{return}}function ty(Q){try{return Q.padStart}catch{return}}function ey(Q){try{return Q.charCodeAt}catch{return}}function Qb(Q){try{return Q.normalize}catch(X){return}}function Xb(Q){try{return Q.replace}catch{return}}function R1(Q,...X){if(ry(Q)===MF)return Q.split(...X);return V0(MF,Q,X)}function Yb(Q,...X){if(oy(Q)===AF)return Q.startsWith(...X);return V0(AF,Q,X)}function Jb(Q,...X){if(ny(Q)===wF)return Q.endsWith(...X);return V0(wF,Q,X)}function S0(Q,...X){if(iy(Q)===CF)return Q.substring(...X);return V0(CF,Q,X)}function gG(Q){if(ay(Q)===TF)return Q.toLowerCase();return V0(TF,Q,[])}function KK(Q){if(sy(Q)===IF)return Q.toUpperCase();return V0(IF,Q,[])}function $b(Q,...X){if(ty(Q)===jF)return Q.padStart(...X);return V0(jF,Q,X)}function H9(Q,X){if(ey(Q)===EF)return Q.charCodeAt(X);return V0(EF,Q,[X])}function Zb(Q,X){if(Qb(Q)===SF)return Q.normalize(X);return V0(SF,Q,[X])}function Gb(Q,X,Y){if(Xb(Q)===xF)return Q.replace(X,Y);return V0(xF,Q,[X,Y])}var vF=Number.prototype.toString;function Kb(Q){try{return Q.toString}catch{return}}function HX(Q,...X){if(Kb(Q)===vF)return Q.toString(...X);return V0(vF,Q,X)}var Wb=Object.prototype.hasOwnProperty,Hb=Object.prototype.toString;function DP(Q,X){return V0(Wb,Q,[X])}function hG(Q){return V0(Hb,Q,[])}var Vb=Error.prototype.toString;function _b(Q){return V0(Vb,Q,[])}var qb=class{constructor(Q){this.producer=Q}[Symbol.iterator](){if(this.it===void 0)this.it=this.producer();return this.it}next(){if(this.it===void 0)this.it=this.producer();return this.it.next()}};function s4(Q){return new qb(Q)}var BP=Array.isArray,Db=Object.defineProperty;function UP(Q,X){return Db(Q,r0,{value:()=>{let Y=[];for(let J=0;J!==X.length;++J)x(Y,X[J].value);return UP(Y,X),Y}})}function OP(Q){let X=!1,Y=[],J=[];for(let $=0;$!==Q.length;++$){let Z=Q[$];X=X||Z.hasToBeCloned,x(Y,Z.value),x(J,Z.context)}if(X)UP(Y,Q);return new k(Y,J)}function zP(Q,X,Y){let J=[],$=BP(Y)?Y:[];for(let Z=0;Z!==Q.length;++Z)x(J,s4(()=>Q[Z].shrink(X[Z],$[Z]).map((G)=>{let K=Z0(X,(W,H)=>new k(K9(W),$[H]));return[...s0(K,0,Z),G,...s0(K,Z+1)]}).map(OP)));return s.nil().join(...J)}var Bb=class extends C0{constructor(Q){super();this.arbs=Q;for(let X=0;X!==Q.length;++X){let Y=Q[X];if(Y===null||Y===void 0||Y.generate===null||Y.generate===void 0)throw Error(`Invalid parameter encountered at index ${X}: expecting an Arbitrary`)}}generate(Q,X){let Y=[];for(let J=0;J!==this.arbs.length;++J)x(Y,this.arbs[J].generate(Q,X));return OP(Y)}canShrinkWithoutContext(Q){if(!BP(Q)||Q.length!==this.arbs.length)return!1;for(let X=0;X!==this.arbs.length;++X)if(!this.arbs[X].canShrinkWithoutContext(Q[X]))return!1;return!0}shrink(Q,X){return zP(this.arbs,Q,X)}};function Q0(...Q){return new Bb(Q)}var Ub=Math.log;function FP(Q){return 2+~~(Ub(Q+1)*0.4342944819032518)}var WK={};function Ob(Q){WK=Q}function P8(){return WK}function zb(){WK={}}var VX=Symbol("UndefinedContextPlaceholder");function V9(Q){if(Q.context!==void 0)return Q;if(Q.hasToBeCloned)return new k(Q.value_,VX,()=>Q.value);return new k(Q.value_,VX)}var kF=()=>{},Fb=class{constructor(Q,X){this.arb=Q,this.predicate=X;let{asyncBeforeEach:Y,asyncAfterEach:J,beforeEach:$,afterEach:Z}=P8()||{};if(Y!==void 0&&$!==void 0)throw S(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(J!==void 0&&Z!==void 0)throw S(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=Y||$||kF,this.afterEachHook=J||Z||kF}isAsync(){return!0}generate(Q,X){return V9(this.arb.generate(Q,X!==void 0?FP(X):void 0))}shrink(Q){if(Q.context===void 0&&!this.arb.canShrinkWithoutContext(Q.value_))return s.nil();let X=Q.context!==VX?Q.context:void 0;return this.arb.shrink(Q.value_,X).map(V9)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(Q){try{let X=await this.predicate(Q);return X===void 0||X===!0?null:{error:new S("Property failed by returning false")}}catch(X){if(Q6.isFailure(X))return X;return{error:X}}}beforeEach(Q){let X=this.beforeEachHook;return this.beforeEachHook=()=>Q(X),this}afterEach(Q){let X=this.afterEachHook;return this.afterEachHook=()=>Q(X),this}},LP=class extends C0{constructor(Q){super();this.arb=Q}generate(Q,X){return V9(this.arb.generate(Q,X))}canShrinkWithoutContext(Q){return!0}shrink(Q,X){if(X===void 0&&!this.arb.canShrinkWithoutContext(Q))return s.nil();let Y=X!==VX?X:void 0;return this.arb.shrink(Q,Y).map(V9)}};function Lb(...Q){if(Q.length<2)throw Error("asyncProperty expects at least two parameters");let X=s0(Q,0,Q.length-1),Y=Q[Q.length-1];return WP(X,YP),new Fb(Q0(...Z0(X,(J)=>new LP(J))),(J)=>Y(...J))}var yF=()=>{},PP=class{constructor(Q,X){this.arb=Q,this.predicate=X;let{beforeEach:Y=yF,afterEach:J=yF,asyncBeforeEach:$,asyncAfterEach:Z}=P8()||{};if($!==void 0)throw S(`"asyncBeforeEach" can't be set when running synchronous properties`);if(Z!==void 0)throw S(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=Y,this.afterEachHook=J}isAsync(){return!1}generate(Q,X){return V9(this.arb.generate(Q,X!==void 0?FP(X):void 0))}shrink(Q){if(Q.context===void 0&&!this.arb.canShrinkWithoutContext(Q.value_))return s.nil();let X=Q.context!==VX?Q.context:void 0;return this.arb.shrink(Q.value_,X).map(V9)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(Q){try{let X=this.predicate(Q);return X===void 0||X===!0?null:{error:new S("Property failed by returning false")}}catch(X){if(Q6.isFailure(X))return X;return{error:X}}}beforeEach(Q){let X=this.beforeEachHook;return this.beforeEachHook=()=>Q(X),this}afterEach(Q){let X=this.afterEachHook;return this.afterEachHook=()=>Q(X),this}};function Pb(...Q){if(Q.length<2)throw Error("property expects at least two parameters");let X=s0(Q,0,Q.length-1),Y=Q[Q.length-1];return WP(X,YP),new PP(Q0(...Z0(X,(J)=>new LP(J))),(J)=>Y(...J))}var Rb=function(Q){return Q[Q.None=0]="None",Q[Q.Verbose=1]="Verbose",Q[Q.VeryVerbose=2]="VeryVerbose",Q}({});function mG(Q){if("unsafeNext"in Q){if(Q.unsafeJump===void 0)return{clone:()=>mG(Q),next:()=>Q.unsafeNext(),getState:()=>Q.getState()};return{clone:()=>mG(Q),next:()=>Q.unsafeNext(),jump:()=>Q.unsafeJump(),getState:()=>Q.getState()}}return Q}function RP(Q){if("jump"in Q&&typeof Q.jump==="function")return Q;return{clone:()=>RP(Q),next:()=>Q.next(),jump:()=>az(Q,42),getState:()=>Q.getState()}}function I2(Q){return RP(mG(Q))}var Nb=Date.now,Mb=Math.min,Ab=Math.random,wb=class{constructor(Q){let X=Q||{};this.seed=Cb(X),this.randomType=Tb(X),this.numRuns=Ib(X),this.verbose=jb(X),this.maxSkipsPerRun=X.maxSkipsPerRun!==void 0?X.maxSkipsPerRun:100,this.timeout=BG(X.timeout),this.skipAllAfterTimeLimit=BG(X.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=BG(X.interruptAfterTimeLimit),this.markInterruptAsFailure=X.markInterruptAsFailure===!0,this.skipEqualValues=X.skipEqualValues===!0,this.ignoreEqualValues=X.ignoreEqualValues===!0,this.logger=X.logger!==void 0?X.logger:(Y)=>{console.log(Y)},this.path=X.path!==void 0?X.path:"",this.unbiased=X.unbiased===!0,this.examples=X.examples!==void 0?X.examples:[],this.endOnFailure=X.endOnFailure===!0,this.reporter=X.reporter,this.asyncReporter=X.asyncReporter,this.includeErrorInReport=X.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function DG(Q){return(X)=>{return I2(Q(X))}}function Cb(Q){if(Q.seed===void 0)return Nb()^Ab()*4294967296;let X=Q.seed|0;if(Q.seed===X)return X;return X^(Q.seed-X)*4294967296}function Tb(Q){if(Q.randomType===void 0)return HG;if(typeof Q.randomType==="string")switch(Q.randomType){case"mersenne":return DG(nz);case"congruential":case"congruential32":return DG(rz);case"xorshift128plus":return HG;case"xoroshiro128plus":return iz;default:throw Error(`Invalid random specified: '${Q.randomType}'`)}let X=Q.randomType(0);if("min"in X&&X.min!==-2147483648)throw Error(`Invalid random number generator: min must equal -0x80000000, got ${String(X.min)}`);if("max"in X&&X.max!==2147483647)throw Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(X.max)}`);if(X===I2(X))return Q.randomType;return DG(Q.randomType)}function Ib(Q){if(Q.numRuns!==void 0)return Q.numRuns;if(Q.num_runs!==void 0)return Q.num_runs;return 100}function jb(Q){if(Q.verbose===void 0)return 0;if(typeof Q.verbose==="boolean")return Q.verbose===!0?1:0;if(Q.verbose<=0)return 0;if(Q.verbose>=2)return 2;return Q.verbose|0}function BG(Q){if(Q===void 0)return;return Mb(Q,2147483647)}function HK(Q){return new wb(Q)}function Eb(Q,X,Y){let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=X(()=>{$(new Q6(!0))},Q)})}}var bF=class{constructor(Q,X,Y,J,$,Z){this.property=Q,this.getTime=X,this.interruptExecution=J,this.setTimeoutSafe=$,this.clearTimeoutSafe=Z,this.skipAfterTime=this.getTime()+Y}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}run(Q){let X=this.skipAfterTime-this.getTime();if(X<=0){let Y=new Q6(this.interruptExecution);if(this.isAsync())return Promise.resolve(Y);else return Y}if(this.interruptExecution&&this.isAsync()){let Y=Eb(X,this.setTimeoutSafe,this.clearTimeoutSafe),J=Promise.race([this.property.run(Q),Y.promise]);return J.then(Y.clear,Y.clear),J}return this.property.run(Q)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Sb=(Q,X,Y)=>{let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=X(()=>{$({error:new S(`Property timeout: exceeded limit of ${Q} milliseconds`)})},Q)})}},xb=class{constructor(Q,X,Y,J){this.property=Q,this.timeMs=X,this.setTimeoutSafe=Y,this.clearTimeoutSafe=J}isAsync(){return!0}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}async run(Q){let X=Sb(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),Y=Promise.race([this.property.run(Q),X.promise]);return Y.then(X.clear,X.clear),Y}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},NP=class{constructor(Q){this.property=Q}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,void 0)}shrink(Q){return this.property.shrink(Q)}run(Q){return this.property.run(Q)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},gF=Array.from,hF=typeof Buffer<"u"?Buffer.isBuffer:void 0,J9=JSON.stringify,mF=Number.isNaN,vb=Object.keys,kb=Object.getOwnPropertySymbols,yb=Object.getOwnPropertyDescriptor,dF=Object.getPrototypeOf,pF=Number.NEGATIVE_INFINITY,bb=Number.POSITIVE_INFINITY,R8=Symbol.for("fast-check/toStringMethod");function VK(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&R8 in Q&&typeof Q[R8]==="function"}var D4=Symbol.for("fast-check/asyncToStringMethod");function _K(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&D4 in Q&&typeof Q[D4]==="function"}var gb=/^Symbol\((.*)\)$/;function hb(Q){if(Q.description!==void 0)return Q.description;let X=gb.exec(P1(Q));return X&&X[1].length?X[1]:null}function cF(Q){switch(Q){case 0:return 1/Q===pF?"-0":"0";case pF:return"Number.NEGATIVE_INFINITY";case bb:return"Number.POSITIVE_INFINITY";default:return Q===Q?P1(Q):"Number.NaN"}}function mb(Q){let X=-1;for(let Y in Q){let J=Number(Y);if(J!==X+1)return!0;X=J}return X+1!==Q.length}function p1(Q,X,Y){let J=[...X,Q];if(typeof Q==="object"){if(V4(X,Q)!==-1)return"[cyclic]"}if(_K(Q)){let $=Y(Q);if($.state==="fulfilled")return $.value}if(VK(Q))try{return Q[R8]()}catch{}switch(hG(Q)){case"[object Array]":{let $=Q;if($.length>=50&&mb($)){let G=[];for(let K in $)if(!mF(Number(K)))x(G,`${K}:${p1($[K],J,Y)}`);return G.length!==0?`Object.assign(Array(${$.length}),{${w0(G,",")}})`:`Array(${$.length})`}let Z=w0(Z0($,(G)=>p1(G,J,Y)),",");return $.length===0||$.length-1 in $?`[${Z}]`:`[${Z},]`}case"[object BigInt]":return`${Q}n`;case"[object Boolean]":{let $=Q==!0?"true":"false";return typeof Q==="boolean"?$:`new Boolean(${$})`}case"[object Date]":{let $=Q;return mF(M2($))?"new Date(NaN)":`new Date(${J9(yy($))})`}case"[object Map]":return`new Map(${p1(Array.from(Q),J,Y)})`;case"[object Null]":return"null";case"[object Number]":return typeof Q==="number"?cF(Q):`new Number(${cF(Number(Q))})`;case"[object Object]":{try{let Z=Q.toString;if(typeof Z==="function"&&Z!==Object.prototype.toString)return Q.toString()}catch{return"[object Object]"}let $=(Z)=>`${Z==="__proto__"?'["__proto__"]':typeof Z==="symbol"?`[${p1(Z,J,Y)}]`:J9(Z)}:${p1(Q[Z],J,Y)}`;return"{"+w0([...dF(Q)===null?["__proto__:null"]:[],...Z0(vb(Q),$),...Z0(xy(kb(Q),(Z)=>{let G=yb(Q,Z);return G&&G.enumerable}),$)],",")+"}"}case"[object Set]":return`new Set(${p1(Array.from(Q),J,Y)})`;case"[object String]":return typeof Q==="string"?J9(Q):`new String(${J9(Q)})`;case"[object Symbol]":{let $=Q;if(U2.keyFor($)!==void 0)return`Symbol.for(${J9(U2.keyFor($))})`;let Z=hb($);if(Z===null)return"Symbol()";return $===(Z.startsWith("Symbol.")&&U2[Z.substring(7)])?Z:`Symbol(${J9(Z)})`}case"[object Promise]":{let $=Y(Q);switch($.state){case"fulfilled":return`Promise.resolve(${p1($.value,J,Y)})`;case"rejected":return`Promise.reject(${p1($.value,J,Y)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(Q instanceof Error)return`new Error(${p1(Q.message,J,Y)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof hF==="function"&&hF(Q))return`Buffer.from(${Q.buffer.detached?"/*detached ArrayBuffer*/":p1(gF(Q.values()),J,Y)})`;let $=dF(Q),Z=$&&$.constructor&&$.constructor.name;if(typeof Z==="string"){let G=Q;if(G.buffer.detached)return`${Z}.from(/*detached ArrayBuffer*/)`;return`${Z}.from(${p1(gF(G.values()),J,Y)})`}break}}try{return Q.toString()}catch{return hG(Q)}}function b0(Q){return p1(Q,[],()=>({state:"unknown",value:void 0}))}function MP(Q){let X=U2(),Y=[],J=new q4;function $(){let W=null,H=()=>{if(W!==null)clearTimeout(W)};return{delay:new Promise((_)=>{W=setTimeout(()=>{W=null,_(X)},0)}),cancel:H}}let Z={state:"unknown",value:void 0},G=function(H){let _=H;if(J.has(_))return J.get(_);let V=$(),q=D4 in H?Promise.resolve().then(()=>H[D4]()):H;return q.catch(()=>{}),Y.push(Promise.race([q,V.delay]).then((D)=>{if(D===X)J.set(_,{state:"pending",value:void 0});else J.set(_,{state:"fulfilled",value:D});V.cancel()},(D)=>{J.set(_,{state:"rejected",value:D}),V.cancel()})),J.set(_,Z),Z};function K(){let W=p1(Q,[],G);if(Y.length===0)return W;return Promise.all(Y.splice(0)).then(K)}return K()}async function qK(Q){return Promise.resolve(MP(Q))}function fF(Q){return Q===null?new Q6:Q}function db(...Q){if(Q[1])return Q[0].then(fF);return fF(Q[0])}function pb(Q,X){return db(Q,X)}var uF=class{constructor(Q,X){this.property=Q,this.skipRuns=X,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}run(Q){let X=b0(Q);if(this.coveredCases.has(X)){let J=this.coveredCases.get(X);if(!this.skipRuns)return J;return pb(J,this.property.isAsync())}let Y=this.property.run(Q);return this.coveredCases.set(X,Y),Y}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},lF=Date.now,UG=setTimeout,OG=clearTimeout;function cb(Q,X){let Y=Q;if(Q.isAsync()&&X.timeout!==void 0)Y=new xb(Y,X.timeout,UG,OG);if(X.unbiased)Y=new NP(Y);if(X.skipAllAfterTimeLimit!==void 0)Y=new bF(Y,lF,X.skipAllAfterTimeLimit,!1,UG,OG);if(X.interruptAfterTimeLimit!==void 0)Y=new bF(Y,lF,X.interruptAfterTimeLimit,!0,UG,OG);if(X.skipEqualValues)Y=new uF(Y,!0);if(X.ignoreEqualValues)Y=new uF(Y,!1);return Y}var fb=function(Q){return Q[Q.Success=0]="Success",Q[Q.Skipped=-1]="Skipped",Q[Q.Failure=1]="Failure",Q}({}),ub=class Q{constructor(X,Y){this.verbosity=X,this.interruptedAsFailure=Y,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(X,Y){let J={status:X,value:Y,children:[]};return this.currentLevelExecutionTrees.push(J),J}fail(X,Y,J){if(this.verbosity>=1){let $=this.appendExecutionTree(1,X);this.currentLevelExecutionTrees=$.children}if(this.pathToFailure===void 0)this.pathToFailure=`${Y}`;else this.pathToFailure+=`:${Y}`;this.value=X,this.failure=J}skip(X){if(this.verbosity>=2)this.appendExecutionTree(-1,X);if(this.pathToFailure===void 0)++this.numSkips}success(X){if(this.verbosity>=2)this.appendExecutionTree(0,X);if(this.pathToFailure===void 0)++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+R1(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?R1(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let X=[],Y=this.rootExecutionTrees;while(Y.length>0&&Y[Y.length-1].status===1){let J=Y[Y.length-1];X.push(J.value),Y=J.children}return X}static mergePaths(X,Y){if(X.length===0)return Y;let J=X.split(":"),$=Y.split(":"),Z=+J[J.length-1]+ +$[0];return[...J.slice(0,J.length-1),`${Z}`,...$.slice(1)].join(":")}toRunDetails(X,Y,J,$){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:X,counterexample:this.value,counterexamplePath:Q.mergePaths(Y,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:$.toParameters()};let Z=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>J||this.interrupted&&Z,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:X,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:$.toParameters()}}},AP=class{constructor(Q,X,Y,J){this.sourceValues=Q,this.shrink=X,this.runExecution=new ub(Y,J),this.currentIdx=-1,this.nextValues=Q}[Symbol.iterator](){return this}next(){let Q=this.nextValues.next();if(Q.done||this.runExecution.interrupted)return{done:!0,value:void 0};return this.currentValue=Q.value,++this.currentIdx,{done:!1,value:Q.value.value_}}handleResult(Q){if(Q!==null&&typeof Q==="object"&&!Q6.isFailure(Q))this.runExecution.fail(this.currentValue.value_,this.currentIdx,Q),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue);else if(Q!==null)if(!Q.interruptExecution)this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne();else this.runExecution.interrupt();else this.runExecution.success(this.currentValue.value_)}},lb=class{constructor(Q,X,Y){this.initialValues=Q,this.maxInitialIterations=X,this.remainingSkips=Y}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let Q=this.initialValues.next();if(!Q.done)return{value:Q.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},rb=-2147483648,ob=2147483647,nb=Math.pow(2,27),ib=Math.pow(2,-53),DK=class Q{constructor(X){this.internalRng=I2(X.clone())}clone(){return new Q(this.internalRng)}next(X){return K2(this.internalRng,0,(1<<X)-1)}nextBoolean(){return K2(this.internalRng,0,1)===1}nextInt(X,Y){return K2(this.internalRng,X===void 0?rb:X,Y===void 0?ob:Y)}nextBigInt(X,Y){return ez(this.internalRng,X,Y)}nextDouble(){let X=this.next(26),Y=this.next(27);return(X*nb+Y)*ib}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function ab(Q,X,Y){return X.jump(),Q.generate(new DK(X),Y)}function*wP(Q,X,Y,J){for(let $=0;$!==J.length;++$)yield new k(J[$],void 0);for(let $=0,Z=Y(X);;++$)yield ab(Q,Z,$)}function sb(Q,X,Y){return()=>Q.generate(new DK(X),Y)}function*CP(Q,X,Y,J){yield*Z0(J,(G)=>()=>new k(G,void 0));let $=0,Z=I2(Y(X));for(;;)Z.jump(),yield sb(Q,Z,$++)}function rF(Q){return Q()}function TP(Q,X,Y){let J=X,$=Q.split(":").map((G)=>+G);if($.length===0)return J.map(rF);if(!$.every((G)=>!Number.isNaN(G)))throw Error(`Unable to replay, got invalid path=${Q}`);let Z=J.drop($[0]).map(rF);for(let G of $.slice(1)){let K=Z.getNthOrLast(0);if(K===null)throw Error(`Unable to replay, got wrong path=${Q}`);Z=Y(K).drop(G)}return Z}var tb=Object.assign;function eb(Q){if(Q.length===1)return`Hint: ${Q[0]}`;return Q.map((X,Y)=>`Hint (${Y+1}): ${X}`).join(`
30
- `)}function Qg(Q,X){return`Encountered failures were:
16
+ `)},U_=(Q,X)=>{let Y=X?.get(E7.key);if(Y)Q=`${Q}
17
+ ${B_(Y)}`;return Q},CT=(Q,X)=>{let Y=[`${Q.name}: ${Q.message}`];for(let $ of X){let J=$.fiberId!==void 0?`#${$.fiberId}`:"unknown",Z=$.annotations.get(q$.key);if(Y.push(` at fiber (${J})`),Z)Y.push(B_(Z))}return Y.join(`
18
+ `)},B_=(Q)=>{let X=[],Y=Q,$=0;while(Y&&$<10){let J=Y.stack();if(J){let Z=J.matchAll(PT),G=!1;for(let[,W]of Z)G=!0,X.push(` at ${Y.name} (${W})`);if(!G)X.push(` at ${Y.name} (${J.replace(/^at /,"")})`)}else X.push(` at ${Y.name}`);Y=Y.parent,$++}return X.join(`
19
+ `)},ZY=(Q)=>i$(Q).map(z_).join(`
20
+ `),z_=(Q)=>Q.cause?`${Q.stack} {
21
+ ${O_(Q.cause," ")}
22
+ }`:Q.stack,O_=(Q,X)=>{let Y=Q.stack.split(`
23
+ `),$=`${X}[cause]: ${Y[0]}`;for(let J=1,Z=Y.length;J<Z;J++)$+=`
24
+ ${X}${Y[J]}`;if(Q.cause)$+=` {
25
+ ${O_(Q.cause,`${X} `)}
26
+ ${X}}`;return $},h$=`~effect/Fiber/${tV}`,jT={_A:u,_E:u},TT={id:0},GY=()=>globalThis[d9];class n${constructor(Q,X=!0){this[h$]=jT,this.setContext(Q),this.id=++TT.id,this.currentOpCount=0,this.interruptible=X,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[h$];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(Q){return RV(this.context,Q)}addObserver(Q){if(this._exit)return Q(this._exit),h9;return this._observers.push(Q),()=>{let X=this._observers.indexOf(Q);if(X>=0)this._observers.splice(X,1)}}interruptUnsafe(Q,X){if(this._exit)return;let Y=J5(Q);if(this.currentStackFrame)Y=l9(Y,m7(E7,this.currentStackFrame));if(X)Y=l9(Y,X);if(this._interruptedCause=this._interruptedCause?r$(this._interruptedCause,Y):Y,this.interruptible)if(this._running)this._deferredInterrupt=!0;else this.evaluate(P0(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(Q){if(this._exit)return;else if(this._yielded!==void 0){let $=this._yielded;this._yielded=void 0,$()}let X=this.runLoop(Q);if(X===i6)return;let Y=m$.interruptChildren&&m$.interruptChildren(this);if(Y!==void 0)return this.evaluate(S(Y,()=>X));this._exit=X,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let $=0;$<this._observers.length;$++)this._observers[$](X);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=D8()}runLoop(Q){let X=globalThis[d9];globalThis[d9]=this;let Y=this._running;this._running=!0;let $=!1,J=Q;this.currentOpCount=0;try{while(!0){if(this._deferredInterrupt)this._deferredInterrupt=!1,J=P0(this._interruptedCause);if(this.currentOpCount++,!$&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){$=!0;let Z=J;J=S(G5,()=>Z)}if(J=this.currentTracerContext?this.currentTracerContext(J,this):J[c0](this),J===i6){let Z=this._yielded;if(o6 in Z)return this._deferredInterrupt=!1,this._yielded=void 0,Z;else if(this._deferredInterrupt){this._yielded=void 0,Z();continue}return i6}}}catch(Z){if(!C(J,c0))return j8(`Fiber.runLoop: Not a valid effect: ${String(J)}`);return this.runLoop(j8(Z))}finally{this._running=Y,globalThis[d9]=X}}getCont(Q){if(this._deferredInterrupt)return this._deferredInterrupt=!1,IT;while(!0){let X=this._stack.pop();if(!X)return;let Y=X[s4]&&X[s4](this);if(Y)return Y[Q]=Y,Y;if(X[Q])return X}}yieldWith(Q){return this._yielded=Q,i6}children(){return this._children??=new Set}pipe(){return H0(this,arguments)}setContext(Q){this.context=Q;let X=this.getRef(zQ);if(X!==this.currentScheduler)this.currentScheduler=X,this._dispatcher=void 0;this.currentSpan=Q.mapUnsafe.get(S$),this.currentLogLevel=this.getRef(x$),this.minimumLogLevel=this.getRef(b$),this.currentStackFrame=Q.mapUnsafe.get(OQ.key),this.maxOpsBeforeYield=this.getRef(cV),this.currentPreventYield=this.getRef(uV),this.runtimeMetrics=Q.mapUnsafe.get(aV);let Y=Q.mapUnsafe.get(v$);this.currentTracerContext=Y?Y.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var IT={[I1](Q,X){return P0(X._interruptedCause)},[K8](Q,X){return P0(X._interruptedCause)}},m$={interruptChildren:void 0},WY=(Q)=>{if(!Q.currentStackFrame)return;let X=new Map;return X.set(q$.key,Q.currentStackFrame),J6(X)},ET=(Q)=>{if(Q._children===void 0||Q._children.size===0)return;return J9(Q._children)},ST=(Q)=>{let X=Q;if(X._exit)return j(X._exit);return h1((Y)=>{if(X._exit)return Y(j(X._exit));return K0(Q.addObserver(($)=>Y(j($))))})},a$=(Q)=>h1((X)=>{let Y=Q[Symbol.iterator](),$=[],J=void 0;function Z(){let G=Y.next();while(!G.done){if(G.value._exit){$.push(G.value._exit),G=Y.next();continue}J=G.value.addObserver((W)=>{$.push(W),Z()});return}X(j($))}return Z(),K0(()=>J?.())});var vT=(Q)=>e((X)=>xT(Q,X.id)),xT=U((Q)=>C(Q[0],h$),(Q,X,Y)=>e(($)=>{let J=WY($);return J=J&&Y?d7(J,Y):J??Y,Q.interruptUnsafe(X,J),EQ(ST(Q))})),J9=(Q)=>e((X)=>{let Y=WY(X),$=u7();for(let J of Q)J.interruptUnsafe(X.id,Y),$.push(J);return EQ(a$($))});var j=t0,P0=g1,E0=a8,K0=V8({op:"Sync",[c0](Q){let X=this[J0](),Y=Q.getCont(I1);return Y?Y[I1](X,Q):Q.yieldWith(t0(X))}}),Q0=V8({op:"Suspend",[c0](Q){return this[J0]()}}),F_=U((Q)=>Q.length>=2||y7(Q[0]),(Q,X)=>I0(Q)?E0(X?X():new s8("Effect.fromOption: Option.none")):j(Q.value)),Z5=B8({onFailure:E0,onSuccess:j}),R_=(Q)=>Q==null?E0(new s8):j(Q),s$=V8({op:"Yield",[c0](Q){let X=!1;return Q.currentDispatcher.scheduleTask(()=>{if(X)return;Q.evaluate(e1)},this[J0]??0),Q.yieldWith(()=>{X=!0})}}),G5=s$(0),t$=(Q)=>j(R(Q)),IQ=j(d()),N_=(Q)=>I0(Q)?IQ:M0(Q.value,R),L_=(Q)=>Q0(()=>P0(V0(Q))),K6=(Q)=>j8(Q),HY=(Q)=>Q0(()=>E0(V0(Q))),$0=j(void 0);var M_=(Q)=>{let X=typeof Q==="function"?Q:Q.try,Y=typeof Q==="function"?($)=>new dQ($,"An error occurred in Effect.try"):Q.catch;return Q0(()=>{try{return j(V0(X))}catch($){return E0(V0(()=>Y($)))}})};var e$=(Q)=>QJ(function(X,Y){V0(()=>Q(Y)).then(($)=>X(j($)),($)=>X(K6($)))},Q.length!==0),w_=(Q)=>{let X=typeof Q==="function"?Q:Q.try,Y=typeof Q==="function"?($)=>new dQ($,"An error occurred in Effect.tryPromise"):Q.catch;return QJ(function($,J){let Z=(G)=>{try{$(E0(V0(()=>Y(G))))}catch(W){$(K6(W))}};try{V0(()=>X(J)).then((G)=>$(j(G)),Z)}catch(G){Z(G)}},X.length!==0)},P_=(Q)=>e((X)=>Q(X.id)),A_=e(j),C_=P_(j),QJ=V8({op:"Async",single:!1,[c0](Q){let X=V0(()=>this[J0][0].bind(Q.currentScheduler)),Y=!1,$=!1,J=this[J0][1]?new AbortController:void 0,Z=X((G)=>{if(Y)return;if(Y=!0,$)Q.evaluate(G);else $=G},J?.signal);if($!==!1)return $;if($=!0,Q._yielded=()=>{Y=!0},J===void 0&&Z===void 0)return i6;return Q._stack.push(bT(()=>{return Y=!0,J?.abort(),Z??e1})),i6}}),bT=V8({op:"AsyncFinalizer",[s4](Q){if(Q.interruptible)Q.interruptible=!1,Q._stack.push(NY)},[K8](Q,X){return YY(Q)?S(this[J0](),()=>P0(Q)):P0(Q)}}),h1=(Q)=>QJ(Q,Q.length>=2),KY=h1(h9),j_=(...Q)=>Q0(()=>Y5(Q.length===1?Q[0]():Q[1].call(Q[0].self))),XJ=(Q,...X)=>{let Y=X.length===0?function(){return Q0(()=>Y5(Q.apply(this,arguments)))}:function(){let $=Q0(()=>Y5(Q.apply(this,arguments)));for(let J=0;J<X.length;J++)$=X[J]($,...arguments);return $};return YJ(Q.length,Y)},YJ=(Q,X)=>Object.defineProperty(X,"length",{value:Q,configurable:!0}),eV=k$(2),T_=function(){let Q=typeof arguments[0]==="string",X=Q?arguments[0]:"Effect.fn",Y=Q?arguments[1]:void 0,$=Q6();i1(2);let J=new globalThis.Error;if(i1($),Q)return(Z,...G)=>Q_(X,Z,J,G,Q,Y);return Q_(X,arguments[0],J,Array.prototype.slice.call(arguments,1),Q,Y)},Q_=(Q,X,Y,$,J,Z)=>{let G=typeof X==="function"?X:$.pop().bind(X.self);return YJ(G.length,function(...W){let H=Q0(()=>{let _=G.apply(this,arguments);return r(_)?_:Y5(_)});for(let _=0;_<$.length;_++)H=$[_](H,...W);if(!r(H))return H;let K=Q6();i1(2);let V=new globalThis.Error;return i1(K),C4(J?MQ(Q,Z,(_)=>c$(H,_)):H,OQ,(_)=>({name:Q,stack:eV(()=>V.stack),parent:{name:`${Q} (definition)`,stack:eV(()=>Y.stack),parent:_}}))})},I_=(Q,...X)=>YJ(Q.length,X.length===0?function(){return X_(()=>Q.apply(this,arguments))}:function(){let Y=X_(()=>Q.apply(this,arguments));for(let $ of X)Y=$(Y);return Y}),X_=(Q)=>{try{let X=Q(),Y=void 0;while(!0){let $=X.next(Y);if($.done)return j($.value);let J=$.value;if(J&&J._tag==="Success"){Y=J.value;continue}else if(J&&J._tag==="Failure")return $.value;else{let Z=!0;return Q0(()=>{if(Z)return Z=!1,S($.value,(G)=>Y5(X,G));else return Q0(()=>Y5(Q()))})}}}catch(X){return K6(X)}},Y5=V8({op:"Iterator",single:!1,[I1](Q,X){let Y=this[J0][0];while(!0){let $=Y.next(Q);if($.done)return j($.value);if(!w1($.value))return X._stack.push(this),$.value;else if($.value._tag==="Failure")return $.value;Q=$.value.value}},[c0](Q){return this[I1](this[J0][1],Q)}}),Q8=U(2,(Q,X)=>{let Y=j(X);return S(Q,($)=>Y)}),VY=(Q)=>M0(Q,R),E_=(Q)=>G9(Q,{onFailure:j,onSuccess:E0}),V6=U(2,(Q,X)=>S(Q,(Y)=>r(X)?X:V0(()=>X(Y)))),Z9=U(2,(Q,X)=>S(Q,(Y)=>Q8(r(X)?X:V0(()=>X(Y)),Y))),EQ=(Q)=>S(Q,(X)=>e1),S_=(Q)=>O8(Q,E0),$J=(Q,X)=>e((Y)=>h1(($)=>{let J=M1(Q),Z=J.length,G=0,W=!1,H=new Set,K=[],V=(_,q,D)=>{if(G++,_._tag==="Failure"){if(K.push(..._.cause.reasons),G>=Z)$(P0(N4(K)));return}let B=!W;if(W=!0,$(H.size===0?_:S(I4(J9(H)),()=>_)),B&&X?.onWinner)X.onWinner({fiber:q,index:D,parentFiber:Y})};for(let _=0;_<Z;_++){let q=W9(Y,J[_],!0,!0,!1);if(H.add(q),q.addObserver((D)=>{H.delete(q),V(D,q,_)}),W)break}return J9(H)})),JJ=(Q,X)=>e((Y)=>h1(($)=>{let J=!1,Z=new Set,G=(H)=>{J=!0,$(Z.size===0?H:S(I4(J9(Z)),()=>H))},W=0;for(let H of Q){if(J)break;let K=W++,V=W9(Y,H,!0,!0,!1);Z.add(V),V.addObserver((_)=>{Z.delete(V);let q=!J;if(G(_),q&&X?.onWinner)X.onWinner({fiber:V,index:K,parentFiber:Y})})}return J9(Z)})),v_=U((Q)=>r(Q[1]),(Q,X,Y)=>$J([Q,X],Y)),_Y=U((Q)=>r(Q[1]),(Q,X,Y)=>JJ([Q,X],Y)),S=U(2,(Q,X)=>{let Y=Object.create(kT);return Y[J0]=Q,Y[I1]=X.length!==1?($)=>X($):X,Y}),kT=L4({op:"OnSuccess",[c0](Q){return Q._stack.push(this),this[J0]}}),x_=U(2,(Q,X)=>{if(w1(Q))return Q._tag==="Success"?X.onSuccess(Q.value):X.onFailure(Q.cause);return $4(Q,X)}),w1=(Q)=>(o6 in Q),b_=U(2,(Q,X)=>{if(w1(Q))return Q._tag==="Success"?X(Q.value):Q;return S(Q,X)}),k_=(Q)=>S(Q,u),M0=U(2,(Q,X)=>S(Q,(Y)=>j(V0(()=>X(Y))))),y_=U(2,(Q,X)=>w1(Q)?WJ(Q,X):M0(Q,X)),g_=U(2,(Q,X)=>w1(Q)?HJ(Q,X):OJ(Q,X)),h_=U(2,(Q,X)=>w1(Q)?KJ(Q,X):FJ(Q,X)),m_=U(2,(Q,X)=>{if(w1(Q)){if(Q._tag==="Success")return Q;let Y=z8(Q.cause);if(_0(Y))return Q;return X(Y.success)}return X8(Q,X)}),d_=(Q)=>g1(J5(Q)),W5=(Q)=>Q._tag==="Success",p_=(Q)=>Q._tag==="Success"?t(Q):i(Q),f_=(Q)=>Q._tag==="Success"?t(Q.value):i(Q),ZJ=(Q)=>Q._tag==="Failure",c_=(Q)=>Q._tag==="Failure"?t(Q):i(Q),SQ=(Q)=>Q._tag==="Failure"?t(Q.cause):i(Q),GJ=Q5(SQ,z8),u_=Q5(SQ,TQ),l_=(Q)=>Q._tag==="Failure"&&YY(Q.cause),o_=(Q)=>Q._tag==="Failure"&&XY(Q.cause),r_=(Q)=>Q._tag==="Failure"&&l$(Q.cause),e1=t0(void 0),WJ=U(2,(Q,X)=>Q._tag==="Success"?t0(X(Q.value)):Q),HJ=U(2,(Q,X)=>{if(Q._tag==="Success")return Q;let Y=z8(Q.cause);if(_0(Y))return Q;return a8(X(Y.success))}),KJ=U(2,(Q,X)=>{if(Q._tag==="Success")return t0(X.onSuccess(Q.value));let Y=z8(Q.cause);if(_0(Y))return Q;return a8(X.onFailure(Y.success))}),yT=U(2,(Q,X)=>W5(Q)?t0(X):Q);var i_=U(2,(Q,X)=>W5(Q)?X.onSuccess(Q.value):X.onFailure(Q.cause)),n_=yT(void 0),VJ=(Q)=>{let X=[];for(let Y of Q)if(Y._tag==="Failure")X.push(...Y.cause.reasons);return X.length===0?e1:g1(N4(X))},a_=(Q)=>W5(Q)?R(Q.value):d(),s_=(Q)=>ZJ(Q)?R(Q.cause):d(),t_=(Q)=>{let X=GJ(Q);return _0(X)?d():R(X.success)},e_=(Q)=>Q,Qq=(Q)=>e((X)=>j(NV(X.context,Q))),gT=(Q)=>e((X)=>X.context.mapUnsafe.has(Q.key)?j(t8(X.context,Q)):E0(new s8)),H5=U(2,(Q,X)=>e((Y)=>{let $=Y.context,J=X($);if($===J)return Q;return Y.setContext(J),_5(Q,()=>{Y.setContext($);return})})),C4=U(3,(Q,X,Y)=>H5(Q,($)=>{let J=t8($,X),Z=Y(J);if(J===Z)return $;return a1($,X,Z)})),Xq=(Q,X,Y)=>I4(e(($)=>{let J=t8($.context,Q),Z=X(J);return $.setContext(a1($.context,Q,Z)),T4(t8($.context,V5),(G)=>{let W=t8($.context,Q),H;if(Y?.reset===void 0){if(W!==Z)return $0;H=J}else H=Y.reset(J,Z,W);return $.setContext(a1($.context,Q,H)),$0})})),_J=()=>hT,hT=e((Q)=>j(Q.context)),_6=(Q)=>e((X)=>Q(X.context)),Yq=U(2,(Q,X)=>H5(Q,V1(X))),j4=U(2,(Q,X)=>{if(w1(Q))return Q;return H5(Q,d7(X))}),m1=function(){if(arguments.length===1)return U(2,(Q,X)=>Y_(Q,arguments[0],X));return U(3,(Q,X,Y)=>Y_(Q,X,Y)).apply(this,arguments)},Y_=(Q,X,Y)=>H5(Q,($)=>{if($.mapUnsafe.get(X.key)===Y)return $;return a1($,X,Y)}),qY=U(3,(Q,X,Y)=>S(Y,($)=>m1(Q,X,$))),$q=U((Q)=>r(Q[1]),(Q,X,Y)=>qJ(Q,X,($,J)=>[$,J],Y)),qJ=U((Q)=>r(Q[1]),(Q,X,Y,$)=>$?.concurrent?M0(hQ([Q,X],{concurrency:2}),([J,Z])=>V0(()=>Y(J,Z))):S(Q,(J)=>M0(X,(Z)=>V0(()=>Y(J,Z))))),Jq=U((Q)=>r(Q[0]),(Q,X,Y)=>bJ(Q,X,Y?($)=>E0(Y($)):()=>E0(new s8))),Zq=U(2,(Q,X)=>S(X,(Y)=>Y?VY(Q):IQ)),DJ=U(2,(Q,X)=>Array.from({length:X},()=>Q)),Gq=U((Q)=>r(Q[0]),(Q,X,Y)=>hQ(DJ(Q,X),Y)),DY=U((Q)=>r(Q[0]),(Q,X)=>E4({while:n4,body:V1(X?.disableYield?Q:S(Q,(Y)=>G5)),step:h9})),O8=U(2,(Q,X)=>{let Y=Object.create(mT);return Y[J0]=Q,Y[K8]=X.length!==1?($)=>X($):X,Y}),mT=L4({op:"OnFailure",[c0](Q){return Q._stack.push(this),this[J0]}}),UJ=U(3,(Q,X,Y)=>O8(Q,($)=>{if(!X($))return P0($);return V0(()=>Y($))})),K5=U(3,(Q,X,Y)=>O8(Q,($)=>{let J=X($);return _0(J)?P0(J.failure):V0(()=>Y(J.success,$))})),X8=U(2,(Q,X)=>K5(Q,z8,(Y)=>X(Y))),Wq=(Q)=>G9(Q,{onFailure:(X)=>v7(X)?IQ:E0(X),onSuccess:t$}),Hq=U(2,(Q,X)=>K5(Q,TQ,X)),Kq=U(2,(Q,X)=>O8(Q,(Y)=>V6(V0(()=>X(Y)),P0(Y)))),Vq=U(3,(Q,X,Y)=>UJ(Q,X,($)=>V6(V0(()=>Y($)),P0($)))),UY=U(3,(Q,X,Y)=>O8(Q,($)=>{let J=X($);if(_0(J))return P0($);return V6(V0(()=>Y(J.success,$)),P0($))})),BJ=U(2,(Q,X)=>UY(Q,z8,(Y)=>X(Y))),_q=U(3,(Q,X,Y)=>{let $=Array.isArray(X)?(J)=>C(J,"_tag")&&X.includes(J._tag):c6(X);return BJ(Q,(J)=>$(J)?Y(J):$0)}),qq=U(2,(Q,X)=>UY(Q,TQ,(Y)=>X(Y))),vQ=U((Q)=>r(Q[0]),(Q,X,Y,$)=>O8(Q,(J)=>{let Z=z8(J);if(_0(Z))return P0(Z.failure);if(!X(Z.success))return $?V0(()=>$(Z.success)):P0(J);return V0(()=>Y(Z.success))})),BY=U((Q)=>r(Q[0]),(Q,X,Y,$)=>O8(Q,(J)=>{let Z=z8(J);if(_0(Z))return P0(Z.failure);let G=X(Z.success);if(_0(G))return $?V0(()=>$(G.failure)):P0(J);return V0(()=>Y(G.success))})),zJ=U((Q)=>r(Q[0]),(Q,X,Y,$)=>{let J=Array.isArray(X)?(Z)=>C(Z,"_tag")&&X.includes(Z._tag):c6(X);return vQ(Q,J,Y,$)}),Dq=U((Q)=>r(Q[0]),(Q,X,Y)=>{let $;return BY(Q,(J)=>{return $??=Object.keys(X),C(J,"_tag")&&C8(J._tag)&&$.includes(J._tag)?t(J):i(J)},(J)=>V0(()=>X[J._tag](J)),Y)}),Uq=U((Q)=>r(Q[0]),(Q,X,Y,$,J)=>vQ(Q,(Z)=>c6(Z,X)&&C(Z,"reason"),(Z)=>{let G=Z.reason;if(c6(G,Y))return $(G,Z);return J?V0(()=>J(G,Z)):E0(Z)})),Bq=U((Q)=>r(Q[0]),(Q,X,Y,$)=>{let J;return vQ(Q,(Z)=>c6(Z,X)&&C(Z,"reason")&&C(Z.reason,"_tag")&&C8(Z.reason._tag),(Z)=>{let G=Z.reason;if(J??=Object.keys(Y),J.includes(G._tag))return V0(()=>Y[G._tag](G,Z));return $?V0(()=>$(G,Z)):E0(Z)})}),zq=U(2,(Q,X)=>BY(Q,(Y)=>{if(c6(Y,X)&&C(Y,"reason"))return t(Y.reason);return i(Y)},E0)),OJ=U(2,(Q,X)=>X8(Q,(Y)=>HY(()=>X(Y)))),FJ=U(2,(Q,X)=>G9(Q,{onFailure:(Y)=>HY(()=>X.onFailure(Y)),onSuccess:(Y)=>K0(()=>X.onSuccess(Y))})),RJ=(Q)=>X8(Q,K6),Oq=U(2,(Q,X)=>X8(Q,(Y)=>K0(X))),Fq=(Q)=>Q0(()=>{let X=Q[Symbol.iterator](),Y=X.next();if(Y.done)return K6(Error("Received an empty collection of effects"));function $(J){let Z=X.next();if(Z.done)return J.value;return X8(J.value,(G)=>$(Z))}return $(Y)}),NJ=(Q)=>X8(Q,(X)=>S(G5,()=>NJ(Q))),Rq=U((Q)=>r(Q[0]),(Q,X)=>{if(!X?.log)return G9(Q,{onFailure:($)=>$0,onSuccess:($)=>$0});let Y=E8(X.log===!0?void 0:X.log);return $4(Q,{onFailure($){let J=o$($);return _0(J)?P0(J.failure):X.message===void 0?Y($):Y(X.message,$)},onSuccess:($)=>$0})}),Nq=U((Q)=>r(Q[0]),(Q,X)=>{if(!X?.log)return $4(Q,{onFailure:($)=>$0,onSuccess:($)=>$0});let Y=E8(X.log===!0?void 0:X.log);return $4(Q,{onFailure:($)=>X.message===void 0?Y($):Y(X.message,$),onSuccess:($)=>$0})}),Lq=(Q)=>zY(Q,{onFailure:d,onSuccess:R}),H6=(Q)=>xQ(Q,{onFailure:i,onSuccess:t}),$4=U(2,(Q,X)=>{let Y=Object.create(dT);return Y[J0]=Q,Y[I1]=X.onSuccess.length!==1?($)=>X.onSuccess($):X.onSuccess,Y[K8]=X.onFailure.length!==1?($)=>X.onFailure($):X.onFailure,Y}),dT=L4({op:"OnSuccessAndFailure",[c0](Q){return Q._stack.push(this),this[J0]}}),LJ=U(2,(Q,X)=>$4(Q,{onFailure:(Y)=>K0(()=>X.onFailure(Y)),onSuccess:(Y)=>K0(()=>X.onSuccess(Y))})),G9=U(2,(Q,X)=>$4(Q,{onFailure:(Y)=>{let $=Y.reasons.find(t4);return $?V0(()=>X.onFailure($.error)):P0(Y)},onSuccess:X.onSuccess})),zY=U(2,(Q,X)=>G9(Q,{onFailure:(Y)=>K0(()=>X.onFailure(Y)),onSuccess:(Y)=>K0(()=>X.onSuccess(Y))})),xQ=U(2,(Q,X)=>{if(w1(Q)){if(Q._tag==="Success")return t0(X.onSuccess(Q.value));let Y=z8(Q.cause);if(_0(Y))return Q;return t0(X.onFailure(Y.success))}return zY(Q,X)}),Mq=U(2,(Q,X)=>{if(w1(Q)){if(Q._tag==="Success")return t0(X.onSuccess(Q.value));return t0(X.onFailure(Q.cause))}return LJ(Q,X)}),bQ=(Q)=>w1(Q)?t0(Q):pT(Q),pT=V8({op:"Exit",[c0](Q){return Q._stack.push(this),this[J0]},[I1](Q,X,Y){return j(Y??t0(Q))},[K8](Q,X,Y){return j(Y??g1(Q))}}),wq=xQ({onFailure:()=>!0,onSuccess:()=>!1}),Pq=xQ({onFailure:()=>!1,onSuccess:()=>!0}),Aq=U(2,(Q,X)=>V6(K9(X),Q)),MJ=U(2,(Q,X)=>_Y(Q,S(K9(X.duration),X.orElse))),Cq=U(2,(Q,X)=>MJ(Q,{duration:X,orElse:()=>E0(new wY)})),jq=U(2,(Q,X)=>_Y(VY(Q),Q8(K9(X),d()))),Tq=(Q)=>H9((X)=>{let Y=X.currentTimeNanosUnsafe();return M0(Q,($)=>[Y4(X.currentTimeNanosUnsafe()-Y),$])}),d$="~effect/Scope",p$="~effect/Scope/Closeable",V5=q8("effect/Scope"),wJ=(Q,X)=>Q0(()=>OY(Q,X)??$0),OY=(Q,X)=>{if(Q.state._tag==="Closed")return;let Y={_tag:"Closed",exit:X};if(Q.state._tag==="Empty"){Q.state=Y;return}let{finalizers:$}=Q.state;if(Q.state=Y,$.size===0)return;else if($.size===1)return $.values().next().value(X);return fT(Q,$,X)},fT=XJ(function*(Q,X,Y){let $=[],J=[],Z=Array.from(X.values()),G=GY();for(let W=Z.length-1;W>=0;W--){let H=Z[W];if(Q.strategy==="sequential")$.push(yield*bQ(H(Y)));else J.push(W9(G,H(Y),!0,!0,"inherit"))}if(J.length>0)$=yield*a$(J);return yield*VJ($)});var Iq=(Q,X)=>{let Y=kQ(X);if(Q.state._tag==="Closed")return Y.state=Q.state,Y;let $={};return QY(Q,$,(J)=>wJ(Y,J)),QY(Y,$,(J)=>K0(()=>Eq(Q,$))),Y},T4=(Q,X)=>{return Q0(()=>{if(Q.state._tag==="Closed")return X(Q.state.exit);return QY(Q,{},X),$0})};var QY=(Q,X,Y)=>{if(Q.state._tag==="Empty")Q.state={_tag:"Open",finalizers:new Map([[X,Y]])};else if(Q.state._tag==="Open")Q.state.finalizers.set(X,Y)},Eq=(Q,X)=>{if(Q.state._tag==="Open")Q.state.finalizers.delete(X)},kQ=(Q="sequential")=>({[p$]:p$,[d$]:d$,strategy:Q,state:cT}),cT={_tag:"Empty"};var yQ=V5;var PJ=(Q)=>e((X)=>{let Y=X.context,$=kQ();return X.setContext(a1(X.context,V5,$)),_5(Q,(J)=>{return X.setContext(Y),OY($,J)})});var FY=(Q)=>Q0(()=>{let X=kQ();return v1(Q(X),(Y)=>Q0(()=>OY(X,Y)??$0))}),RY=(Q,X,Y)=>_6(($)=>gQ((J)=>S(yQ,(Z)=>Z9(Y?.interruptible?J(Q):Q,(G)=>T4(Z,(W)=>j4(X(G,W),$)))))),AJ=(Q)=>S(yQ,(X)=>_6((Y)=>T4(X,($)=>j4(Q($),Y)))),_5=V8({op:"OnExit",single:!1,[c0](Q){return Q._stack.push(this),this[J0][0]},[s4](Q){if(Q.interruptible&&this[J0][2]!==!0)Q._stack.push(NY),Q.interruptible=!1},[I1](Q,X,Y){Y??=t0(Q);let $=this[J0][1](Y);return $?S($,(J)=>Y):Y},[K8](Q,X,Y){Y??=g1(Q);let $=this[J0][1](Y);return $?S($,(J)=>Y):Y}}),v1=U(2,_5),Sq=U(2,(Q,X)=>v1(Q,(Y)=>X)),CJ=U(3,(Q,X,Y)=>v1(Q,($)=>{if(!X($))return $0;return Y($)})),jJ=U(3,(Q,X,Y)=>v1(Q,($)=>{let J=X($);return _0(J)?$0:Y(J.success,$)})),TJ=U(2,(Q,X)=>jJ(Q,SQ,X)),vq=U(3,(Q,X,Y)=>CJ(Q,($)=>{if($._tag!=="Failure")return!1;return X($.cause)},($)=>Y($.cause))),IJ=U(3,(Q,X,Y)=>v1(Q,($)=>{if($._tag!=="Failure")return $0;let J=X($.cause);return _0(J)?$0:Y(J.success,$.cause)})),xq=U(2,(Q,X)=>IJ($Y,X)(Q)),bq=(Q,X,Y)=>gQ(($)=>S(Q,(J)=>_5($(X(J)),(Z)=>Y(J,Z),!0))),kq=(Q)=>RY(Q,(X)=>C(X,Symbol.asyncDispose)?e$(()=>X[Symbol.asyncDispose]()):K0(()=>X[Symbol.dispose]())),EJ=U(2,(Q,X)=>K0(()=>{let Y=W6(s1(X)),$=Number.isFinite(Y),J=rT(!1),Z=0,G=!1,W,H=S(J.await,()=>W);return[e((K)=>{let V=K.getRef(J4),_=$?V.currentTimeMillisUnsafe():0;if(G||_<Z)return W??H;return G=!0,J.closeUnsafe(),W=void 0,v1(Q,(q)=>K0(()=>{G=!1,Z=V.currentTimeMillisUnsafe()+Y,W=q,J.openUnsafe()}))}),K0(()=>{Z=0,J.closeUnsafe(),W=void 0})]})),SJ=U(2,(Q,X)=>M0(EJ(Q,X),(Y)=>Y[0])),yq=(Q)=>SJ(Q,P4),gq=e((Q)=>P0(J5(Q.id))),I4=(Q)=>e((X)=>{if(!X.interruptible)return Q;return X.interruptible=!1,X._stack.push(NY),Q}),hq=V8({op:"SetInterruptible",[s4](Q){if(Q.interruptible=this[J0],Q._interruptedCause&&Q.interruptible)return()=>P0(Q._interruptedCause)}}),NY=hq(!0),uT=hq(!1),mq=(Q)=>{if(Q.interruptible=!0,Q._stack.push(uT),Q._interruptedCause)return P0(Q._interruptedCause)},vJ=(Q)=>e((X)=>{if(X.interruptible)return Q;return mq(X)??Q}),gQ=(Q)=>e((X)=>{if(!X.interruptible)return Q(u);return X.interruptible=!1,X._stack.push(NY),Q(vJ)}),dq=(Q)=>e((X)=>{if(X.interruptible)return Q(u);let Y=mq(X),$=Q(I4);return Y??$}),pq=M0(RY(K0(()=>new AbortController),(Q)=>K0(()=>Q.abort())),(Q)=>Q.signal),hQ=(Q,X)=>{if(B4(Q))return X?.mode==="result"?t1(Q,H6,X):t1(Q,u,X);else if(X?.discard)return X.mode==="result"?t1(Object.values(Q),H6,X):t1(Object.values(Q),u,X);return Q0(()=>{let Y={};return Q8(t1(Object.entries(Q),([$,J])=>M0(X?.mode==="result"?H6(J):J,(Z)=>{b(Y,$,Z)}),{discard:!0,concurrency:X?.concurrency}),Y)})},xJ=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X,Y)=>M0(t1(Q,($,J)=>H6(X($,J)),Y),($)=>j$($,u))),fq=U(3,(Q,X,Y)=>{let $=M1(Q);if($.length===0)return K0(X);return Q0(()=>{let J=0,Z=X();return M0(E4({while:()=>J<$.length,body:()=>Y(Z,$[J],J),step(G){Z=G,J++}}),()=>Z)})}),cq=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X,Y)=>S(xJ(Q,X,{concurrency:Y?.concurrency}),([$,J])=>{if(e8($))return E0($);return Y?.discard?$0:j(J)})),uq=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X)=>Q0(()=>{let Y=Q[Symbol.iterator](),$=Y.next();if(!$.done)return lq(Y,0,X,$.value);return j(d())})),lq=(Q,X,Y,$)=>S(Y($,X),(J)=>{if(J)return j(R($));let Z=Q.next();if(!Z.done)return lq(Q,X+1,Y,Z.value);return j(d())}),oq=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X)=>Q0(()=>{let Y=Q[Symbol.iterator](),$=Y.next();if(!$.done)return rq(Y,0,X,$.value);return j(d())})),rq=(Q,X,Y,$)=>S(Y($,X),(J)=>{if(E1(J))return j(R(J.success));let Z=Q.next();if(!Z.done)return rq(Q,X+1,Y,Z.value);return j(d())}),E4=V8({op:"While",[I1](Q,X){if(this[J0].step(Q),this[J0].while())return X._stack.push(this),this[J0].body();return e1},[c0](Q){if(this[J0].while())return Q._stack.push(this),this[J0].body();return e1}}),t1=U((Q)=>typeof Q[1]==="function",(Q,X,Y)=>Q0(()=>{let $=Y?.concurrency??1,J=$==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,$);if(J===1)return lT(Q,X,Y);let Z=M1(Q),G=Z.length;if(G===0)return Y?.discard?$0:j([]);let W=Y?.discard?void 0:Array(G),H=oT({f:X,out:W},Z,{concurrency:J});return H?Q8(H,W):j(W)})),lT=(Q,X,Y)=>Q0(()=>{let $=Y?.discard?void 0:[],J=Q[Symbol.iterator](),Z=J.next(),G=0;return Q8(E4({while:()=>!Z.done,body:()=>X(Z.value,G++),step:(W)=>{if($)$.push(W);Z=J.next()}}),$)}),iq=(Q)=>{let{onItem:X,step:Y}=Q;return($,J,Z)=>{let G=Z?.start??0,W=Z?.end??J.length,H=Z?.concurrency??1,K=Z?.orderedStep===!0&&H>1,V=!1,_,q,D,B=!1,F,N,M=G,w=K?Array(W):void 0,A=(x)=>{let I=j8(x);return F=I,V=!0,B=!0,q&&q.size>0?S(I4(J9(Array.from(q))),()=>I):I},s=(x,I,W0)=>{if(!K)return Y($,x,I,W0);if(F)return F;w[W0]=I;while(M<W){let T0=w[M];if(T0===void 0)return;w[M]=void 0;let o1=M++,F1=Y($,J[o1],T0,o1);if(F1)return F1}},L=()=>{let x=!1;for(;!F&&G<W;G++){let I=J[G],W0=N??X($,I,G);if(w1(W0)){if(F=s(I,W0,G),F)break}else if(H===1)return S(bQ(W0),(T0)=>{return F=s(I,T0,G),G++,F??L()??$0});else if(!_)return h1((T0)=>{_=GY(),q=new Set,N=W0,D=T0;let o1;try{o1=L()}catch(F1){return T0(A(F1))}if(o1)return T0(o1);return Q0(()=>{return F=e1,B=!0,q?J9(q):$0})});else{N=void 0;let T0=W9(_,W0,!0,!0,"inherit");if(T0._exit){if(F=s(I,T0._exit,G),F)break;continue}q.add(T0);let o1=G;if(T0.addObserver((F1)=>{q.delete(T0);try{if(F){if(!B&&F1._tag==="Failure")for(let x0 of F1.cause.reasons)if(x0._tag==="Interrupt")continue;else if(F._tag==="Failure")F.cause.reasons.push(x0);else F=g1(N4([x0]))}else{let x0=s(I,F1,o1);if(x0)F=x0._tag==="Failure"?g1(N4(x0.cause.reasons.slice())):x0,L()}if(x){let x0=L();if(x0)D(x0)}else if(V&&q.size===0)D(F??$0)}catch(x0){D(A(x0))}}),q.size<H)continue;x=!0,G++;return}}if(V=!0,F){if(q&&q.size>0){let I=WY(_);q.forEach((W0)=>W0.interruptUnsafe(_.id,I));return}if(D||F._tag==="Failure")return F}else if(D){if(!q)return e1;else if(q.size===0)D($0)}};return L()}},mQ=()=>iq,oT=iq({onItem(Q,X,Y){return Q.f(X,Y)},step(Q,X,Y,$){if(Y._tag==="Failure")return Y;else if(Q.out)Q.out[$]=Y.value}}),bJ=U(3,(Q,X,Y)=>S(Q,($)=>X($)?j($):Y($))),kJ=U(3,(Q,X,Y)=>S(Q,($)=>{let J=X($);return _0(J)?Y(J.failure):j(J.success)})),nq=U((Q)=>r(Q[0]),(Q,X,Y)=>kJ(Q,X,Y?($)=>E0(Y($)):()=>E0(new s8))),aq=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X,Y)=>Q0(()=>{let $=[];return Q8(t1(Q,(J,Z)=>{let G=X(J,Z);if(typeof G==="boolean"){if(G)$.push(J);return $0}return M0(G,(W)=>{if(W)$.push(J)})},{discard:!0,concurrency:Y?.concurrency}),$)})),sq=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X)=>Q0(()=>{let Y=[];for(let $ of Q){let J=X($);if(E1(J))Y.push(J.success)}return j(Y)})),tq=U((Q)=>B4(Q[0])&&!r(Q[0]),(Q,X,Y)=>Q0(()=>{let $=[];return Q8(t1(Q,(J)=>M0(X(J),(Z)=>{if(E1(Z))$.push(Z.success)}),{discard:!0,concurrency:Y?.concurrency}),$)})),eq=j({}),QD=YV(M0),XD=$V(M0,S),YD=XV(M0);var $D=U((Q)=>r(Q[0]),(Q,X)=>e((Y)=>{return _I(),j(W9(Y,Q,X?.startImmediately,!1,X?.uninterruptible??!1))})),W9=(Q,X,Y=!1,$=!1,J=!1)=>{let Z=J==="inherit"?Q.interruptible:!J,G=new n$(Q.context,Z);if(Y)G.evaluate(X);else Q.currentDispatcher.scheduleTask(()=>G.evaluate(X),0);if(!$&&!G._exit)Q.children().add(G),G.addObserver(()=>Q._children.delete(G));return G},JD=U((Q)=>r(Q[0]),(Q,X)=>e((Y)=>j(W9(Y,Q,X?.startImmediately,!0,X?.uninterruptible)))),ZD=(Q)=>e((X)=>{let Y=X._children&&new Set(X._children);return v1(Q,($)=>{let J=X._children;if(J===void 0||J.size===0)return $0;else if(Y)J=CV(J,(Z)=>!Y.has(Z));return EQ(a$(J))})}),yJ=U((Q)=>r(Q[0]),(Q,X,Y)=>e(($)=>{let J=W9($,Q,Y?.startImmediately,!0,Y?.uninterruptible);if(!J._exit)if(X.state._tag!=="Closed"){let Z={};QY(X,Z,()=>P_((W)=>W===J.id?$0:vT(J))),J.addObserver(()=>Eq(X,Z))}else J.interruptUnsafe($.id,WY($));return j(J)})),GD=U((Q)=>r(Q[0]),(Q,X)=>S(yQ,(Y)=>yJ(Q,Y,X))),S4=(Q)=>(X,Y)=>{let $=new n$(Y?.scheduler?a1(Q,zQ,Y.scheduler):Q,Y?.uninterruptible!==!0);if($.evaluate(X),$._exit)return $;if(Y?.signal)if(Y.signal.aborted)$.interruptUnsafe();else{let J=()=>$.interruptUnsafe();Y.signal.addEventListener("abort",J,{once:!0}),$.addObserver(()=>Y.signal.removeEventListener("abort",J))}if(Y?.onFiberStart)Y.onFiberStart($);return $};var WD=S4(D8()),gJ=(Q)=>{let X=S4(Q);return(Y,$)=>{let J=X(Y,$);if($?.onExit)J.addObserver($.onExit);return(Z)=>{return J.interruptUnsafe(Z)}}},HD=gJ(D8()),LY=(Q)=>{let X=S4(Q);return(Y,$)=>{let J=X(Y,$);return new Promise((Z)=>{J.addObserver((G)=>Z(G))})}},KD=LY(D8()),hJ=(Q)=>{let X=LY(Q);return(Y,$)=>X(Y,$).then((J)=>{if(J._tag==="Failure")throw JY(J.cause);return J.value})},VD=hJ(D8()),MY=(Q)=>{let X=S4(Q);return(Y)=>{if(w1(Y))return Y;let $=new X5("sync"),J=X(Y,{scheduler:$});return J._dispatcher?.flush(),J._exit??j8(new PY(J))}},_D=MY(D8()),mJ=(Q)=>{let X=MY(Q);return(Y)=>{let $=X(Y);if($._tag==="Failure")throw JY($.cause);return $.value}},qD=mJ(D8()),$_=j(!0),J_=j(!1);class DD{waiters=[];scheduled=void 0;_isOpen;constructor(Q){this._isOpen=Q}scheduleUnsafe(Q){if(this.waiters.length===0)return $_;if(this.scheduled===void 0)this.scheduled=this.waiters,Q.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let X=0;X<this.waiters.length;X++)this.scheduled.push(this.waiters[X]);return this.waiters=[],$_}flushScheduled=()=>{if(this.scheduled===void 0)return;let Q=this.scheduled;this.scheduled=void 0;for(let X=0;X<Q.length;X++)Q[X](e1)};flushWaiters(){let Q=this.waiters;this.waiters=[],this.flushScheduled();for(let X=0;X<Q.length;X++)Q[X](e1)}open=e((Q)=>{if(this._isOpen)return J_;return this._isOpen=!0,this.scheduleUnsafe(Q)});release=e((Q)=>this._isOpen?J_:this.scheduleUnsafe(Q));openUnsafe(){if(this._isOpen)return!1;return this._isOpen=!0,this.flushWaiters(),!0}await=h1((Q)=>{if(this._isOpen)return Q($0);return this.waiters.push(Q),K0(()=>{let X=this.waiters.indexOf(Q);if(X!==-1)this.waiters.splice(X,1);else if(this.scheduled!==void 0){if(X=this.scheduled.indexOf(Q),X!==-1)this.scheduled.splice(X,1)}})});closeUnsafe(){if(!this._isOpen)return!1;return this._isOpen=!1,!0}close=K0(()=>this.closeUnsafe());whenOpen=(Q)=>S(this.await,()=>Q);isOpen(){return this._isOpen}}var rT=(Q)=>new DD(Q??!1);var UD=e((Q)=>j(Q.getRef(a7))),BD=U(2,(Q,X)=>m1(Q,a7,X)),zD=m1(s7),OD=m1(FQ),f$=BigInt(0),iT={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:f$,endTime:f$,exit:e1},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},nT=(Q)=>Object.assign(Object.create(iT),Q),FD=(Q)=>{if(!Q)return d();return n1(Q.annotations,n7)?Q._tag==="Span"?FD(e6(Q.parent)):d():R(Q)},dJ=(Q,X,Y)=>{let $=!Q.getRef(s7)||Y?.annotations&&n1(Y.annotations,n7),J=Y?.parent!==void 0?R(Y.parent):Y?.root?d():FD(Q.currentSpan),Z;if($)Z=nT({name:X,parent:J,annotations:a1(Y?.annotations??D8(),n7,!0)});else{let G=Q.getRef(a7),W=Q.getRef(J4),H=Q.getRef(FQ),K=Q.getRef(RQ),V=Q.getRef(NQ),_=Y?.level??Q.getRef(rV),q=Y?.links!==void 0?[...V,...Y.links]:V.slice();Z=G.span({name:X,parent:J,annotations:Y?.annotations??D8(),links:q,startTime:H?W.currentTimeNanosUnsafe():BigInt(0),kind:Y?.kind??"internal",root:Y?.root??I0(J),sampled:Y?.sampled??(L1(J)&&J.value.sampled===!1?!1:!yD(Q.getRef(iV),_))});for(let[D,B]of Object.entries(K))Z.attribute(D,B);if(Y?.attributes!==void 0)for(let[D,B]of Object.entries(Y.attributes))Z.attribute(D,B)}return Z},RD=(Q,X)=>e((Y)=>j(dJ(Y,Q,X))),LQ=(Q,X)=>I4(e((Y)=>{let $=t8(Y.context,V5),J=dJ(Y,Q,X??{}),Z=Y.getRef(J4),G=Y.getRef(FQ);return Q8(T4($,(W)=>sT(J,W,Z,G)),J)})),ND=function(){let Q=typeof arguments[0]!=="string",X=Q?arguments[1]:arguments[0],Y=e7(Q?arguments[2]:arguments[1]);if(Q){let $=arguments[0];return S(LQ(X,Y),(J)=>$5($,J,Y))}return($)=>S(LQ(X,Y),(J)=>$5($,J,Y))},aT=(Q,X)=>{return X=typeof X==="function"?X:i8,C4(OQ,(Y)=>({name:Q,stack:X,parent:Y}))},LD=RQ,MD=NQ,wD=U((Q)=>r(Q[0]),(Q,X,Y={})=>{let J=(Array.isArray(X)?X:[X]).map((Z)=>({span:Z,attributes:Y}));return C4(Q,NQ,(Z)=>[...Z,...J])}),sT=(Q,X,Y,$)=>K0(()=>{if(Q.status._tag==="Ended")return;Q.end($?Y.currentTimeNanosUnsafe():f$,X)}),MQ=(Q,...X)=>{let Y=X.length===1?void 0:X[0],$=X[X.length-1];return e((J)=>{let Z=dJ(J,Q,Y),G=J.getRef(J4);return v1(V0(()=>$(Z)),(W)=>K0(()=>{if(Z.status._tag==="Ended")return;Z.end(G.currentTimeNanosUnsafe(),W)}))})},c$=m1(i7),$5=function(){let Q=r(arguments[0]),X=Q?arguments[1]:arguments[0],Y=Q?arguments[2]:arguments[1],$=u;if(X._tag==="Span")Y=e7(Y),$=aT(X.name,Y?.captureStackTrace);if(Q)return c$($(arguments[0]),X);return(J)=>c$($(J),X)},PD=function(){let Q=typeof arguments[0]!=="string",X=Q?arguments[1]:arguments[0],Y=e7(arguments[2]);if(Q){let Z=arguments[0];return MQ(X,arguments[2],(G)=>$5(Z,G,Y))}let $=typeof arguments[1]==="function"?arguments[1]:void 0,J=$?void 0:arguments[1];return(Z,...G)=>MQ(X,$?$(...G):J,(W)=>$5(Z,W,Y))},AD=U((Q)=>r(Q[0]),(Q,...X)=>C4(Q,RQ,(Y)=>{let $=X.length===1?{...Y,...X[0]}:{...Y};if(X.length===1)return $;else b($,X[0],X[1]);return $})),CD=(...Q)=>e((X)=>{let Y=X.currentSpanLocal;if(Y)if(Q.length===1)for(let[$,J]of Object.entries(Q[0]))Y.attribute($,J);else Y.attribute(Q[0],Q[1]);return $0}),jD=e((Q)=>{let X=Q.currentSpanLocal;return X?j(X):E0(new s8)}),TD=gT(i7),J4=R0("effect/Clock",{defaultValue:()=>new ID}),y$=2147483647;class ID{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=K0(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return eT()}currentTimeNanos=K0(()=>this.currentTimeNanosUnsafe());sleep(Q){return this.sleepMillis(W6(Q))}sleepMillis(Q){if(Q<=0)return G5;else if(!Number.isFinite(Q))return KY;return h1((X)=>{let Y=Q>y$?this.sleepMillis(Q-y$):$0,$=setTimeout(()=>X(Y),Math.min(Q,y$));return K0(()=>clearTimeout($))})}}var tT=function(){let Q=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*Q;let X;return()=>{return X??=BigInt(Date.now())*Q-BigInt(Math.round(performance.now()*1e6)),X+BigInt(Math.round(performance.now()*1e6))}}(),eT=function(){let Q=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!Q)return tT;let X=BigInt(Date.now())*BigInt(1e6)-Q.bigint();return()=>X+Q.bigint()}(),H9=(Q)=>e((X)=>Q(X.getRef(J4))),K9=(Q)=>H9((X)=>X.sleep(s1(Q))),ED=H9((Q)=>Q.currentTimeMillis);var wQ="~effect/Cause/TimeoutError",SD=(Q)=>C(Q,wQ);class wY extends M4("TimeoutError"){[wQ]=wQ;constructor(Q){super({message:Q})}}var PQ="~effect/Cause/IllegalArgumentError",vD=(Q)=>C(Q,PQ);class pJ extends M4("IllegalArgumentError"){[PQ]=PQ;constructor(Q){super({message:Q})}}var AQ="~effect/Cause/ExceededCapacityError",xD=(Q)=>C(Q,AQ);class fJ extends M4("ExceededCapacityError"){[AQ]=AQ;constructor(Q){super({message:Q})}}var CQ="~effect/Cause/AsyncFiberError",bD=(Q)=>C(Q,CQ);class PY extends M4("AsyncFiberError"){[CQ]=CQ;constructor(Q){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:Q})}}var jQ="~effect/Cause/UnknownError",kD=(Q)=>C(Q,jQ);class dQ extends M4("UnknownError"){[jQ]=jQ;constructor(Q,X){super({message:X,cause:Q})}}var QI=R0("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),XI=(Q)=>{switch(Q){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},YI=F$(D1,XI),yD=Y6(YI),cJ=R0("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([KI,VI])}),$I=R0("effect/Logger/LogToStderr",{defaultValue:O7}),gD=function(){let Q=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return I4(e((X)=>{let Y=X.getRef(A4),$={...Y};for(let J=0;J<Q.length;J++){let[Z,G]=Q[J];b($,Z,G)}return X.setContext(a1(X.context,A4,$)),T4(t8(X.context,V5),(J)=>{let Z=X.getRef(A4),G={...Z};for(let W=0;W<Q.length;W++){let[H,K]=Q[W];if(Z[H]!==K)continue;if(Object.hasOwn(Y,H))b(G,H,Y[H]);else delete G[H]}return X.setContext(a1(X.context,A4,G)),$0})}))},JI="~effect/Logger",ZI={[JI]:{_Message:u,_Output:u},pipe(){return H0(this,arguments)}},hD=(Q)=>{let X=Object.create(ZI);return X.log=Q,X},GI=(Q)=>Q.replace(/[\s="]/g,"_"),WI=(Q,X)=>{return`${GI(Q[0])}=${X-Q[1]}ms`};var E8=(Q)=>(...X)=>{let Y=void 0;for(let $=0,J=X.length;$<J;$++){let Z=X[$];if(c9(Z)){if(Y)X.splice($,1);else X=X.slice(0,$).concat(X.slice($+1));Y=Y?N4(Y.reasons.concat(Z.reasons)):Z,$--}}if(Y===void 0)Y=T7;return e(($)=>{let J=Q??$.currentLogLevel;if(yD($.minimumLogLevel,J))return $0;let Z=$.getRef(J4),G=$.getRef(cJ);if(G.size>0){let W=new Date(Z.currentTimeMillisUnsafe());for(let H of G)H.log({cause:Y,fiber:$,date:W,logLevel:J,message:X})}return $0})};var $9={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},R00={None:[],All:[],Trace:[$9.gray],Debug:[$9.blue],Info:[$9.green],Warn:[$9.yellow],Error:[$9.red],Fatal:[$9.bgBrightRed,$9.black]};var HI=(Q)=>`${Q.getHours().toString().padStart(2,"0")}:${Q.getMinutes().toString().padStart(2,"0")}:${Q.getSeconds().toString().padStart(2,"0")}.${Q.getMilliseconds().toString().padStart(3,"0")}`;var KI=hD(({cause:Q,date:X,fiber:Y,logLevel:$,message:J})=>{let Z=Array.isArray(J)?J.slice():[J];if(Q.reasons.length>0)Z.push(ZY(Q));let G=X.getTime(),W=Y.getRef(t7),H="";for(let q of W)H+=` ${WI(q,G)}`;let K=Y.getRef(A4);if(Object.keys(K).length>0)Z.push(K);let V=Y.getRef(QI);(Y.getRef($I)?V.error:V.log)(`[${HI(X)}] ${$.toUpperCase()} (#${Y.id})${H}:`,...Z)}),VI=hD(({cause:Q,fiber:X,logLevel:Y,message:$})=>{let J=X.getRef(J4),Z=X.getRef(A4),G=X.currentSpan;if(G===void 0||G._tag==="ExternalSpan")return;let W={};for(let[H,K]of Object.entries(Z))b(W,H,K);if(W["effect.fiberId"]=X.id,W["effect.logLevel"]=Y.toUpperCase(),Q.reasons.length>0)W["effect.cause"]=ZY(Q);G.event(cK(Array.isArray($)&&$.length===1?$[0]:$),J.currentTimeNanosUnsafe(),W)});function _I(){m$.interruptChildren??=ET}var uJ=j(void 0);var mD=U((Q)=>r(Q[0]),(Q,X)=>TJ(Q,(Y)=>e(($)=>{return qI($,Y,X?.defectsOnly),$0}))),qI=(Q,X,Y)=>{let $=Q.getRef(sV);if($.size===0)return;if(Y&&!XY(X))return;let J={cause:X,fiber:Q,timestamp:Q.getRef(J4).currentTimeNanosUnsafe()};$.forEach((Z)=>Z.report(J))};var DI=p9,UI=f9,lJ=c9,oJ=rK,pQ=t4,BI=n6,zI=a6,fQ=N4,rJ=T7,OI=V$,FI=_$,RI=J5,cQ=(Q)=>new u9(Q),uQ=(Q)=>new I7(Q),lQ=Z_,AY=V_,Z4=D_,NI=r$,CY=JY,LI=l$,MI=o$,jY=z8,wI=G_,PI=XY,AI=W_,CI=TQ,jI=YY,TI=H_,II=K_,EI=$Y,SI=i$,iJ=ZY,vI=v7,xI=HQ,bI=s8,TY=_Q,kI=r6,yI=D$,IY=aK,gI=wQ,hI=SD,mI=wY,dI=PQ,pI=vD,oQ=pJ,fI=xD,cI=AQ,uI=fJ,lI=CQ,oI=bD,rI=PY,iI=jQ,nI=kD,aI=dQ,sI=l9,tI=__,eI=q_;class dD extends q8()("effect/Cause/StackTrace"){}class pD extends q8()("effect/Cause/InterruptorStackTrace"){}var w0={};p6(w0,{zipWith:()=>Kv,zip:()=>Hv,yieldNowWith:()=>aS,yieldNow:()=>nS,withTracerTiming:()=>tx,withTracerEnabled:()=>sx,withTracer:()=>ax,withSpanScoped:()=>Vb,withSpan:()=>Kb,withParentSpan:()=>_b,withLogger:()=>mb,withLogSpan:()=>fb,withFiber:()=>sU,withExecutionPlan:()=>bv,withErrorReporting:()=>kv,whileLoop:()=>rU,when:()=>Xx,void:()=>D6,validate:()=>kS,useSpan:()=>Hb,updateServiceScoped:()=>Rx,updateService:()=>Fx,updateContext:()=>Ox,unwrapReason:()=>Bv,uninterruptibleMask:()=>$B,uninterruptible:()=>dx,undefined:()=>dS,txRetry:()=>tb,tx:()=>ib,tryPromise:()=>jZ,try:()=>O5,transposeOption:()=>tS,trackSuccesses:()=>ub,trackErrors:()=>lb,trackDuration:()=>rb,trackDefects:()=>ob,track:()=>cb,tracer:()=>nx,timeoutOrElse:()=>dv,timeoutOption:()=>mv,timeout:()=>hv,timed:()=>cv,tapErrorTag:()=>Av,tapError:()=>eU,tapDefect:()=>QB,tapCauseIf:()=>Cv,tapCauseFilter:()=>jv,tapCause:()=>hY,tap:()=>tU,sync:()=>nU,suspend:()=>iU,succeedSome:()=>$X,succeedNone:()=>v8,succeed:()=>f,spanLinks:()=>Jb,spanAnnotations:()=>$b,sleep:()=>fv,setContext:()=>Ux,serviceOption:()=>zx,service:()=>Bx,scopedWith:()=>wx,scoped:()=>Mx,scope:()=>Lx,scheduleFrom:()=>JB,schedule:()=>ix,satisfiesSuccessType:()=>Qk,satisfiesServicesType:()=>Yk,satisfiesErrorType:()=>Xk,sandbox:()=>Sv,runSyncWith:()=>Tb,runSyncExitWith:()=>Ib,runSyncExit:()=>U6,runSync:()=>jb,runPromiseWith:()=>Ab,runPromiseExitWith:()=>Cb,runPromiseExit:()=>mY,runPromise:()=>Pb,runForkWith:()=>Lb,runFork:()=>F5,runCallbackWith:()=>Mb,runCallback:()=>wb,retryOrElse:()=>Ev,retry:()=>Iv,result:()=>Yv,requestUnsafe:()=>Db,request:()=>qb,replicateEffect:()=>rx,replicate:()=>ox,repeatOrElse:()=>lx,repeat:()=>ux,reduce:()=>bS,raceFirst:()=>rv,raceAllFirst:()=>lv,raceAll:()=>uv,race:()=>ov,provideServiceEffect:()=>Nx,provideService:()=>XB,provideContext:()=>Dx,provide:()=>qx,promise:()=>mS,partition:()=>xS,orElseSucceed:()=>yv,orDie:()=>Pv,option:()=>$v,onInterrupt:()=>mx,onExitPrimitive:()=>vx,onExitIf:()=>xx,onExitFilter:()=>bx,onExit:()=>vZ,onErrorIf:()=>Ex,onErrorFilter:()=>Sx,onError:()=>Ix,never:()=>pS,matchEffect:()=>Wx,matchEager:()=>Yx,matchCauseEffectEager:()=>Zx,matchCauseEffect:()=>Gx,matchCauseEager:()=>Jx,matchCause:()=>$x,match:()=>SZ,mapErrorEager:()=>R5,mapError:()=>Mv,mapEager:()=>B9,mapBothEager:()=>K1,mapBoth:()=>wv,map:()=>EZ,makeSpanScoped:()=>Wb,makeSpan:()=>Gb,logWithLevel:()=>vb,logWarning:()=>kb,logTrace:()=>hb,logInfo:()=>yb,logFatal:()=>bb,logError:()=>xZ,logDebug:()=>gb,log:()=>xb,linkSpans:()=>Zb,let:()=>uS,isSuccess:()=>Kx,isFailure:()=>Hx,isEffect:()=>x4,interruptibleMask:()=>px,interruptible:()=>hx,interrupt:()=>YB,ignoreCause:()=>xv,ignore:()=>vv,gen:()=>oS,fromResult:()=>IZ,fromOption:()=>sS,fromNullishOr:()=>eS,forkScoped:()=>zb,forkIn:()=>Bb,forkDetach:()=>Ob,forkChild:()=>Ub,forever:()=>cx,forEach:()=>hS,fnUntracedEager:()=>GX,fnUntraced:()=>Eb,fn:()=>Sb,flip:()=>Wv,flatten:()=>Qv,flatMapEager:()=>F8,flatMap:()=>JX,firstSuccessOf:()=>gv,findFirstFilter:()=>gS,findFirst:()=>yS,filterOrFail:()=>ev,filterOrElse:()=>sv,filterMapOrFail:()=>Qx,filterMapOrElse:()=>tv,filterMapEffect:()=>av,filterMap:()=>nv,filter:()=>iv,fiberId:()=>Nb,fiber:()=>Rb,failSync:()=>rS,failCauseSync:()=>D9,failCause:()=>iS,fail:()=>p,exit:()=>ZX,eventually:()=>Tv,ensuring:()=>Tx,effectify:()=>eb,die:()=>aU,delay:()=>pv,currentSpan:()=>Xb,currentParentSpan:()=>Yb,contextWith:()=>_x,context:()=>Vx,clockWith:()=>ZB,catchTags:()=>qv,catchTag:()=>_v,catchReasons:()=>Uv,catchReason:()=>Dv,catchNoSuchElement:()=>Rv,catchIf:()=>Ov,catchFilter:()=>Fv,catchEager:()=>dY,catchDefect:()=>zv,catchCauseIf:()=>Nv,catchCauseFilter:()=>Lv,catchCause:()=>U9,catch:()=>Vv,callback:()=>TZ,cachedWithTTL:()=>yx,cachedInvalidateWithTTL:()=>gx,cached:()=>kx,bindTo:()=>cS,bind:()=>lS,awaitAllChildren:()=>Fb,asVoid:()=>Gv,asSome:()=>Zv,as:()=>Jv,annotateSpans:()=>ex,annotateLogsScoped:()=>pb,annotateLogs:()=>db,annotateCurrentSpan:()=>Qb,andThen:()=>Xv,all:()=>vS,addFinalizer:()=>jx,acquireUseRelease:()=>Cx,acquireRelease:()=>Px,acquireDisposable:()=>Ax,abortSignal:()=>fx,TypeId:()=>SS,Transaction:()=>YX,Do:()=>fS});var S8={};p6(S8,{void:()=>aJ,succeed:()=>V9,match:()=>_E,mapError:()=>DE,mapBoth:()=>UE,map:()=>qE,isSuccess:()=>Y1,isFailure:()=>sJ,isExit:()=>nJ,interrupt:()=>XE,hasInterrupts:()=>JE,hasFails:()=>YE,hasDies:()=>$E,getSuccess:()=>OE,getCause:()=>FE,findErrorOption:()=>RE,findError:()=>KE,findDefect:()=>VE,filterValue:()=>GE,filterSuccess:()=>ZE,filterFailure:()=>WE,filterCause:()=>HE,failCause:()=>v4,fail:()=>q5,die:()=>QE,asVoidAll:()=>zE,asVoid:()=>BE});var nJ=K$,V9=t0,v4=g1,q5=a8,QE=j8,XE=d_,aJ=e1;var Y1=W5,sJ=ZJ,YE=r_,$E=o_,JE=l_,ZE=p_,GE=f_,WE=c_,HE=SQ,KE=GJ,VE=u_,_E=i_,qE=WJ,DE=HJ,UE=KJ,BE=n_,zE=VJ,OE=a_,FE=s_,RE=t_;var NE="~effect/Deferred";var LE={[NE]:{_A:u,_E:u},pipe(){return H0(this,arguments)}},fD=()=>{let Q=Object.create(LE);return Q.resumes=void 0,Q.effect=void 0,Q};var cD=(Q)=>h1((X)=>{if(Q.effect)return X(Q.effect);return Q.resumes??=[],Q.resumes.push(X),K0(()=>{let Y=Q.resumes.indexOf(X);Q.resumes.splice(Y,1)})});var ME=U(2,(Q,X)=>K0(()=>wE(Q,X))),uD=ME;var wE=(Q,X)=>{if(Q.effect)return!1;if(Q.effect=X,Q.resumes){for(let Y=0;Y<Q.resumes.length;Y++)Q.resumes[Y](X);Q.resumes=void 0}return!0};var lD=A4;var oD=t7;var rD=kQ;var EY=Iq,tJ=wJ;var nD="~effect/Layer",iD="~effect/Layer/MemoMap",CE=(Q,X)=>{return Q.observers++,V6(T4(X,(Y)=>Q.finalizer(Y)),Q.effect)},aD=(Q)=>C(Q,nD),jE={[nD]:{_ROut:u,_E:u,_RIn:u},pipe(){return H0(this,arguments)}},sD=(Q)=>{let X=Object.create(jE);return X.build=Q,X},tD=(Q)=>sD((X,Y)=>{let $=EY(Y);return v1(Q(X,$),(J)=>J._tag==="Failure"?tJ($,J):$0)});var TE=(Q,X,Y,$)=>{let J=rD(),Z=fD(),G={observers:1,effect:cD(Z),finalizer:(W)=>Q0(()=>{if(G.observers--,G.observers===0)return Q.map.delete(X),tJ(J,W);return $0})};return Q.map.set(X,G),T4(Y,G.finalizer).pipe(S(()=>$(Q,J)),v1((W)=>{return G.effect=W,uD(Z,W)}))};class eJ{get[iD](){return iD}parent;constructor(Q){this.parent=Q}map=new Map;get(Q,X){let Y=this.map.get(Q);if(Y)return CE(Y,X);return this.parent?.get(Q,X)}getOrElseMemoize(Q,X,Y){let $=this.get(Q,X);if($)return $;return TE(this,Q,X,Y)}}var QZ=()=>new eJ,IE=(Q)=>new eJ(Q);class rQ extends q8()("effect/Layer/CurrentMemoMap"){static forkOrCreate(Q){let X=FV(Q,rQ);return X?IE(X):QZ()}}var XZ=U(3,(Q,X,Y)=>m1(M0(Q.build(X,Y),a1(rQ,X)),rQ,X));var eD=U(2,(Q,X)=>e((Y)=>XZ(Q,rQ.forkOrCreate(Y.context),X)));var QU=(Q)=>sD(V1(j(Q)));var XU=(Q,X,Y)=>{let $=EY(Y,"parallel");return t1(Q,(J)=>J.build(X,EY($,"sequential")),{concurrency:Q.length}).pipe(M0((J)=>LV(...J)))},YU=(...Q)=>tD((X,Y)=>XU(Q,X,Y));var EE=(Q,X,Y)=>tD(($,J)=>S(Array.isArray(X)?XU(X,$,J):X.build($,J),(Z)=>Q.build($,J).pipe(j4(Z),M0((G)=>Y(G,Z))))),$U=U(2,(Q,X)=>EE(Q,X,u));var ZU="~effect/ExecutionPlan";var SE={[ZU]:ZU,get captureRequirements(){let Q=this;return _6((X)=>j(vE(Q.steps.map((Y)=>({...Y,provide:aD(Y.provide)?$U(Y.provide,QU(X)):Y.provide})))))},pipe(){return H0(this,arguments)}},vE=(Q)=>{let X=Object.create(SE);return X.steps=Q,X};var GU=R0("effect/ExecutionPlan/CurrentMetadata",{defaultValue:V1({attempt:0,stepIndex:0})});var WU=class extends f6{constructor(Q){super();if(Q)j7(this,Q)}};var SY=M4;var vY="~effect/time/DateTime",xY="~effect/time/DateTime/TimeZone",KU={[vY]:vY,pipe(){return H0(this,arguments)},[W1](){return this.toString()},toJSON(){return sQ(this).toJSON()}},hE={...KU,_tag:"Utc",[D0](){return z4(this.epochMilliseconds)},[U0](Q){return U5(Q)&&Q._tag==="Utc"&&this.epochMilliseconds===Q.epochMilliseconds},toString(){return`DateTime.Utc(${sQ(this).toJSON()})`}},mE={...KU,_tag:"Zoned",[D0](){return X1(z4(this.epochMilliseconds))(X0(this.zone))},[U0](Q){return U5(Q)&&Q._tag==="Zoned"&&this.epochMilliseconds===Q.epochMilliseconds&&o(this.zone,Q.zone)},toString(){return`DateTime.Zoned(${zZ(this)})`}},VU={[xY]:xY,[W1](){return this.toString()}},dE={...VU,_tag:"Named",[D0](){return b0(`Named:${this.id}`)},[U0](Q){return _9(Q)&&Q._tag==="Named"&&this.id===Q.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},pE={...VU,_tag:"Offset",[D0](){return b0(`Offset:${this.offset}`)},[U0](Q){return _9(Q)&&Q._tag==="Offset"&&this.offset===Q.offset},toString(){return`TimeZone.Offset(${DZ(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},G4=(Q,X,Y)=>{let $=Object.create(mE);return $.epochMilliseconds=Q,$.zone=X,Object.defineProperty($,"partsUtc",{value:Y,enumerable:!1,writable:!0}),Object.defineProperty($,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty($,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),$},U5=(Q)=>C(Q,vY);var _9=(Q)=>C(Q,xY),_U=(Q)=>_9(Q)&&Q._tag==="Offset",qU=(Q)=>_9(Q)&&Q._tag==="Named",DU=(Q)=>Q._tag==="Utc",ZZ=(Q)=>Q._tag==="Zoned",UU=H1((Q,X)=>Q.epochMilliseconds===X.epochMilliseconds),BU=s6((Q,X)=>Q.epochMilliseconds<X.epochMilliseconds?-1:Q.epochMilliseconds>X.epochMilliseconds?1:0);var GZ=(Q)=>{let X=Object.create(hE);return X.epochMilliseconds=Q,Object.defineProperty(X,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),X},D5=(Q)=>{let X=Q.getTime();if(Number.isNaN(X))throw new oQ("Invalid date");return GZ(X)},WZ=(Q)=>{if(U5(Q))return Q;else if(Q instanceof Date)return D5(Q);else if(typeof Q==="object"){if("epochMilliseconds"in Q)return GZ(Q.epochMilliseconds);let X=new Date(0);return nE(X,Q),D5(X)}else if(typeof Q==="string"&&!fE(Q))return D5(new Date(Q+"Z"));return D5(new Date(Q))},fE=(Q)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(Q),cE=-8639999956800000,uE=8639999949600000,HZ=(Q,X)=>{let Y=X?.timeZone;if(Y===void 0&&U5(Q)&&ZZ(Q))return Q;let $=WZ(Q);if($.epochMilliseconds<cE||$.epochMilliseconds>uE)throw RangeError(`Epoch millis out of range: ${$.epochMilliseconds}`);if(Y===void 0&&typeof Q==="object"&&"timeZoneId"in Q)Y=Q.timeZoneId;let J;if(Y===void 0){let Z=new Date($.epochMilliseconds).getTimezoneOffset()*-60*1000;J=aQ(Z)}else if(_9(Y))J=Y;else if(typeof Y==="number")J=aQ(Y);else{let Z=_Z(Y);if(I0(Z))throw new oQ(`Invalid time zone: ${Y}`);J=Z.value}if(X?.adjustForTimeZone!==!0)return G4($.epochMilliseconds,J,$.partsUtc);return aE($.epochMilliseconds,J,X?.disambiguation??"compatible")},$Z=Q9(HZ),zU=Q9(WZ),lE=/^(.{17,35})\[(.+)\]$/,OU=(Q)=>{let X=lE.exec(Q);if(X===null){let J=BZ(Q);return J!==null?$Z(Q,{timeZone:J}):d()}let[,Y,$]=X;return $Z(Y,{timeZone:$})};var FU=(Q)=>GZ(Q.epochMilliseconds);var nQ=new Map,oE={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},rE=(Q)=>{let X=Q.resolvedOptions().timeZone;if(nQ.has(X))return nQ.get(X);let Y=Object.create(dE);return Y.id=X,Y.format=Q,nQ.set(X,Y),Y},KZ=(Q)=>{if(nQ.has(Q))return nQ.get(Q);try{return rE(new Intl.DateTimeFormat("en-US",{...oE,timeZone:Q}))}catch{throw new oQ(`Invalid time zone: ${Q}`)}},aQ=(Q)=>{let X=Object.create(pE);return X.offset=Q,X},VZ=Q9(KZ);var iE=/^(?:GMT|[+-])/,_Z=(Q)=>{if(iE.test(Q)){let X=BZ(Q);return X===null?d():R(aQ(X))}return VZ(Q)},RU=(Q)=>{if(Q._tag==="Offset")return DZ(Q.offset);return Q.id};var sQ=(Q)=>new Date(Q.epochMilliseconds),bY=(Q)=>{if(Q._tag==="Utc")return new Date(Q.epochMilliseconds);else if(Q.zone._tag==="Offset")return new Date(Q.epochMilliseconds+Q.zone.offset);else if(Q.adjustedEpochMilliseconds!==void 0)return new Date(Q.adjustedEpochMilliseconds);let X=Q.zone.format.formatToParts(Q.epochMilliseconds).filter(($)=>$.type!=="literal"),Y=new Date(0);return Y.setUTCFullYear(Number(X[2].value),Number(X[0].value)-1,Number(X[1].value)),Y.setUTCHours(Number(X[3].value),Number(X[4].value),Number(X[5].value),Number(X[6].value)),Q.adjustedEpochMilliseconds=Y.getTime(),Y},qZ=(Q)=>{return bY(Q).getTime()-UZ(Q)},DZ=(Q)=>{let X=Math.abs(Q),Y=Math.floor(X/3600000),$=Math.round(X%3600000/60000);if($===60)Y+=1,$=0;return`${Q<0?"-":"+"}${String(Y).padStart(2,"0")}:${String($).padStart(2,"0")}`},NU=(Q)=>DZ(qZ(Q)),UZ=(Q)=>Q.epochMilliseconds;var nE=(Q,X)=>{if(X.year!==void 0)Q.setUTCFullYear(X.year);if(X.month!==void 0)Q.setUTCMonth(X.month-1);if(X.day!==void 0)Q.setUTCDate(X.day);if(X.weekDay!==void 0){let Y=X.weekDay-Q.getUTCDay();Q.setUTCDate(Q.getUTCDate()+Y)}if(X.hour!==void 0)Q.setUTCHours(X.hour);if(X.minute!==void 0)Q.setUTCMinutes(X.minute);if(X.second!==void 0)Q.setUTCSeconds(X.second);if(X.millisecond!==void 0)Q.setUTCMilliseconds(X.millisecond)};var HU=86400000,aE=(Q,X,Y)=>{if(X._tag==="Offset")return G4(Q-X.offset,X);let $=iQ(Q-HU,Q,X),J=iQ(Q+HU,Q,X);if($===J)return G4(Q-$,X);let Z=$<J,G=$-J;if(Z){if(iQ(Q-J,Q,X)===J)return G4(Q-J,X);let K=G4(Q-$,X),V=bY(K).getTime();if(Q!==V)switch(Y){case"reject":{let _=new Date(Q).toISOString();throw RangeError(`Gap time: ${_} does not exist in time zone ${X.id}`)}case"earlier":return G4(Q-J,X);case"compatible":case"later":return K}return K}if(iQ(Q-$,Q,X)===$){if(Y==="earlier"||Y==="compatible")return G4(Q-$,X);if(iQ(Q-$+G,Q+G,X)===$)return G4(Q-$,X);if(Y==="reject"){let K=new Date(Q).toISOString();throw RangeError(`Ambiguous time: ${K} occurs twice in time zone ${X.id}`)}}return G4(Q-J,X)},sE=/([+-])(\d{2}):(\d{2})$/,BZ=(Q)=>{let X=sE.exec(Q);if(X===null)return null;let[,Y,$,J]=X;return(Y==="+"?1:-1)*(Number($)*60+Number(J))*60*1000},iQ=(Q,X,Y)=>{let $=Y.format.formatToParts(Q).find((Z)=>Z.type==="timeZoneName")?.value??"";if($==="GMT")return 0;let J=BZ($);if(J===null)return qZ(G4(X,Y));return J};var LU=(Q)=>sQ(Q).toISOString();var JZ=(Q)=>{let X=bY(Q);return Q._tag==="Utc"?X.toISOString():`${X.toISOString().slice(0,-1)}${NU(Q)}`},zZ=(Q)=>Q.zone._tag==="Offset"?JZ(Q):`${JZ(Q)}[${Q.zone.id}]`;var d00=globalThis.Number;var wU=U(2,(Q,X)=>{let Y=Q.toString(),$=X.toString();if(Y.includes("e")||$.includes("e")){if(!globalThis.Number.isFinite(Q)||!globalThis.Number.isFinite(X)||X===0)return NaN;return eE(Q,X)}let J=(Y.split(".")[1]||"").length,Z=($.split(".")[1]||"").length,G=J>Z?J:Z,W=parseInt(Q.toFixed(G).replace(".","")),H=parseInt(X.toFixed(G).replace(".",""));return W%H/Math.pow(10,G)});function eE(Q,X){let[Y,$]=MU(Q),[J,Z]=MU(X),G=Math.min($,Z),W=Y*BigInt(10)**BigInt($-G),H=J*BigInt(10)**BigInt(Z-G),K=W%H;if(K===BigInt(0))return Q<0||Object.is(Q,-0)?-0:0;let V=globalThis.Number(`${K}e${G}`);return V===0?Math.sign(Q)*globalThis.Number.MIN_VALUE:V}function MU(Q){let X=Math.abs(Q).toExponential(),Y=X.indexOf("e"),$=X.slice(0,Y).replace(".","");return[BigInt($)*(Q<0?-BigInt(1):BigInt(1)),globalThis.Number(X.slice(Y+1))-$.length+1]}var PU=w4((Q,X)=>Math.max(Q,X),-1/0),AU=w4((Q,X)=>Math.min(Q,X),1/0);var p00=globalThis.String;var CU=(Q)=>Q.trim();var OZ=U(2,(Q,X)=>K5(Q,$S,(Y)=>X(Y)));var YS=Q5(jY,(Q)=>TY(Q)?t(Q):i(Q));var $S=Q5(jY,(Q)=>TY(Q)?t(Q.value):i(Q));var jU=U(2,(Q,X)=>$4(Q,{onSuccess:X.onSuccess,onFailure:(Y)=>{let $=YS(Y);return!_0($)?X.onDone($.success.value):X.onFailure($.failure)}}));var IU="~effect/Schedule";var q9=R0("effect/Schedule/CurrentMetadata",{defaultValue:V1({input:void 0,output:void 0,duration:t9,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),JS={[IU]:{_Out:u,_In:u,_Env:u},pipe(){return H0(this,arguments)}},FZ=(Q)=>C(Q,IU),RZ=(Q)=>{let X=Object.create(JS);return X.step=Q,X},NZ=()=>{let Q=0,X,Y;return($,J)=>{if(Y===void 0)Y=$;let Z=$-Y,G=X===void 0?0:$-X;return X=$,{input:J,attempt:++Q,start:Y,now:$,elapsed:Z,elapsedSincePrevious:G}}},ZS=(Q)=>RZ(M0(Q,(X)=>{let Y=NZ();return($,J)=>X(Y($,J))})),LZ=(Q)=>O8(Q.step,(X)=>j(()=>P0(X))),kY=(Q)=>H9((X)=>M0(LZ(Q),(Y)=>{let $=NZ();return(J)=>Q0(()=>{let Z=X.currentTimeMillisUnsafe();return S(Y(Z,J),([G,W])=>{let H=$(Z,J);return H.output=G,H.duration=W,Q8(K9(W),H)})})}));var MZ=(Q)=>RZ(M0(LZ(Q),(X)=>(Y,$)=>jU(X(Y,$),{onSuccess:(J)=>j([$,J[1]]),onFailure:P0,onDone:()=>IY($)}))),EU=(Q)=>tQ(wZ,({attempt:X})=>j(X<=Q)),GS=(Q)=>{let X=s1(Q);return ZS(j((Y)=>j([Y.attempt-1,X])))};var tQ=U(2,(Q,X)=>RZ(M0(LZ(Q),(Y)=>{let $=NZ();return(J,Z)=>S(Y(J,Z),(G)=>{let[W,H]=G,K=X({...$(J,Z),output:W,duration:H});return S(r(K)?K:j(K),(V)=>V?j(G):IY(W))})})));var wZ=GS(t9);var WS=(Q,X,Y)=>FY(($)=>S(Y?.local?XZ(X,QZ(),$):eD(X,$),(J)=>j4(Q,J))),yY=U((Q)=>r(Q[0]),(Q,X,Y)=>L$(X)?j4(Q,X):WS(Q,Array.isArray(X)?YU(...X):X,Y));var PZ=U(3,(Q,X,Y)=>S(kY(X),($)=>{let J=q9.defaultValue();return X8(DY(Z9(S(Q0(()=>m1(Q,q9,J)),$),(Z)=>K0(()=>{J=Z})),{disableYield:!0}),(Z)=>_Q(Z)?j(Z.value):Y(Z,J.attempt===0?d():R(J)))})),AZ=U(3,(Q,X,Y)=>S(kY(X),($)=>{let J=q9.defaultValue(),Z,G=X8(Q0(()=>m1(Q,q9,J)),(W)=>{return Z=W,S($(W),(H)=>{return J=H,G})});return OZ(G,(W)=>V0(()=>Y(Z,W)))})),xU=U(2,(Q,X)=>{let Y=typeof X==="function"?X(u):FZ(X)?X:QX(X);return PZ(Q,Y,E0)}),eQ=U(2,(Q,X)=>{let Y=typeof X==="function"?X(u):FZ(X)?X:QX(X);return AZ(Q,Y,E0)}),bU=U(3,(Q,X,Y)=>S(kY(Y),($)=>{let J=q9.defaultValue(),Z=Q0(()=>m1(Q,q9,J));return X8(S($(X),(G)=>{J=G;let W=V1(S(Z,$));return E4({while:n4,body:W,step(H){J=H}})}),(G)=>_Q(G)?j(G.value):E0(G))})),HS=MZ(wZ),QX=(Q)=>{let X=Q.schedule?MZ(Q.schedule):HS;if(Q.while)X=tQ(X,({input:Y})=>{let $=Q.while(Y);return r($)?$:j($)});if(Q.until)X=tQ(X,({input:Y})=>{let $=Q.until(Y);return r($)?M0($,(J)=>!J):j(!$)});if(Q.times!==void 0)X=tQ(X,({attempt:Y})=>j(Y<=Q.times));return X};var gU=U(2,(Q,X)=>Q0(()=>{let Y=0,$={attempt:0,stepIndex:0},J=qY(GU,K0(()=>{return $={attempt:$.attempt+1,stepIndex:Y},$})),Z;return S(E4({while:()=>Y<X.steps.length&&(Z===void 0||_0(Z)),body(){let G=X.steps[Y],W=J(yY(Q,G.provide));if(Z){let H=!1,K=W;W=Q0(()=>{if(H)return K;return H=!0,Z5(Z)}),W=eQ(W,yU(G,!1))}else{let H=yU(G,!0);W=H?eQ(W,H):W}return H6(W)},step(G){Z=G,Y++}}),()=>Z5(Z))})),yU=(Q,X)=>{if(!X)return QX({schedule:Q.schedule?Q.schedule:Q.attempts?void 0:KS,times:Q.attempts,while:Q.while});else if(Q.attempts===1||!(Q.schedule||Q.attempts))return;return QX({schedule:Q.schedule,while:Q.while,times:Q.attempts?Q.attempts-1:void 0})},KS=EU(1);var _S="~effect/Request",qS=pK({_E:(Q)=>Q,_A:(Q)=>Q,_R:(Q)=>Q}),$10={...oK,[_S]:qS};var hU=(Q)=>Q;var dU=U(2,(Q,X)=>{let Y=($)=>h1((J)=>{let Z=fU($,Q,J,GY());return DS($,Z)});return r(X)?S(X,Y):Y(X)}),pU=(Q,X)=>{let Y=fU(X.resolver,Q,X.onExit,{context:X.context,currentScheduler:n1(X.context,zQ)});return()=>cU(X.resolver,Y)},gY=[],CZ=new WeakMap,fU=(Q,X,Y,$)=>{let J=CZ.get(Q);if(!J)J=new Map,CZ.set(Q,J);let Z,G=!1,W=hU({request:X,context:$.context,uninterruptible:!1,completeUnsafe(K){if(G)return;G=!0,Y(K),Z?.entrySet.delete(W)}});if(Q.preCheck!==void 0&&!Q.preCheck(W))return W;let H=Q.batchKey(W);if(Z=J.get(H),!Z){if(gY.length>0)Z=gY.pop(),Z.key=H,Z.resolver=Q,Z.map=J;else{let K={key:H,resolver:Q,map:J,entrySet:new Set,entries:new Set,delayEffect:S(Q0(()=>K.resolver.delay),(V)=>mU(K)),run:v1(Q0(()=>K.resolver.runAll(Array.from(K.entries),K.key)),(V)=>{for(let _ of K.entrySet)_.completeUnsafe(V._tag==="Success"?j8(Error("Effect.request: RequestResolver did not complete request",{cause:_.request})):V);if(K.entries.clear(),gY.length<128)K.entrySet.clear(),K.key=void 0,K.fiber=void 0,K.resolver=void 0,K.map=void 0,gY.push(K);return $0})};Z=K}J.set(H,Z),Z.fiber=S4($.context)(Z.delayEffect,{scheduler:$.currentScheduler})}if(Z.entrySet.add(W),Z.entries.add(W),Z.resolver.collectWhile(Z.entries))return W;return Z.fiber.interruptUnsafe($.id),Z.fiber=S4($.context)(mU(Z),{scheduler:$.currentScheduler}),W},cU=(Q,X)=>{if(X.uninterruptible)return;let Y=CZ.get(Q);if(!Y)return;let $=Q.batchKey(X),J=Y.get($);if(!J)return;if(J.entries.delete(X),J.entrySet.delete(X),J.entries.size===0)Y.delete($),J.fiber?.interruptUnsafe()},DS=(Q,X)=>K0(()=>cU(Q,X));function mU(Q){if(!Q.map.has(Q.key))return $0;return Q.map.delete(Q.key),Q.run}var OS="effect/Metric/CurrentMetricAttributes",FS=R0(OS,{defaultValue:()=>({})}),RS="~effect/observability/Metric/MetricRegistryKey",NS=R0(RS,{defaultValue:()=>new Map}),uU="~effect/observability/Metric";class B5{[uU]=uU;#Q=new WeakMap;#X;id;description;attributes;constructor(Q,X,Y){this.id=Q,this.description=X,this.attributes=Y}valueUnsafe(Q){return this.hook(Q).get(Q)}modifyUnsafe(Q,X){return this.hook(X).modify(Q,X)}updateUnsafe(Q,X){return this.hook(X).update(Q,X)}hook(Q){let X=n1(Q,FS);if(Object.keys(X).length===0){if(_1(this.#X))return this.#X.hooks;return this.#X=this.getOrCreate(Q,this.attributes),this.#X.hooks}let Y=IS(this.attributes,X),$=this.#Q.get(Y);if(_1($))return $.hooks;return $=this.getOrCreate(Q,Y),this.#Q.set(Y,$),$.hooks}getOrCreate(Q,X){let Y=CS(this,X),$=n1(Q,NS);if($.has(Y))return $.get(Y);let J=this.createHooks(),Z={id:this.id,type:this.type,description:this.description,attributes:q6(X),hooks:J};return $.set(Y,Z),Z}pipe(){return H0(this,arguments)}}var lU=BigInt(0);class LS extends B5{type="Counter";#Q;#X;constructor(Q,X){super(Q,X?.description,q6(X?.attributes));this.#Q=X?.bigint??!1,this.#X=X?.incremental??!1}createHooks(){let Q=this.#Q?lU:0,X=this.#X?this.#Q?($)=>$>=lU:($)=>$>=0:($)=>!0;return XX(()=>({count:Q,incremental:this.#X}),($)=>{if(X($))Q=Q+$})}}class MS extends B5{type="Gauge";#Q;constructor(Q,X){super(Q,X?.description,q6(X?.attributes));this.#Q=X?.bigint??!1}createHooks(){let Q=this.#Q?BigInt(0):0;return XX(()=>({value:Q}),($)=>{Q=$},($)=>{Q=Q+$})}}class wS extends B5{type="Frequency";#Q;constructor(Q,X){super(Q,X?.description,q6(X?.attributes));this.#Q=X?.preregisteredWords}createHooks(){let Q=new Map;if(_1(this.#Q))for(let Y of this.#Q)Q.set(Y,0);return XX(()=>({occurrences:Q}),(Y)=>{let $=Q.get(Y)??0;Q.set(Y,$+1)})}}class PS extends B5{type="Histogram";#Q;constructor(Q,X){super(Q,X?.description,q6(X?.attributes));this.#Q=X.boundaries}createHooks(){let Q=this.#Q,X=Q.length,Y=new Uint32Array(X+1),$=new Float64Array(X),J=0,Z=0,G=Number.MAX_VALUE,W=-Number.MAX_VALUE;Q4(BQ(Q,D1),(V,_)=>{$[_]=V});let H=(V)=>{let _=0,q=X;while(_!==q){let D=Math.floor(_+(q-_)/2),B=$[D];if(V<=B)q=D;else _=D;if(q===_+1)if(V<=$[_])q=_;else _=q}if(Y[_]=Y[_]+1,J=J+1,Z=Z+V,V<G)G=V;if(V>W)W=V},K=()=>{let V=P$(X),_=0;for(let q=0;q<X;q++){let D=$[q],B=Y[q];_=_+B,V[q]=[D,_]}return V};return XX(()=>({buckets:K(),count:J,min:G,max:W,sum:Z}),H)}}class AS extends B5{type="Summary";#Q;#X;#Y;constructor(Q,X){super(Q,X?.description,q6(X?.attributes));this.#Q=Math.max(W6(s1(X.maxAge)),0),this.#X=X.maxSize,this.#Y=X.quantiles}createHooks(){let Q=BQ(this.#Y,D1),X=P$(this.#X);for(let _ of this.#Y)if(_<0||_>1)throw Error(`Quantile must be between 0 and 1, found: ${_}`);let Y=0,$=0,J=0,Z=Number.MAX_VALUE,G=-Number.MAX_VALUE,W=(_)=>{let q=[],D=0;while(D<this.#X){let N=X[D];if(_1(N)){let[M,w]=N,A=_-M;if(A>=0&&A<=this.#Q)q.push(w)}D=D+1}let B=BQ(q,D1),F=B.length;if(F===0)return Q.map((N)=>[N,void 0]);return Q.map((N)=>{if(N<=0)return[N,B[0]];if(N>=1)return[N,B[F-1]];let M=Math.ceil(N*F)-1;return[N,B[M]]})},H=(_,q)=>{if(this.#X>0){let D=Y%this.#X;X[D]=[q,_],Y=Y+1}if($=$+1,J=J+_,_<Z)Z=_;if(_>G)G=_};return XX((_)=>{let q=n1(_,J4);return{quantiles:W(q.currentTimeMillisUnsafe()),count:$,min:Z,max:G,sum:J}},([_,q])=>H(_,q))}}var z5=U(2,(Q,X)=>_6((Y)=>K0(()=>Q.updateUnsafe(X,Y))));function CS(Q,X){let Y=`${Q.type}:${Q.id}`;if(_1(Q.description))Y+=`:${Q.description}`;if(_1(X))Y+=`:${jS(X)}`;return Y}function XX(Q,X,Y){return{get:Q,update:X,modify:Y??X}}function jS(Q){return TS(Array.isArray(Q)?Q:Object.entries(Q))}function TS(Q){return Q.map(([X,Y])=>`${X}=${Y}`).join(",")}function IS(Q,X){return{...q6(Q),...q6(X)}}function q6(Q){if(_1(Q)&&Array.isArray(Q))return Q.reduce((X,[Y,$])=>{return b(X,Y,$),X},{});return Q}var SS=n8,x4=r,vS=hQ,xS=xJ,bS=fq,kS=cq,yS=uq,gS=oq,hS=t1,rU=E4,mS=e$,jZ=w_,f=j,v8=IQ,$X=t$,iU=Q0,nU=K0,D6=$0;var dS=uJ;var TZ=h1,pS=KY,fS=eq,cS=QD,uS=YD;var lS=XD,oS=j_,p=E0,rS=HY,iS=P0,D9=L_,aU=K6,O5=M_;var nS=G5,aS=s$,sU=e,IZ=Z5,sS=F_,tS=N_,eS=R_,JX=S,Qv=k_,Xv=V6,tU=Z9,Yv=H6,$v=Lq,ZX=bQ,EZ=M0,Jv=Q8,Zv=VY,Gv=EQ,Wv=E_,Hv=$q,Kv=qJ,Vv=X8;var _v=zJ,qv=Dq,Dv=Uq,Uv=Bq,Bv=zq,U9=O8,zv=Hq,Ov=vQ,Fv=BY,Rv=Wq,Nv=UJ,Lv=K5,Mv=OJ,wv=FJ,Pv=RJ,eU=BJ,Av=_q,hY=Kq,Cv=Vq,jv=UY,QB=qq,Tv=NJ,Iv=eQ,Ev=AZ,Sv=S_,vv=Rq,xv=Nq,bv=gU,kv=mD,yv=Oq,gv=Fq,hv=Cq,mv=jq,dv=MJ,pv=Aq,fv=K9,cv=Tq,uv=$J,lv=JJ,ov=v_,rv=_Y,iv=aq,nv=sq,av=tq,sv=bJ,tv=kJ,ev=Jq,Qx=nq,Xx=Zq,SZ=zY,Yx=xQ,$x=LJ,Jx=Mq,Zx=x_,Gx=$4,Wx=G9,Hx=wq,Kx=Pq,Vx=_J,_x=_6,qx=yY,Dx=j4,Ux=Yq,Bx=e_,zx=Qq,Ox=H5,Fx=C4,Rx=Xq,XB=m1,Nx=qY,Lx=yQ,Mx=PJ,wx=FY,Px=RY,Ax=kq,Cx=bq,jx=AJ,Tx=Sq,Ix=TJ,Ex=vq,Sx=IJ,vx=_5,vZ=v1,xx=CJ,bx=jJ,kx=yq,yx=SJ,gx=EJ,YB=gq,hx=vJ,mx=xq,dx=I4,$B=gQ,px=dq,fx=pq,cx=DY,ux=xU,lx=PZ,ox=DJ,rx=Gq,ix=U(2,(Q,X)=>JB(Q,void 0,X)),JB=bU,nx=UD,ax=BD,sx=zD,tx=OD,ex=AD,Qb=CD,Xb=jD,Yb=TD,$b=LD,Jb=MD,Zb=wD,Gb=RD,Wb=LQ,Hb=MQ,Kb=PD,Vb=ND,_b=$5,qb=dU,Db=pU,Ub=$D,Bb=yJ,zb=GD,Ob=JD,Fb=ZD,Rb=A_,Nb=C_,F5=WD,Lb=S4,Mb=gJ,wb=HD,Pb=VD,Ab=hJ,mY=KD,Cb=LY,jb=qD,Tb=mJ,U6=_D,Ib=MY,Eb=XJ,Sb=T_,ZB=H9,vb=E8,xb=E8(),bb=E8("Fatal"),kb=E8("Warn"),xZ=E8("Error"),yb=E8("Info"),gb=E8("Debug"),hb=E8("Trace"),mb=U(2,(Q,X)=>C4(Q,cJ,(Y)=>new Set([...Y,X]))),db=U((Q)=>x4(Q[0]),(Q,...X)=>C4(Q,lD,(Y)=>{let $=X.length===1?{...Y,...X[0]}:{...Y};if(X.length===1)return $;else b($,X[0],X[1]);return $})),pb=gD,fb=U(2,(Q,X)=>S(ED,(Y)=>C4(Q,oD,($)=>{return[[X,Y],...$]}))),cb=U((Q)=>x4(Q[0]),(Q,X,Y)=>vZ(Q,($)=>{let J=Y===void 0?$:V0(()=>Y($));return z5(X,J)})),ub=U((Q)=>x4(Q[0]),(Q,X,Y)=>tU(Q,($)=>{let J=Y===void 0?$:Y($);return z5(X,J)})),lb=U((Q)=>x4(Q[0]),(Q,X,Y)=>eU(Q,($)=>{let J=Y===void 0?$:V0(()=>Y($));return z5(X,J)})),ob=U((Q)=>x4(Q[0]),(Q,X,Y)=>QB(Q,($)=>{let J=Y===void 0?$:V0(()=>Y($));return z5(X,J)})),rb=U((Q)=>x4(Q[0]),(Q,X,Y)=>ZB(($)=>{let J=$.currentTimeNanosUnsafe();return vZ(Q,()=>{let Z=$.currentTimeNanosUnsafe(),G=gV(s1(Z),s1(J)),W=Y===void 0?G:V0(()=>Y(G));return z5(X,W)})}));class YX extends q8()("effect/Effect/Transaction"){}var ib=(Q)=>sU((X)=>{if(X.context.mapUnsafe.has(YX.key))return Q;let Y={journal:new Map,retry:!1},$;return $B((J)=>JX(rU({while:()=>!$,body:V1(J(Q).pipe(XB(YX,Y),hY(()=>{if(!Y.retry)return D6;return J(ab(Y))}),ZX)),step(Z){if(Y.retry||!nb(Y))return oU(Y);if(Y1(Z))sb(X,Y);else oU(Y);$=Z}}),()=>$))}),nb=(Q)=>{for(let[X,{version:Y}]of Q.journal)if(X.version!==Y)return!1;return!0},ab=(Q)=>iU(()=>{let X={},Y=Array.from(Q.journal.keys()),$=()=>{for(let J of Y)J.pending.delete(X)};return TZ((J)=>{let Z=()=>{$(),J(D6)};for(let G of Y)G.pending.set(X,Z);return nU($)})});function sb(Q,X){for(let[Y,{value:$}]of X.journal){if($!==Y.value)Y.version=Y.version+1,Y.value=$;for(let J of Y.pending.values())Q.currentDispatcher.scheduleTask(J,0);Y.pending.clear()}}function oU(Q){Q.retry=!1,Q.journal.clear()}var tb=JX(YX,(Q)=>{return Q.retry=!0,YB}),eb=(Q,X,Y)=>(...$)=>TZ((J)=>{try{Q(...$,(Z,G)=>{if(Z)J(p(X?X(Z,$):Z));else J(f(G))})}catch(Z){J(Y?p(Y(Z,$)):aU(Z))}}),Qk=()=>(Q)=>Q,Xk=()=>(Q)=>Q,Yk=()=>(Q)=>Q,B9=y_,R5=g_,K1=h_,F8=b_,dY=m_,GX=I_;var $k=(Q,X)=>{if(Y1(Q))return X(0);if(AY(Q.cause))return X(130);return X(Jk(CY(Q.cause)))},HB=(Q)=>U((X)=>x4(X[0]),(X,Y)=>{let $=Y?.disableErrorReporting===!0?F5(X):F5(hY(X,(Z)=>{if(AY(Z))return D6;return Zk(CY(Z))?xZ(Z):D6}));try{let Z=globalThis.setInterval(h9,2147483647);$.addObserver(()=>{clearInterval(Z)})}catch{}let J=Y?.teardown??$k;return Q({fiber:$,teardown:J})}),GB="~effect/Runtime/errorExitCode",Jk=(Q)=>{if(typeof Q==="object"&&Q!==null&&GB in Q){let X=Q[GB];if(typeof X==="number")return X}return 1},WB="~effect/Runtime/errorReported",Zk=(Q)=>{if(typeof Q==="object"&&Q!==null&&WB in Q){let X=Q[WB];if(typeof X==="boolean")return X}return!0};var KB=HB(({fiber:Q,teardown:X})=>{let Y=!1;Q.addObserver((J)=>{process.removeListener("SIGINT",$),process.removeListener("SIGTERM",$),X(J,(Z)=>{if(Y||Z!==0)process.exit(Z)})});function $(){Y=!0,Q.interruptUnsafe(Q.id)}process.on("SIGINT",$),process.on("SIGTERM",$)});var Hk=KB;var g={};p6(g,{withDecodingDefaultTypeKey:()=>Ar,withDecodingDefaultType:()=>Cr,withDecodingDefaultKey:()=>sH,withDecodingDefault:()=>HP,withConstructorDefault:()=>WP,toType:()=>k1,toTaggedUnion:()=>KP,toStandardSchemaV1:()=>vo,toStandardJSONSchemaV1:()=>xo,toRepresentation:()=>Qa,toJsonSchemaDocument:()=>EA,toIsoSource:()=>Aa,toIsoFocus:()=>Ca,toIso:()=>Pa,toFormatter:()=>sn,toEquivalence:()=>en,toEncoderXml:()=>Ga,toEncoded:()=>s5,toDifferJsonPatch:()=>Ta,toCodecStringTree:()=>yA,toCodecJsonAST:()=>d3,toCodecJson:()=>SA,toCodecIso:()=>bA,toCodecArrayFromSingle:()=>Za,toArbitraryLazy:()=>IA,toArbitrary:()=>nn,tagDefaultOmit:()=>jr,tag:()=>x9,suspend:()=>YP,revealCodec:()=>So,revealBottom:()=>jo,resolveAnnotationsKey:()=>ba,resolveAnnotations:()=>xa,requiredKey:()=>no,required:()=>ao,refine:()=>Rr,redact:()=>ZK,readonlyKey:()=>to,overrideToFormatter:()=>an,overrideToEquivalence:()=>tn,overrideToCodecIso:()=>ja,optionalKey:()=>k6,optional:()=>P8,mutableKey:()=>so,mutable:()=>Or,middlewareEncoding:()=>JP,middlewareDecoding:()=>iH,makeIsMultipleOf:()=>AP,makeIsLessThanOrEqualTo:()=>H7,makeIsLessThan:()=>W7,makeIsGreaterThanOrEqualTo:()=>G7,makeIsGreaterThan:()=>Z7,makeIsBetween:()=>K7,makeFilterGroup:()=>Er,makeFilter:()=>j0,make:()=>E,link:()=>v0,isUppercasedReviver:()=>or,isUppercased:()=>NP,isUniqueReviver:()=>Li,isUnique:()=>$K,isUncapitalizedReviver:()=>nr,isUncapitalized:()=>wP,isUint32:()=>Zi,isUUIDReviver:()=>hr,isUUID:()=>DP,isULIDReviver:()=>dr,isULID:()=>BP,isTrimmedReviver:()=>Sr,isTrimmed:()=>tH,isStringSymbolReviver:()=>yr,isStringSymbol:()=>qP,isStringFiniteReviver:()=>br,isStringFinite:()=>VP,isStringBigIntReviver:()=>kr,isStringBigInt:()=>_P,isStartsWithReviver:()=>cr,isStartsWith:()=>OP,isSizeBetweenReviver:()=>zi,isSizeBetween:()=>uP,isSchemaError:()=>eG,isSchema:()=>x3,isPropertyNamesReviver:()=>Ni,isPropertyNames:()=>iP,isPropertiesLengthBetweenReviver:()=>Ri,isPropertiesLengthBetween:()=>rP,isPatternReviver:()=>xr,isPattern:()=>b9,isNonEmpty:()=>dP,isMultipleOfReviver:()=>Yi,isMultipleOf:()=>IP,isMinSizeReviver:()=>Ui,isMinSize:()=>fP,isMinPropertiesReviver:()=>Oi,isMinProperties:()=>lP,isMinLengthReviver:()=>_i,isMinLength:()=>XK,isMaxSizeReviver:()=>Bi,isMaxSize:()=>cP,isMaxPropertiesReviver:()=>Fi,isMaxProperties:()=>oP,isMaxLengthReviver:()=>qi,isMaxLength:()=>pP,isLowercasedReviver:()=>rr,isLowercased:()=>LP,isLessThanReviver:()=>er,isLessThanOrEqualToReviver:()=>Qi,isLessThanOrEqualToDateReviver:()=>Oa,isLessThanOrEqualToDate:()=>xP,isLessThanOrEqualToBigIntReviver:()=>Ma,isLessThanOrEqualToBigInt:()=>hP,isLessThanOrEqualToBigDecimal:()=>Ki,isLessThanOrEqualTo:()=>TP,isLessThanDateReviver:()=>za,isLessThanDate:()=>vP,isLessThanBigIntReviver:()=>La,isLessThanBigInt:()=>gP,isLessThanBigDecimal:()=>Hi,isLessThan:()=>jP,isLengthBetweenReviver:()=>Di,isLengthBetween:()=>YK,isIntReviver:()=>$i,isInt32:()=>Ji,isInt:()=>V7,isIncludesReviver:()=>lr,isIncludes:()=>RP,isGreaterThanReviver:()=>sr,isGreaterThanOrEqualToReviver:()=>tr,isGreaterThanOrEqualToDateReviver:()=>Ba,isGreaterThanOrEqualToDate:()=>SP,isGreaterThanOrEqualToBigIntReviver:()=>Na,isGreaterThanOrEqualToBigInt:()=>yP,isGreaterThanOrEqualToBigDecimal:()=>Wi,isGreaterThanOrEqualTo:()=>QK,isGreaterThanDateReviver:()=>Ua,isGreaterThanDate:()=>EP,isGreaterThanBigIntReviver:()=>Ra,isGreaterThanBigInt:()=>kP,isGreaterThanBigDecimal:()=>Gi,isGreaterThan:()=>CP,isGUIDReviver:()=>mr,isGUID:()=>UP,isFiniteReviver:()=>ar,isFinite:()=>PP,isEndsWithReviver:()=>ur,isEndsWith:()=>FP,isCapitalizedReviver:()=>ir,isCapitalized:()=>MP,isBetweenReviver:()=>Xi,isBetweenDateReviver:()=>Fa,isBetweenDate:()=>bP,isBetweenBigIntReviver:()=>wa,isBetweenBigInt:()=>mP,isBetweenBigDecimal:()=>Vi,isBetween:()=>h3,isBase64UrlReviver:()=>fr,isBase64Url:()=>zP,isBase64Reviver:()=>pr,isBase64:()=>eH,is:()=>kw,instanceOf:()=>y6,fromURLSearchParams:()=>On,fromJsonString:()=>RA,fromFormData:()=>Bn,fromBrand:()=>Nr,flip:()=>pH,fieldsAssign:()=>Hr,extendTo:()=>_r,encodeUnknownSync:()=>iw,encodeUnknownResult:()=>ow,encodeUnknownPromise:()=>rw,encodeUnknownOption:()=>uo,encodeUnknownExit:()=>lw,encodeUnknownEffect:()=>v3,encodeTo:()=>nH,encodeSync:()=>io,encodeResult:()=>oo,encodePromise:()=>ro,encodeOption:()=>lo,encodeKeys:()=>Vr,encodeExit:()=>co,encodeEffect:()=>uw,encode:()=>Pr,decodeUnknownSync:()=>cw,decodeUnknownResult:()=>pw,decodeUnknownPromise:()=>fw,decodeUnknownOption:()=>go,decodeUnknownExit:()=>mw,decodeUnknownEffect:()=>S3,decodeTo:()=>l,decodeSync:()=>fo,decodeResult:()=>mo,decodePromise:()=>po,decodeOption:()=>ho,decodeExit:()=>yo,decodeEffect:()=>ko,decode:()=>wr,declareConstructor:()=>H8,declare:()=>A8,check:()=>Fr,catchEncodingWithContext:()=>GP,catchEncoding:()=>Mr,catchDecodingWithContext:()=>ZP,catchDecoding:()=>Lr,brand:()=>$P,asserts:()=>bo,annotateKey:()=>Eo,annotateEncoded:()=>Io,annotate:()=>To,Void:()=>Zr,UnknownFromJsonString:()=>qn,Unknown:()=>uH,UniqueSymbol:()=>Wr,UniqueArray:()=>zr,Union:()=>Q1,UndefinedOr:()=>y3,Undefined:()=>lH,Uint8ArrayReviver:()=>Tn,Uint8ArrayFromHex:()=>Sn,Uint8ArrayFromBase64Url:()=>En,Uint8ArrayFromBase64:()=>In,Uint8Array:()=>q7,URLSearchParamsReviver:()=>zn,URLSearchParams:()=>_K,URLReviver:()=>ni,URLFromString:()=>ai,URL:()=>GK,TupleWithRest:()=>Dr,Tuple:()=>r5,Trimmed:()=>NA,Trim:()=>Ln,Tree:()=>Ia,TimeZoneReviver:()=>mn,TimeZoneOffsetReviver:()=>yn,TimeZoneOffset:()=>MA,TimeZoneNamedReviver:()=>gn,TimeZoneNamedFromString:()=>hn,TimeZoneNamed:()=>qK,TimeZoneFromString:()=>dn,TimeZone:()=>DK,TemplateLiteralParser:()=>Xr,TemplateLiteral:()=>Qr,TaggedUnion:()=>Tr,TaggedStruct:()=>g3,TaggedErrorClass:()=>rn,TaggedClass:()=>on,Symbol:()=>sw,StructWithRest:()=>qr,Struct:()=>m,StringFromUriComponent:()=>An,StringFromHex:()=>Pn,StringFromBase64Url:()=>wn,StringFromBase64:()=>Mn,String:()=>n,StandardSchemaV1FailureResult:()=>Cn,SchemaError:()=>C6,ResultReviver:()=>Si,Result:()=>nP,RegExpReviver:()=>ii,RegExp:()=>DA,RedactedReviver:()=>bi,RedactedFromValue:()=>ki,Redacted:()=>JK,Record:()=>tw,ReadonlySetReviver:()=>li,ReadonlySet:()=>VA,ReadonlyMapReviver:()=>ci,ReadonlyMap:()=>HA,PropertyKey:()=>cH,OptionReviver:()=>Pi,OptionFromUndefinedOr:()=>Ci,OptionFromOptionalNullOr:()=>Ei,OptionFromOptionalKey:()=>Ti,OptionFromOptional:()=>Ii,OptionFromNullishOr:()=>ji,OptionFromNullOr:()=>Ai,Option:()=>g6,Opaque:()=>Ir,ObjectKeyword:()=>Gr,NumberFromString:()=>Fn,Number:()=>b3,NullishOr:()=>XP,NullOr:()=>rH,Null:()=>F0,NonEmptyString:()=>Mi,NonEmptyArray:()=>Ur,Never:()=>$r,Natural:()=>W8,MutableJsonReviver:()=>va,MutableJson:()=>pA,Literals:()=>k3,Literal:()=>p0,JsonReviver:()=>Ea,Json:()=>p3,Int:()=>k9,HashSetReviver:()=>oi,HashSet:()=>_A,HashMapReviver:()=>ui,HashMap:()=>KA,FormDataReviver:()=>Un,FormData:()=>VK,FiniteFromString:()=>Rn,Finite:()=>o8,FileReviver:()=>Dn,File:()=>KK,ExitReviver:()=>fi,Exit:()=>ZA,ErrorReviver:()=>di,ErrorClass:()=>TA,Error:()=>JA,Enum:()=>Yr,DurationReviver:()=>Qn,DurationFromString:()=>Yn,DurationFromNanos:()=>$n,DurationFromMillis:()=>Jn,Duration:()=>_7,Defect:()=>pi,DateTimeZonedReviver:()=>pn,DateTimeZonedFromString:()=>fn,DateTimeZoned:()=>UK,DateTimeUtcReviver:()=>vn,DateTimeUtcFromString:()=>bn,DateTimeUtcFromMillis:()=>kn,DateTimeUtcFromDate:()=>xn,DateTimeUtc:()=>D7,DateReviver:()=>si,DateFromString:()=>ti,DateFromMillis:()=>ei,Date:()=>r8,Class:()=>jA,ChunkReviver:()=>ri,Chunk:()=>qA,Char:()=>wi,CauseReviver:()=>gi,CauseReasonReviver:()=>yi,CauseReason:()=>T3,Cause:()=>I3,BooleanFromBit:()=>jn,Boolean:()=>aw,BigIntFromString:()=>Nn,BigInt:()=>U4,BigDecimalReviver:()=>Kn,BigDecimalFromString:()=>Vn,BigDecimal:()=>HK,ArrayEnsure:()=>Br,Array:()=>e0,Any:()=>Jr});var VB=/^[+-]?\d+$/,bZ="~effect/BigDecimal",Kk={[bZ]:bZ,[D0](){let Q=kZ(this);return X1(X0(Q.value),z4(Q.scale))},[U0](Q){return cY(Q)&&Bk(this,Q)},toString(){return`BigDecimal(${W4(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[W1](){return this.toJSON()},pipe(){return H0(this,arguments)}},cY=(Q)=>C(Q,bZ),p1=(Q,X)=>{let Y=Object.create(Kk);return Y.value=Q,Y.scale=X,Y},qB=(Q,X)=>{if(Q!==Y8&&Q%fY===Y8)throw RangeError("Value must be normalized");let Y=p1(Q,X);return Y.normalized=Y,Y},Y8=BigInt(0),Vk=BigInt(1),_k=BigInt(-1);var fY=BigInt(10),DB=qB(Y8,0);var kZ=(Q)=>{if(Q.normalized===void 0)if(Q.value===Y8)Q.normalized=DB;else{let X=`${Q.value}`,Y=0;for(let Z=X.length-1;Z>=0;Z--)if(X[Z]==="0")Y++;else break;if(Y===0)Q.normalized=Q;let $=BigInt(X.substring(0,X.length-Y)),J=Q.scale-Y;Q.normalized=qB($,J)}return Q.normalized},B6=U(2,(Q,X)=>{if(X>Q.scale)return p1(Q.value*fY**BigInt(X-Q.scale),X);if(X<Q.scale)return p1(Q.value/fY**BigInt(Q.scale-X),X);return Q}),UB=U(2,(Q,X)=>{if(X.value===Y8)return Q;if(Q.value===Y8)return X;if(Q.scale>X.scale)return p1(B6(X,Q.scale).value+Q.value,Q.scale);if(Q.scale<X.scale)return p1(B6(Q,X.scale).value+X.value,X.scale);return p1(Q.value+X.value,Q.scale)});var b4=s6((Q,X)=>{let Y=D1(_B(Q),_B(X));if(Y!==0)return Y;if(Q.scale>X.scale)return _8(Q.value,B6(X,Q.scale).value);if(Q.scale<X.scale)return _8(B6(Q,X.scale).value,X.value);return _8(Q.value,X.value)}),qk=o9(b4);var Dk=Y6(b4);var _B=(Q)=>Q.value===Y8?0:Q.value<Y8?-1:1,Uk=(Q)=>Q.value<Y8?p1(-Q.value,Q.scale):Q;var yZ=H1((Q,X)=>{if(Q.scale>X.scale)return B6(X,Q.scale).value===Q.value;if(Q.scale<X.scale)return B6(Q,X.scale).value===X.value;return Q.value===X.value}),Bk=U(2,(Q,X)=>yZ(Q,X));var BB=(Q)=>{if(Q==="")return R(DB);let X,Y,$=Q.search(/[eE]/);if($!==-1){let H=Q.slice($+1);if(X=Q.slice(0,$),Y=Number(H),X===""||!Number.isSafeInteger(Y)||!VB.test(H))return d()}else X=Q,Y=0;let J,Z,G=X.search(/\./);if(G!==-1){let H=X.slice(0,G),K=X.slice(G+1);J=`${H}${K}`,Z=K.length}else J=X,Z=0;if(!VB.test(J))return d();let W=Z-Y;if(!Number.isSafeInteger(W))return d();return R(p1(BigInt(J),W))};var W4=(Q)=>{let X=kZ(Q);if(Math.abs(X.scale)>=16)return zk(X);let Y=X.value<Y8,$=Y?`${X.value}`.substring(1):`${X.value}`,J,Z;if(X.scale>=$.length)J="0",Z="0".repeat(X.scale-$.length)+$;else{let W=$.length-X.scale;if(W>$.length){let H=W-$.length;J=`${$}${"0".repeat(H)}`,Z=""}else Z=$.slice(W),J=$.slice(0,W)}let G=Z===""?J:`${J}.${Z}`;return Y?`-${G}`:G},zk=(Q)=>{if(Ok(Q))return"0e+0";let X=kZ(Q),Y=`${Uk(X).value}`,$=Y.slice(0,1),J=Y.slice(1),Z=`${zB(X)?"-":""}${$}`;if(J!=="")Z+=`.${J}`;let G=J.length-X.scale;return`${Z}e${G>=0?"+":""}${G}`};var Ok=(Q)=>Q.value===Y8,zB=(Q)=>Q.value<Y8,Fk=(Q)=>Q.value>Y8,gZ=(Q)=>cY(Q[0]);var OB=U(gZ,(Q,X=0)=>{if(Q.scale<=X)return Q;return p1(Q.value/fY**BigInt(Q.scale-X),X)}),hZ=U(gZ,(Q,X=0)=>{let Y=OB(Q,X);if(Fk(Q)&&qk(Y,Q))return UB(Y,p1(Vk,X));return Y});var mZ=U(gZ,(Q,X=0)=>{let Y=OB(Q,X);if(zB(Q)&&Dk(Y,Q))return UB(Y,p1(_k,X));return Y});var RB="~effect/collections/Chunk";function Rk(Q,X,Y,$,J){for(let Z=X;Z<Math.min(Q.length,X+J);Z++)Y[$+Z-X]=Q[Z];return Y}var NB=[],pZ=(Q)=>H1((X,Y)=>X.length===Y.length&&WX(X).every(($,J)=>Q($,HX(Y,J)))),Nk=pZ(o),Lk={[RB]:{_A:(Q)=>Q},toString(){return`Chunk(${P(WX(this))})`},toJSON(){return{_id:"Chunk",values:R1(WX(this))}},[W1](){return this.toJSON()},[U0](Q){return uY(Q)&&Nk(this,Q)},[D0](){return GQ(WX(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return NB[Symbol.iterator]();default:return WX(this)[Symbol.iterator]()}},pipe(){return H0(this,arguments)}},fZ=(Q)=>{let X=Object.create(Lk);switch(X.backing=Q,Q._tag){case"IEmpty":{X.length=0,X.depth=0,X.left=X,X.right=X;break}case"IConcat":{X.length=Q.left.length+Q.right.length,X.depth=1+Math.max(Q.left.depth,Q.right.depth),X.left=Q.left,X.right=Q.right;break}case"IArray":{X.length=Q.array.length,X.depth=0,X.left=k4,X.right=k4;break}case"ISingleton":{X.length=1,X.depth=0,X.left=k4,X.right=k4;break}case"ISlice":{X.length=Q.length,X.depth=Q.chunk.depth+1,X.left=k4,X.right=k4;break}}return X},uY=(Q)=>C(Q,RB),k4=fZ({_tag:"IEmpty"}),Mk=()=>k4;var wk=(Q)=>fZ({_tag:"ISingleton",a:Q}),lY=(Q)=>uY(Q)?Q:Ak(M1(Q)),dZ=(Q,X,Y)=>{switch(Q.backing._tag){case"IArray":{Rk(Q.backing.array,0,X,Y,Q.length);break}case"IConcat":{dZ(Q.left,X,Y),dZ(Q.right,X,Y+Q.left.length);break}case"ISingleton":{X[Y]=Q.backing.a;break}case"ISlice":{let $=0,J=Y;while($<Q.length)X[J]=HX(Q,$),$+=1,J+=1;break}}};var Pk=(Q)=>{switch(Q.backing._tag){case"IEmpty":return NB;case"IArray":return Q.backing.array;default:{let X=Array(Q.length);return dZ(Q,X,0),Q.backing={_tag:"IArray",array:X},Q.left=k4,Q.right=k4,Q.depth=0,X}}},WX=Pk;var Ak=(Q)=>Q.length===0?Mk():Q.length===1?wk(Q[0]):fZ({_tag:"IArray",array:Q});var HX=U(2,(Q,X)=>{let Y=Math.floor(X);switch(Q.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${Y}`);case"ISingleton":{if(X!==0)throw Error(`Index out of bounds: ${Y}`);return Q.backing.a}case"IArray":{if(Y>=Q.length||Y<0)throw Error(`Index out of bounds: ${Y}`);return Q.backing.array[Y]}case"IConcat":return Y<Q.left.length?HX(Q.left,Y):HX(Q.right,Y-Q.left.length);case"ISlice":return HX(Q.backing.chunk,Y+Q.backing.offset)}});var LB=(Q)=>Q.length;var cZ=U5,MB=_9,wB=_U,PB=qU,AB=DU,CB=ZZ,uZ=UU,lZ=BU;var jB=D5;var TB=HZ;var oY=zU,IB=OU;var rY=FU;var oZ=KZ,KX=aQ,EB=VZ;var SB=_Z,z6=RU;var iY=sQ;var vB=UZ;var xB=LU;var nY=zZ;var bB="~effect/encoding/EncodingError";class O6 extends SY("EncodingError"){[bB]=bB}var sY=(Q)=>typeof Q==="string"?iZ(sZ.encode(Q)):iZ(Q),N5=(Q)=>{let X=uB(Q),Y=X.length;if(Y%4!==0)return i(new O6({kind:"Decode",module:"Base64",input:X,message:`Length must be a multiple of 4, but is ${Y}`}));let $=X.indexOf("=");if($!==-1&&($<Y-2||$===Y-2&&X[Y-1]!=="="))return i(new O6({kind:"Decode",module:"Base64",input:X,message:"Found a '=' character, but it is not at the end"}));try{let J=X.endsWith("==")?2:X.endsWith("=")?1:0,Z=new Uint8Array(3*(Y/4)-J);for(let G=0,W=0;G<Y;G+=4,W+=3){let H=aY(X.charCodeAt(G))<<18|aY(X.charCodeAt(G+1))<<12|aY(X.charCodeAt(G+2))<<6|aY(X.charCodeAt(G+3));Z[W]=H>>16,Z[W+1]=H>>8&255,Z[W+2]=H&255}return t(Z)}catch(J){return i(new O6({kind:"Decode",module:"Base64",input:X,message:J instanceof Error?J.message:"Invalid input"}))}},mB=(Q)=>X9(N5(Q),(X)=>tZ.decode(X)),dB=(Q)=>typeof Q==="string"?yB(sZ.encode(Q)):yB(Q),nZ=(Q)=>{let X=uB(Q),Y=X.length;if(Y%4===1)return i(new O6({module:"Base64Url",kind:"Decode",input:X,message:`Length should be a multiple of 4, but is ${Y}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(X))return i(new O6({module:"Base64Url",kind:"Decode",input:X,message:"Invalid input"}));let $=Y%4===2?`${X}==`:Y%4===3?`${X}=`:X;return $=$.replace(/-/g,"+").replace(/_/g,"/"),N5($)},pB=(Q)=>X9(nZ(Q),(X)=>tZ.decode(X)),fB=(Q)=>typeof Q==="string"?gB(sZ.encode(Q)):gB(Q),aZ=(Q)=>{let X=new TextEncoder().encode(Q);if(X.length%2!==0)return i(new O6({module:"Hex",kind:"Decode",input:Q,message:`Length must be a multiple of 2, but is ${X.length}`}));try{let Y=X.length/2,$=new Uint8Array(Y);for(let J=0;J<Y;J++){let Z=hB(X[J*2]),G=hB(X[J*2+1]);$[J]=Z<<4|G}return t($)}catch(Y){return i(new O6({module:"Hex",kind:"Decode",input:Q,message:Y instanceof Error?Y.message:"Invalid input"}))}},cB=(Q)=>X9(aZ(Q),(X)=>tZ.decode(X)),sZ=new TextEncoder,tZ=new TextDecoder,uB=(Q)=>Q.replace(/[\n\r]/g,""),iZ=(Q)=>{let X=Q.length,Y="",$;for($=2;$<X;$+=3)Y+=y4[Q[$-2]>>2],Y+=y4[(Q[$-2]&3)<<4|Q[$-1]>>4],Y+=y4[(Q[$-1]&15)<<2|Q[$]>>6],Y+=y4[Q[$]&63];if($===X+1)Y+=y4[Q[$-2]>>2],Y+=y4[(Q[$-2]&3)<<4],Y+="==";if($===X)Y+=y4[Q[$-2]>>2],Y+=y4[(Q[$-2]&3)<<4|Q[$-1]>>4],Y+=y4[(Q[$-1]&15)<<2],Y+="=";return Y};function aY(Q){if(Q>=kB.length)throw TypeError(`Invalid character ${String.fromCharCode(Q)}`);let X=kB[Q];if(X===255)throw TypeError(`Invalid character ${String.fromCharCode(Q)}`);return X}var y4=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],kB=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],yB=(Q)=>iZ(Q).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),gB=(Q)=>{let X="";for(let Y=0;Y<Q.length;++Y)X+=jk[Q[Y]];return X},hB=(Q)=>{if(48<=Q&&Q<=57)return Q-48;if(97<=Q&&Q<=102)return Q-97+10;if(65<=Q&&Q<=70)return Q-65+10;throw TypeError("Invalid input")},jk=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var eY="~effect/collections/HashMap",x8=5,DX=1<<x8,Tk=DX/4,oB=DX/2,Ik=DX-1,Ek=(Q)=>{return Q=Q-(Q>>>1&1431655765),Q=(Q&858993459)+(Q>>>2&858993459),(Q+(Q>>>4)&252645135)*16843009>>>24},VX=(Q,X)=>Q>>>X&Ik,F6=(Q,X)=>1<<VX(Q,X),tY=(Q,X)=>Ek(Q&X-1);function rB(Q,X,Y,$,J,Z){if(X>32)throw Error("HashMap: max depth exceeded");let G=F6(Y,X),W=F6(J,X);if(G===W){let V=rB(Q,X+x8,Y,$,J,Z);return new H4(Q,G,[V])}let H=G|W,K=G>>>0<W>>>0?[$,Z]:[Z,$];return new H4(Q,H,K)}class L5{canEdit(Q){return this.edit===Q}}class iB extends L5{_tag="EmptyNode";edit=0;get size(){return 0}get(Q,X,Y){return d()}has(Q,X,Y){return!1}set(Q,X,Y,$,J,Z){return Z.value=!0,new g4(Q,Y,$,J)}remove(Q,X,Y,$,J){return this}iterator(){return[][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}canEdit(Q){return!1}}class g4 extends L5{_tag="LeafNode";edit;hash;key;value;constructor(Q,X,Y,$){super();this.edit=Q,this.hash=X,this.key=Y,this.value=$}get size(){return 1}get(Q,X,Y){if(this.hash===X&&o(this.key,Y))return R(this.value);return d()}has(Q,X,Y){return this.hash===X&&o(this.key,Y)}set(Q,X,Y,$,J,Z){if(this.hash===Y&&o(this.key,$)){if(o(this.value,J))return this;if(this.canEdit(Q))return this.value=J,this;return new g4(Q,Y,$,J)}if(Z.value=!0,this.hash===Y)return new _X(Q,Y,[[this.key,this.value],[$,J]]);let G=F6(Y,X),W=F6(this.hash,X);if(G===W)return new H4(Q,G,[this.set(Q,X+x8,Y,$,J,Z)]);let H=G|W,K=G>>>0<W>>>0?[new g4(Q,Y,$,J),this]:[this,new g4(Q,Y,$,J)];return new H4(Q,H,K)}remove(Q,X,Y,$,J){if(this.hash===Y&&o(this.key,$)){J.value=!0;return}return this}iterator(){return[[this.key,this.value]][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class _X extends L5{_tag="CollisionNode";edit;hash;entries;constructor(Q,X,Y){super();this.edit=Q,this.hash=X,this.entries=Y}get size(){return this.entries.length}get(Q,X,Y){if(this.hash!==X)return d();for(let[$,J]of this.entries)if(o($,Y))return R(J);return d()}has(Q,X,Y){if(this.hash!==X)return!1;for(let[$]of this.entries)if(o($,Y))return!0;return!1}set(Q,X,Y,$,J,Z){if(this.hash!==Y)return Z.value=!0,rB(Q,X,this.hash,this,Y,new g4(Q,Y,$,J));for(let G=0;G<this.entries.length;G++)if(o(this.entries[G][0],$)){if(o(this.entries[G][1],J))return this;if(this.canEdit(Q))return this.entries[G]=[$,J],this;let W=[...this.entries];return W[G]=[$,J],new _X(Q,this.hash,W)}if(Z.value=!0,this.canEdit(Q))return this.entries.push([$,J]),this;return new _X(Q,this.hash,[...this.entries,[$,J]])}remove(Q,X,Y,$,J){if(this.hash!==Y)return this;let Z=this.entries.findIndex(([W])=>o(W,$));if(Z===-1)return this;if(J.value=!0,this.entries.length===1)return;if(this.entries.length===2){let W=this.entries[Z===0?1:0];return new g4(Q,this.hash,W[0],W[1])}if(this.canEdit(Q))return this.entries.splice(Z,1),this;let G=[...this.entries];return G.splice(Z,1),new _X(Q,this.hash,G)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class H4 extends L5{_tag="IndexedNode";edit;_size;bitmap;children;constructor(Q,X,Y){super();this.edit=Q,this.bitmap=X,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((Q,X)=>Q+X.size,0);return this._size}get(Q,X,Y){let $=F6(X,Q);if((this.bitmap&$)===0)return d();let J=tY(this.bitmap,$);return this.children[J].get(Q+x8,X,Y)}has(Q,X,Y){let $=F6(X,Q);if((this.bitmap&$)===0)return!1;let J=tY(this.bitmap,$);return this.children[J].has(Q+x8,X,Y)}set(Q,X,Y,$,J,Z){let G=F6(Y,X),W=tY(this.bitmap,G);if((this.bitmap&G)!==0){let H=this.children[W],K=H.set(Q,X+x8,Y,$,J,Z);if(H===K)return this;if(this.canEdit(Q))return this.children[W]=K,this;let V=[...this.children];return V[W]=K,new H4(Q,this.bitmap,V)}else{Z.value=!0;let H=new g4(Q,Y,$,J),K=this.bitmap|G;if(this.canEdit(Q)){if(this.children.splice(W,0,H),this.bitmap=K,this._size=void 0,this.children.length>oB)return this.expand(Q,K,this.children);return this}let V=[...this.children];if(V.splice(W,0,H),V.length>oB)return this.expand(Q,K,V);return new H4(Q,K,V)}}remove(Q,X,Y,$,J){let Z=F6(Y,X);if((this.bitmap&Z)===0)return this;let G=tY(this.bitmap,Z),W=this.children[G],H=W.remove(Q,X+x8,Y,$,J);if(!J.value)return this;if(H===void 0){let V=this.bitmap^Z;if(V===0)return;if(this.children.length===2){let q=this.children[G===0?1:0];if(q._tag==="LeafNode")return q}if(this.canEdit(Q))return this.children.splice(G,1),this.bitmap=V,this._size=void 0,this;let _=[...this.children];return _.splice(G,1),new H4(Q,V,_)}if(W===H)return this;if(this.canEdit(Q))return this.children[G]=H,this;let K=[...this.children];return K[G]=H,new H4(Q,this.bitmap,K)}expand(Q,X,Y){let $=new globalThis.Array(DX),J=0;for(let Z=0;Z<DX;Z++)if((X&1<<Z)!==0)$[Z]=Y[J++];return new qX(Q,Y.length,$)}iterator(){let Q=0,X;return{next:()=>{while(Q<this.children.length){if(!X)X=this.children[Q].iterator();let Y=X.next();if(!Y.done)return Y;X=void 0,Q++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class qX extends L5{_tag="ArrayNode";edit;_size;count;children;constructor(Q,X,Y){super();this.edit=Q,this.count=X,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((Q,X)=>Q+(X?.size??0),0);return this._size}get(Q,X,Y){let $=VX(X,Q),J=this.children[$];return J?J.get(Q+x8,X,Y):d()}has(Q,X,Y){let $=VX(X,Q),J=this.children[$];return J?J.has(Q+x8,X,Y):!1}set(Q,X,Y,$,J,Z){let G=VX(Y,X),W=this.children[G];if(W){let H=W.set(Q,X+x8,Y,$,J,Z);if(W===H)return this;if(this.canEdit(Q))return this.children[G]=H,this;let K=[...this.children];return K[G]=H,new qX(Q,this.count,K)}else{Z.value=!0;let H=new g4(Q,Y,$,J);if(this.canEdit(Q))return this.children[G]=H,this.count++,this._size=void 0,this;let K=[...this.children];return K[G]=H,new qX(Q,this.count+1,K)}}remove(Q,X,Y,$,J){let Z=VX(Y,X),G=this.children[Z];if(!G)return this;let W=G.remove(Q,X+x8,Y,$,J);if(!J.value)return this;let H=this.count-(W?0:1);if(H<Tk)return this.pack(Q,Z,W);if(G===W)return this;if(this.canEdit(Q)){if(this.children[Z]=W,!W)this.count=H;return this._size=void 0,this}let K=[...this.children];return K[Z]=W,new qX(Q,H,K)}pack(Q,X,Y){let $=[],J=0,Z=1;for(let G=0;G<this.children.length;G++){let W=G===X?Y:this.children[G];if(W)$.push(W),J|=Z;Z<<=1}return new H4(Q,J,$)}iterator(){let Q=0,X;return{next:()=>{while(Q<this.children.length){let Y=this.children[Q];if(!Y){Q++;continue}if(!X)X=Y.iterator();let $=X.next();if(!$.done)return $;X=void 0,Q++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class Q2{[eY]=eY;_editable;_edit;_root;_size;constructor(Q,X,Y,$){this._editable=Q,this._edit=X,this._root=Y,this._size=$}get size(){return this._size}[Symbol.iterator](){return this._root.iterator()}[U0](Q){if(eZ(Q)){let X=Q;if(this.size!==X.size)return!1;for(let[Y,$]of this){let J=n3(Q,sB(Y));if(I0(J)||!o($,J.value))return!1}return!0}return!1}[D0](){let Q=b0("HashMap");for(let[X,Y]of this)Q=Q^X0(X)+X0(Y);return Q}[W1](){return R1(this)}toString(){return`HashMap(${P(Array.from(this))})`}toJSON(){return{_id:"HashMap",values:Array.from(this).map(([Q,X])=>[R1(Q),R1(X)])}}pipe(){return H0(this,arguments)}}var nB=new iB,eZ=(Q)=>C(Q,eY),QG=()=>new Q2(!1,0,nB,0);var aB=(Q)=>{let X=nB,Y=0,$={value:!1};for(let[J,Z]of Q){let G=X0(J);if($.value=!1,X=X.set(NaN,0,G,J,Z,$),$.value)Y++}return new Q2(!1,0,X,Y)};var sB=U(2,(Q,X)=>{return Q._root.get(0,X0(X),X)});var XG=U(2,(Q,X)=>{return Q._root.has(0,X0(X),X)});var YG=U(3,(Q,X,Y)=>{let $=Q,J=X0(X),Z={value:!1},G=$._editable?$._edit:NaN,W=$._root.set(G,0,J,X,Y,Z);if($._editable){if($._root=W,Z.value)$._size++;return Q}if($._root===W)return Q;return new Q2(!1,$._edit,W,$._size+(Z.value?1:0))}),$G=(Q)=>{let X=Q[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){let Y=X.next();if(Y.done)return{done:!0,value:void 0};return{done:!1,value:Y.value[0]}}}};var tB=(Q)=>{let X=Q[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return X.next()}}},X2=(Q)=>Q.size;var Qz=eZ;var Y2=aB;var xk=tB,$2=(Q)=>Array.from(xk(Q)),Xz=X2;var UX="~effect/collections/HashSet",kk={[D0](){return X0(UX)},[U0](Q){return JG(Q)&&J2(this)===J2(Q)&&Jz(this,(X)=>$z(Q,X))},[Symbol.iterator](){return $G(ZG(this))},toString(){return`HashSet(${P(Array.from(this))})`},toJSON(){return{_id:"HashSet",values:R1(Array.from(this))}},[W1](){return this.toJSON()},pipe(){return H0(this,arguments)}},yk=(Q)=>{let X=Object.create(kk);return X[UX]=UX,X.keyMap=Q,X},JG=(Q)=>C(Q,UX),ZG=(Q)=>Q.keyMap;var Yz=(Q)=>{let X=QG();for(let Y of Q)X=YG(X,Y,!0);return yk(X)},$z=(Q,X)=>XG(ZG(Q),X);var J2=(Q)=>X2(ZG(Q));var Jz=(Q,X)=>{for(let Y of Q)if(!X(Y))return!1;return!0};var Z2=Yz,Zz=JG;var Gz=J2;function h4(Q){return Q.checks?Q.checks[Q.checks.length-1].annotations:Q.annotations}function BX(Q){return(X)=>h4(X)?.[Q]}var f1="~structural",zX="~identifier",OX="~sentinels",Wz=["title","description","default","examples","readOnly","writeOnly","format","contentEncoding","contentMediaType","contentSchema"],R6=BX("identifier"),G2=BX(zX),GG=BX("title");var Hz=BX("brands"),W2=s0((Q)=>{let X=R6(Q);if(typeof X==="string")return X;return Q.getExpected(W2)});var Kz=new Set([OX,f1,"representation","arbitrary","brands","toJsonSchema","toCode","toArbitrary","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecStringTree","toCodecIso"]);var O9=new WeakMap,Vz=(Q)=>{if(O9.has(Q))return O9.get(Q);else throw Error("Unable to get redacted value"+(Q.label?` with label: "${Q.label}"`:""))};var _z="~effect/data/Redacted",WG=(Q)=>C(Q,_z),K4=(Q,X)=>{let Y=Object.create(dk);if(X?.label)Y.label=X.label;return O9.set(Y,Q),Y},dk={[_z]:{_A:(Q)=>Q},label:void 0,...F4,toJSON(){return this.toString()},toString(){return`<redacted${C8(this.label)?":"+this.label:""}>`},[D0](){return X0(O9.get(this))},[U0](Q){return WG(Q)&&o(O9.get(this),O9.get(Q))}},M5=Vz;var qz=(Q)=>H1((X,Y)=>Q(M5(X),M5(Y)));var RX="~effect/SchemaIssue/Issue";function VG(Q){return C(Q,RX)&&Q[RX]===RX}class R8{[RX]=RX;toString(){return fk(this)}}class K2 extends R8{_tag="Filter";actual;filter;issue;constructor(Q,X,Y){super();this.actual=Q,this.filter=X,this.issue=Y}}class _G extends R8{_tag="Encoding";ast;actual;issue;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issue=Y}}class S0 extends R8{_tag="Pointer";path;issue;constructor(Q,X){super();this.path=Q,this.issue=X}}class LX extends R8{_tag="MissingKey";annotations;constructor(Q){super();this.annotations=Q}}class V2 extends R8{_tag="UnexpectedKey";ast;actual;constructor(Q,X){super();this.ast=Q,this.actual=X}}class N0 extends R8{_tag="Composite";ast;actual;issues;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issues=Y}}class u0 extends R8{_tag="InvalidType";ast;actual;constructor(Q,X){super();this.ast=Q,this.actual=X}}class q0 extends R8{_tag="InvalidValue";actual;annotations;constructor(Q,X){super();this.actual=Q,this.annotations=X}}class w5 extends R8{_tag="Forbidden";actual;annotations;constructor(Q,X){super();this.actual=Q,this.annotations=X}}class _2 extends R8{_tag="AnyOf";ast;actual;issues;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issues=Y}}class qG extends R8{_tag="OneOf";ast;actual;successes;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.successes=Y}}function HG(Q,X){if(VG(X))return X;if(typeof X==="string")return new q0(R(Q),{message:X});let Y=typeof X.issue==="string"?new q0(R(Q),{message:X.issue}):X.issue;return new S0(X.path,Y)}function Bz(Q,X){if(X===void 0)return;if(typeof X==="boolean")return X?void 0:new q0(R(Q));return HG(Q,X)}function zz(Q,X,Y){if(Array.isArray(Y)){if(Z6(Y)){if(Y.length===1)return HG(Q,Y[0]);return new N0(X,R(Q),Q4(Y,($)=>HG(Q,$)))}return}return Bz(Q,Y)}var Oz=(Q)=>{let X=NX(Q);if(X!==void 0)return X;switch(Q._tag){case"InvalidType":return KG(W2(Q.ast),Uz(Q.actual));case"InvalidValue":return`Invalid data ${Uz(Q.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${P(Q.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${P(Q.actual)}`}},Fz=(Q)=>{return NX(Q.issue)??NX(Q)};function Rz(Q){return(X)=>({issues:F9(X,[],Q?.leafHook??Oz,Q?.checkHook??Fz)})}function KG(Q,X){return`Expected ${Q}, got ${X}`}function F9(Q,X,Y,$){switch(Q._tag){case"Filter":{let J=$(Q);if(J!==void 0)return[{path:X,message:J}];switch(Q.issue._tag){case"InvalidValue":return[{path:X,message:KG(Nz(Q.filter),P(Q.actual))}];default:return F9(Q.issue,X,Y,$)}}case"Encoding":return F9(Q.issue,X,Y,$);case"Pointer":return F9(Q.issue,[...X,...Q.path],Y,$);case"Composite":return Q.issues.flatMap((J)=>F9(J,X,Y,$));case"AnyOf":{let J=NX(Q);if(Q.issues.length===0){if(J!==void 0)return[{path:X,message:J}];let Z=KG(W2(Q.ast),P(Q.actual));return[{path:X,message:Z}]}return Q.issues.flatMap((Z)=>F9(Z,X,Y,$))}default:return[{path:X,message:Y(Q)}]}}function Nz(Q){let X=Q.annotations?.expected;if(typeof X==="string")return X;switch(Q._tag){case"Filter":return"<filter>";case"FilterGroup":return Q.checks.map((Y)=>Nz(Y)).join(" & ")}}function pk(){return(Q)=>F9(Q,[],Oz,Fz).map(ck).join(`
27
+ `)}var fk=pk();function ck(Q){let X=Q.message;if(Q.path&&Q.path.length>0){let Y=C7(Q.path);X+=`
28
+ at ${Y}`}return X}function NX(Q){switch(Q._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return FX(Q.ast.annotations);case"InvalidValue":case"Forbidden":return FX(Q.annotations);case"MissingKey":return FX(Q.annotations,"messageMissingKey");case"UnexpectedKey":return FX(Q.ast.annotations,"messageUnexpectedKey");case"Filter":return FX(Q.filter.annotations);case"Encoding":return NX(Q.issue)}}function FX(Q,X="message"){let Y=Q?.[X];if(typeof Y==="string")return Y}function Uz(Q){if(I0(Q))return"no value provided";return P(Q.value)}function H2(Q){switch(Q._tag){case"MissingKey":return Q;case"Forbidden":return new w5($6(Q.actual,K4),Q.annotations);case"Filter":return new K2(K4(Q.actual),Q.filter,H2(Q.issue));case"Pointer":return new S0(Q.path,H2(Q.issue));case"Encoding":case"InvalidType":case"InvalidValue":case"Composite":return new q0($6(Q.actual,K4));case"AnyOf":case"OneOf":case"UnexpectedKey":return new q0(R(K4(Q.actual)))}}function q2(Q){let X;for(let Y of Q.reasons){if(!pQ(Y)||!VG(Y.error))return;X??=Y.error}return X}function m4(Q,X){let Y=q2(Q);if(Y===void 0)throw Error(X,{cause:Q});return Y}class d4 extends f6{run;constructor(Q){super();this.run=Q}map(Q){return new d4((X,Y)=>this.run(X,Y).pipe(B9($6(Q))))}compose(Q){if(Mz(this))return Q;if(Mz(Q))return this;return new d4((X,Y)=>this.run(X,Y).pipe(F8(($)=>Q.run($,Y))))}}function uk(Q){return new d4((X)=>p(Q(X)))}function DG(Q){return uk((X)=>new w5(X,{message:Q(X)}))}var wz=new d4(f);function Mz(Q){return Q.run===wz.run}function b8(){return wz}function UG(Q){return new d4((X,Y)=>I0(X)?v8:Q(X.value,Y))}function Y0(Q){return D2($6(Q))}function c1(Q){return UG((X,Y)=>Q(X,Y).pipe(B9(R)))}function D2(Q){return new d4((X)=>f(Q(X)))}function BG(){return new d4(()=>v8)}function MX(Q){return new d4((X)=>{let Y=n9(X,_1);return L1(Y)?f(Y):B9(Q,R)})}function R9(){return Y0(globalThis.String)}function U2(){return Y0(globalThis.Number)}function Pz(){return Y0(globalThis.BigInt)}function zG(){return Y0((Q)=>new globalThis.Date(Q))}function Az(){return Y0(CU)}function Cz(Q){return UG((X)=>O5({try:()=>R(JSON.parse(X,Q?.reviver)),catch:(Y)=>new q0(R(X),{message:globalThis.String(Y)})}))}function jz(Q){return UG((X)=>O5({try:()=>{let Y=JSON.stringify(X,Q?.replacer,Q?.space);if(Y===void 0)throw TypeError("Value cannot be represented as JSON");return R(Y)},catch:(Y)=>new q0(R(X),{message:globalThis.String(Y)})}))}function OG(){return Y0(sY)}function B2(){return Y0(dB)}function z2(){return Y0(fB)}function Tz(){return c1((Q)=>R5(IZ(N5(Q)),(X)=>new q0(R(Q),{message:X.message})))}function Iz(){return c1((Q)=>B8(mB(Q),{onFailure:(X)=>p(new q0(R(Q),{message:X.message})),onSuccess:f}))}function Ez(){return c1((Q)=>B8(nZ(Q),{onFailure:(X)=>p(new q0(R(Q),{message:X.message})),onSuccess:f}))}function Sz(){return c1((Q)=>B8(pB(Q),{onFailure:(X)=>p(new q0(R(Q),{message:X.message})),onSuccess:f}))}function vz(){return c1((Q)=>B8(aZ(Q),{onFailure:(X)=>p(new q0(R(Q),{message:X.message})),onSuccess:f}))}function xz(){return c1((Q)=>B8(cB(Q),{onFailure:(X)=>p(new q0(R(Q),{message:X.message})),onSuccess:f}))}function bz(){return Y0(encodeURIComponent)}function kz(){return c1((Q)=>{try{return f(globalThis.decodeURIComponent(Q))}catch(X){return p(new q0(R(Q),{message:X instanceof URIError?X.message:"Invalid URI component"}))}})}function FG(){return c1((Q)=>{return T8(oY(Q),{onNone:()=>p(new q0(R(Q),{message:"Invalid DateTime input"})),onSome:(X)=>f(rY(X))})})}function yz(){return Y0((Q)=>dz(Array.from(Q.entries())))}var lk=pz((Q)=>typeof Q==="string"||typeof Blob<"u"&&Q instanceof Blob);function gz(){return Y0((Q)=>{let X=new FormData;if(typeof Q==="object"&&Q!==null)lk(Q).forEach(([$,J])=>{X.append($,J)});return X})}function hz(){return Y0((Q)=>dz(Array.from(Q.entries())))}var ok=pz(C8);function mz(){return Y0((Q)=>{if(typeof Q==="object"&&Q!==null)return new URLSearchParams(ok(Q));return new URLSearchParams})}var rk=/^\d+$/;function ik(Q){if(Q==="")return[""];let X=Q.replace(/\[(.*?)\]/g,".$1"),Y=X.split("."),$=X.startsWith(".")?1:0;return Y.slice($).map((J)=>rk.test(J)?globalThis.Number(J):J)}function dz(Q){let X={},Y=new WeakSet;function $(J,Z,G){let W=Object.hasOwn(J,Z)?J[Z]:void 0;if(Y.has(W)&&Array.isArray(W)===G)return W;let H=G?[]:{};return Y.add(H),b(J,Z,H),H}return Q.forEach(([J,Z])=>{let G=ik(J),W=X;G.forEach((H,K)=>{let V=K===G.length-1;if(Array.isArray(W)&&H==="")if(V)W.push(Z);else{let _=G[K+1],q=typeof _==="number"||_==="",D=W.length;W=$(W,D,q)}else if(V){let _=Object.hasOwn(W,H);if(_&&Array.isArray(W[H]))W[H].push(Z);else if(_)b(W,H,[W[H],Z]);else b(W,H,Z)}else{let _=G[K+1];W=$(W,H,typeof _==="number"||_==="")}})}),X}function pz(Q){return(X)=>{let Y=[];function $(J,Z){if(Q(Z))Y.push([J,Z]);else if(Array.isArray(Z))if(Z.every(Q))Z.forEach((W)=>{Y.push([J,W])});else Z.forEach((W,H)=>{$(`${J}[${H}]`,W)});else if(typeof Z==="object"&&Z!==null)for(let[G,W]of Object.entries(Z))$(`${J}[${G}]`,W)}for(let[J,Z]of Object.entries(X))$(J,Z);return Y}}class PX{_tag="Middleware";decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new PX(this.encode,this.decode)}}var wX="~effect/SchemaTransformation/Transformation";class z0{[wX]=wX;_tag="Transformation";decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new z0(this.encode,this.decode)}compose(Q){return new z0(this.decode.compose(Q.decode),Q.encode.compose(this.encode))}}function nk(Q){return C(Q,wX)&&Q[wX]===wX}var O2=(Q)=>{if(nk(Q))return Q;return new z0(Q.decode,Q.encode)};function N8(Q){return new z0(c1(Q.decode),c1(Q.encode))}function h0(Q){return new z0(Y0(Q.decode),Y0(Q.encode))}function F2(Q){return new z0(D2(Q.decode),D2(Q.encode))}function fz(){return new z0(Az(),b8())}var ak=new z0(b8(),b8());function A5(){return ak}var C5=new z0(U2(),R9()),R2=new z0(Pz(),R9()),NG=new z0(zG(),Y0(H$)),cz=new z0(zG(),Y0((Q)=>Q.getTime())),uz=N8({decode:(Q)=>T8(bV(Q),{onNone:()=>p(new q0(R(Q),{message:`Invalid Duration string: ${Q}`})),onSome:f}),encode:(Q)=>f(globalThis.String(Q))}),lz=N8({decode:(Q)=>f(Y4(Q)),encode:(Q)=>T8(kV(Q),{onNone:()=>p(new q0(R(Q),{message:`Unable to encode ${Q} into a bigint`})),onSome:(X)=>f(X)})}),oz=h0({decode:(Q)=>G6(Q),encode:(Q)=>W6(Q)}),sk=(Q)=>j1(Q)&&typeof Q.message==="string",rz=(Q)=>{let Y=Object.hasOwn(Q,"cause")?Error(Q.message,{cause:nz(Q.cause)}):Error(Q.message);if(typeof Q.name==="string"&&Q.name!=="Error")Y.name=Q.name;if(typeof Q.stack==="string")Y.stack=Q.stack;return Y},tk=(Q)=>{try{let X=l6(Q);return X===void 0?P(Q):JSON.parse(X)}catch{return P(Q)}},ek=(Q,X,Y)=>{let $={name:Q.name,message:typeof Q.message==="string"?Q.message:""};if(X?.includeStack&&typeof Q.stack==="string")$.stack=Q.stack;if(!X?.excludeCause&&Q.cause!==void 0)$.cause=Y(Q.cause);return $},iz=(Q)=>{let X=new WeakSet,Y=($)=>{if(mK($)){if(X.has($))return"[Circular]";X.add($);let J=ek($,Q,Y);return X.delete($),J}return tk($)};return Y},nz=(Q)=>sk(Q)?rz(Q):Q,az=(Q)=>h0({decode:rz,encode:(X)=>iz(Q)(X)}),sz=(Q)=>h0({decode:nz,encode:iz(Q)});function tz(){return h0({decode:UV,encode:R$})}function ez(){return h0({decode:DV,encode:e6})}function QO(Q){return h0({decode:qV,encode:Q?.onNoneEncoding===null?R$:e6})}function XO(){return F2({decode:R,encode:i9})}function YO(){return F2({decode:(Q)=>Q.pipe(n9(_1),R),encode:i9})}var LG=N8({decode:(Q)=>URL.canParse(Q)?f(new URL(Q)):p(new q0(R(Q),{message:`Invalid URL string: ${Q}`})),encode:(Q)=>f(Q.href)}),MG=N8({decode:(Q)=>{let X=BB(Q);return I0(X)?p(new q0(R(Q),{message:`Invalid BigDecimal string: ${Q}`})):f(X.value)},encode:(Q)=>f(W4(Q))}),wG=new z0(Tz(),OG()),$O=new z0(Iz(),OG()),JO=new z0(Sz(),B2()),ZO=new z0(xz(),z2()),GO=new z0(kz(),bz()),WO=new z0(Cz(),jz()),HO=new z0(yz(),gz()),KO=new z0(hz(),mz()),VO=h0({decode:(Q)=>KX(Q),encode:(Q)=>Q.offset}),PG=N8({decode:(Q)=>{return T8(EB(Q),{onNone:()=>p(new q0(R(Q),{message:`Invalid IANA time zone: ${Q}`})),onSome:f})},encode:(Q)=>f(Q.id)}),AG=N8({decode:(Q)=>{return T8(SB(Q),{onNone:()=>p(new q0(R(Q),{message:`Invalid time zone: ${Q}`})),onSome:f})},encode:(Q)=>f(z6(Q))}),CG=N8({decode:(Q)=>{return T8(oY(Q),{onNone:()=>p(new q0(R(Q),{message:`Invalid UTC DateTime string: ${Q}`})),onSome:(X)=>f(rY(X))})},encode:(Q)=>f(xB(Q))}),jG=N8({decode:(Q)=>{return T8(IB(Q),{onNone:()=>p(new q0(R(Q),{message:`Invalid Zoned DateTime string: ${Q}`})),onSome:f})},encode:(Q)=>f(nY(Q))});function L9(Q){return(X)=>X._tag===Q}var M9=L9("Declaration");var Qy=L9("Never");var N2=L9("Literal"),Xy=L9("UniqueSymbol");var CX=L9("Arrays"),xG=L9("Objects"),jX=L9("Union");class m0{to;transformation;constructor(Q,X){this.to=Q,this.transformation=X}}var w9={};class y8{isOptional;isMutable;defaultValue;annotations;constructor(Q,X,Y=void 0,$=void 0){this.isOptional=Q,this.isMutable=X,this.defaultValue=Y,this.annotations=$}}var qO="~effect/Schema";class l0{[qO]=qO;annotations;checks;encoding;context;constructor(Q=void 0,X=void 0,Y=void 0,$=void 0){this.annotations=Q,this.checks=X,this.encoding=Y,this.context=$}toString(){return`<${this._tag}>`}}class P9 extends l0{_tag="Declaration";typeParameters;run;encodingChecks;constructor(Q,X,Y,$,J,Z,G){super(Y,$,J,Z);this.typeParameters=Q,this.run=X,this.encodingChecks=G}getParser(){let Q=this.run(this.typeParameters);return(X,Y)=>{if(I0(X))return v8;return B9(Q(X.value,this,Y),R)}}_rebuild(Q,X,Y){let $=j5(this.typeParameters,Q);return $===this.typeParameters&&X===this.checks&&Y===this.encodingChecks?this:new P9($,this.run,this.annotations,X,void 0,this.context,Y)}recur(Q){return this._rebuild(Q,this.checks,this.encodingChecks)}flip(Q){return this._rebuild(Q,this.encodingChecks,this.checks)}getExpected(){let Q=this.annotations?.expected;if(typeof Q==="string")return Q;return"<Declaration>"}}class RO extends l0{_tag="Null";getParser(){return k2(this,null)}getExpected(){return"null"}}var bG=new RO;class NO extends l0{_tag="Undefined";getParser(){return k2(this,void 0)}toCodecJson(){return L0(this,[LO])}getExpected(){return"undefined"}}var LO=new m0(bG,new z0(Y0(()=>{return}),Y0(()=>null))),MO=new NO;class wO extends l0{_tag="Void";getParser(){return Uy(void 0)}toCodecJson(){return L0(this,[LO])}getExpected(){return"void"}}var PO=new wO;class AO extends l0{_tag="Never";getParser(){return m8(this,hK)}getExpected(){return"never"}}var CO=new AO;class jO extends l0{_tag="Any";getParser(){return m8(this,s3)}getExpected(){return"any"}}var TO=new jO;class IO extends l0{_tag="Unknown";getParser(){return m8(this,s3)}getExpected(){return"unknown"}}var N9=new IO;class EO extends l0{_tag="ObjectKeyword";getParser(){return m8(this,t3)}getExpected(){return"object | array | function"}}var SO=new EO;class kG extends l0{_tag="Enum";enums;constructor(Q,X,Y,$,J){super(X,Y,$,J);this.enums=Q}getParser(){let Q=new Set(this.enums.map(([,X])=>X));return m8(this,(X)=>Q.has(X))}toCodecStringTree(){if(this.enums.some(([Q,X])=>typeof X==="number")){let Q=Object.fromEntries(this.enums.map(([X,Y])=>[globalThis.String(Y),Y]));return L0(this,[new m0(new u1(Object.keys(Q).map((X)=>new $8(X)),"anyOf"),new z0(Y0((X)=>Q[X]),R9()))])}return this}getExpected(){return this.enums.map(([Q,X])=>JSON.stringify(X)).join(" | ")}}function vO(Q){switch(Q._tag){case"String":case"Number":case"BigInt":return!0;case"Literal":case"TemplateLiteral":return Q.checks===void 0;case"Union":return Q.checks===void 0&&Q.types.every(vO);default:return!1}}class yG extends l0{_tag="TemplateLiteral";parts;encodedParts;constructor(Q,X,Y,$,J){super(X,Y,$,J);let Z=[];for(let G of Q){let W=O1(G);if(vO(W))Z.push(W);else throw Error(`Invalid TemplateLiteral part ${W._tag}`)}this.parts=Q,this.encodedParts=Z}getParser(Q){let X=Q(this.asTemplateLiteralParser());return(Y,$)=>K1(X(Y,$),{onSuccess:()=>Y,onFailure:(J)=>new N0(this,Y,[J])})}getExpected(){return"string"}matchPart(Q,X){return FO(this.encodedParts,Q,X)===void 0?void 0:Q}asTemplateLiteralParser(){let Q=new g8(!1,this.parts.map(XF),[]);return b2(L6,Q,new z0(c1((X,Y)=>{let $=FO(this.encodedParts,X,Y);if($!==void 0)return f($);return p(new q0(R(X),{message:`Expected a string matching template literal parts, got ${P(X)}`}))}),Y0((X)=>X.join(""))))}}class gG extends l0{_tag="UniqueSymbol";symbol;constructor(Q,X,Y,$,J){super(X,Y,$,J);this.symbol=Q}getParser(){return k2(this,this.symbol)}toCodecStringTree(){return L0(this,[JF])}getExpected(){return globalThis.String(this.symbol)}}class $8 extends l0{_tag="Literal";literal;constructor(Q,X,Y,$,J){super(X,Y,$,J);if(typeof Q==="number"&&!globalThis.Number.isFinite(Q))throw Error(`A numeric literal must be finite, got ${P(Q)}`);this.literal=Q}getParser(){return k2(this,this.literal)}matchPart(Q,X){return Q===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==="bigint"?DO(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:DO(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function DO(Q){let X=globalThis.String(Q.literal);return L0(Q,[new m0(new $8(X),new z0(Y0(()=>Q.literal),Y0(()=>X)))])}class xO extends l0{_tag="String";getParser(){return m8(this,C8)}matchPart(Q,X){return y2(this,Q,X)}getExpected(){return"string"}}var L6=new xO;class bO extends l0{_tag="Number";getParser(){return m8(this,ZQ)}matchKey(Q,X){return this._match(By,Q,X)}matchPart(Q,X){return this._match(EG,Q,X)}_match(Q,X,Y){return Q.test(X)?y2(this,globalThis.Number(X),Y):void 0}toCodecJson(){if(this.checks&&(TG(this.checks,"effect/schema/isFinite")||TG(this.checks,"effect/schema/isInt")))return this;return L0(this,[Yy(this.checks)])}toCodecStringTree(){if(this.toCodecJson()===this)return L0(this,[zy]);return L0(this,[Oy])}getExpected(){return"number"}}function TG(Q,X){return Q.some((Y)=>Y.annotations?.representation?.id===X||Y._tag==="FilterGroup"&&TG(Y.checks,X))}function Yy(Q){let X=Q===void 0?M2:h8(M2,Q);return new m0(new u1([X,uO],"anyOf"),new z0(U2(),Y0((Y)=>globalThis.Number.isFinite(Y)?Y:globalThis.String(Y))))}var hG=new bO;class kO extends l0{_tag="Boolean";getParser(){return m8(this,kK)}getExpected(){return"boolean"}}var yO=new kO;class gO extends l0{_tag="Symbol";getParser(){return m8(this,a3)}matchKey(Q,X){return y2(this,Q,X)}toCodecStringTree(){return L0(this,[JF])}getExpected(){return"symbol"}}var hO=new gO;class mO extends l0{_tag="BigInt";getParser(){return m8(this,yK)}matchPart(Q,X){return SG.test(Q)?y2(this,globalThis.BigInt(Q),X):void 0}toCodecStringTree(){return L0(this,[Ry])}getExpected(){return"bigint"}}var dO=new mO;class g8 extends l0{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor(Q,X,Y,$,J,Z,G,W){super($,J,Z,G);this.isMutable=Q,this.elements=X,this.rest=Y,this.encodingChecks=W;let H=X.findIndex(f0);if(H!==-1&&(X.slice(H+1).some((K)=>!f0(K))||Y.length>1))throw Error("A required element cannot follow an optional element. ts(1257)");if(Y.length>1&&Y.slice(1).some(f0))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(Q){let X=this,Y=X.elements.map((K)=>({ast:K,parser:Q(K)})),$=X.rest.map((K)=>({ast:K,parser:Q(K)})),J=Y.length,[Z,...G]=$,W=G.length;function H(K,V){if(V<J)return Y[V];else if(V>=K)return G[V-K];return Z}return GX(function*(K,V){if(K._tag==="None")return K;let _=K.value;if(!Array.isArray(_))return yield*p(new u0(X,K));let q=_.length,D={ast:X,getParser:H,oinput:K,len:q,tailThreshold:Jy(q,J,W),output:new globalThis.Array(q),issues:void 0,options:V},B=mG(V?.concurrency),F=$y(D,_,{concurrency:B?.concurrency,end:X.rest.length===0?J:Math.max(q,J+W)});if(F)yield*F;if(X.rest.length===0&&q>J)for(let N=J;N<=q-1;N++){let M=new S0([N],new V2(X,_[N]));if(V.errors==="all")if(D.issues)D.issues.push(M);else D.issues=[M];else return yield*p(new N0(X,K,[M]))}if(D.issues)return yield*p(new N0(X,K,D.issues));return R(D.output)})}_rebuild(Q,X,Y){let $=j5(this.elements,Q),J=j5(this.rest,Q);return $===this.elements&&J===this.rest&&X===this.checks&&Y===this.encodingChecks?this:new g8(this.isMutable,$,J,this.annotations,X,void 0,this.context,Y)}recur(Q){return this._rebuild(Q,this.checks,this.encodingChecks)}flip(Q){return this._rebuild(Q,this.encodingChecks,this.checks)}getExpected(){return"array"}}var $y=mQ()({onItem(Q,X,Y){let $=Y<Q.len?R(X):d();return Q.getParser(Q.tailThreshold,Y).parser($,Q.options)},step(Q,X,Y,$){if(Y._tag==="Failure")return L2(Q,Q.ast,$,Y);else if(Y.value._tag==="Some")Q.output[$]=Y.value.value;else{let J=Q.getParser(Q.tailThreshold,$);if(f0(J.ast))return;let Z=new S0([$],new LX(J.ast.context?.annotations));if(Q.options.errors==="all")if(Q.issues)Q.issues.push(Z);else Q.issues=[Z];else return q5(new N0(Q.ast,Q.oinput,[Z]))}}});function Jy(Q,X,Y){return Math.max(X,Q-Y)}var mG=(Q)=>{return Q=Q==="unbounded"?1/0:Q??1,Q>1?{concurrency:Q}:void 0},L2=(Q,X,Y,$)=>{if($.cause.reasons.length===0)return $;let J=q2($.cause);if(J===void 0)return v4(Z4($.cause,(G)=>new N0(X,Q.oinput,[new S0([Y],G)])));let Z=new S0([Y],J);if(Q.options.errors==="all")if(Q.issues)Q.issues.push(Z);else Q.issues=[Z];else return q5(new N0(X,Q.oinput,[Z]))},w2="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";function I5(Q,X,Y=w9){let $,J;function Z(G){switch(G._tag){case"String":case"TemplateLiteral":return($??=Object.keys(Q)).filter((W)=>G.matchPart(W,Y)!==void 0);case"Number":return($??=Object.keys(Q)).filter((W)=>G.matchKey(W,Y)!==void 0);case"Symbol":return(J??=Object.getOwnPropertySymbols(Q)).filter((W)=>G.matchKey(W,Y)!==void 0);case"Union":return[...new Set(G.types.flatMap(Z))];default:return[]}}return Z(oG(O1(X)))}class P2{name;type;constructor(Q,X){this.name=Q,this.type=X}}class A2{decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new A2(this.encode,this.decode)}}function IG(Q){switch(Q._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return Q.types.every(IG);default:return!1}}function Zy(Q){return IG(Q)&&IG(O1(Q))}class C2{parameter;type;merge;constructor(Q,X,Y){if(!Zy(Q))throw Error(`Invalid index signature parameter ${Q._tag}`);if(this.parameter=Q,this.type=X,this.merge=Y,f0(X)&&!eO(X))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class E5 extends l0{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor(Q,X,Y,$,J,Z,G){super(Y,$,J,Z);this.propertySignatures=Q,this.indexSignatures=X,this.encodingChecks=G;let W=Q.map((H)=>H.name).filter((H,K,V)=>V.indexOf(H)!==K);if(W.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(W)}. ts(2300)`)}getParser(Q){let X=this,Y=[],$=new Set,J=[];for(let W of X.propertySignatures)Y.push(W.name),$.add(W.name),J.push({ps:W,parser:Q(W.type),name:W.name,type:W.type});let Z=X.indexSignatures.length;if(X.propertySignatures.length===0&&X.indexSignatures.length===0)return m8(X,R7);let G=Z>0?mQ()({onItem:GX(function*(W,[H,K]){let _=Q(oG(K.parameter))(R(H),W.options),q=w1(_)?_:yield*ZX(_);if(q._tag==="Failure"){let M=L2(W,X,H,q);if(M)yield*M;return}let D=R(W.input[H]),F=Q(K.type)(D,W.options),N=w1(F)?F:yield*ZX(F);if(N._tag==="Failure"){let M=L2(W,X,H,N);if(M)yield*M;return}else if(q.value._tag==="Some"&&N.value._tag==="Some"){let M=q.value.value;if($.has(H)||$.has(M))return;let w=N.value.value;if(K.merge&&K.merge.decode&&Object.hasOwn(W.out,M)){let[A,s]=K.merge.decode.combine([M,W.out[M]],[M,w]);b(W.out,A,s)}else b(W.out,M,w)}}),step:(W,H,K)=>K._tag==="Failure"?K:void 0}):void 0;return GX(function*(W,H){if(W._tag==="None")return W;let K=W.value;if(!(typeof K==="object"&&K!==null&&!Array.isArray(K)))return yield*p(new u0(X,W));let V={},_={ast:X,oinput:W,input:K,out:V,issues:void 0,options:H},q=H.errors==="all",D=H.onExcessProperty==="error",B=H.onExcessProperty==="preserve",F;if(X.indexSignatures.length===0&&(D||B)){F=Reflect.ownKeys(K);for(let w=0;w<F.length;w++){let A=F[w];if(!$.has(A))if(D){let s=new S0([A],new V2(X,K[A]));if(q){if(_.issues)_.issues.push(s);else _.issues=[s];continue}else return yield*p(new N0(X,W,[s]))}else b(V,A,K[A])}}let N=mG(H?.concurrency),M=Gy(_,J,N);if(M)yield*M;if(G){let w=u7();for(let s=0;s<Z;s++){let L=X.indexSignatures[s],x=I5(K,L.parameter,H);for(let I=0;I<x.length;I++){let W0=x[I];w.push([W0,L])}}let A=G(_,w,N);if(A)yield*A}if(_.issues)return yield*p(new N0(X,W,_.issues));if(H.propertyOrder==="original"){let w=(F??Reflect.ownKeys(K)).concat(Y),A={};for(let s of w)if(Object.hasOwn(V,s))b(A,s,V[s]);return R(A)}return R(V)})}_rebuild(Q,X,Y,$,J){let Z=j5(this.propertySignatures,(W)=>{let H=Q(W.type);return H===W.type?W:new P2(W.name,H)}),G=j5(this.indexSignatures,(W)=>{let H=X(W.parameter),K=Q(W.type),V=Y?W.merge?.flip():W.merge;return H===W.parameter&&K===W.type&&V===W.merge?W:new C2(H,K,V)});return Z===this.propertySignatures&&G===this.indexSignatures&&$===this.checks&&J===this.encodingChecks?this:new E5(Z,G,this.annotations,$,void 0,this.context,J)}flip(Q){return this._rebuild(Q,Q,!0,this.encodingChecks,this.checks)}recur(Q,X=Q){return this._rebuild(Q,X,!1,this.checks,this.encodingChecks)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}}var Gy=mQ()({onItem(Q,X){let Y=Object.hasOwn(Q.input,X.name)?R(Q.input[X.name]):d();return X.parser(Y,Q.options)},step(Q,X,Y){if(Y._tag==="Failure")return L2(Q,Q.ast,X.name,Y);else if(Y.value._tag==="Some")b(Q.out,X.name,Y.value.value);else if(!f0(X.type)){let $=new S0([X.name],new LX(X.type.context?.annotations));if(Q.options.errors==="all"){if(Q.issues)Q.issues.push($);else Q.issues=[$];return}else return q5(new N0(Q.ast,Q.oinput,[$]))}}});function dG(Q,X){if(!Q)return X;if(!X)return Q;return[...Q,...X]}function j2(Q,X,Y){return new E5(Reflect.ownKeys(Q).map(($)=>{return new P2($,Q[$].ast)}),[],Y,X)}function TX(Q){return Q.ast}function pG(Q,X=void 0){return new g8(!1,Q.map((Y)=>Y.ast),[],void 0,X)}function T2(Q,X,Y){return new u1(Q.map(TX),X,void 0,Y)}function pO(Q,X){if(Q.encoding||X.some((Z)=>Z.encoding))throw Error("StructWithRest does not support encodings");let{propertySignatures:Y,indexSignatures:$,checks:J}=Q;for(let Z of X)Y=Y.concat(Z.propertySignatures),$=$.concat(Z.indexSignatures),J=dG(J,Z.checks);return new E5(Y,$,void 0,J)}function fO(Q,X){if(Q.encoding)throw Error("TupleWithRest does not support encodings");return new g8(Q.isMutable,Q.elements,X,void 0,Q.checks)}function cO(Q){switch(Q._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 Q.propertySignatures.length||Q.indexSignatures.length?["object"]:["string","number","boolean","symbol","bigint","object","array","function"];case"Enum":return Array.from(new Set(Q.enums.map(([,X])=>typeof X)));case"Literal":return[typeof Q.literal];case"Union":return Array.from(new Set(Q.types.flatMap(cO)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function IX(Q){switch(Q._tag){default:return[];case"Declaration":{let X=Q.annotations?.[OX];return Array.isArray(X)?X:[]}case"Objects":return Q.propertySignatures.flatMap((X)=>{let Y=X.type;if(!f0(Y)){if(N2(Y))return[{key:X.name,literal:Y.literal}];if(Xy(Y))return[{key:X.name,literal:Y.symbol}]}return[]});case"Arrays":return Q.elements.flatMap((X,Y)=>{return N2(X)&&!f0(X)?[{key:Y,literal:X.literal}]:[]});case"Suspend":return IX(Q.thunk())}}var UO=new WeakMap;function Wy(Q){let X=UO.get(Q);if(X)return X;X={};for(let Y=0;Y<Q.length;Y++){let $=Q[Y],J=O1($);if(Qy(J))continue;let Z=cO(J),G=IX(J);X.byType??={};for(let W of Z)(X.byType[W]??=[]).push(Y);if(G.length>0){X.bySentinel??=new Map;for(let{key:W,literal:H}of G){let K=X.bySentinel.get(W);if(!K)X.bySentinel.set(W,K=new Map);let V=K.get(H);if(!V)K.set(H,V=[]);V.push(Y)}}else{X.otherwise??={};for(let W of Z)(X.otherwise[W]??=[]).push(Y)}}return UO.set(Q,X),X}function BO(Q){return(X)=>{let Y=O1(X);return Y._tag==="Literal"?Y.literal===Q:Y._tag==="UniqueSymbol"?Y.symbol===Q:!0}}function EX(Q,X){let Y=Wy(X),$=Q===null?"null":Array.isArray(Q)?"array":typeof Q;if(Y.bySentinel){let J=Y.otherwise?.[$]??[];if($==="object"||$==="array"){let Z=new Set(J);for(let[G,W]of Y.bySentinel)if(Object.hasOwn(Q,G)){let H=W.get(Q[G]);if(H)for(let K of H)Z.add(K)}return Array.from(Z).sort((G,W)=>G-W).map((G)=>X[G]).filter(BO(Q))}return J.map((Z)=>X[Z])}return(Y.byType?.[$]??[]).map((J)=>X[J]).filter(BO(Q))}class u1 extends l0{_tag="Union";types;mode;encodingChecks;constructor(Q,X,Y,$,J,Z,G){super(Y,$,J,Z);this.types=Q,this.mode=X,this.encodingChecks=G}getParser(Q){let X=this;return(Y,$)=>{if(Y._tag==="None")return f(Y);let J=Y.value,Z=EX(J,X.types),G={ast:X,recur:Q,oinput:Y,input:J,out:void 0,successes:[],issues:void 0,options:$},W=mG($?.concurrency),H=Hy(G,Z,W?{...W,orderedStep:!0}:void 0);if(!H)return G.out?f(G.out):p(new _2(X,J,G.issues??[]));return JX(H,(K)=>{return G.out?f(G.out):p(new _2(X,J,G.issues??[]))})}}_rebuild(Q,X,Y){let $=j5(this.types,Q);return $===this.types&&X===this.checks&&Y===this.encodingChecks?this:new u1($,this.mode,this.annotations,X,void 0,this.context,Y)}recur(Q){return this._rebuild(Q,this.checks,this.encodingChecks)}flip(Q){return this._rebuild(Q,this.encodingChecks,this.checks)}matchPart(Q,X){for(let Y of this.types){let $=Y.matchPart(Q,X);if($!==void 0)return $}return}getExpected(Q){let X=this.annotations?.expected;if(typeof X==="string")return X;if(this.types.length===0)return"never";let Y=this.types.map(($)=>{let J=O1($);switch(J._tag){case"Arrays":{let Z=J.elements.filter(N2);if(Z.length>0)return`${zO(J.isMutable)}[ ${Z.map((G)=>Q(G)+OO(G.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let Z=J.propertySignatures.filter((G)=>N2(G.type));if(Z.length>0)return`{ ${Z.map((G)=>`${zO(G.type.context?.isMutable)}${O4(G.name)}${OO(G.type.context?.isOptional)}: ${Q(G.type)}`).join(", ")}, ... }`;break}}return Q(J)});return Array.from(new Set(Y)).join(" | ")}}var Hy=mQ()({onItem(Q,X){return Q.recur(X)(Q.oinput,Q.options)},step(Q,X,Y){if(Y._tag==="Failure"){let $=q2(Y.cause);if($===void 0)return Y;if(Q.issues)Q.issues.push($);else Q.issues=[$]}else{if(Q.out&&Q.ast.mode==="oneOf")return Q.successes.push(X),q5(new qG(Q.ast,Q.input,Q.successes));if(Q.out=Y.value,Q.successes.push(X),Q.ast.mode==="anyOf")return aJ}}}),uO=new u1([new $8("Infinity"),new $8("-Infinity"),new $8("NaN")],"anyOf");function zO(Q){return Q?"":"readonly "}function OO(Q){return Q?"?":""}function A9(Q){let X=!1,Y;return()=>{if(X)return Y;return Y=Q(),X=!0,Y}}class I2 extends l0{_tag="Suspend";thunk;constructor(Q,X,Y,$,J){if(Y!==void 0)throw Error("Cannot add checks to Suspend");super(X,void 0,$,J);this.thunk=A9(Q)}getParser(Q){return Q(this.thunk())}recur(Q){return new I2(()=>Q(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(Q){return Q(this.thunk())}}class AX extends f6{_tag="Filter";run;annotations;aborted;constructor(Q,X=void 0,Y=!1){super();this.run=Q,this.annotations=X,this.aborted=Y}annotate(Q){return new AX(this.run,{...this.annotations,...Q},this.aborted)}abort(){return new AX(this.run,this.annotations,!0)}and(Q,X){return new N6([this,Q],X)}}class N6 extends f6{_tag="FilterGroup";checks;annotations;constructor(Q,X=void 0){super();this.checks=Q,this.annotations=X}annotate(Q){return new N6(this.checks,{...this.annotations,...Q})}and(Q,X){return new N6([this,Q],X)}}function E2(Q,X,Y=!1){return new AX(($,J,Z)=>zz($,J,Q($,J,Z)),X,Y)}function S2(Q,X){return new AX((Y)=>Q(Y)?void 0:new q0(R(Y)),X,!0)}function fG(Q){return E2((X)=>globalThis.Number.isFinite(X),{expected:"a finite number",representation:{id:"effect/schema/isFinite",payload:null},toJsonSchema:()=>({type:"number"}),toCode:()=>({runtime:"Schema.isFinite()"}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...Q})}var M2=h8(hG,[fG()]);function SX(Q,X){let Y=Q.source;return E2(($)=>Q.test($),{expected:`a string matching the RegExp ${Y}`,representation:{id:"effect/schema/isPattern",payload:{source:Y,flags:Q.flags}},toJsonSchema:()=>({pattern:Y}),arbitrary:{constraint:{patterns:[Q.source]}},...X})}function vX(Q,X){let Y=Object.getOwnPropertyDescriptors(Q);return X(Y),Object.create(Object.getPrototypeOf(Q),Y)}function L0(Q,X){if(Q.encoding===X)return Q;return vX(Q,(Y)=>{Y.encoding.value=X})}function xX(Q,X){if(Q.context===X)return Q;return vX(Q,(Y)=>{Y.context.value=X})}function M6(Q){return Q.encoding?M6(Q.encoding[Q.encoding.length-1].to):Q}function V4(Q,X){if(Q.checks){let Y=Q.checks[Q.checks.length-1];return v2(Q,c7(Q.checks.slice(0,-1),Y.annotate(X)))}return vX(Q,(Y)=>{Y.annotations.value={...Y.annotations.value,...X}})}function v2(Q,X){if(Q._tag==="Suspend"&&X!==void 0)throw Error("Cannot add checks to Suspend");if(Q.checks===X)return Q;return vX(Q,(Y)=>{Y.checks.value=X})}function h8(Q,X){return v2(Q,dG(Q.checks,X))}function w6(Q,X){let Y=X(Q.to);return Y===Q.to?Q:new m0(Y,Q.transformation)}function lO(Q,X){let Y=Q,$=Y[Y.length-1],J=w6($,X);return J===$?Q:c7(Q.slice(0,Q.length-1),J)}function cG(Q){return(X)=>X.encoding?L0(X,lO(X.encoding,Q)):X}function x2(Q,X){return cG((Y)=>xX(Y,X))(Q)}function P6(Q){function X(Y){return Y.encoding?L0(Y,lO(Y.encoding,X)):Q(Y)}return s0(X)}function oO(Q,X){return uG(Q,X,z1(Q))}function rO(Q,X){return uG(O1(Q),X,Q)}function uG(Q,X,Y){let $=new m0(Q,X);return L0(Y,Y.encoding?[...Y.encoding,$]:[$])}function iO(Q,X){let Y=Hz(Q),$=Y?[...Y,X]:[X];return V4(Q,{brands:$})}function j5(Q,X){let Y=!1,$=Array(Q.length);for(let J=0;J<Q.length;J++){let Z=Q[J],G=X(Z);if(G!==Z)Y=!0;$[J]=G}return Y?$:Q}function bX(Q,X){let Y=Q.context?new y8(Q.context.isOptional,Q.context.isMutable,Q.context.defaultValue,{...Q.context.annotations,...X}):new y8(!1,!1,void 0,X);return xX(Q,Y)}var Ky=cG(kX);function kX(Q){let X=Q.context?Q.context.isOptional===!1?new y8(!0,Q.context.isMutable,Q.context.defaultValue,Q.context.annotations):Q.context:new y8(!0,!1);return Ky(xX(Q,X))}var Vy=cG(lG);function lG(Q){let X=Q.context?Q.context.isMutable===!1?new y8(Q.context.isOptional,!0,Q.context.defaultValue,Q.context.annotations):Q.context:new y8(!1,!0);return Vy(xX(Q,X))}function nO(Q,X){let Y=new z0(MX(X),b8()),$=[new m0(N9,Y)],J=Q.context?new y8(Q.context.isOptional,Q.context.isMutable,$,Q.context.annotations):new y8(!1,!1,$);return xX(Q,J)}function b2(Q,X,Y){return uG(Q,Y,X)}function _y(Q){let X=[],Y=[];function $(J){switch(J._tag){case"Literal":if(F7(J.literal))X.push(J.literal);return;case"UniqueSymbol":X.push(J.symbol);return;case"Never":return;case"Union":for(let Z=0;Z<J.types.length;Z++)$(J.types[Z]);return;default:Y.push(J)}}return $(Q),{literals:X,parameters:Y}}function aO(Q,X,Y){let{literals:$,parameters:J}=_y(Q);return new E5($.map((Z)=>new P2(Z,X)),J.map((Z)=>new C2(Z,X,Y)))}function f0(Q){return Q.context?.isOptional??!1}function sO(Q){return Q.context?.isMutable??!1}function tO(Q){return Q.annotations?.[f1]===!0||Q._tag==="FilterGroup"&&Q.checks.every(tO)}function qy(Q){function X($){if(tO($))return[$];return $._tag==="FilterGroup"?$.checks.flatMap(X):[]}let Y=Q.flatMap(X);return e8(Y)?Y:void 0}var z1=s0((Q)=>{if(Q.encoding)return z1(L0(Q,void 0));let X=Q,Y=X.recur?.(z1)??X,$=Y.encodingChecks;if($){let J=Y===Q?$:CX(Y)||xG(Y)||M9(Y)&&Y.typeParameters.length>0?qy($):void 0;return vX(Y,(Z)=>{Z.encodingChecks.value=void 0,Z.checks.value=dG(Y.checks,J)})}return Y}),O1=s0((Q)=>{return z1(k8(Q))});function Dy(Q,X){let Y=X,$=Y.length,J=Y[$-1],Z=[new m0(k8(L0(Q,void 0)),Y[0].transformation.flip())];for(let W=1;W<$;W++)Z.unshift(new m0(k8(Y[W-1].to),Y[W].transformation.flip()));let G=k8(J.to);if(G.encoding)return L0(G,[...G.encoding,...Z]);else return L0(G,Z)}var k8=s0((Q)=>{if(Q.encoding)return Dy(Q,Q.encoding);let X=Q;return X.flip?.(k8)??X.recur?.(k8)??X});function eO(Q){switch(Q._tag){case"Undefined":return!0;case"Union":return Q.types.some(eO);default:return!1}}function k2(Q,X){let Y=$X(X);return($)=>{if($._tag==="None")return v8;return $.value===X?Y:p(new u0(Q,$))}}function Uy(Q){let X=$X(Q);return(Y)=>Y._tag==="None"?v8:X}function m8(Q,X){return(Y)=>{if(Y._tag==="None")return v8;return X(Y.value)?f(Y):p(new u0(Q,Y))}}function y2(Q,X,Y){if(Y?.disableChecks||Q.checks===void 0)return X;let $=[];return S5(Q.checks,X,$,Q,Y),$.length===0?X:void 0}function FO(Q,X,Y){let $=Q.map((H)=>H._tag==="Literal"?globalThis.String(H.literal):void 0);if($.some((H)=>H!==void 0&&!X.includes(H)))return;let J=Array(Q.length+1);J[Q.length]=0;for(let H=Q.length-1;H>=0;H--)J[H]=J[H+1]+($[H]?.length??0);if(J[0]>X.length)return;let Z=Array(Q.length),G=Q.map(()=>new Set);function W(H,K){if(H===Q.length)return K===X.length;if(G[H].has(K))return!1;let V=Q[H];if(H===Q.length-1){let _=X.slice(K);if(V.matchPart(_,Y)!==void 0)return Z[H]=_,!0}else if(V._tag==="Literal"){let _=$[H];if(X.startsWith(_,K)&&W(H+1,K+_.length))return Z[H]=_,!0}else{let _=X.length-J[H+1],q=$[H+1],D=q===void 0?_:X.lastIndexOf(q,_);while(D>=K){let B=X.slice(K,D);if(V.matchPart(B,Y)!==void 0&&W(H+1,D))return Z[H]=B,!0;if(D===0)break;D=q===void 0?D-1:X.lastIndexOf(q,D-1)}}return G[H].add(K),!1}return W(0,0)?Z:void 0}var QF=s0((Q)=>{return new u1(Q.enums.map((X)=>new $8(X[1],{title:X[0]})),"anyOf")}),oG=P6((Q)=>{switch(Q._tag){default:return Q;case"Number":return Q.toCodecStringTree();case"Union":return Q.recur(oG)}}),g2=P6((Q)=>{switch(Q._tag){default:return Q;case"Symbol":case"UniqueSymbol":return Q.toCodecStringTree();case"Union":return Q.recur(g2)}}),XF=P6((Q)=>{switch(Q._tag){default:return Q;case"Number":case"Literal":case"BigInt":return Q.toCodecStringTree();case"Union":return Q.recur(XF)}}),YF="[\\s\\S]*?",EG=new globalThis.RegExp(`^${w2}$`),By=new globalThis.RegExp(`^(?:${w2}|Infinity|-Infinity|NaN)$`);function rG(Q){return SX(EG,{expected:"a string representing a finite number",representation:{id:"effect/schema/isStringFinite",payload:null},toJsonSchema:()=>({pattern:EG.source}),...Q})}var $F=h8(L6,[rG()]),zy=new m0($F,C5),Oy=new m0(new u1([$F,uO],"anyOf"),C5),Fy="-?\\d+",SG=new globalThis.RegExp(`^${Fy}$`);function iG(Q){return SX(SG,{expected:"a string representing a bigint",representation:{id:"effect/schema/isStringBigInt",payload:null},toJsonSchema:()=>({pattern:SG.source}),...Q})}var nG=h8(L6,[iG({expected:"a string representing a bigint"})]),Ry=new m0(nG,R2),Ny="Symbol\\((.*)\\)",vG=new globalThis.RegExp(`^${Ny}$`),Ly=h8(L6,[aG()]),JF=new m0(Ly,new z0(Y0((Q)=>globalThis.Symbol.for(vG.exec(Q)[1])),c1((Q)=>{if(globalThis.Symbol.keyFor(Q)!==void 0)return f(globalThis.String(Q));return p(new w5(R(Q),{message:"cannot serialize to string, Symbol is not registered"}))})));function aG(Q){return SX(vG,{expected:"a string representing a symbol",representation:{id:"effect/schema/isStringSymbol",payload:null},toJsonSchema:()=>({pattern:vG.source}),...Q})}function S5(Q,X,Y,$,J){for(let Z=0;Z<Q.length;Z++){let G=Q[Z];if(G._tag==="FilterGroup")S5(G.checks,X,Y,$,J);else{let W=G.run(X,$,J);if(W){if(Y.push(new K2(X,G,W)),G.aborted||J?.errors!=="all")return}}}}function ZF(Q,X){let Y=[];if(S5(Q,X,Y,N9,{errors:"all"}),e8(Y)){let $=new N0(N9,R(X),Y);return i($)}return t(X)}var h2="~effect/Schema/Class";function My(Q){return Q===null||typeof Q==="string"||typeof Q==="boolean"||typeof Q==="number"&&globalThis.Number.isFinite(Q)}function wy(Q){return Q===void 0||typeof Q==="string"}function GF(Q,X){let Y=new WeakMap,$=[];Q:while(!0){if(typeof Q!=="object"||Q===null){if(!X(Q))return!1}else{let J=Q,Z=Y.get(J);if(Z===!1)return!1;if(Z===void 0){let G=Array.isArray(J);if(!G){let W=Object.getPrototypeOf(J);if(W!==null&&W!==Object.prototype&&Object.getPrototypeOf(W)!==null)return!1}Y.set(J,!1),$.push({value:J,keys:G?J.length:Object.keys(J),index:0})}}while($.length>0){let J=$[$.length-1],Z=J.keys;if(typeof Z==="number"){if(J.index<Z){Q=J.value[J.index++];continue Q}}else if(J.index<Z.length){Q=J.value[Z[J.index++]];continue Q}Y.set(J.value,!0),$.pop()}return!0}}function v5(Q){return GF(Q,My)}var T5=new P9([],()=>(Q,X)=>v5(Q)?f(Q):p(new u0(X,R(Q))),{representation:{id:"effect/schema/Json",payload:null},expected:"JSON value",toCodecJson:()=>{return},toCodecStringTree:()=>tG,toArbitrary:()=>(Q)=>Q.jsonValue()}),WF=V4(T5,{representation:{id:"effect/schema/MutableJson",payload:null}}),sG=new m0(T5,A5()),HF=new m0(new u1([new g8(!1,[],[T5]),new E5([],[new C2(L6,T5,void 0)])],"anyOf"),A5());function Py(Q){return GF(Q,wy)}var Ay=new P9([],()=>(Q,X)=>Py(Q)?f(Q):p(new u0(X,R(Q))),{expected:"StringTree",toCodecStringTree:()=>{return}}),tG=new m0(Ay,A5());var yX="~effect/SchemaError/SchemaError";class C6 extends SY("SchemaError"){[yX]=yX;constructor(Q){super({issue:Q})}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}function eG(Q){return C(Q,yX)&&Q[yX]===yX}var gX=s0((Q)=>{switch(Q._tag){case"Declaration":{let X=Q.annotations?.[h2];if(r1(X)){let Y=X(Q.typeParameters);return L0(Q,[w6(Y,gX)])}return Q}case"Objects":case"Arrays":return Q.recur((X)=>{let Y=X.context?.defaultValue;if(Y){let $=gX(X);return L0($,$.encoding?[...$.encoding,...Y]:Y)}return gX(X)});case"Suspend":return Q.recur(gX);default:return Q}});function d2(Q){let X=gX(z1(Q.ast)),Y=b5(X);return($,J)=>{return Y($,J?.disableChecks?J?.parseOptions?{...J.parseOptions,disableChecks:!0}:{disableChecks:!0}:J?.parseOptions)}}function p2(Q){let X=d2(Q);return(Y,$)=>{let J=U6(X(Y,$));if(Y1(J))return R(J.value);return m4(J.cause,"Option adapter can only return none for schema issues"),d()}}function KF(Q){let X=d2(Q);return(Y,$)=>{let J=U6(X(Y,$));if(Y1(J))return J.value;let Z=m4(J.cause,"Constructor adapter can only throw schema issues");throw Error(Z.toString(),{cause:Z})}}function VF(Q){return hX(Q.ast)}function hX(Q){let X=C9(b5(z1(Q)));return(Y)=>{let $=X(Y,w9);if(Y1($))return!0;return m4($.cause,"Type guard adapter can only return false for schema issues"),!1}}function _F(Q){let X=b5(Q);return(Y,$)=>{let J=U6(X(Y,$));if(Y1(J))return;return m4(J.cause,"Issue adapter can only return schema issues")}}function qF(Q,X){let $=C9(b5(z1(Q.ast)))(X,w9);if(sJ($)){let J=m4($.cause,"Assertion adapter can only throw schema issues");throw Error(J.toString(),{cause:J})}}function i0(Q,X){let Y=b5(Q.ast);return X===void 0?Y:($,J)=>Y($,RF(X,J))}var QW=i0;function DF(Q,X){return C9(i0(Q,X))}function XW(Q,X){return NF(i0(Q,X))}var UF=XW;function BF(Q,X){return LF(i0(Q,X))}function Cy(Q,X){return MF(i0(Q,X))}var YW=Cy;function x5(Q,X){let Y=b5(k8(Q.ast));return X===void 0?Y:($,J)=>Y($,RF(X,J))}function zF(Q,X){return C9(x5(Q,X))}function $W(Q,X){return NF(x5(Q,X))}var OF=$W;function FF(Q,X){return LF(x5(Q,X))}function jy(Q,X){return MF(x5(Q,X))}var JW=jy,RF=(Q,X)=>X===void 0?Q:{...Q,...X};function b5(Q){let X=m2(Q);return(Y,$)=>F8(X(R(Y),$??w9),(J)=>{if(J._tag==="None")return p(new q0(J));return f(J.value)})}function C9(Q){return(X,Y)=>U6(Q(X,Y))}function NF(Q){let X=C9(Q);return(Y,$)=>{let J=X(Y,$);if(Y1(J))return R(J.value);return m4(J.cause,"Option adapter can only return none for schema issues"),d()}}function LF(Q){let X=C9(Q);return(Y,$)=>{let J=X(Y,$);if(Y1(J))return t(J.value);return i(m4(J.cause,"Result adapter can only return schema issues"))}}function MF(Q){let X=C9(Q);return(Y,$)=>{let J=X(Y,$);if(Y1(J))return J.value;let Z=m4(J.cause,"Sync adapter can only throw schema issues");throw Error(Z.toString(),{cause:Z})}}function Ty(Q,X){return U9(Q,(Y)=>D9(()=>Z4(Y,X)))}var m2=s0((Q)=>{let X,Y=Q.checks,$=Q.encoding,J=$,Z=J?.length??0,G=Q.encodingChecks,W=(Y?Y[Y.length-1].annotations:Q.annotations)?.parseOptions;if(!Q.context&&!$&&!Y&&!G)return(H,K)=>{if(X??=Q.getParser(m2),W)K={...K,...W};return X(H,K)};return(H,K)=>{if(W)K={...K,...W};let V;if(J){for(let D=Z-1;D>=0;D--){let B=J[D],F=B.to,N=m2(F);if(V=V?F8(V,(M)=>N(M,K)):N(H,K),B.transformation._tag==="Transformation"){let M=B.transformation.decode;V=F8(V,(w)=>M.run(w,K))}else V=B.transformation.decode(V,K)}V=Ty(V,(D)=>new _G(Q,H,D))}X??=Q.getParser(m2);let _=(D)=>{let B=X(D,K);if(G&&!K?.disableChecks)B=F8(B,(F)=>{if(L1(D)&&L1(F)){let N=[];if(S5(G,D.value,N,Q,K),e8(N))return p(new N0(Q,D,N))}return f(F)});if(Y&&!K?.disableChecks)B=F8(B,(F)=>{if(L1(F)){let N=F.value,M=[];if(S5(Y,N,M,Q,K),e8(M))return p(new N0(Q,F,M))}return f(F)});return B};return V?F8(V,_):_(H)}});var f2="~effect/Schema/Schema";function l1(Q,X,Y){return{id:Q,payloadSchema:X,revive:Y}}function a(Q,X,Y){return{id:Q,payloadSchema:X,revive:Y}}var Iy={[f2]:f2,pipe(){return H0(this,arguments)},annotate(Q){return this.rebuild(V4(this.ast,Q))},annotateKey(Q){return this.rebuild(bX(this.ast,Q))},check(...Q){return this.rebuild(h8(this.ast,Q))}};function mX(Q,X){function Y(){}let $=Object.defineProperties(Object.setPrototypeOf(Y,Iy),Object.getOwnPropertyDescriptors({...X}));$.ast=Q,$.rebuild=(Z)=>mX(Z,X);let J=d2($);return $.makeEffect=(Z,G)=>c2(J(Z,G)),$.make=KF($),$.makeOption=p2($),$}function c2(Q){return U9(Q,(X)=>D9(()=>Z4(X,(Y)=>new C6(Y))))}var I60=globalThis.Boolean;var wF=w4((Q,X)=>Q||X,!1);var PF=U(2,(Q,X)=>{return WW(Q,(Y,$)=>X.includes(Y)?[Y,$]:void 0)}),AF=U(2,(Q,X)=>{return WW(Q,(Y,$)=>!X.includes(Y)?[Y,$]:void 0)}),CF=U(2,(Q,X)=>{return{...Q,...X}});var GW=U(2,(Q,X)=>{return WW(Q,(Y,$)=>[Object.hasOwn(X,Y)?X[Y]:Y,$])});var P1=(Q)=>Q;function WW(Q,X){let Y={};for(let $ of Reflect.ownKeys(Q)){if(!Object.prototype.propertyIsEnumerable.call(Q,$))continue;let J=X($,Q[$]);if(J){let[Z,G]=J;b(Y,Z,G)}}return Y}function jF(Q,X){let Y=X?.omitKeyWhen??(()=>!1);return tK(($,J)=>{let Z=Reflect.ownKeys(Q),G={};for(let W of Z){let H=Q[W].combine($[W],J[W]);if(Y(H))continue;b(G,W,H)}return G})}function dX(Q){return w4((X,Y)=>{if(X===void 0)return Y;if(Y===void 0)return X;return Q.combine(X,Y)},void 0)}function _4(Q,X){if(X.length>0)Q+=`
29
+ at ${C7(X)}`;return Error(Q)}var TF=new WeakMap,IF=new WeakMap,EF=[];function pF(){return{warnings:[]}}function fF(Q){return{warnings:Q.warnings.slice()}}function p4(Q){return Error(`Unable to derive an arbitrary for ${Q}`)}var SF=([Q],[X])=>o(Q,X);function xy(Q,X,Y){return X.reduce(($,J)=>$.filter((Z)=>J.run(Z,Q,w9)===void 0),Y)}function cF(Q,X){if(Q?.minLength!==void 0&&Q.maxLength!==void 0&&Q.minLength>Q.maxLength)throw p4(`${X} constraints`)}function uF(Q){return Q===void 0||Q.minLength===void 0&&Q.maxLength===void 0?void 0:{...Q.minLength!==void 0?{minLength:Q.minLength}:{},...Q.maxLength!==void 0?{maxLength:Q.maxLength}:{}}}function KW(Q,X,Y,$){return $?Q.uniqueArray(X,{...Y,comparator:$}):Q.array(X,Y)}function vF(Q,X,Y,$=!1){let J=X.constraint,Z=uF(J);return cF(Z,"array"),KW(Q,Y,$?{...Z,maxLength:Z?.minLength??0}:Z,J?.unique?o:void 0)}function u2(Q,X,Y,$){return X.chain((J)=>J.length<Y?Q.constant(J):$.map((Z)=>[...J,...Z]))}function xF(Q,X){return Q.chain((Y)=>X.map(($)=>({...Object.fromEntries($),...Y})))}var by=dX(PU),ky=dX(AU),l2=dX(wF),yy=dX(IV()),gy=jF({integer:l2,maxLength:ky,minLength:by,noInfinity:l2,noNaN:l2,patterns:yy,unique:l2},{omitKeyWhen:gK});function bF(Q,X,Y,$,J,Z){if($===void 0||X===void 0)return $===void 0?[X,Y]:[$,J];let G=Q(X,$);return G===Z?[$,J]:G===0?[X,Y||J]:[X,Y]}function hy(Q,X){if(Q===void 0)return X;if(Q.order!==X.order)throw Error("Cannot merge ordered arbitrary constraints with different Order instances");let[Y,$]=bF(Q.order,Q.minimum,Q.exclusiveMinimum,X.minimum,X.exclusiveMinimum,-1),[J,Z]=bF(Q.order,Q.maximum,Q.exclusiveMaximum,X.maximum,X.exclusiveMaximum,1);return{order:Q.order,...Y!==void 0?{minimum:Y}:{},...$!==void 0?{exclusiveMinimum:$}:{},...J!==void 0?{maximum:J}:{},...Z!==void 0?{exclusiveMaximum:Z}:{}}}function my(Q,X){let{ordered:Y,...$}=Q??{},{ordered:J,...Z}=X,G=J===void 0?Y:hy(Y,J);return{...gy.combine($,Z),...G===void 0?{}:{ordered:G}}}function kF(Q){let X=[],Y=[];function $(J){if(J.annotations?.arbitrary)Y.push(J.annotations.arbitrary);if(J._tag!=="Filter")for(let Z of J.checks)$(Z);else X.push(J)}return Q?.forEach($),{filters:X,arbitraries:Y}}function dy(Q){let X=Q.map(({constraint:Y})=>Y).filter(_1);return(Y)=>{let $=X.reduce((J,Z)=>my(J,Z),Y.constraint);return{...Y,constraint:$}}}function pX(Q){return{...Q,constraint:void 0}}function yF(Q,X,Y){if(X===void 0||X.minLength===void 0&&X.maxLength===void 0)return;if(X.minLength!==void 0&&Q.indexSignatures.length===0&&X.minLength>Q.propertySignatures.length)throw p4("object property constraints");let $={};if(X.minLength!==void 0)$.minLength=Math.max(0,X.minLength-Y);if(X.maxLength!==void 0){if($.maxLength=X.maxLength-Y,$.maxLength<0)throw p4("object property constraints")}return cF($,"object property"),$}function py(Q,X,Y,$,J,Z){let G=$.length;if(Z.maxLength!==void 0&&Z.maxLength<G)throw p4("object property constraints");let W=Z.minLength===void 0?0:Math.max(0,Z.minLength-G),H=Z.maxLength===void 0?J.length:Math.min(J.length,Z.maxLength-G);if(W>H)throw p4("object property constraints");let K=Q.record(X,{requiredKeys:[...$,...J]}),V=Q.shuffledSubarray([...J],{minLength:W,maxLength:H});return Q.tuple(K,V).map(([_,q])=>{let D=new Set([...$,...q]),B={};for(let F of Y)if(D.has(F))b(B,F,_[F]);return B})}function lF(Q,X,Y,$){let J={};if(Q?.minimum!==void 0)J.min=X(Q.minimum,Q.exclusiveMinimum===!0);if(Q?.maximum!==void 0)J.max=Y(Q.maximum,Q.exclusiveMaximum===!0);if(J.min!==void 0&&J.max!==void 0&&J.min>J.max)throw p4($);return J}function fy(Q){return lF(Q,(X,Y)=>Y?Math.floor(X)+1:Math.ceil(X),(X,Y)=>Y?Math.ceil(X)-1:Math.floor(X),"integer constraints")}function cy(Q,X){let Y={...Q?.noInfinity?{noDefaultInfinity:!0}:{},...Q?.noNaN?{noNaN:!0}:{},...X?.minimum!==void 0?{min:X.minimum}:{},...X?.exclusiveMinimum!==void 0?{minExcluded:X.exclusiveMinimum}:{},...X?.maximum!==void 0?{max:X.maximum}:{},...X?.exclusiveMaximum!==void 0?{maxExcluded:X.exclusiveMaximum}:{}};if(Y.min!==void 0&&Y.max!==void 0&&(Y.min>Y.max||Y.min===Y.max&&(Y.minExcluded||Y.maxExcluded)))throw p4("number constraints");return Y}function uy(Q){return lF(Q,(X,Y)=>Y?X+BigInt(1):X,(X,Y)=>Y?X-BigInt(1):X,"the ordered bigint constraints")}function k5(Q,X){let Y=($,J,Z=EF)=>Q($,J,Z);return Y.terminal=($,J,Z=EF)=>X($,J,Z),Y}function L8(Q){return k5(Q,Q)}function gF(Q,X){let Y=IF.get(X)??Q.createDepthIdentifier();return IF.set(X,Y),{maxDepth:2,depthIdentifier:Y}}function hF(Q,X){return X.length===0?void 0:X.length===1?X[0]:Q.oneof(...X)}var ly={noInfinity:!0,noNaN:!0};function oy(Q){return{...Q,constraint:ly}}function ry(Q,X,Y){function $(J,Z){let G=J.annotations?.arbitrary,W=Z||G?.constraint!==void 0||G?.candidate!==void 0;if(J._tag!=="Filter")for(let H of J.checks)$(H,W);else if(!W){let H=J.annotations?.representation?.id??J.annotations?.identifier??J.annotations?.expected;Q.warnings.push({_tag:"OpaqueFilter",path:Y,...H===void 0?{}:{description:H}})}}X?.forEach((J)=>$(J,!1))}function oF(Q,X){let Y=new WeakSet;function $(J,Z){if(Y.has(J))return;switch(Y.add(J),ry(X,J.checks,Z),J._tag){case"Declaration":J.typeParameters.forEach((G)=>$(G,Z));break;case"Arrays":{for(let[G,W]of[...J.elements,...J.rest].entries())$(W,[...Z,G]);break}case"Objects":J.propertySignatures.forEach((G)=>$(G.type,[...Z,G.name])),J.indexSignatures.forEach((G)=>{$(G.parameter,Z),$(G.type,Z)});break;case"Union":J.types.forEach((G)=>$(G,Z));break;case"TemplateLiteral":J.parts.forEach((G,W)=>$(O1(G),[...Z,W]));break;case"Suspend":$(J.thunk(),Z);break}Y.delete(J)}$(Q,[])}function iy(Q,X,Y,$){let J=$===void 0?[]:[{arbitrary:$,weight:1}];for(let{candidate:Z}of Y){if(!Z)continue;let G=Z.make(Q,X);if(G===void 0)continue;let W=Z.weight??1;if(!globalThis.Number.isInteger(W)||W<=0)throw p4("a candidate with an invalid weight");J.push({arbitrary:G,weight:W})}return J.length===0?void 0:J.length===1?J[0].arbitrary:Q.oneof(...J)}function mF(Q,X,Y,$,J){let Z=iy(Y,$,X.arbitraries,J);return Z===void 0?void 0:xy(Q,X.filters,Z)}function ny(Q,X){if(!(typeof Q==="object"&&Q!==null&&("arbitrary"in Q)))return{arbitrary:Q,terminal:X?void 0:Q};let Y="terminal"in Q?Q.terminal:X?void 0:Q.arbitrary;return{arbitrary:Q.arbitrary,terminal:Y}}function ay(Q,X,Y,$,J){return Q.map((Z)=>({arbitrary:J?X.constant(null).chain(()=>Z(X,Y,$)):Z(X,Y,$),terminal:Z.terminal(X,Y,$)}))}function dF(Q,X,Y,$){let J=dy(X.arbitraries);return k5((Z,G,W)=>{let H=J(G);return mF(Q,X,Z,H,Y(Z,G,H,W))},(Z,G,W)=>{let H=J(G);return mF(Q,X,Z,H,$(Z,G,H,W))})}var VW=s0((Q)=>M8(Q,[]));function M8(Q,X){let Y=h4(Q)?.toArbitrary;if(Y){let $=M9(Q)?Q.typeParameters.map((G)=>M8(G,X)):[],J=kF(Q.checks),Z=(G)=>(W,H,K,V)=>ny(Y(ay($,W,pX(H),V,G))(W,K),$.length>0)[G?"terminal":"arbitrary"];return dF(Q,J,Z(!1),Z(!0))}if(Q.checks){let $=kF(Q.checks),J=M8(v2(Q,void 0),X);return dF(Q,$,(Z,G,W,H)=>J(Z,W,H),(Z,G,W,H)=>J.terminal(Z,W,H))}return sy(Q,X)}function sy(Q,X){switch(Q._tag){case"Never":case"Declaration":throw _4(`Unsupported AST ${Q._tag}`,X);case"Null":return L8((Y)=>Y.constant(null));case"Void":case"Undefined":return L8((Y)=>Y.constant(void 0));case"Unknown":case"Any":return L8((Y)=>Y.anything());case"String":return L8((Y,$)=>{let J=$.constraint,Z=J?.patterns;return Z?Y.oneof(...Z.map((G)=>Y.stringMatching(new RegExp(G)))):Y.string(uF(J))});case"Number":return L8((Y,$)=>{let J=$.constraint,Z=J?.ordered?.order===D1?J.ordered:void 0;return J?.integer?Y.integer(fy(Z)):Y.float(cy(J,Z))});case"Boolean":return L8((Y)=>Y.boolean());case"BigInt":return L8((Y,$)=>{let J=$.constraint?.ordered?.order===_8?$.constraint.ordered:void 0;return Y.bigInt(uy(J))});case"Symbol":return L8((Y)=>Y.string().map(Symbol.for));case"Literal":return L8((Y)=>Y.constant(Q.literal));case"UniqueSymbol":return L8((Y)=>Y.constant(Q.symbol));case"ObjectKeyword":return L8((Y)=>Y.oneof(Y.object(),Y.array(Y.anything())));case"Enum":return M8(QF(Q),X);case"TemplateLiteral":{let Y=Q.parts.map(($,J)=>M8(O1($),[...X,J]));return L8(($,J,Z)=>$.tuple(...Y.map((G)=>G($,oy(J),Z))).map((G)=>G.map((W)=>globalThis.String(W)).join("")))}case"Arrays":{let Y=Q.elements.map((G,W)=>({ast:G,arbitrary:M8(G,[...X,W])})),$=Q.elements.length,J=Q.rest.map((G,W)=>({ast:G,arbitrary:M8(G,[...X,$+W])})),Z=(G,W,H)=>{let K=pX(W),V=[],_=[],q=0;for(let w of Y){let A=w.arbitrary.terminal(G,K,H);if(f0(w.ast)){_.push(A);continue}if(A===void 0)return;q++,V.push(A.map(R))}let D=W.constraint?.minLength??0,F=Z6(J)&&D>q+_.length?_.length:Math.max(0,D-q),N=0;for(let w of _){if(N>=F||w===void 0){V.push(G.constant(d()));continue}N++,q++,V.push(w.map(R))}if(N<F)return;let M=G.tuple(...V).map(C$);if(Z6(J)){let[w,...A]=J,s=Q.elements.length===0?W:K,L=Math.max(0,D-q-A.length),x=L===0?void 0:w.arbitrary.terminal(G,K,H);if(L>0&&x===void 0)return;let I=L===0?G.constant([]):vF(G,{...s,constraint:{...s.constraint,minLength:L}},x,!0);if(M=u2(G,M,$,I),A.length>0){let W0=[];for(let o1 of A){let F1=o1.arbitrary.terminal(G,K,H);if(F1===void 0)return;W0.push(F1)}let T0=G.tuple(...W0);M=u2(G,M,$,T0)}}return M};return k5((G,W,H)=>{let K=pX(W),V=Y.map(({ast:q,arbitrary:D})=>{let B=D(G,K,H);return f0(q)?B.chain((F)=>G.boolean().map((N)=>N?R(F):d())):B.map(R)}),_=G.tuple(...V).map(C$);if(Z6(J)){let[q,...D]=J.map(({arbitrary:F})=>F(G,K,H)),B=vF(G,Q.elements.length===0?W:K,q);if(_=u2(G,_,$,B),D.length>0){let F=G.tuple(...D);_=u2(G,_,$,F)}}if(W.recursion){let q=Z(G,W,H);if(q!==void 0)return G.oneof(W.recursion,q,_)}return _},Z)}case"Objects":{let Y=Q.propertySignatures.map((Z)=>({ps:Z,arbitrary:M8(Z.type,[...X,Z.name])})),$=Q.indexSignatures.map((Z)=>({is:Z,parameter:M8(Z.parameter,X),type:M8(Z.type,X)}));return k5((Z,G,W)=>{let H=pX(G),K={},V=[],_=[],q=[];for(let{ps:N,arbitrary:M}of Y){let w=N.name;if(V.push(w),f0(N.type))q.push(w);else _.push(w);b(K,w,M(Z,H,W))}let D=G.constraint;if(q.length>0&&$.length===0&&D!==void 0&&(D.minLength!==void 0||D.maxLength!==void 0))return py(Z,K,V,_,q,D);let B=Z.record(K,{requiredKeys:_}),F=yF(Q,G.constraint,_.length);for(let{parameter:N,type:M}of $){let w=Z.tuple(N(Z,H,W),M(Z,H,W)),A=KW(Z,w,F,SF);B=xF(B,A)}return B},(Z,G,W)=>{let H=pX(G),K={},V=[],_=[];for(let{ps:N,arbitrary:M}of Y){let w=N.name,A=M.terminal(Z,H,W);if(f0(N.type)){if(A!==void 0)_.push([w,A]);continue}if(A===void 0)return;V.push(w),b(K,w,A)}let q=Math.max(0,(G.constraint?.minLength??0)-V.length);for(let[N,M]of _){if(q===0)break;q--,V.push(N),b(K,N,M)}if(q>0&&Q.indexSignatures.length===0)return;let D=Z.record(K,{requiredKeys:V}),B=yF(Q,G.constraint,V.length),F=B?.minLength??0;for(let{parameter:N,type:M}of $){let w;if(F===0)w=Z.constant([]);else{let A=N.terminal(Z,H,W),s=M.terminal(Z,H,W);if(A===void 0||s===void 0)return;w=KW(Z,Z.tuple(A,s),{...B,maxLength:F},SF)}D=xF(D,w)}return D})}case"Union":{let Y=Q.types.map((J)=>M8(J,X)),$=(J,Z,G)=>hF(J,Y.map((W)=>W.terminal(J,Z,G)).filter(_1));return k5((J,Z,G)=>{let W=Y.map((K)=>K(J,Z,G));if(Z.recursion){let K=$(J,Z,G);if(K!==void 0)return J.oneof(Z.recursion,K,...W)}let H=hF(J,W);if(H===void 0)throw p4("a union with no members");return H},$)}case"Suspend":{let Y=TF.get(Q);if(Y)return Y;let $=A9(()=>M8(Q.thunk(),X)),J=k5((Z,G,W)=>{let H=gF(Z,Q),K={...G,recursion:H},V=W.includes(Q)?W:[...W,Q],_=$().terminal(Z,K,V);if(_===void 0)throw _4("Unable to derive an arbitrary for a recursive schema without a finite generation path",X);return Z.oneof(H,_,Z.constant(null).chain(()=>$()(Z,K,V)))},(Z,G,W)=>{if(W.includes(Q))return;let H=gF(Z,Q);return $().terminal(Z,{...G,recursion:H},[...W,Q])});return TF.set(Q,J),J}}}var rF=s0((Q)=>{return j6(Q,[])});function j6(Q,X){let Y=h4(Q)?.toEquivalence;if(Y)return Y(M9(Q)?Q.typeParameters.map(($)=>j6($,X)):[]);switch(Q._tag){case"Never":return eK();case"Declaration":case"Null":case"Undefined":case"Void":case"Unknown":case"Any":case"String":case"Number":case"Boolean":case"BigInt":case"Symbol":case"Literal":case"UniqueSymbol":case"ObjectKeyword":case"Enum":case"TemplateLiteral":return o;case"Arrays":{let $=Q.elements.map((G,W)=>j6(G,[...X,W])),J=Q.elements.length,Z=Q.rest.map((G,W)=>j6(G,[...X,J+W]));return H1((G,W)=>{if(!Array.isArray(G)||!Array.isArray(W))return!1;let H=G.length;if(H!==W.length)return!1;let K=0;for(;K<Math.min(H,Q.elements.length);K++)if(!$[K](G[K],W[K]))return!1;if(Z.length>0){let[V,..._]=Z;for(;K<H-_.length;K++)if(!V(G[K],W[K]))return!1;for(let q=0;q<_.length;q++)if(!_[q](G[K+q],W[K+q]))return!1}return!0})}case"Objects":{if(Q.propertySignatures.length===0&&Q.indexSignatures.length===0)return o;let $=Q.propertySignatures.map((Z)=>j6(Z.type,[...X,Z.name])),J=Q.indexSignatures.map((Z)=>j6(Z.type,X));return H1((Z,G)=>{if(!j1(Z)||!j1(G))return!1;for(let W=0;W<$.length;W++){let H=Q.propertySignatures[W],K=H.name,V=Object.hasOwn(Z,K),_=Object.hasOwn(G,K);if(f0(H.type)){if(V!==_)return!1}if(V&&_&&!$[W](Z[K],G[K]))return!1}for(let W=0;W<J.length;W++){let H=Q.indexSignatures[W],K=I5(Z,H.parameter),V=I5(G,H.parameter);if(K.length!==V.length)return!1;for(let _=0;_<K.length;_++){let q=K[_];if(!Object.hasOwn(G,q)||!J[W](Z[q],G[q]))return!1}}return!0})}case"Union":{let $=z1(Q).types,J=new Map($.map((Z,G)=>[Z,[hX(Z),j6(Q.types[G],X)]]));return H1((Z,G)=>{let W=EX(Z,$);for(let H=0;H<W.length;H++){let[K,V]=J.get(W[H]);if(K(Z)&&K(G))return V(Z,G)}return!1})}case"Suspend":{let $=A9(()=>j6(Q.thunk(),X));return H1((J,Z)=>$()(J,Z))}}}function o2(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}function iF(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}var g60=globalThis.RegExp;var y5=(Q)=>Q.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var Qg=new Set([...Kz,zX,...Wz]);function fX(Q,X){if(Q===void 0)return;let Y={},$=Q.title;if(typeof $==="string")Y.title=$;let{description:J,expected:Z}=Q;if(typeof J==="string")Y.description=J;else if(X?.generateDescriptions===!0&&typeof Z==="string")Y.description=Z;let G=Q.default;if(v5(G))Y.default=G;let W=Q.examples;if(Array.isArray(W)&&v5(W))Y.examples=W;let H=Q.readOnly;if(typeof H==="boolean")Y.readOnly=H;let K=Q.writeOnly;if(typeof K==="boolean")Y.writeOnly=K;let V=Q.format;if(typeof V==="string")Y.format=V;let _=Q.contentEncoding;if(typeof _==="string")Y.contentEncoding=_;let q=Q.contentMediaType;if(typeof q==="string")Y.contentMediaType=q;let D=Q.contentSchema;if(v5(D))Y.contentSchema=D;if(X?.includeAnnotationKey!==void 0)for(let[B,F]of Object.entries(Q)){if(Qg.has(B)||!X.includeAnnotationKey(B))continue;if(v5(F))b(Y,B,F)}return Object.keys(Y).length===0?void 0:Y}function aF(Q){let X=Q.type==="number"||Q.type==="integer"?Q.type:void 0,Y=Q;if(X!==void 0)Y={...Q},delete Y.type;if(Array.isArray(Y.allOf)){let $=[],J=!1;for(let Z of Y.allOf){let G=aF(Z);if(G.type!==void 0){if(J=!0,X===void 0||G.type==="integer")X=G.type}if(Object.keys(G.schema).length>0)$.push(G.schema)}if(J){let{allOf:Z,...G}=Y;Y=$.length===0?G:{...G,allOf:$}}}return{type:X,schema:Y}}function Xg(Q){return Array.isArray(Q.anyOf)&&Q.anyOf.length===4&&Q.anyOf[0]?.type==="number"&&Q.anyOf.slice(1).every((X)=>X.type==="string")}function r2(Q,X){if(Object.keys(Q).length===0)return X;let Y=Object.keys(X);if(Y.length===0)return Q;let $=Q.type==="number"||Q.type==="integer"?Q.type:void 0,J=Xg(Q);if($!==void 0||J){let G=aF(X);if(G.type!==void 0){let W=$==="integer"||G.type==="integer"?"integer":"number",H={...Q,type:W};if(J)delete H.anyOf;return Object.keys(G.schema).length===0?H:r2(H,G.schema)}}let Z=Array.isArray(X.allOf)&&Y.length===1?X.allOf:[X];if(Array.isArray(Q.allOf))return{...Q,allOf:[...Q.allOf,...Z]};if(typeof Q.$ref==="string")return{allOf:[Q,...Z]};return{...Q,allOf:Z}}function Yg(Q,X,Y,$){let J={};for(let _ of Object.keys(Y))b(J,_,H(Y[_],["references",_]));return{dialect:"draft-2020-12",schemas:Q4(Q,(_,q)=>H(_,X[q])),definitions:J};function G(_,q){return _?.schemas?.map((D,B)=>H(D,[...q,"schemas",B]))??[]}function W(_,q,D){let B=_.annotations,F=B?.toJsonSchema;if(F!==void 0){let w=G(_.representation,[...D,"representation"]),A=F({type:q,schemas:w}),s=fX(B,$);return s===void 0?A:{...A,...s}}if(_._tag==="Filter")return;let N=_.checks.map((w,A)=>W(w,q,[...D,"checks",A])).filter((w)=>w!==void 0);if(N.length===0)return;let M=fX(B,$);return M===void 0?{allOf:N}:{allOf:N,...M}}function H(_,q){if(_._tag==="Reference"){if(!Object.hasOwn(Y,_.$ref))throw _4(`Invalid reference ${_.$ref}`,[...q,"$ref"]);return{$ref:`#/$defs/${o2(_.$ref)}`}}let D=K(_,q),B=fX(_.annotations,$);if(B!==void 0)D={...D,...B};for(let F=0;F<_.checks.length;F++){let N=typeof D.type==="string"&&$g(D.type)?D.type:void 0,M=W(_.checks[F],N,[...q,"checks",F]);if(M!==void 0)D=r2(D,M)}return D}function K(_,q){switch(_._tag){case"Any":case"Unknown":return{};case"ObjectKeyword":return{anyOf:[{type:"object"},{type:"array"}]};case"Void":case"Undefined":case"Null":return{type:"null"};case"BigInt":return{type:"string",allOf:[{pattern:"^-?\\d+$"}]};case"Symbol":case"UniqueSymbol":return{type:"string",allOf:[{pattern:"^Symbol\\((.*)\\)$"}]};case"Declaration":return{};case"Suspend":return H(_.thunk,[...q,"thunk"]);case"Never":return{not:{}};case"String":return{type:"string"};case"Number":return{anyOf:[{type:"number"},{type:"string",enum:["NaN"]},{type:"string",enum:["Infinity"]},{type:"string",enum:["-Infinity"]}]};case"Boolean":return{type:"boolean"};case"Literal":{let D=_.literal;return typeof D==="bigint"?{type:"string",enum:[globalThis.String(D)]}:{type:typeof D,enum:[D]}}case"Enum":{let D=_.enums.map(([B,F])=>typeof F==="number"&&!globalThis.Number.isFinite(F)?{type:"string",enum:[globalThis.String(F)],title:B}:{type:typeof F,enum:[F],title:B});return D.length===0?{not:{}}:{anyOf:D}}case"TemplateLiteral":return{type:"string",pattern:`^${_.parts.map(i2).join("")}$`};case"Arrays":{if(_.rest.length>1)throw _4("Invalid schema representation document",[...q,"rest"]);let D={type:"array"},B=_.elements.length,F=_.elements.map((N,M)=>{if(N.isOptional)B--;let w=H(N.type,[...q,"elements",M,"type"]),A=fX(N.annotations,$);return A===void 0?w:r2(w,A)});if(F.length>0){if(D.prefixItems=F,D.maxItems=_.elements.length,B>0)D.minItems=B}else D.items=!1;if(_.rest.length===1){delete D.maxItems;let N=H(_.rest[0],[...q,"rest",0]);if(Object.keys(N).length>0)D.items=N;else delete D.items}return D}case"Objects":{if(_.propertySignatures.length===0&&_.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let D={type:"object"},B={},F=[];for(let M=0;M<_.propertySignatures.length;M++){let w=_.propertySignatures[M];if(typeof w.name!=="string")throw _4("Invalid schema representation document",[...q,"propertySignatures",M,"name"]);let A=w.name,s=H(w.type,[...q,"propertySignatures",M,"type"]),L=fX(w.annotations,$);if(b(B,A,L===void 0?s:r2(s,L)),!w.isOptional)F.push(A)}if(_.propertySignatures.length>0)D.properties=B;if(F.length>0)D.required=F;D.additionalProperties=$?.additionalProperties??!1;let N={};for(let M=0;M<_.indexSignatures.length;M++){let w=_.indexSignatures[M],A=H(w.type,[...q,"indexSignatures",M,"type"]);if(Object.keys(A).length===1&&"not"in A)A=!1;let s=V(w.parameter,[...q,"indexSignatures",M,"parameter"],new Set);if(s.length===0)D.additionalProperties=A;else for(let L of s)b(N,L,A)}if(Object.keys(N).length>0)D.patternProperties=N,delete D.additionalProperties;if(typeof D.additionalProperties==="object"&&D.additionalProperties!==null&&Object.keys(D.additionalProperties).length===0)delete D.additionalProperties;return D}case"Union":{let D=_.types.map((B,F)=>H(B,[...q,"types",F]));if(D.length===0)return{not:{}};if(D.length>1){let B=Jg(D);if(B!==void 0)return B}return _.mode==="anyOf"?{anyOf:D}:{oneOf:D}}}}function V(_,q,D){switch(_._tag){case"Reference":{if(!Object.hasOwn(Y,_.$ref))throw _4(`Invalid reference ${_.$ref}`,[...q,"$ref"]);if(D.has(_.$ref))return[];let B=new Set(D).add(_.$ref);return V(Y[_.$ref],["references",_.$ref],B)}case"String":return sF(H(_,q));case"TemplateLiteral":return[`^${_.parts.map(i2).join("")}$`];case"Union":return _.types.flatMap((B,F)=>V(B,[...q,"types",F],D));default:throw _4("Invalid schema representation document",q)}}}function $g(Q){return Q==="string"||Q==="number"||Q==="boolean"||Q==="array"||Q==="object"||Q==="null"||Q==="integer"}function Jg(Q){let X=void 0,Y=[];for(let $ of Q){if(Object.keys($).length!==2||$.type===void 0||!Array.isArray($.enum)||$.enum.length===0)return;if(X===void 0)X=$.type;else if($.type!==X)return;Y.push(...$.enum)}return{type:X,enum:Y}}function sF(Q){let X=[];if(typeof Q.pattern==="string")X.push(Q.pattern);for(let Y of["allOf","anyOf","oneOf"]){let $=Q[Y];if(Array.isArray($)){for(let J of $)if(typeof J==="object"&&J!==null&&!Array.isArray(J))X.push(...sF(J))}}return X}function i2(Q){switch(Q._tag){case"Literal":return y5(globalThis.String(Q.literal));case"String":return YF;case"Number":return w2;case"TemplateLiteral":return Q.parts.map(i2).join("");case"Union":return Q.types.map(i2).join("|");default:throw _4("Invalid schema representation document",[])}}function tF(Q,X){let Y=Yg([Q.representation],[["representation"]],Q.references,X);return{dialect:Y.dialect,schema:Y.schemas[0],definitions:Y.definitions}}function _W(Q){let{references:X,representations:Y}=Gg([Q]);return{representation:Y[0],references:X}}function Gg(Q){return Wg(Q,[])}function d8(Q){return Q===void 0?void 0:{annotations:Q}}function XR(Q){return CX(Q)||xG(Q)||jX(Q)&&Q.types.some(XR)}function eF(Q){let X=R6(Q);if(X!==void 0)return{identifier:X,isFallback:!1};let Y=G2(Q);return Y===void 0?void 0:{identifier:`${Y}JsonEncoding`,isFallback:!0}}function QR(Q,X){if(Q===X)return!0;let Y=Reflect.ownKeys(Q),$=Reflect.ownKeys(X);if(Y.length!==$.length)return!1;for(let J of Y)if(J!=="context"&&Q[J]!==X[J])return!1;return!0}function Wg(Q,X){let Y={},$=new Map,J=[],Z=new Map,G=new Set(X.map((L)=>L.key)),W=new Set,H=new Set,K=new Set;for(let L of X)Z.set(L.key,L.body),$.set(L.original,L.key),$.set(L.encoded,L.key);for(let L of Q)q(L);for(let L of X)q(L.body);let V=Q4(Q,(L)=>B(L));for(let L of X)b(Y,L.key,B(L.body,L.key));return{representations:V,references:Y};function _(L,x){let I=L,W0=0;while(Z.has(I))I=`${L}${++W0}`;return Z.set(I,x),I}function q(L){let x=M6(L);if(H.has(x)){if(XR(x))K.add(x);return}H.add(x);let I=eF(x);if(I!==void 0&&!I.isFallback){let W0=Z.get(I.identifier);if(W0===void 0)Z.set(I.identifier,x);else if($.get(x)!==I.identifier&&!QR(W0,x))throw Error(`Duplicate identifier: ${JSON.stringify(I.identifier)}`)}switch(D(x.checks),x._tag){case"Declaration":case"Arrays":case"Objects":case"Union":x.recur((W0)=>{return q(W0),W0});break;case"TemplateLiteral":x.parts.forEach(q);break;case"Suspend":q(x.thunk());break}}function D(L){L?.forEach((x)=>{if(x.annotations?.representation?.schemas?.forEach((I)=>q(z1(I))),x._tag==="FilterGroup")D(x.checks)})}function B(L,x){let I=$.get(L);if(I!==void 0&&I!==x)return{_tag:"Reference",$ref:I};let W0=M6(L);if(W0!==L)return B(W0,x);let T0=x===void 0?eF(L):void 0;if(T0!==void 0){let x0=F(T0,L);if($.set(L,x0),!Object.hasOwn(Y,x0)&&!G.has(x0))b(Y,x0,N(L));return{_tag:"Reference",$ref:x0}}if(x===void 0&&K.has(L)){let x0=_(`${L._tag}_`,L);return $.set(L,x0),b(Y,x0,N(L)),{_tag:"Reference",$ref:x0}}if(W.has(L)){let x0=_(`${L._tag}_`,L);return $.set(L,x0),{_tag:"Reference",$ref:x0}}W.add(L);let o1=N(L);W.delete(L);let F1=$.get(L);if(F1!==void 0&&F1!==x)return b(Y,F1,o1),{_tag:"Reference",$ref:F1};return o1}function F(L,x){if(!L.isFallback)return L.identifier;for(let[W0,T0]of J)if(QR(W0,x))return T0;let I=_(L.identifier,x);return J.push([x,I]),I}function N(L){let x=M(L.checks);switch(L._tag){case"Declaration":return{_tag:"Declaration",typeParameters:L.typeParameters.map((I)=>B(I)),checks:x,...A(L.annotations)};case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"String":case"Boolean":case"Number":case"BigInt":case"Symbol":case"ObjectKeyword":return{_tag:L._tag,checks:x,...d8(L.annotations)};case"Literal":return{_tag:"Literal",literal:L.literal,checks:x,...d8(L.annotations)};case"UniqueSymbol":return{_tag:"UniqueSymbol",symbol:L.symbol,checks:x,...d8(L.annotations)};case"Enum":return{_tag:"Enum",enums:L.enums,checks:x,...d8(L.annotations)};case"TemplateLiteral":return{_tag:"TemplateLiteral",parts:L.parts.map((I)=>B(I)),checks:x,...d8(L.annotations)};case"Arrays":return{_tag:"Arrays",elements:L.elements.map((I)=>{let W0=M6(I),T0=W0.context?.annotations;return{isOptional:f0(W0),type:B(I),...d8(T0)}}),rest:L.rest.map((I)=>B(I)),checks:x,...d8(L.annotations)};case"Objects":return{_tag:"Objects",propertySignatures:L.propertySignatures.map((I)=>{let W0=M6(I.type),T0=W0.context?.annotations;return{name:I.name,type:B(I.type),isOptional:f0(W0),isMutable:sO(W0),...d8(T0)}}),indexSignatures:L.indexSignatures.map((I)=>({parameter:B(I.parameter),type:B(I.type)})),checks:x,...d8(L.annotations)};case"Union":return{_tag:"Union",types:L.types.map((I)=>B(I)),mode:L.mode,checks:x,...d8(L.annotations)};case"Suspend":return{_tag:"Suspend",checks:[],thunk:B(L.thunk()),...d8(L.annotations)}}}function M(L){return L?.map(w)??[]}function w(L){switch(L._tag){case"Filter":return{_tag:"Filter",aborted:L.aborted,...s(L.annotations)};case"FilterGroup":return{_tag:"FilterGroup",checks:Q4(L.checks,w),...s(L.annotations)}}}function A(L){if(L===void 0)return;let{representation:x,...I}=L;return{...x===void 0?void 0:{representation:x},...Object.keys(I).length===0?void 0:{annotations:I}}}function s(L){if(L===void 0)return;let{representation:x,...I}=L,W0=x===void 0?void 0:x.schemas===void 0?x:{...x,schemas:x.schemas.map((T0)=>B(z1(T0)))};return{...W0===void 0?void 0:{representation:W0},...Object.keys(I).length===0?void 0:{annotations:I}}}}function n2(Q,X){if(Object.is(Q,X))return[];let Y=[];if(Array.isArray(Q)&&Array.isArray(X)){let $=Q.length,J=X.length,Z=Math.min($,J);for(let G=0;G<Z;G++){let W=`/${G}`,H=n2(Q[G],X[G]);for(let K of H)YR(K,W),Y.push(K)}for(let G=$-1;G>=J;G--)Y.push({op:"remove",path:`/${G}`});for(let G=$;G<J;G++)Y.push({op:"add",path:`/${G}`,value:X[G]});return Y}if(a2(Q)&&a2(X)){let $=Object.keys(Q),J=Object.keys(X),Z=Array.from(new Set([...$,...J])).sort();for(let G of Z){let H=`/${o2(G)}`,K=Object.hasOwn(Q,G),V=Object.hasOwn(X,G);if(K&&V){let _=n2(Q[G],X[G]);for(let q of _)YR(q,H),Y.push(q)}else if(!K&&V)Y.push({op:"add",path:H,value:X[G]});else if(K&&!V)Y.push({op:"remove",path:H})}return Y}return Y.push({op:"replace",path:"",value:X}),Y}function JR(Q,X){let Y=X;for(let $ of Q)switch($.op){case"replace":{Y=$.path===""?$.value:$R(Y,$.path,$.value,"replace");break}case"add":{Y=Vg(Y,$.path,$.value);break}case"remove":{Y=$R(Y,$.path,void 0,"remove");break}}return Y}function YR(Q,X){Q.path=Q.path===""?X:X+Q.path}function a2(Q){return j1(Q)}function Kg(Q){if(Q==="")return[];if(Q.charCodeAt(0)!==47)throw Error(`Invalid JSON Pointer, it must start with "/": ${P(Q)}`);return Q.split("/").slice(1).map(iF)}function qW(Q){if(!/^(0|[1-9]\d*)$/.test(Q))throw Error(`Invalid array index: "${Q}"`);return Number(Q)}function Vg(Q,X,Y){if(X==="")return Y;let $=ZR(Q,X);if($===null)throw Error(`Cannot add at "${X}" (parent not found or not a container).`);let{lastToken:J,parent:Z,stack:G}=$;if(Array.isArray(Z)){let W=J==="-"?Z.length:qW(J);if(W<0||W>Z.length)throw Error(`Array index out of bounds at "${X}".`);let H=Z.slice();return H.splice(W,0,Y),s2(G,H)}if(a2(Z)){let W={...Z};return b(W,J,Y),s2(G,W)}throw Error(`Cannot add at "${X}" (parent not found or not a container).`)}function $R(Q,X,Y,$){if(X===""){if($==="remove"||Y===void 0)throw Error("Unsupported operation at the root");return Y}let J=ZR(Q,X);if(J===null)throw Error(`Cannot ${$} at "${X}" (parent not found or not a container).`);let{lastToken:Z,parent:G,stack:W}=J;if(Array.isArray(G)){if(Z==="-")throw Error(`"-" is not valid for ${$} at "${X}".`);let H=qW(Z);if(H<0||H>=G.length)throw Error(`Array index out of bounds at "${X}".`);let K=G.slice();if($==="remove")K.splice(H,1);else K[H]=Y;return s2(W,K)}if(a2(G)){if(!Object.hasOwn(G,Z))throw Error(`Property "${Z}" does not exist at "${X}".`);let H={...G};if($==="remove")delete H[Z];else b(H,Z,Y);return s2(W,H)}throw Error(`Cannot ${$} at "${X}" (parent not found or not a container).`)}function ZR(Q,X){let Y=Kg(X);if(Y.length===0)return null;let $=Y[Y.length-1],J=[],Z=Q;for(let G=0;G<Y.length-1;G++){let W=Y[G];if(Z==null)return null;if(Array.isArray(Z)){let H=qW(W);if(H<0||H>=Z.length)return null;J.push({container:Z,token:H}),Z=Z[H];continue}if(Z&&typeof Z==="object"){if(!Object.hasOwn(Z,W))return null;J.push({container:Z,token:W}),Z=Z[W];continue}return null}return{stack:J,parent:Z,lastToken:$}}function s2(Q,X){let Y=X;for(let $=Q.length-1;$>=0;$--){let{container:J,token:Z}=Q[$];if(Array.isArray(J)){let G=J.slice();G[Z]=Y,Y=G}else{let G={...J};b(G,Z,Y),Y=G}}return Y}var qg=/^#\/\$defs(?=\/|$)/;function WR(Q){return{dialect:"draft-07",schema:GR(Q.schema),definitions:f7(Q.definitions,GR)}}function GR(Q){return X(Q);function X($){return Y(DW($,(J)=>J.replace(qg,"#/definitions")),!0)}function Y($,J){if(Array.isArray($))return $.map((K)=>Y(K,!1));if(!j1($))return $;let Z=$,G={},W=void 0,H=void 0;for(let K of Object.keys(Z)){let V=Z[K];switch(K){case"$ref":case"type":case"required":case"enum":case"const":case"title":case"description":case"default":case"examples":case"format":case"pattern":case"minimum":case"maximum":case"exclusiveMinimum":case"exclusiveMaximum":case"minLength":case"maxLength":case"minItems":case"maxItems":case"minProperties":case"maxProperties":case"multipleOf":case"uniqueItems":G[K]=V;break;case"properties":case"patternProperties":{let _=Dg(V,Y);G[K]=_??V;break}case"additionalProperties":case"propertyNames":G[K]=Y(V,!1);break;case"allOf":case"anyOf":case"oneOf":G[K]=Array.isArray(V)?V.map((_)=>Y(_,!1)):V;break;case"prefixItems":W=V;break;case"items":H=V;break;default:break}}if(W!==void 0)if(Array.isArray(W)){if(G.items=W.map((K)=>Y(K,!1)),H!==void 0)G.additionalItems=Y(H,!1)}else G.items=Y(W,!1);else if(H!==void 0)G.items=Y(H,!1);return G}}function DW(Q,X){if(Array.isArray(Q))return Q.map(($)=>DW($,X));if(!j1(Q))return Q;let Y={};for(let $ of Object.keys(Q)){let J=Q[$];if($==="$ref")b(Y,$,typeof J==="string"?X(J):J);else if(Array.isArray(J)||j1(J))b(Y,$,DW(J,X));else b(Y,$,J)}return Y}function Dg(Q,X){if(!j1(Q))return;let Y={};for(let $ of Object.keys(Q))b(Y,$,X(Q[$],!1));return Y}function KR(Q,X){return p8(new DR(Q,X))}function HR(Q,X){return p8(new BW(Q,X))}class VR{_tag="IdentityNode"}var _R=new VR;class qR{_tag="CompositionNode";nodes;constructor(Q){this.nodes=Q}}class DR{_tag="IsoNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class BW{_tag="LensNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class UR{_tag="PrismNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class zW{_tag="OptionalNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class OW{_tag="PathNode";path;constructor(Q){this.path=Q}}class e2{_tag="CheckNode";checks;constructor(Q){this.checks=Q}}function Bg(Q,X){let Y=Q[Q.length-1];if(Y){if(Y._tag==="PathNode"&&X._tag==="PathNode"){Q[Q.length-1]=new OW([...Y.path,...X.path]);return}if(Y._tag==="CheckNode"&&X._tag==="CheckNode"){Q[Q.length-1]=new e2([...Y.checks,...X.checks]);return}}Q.push(X)}function UW(Q,X){if(Q._tag==="IdentityNode")return;if(Q._tag==="CompositionNode"){for(let Y=0;Y<Q.nodes.length;Y++)UW(Q.nodes[Y],X);return}Bg(X,Q)}function j9(Q,X){let Y=[];switch(UW(Q,Y),UW(X,Y),Y.length){case 0:return _R;case 1:return Y[0];default:return new qR(Y)}}function zg(Q,X){return p8(new zW(Q,X))}class cX{node;getResult;replaceResult;constructor(Q,X,Y){this.node=Q,this.getResult=X,this.replaceResult=Y}replace(Q,X){return UQ(this.replaceResult(Q,X),()=>X)}modify(Q){return(X)=>UQ(p7(this.getResult(X),(Y)=>this.replaceResult(Q(Y),X)),()=>X)}compose(Q){return p8(j9(this.node,Q.node))}key(Q){return p8(j9(this.node,new OW([Q])))}optionalKey(Q){return p8(j9(this.node,new BW((X)=>X[Q],(X,Y)=>{let $=Q3(Y);if(X===void 0)if(Array.isArray($)&&typeof Q==="number")$.splice(Q,1);else delete $[Q];else b($,Q,X);return $})))}check(...Q){return p8(j9(this.node,new e2(Q)))}refine(Q,X){return p8(j9(this.node,new e2([S2(Q,X)])))}tag(Q){return p8(j9(this.node,new UR((X)=>X._tag===Q?t(X):i(`Expected ${P(Q)} tag, got ${P(X._tag)}`),u)))}at(Q,...X){let Y=i(`Key ${P(Q)} not found`);return p8(j9(this.node,new zW(($)=>Object.hasOwn($,Q)?t($[Q]):Y,($,J)=>{if(Object.hasOwn(J,Q)){let Z=Q3(J);return b(Z,Q,$),t(Z)}else return Y})))}pick(Q){return this.compose(HR(PF(Q),(X,Y)=>({...Y,...X})))}omit(Q){return this.compose(HR(AF(Q),(X,Y)=>({...Y,...X})))}notUndefined(){return this.refine(_1,{expected:"a value other than `undefined`"})}forEach(Q){let X=Q(X3());return zg((Y)=>X9(this.getResult(Y),($)=>{let J=[];for(let Z=0;Z<$.length;Z++){let G=X.getResult($[Z]);if(E1(G))J.push(G.success)}return J}),(Y,$)=>p7(this.getResult($),(J)=>{let Z=[];for(let W=0;W<J.length;W++)if(E1(X.getResult(J[W])))Z.push(W);if(Y.length!==Z.length)return i(`each: replacement length mismatch: ${Y.length} !== ${Z.length}`);let G=J.slice();for(let W=0;W<Z.length;W++){let H=Z[W],K=X.replaceResult(Y[W],J[H]);if(_0(K))return i(`each: could not set element ${H}`);G[H]=K.success}return this.replaceResult(G,$)}))}modifyAll(Q){return(X)=>UQ(p7(this.getResult(X),(Y)=>this.replaceResult(Y.map(Q),X)),()=>X)}}class BR extends cX{get;set;constructor(Q,X,Y){super(Q,($)=>t(X($)),($)=>t(Y($)));this.get=X,this.set=Y}replace(Q,X){return this.set(Q)}modify(Q){return(X)=>this.set(Q(this.get(X)))}}class zR extends cX{get;constructor(Q,X,Y){super(Q,($)=>t(X($)),($,J)=>t(Y($,J)));this.get=X,this.replace=Y}modify(Q){return(X)=>this.replace(Q(this.get(X)),X)}}class OR extends cX{set;constructor(Q,X,Y){super(Q,X,($,J)=>t(Y($)));this.set=Y}replace(Q,X){return this.set(Q)}modify(Q){return(X)=>UQ(X9(this.getResult(X),(Y)=>this.set(Q(Y))),()=>X)}}function p8(Q){let X=FR(Q);switch(X._tag){case"IsoNode":return new BR(Q,X.get,X.set);case"LensNode":return new zR(Q,X.get,X.set);case"PrismNode":return new OR(Q,X.get,X.set);case"OptionalNode":return new cX(Q,X.get,X.set)}}function Q3(Q){if(Array.isArray(Q))return Q.slice();if(typeof Q==="object"&&Q!==null){let X=Object.getPrototypeOf(Q);if(X!==Object.prototype&&X!==null)throw Error("Cannot clone object with non-Object constructor or null prototype");return{...Q}}return Q}var FR=s0((Q)=>{switch(Q._tag){case"IdentityNode":return{_tag:"IsoNode",get:u,set:u};case"IsoNode":case"LensNode":case"PrismNode":case"OptionalNode":return{_tag:Q._tag,get:Q.get,set:Q.set};case"PathNode":return{_tag:"LensNode",get:(X)=>{let Y=Q.path,$=X;for(let J=0,Z=Y.length;J<Z;J++)$=$[Y[J]];return $},set:(X,Y)=>{let $=Q.path,J=Q3(Y),Z=J,G=0;for(;G<$.length-1;G++){let H=$[G];b(Z,H,Q3(Z[H])),Z=Z[H]}let W=$[G];return b(Z,W,X),J}};case"CheckNode":return{_tag:"PrismNode",get:(X)=>a9(ZF(Q.checks,X),String),set:u};case"CompositionNode":{let X=Q.nodes.map(FR),Y=X.reduce(($,J)=>Og($,J._tag),"IsoNode");return{_tag:Y,get:($)=>{for(let J=0;J<X.length;J++){let Z=X[J],G=Z.get($);if(t2(Z._tag)){if(_0(G))return G;$=G.success}else $=G}return t2(Y)?t($):$},set:($,J)=>{let Z=J,G=X.length,W=Array(G+1);W[0]=J;for(let H=0;H<G;H++){let K=X[H];if(t2(K._tag)){let V=K.get(J);if(_0(V))return Y==="OptionalNode"?V:Z;J=V.success}else J=K.get(J);W[H+1]=J}for(let H=G-1;H>=0;H--){let K=X[H];if(RR(K._tag))$=K.set($);else if(K._tag==="LensNode")$=K.set($,W[H]);else{let V=K.set($,W[H]);if(_0(V))return V;$=V.success}}return Y==="OptionalNode"?t($):$}}}}});function t2(Q){return Q==="PrismNode"||Q==="OptionalNode"}function RR(Q){return Q==="IsoNode"||Q==="PrismNode"}function Og(Q,X){switch(Q){case"IsoNode":return X;case"LensNode":return t2(X)?"OptionalNode":"LensNode";case"PrismNode":return RR(X)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var Fg=p8(_R);function X3(){return Fg}var j3={};p6(j3,{webUrl:()=>Il,webSegment:()=>Gw,webQueryParameters:()=>Hw,webPath:()=>Ww,webFragments:()=>Zw,webAuthority:()=>$w,uuid:()=>zl,uniqueArray:()=>v9,ulid:()=>Kl,uint8ClampedArray:()=>rM,uint8Array:()=>oM,uint32Array:()=>lM,uint16Array:()=>uM,tuple:()=>Z0,toStringMethod:()=>l8,subarray:()=>Ql,stringify:()=>o0,stringMatching:()=>zo,string:()=>a0,stream:()=>v6,statistics:()=>Xd,sparseArray:()=>iM,shuffledSubarray:()=>Xl,set:()=>nM,schedulerFor:()=>cl,scheduler:()=>fl,scheduledModelRun:()=>dl,sample:()=>em,resetConfigureGlobal:()=>$m,record:()=>HH,readConfigureGlobal:()=>u8,property:()=>Gm,pre:()=>vg,option:()=>l4,oneof:()=>J1,object:()=>ku,noShrink:()=>M3,noBias:()=>N3,nat:()=>E6,modelRun:()=>hl,mixedCase:()=>Du,memo:()=>Wu,maxSafeNat:()=>Xc,maxSafeInteger:()=>xM,mapToConstant:()=>l5,map:()=>KH,lorem:()=>$u,limitShrink:()=>wo,letrec:()=>yM,jsonValue:()=>eM,json:()=>du,ipV6:()=>kM,ipV4Extended:()=>bM,ipV4:()=>yH,integer:()=>A0,int8Array:()=>cM,int32Array:()=>fM,int16Array:()=>pM,infiniteStream:()=>cu,hash:()=>L3,hasToStringMethod:()=>RH,hasCloneMethod:()=>E9,hasAsyncToStringMethod:()=>NH,getDepthContextFor:()=>PH,gen:()=>Gd,func:()=>sf,float64Array:()=>dM,float32Array:()=>mM,float:()=>EM,falsy:()=>bd,entityGraph:()=>nc,emailAddress:()=>Zf,double:()=>A3,domain:()=>vH,dictionary:()=>TH,defaultReportMessage:()=>tL,date:()=>KM,createDepthIdentifier:()=>AH,context:()=>yd,constantFrom:()=>D4,constant:()=>k0,configureGlobal:()=>Ym,compareFunc:()=>rf,compareBooleanFunc:()=>lf,commands:()=>xl,cloneMethod:()=>Z1,cloneIfNeeded:()=>p5,clone:()=>od,check:()=>XM,chainUntil:()=>VM,boolean:()=>Y7,bigUint64Array:()=>ll,bigInt64Array:()=>ul,bigInt:()=>x6,base64String:()=>au,asyncToStringMethod:()=>u4,asyncStringify:()=>LH,asyncProperty:()=>Zm,asyncModelRun:()=>ml,asyncDefaultReportMessage:()=>eL,assert:()=>sm,array:()=>C0,anything:()=>tM,__version:()=>Ao,__type:()=>Po,__commitHash:()=>Co,VerbosityLevel:()=>Wm,Value:()=>y,Stream:()=>G0,Random:()=>MH,PreconditionFailure:()=>b6,ExecutionStatus:()=>Im,Arbitrary:()=>g0});var Ng=class Q{constructor(X){this.seed=X}clone(){return new Q(this.seed)}next(){let X=FW(this.seed),Y=RW(X),$=FW(X),J=RW($);return this.seed=FW($),RW(this.seed)+(J+(Y<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function FW(Q){return Math.imul(Q,214013)+2531011&4294967295}function RW(Q){return(Q&-2147483649)>>16}function NR(Q){return new Ng(Q)}var Lg=class Q{constructor(X,Y){this.states=X,this.index=Y}clone(){return new Q(this.states.slice(),this.index)}next(){let X=this.states[this.index];return X^=X>>>11,X^=X<<7&2636928640,X^=X<<15&4022730752,X^=X>>>18,this.index=Y3(this.states,this.index),X}getState(){return[this.index,...this.states]}jump(){let X=this.states.slice(),Y=this.index;this.index=Y3(this.states,this.index);for(let $=19932;$>0;--$){if("SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000".charCodeAt($/6|0)-48&1<<$%6)LR(this.states,this.index,X,Y);this.index=Y3(this.states,this.index)}LR(this.states,this.index,X,Y)}};function LR(Q,X,Y,$){let J=0;if($>=X){for(;J<624-$;J++)Q[J+X]^=Y[J+$];for(;J<624-X;J++)Q[J+X]^=Y[J+$-624];for(;J<624;J++)Q[J+X-624]^=Y[J+$-624]}else{for(;J<624-X;J++)Q[J+X]^=Y[J+$];for(;J<624-$;J++)Q[J+X-624]^=Y[J+$];for(;J<624;J++)Q[J+X-624]^=Y[J+$-624]}}function Y3(Q,X){if(X<227){let Y=Q[X]&2147483648|Q[X+1]&2147483647;return Q[X]=Q[X+397]^Y>>>1^-(Y&1)&2567483615,X+1}else if(X<623){let Y=Q[X]&2147483648|Q[X+1]&2147483647;return Q[X]=Q[X+397-624]^Y>>>1^-(Y&1)&2567483615,X+1}else{let Y=Q[X]&2147483648|Q[0]&2147483647;return Q[X]=Q[396]^Y>>>1^-(Y&1)&2567483615,0}}function Mg(Q){for(let X=0;X!==624;++X)Y3(Q,X)}function MR(Q){let X=[Q|0];for(let Y=1;Y!==624;++Y){let $=X[Y-1]^X[Y-1]>>>30;X.push(Math.imul(1812433253,$)+Y|0)}return Mg(X),new Lg(X,0)}var wg=class Q{constructor(X,Y,$,J){this.s01=X,this.s00=Y,this.s11=$,this.s10=J}clone(){return new Q(this.s01,this.s00,this.s11,this.s10)}next(){let X=this.s00^this.s00<<23,Y=this.s01^(this.s01<<23|this.s00>>>9),$=X^this.s10^(X>>>18|Y<<14)^(this.s10>>>5|this.s11<<27),J=Y^this.s11^Y>>>18^this.s11>>>5,Z=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=J,this.s10=$,Z}jump(){let X=0,Y=0,$=0,J=0,Z=[1667051007,2321340297,1548169110,304075285];for(let G=0;G!==4;++G)for(let W=1;W;W<<=1){if(Z[G]&W)X^=this.s01,Y^=this.s00,$^=this.s11,J^=this.s10;this.next()}this.s01=X,this.s00=Y,this.s11=$,this.s10=J}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function NW(Q){return new wg(-1,~Q,Q|0,0)}var Pg=class Q{constructor(X,Y,$,J){this.s01=X,this.s00=Y,this.s11=$,this.s10=J}clone(){return new Q(this.s01,this.s00,this.s11,this.s10)}next(){let X=this.s00+this.s10|0,Y=this.s10^this.s00,$=this.s11^this.s01,J=this.s00,Z=this.s01;return this.s00=J<<24^Z>>>8^Y^Y<<16,this.s01=Z<<24^J>>>8^$^($<<16|Y>>>16),this.s10=$<<5^Y>>>27,this.s11=Y<<5^$>>>27,X}jump(){let X=0,Y=0,$=0,J=0,Z=[3639956645,3750757012,1261568508,386426335];for(let G=0;G!==4;++G)for(let W=1;W;W<<=1){if(Z[G]&W)X^=this.s01,Y^=this.s00,$^=this.s11,J^=this.s10;this.next()}this.s01=X,this.s00=Y,this.s11=$,this.s10=J}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function wR(Q){return new Pg(-1,~Q,Q|0,0)}function PR(Q,X){for(let Y=0;Y!==X;++Y)Q.next()}var AR=BigInt,Ag=4294967296n;function jR(Q,X,Y){let $=Y-X+1n,J=Ag,Z=1;while(J<$)J<<=32n,++Z;let G=CR(Z,Q);if(G<$)return G+X;if(G+$<J)return G%$+X;let W=J-J%$;while(G>=W)G=CR(Z,Q);return G%$+X}function CR(Q,X){let Y=AR(X.next()+2147483648);for(let $=1;$<Q;++$){let J=X.next();Y=(Y<<32n)+AR(J+2147483648)}return Y}function uX(Q,X){let Y=X>2?~~(4294967296/X)*X:4294967296,$=Q.next()+2147483648;while($>=Y)$=Q.next()+2147483648;return $%X}function LW(Q,X){if(X<0){let Y=-X;Q.sign=-1,Q.data[0]=~~(Y/4294967296),Q.data[1]=Y>>>0}else Q.sign=1,Q.data[0]=~~(X/4294967296),Q.data[1]=X>>>0;return Q}function Cg(Q,X,Y){let $=X.data[1],J=X.data[0],Z=X.sign,G=Y.data[1],W=Y.data[0],H=Y.sign;if(Q.sign=1,Z===1&&H===-1){let F=$+G,N=J+W+(F>4294967295?1:0);return Q.data[0]=N>>>0,Q.data[1]=F>>>0,Q}let K=$,V=J,_=G,q=W;if(Z===-1)K=G,V=W,_=$,q=J;let D=0,B=K-_;if(B<0)D=1,B=B>>>0;return Q.data[0]=V-q-D,Q.data[1]=B,Q}function jg(Q,X,Y){let $=Y[0]+1;X[0]=uX(Q,$),X[1]=uX(Q,4294967296);while(X[0]>=Y[0]&&(X[0]!==Y[0]||X[1]>=Y[1]))X[0]=uX(Q,$),X[1]=uX(Q,4294967296);return X}var Tg=Number.MAX_SAFE_INTEGER,Ig={sign:1,data:[0,0]},Eg={sign:1,data:[0,0]},TR={sign:1,data:[0,0]},MW=[0,0];function Sg(Q,X,Y,$){let J=$<=Tg?LW(TR,$):Cg(TR,LW(Ig,Y),LW(Eg,X));if(J.data[1]===4294967295)J.data[0]+=1,J.data[1]=0;else J.data[1]+=1;return jg(Q,MW,J.data),MW[0]*4294967296+MW[1]+X}function $3(Q,X,Y){let $=Y-X;if($<=4294967295)return uX(Q,$+1)+X;return Sg(Q,X,Y,$)}var IR=Symbol.for("fast-check/PreconditionFailure"),b6=class extends Error{constructor(Q=!1){super();this.interruptExecution=Q,this.footprint=IR}static isFailure(Q){return Q!==null&&Q!==void 0&&Q.footprint===IR}};function vg(Q){if(!Q)throw new b6}var xg=class{[Symbol.iterator](){return this}next(Q){return{value:Q,done:!0}}},bg=new xg;function kg(){return bg}function*yg(Q,X){for(let Y of Q)yield X(Y)}function*gg(Q,X){for(let Y of Q)yield*X(Y)}function*hg(Q,X){for(let Y of Q)if(X(Y))yield Y}function*mg(Q,X){for(let Y=0;Y<X;++Y){let $=Q.next();if($.done)break;yield $.value}}function*dg(Q,X){let Y=Q.next();while(!Y.done&&X(Y.value))yield Y.value,Y=Q.next()}function*pg(Q,X){for(let Y=Q.next();!Y.done;Y=Q.next())yield Y.value;for(let Y of X)for(let $=Y.next();!$.done;$=Y.next())yield $.value}var fg=Symbol.iterator,G0=class Q{static nil(){return new Q(kg())}static of(...X){return new Q(X[fg]())}constructor(X){this.g=X}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(X){return new Q(yg(this.g,X))}flatMap(X){return new Q(gg(this.g,X))}dropWhile(X){let Y=!1;function*$(J){if(Y||!X(J))Y=!0,yield J}return this.flatMap($)}drop(X){if(X<=0)return this;let Y=0;function $(){return Y++<X}return this.dropWhile($)}takeWhile(X){return new Q(dg(this.g,X))}take(X){return new Q(mg(this.g,X))}filter(X){return new Q(hg(this.g,X))}every(X){for(let Y of this.g)if(!X(Y))return!1;return!0}has(X){for(let Y of this.g)if(X(Y))return[!0,Y];return[!1,null]}join(...X){return new Q(pg(this.g,X))}getNthOrLast(X){let Y=X,$=null;for(let J of this.g){if(Y--===0)return J;$=J}return $}};function v6(Q){return new G0(Q)}var Z1=Symbol.for("fast-check/cloneMethod");function E9(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&Z1 in Q&&typeof Q[Z1]==="function"}function p5(Q){return E9(Q)?Q[Z1]():Q}var cg=Object.defineProperty,y=class{constructor(Q,X,Y){if(this.value_=Q,this.context=X,this.hasToBeCloned=Y!==void 0||E9(Q),this.readOnce=!1,this.value=Q,this.hasToBeCloned)cg(this,"value",{get:Y!==void 0?Y:this.getValue,enumerable:!1,configurable:!1})}getValue(){if(this.hasToBeCloned){if(!this.readOnce)return this.readOnce=!0,this.value_;return this.value_[Z1]()}return this.value_}},g0=class{filter(Q){return new og(this,Q)}map(Q,X){return new lg(this,Q,X)}chain(Q){return new ug(this,Q)}},ug=class extends g0{constructor(Q,X){super();this.arb=Q,this.chainer=X}generate(Q,X){let Y=Q.clone(),$=this.arb.generate(Q,X);return this.valueChainer($,Q,Y,X)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(this.isSafeContext(X))return(!X.stoppedForOriginal?this.arb.shrink(X.originalValue,X.originalContext).map((Y)=>this.valueChainer(Y,X.clonedMrng.clone(),X.clonedMrng,X.originalBias)):G0.nil()).join(X.chainedArbitrary.shrink(Q,X.chainedContext).map((Y)=>{let $={...X,chainedContext:Y.context,stoppedForOriginal:!0};return new y(Y.value_,$)}));return G0.nil()}valueChainer(Q,X,Y,$){let J=this.chainer(Q.value_),Z=J.generate(X,$),G={originalBias:$,originalValue:Q.value_,originalContext:Q.context,stoppedForOriginal:!1,chainedArbitrary:J,chainedContext:Z.context,clonedMrng:Y};return new y(Z.value_,G)}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalBias"in Q&&"originalValue"in Q&&"originalContext"in Q&&"stoppedForOriginal"in Q&&"chainedArbitrary"in Q&&"chainedContext"in Q&&"clonedMrng"in Q}};function CL(Q,X){let Y=Q.value,$=X(Y);if(Q.hasToBeCloned&&(typeof $==="object"&&$!==null||typeof $==="function")&&Object.isExtensible($)&&!E9($))Object.defineProperty($,Z1,{get:()=>()=>CL(Q,X)[0]});return[$,Y]}function ER(Q,X){let[Y,$]=CL(Q,X);return new y(Y,{originalValue:$,originalContext:Q.context})}var lg=class extends g0{constructor(Q,X,Y){super();this.arb=Q,this.mapper=X,this.unmapper=Y,this.bindValueMapper=($)=>ER($,X)}generate(Q,X){let Y=this.arb.generate(Q,X);if(!Y.hasToBeCloned){let $=Y.value;return new y(this.mapper($),{originalValue:$,originalContext:Y.context})}return ER(Y,this.mapper)}canShrinkWithoutContext(Q){if(this.unmapper!==void 0)try{let X=this.unmapper(Q);return this.arb.canShrinkWithoutContext(X)}catch{return!1}return!1}shrink(Q,X){if(this.isSafeContext(X))return this.arb.shrink(X.originalValue,X.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let Y=this.unmapper(Q);return this.arb.shrink(Y,void 0).map(this.bindValueMapper)}return G0.nil()}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalValue"in Q&&"originalContext"in Q}},og=class extends g0{constructor(Q,X){super();this.arb=Q,this.refinement=X,this.bindRefinementOnValue=(Y)=>this.refinementOnValue(Y)}generate(Q,X){while(!0){let Y=this.arb.generate(Q,X);if(this.refinementOnValue(Y))return Y}}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)&&this.refinement(Q)}shrink(Q,X){return this.arb.shrink(Q,X).filter(this.bindRefinementOnValue)}refinementOnValue(Q){return this.refinement(Q.value)}};function jL(Q){return typeof Q==="object"&&Q!==null&&"generate"in Q&&"shrink"in Q&&"canShrinkWithoutContext"in Q}function TL(Q){if(!jL(Q))throw Error("Unexpected value received: not an instance of Arbitrary")}var IL=Function.prototype.apply,wW=Symbol("apply");function rg(Q){try{return Q.apply}catch{return}}function ig(Q,X,Y){let $=Q;$[wW]=IL;let J=$[wW](X,Y);return delete $[wW],J}function B0(Q,X,Y){if(rg(Q)===IL)return Q.apply(X,Y);return ig(Q,X,Y)}var EL=Array,k=BigInt,ng=BigInt64Array,ag=BigUint64Array,SL=Boolean,F3=Date,h=Error,vL=Float32Array,xL=Float64Array,sg=Int8Array,tg=Int16Array,eg=Int32Array,f4=Number,x1=String,c8=Set,Qh=Uint8Array,Xh=Uint8ClampedArray,Yh=Uint16Array,$h=Uint32Array,Jh=encodeURIComponent,c4=Map,_3=Symbol,SR=Array.prototype.forEach,vR=Array.prototype.indexOf,xR=Array.prototype.join,bR=Array.prototype.map,kR=Array.prototype.flat,yR=Array.prototype.filter,gR=Array.prototype.push,hR=Array.prototype.pop,mR=Array.prototype.splice,dR=Array.prototype.slice,pR=Array.prototype.sort,fR=Array.prototype.every;function Zh(Q){try{return Q.forEach}catch{return}}function Gh(Q){try{return Q.indexOf}catch{return}}function Wh(Q){try{return Q.join}catch{return}}function Hh(Q){try{return Q.map}catch{return}}function Kh(Q){try{return Q.flat}catch{return}}function Vh(Q){try{return Q.filter}catch{return}}function _h(Q){try{return Q.push}catch{return}}function qh(Q){try{return Q.pop}catch{return}}function Dh(Q){try{return Q.splice}catch{return}}function Uh(Q){try{return Q.slice}catch{return}}function Bh(Q){try{return Q.sort}catch{return}}function zh(Q){try{return Q.every}catch{return}}function bL(Q,X){if(Zh(Q)===SR)return Q.forEach(X);return B0(SR,Q,[X])}function nX(Q,...X){if(Gh(Q)===vR)return Q.indexOf(...X);return B0(vR,Q,X)}function y0(Q,...X){if(Wh(Q)===xR)return Q.join(...X);return B0(xR,Q,X)}function O0(Q,X){if(Hh(Q)===bR)return Q.map(X);return B0(bR,Q,[X])}function Oh(Q,X){if(Kh(Q)===kR)return[].flat(),Q.flat(X);return B0(kR,Q,[X])}function Fh(Q,X){if(Vh(Q)===yR)return Q.filter(X);return B0(yR,Q,[X])}function T(Q,...X){if(_h(Q)===gR)return Q.push(...X);return B0(gR,Q,X)}function kL(Q){if(qh(Q)===hR)return Q.pop();return B0(hR,Q,[])}function yL(Q,...X){if(Dh(Q)===mR)return Q.splice(...X);return B0(mR,Q,X)}function $1(Q,...X){if(Uh(Q)===dR)return Q.slice(...X);return B0(dR,Q,X)}function gL(Q,...X){if(Bh(Q)===pR)return Q.sort(...X);return B0(pR,Q,X)}function hL(Q,...X){if(zh(Q)===fR)return Q.every(...X);return B0(fR,Q,X)}var cR=Date.prototype.getTime,uR=Date.prototype.toISOString;function Rh(Q){try{return Q.getTime}catch{return}}function Nh(Q){try{return Q.toISOString}catch{return}}function R3(Q){if(Rh(Q)===cR)return Q.getTime();return B0(cR,Q,[])}function Lh(Q){if(Nh(Q)===uR)return Q.toISOString();return B0(uR,Q,[])}var lR=Set.prototype.add,oR=Set.prototype.has;function Mh(Q){try{return Q.add}catch{return}}function wh(Q){try{return Q.has}catch(X){return}}function aX(Q,X){if(Mh(Q)===lR)return Q.add(X);return B0(lR,Q,[X])}function I6(Q,X){if(wh(Q)===oR)return Q.has(X);return B0(oR,Q,[X])}var rR=WeakMap.prototype.set,iR=WeakMap.prototype.get;function Ph(Q){try{return Q.set}catch(X){return}}function Ah(Q){try{return Q.get}catch(X){return}}function Ch(Q,X,Y){if(Ph(Q)===rR)return Q.set(X,Y);return B0(rR,Q,[X,Y])}function jh(Q,X){if(Ah(Q)===iR)return Q.get(X);return B0(iR,Q,[X])}var nR=Map.prototype.set,aR=Map.prototype.get,sR=Map.prototype.has;function Th(Q){try{return Q.set}catch(X){return}}function Ih(Q){try{return Q.get}catch(X){return}}function Eh(Q){try{return Q.has}catch(X){return}}function f8(Q,X,Y){if(Th(Q)===nR)return Q.set(X,Y);return B0(nR,Q,[X,Y])}function G8(Q,X){if(Ih(Q)===aR)return Q.get(X);return B0(aR,Q,[X])}function Sh(Q,X){if(Eh(Q)===sR)return Q.has(X);return B0(sR,Q,[X])}var tR=String.prototype.split,eR=String.prototype.startsWith,QN=String.prototype.endsWith,XN=String.prototype.substring,YN=String.prototype.toLowerCase,$N=String.prototype.toUpperCase,JN=String.prototype.padStart,ZN=String.prototype.charCodeAt,GN=String.prototype.normalize,WN=String.prototype.replace;function vh(Q){try{return Q.split}catch{return}}function xh(Q){try{return Q.startsWith}catch{return}}function bh(Q){try{return Q.endsWith}catch{return}}function kh(Q){try{return Q.substring}catch{return}}function yh(Q){try{return Q.toLowerCase}catch{return}}function gh(Q){try{return Q.toUpperCase}catch{return}}function hh(Q){try{return Q.padStart}catch{return}}function mh(Q){try{return Q.charCodeAt}catch{return}}function dh(Q){try{return Q.normalize}catch(X){return}}function ph(Q){try{return Q.replace}catch{return}}function b1(Q,...X){if(vh(Q)===tR)return Q.split(...X);return B0(tR,Q,X)}function fh(Q,...X){if(xh(Q)===eR)return Q.startsWith(...X);return B0(eR,Q,X)}function ch(Q,...X){if(bh(Q)===QN)return Q.endsWith(...X);return B0(QN,Q,X)}function d0(Q,...X){if(kh(Q)===XN)return Q.substring(...X);return B0(XN,Q,X)}function rW(Q){if(yh(Q)===YN)return Q.toLowerCase();return B0(YN,Q,[])}function BH(Q){if(gh(Q)===$N)return Q.toUpperCase();return B0($N,Q,[])}function uh(Q,...X){if(hh(Q)===JN)return Q.padStart(...X);return B0(JN,Q,X)}function f5(Q,X){if(mh(Q)===ZN)return Q.charCodeAt(X);return B0(ZN,Q,[X])}function lh(Q,X){if(dh(Q)===GN)return Q.normalize(X);return B0(GN,Q,[X])}function oh(Q,X,Y){if(ph(Q)===WN)return Q.replace(X,Y);return B0(WN,Q,[X,Y])}var HN=Number.prototype.toString;function rh(Q){try{return Q.toString}catch{return}}function sX(Q,...X){if(rh(Q)===HN)return Q.toString(...X);return B0(HN,Q,X)}var ih=Object.prototype.hasOwnProperty,nh=Object.prototype.toString;function mL(Q,X){return B0(ih,Q,[X])}function iW(Q){return B0(nh,Q,[])}var ah=Error.prototype.toString;function sh(Q){return B0(ah,Q,[])}var th=class{constructor(Q){this.producer=Q}[Symbol.iterator](){if(this.it===void 0)this.it=this.producer();return this.it}next(){if(this.it===void 0)this.it=this.producer();return this.it.next()}};function S6(Q){return new th(Q)}var dL=Array.isArray,eh=Object.defineProperty;function zH(Q,X,Y){return eh(Q,Z1,{value:()=>{let $=[];for(let J=0;J!==Y.length;++J){let Z=Y[J];if(Z===void 0)Z=new y(Q[J],X[J]);T($,Z.value)}return zH($,X,Y),$}})}function pL(Q,X,Y){let $=[],J=dL(Y)?Y:[];for(let Z=0;Z!==Q.length;++Z)T($,S6(()=>Q[Z].shrink(X[Z],J[Z]).map((G)=>{let W=!1,H=[],K=[],V=[];for(let _=0;_!==Q.length;++_){let q=_===Z?G:new y(p5(X[_]),J[_]);if(q.hasToBeCloned)W=!0,V[_]=q;T(H,q.value),T(K,q.context)}if(W)zH(H,K,V);return new y(H,K)})));return G0.nil().join(...$)}var Qm=class extends g0{constructor(Q){super();this.arbs=Q;for(let X=0;X!==Q.length;++X){let Y=Q[X];if(Y===null||Y===void 0||Y.generate===null||Y.generate===void 0)throw Error(`Invalid parameter encountered at index ${X}: expecting an Arbitrary`)}}generate(Q,X){let Y=!1,$=[],J=[],Z=[];for(let G=0;G!==this.arbs.length;++G){let W=this.arbs[G].generate(Q,X);if(W.hasToBeCloned)Y=!0,Z[G]=W;T($,W.value),T(J,W.context)}if(Y)zH($,J,Z);return new y($,J)}canShrinkWithoutContext(Q){if(!dL(Q)||Q.length!==this.arbs.length)return!1;for(let X=0;X!==this.arbs.length;++X)if(!this.arbs[X].canShrinkWithoutContext(Q[X]))return!1;return!0}shrink(Q,X){return pL(this.arbs,Q,X)}};function Z0(...Q){return new Qm(Q)}var Xm=Math.log;function fL(Q){return 2+~~(Xm(Q+1)*0.4342944819032518)}var OH={};function Ym(Q){OH=Q}function u8(){return OH}function $m(){OH={}}var tX=Symbol("UndefinedContextPlaceholder");function c5(Q){if(Q.context!==void 0)return Q;if(Q.hasToBeCloned)return new y(Q.value_,tX,()=>Q.value);return new y(Q.value_,tX)}var KN=()=>{},Jm=class{constructor(Q,X){this.arb=Q,this.predicate=X;let{asyncBeforeEach:Y,asyncAfterEach:$,beforeEach:J,afterEach:Z}=u8()||{};if(Y!==void 0&&J!==void 0)throw h(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if($!==void 0&&Z!==void 0)throw h(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=Y||J||KN,this.afterEachHook=$||Z||KN}isAsync(){return!0}generate(Q,X){return c5(this.arb.generate(Q,X!==void 0?fL(X):void 0))}shrink(Q){if(Q.context===void 0&&!this.arb.canShrinkWithoutContext(Q.value_))return G0.nil();let X=Q.context!==tX?Q.context:void 0;return this.arb.shrink(Q.value_,X).map(c5)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(Q){try{let X=await this.predicate(Q);return X===void 0||X===!0?null:{error:new h("Property failed by returning false")}}catch(X){if(b6.isFailure(X))return X;return{error:X}}}beforeEach(Q){let X=this.beforeEachHook;return this.beforeEachHook=()=>Q(X),this}afterEach(Q){let X=this.afterEachHook;return this.afterEachHook=()=>Q(X),this}},cL=class extends g0{constructor(Q){super();this.arb=Q}generate(Q,X){return c5(this.arb.generate(Q,X))}canShrinkWithoutContext(Q){return!0}shrink(Q,X){if(X===void 0&&!this.arb.canShrinkWithoutContext(Q))return G0.nil();let Y=X!==tX?X:void 0;return this.arb.shrink(Q,Y).map(c5)}};function Zm(...Q){if(Q.length<2)throw Error("asyncProperty expects at least two parameters");let X=$1(Q,0,Q.length-1),Y=Q[Q.length-1];return bL(X,TL),new Jm(Z0(...O0(X,($)=>new cL($))),($)=>Y(...$))}var VN=()=>{},uL=class{constructor(Q,X){this.arb=Q,this.predicate=X;let{beforeEach:Y=VN,afterEach:$=VN,asyncBeforeEach:J,asyncAfterEach:Z}=u8()||{};if(J!==void 0)throw h(`"asyncBeforeEach" can't be set when running synchronous properties`);if(Z!==void 0)throw h(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=Y,this.afterEachHook=$}isAsync(){return!1}generate(Q,X){return c5(this.arb.generate(Q,X!==void 0?fL(X):void 0))}shrink(Q){if(Q.context===void 0&&!this.arb.canShrinkWithoutContext(Q.value_))return G0.nil();let X=Q.context!==tX?Q.context:void 0;return this.arb.shrink(Q.value_,X).map(c5)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(Q){try{let X=this.predicate(Q);return X===void 0||X===!0?null:{error:new h("Property failed by returning false")}}catch(X){if(b6.isFailure(X))return X;return{error:X}}}beforeEach(Q){let X=this.beforeEachHook;return this.beforeEachHook=()=>Q(X),this}afterEach(Q){let X=this.afterEachHook;return this.afterEachHook=()=>Q(X),this}};function Gm(...Q){if(Q.length<2)throw Error("property expects at least two parameters");let X=$1(Q,0,Q.length-1),Y=Q[Q.length-1];return bL(X,TL),new uL(Z0(...O0(X,($)=>new cL($))),($)=>Y(...$))}var Wm=function(Q){return Q[Q.None=0]="None",Q[Q.Verbose=1]="Verbose",Q[Q.VeryVerbose=2]="VeryVerbose",Q}({});function nW(Q){if("unsafeNext"in Q){if(Q.unsafeJump===void 0)return{clone:()=>nW(Q),next:()=>Q.unsafeNext(),getState:()=>Q.getState()};return{clone:()=>nW(Q),next:()=>Q.unsafeNext(),jump:()=>Q.unsafeJump(),getState:()=>Q.getState()}}return Q}function lL(Q){if("jump"in Q&&typeof Q.jump==="function")return Q;return{clone:()=>lL(Q),next:()=>Q.next(),jump:()=>PR(Q,42),getState:()=>Q.getState()}}function P3(Q){return lL(nW(Q))}var Hm=Date.now,Km=Math.min,Vm=Math.random,_m=class{constructor(Q){let X=Q||{};this.seed=qm(X),this.randomType=Dm(X),this.numRuns=Um(X),this.verbose=Bm(X),this.maxSkipsPerRun=X.maxSkipsPerRun!==void 0?X.maxSkipsPerRun:100,this.timeout=AW(X.timeout),this.skipAllAfterTimeLimit=AW(X.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=AW(X.interruptAfterTimeLimit),this.markInterruptAsFailure=X.markInterruptAsFailure===!0,this.skipEqualValues=X.skipEqualValues===!0,this.ignoreEqualValues=X.ignoreEqualValues===!0,this.logger=X.logger!==void 0?X.logger:(Y)=>{console.log(Y)},this.path=X.path!==void 0?X.path:"",this.unbiased=X.unbiased===!0,this.examples=X.examples!==void 0?X.examples:[],this.endOnFailure=X.endOnFailure===!0,this.reporter=X.reporter,this.asyncReporter=X.asyncReporter,this.includeErrorInReport=X.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function PW(Q){return(X)=>{return P3(Q(X))}}function qm(Q){if(Q.seed===void 0)return Hm()^Vm()*4294967296;let X=Q.seed|0;if(Q.seed===X)return X;return X^(Q.seed-X)*4294967296}function Dm(Q){if(Q.randomType===void 0)return NW;if(typeof Q.randomType==="string")switch(Q.randomType){case"mersenne":return PW(MR);case"congruential":case"congruential32":return PW(NR);case"xorshift128plus":return NW;case"xoroshiro128plus":return wR;default:throw Error(`Invalid random specified: '${Q.randomType}'`)}let X=Q.randomType(0);if("min"in X&&X.min!==-2147483648)throw Error(`Invalid random number generator: min must equal -0x80000000, got ${String(X.min)}`);if("max"in X&&X.max!==2147483647)throw Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(X.max)}`);if(X===P3(X))return Q.randomType;return PW(Q.randomType)}function Um(Q){if(Q.numRuns!==void 0)return Q.numRuns;if(Q.num_runs!==void 0)return Q.num_runs;return 100}function Bm(Q){if(Q.verbose===void 0)return 0;if(typeof Q.verbose==="boolean")return Q.verbose===!0?1:0;if(Q.verbose<=0)return 0;if(Q.verbose>=2)return 2;return Q.verbose|0}function AW(Q){if(Q===void 0)return;return Km(Q,2147483647)}function FH(Q){return new _m(Q)}function zm(Q,X,Y){let $=null;return{clear:()=>Y($),promise:new Promise((J)=>{$=X(()=>{J(new b6(!0))},Q)})}}var _N=class{constructor(Q,X,Y,$,J,Z){this.property=Q,this.getTime=X,this.interruptExecution=$,this.setTimeoutSafe=J,this.clearTimeoutSafe=Z,this.skipAfterTime=this.getTime()+Y}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}run(Q){let X=this.skipAfterTime-this.getTime();if(X<=0){let Y=new b6(this.interruptExecution);if(this.isAsync())return Promise.resolve(Y);else return Y}if(this.interruptExecution&&this.isAsync()){let Y=zm(X,this.setTimeoutSafe,this.clearTimeoutSafe),$=Promise.race([this.property.run(Q),Y.promise]);return $.then(Y.clear,Y.clear),$}return this.property.run(Q)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Om=(Q,X,Y)=>{let $=null;return{clear:()=>Y($),promise:new Promise((J)=>{$=X(()=>{J({error:new h(`Property timeout: exceeded limit of ${Q} milliseconds`)})},Q)})}},Fm=class{constructor(Q,X,Y,$){this.property=Q,this.timeMs=X,this.setTimeoutSafe=Y,this.clearTimeoutSafe=$}isAsync(){return!0}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}async run(Q){let X=Om(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),Y=Promise.race([this.property.run(Q),X.promise]);return Y.then(X.clear,X.clear),Y}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},oL=class{constructor(Q){this.property=Q}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,void 0)}shrink(Q){return this.property.shrink(Q)}run(Q){return this.property.run(Q)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},qN=Array.from,DN=typeof Buffer<"u"?Buffer.isBuffer:void 0,g5=JSON.stringify,UN=Number.isNaN,Rm=Object.keys,Nm=Object.getOwnPropertySymbols,Lm=Object.getOwnPropertyDescriptor,BN=Object.getPrototypeOf,zN=Number.NEGATIVE_INFINITY,Mm=Number.POSITIVE_INFINITY,l8=Symbol.for("fast-check/toStringMethod");function RH(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&l8 in Q&&typeof Q[l8]==="function"}var u4=Symbol.for("fast-check/asyncToStringMethod");function NH(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&u4 in Q&&typeof Q[u4]==="function"}var wm=/^Symbol\((.*)\)$/;function Pm(Q){if(Q.description!==void 0)return Q.description;let X=wm.exec(x1(Q));return X&&X[1].length?X[1]:null}function ON(Q){switch(Q){case 0:return 1/Q===zN?"-0":"0";case zN:return"Number.NEGATIVE_INFINITY";case Mm:return"Number.POSITIVE_INFINITY";default:return Q===Q?x1(Q):"Number.NaN"}}function Am(Q){let X=-1;for(let Y in Q){let $=Number(Y);if($!==X+1)return!0;X=$}return X+1!==Q.length}function Z8(Q,X,Y){let $=[...X,Q];if(typeof Q==="object"){if(nX(X,Q)!==-1)return"[cyclic]"}if(NH(Q)){let J=Y(Q);if(J.state==="fulfilled")return J.value}if(RH(Q))try{return Q[l8]()}catch{}switch(iW(Q)){case"[object Array]":{let J=Q;if(J.length>=50&&Am(J)){let G=[];for(let W in J)if(!UN(Number(W)))T(G,`${W}:${Z8(J[W],$,Y)}`);return G.length!==0?`Object.assign(Array(${J.length}),{${y0(G,",")}})`:`Array(${J.length})`}let Z=y0(O0(J,(G)=>Z8(G,$,Y)),",");return J.length===0||J.length-1 in J?`[${Z}]`:`[${Z},]`}case"[object BigInt]":return`${Q}n`;case"[object Boolean]":{let J=Q==!0?"true":"false";return typeof Q==="boolean"?J:`new Boolean(${J})`}case"[object Date]":{let J=Q;return UN(R3(J))?"new Date(NaN)":`new Date(${g5(Lh(J))})`}case"[object Map]":return`new Map(${Z8(Array.from(Q),$,Y)})`;case"[object Null]":return"null";case"[object Number]":return typeof Q==="number"?ON(Q):`new Number(${ON(Number(Q))})`;case"[object Object]":{try{let Z=Q.toString;if(typeof Z==="function"&&Z!==Object.prototype.toString)return Q.toString()}catch{return"[object Object]"}let J=(Z)=>`${Z==="__proto__"?'["__proto__"]':typeof Z==="symbol"?`[${Z8(Z,$,Y)}]`:g5(Z)}:${Z8(Q[Z],$,Y)}`;return"{"+y0([...BN(Q)===null?["__proto__:null"]:[],...O0(Rm(Q),J),...O0(Fh(Nm(Q),(Z)=>{let G=Lm(Q,Z);return G&&G.enumerable}),J)],",")+"}"}case"[object Set]":return`new Set(${Z8(Array.from(Q),$,Y)})`;case"[object String]":return typeof Q==="string"?g5(Q):`new String(${g5(Q)})`;case"[object Symbol]":{let J=Q;if(_3.keyFor(J)!==void 0)return`Symbol.for(${g5(_3.keyFor(J))})`;let Z=Pm(J);if(Z===null)return"Symbol()";return J===(Z.startsWith("Symbol.")&&_3[Z.substring(7)])?Z:`Symbol(${g5(Z)})`}case"[object Promise]":{let J=Y(Q);switch(J.state){case"fulfilled":return`Promise.resolve(${Z8(J.value,$,Y)})`;case"rejected":return`Promise.reject(${Z8(J.value,$,Y)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(Q instanceof Error)return`new Error(${Z8(Q.message,$,Y)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof DN==="function"&&DN(Q))return`Buffer.from(${Q.buffer.detached?"/*detached ArrayBuffer*/":Z8(qN(Q.values()),$,Y)})`;let J=BN(Q),Z=J&&J.constructor&&J.constructor.name;if(typeof Z==="string"){let G=Q;if(G.buffer.detached)return`${Z}.from(/*detached ArrayBuffer*/)`;let W=G.values();return`${Z}.from(${Z8(qN(W),$,Y)})`}break}}try{return Q.toString()}catch{return iW(Q)}}function o0(Q){return Z8(Q,[],()=>({state:"unknown",value:void 0}))}function rL(Q){let X=_3(),Y=[],$=new c4;function J(){let H=null,K=()=>{if(H!==null)clearTimeout(H)};return{delay:new Promise((V)=>{H=setTimeout(()=>{H=null,V(X)},0)}),cancel:K}}let Z={state:"unknown",value:void 0},G=function(K){let V=K;if($.has(V))return $.get(V);let _=J(),q=u4 in K?Promise.resolve().then(()=>K[u4]()):K;return q.catch(()=>{}),Y.push(Promise.race([q,_.delay]).then((D)=>{if(D===X)$.set(V,{state:"pending",value:void 0});else $.set(V,{state:"fulfilled",value:D});_.cancel()},(D)=>{$.set(V,{state:"rejected",value:D}),_.cancel()})),$.set(V,Z),Z};function W(){let H=Z8(Q,[],G);if(Y.length===0)return H;return Promise.all(Y.splice(0)).then(W)}return W()}async function LH(Q){return Promise.resolve(rL(Q))}function FN(Q){return Q===null?new b6:Q}function Cm(...Q){if(Q[1])return Q[0].then(FN);return FN(Q[0])}function jm(Q,X){return Cm(Q,X)}var RN=class{constructor(Q,X){this.property=Q,this.skipRuns=X,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}run(Q){let X=o0(Q);if(this.coveredCases.has(X)){let $=this.coveredCases.get(X);if(!this.skipRuns)return $;return jm($,this.property.isAsync())}let Y=this.property.run(Q);return this.coveredCases.set(X,Y),Y}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},NN=Date.now,CW=setTimeout,jW=clearTimeout;function Tm(Q,X){let Y=Q;if(Q.isAsync()&&X.timeout!==void 0)Y=new Fm(Y,X.timeout,CW,jW);if(X.unbiased)Y=new oL(Y);if(X.skipAllAfterTimeLimit!==void 0)Y=new _N(Y,NN,X.skipAllAfterTimeLimit,!1,CW,jW);if(X.interruptAfterTimeLimit!==void 0)Y=new _N(Y,NN,X.interruptAfterTimeLimit,!0,CW,jW);if(X.skipEqualValues)Y=new RN(Y,!0);if(X.ignoreEqualValues)Y=new RN(Y,!1);return Y}var Im=function(Q){return Q[Q.Success=0]="Success",Q[Q.Skipped=-1]="Skipped",Q[Q.Failure=1]="Failure",Q}({}),Em=class Q{constructor(X,Y){this.verbosity=X,this.interruptedAsFailure=Y,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(X,Y){let $={status:X,value:Y,children:[]};return this.currentLevelExecutionTrees.push($),$}fail(X,Y,$){if(this.verbosity>=1){let J=this.appendExecutionTree(1,X);this.currentLevelExecutionTrees=J.children}if(this.pathToFailure===void 0)this.pathToFailure=`${Y}`;else this.pathToFailure+=`:${Y}`;this.value=X,this.failure=$}skip(X){if(this.verbosity>=2)this.appendExecutionTree(-1,X);if(this.pathToFailure===void 0)++this.numSkips}success(X){if(this.verbosity>=2)this.appendExecutionTree(0,X);if(this.pathToFailure===void 0)++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+b1(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?b1(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let X=[],Y=this.rootExecutionTrees;while(Y.length>0&&Y[Y.length-1].status===1){let $=Y[Y.length-1];X.push($.value),Y=$.children}return X}static mergePaths(X,Y){if(X.length===0)return Y;let $=X.split(":"),J=Y.split(":"),Z=+$[$.length-1]+ +J[0];return[...$.slice(0,$.length-1),`${Z}`,...J.slice(1)].join(":")}toRunDetails(X,Y,$,J){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:X,counterexample:this.value,counterexamplePath:Q.mergePaths(Y,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:J.toParameters()};let Z=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>$||this.interrupted&&Z,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:X,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:J.toParameters()}}},iL=class{constructor(Q,X,Y,$){this.sourceValues=Q,this.shrink=X,this.runExecution=new Em(Y,$),this.currentIdx=-1,this.nextValues=Q}[Symbol.iterator](){return this}next(){let Q=this.nextValues.next();if(Q.done||this.runExecution.interrupted)return{done:!0,value:void 0};return this.currentValue=Q.value,++this.currentIdx,{done:!1,value:Q.value.value_}}handleResult(Q){if(Q!==null&&typeof Q==="object"&&!b6.isFailure(Q))this.runExecution.fail(this.currentValue.value_,this.currentIdx,Q),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue);else if(Q!==null)if(!Q.interruptExecution)this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne();else this.runExecution.interrupt();else this.runExecution.success(this.currentValue.value_)}},Sm=class{constructor(Q,X,Y){this.initialValues=Q,this.maxInitialIterations=X,this.remainingSkips=Y}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let Q=this.initialValues.next();if(!Q.done)return{value:Q.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},vm=-2147483648,xm=2147483647,bm=Math.pow(2,27),km=Math.pow(2,-53),MH=class Q{constructor(X){this.internalRng=P3(X.clone())}clone(){return new Q(this.internalRng)}next(X){return $3(this.internalRng,0,(1<<X)-1)}nextBoolean(){return $3(this.internalRng,0,1)===1}nextInt(X,Y){return $3(this.internalRng,X===void 0?vm:X,Y===void 0?xm:Y)}nextBigInt(X,Y){return jR(this.internalRng,X,Y)}nextDouble(){let X=this.next(26),Y=this.next(27);return(X*bm+Y)*km}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function ym(Q,X,Y){return X.jump(),Q.generate(new MH(X),Y)}function*nL(Q,X,Y,$){for(let J=0;J!==$.length;++J)yield new y($[J],void 0);for(let J=0,Z=Y(X);;++J)yield ym(Q,Z,J)}function gm(Q,X,Y){return()=>Q.generate(new MH(X),Y)}function*aL(Q,X,Y,$){yield*O0($,(G)=>()=>new y(G,void 0));let J=0,Z=P3(Y(X));for(;;)Z.jump(),yield gm(Q,Z,J++)}function LN(Q){return Q()}function sL(Q,X,Y){let $=X,J=Q.split(":").map((G)=>+G);if(J.length===0)return $.map(LN);if(!J.every((G)=>!Number.isNaN(G)))throw Error(`Unable to replay, got invalid path=${Q}`);let Z=$.drop(J[0]).map(LN);for(let G of J.slice(1)){let W=Z.getNthOrLast(0);if(W===null)throw Error(`Unable to replay, got wrong path=${Q}`);Z=Y(W).drop(G)}return Z}var hm=Object.assign;function mm(Q){if(Q.length===1)return`Hint: ${Q[0]}`;return Q.map((X,Y)=>`Hint (${Y+1}): ${X}`).join(`
30
+ `)}function dm(Q,X){return`Encountered failures were:
31
31
  - ${Q.map(X).join(`
32
- - `)}`}function BK(Q,X){let Y=[],J=[];for(let $=Q.length-1;$>=0;--$)J.push({depth:1,tree:Q[$]});while(J.length!==0){let $=J.pop(),Z=$.tree,G=$.depth,K=Z.status===0?"\x1B[32m\u221A\x1B[0m":Z.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",W=G!==0?". ".repeat(G-1):"";Y.push(`${W}${K} ${X(Z.value)}`);for(let H=Z.children.length-1;H>=0;--H)J.push({depth:G+1,tree:Z.children[H]})}return`Execution summary:
32
+ - `)}`}function wH(Q,X){let Y=[],$=[];for(let J=Q.length-1;J>=0;--J)$.push({depth:1,tree:Q[J]});while($.length!==0){let J=$.pop(),Z=J.tree,G=J.depth,W=Z.status===0?"\x1B[32m\u221A\x1B[0m":Z.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",H=G!==0?". ".repeat(G-1):"";Y.push(`${H}${W} ${X(Z.value)}`);for(let K=Z.children.length-1;K>=0;--K)$.push({depth:G+1,tree:Z.children[K]})}return`Execution summary:
33
33
  ${Y.join(`
34
- `)}`}function Xg(Q,X){let Y=`Failed to run property, too many pre-condition failures encountered
34
+ `)}`}function pm(Q,X){let Y=`Failed to run property, too many pre-condition failures encountered
35
35
  { seed: ${Q.seed} }
36
36
 
37
37
  Ran ${Q.numRuns} time(s)
38
- Skipped ${Q.numSkips} time(s)`,J=null,$=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];if(Q.verbose>=2)J=BK(Q.executionSummary,X);else x($,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:J,hints:$}}function Yg(Q){if(Q instanceof S&&Q.stack!==void 0)return Q.stack;try{return P1(Q)}catch(X){}if(Q instanceof S)try{return _b(Q)}catch(X){}if(Q!==null&&typeof Q==="object")try{return hG(Q)}catch(X){}return"Failed to serialize errorInstance"}function Jg(Q,X){let Y=Q.runConfiguration.includeErrorInReport?`
39
- Got ${Gb(Yg(Q.errorInstance),/^Error: /,"error: ")}`:"",J=`Property failed after ${Q.numRuns} tests
38
+ Skipped ${Q.numSkips} time(s)`,$=null,J=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];if(Q.verbose>=2)$=wH(Q.executionSummary,X);else T(J,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:$,hints:J}}function fm(Q){if(Q instanceof h&&Q.stack!==void 0)return Q.stack;try{return x1(Q)}catch(X){}if(Q instanceof h)try{return sh(Q)}catch(X){}if(Q!==null&&typeof Q==="object")try{return iW(Q)}catch(X){}return"Failed to serialize errorInstance"}function cm(Q,X){let Y=Q.runConfiguration.includeErrorInReport?`
39
+ Got ${oh(fm(Q.errorInstance),/^Error: /,"error: ")}`:"",$=`Property failed after ${Q.numRuns} tests
40
40
  { seed: ${Q.seed}, path: "${Q.counterexamplePath}", endOnFailure: true }
41
41
  Counterexample: ${X(Q.counterexample)}
42
- Shrunk ${Q.numShrinks} time(s)${Y}`,$=null,Z=[];if(Q.verbose>=2)$=BK(Q.executionSummary,X);else if(Q.verbose===1)$=Qg(Q.failures,X);else x(Z,"Enable verbose mode in order to have the list of all failing values encountered during the run");return{message:J,details:$,hints:Z}}function $g(Q,X){let Y=`Property interrupted after ${Q.numRuns} tests
43
- { seed: ${Q.seed} }`,J=null,$=[];if(Q.verbose>=2)J=BK(Q.executionSummary,X);else x($,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:J,hints:$}}function dG(Q,X){if(!Q.failed)return;let{message:Y,details:J,hints:$}=Q.counterexamplePath===null?Q.interrupted?$g(Q,X):Xg(Q,X):Jg(Q,X),Z=Y;if(J!==null)Z+=`
42
+ Shrunk ${Q.numShrinks} time(s)${Y}`,J=null,Z=[];if(Q.verbose>=2)J=wH(Q.executionSummary,X);else if(Q.verbose===1)J=dm(Q.failures,X);else T(Z,"Enable verbose mode in order to have the list of all failing values encountered during the run");return{message:$,details:J,hints:Z}}function um(Q,X){let Y=`Property interrupted after ${Q.numRuns} tests
43
+ { seed: ${Q.seed} }`,$=null,J=[];if(Q.verbose>=2)$=wH(Q.executionSummary,X);else T(J,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:$,hints:J}}function aW(Q,X){if(!Q.failed)return;let{message:Y,details:$,hints:J}=Q.counterexamplePath===null?Q.interrupted?um(Q,X):pm(Q,X):cm(Q,X),Z=Y;if($!==null)Z+=`
44
44
 
45
- ${J}`;if($.length>0)Z+=`
45
+ ${$}`;if(J.length>0)Z+=`
46
46
 
47
- ${eb($)}`;return Z}function IP(Q){return dG(Q,b0)}async function jP(Q){let X=[];function Y(G){let K=MP(G);if(typeof K==="string")return K;return X.push(Promise.all([G,K])),"\u2026"}let J=dG(Q,Y);if(X.length===0)return J;let $=new q4(await Promise.all(X));function Z(G){let K=c1($,G);if(K!==void 0)return K;return b0(G)}return dG(Q,Z)}function EP(Q,X){if(X.runConfiguration.includeErrorInReport)throw new S(Q);let Y=new S(Q,{cause:X.errorInstance});if(!("cause"in Y))tb(Y,{cause:X.errorInstance});return Y}function Zg(Q){if(!Q.failed)return;throw EP(IP(Q),Q)}async function Gg(Q){if(!Q.failed)return;throw EP(await jP(Q),Q)}function Kg(Q){if(Q.runConfiguration.asyncReporter)return Q.runConfiguration.asyncReporter(Q);else if(Q.runConfiguration.reporter)return Q.runConfiguration.reporter(Q);else return Zg(Q)}async function Wg(Q){if(Q.runConfiguration.asyncReporter)return Q.runConfiguration.asyncReporter(Q);else if(Q.runConfiguration.reporter)return Q.runConfiguration.reporter(Q);else return Gg(Q)}function Hg(Q,X,Y,J,$){let Z=new AP(Y,X,J,$);for(let G of Z){Q.runBeforeEach();let K=Q.run(G);Q.runAfterEach(),Z.handleResult(K)}return Z.runExecution}async function Vg(Q,X,Y,J,$){let Z=new AP(Y,X,J,$);for(let G of Z){await Q.runBeforeEach();let K=await Q.run(G);await Q.runAfterEach(),Z.handleResult(K)}return Z.runExecution}function SP(Q,X){if(Q===null||Q===void 0||Q.generate===null||Q.generate===void 0)throw Error("Invalid property encountered, please use a valid property");if(Q.run===null||Q.run===void 0)throw Error("Invalid property encountered, please use a valid property not an arbitrary");let Y=HK({...P8(),...X});if(Y.reporter!==void 0&&Y.asyncReporter!==void 0)throw Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(Y.asyncReporter!==void 0&&!Q.isAsync())throw Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let J=cb(Q,Y),$=Y.path.length===0||Y.path.indexOf(":")===-1?Y.numRuns:-1,Z=Y.numRuns*Y.maxSkipsPerRun,G=(...H)=>J.shrink(...H),K=new lb(Y.path.length===0?wP(J,Y.seed,Y.randomType,Y.examples):TP(Y.path,t4(CP(J,Y.seed,Y.randomType,Y.examples)),G),$,Z),W=!Y.endOnFailure?G:s.nil;return J.isAsync()?Vg(J,W,K,Y.verbose,Y.markInterruptAsFailure).then((H)=>H.toRunDetails(Y.seed,Y.path,Z,Y)):Hg(J,W,K,Y.verbose,Y.markInterruptAsFailure).toRunDetails(Y.seed,Y.path,Z,Y)}function _g(Q,X){let Y=SP(Q,X);if(Q.isAsync())return Y.then(Wg);else Kg(Y)}function qg(Q,X){let Y=!Object.prototype.hasOwnProperty.call(Q,"isAsync")?new PP(Q,()=>!0):Q;return X.unbiased===!0?new NP(Y):Y}function xP(Q,X){let Y=HK(typeof X==="number"?{...P8(),numRuns:X}:{...P8(),...X}),J=qg(Q,Y),$=J.shrink.bind(J);return(Y.path.length===0?t4(wP(J,Y.seed,Y.randomType,Y.examples)):TP(Y.path,t4(CP(J,Y.seed,Y.randomType,Y.examples)),$)).take(Y.numRuns).map((Z)=>Z.value_)}function Dg(Q,X){return[...xP(Q,X)]}function Bg(Q){return(Math.round(Q*100)/100).toFixed(2)}function Ug(Q,X,Y){let J=HK(typeof Y==="number"?{...P8(),numRuns:Y}:{...P8(),...Y}),$={};for(let W of xP(Q,Y)){let H=X(W),_=Array.isArray(H)?H:[H];for(let V of _)$[V]=($[V]||0)+1}let Z=Object.entries($).sort((W,H)=>H[1]-W[1]).map((W)=>[W[0],`${Bg(W[1]*100/J.numRuns)}%`]),G=Z.map((W)=>W[0].length).reduce((W,H)=>Math.max(W,H),0),K=Z.map((W)=>W[1].length).reduce((W,H)=>Math.max(W,H),0);for(let W of Z)J.logger(`${W[0].padEnd(G,".")}..${W[1].padStart(K,".")}`)}var Og=Object.assign;function pG(Q,X,Y,J){let $=Y(),Z=Q.clone(),G={mrng:Q.clone(),biasFactor:X,history:[]},K=(H)=>{let _=$[G.history.length];if(_!==void 0&&_.arb===H){let q=_.value;return x(G.history,{arb:H,value:q,context:_.context,mrng:_.mrng}),Z=_.mrng.clone(),q}let V=H.generate(Z,X);return x(G.history,{arb:H,value:V.value_,context:V.context,mrng:Z.clone()}),V.value};return new k(Og((H,..._)=>{return K(J(H,_))},{values(){return Z0(G.history,(H)=>H.value)},[r0](){return pG(Q,X,Y,J).value},[R8](){return b0(Z0(G.history,(H)=>H.value))}}),G)}var zG=Array.isArray,oF=Object.keys,zg=Object.is;function Fg(Q){let X=new q4;return function(J,$){let Z=c1(X,J);if(Z===void 0){let W=J(...$);return L8(X,J,[{args:$,value:W}]),W}let G=Z;for(let W of G)if(Q($,W.args))return W.value;let K=J(...$);return x(G,{args:$,value:K}),K}}function vP(Q,X){if(Q!==null&&typeof Q==="object"&&X!==null&&typeof X==="object"){if(zG(Q)){if(!zG(X))return!1;if(Q.length!==X.length)return!1}else if(zG(X))return!1;if(oF(Q).length!==oF(X).length)return!1;for(let Y in Q){if(!(Y in X))return!1;if(!vP(Q[Y],X[Y]))return!1}return!0}else return zg(Q,X)}var Lg=class extends C0{constructor(...Q){super(...Q);this.arbitraryCache=Fg(vP)}generate(Q,X){return pG(Q,X,()=>[],this.arbitraryCache)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(X===void 0)return s.nil();let Y=X,J=Y.mrng,$=Y.biasFactor,Z=Y.history;return zP(Z.map((G)=>G.arb),Z.map((G)=>G.value),Z.map((G)=>G.context)).map((G)=>{function K(){let{value:W,context:H}=G;return Z0(Z,(_,V)=>({arb:_.arb,value:W[V],context:H[V],mrng:_.mrng}))}return pG(J,$,K,this.arbitraryCache)})}};function Pg(){return new Lg}var{floor:Rg,log:nF}=Math;function Ng(Q){return Rg(nF(Q)/nF(2))}function Mg(Q){if(Q===j(0))return j(0);return j(P1(Q).length)}function kP(Q,X,Y){if(Q===X)return[{min:Q,max:X}];if(Q<0&&X>0){let G=Y(-Q),K=Y(X);return[{min:-G,max:K},{min:X-K,max:X},{min:Q,max:Q+G}]}let J=Y(X-Q),$={min:Q,max:Q+J},Z={min:X-J,max:X};return Q<0?[Z,$]:[$,Z]}var{ceil:Ag,floor:wg}=Math;function iF(Q){return wg(Q/2)}function aF(Q){return Ag(Q/2)}function sF(Q,X,Y){let J=Q-X;function*$(){let G=Y?void 0:X,K=Y?J:iF(J);for(let W=K;W>0;W=iF(W)){let H=W===J?X:Q-W;yield new k(H,G),G=H}}function*Z(){let G=Y?void 0:X,K=Y?J:aF(J);for(let W=K;W<0;W=aF(W)){let H=W===J?X:Q-W;yield new k(H,G),G=H}}return J>0?t4($()):t4(Z())}var tF=Math.sign,Cg=Number.isInteger,Tg=Object.is,_9=class Q extends C0{constructor(X,Y){super();this.min=X,this.max=Y}generate(X,Y){let J=this.computeGenerateRange(X,Y);return new k(X.nextInt(J.min,J.max),void 0)}canShrinkWithoutContext(X){return typeof X==="number"&&Cg(X)&&!Tg(X,-0)&&this.min<=X&&X<=this.max}shrink(X,Y){if(!Q.isValidContext(X,Y))return sF(X,this.defaultTarget(),!0);if(this.isLastChanceTry(X,Y))return s.of(new k(Y,void 0));return sF(X,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return 0;return this.min<0?this.max:this.min}computeGenerateRange(X,Y){if(Y===void 0||X.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let J=kP(this.min,this.max,Ng);if(J.length===1)return J[0];let $=X.nextInt(-2*(J.length-1),J.length-2);return $<0?J[0]:J[$+1]}isLastChanceTry(X,Y){if(X>0)return X===Y+1&&X>this.min;if(X<0)return X===Y-1&&X<this.max;return!1}static isValidContext(X,Y){if(Y===void 0)return!1;if(typeof Y!=="number")throw Error("Invalid context type passed to IntegerArbitrary (#1)");if(Y!==0&&tF(X)!==tF(Y))throw Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},eF=Number.isInteger;function Ig(Q){return{min:Q.min!==void 0?Q.min:-2147483648,max:Q.max!==void 0?Q.max:2147483647}}function O0(Q={}){let X=Ig(Q);if(X.min>X.max)throw Error("fc.integer maximum value should be equal or greater than the minimum one");if(!eF(X.min))throw Error("fc.integer minimum value should be an integer");if(!eF(X.max))throw Error("fc.integer maximum value should be an integer");return new _9(X.min,X.max)}var QL=new Map;function UK(Q){if(Q===void 0)return{depth:0};if(typeof Q!=="string")return Q;let X=c1(QL,Q);if(X!==void 0)return X;let Y={depth:0};return L8(QL,Q,Y),Y}function OK(){return{depth:0}}var jg=class{constructor(Q,X,Y){this.arb=Q,this.mrng=X,this.biasFactor=Y}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},Eg=Math.min,Sg=Math.max,xg=class{constructor(Q,X,Y,J){this.arb=Q,this.mrng=X,this.slices=Y,this.biasFactor=J,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(Q){if(Q!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let X=[];for(let Y=0;Y!==this.slices.length;++Y)if(this.slices[Y].length===Q)x(X,Y);if(X.length===0)return;this.activeSliceIndex=X[this.mrng.nextInt(0,X.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=Q-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new k(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let Q=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=Q.length-1,new k(Q[0],void 0);let X=this.mrng.nextInt(0,Q.length-1),Y=this.mrng.nextInt(0,Q.length-1);return this.nextIndexInSlice=Eg(X,Y),this.lastIndexInSlice=Sg(X,Y),new k(Q[this.nextIndexInSlice++],void 0)}};function XL(Q,X,Y,J){if(J===void 0||Y.length===0||X.nextInt(1,J)!==1)return new jg(Q,X,J);return new xg(Q,X,Y,J)}var{floor:vg,log:YL,max:JL}=Math,kg=Array.isArray;function FG(Q,X){if(Q===X)return Q;return Q+vg(YL(X-Q)/YL(2))}var yP=class Q extends C0{constructor(X,Y,J,$,Z,G,K){super();this.arb=X,this.minLength=Y,this.maxGeneratedLength=J,this.maxLength=$,this.setBuilder=G,this.customSlices=K,this.lengthArb=O0({min:Y,max:J}),this.depthContext=UK(Z)}preFilter(X){if(this.setBuilder===void 0)return X;let Y=this.setBuilder();for(let J=0;J!==X.length;++J)Y.tryAdd(X[J]);return Y.getData()}static makeItCloneable(X,Y){return X[r0]=()=>{let J=[];for(let $=0;$!==Y.length;++$)x(J,Y[$].value);return this.makeItCloneable(J,Y),J},X}generateNItemsNoDuplicates(X,Y,J,$){let Z=0,G=X(),K=XL(this.arb,J,this.customSlices,$);while(G.size()<Y&&Z<this.maxGeneratedLength){let W=K.next();if(G.tryAdd(W))Z=0;else Z+=1}return G.getData()}safeGenerateNItemsNoDuplicates(X,Y,J,$){let Z=JL(0,Y-FG(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=Z;try{return this.generateNItemsNoDuplicates(X,Y,J,$)}finally{this.depthContext.depth-=Z}}generateNItems(X,Y,J){let $=[],Z=XL(this.arb,Y,this.customSlices,J);Z.attemptExact(X);for(let G=0;G!==X;++G)x($,Z.next());return $}safeGenerateNItems(X,Y,J){let $=JL(0,X-FG(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=$;try{return this.generateNItems(X,Y,J)}finally{this.depthContext.depth-=$}}wrapper(X,Y,J,$){let Z=Y?this.preFilter(X):X,G=!1,K=[],W=[];for(let H=0;H!==Z.length;++H){let _=Z[H];G=G||_.hasToBeCloned,x(K,_.value),x(W,_.context)}if(G)Q.makeItCloneable(K,Z);return new k(K,{shrunkOnce:Y,lengthContext:X.length===Z.length&&J!==void 0?J:void 0,itemsContexts:W,startIndex:$})}generate(X,Y){let J=this.applyBias(X,Y),$=J.size,Z=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,$,X,J.biasFactorItems):this.safeGenerateNItems($,X,J.biasFactorItems);return this.wrapper(Z,!1,void 0,0)}applyBias(X,Y){if(Y===void 0)return{size:this.lengthArb.generate(X,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(X,void 0).value,biasFactorItems:Y};if(X.nextInt(1,Y)!==1)return{size:this.lengthArb.generate(X,void 0).value};if(X.nextInt(1,Y)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(X,void 0).value,biasFactorItems:Y};let J=FG(this.minLength,this.maxGeneratedLength);return{size:O0({min:this.minLength,max:J}).generate(X,void 0).value,biasFactorItems:Y}}canShrinkWithoutContext(X){if(!kg(X)||this.minLength>X.length||X.length>this.maxLength)return!1;for(let Y=0;Y!==X.length;++Y){if(!(Y in X))return!1;if(!this.arb.canShrinkWithoutContext(X[Y]))return!1}return this.preFilter(Z0(X,(Y)=>new k(Y,void 0))).length===X.length}shrinkItemByItem(X,Y,J){let $=[];for(let Z=Y.startIndex;Z<J;++Z)x($,s4(()=>this.arb.shrink(X[Z],Y.itemsContexts[Z]).map((G)=>{let K=Z0(s0(X,0,Z),(H,_)=>new k(K9(H),Y.itemsContexts[_])),W=Z0(s0(X,Z+1),(H,_)=>new k(K9(H),Y.itemsContexts[_+Z+1]));return[[...K,G,...W],void 0,Z]})));return s.nil().join(...$)}shrinkImpl(X,Y){if(X.length===0)return s.nil();let J=Y!==void 0?Y:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(X.length,J.lengthContext).drop(J.shrunkOnce&&J.lengthContext===void 0&&X.length>this.minLength+1?1:0).map(($)=>{let Z=X.length-$.value;return[Z0(s0(X,Z),(G,K)=>new k(K9(G),J.itemsContexts[K+Z])),$.context,0]}).join(s4(()=>X.length>this.minLength?this.shrinkItemByItem(X,J,1):this.shrinkItemByItem(X,J,X.length))).join(X.length>this.minLength?s4(()=>{let $={shrunkOnce:!1,lengthContext:void 0,itemsContexts:s0(J.itemsContexts,1),startIndex:0};return this.shrinkImpl(s0(X,1),$).filter((Z)=>this.minLength<=Z[0].length+1).map((Z)=>{return[[new k(K9(X[0]),J.itemsContexts[0]),...Z[0]],void 0,0]})}):s.nil())}shrink(X,Y){return this.shrinkImpl(X,Y).map((J)=>this.wrapper(J[0],!0,J[1],J[2]))}},yg=Math.floor,bg=Math.min,t6=2147483647,$9=["xsmall","small","medium","large","xlarge"],gg=["-4","-3","-2","-1","=","+1","+2","+3","+4"],zK="small";function hg(Q,X){switch(X){case"xsmall":return yg(1.1*Q)+1;case"small":return 2*Q+10;case"medium":return 11*Q+100;case"large":return 101*Q+1000;case"xlarge":return 1001*Q+1e4;default:throw Error(`Unable to compute lengths based on received size: ${X}`)}}function DX(Q,X){let Y=V4(gg,Q);if(Y===-1)return Q;let J=V4($9,X);if(J===-1)throw Error(`Unable to offset size based on the unknown defaulted one: ${X}`);let $=J+Y-4;return $<0?$9[0]:$>=$9.length?$9[$9.length-1]:$9[$]}function _X(Q,X,Y,J){let{baseSize:$=zK,defaultSizeToMaxWhenMaxSpecified:Z}=P8()||{},G=Q!==void 0?Q:J&&Z?"max":$;if(G==="max")return Y;return bg(hg(X,DX(G,$)),Y)}function mg(Q,X){if(typeof Q==="number")return 1/Q;let{baseSize:Y=zK,defaultSizeToMaxWhenMaxSpecified:J}=P8()||{},$=Q!==void 0?Q:X&&J?"max":Y;if($==="max")return 0;switch(DX($,Y)){case"xsmall":return 1;case"small":return 0.5;case"medium":return 0.25;case"large":return 0.125;case"xlarge":return 0.0625}}function FK(Q){let{baseSize:X=zK}=P8()||{};if(Q===void 0)return X;return DX(Q,X)}function P0(Q,X={}){let Y=X.size,J=X.minLength||0,$=X.maxLength,Z=X.depthIdentifier,G=$!==void 0?$:t6;return new yP(Q,J,_X(Y,J,G,$!==void 0),G,Z,void 0,X.experimentalCustomSlices||[])}function W2(Q){return Q/j(2)}function $L(Q,X,Y){let J=Q-X;function*$(){let G=Y?void 0:X,K=Y?J:W2(J);for(let W=K;W>0;W=W2(W)){let H=Q-W;yield new k(H,G),G=H}}function*Z(){let G=Y?void 0:X,K=Y?J:W2(J);for(let W=K;W<0;W=W2(W)){let H=Q-W;yield new k(H,G),G=H}}return J>0?t4($()):t4(Z())}var dg=class Q extends C0{constructor(X,Y){super();this.min=X,this.max=Y}generate(X,Y){let J=this.computeGenerateRange(X,Y);return new k(X.nextBigInt(J.min,J.max),void 0)}computeGenerateRange(X,Y){if(Y===void 0||X.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let J=kP(this.min,this.max,Mg);if(J.length===1)return J[0];let $=X.nextInt(-2*(J.length-1),J.length-2);return $<0?J[0]:J[$+1]}canShrinkWithoutContext(X){return typeof X==="bigint"&&this.min<=X&&X<=this.max}shrink(X,Y){if(!Q.isValidContext(X,Y))return $L(X,this.defaultTarget(),!0);if(this.isLastChanceTry(X,Y))return s.of(new k(Y,void 0));return $L(X,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return j(0);return this.min<0?this.max:this.min}isLastChanceTry(X,Y){if(X>0)return X===Y+j(1)&&X>this.min;if(X<0)return X===Y-j(1)&&X<this.max;return!1}static isValidContext(X,Y){if(Y===void 0)return!1;if(typeof Y!=="bigint")throw Error("Invalid context type passed to BigIntArbitrary (#1)");let J=X>0&&Y<0||X<0&&Y>0;if(Y!==j(0)&&J)throw Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function pg(Q){let Y=j(-1)<<j(255),J=(j(1)<<j(255))-j(1),$=Q.min,Z=Q.max;return{min:$!==void 0?$:Y-(Z!==void 0&&Z<j(0)?Z*Z:j(0)),max:Z!==void 0?Z:J+($!==void 0&&$>j(0)?$*$:j(0))}}function cg(Q){if(Q[0]===void 0)return{};if(Q[1]===void 0)return Q[0];return{min:Q[0],max:Q[1]}}function e4(...Q){let X=pg(cg(Q));if(X.min>X.max)throw Error("fc.bigInt expects max to be greater than or equal to min");return new dg(X.min,X.max)}var fg=Object.getPrototypeOf,$X=class extends C0{constructor(Q){super();this.arb=Q}generate(Q,X){return this.arb.generate(Q,void 0)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){return this.arb.shrink(Q,X)}};function w2(Q){if(fg(Q)===$X.prototype&&Q.generate===$X.prototype.generate&&Q.canShrinkWithoutContext===$X.prototype.canShrinkWithoutContext&&Q.shrink===$X.prototype.shrink)return Q;return new $X(Q)}function ug(Q){return Q===1}function lg(Q){if(typeof Q!=="boolean")throw Error("Unsupported input type");return Q===!0?1:0}function BX(){return w2(O0({min:0,max:1}).map(ug,lg))}var KX=Object.is,rg=class{constructor(Q){this.values=Q,this.fastValues=new W9(this.values);let X=!1,Y=!1;if(A2(this.fastValues,0))for(let J=0;J!==this.values.length;++J){let $=this.values[J];X=X||KX($,-0),Y=Y||KX($,0)}this.hasMinusZero=X,this.hasPlusZero=Y}has(Q){if(Q===0){if(KX(Q,0))return this.hasPlusZero;return this.hasMinusZero}return A2(this.fastValues,Q)}},bP=class extends C0{constructor(Q){super();this.values=Q}generate(Q,X){let Y=this.values.length===1?0:Q.nextInt(0,this.values.length-1),J=this.values[Y];if(!s6(J))return new k(J,Y);return new k(J,Y,()=>J[r0]())}canShrinkWithoutContext(Q){if(this.values.length===1)return KX(this.values[0],Q);if(this.fastValues===void 0)this.fastValues=new rg(this.values);return this.fastValues.has(Q)}shrink(Q,X){if(X===0||KX(Q,this.values[0]))return s.nil();return s.of(new k(this.values[0],0))}};function m8(...Q){if(Q.length===0)throw Error("fc.constantFrom expects at least one parameter");return new bP(Q)}function og(Q){if(!Q||!Q.withBigInt)return m8(!1,null,void 0,0,"",NaN);return m8(!1,null,void 0,0,"",NaN,j(0))}function y0(Q){return new bP([Q])}var ng=class Q{constructor(){this.receivedLogs=[]}log(X){this.receivedLogs.push(X)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[r0](){return new Q}};function ig(){return y0(new ng)}var ag=NaN,sg=Number.isNaN;function gP(Q){return new N2(Q)}function hP(Q){if(!(Q instanceof N2)||Q.constructor!==N2)throw new S("Not a valid value for date unmapper");return M2(Q)}function tg(Q){return(X)=>{return X===Q?new N2(ag):gP(X)}}function eg(Q){return(X)=>{let Y=hP(X);return sg(Y)?Q:Y}}var ZL=Number.isNaN;function mP(Q={}){let X=Q.min!==void 0?M2(Q.min):-8640000000000000,Y=Q.max!==void 0?M2(Q.max):8640000000000000,J=Q.noInvalidDate;if(ZL(X))throw Error("fc.date min must be valid instance of Date");if(ZL(Y))throw Error("fc.date max must be valid instance of Date");if(X>Y)throw Error("fc.date max must be greater or equal to min");if(J)return O0({min:X,max:Y}).map(gP,hP);let $=Y+1;return O0({min:X,max:Y+1}).map(tg($),eg($))}var Qh=class extends C0{constructor(Q,X){super();this.startArb=Q,this.chainer=X}generate(Q,X){let Y=[],J=Q.clone(),$=this.startArb.generate(Q,X);Y.push({arbitrary:this.startArb,value:$.value_,context:$.context,clonedMrng:J});while(!0){let G=this.chainer($.value_);if(G===void 0)break;let K=Q.clone();$=G.generate(Q,X),Y.push({arbitrary:G,value:$.value_,context:$.context,clonedMrng:K})}let Z={biasFactor:X,entries:Y,currentShrinkLevel:0};return new k($.value_,Z)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(!this.isSafeContext(X))return s.nil();return new s(this.shrinkIterator(X))}*shrinkIterator(Q){let{entries:X,currentShrinkLevel:Y,biasFactor:J}=Q;for(let $=Y;$<X.length;++$){let Z=X[$],G=Z.arbitrary.shrink(Z.value,Z.context);for(let K of G){let W=X.slice(0,$);W.push({arbitrary:Z.arbitrary,value:K.value_,context:K.context,clonedMrng:Z.clonedMrng});let H=K,_=Z.clonedMrng.clone();while(!0){let D=this.chainer(H.value_);if(D===void 0)break;let U=_.clone(),P=D.generate(_,J);W.push({arbitrary:D,value:P.value_,context:P.context,clonedMrng:U}),H=P}let V=W[W.length-1],q={biasFactor:J,entries:W,currentShrinkLevel:$};yield new k(V.value,q)}}}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"biasFactor"in Q&&"entries"in Q&&"currentShrinkLevel"in Q}};function Xh(Q,X){return new Qh(Q,X)}var Yh=Symbol.iterator,Jh=Array.isArray,$h=Object.is,Zh=class Q extends C0{constructor(X,Y){super();this.arb=X,this.numValues=Y}generate(X,Y){let J=[];if(this.numValues<=0)return this.wrapper(J);for(let $=0;$!==this.numValues-1;++$)x(J,this.arb.generate(X.clone(),Y));return x(J,this.arb.generate(X,Y)),this.wrapper(J)}canShrinkWithoutContext(X){if(!Jh(X)||X.length!==this.numValues)return!1;if(X.length===0)return!0;for(let Y=1;Y<X.length;++Y)if(!$h(X[0],X[Y]))return!1;return this.arb.canShrinkWithoutContext(X[0])}shrink(X,Y){if(X.length===0)return s.nil();return new s(this.shrinkImpl(X,Y!==void 0?Y:[])).map((J)=>this.wrapper(J))}*shrinkImpl(X,Y){let J=Z0(X,(Z,G)=>this.arb.shrink(Z,Y[G])[Yh]()),$=Z0(J,(Z)=>Z.next());while(!$[0].done)yield Z0($,(Z)=>Z.value),$=Z0(J,(Z)=>Z.next())}static makeItCloneable(X,Y){return X[r0]=()=>{let J=[];for(let $=0;$!==Y.length;++$)x(J,Y[$].value);return this.makeItCloneable(J,Y),J},X}wrapper(X){let Y=!1,J=[],$=[];for(let Z=0;Z!==X.length;++Z){let G=X[Z];Y=Y||G.hasToBeCloned,x(J,G.value),x($,G.context)}if(Y)Q.makeItCloneable(J,X);return new k(J,$)}};function Gh(Q,X){return new Zh(Q,X)}var GL=class{constructor(Q){this.isEqual=Q,this.data=[]}tryAdd(Q){for(let X=0;X!==this.data.length;++X)if(this.isEqual(this.data[X],Q))return!1;return x(this.data,Q),!0}size(){return this.data.length}getData(){return this.data}},Kh=Number.isNaN,Wh=class{constructor(Q){this.selector=Q,this.selectedItemsExceptNaN=new W9,this.data=[]}tryAdd(Q){let X=this.selector(Q);if(Kh(X))return x(this.data,Q),!0;let Y=this.selectedItemsExceptNaN.size;if(WX(this.selectedItemsExceptNaN,X),Y!==this.selectedItemsExceptNaN.size)return x(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}},Hh=Object.is,Vh=class{constructor(Q){this.selector=Q,this.selectedItemsExceptMinusZero=new W9,this.data=[],this.hasMinusZero=!1}tryAdd(Q){let X=this.selector(Q);if(Hh(X,-0)){if(this.hasMinusZero)return!1;return x(this.data,Q),this.hasMinusZero=!0,!0}let Y=this.selectedItemsExceptMinusZero.size;if(WX(this.selectedItemsExceptMinusZero,X),Y!==this.selectedItemsExceptMinusZero.size)return x(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}},_h=class{constructor(Q){this.selector=Q,this.selectedItems=new W9,this.data=[]}tryAdd(Q){let X=this.selector(Q),Y=this.selectedItems.size;if(WX(this.selectedItems,X),Y!==this.selectedItems.size)return x(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}};function qh(Q){if(typeof Q.comparator==="function"){if(Q.selector===void 0){let K=Q.comparator,W=(H,_)=>K(H.value_,_.value_);return()=>new GL(W)}let{comparator:J,selector:$}=Q,Z=(K)=>$(K.value_),G=(K,W)=>J(Z(K),Z(W));return()=>new GL(G)}let X=Q.selector||((J)=>J),Y=(J)=>X(J.value_);switch(Q.comparator){case"IsStrictlyEqual":return()=>new Wh(Y);case"SameValueZero":return()=>new _h(Y);case"SameValue":case void 0:return()=>new Vh(Y)}}function e6(Q,X={}){let Y=X.minLength!==void 0?X.minLength:0,J=X.maxLength!==void 0?X.maxLength:t6,$=_X(X.size,Y,J,X.maxLength!==void 0),Z=X.depthIdentifier,G=new yP(Q,Y,$,J,Z,qh(X),[]);if(Y===0)return G;return G.filter((K)=>K.length>=Y)}var{create:Dh,defineProperty:Bh,getOwnPropertyDescriptor:Uh,getPrototypeOf:KL,prototype:Oh}=Object,zh=Reflect.ownKeys;function Fh(Q){let X=Q[1]?Dh(null):{};for(let Y of Q[0])Bh(X,Y[0],{enumerable:!0,configurable:!0,writable:!0,value:Y[1]});return X}function Lh(Q){return Q!==void 0&&!!Q.configurable&&!!Q.enumerable&&!!Q.writable&&Q.get===void 0&&Q.set===void 0}function Ph(Q){if(typeof Q!=="object"||Q===null)throw new S("Incompatible instance received: should be a non-null object");let X=KL(Q)===null,Y=KL(Q)===Oh;if(!X&&!Y)throw new S("Incompatible instance received: should be of exact type Object");let J=Z0(zh(Q),($)=>[$,Uh(Q,$)]);if(!qP(J,([,$])=>Lh($)))throw new S("Incompatible instance received: should contain only c/e/w properties without get/set");return[Z0(J,([$,Z])=>[$,Z.value]),X]}function Rh(Q){return Q[0]}function LK(Q,X,Y={}){let J=!!Y.noNullPrototype;return Q0(e6(Q0(Q,X),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:Rh,depthIdentifier:Y.depthIdentifier}),J?y0(!1):BX()).map(Fh,Ph)}var{POSITIVE_INFINITY:Nh,MAX_SAFE_INTEGER:Mh,isInteger:Ah}=Number,wh=Math.floor,Ch=Math.pow,Th=Math.min,cG=class Q extends C0{static from(X,Y,J){if(X.length===0)throw Error(`${J} expects at least one weighted arbitrary`);let $=0;for(let Z=0;Z!==X.length;++Z){if(X[Z].arbitrary===void 0)throw Error(`${J} expects arbitraries to be specified`);let G=X[Z].weight;if($+=G,!Ah(G))throw Error(`${J} expects weights to be integer values`);if(G<0)throw Error(`${J} expects weights to be superior or equal to 0`)}if($<=0)throw Error(`${J} expects the sum of weights to be strictly superior to 0`);return new Q(X,{depthBias:mg(Y.depthSize,Y.maxDepth!==void 0),maxDepth:Y.maxDepth!==void 0?Y.maxDepth:Nh,withCrossShrink:!!Y.withCrossShrink},UK(Y.depthIdentifier))}constructor(X,Y,J){super();this.warbs=X,this.constraints=Y,this.context=J;let $=0;this.cumulatedWeights=[];for(let Z=0;Z!==X.length;++Z)$+=X[Z].weight,x(this.cumulatedWeights,$);this.totalWeight=$}generate(X,Y){if(this.mustGenerateFirst())return this.safeGenerateForIndex(X,0,Y);let J=X.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let $=0;$!==this.cumulatedWeights.length;++$)if(J<this.cumulatedWeights[$])return this.safeGenerateForIndex(X,$,Y);throw Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(X){return this.canShrinkWithoutContextIndex(X)!==-1}shrink(X,Y){if(Y!==void 0){let $=Y,Z=$.selectedIndex,G=$.originalBias,K=this.warbs[Z].arbitrary.shrink(X,$.originalContext).map((W)=>this.mapIntoValue(Z,W,null,G));if($.clonedMrngForFallbackFirst!==null){if($.cachedGeneratedForFirst===void 0)$.cachedGeneratedForFirst=this.safeGenerateForIndex($.clonedMrngForFallbackFirst,0,G);let W=$.cachedGeneratedForFirst;return s.of(W).join(K)}return K}let J=this.canShrinkWithoutContextIndex(X);if(J===-1)return s.nil();return this.defaultShrinkForFirst(J).join(this.warbs[J].arbitrary.shrink(X,void 0).map(($)=>this.mapIntoValue(J,$,null,void 0)))}defaultShrinkForFirst(X){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(X)||this.warbs[0].fallbackValue===void 0)return s.nil()}finally{--this.context.depth}let Y=new k(this.warbs[0].fallbackValue.default,void 0);return s.of(this.mapIntoValue(0,Y,null,void 0))}canShrinkWithoutContextIndex(X){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(X)?0:-1;try{++this.context.depth;for(let Y=0;Y!==this.warbs.length;++Y){let J=this.warbs[Y];if(J.weight!==0&&J.arbitrary.canShrinkWithoutContext(X))return Y}return-1}finally{--this.context.depth}}mapIntoValue(X,Y,J,$){let Z={selectedIndex:X,originalBias:$,originalContext:Y.context,clonedMrngForFallbackFirst:J};return new k(Y.value,Z)}safeGenerateForIndex(X,Y,J){++this.context.depth;try{let $=this.warbs[Y].arbitrary.generate(X,J),Z=this.mustFallbackToFirstInShrink(Y)?X.clone():null;return this.mapIntoValue(Y,$,Z,J)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(X){return X!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let X=this.constraints.depthBias;if(X<=0||this.warbs[0].weight===0)return 0;let Y=wh(Ch(1+X,this.context.depth))-1;return-Th(this.totalWeight*Y,Mh)||0}};function Ih(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&!("generate"in Q)&&!("arbitrary"in Q)&&!("weight"in Q)}function WL(Q){if(XP(Q))return{arbitrary:Q,weight:1};return Q}function l0(...Q){let X=Q[0];if(Ih(X)){let J=Z0(s0(Q,1),WL);return cG.from(J,X,"fc.oneof")}let Y=Z0(Q,WL);return cG.from(Y,{},"fc.oneof")}var jh=Number.isInteger;function a4(Q){let X=typeof Q==="number"?Q:Q&&Q.max!==void 0?Q.max:2147483647;if(X<0)throw Error("fc.nat value should be greater than or equal to 0");if(!jh(X))throw Error("fc.nat maximum value should be an integer");return new _9(0,X)}var Eh=Object.is;function Sh(Q){let X=0,Y=[];for(let J of Q){let $=X;X=$+J.num;let Z=X-1;Y.push({from:$,to:Z,entry:J})}return Y}function xh(Q,X){let Y=0,J=Q.length;while(J-Y>1){let $=~~((Y+J)/2);if(X<Q[$].from)J=$;else Y=$}return Q[Y]}function vh(Q){let X=Sh(Q);return function(J){let $=xh(X,J);return $.entry.build(J-$.from)}}function kh(Q){let X={mapping:new q4,negativeZeroIndex:void 0},Y=0;for(let J=0;J!==Q.length;++J){let $=Q[J];for(let Z=0;Z!==$.num;++Z){let G=$.build(Z);if(G===0&&1/G===_4.NEGATIVE_INFINITY)X.negativeZeroIndex=Y;else L8(X.mapping,G,Y);++Y}}return X}function yh(Q){let X=null;return function(J){if(X===null)X=kh(Q);let $=Eh(J,-0)?X.negativeZeroIndex:c1(X.mapping,J);if($===void 0)throw new S("Unknown value encountered cannot be built using this mapToConstant");return $}}function bh(Q){if(Q.length===0)throw new S("fc.mapToConstant expects at least one option");let X=0;for(let Y=0;Y!==Q.length;++Y){if(Q[Y].num<0)throw new S("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");X+=Q[Y].num}if(X===0)throw new S("fc.mapToConstant expects at least one choice among options");return X}function q9(...Q){return a4({max:bh(Q)-1}).map(vh(Q),yh(Q))}function dP(Q,X,Y,J){if(X.length===0){if(Y>0)return;return[]}if(J<=0)return;let $=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];while($.length>0){let Z=HP($);for(let G=Z.nextStartIndex;G<=X.length;++G){let K=S0(X,Z.endIndexChunks,G);if(Q.canShrinkWithoutContext(K)){let W=[...Z.chunks,K];if(G===X.length){if(W.length<Y)break;return W}if(x($,{endIndexChunks:Z.endIndexChunks,nextStartIndex:G+1,chunks:Z.chunks}),W.length<J)x($,{endIndexChunks:G,nextStartIndex:G+1,chunks:W});break}}}}function gh(Q){return w0(Q,"")}function pP(Q){return Q.minLength!==void 0?Q.minLength:0}function cP(Q){return Q.maxLength!==void 0?Q.maxLength:t6}function hh(Q,X){return pP(X)<=Q.length&&Q.length<=cP(X)}function mh(Q,X){return function(J){if(typeof J!=="string")throw new S("Unsupported value");let $=dP(Q,J,pP(X),cP(X));if($===void 0)throw new S("Unable to unmap received string");return $}}var fP=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function dh(Q,X,Y){let J;try{J=Y(Q)}catch{return}for(let $ of J)if(!X.canShrinkWithoutContext($))return;return J}function ph(Q,X){let Y=[];for(let J of fP){let $=dh(J,Q,X);if($!==void 0)x(Y,$)}return Y}var HL=new WeakMap;function ch(Q){let X=[];for(let Y of fP){let J=dP(Q,Y,0,t6);if(J!==void 0)x(X,J)}return X}function fh(Q,X){let Y=py(HL,Q);if(Y===void 0)Y=ch(Q),dy(HL,Q,Y);let J=[];for(let $ of Y)if(hh($,X))x(J,$);return J}var uh=[[0,127]],lh=[[0,55295],[57344,1114111]],rh=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6000],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66000,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128000,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],oh=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],VL=String.fromCodePoint,nh=Math.min,ih=Math.max;function fG(Q){if(Q.length===1){let Y=VL(Q[0]);return{num:1,build:()=>Y}}let X=Q[0];return{num:Q[1]-Q[0]+1,build:(Y)=>VL(X+Y)}}function _L(Q,X){let Y=[],J=0,$=0;while(J<Q.length&&$<X.length){let Z=Q[J],G=Z[0],K=Z.length===1?Z[0]:Z[1],W=X[$],H=W[0],_=W.length===1?W[0]:W[1];if(K<H)J+=1;else if(_<G)$+=1;else{let V=ih(G,H),q=nh(K,_);if(Y.length>=1){let D=Y[Y.length-1];if((D.length===1?D[0]:D[1])+1===V)V=D[0],HP(Y)}if(x(Y,V===q?[V]:[V,q]),K<=q)J+=1;if(_<=q)$+=1}}return Y}var qL=Object.create(null);function ah(Q){switch(Q){case"full":return lh;case"ascii":return uh}}function sh(Q,X){let Y=`${Q}:${X}`,J=qL[Y];if(J!==void 0)return J;let $=ah(X),Z=Q==="binary"?$:_L($,rh),G=[];for(let W of Z)x(G,fG(W));if(Q==="grapheme"){let W=_L($,oh);for(let H of W){let _=fG(H);x(G,{num:_.num,build:(V)=>Zb(_.build(V),"NFD")})}}let K=q9(...G);return qL[Y]=K,K}function ZX(Q,X){return sh(Q,X)}function th(Q){if(typeof Q.unit==="object")return Q.unit;switch(Q.unit){case"grapheme":return ZX("grapheme","full");case"grapheme-composite":return ZX("composite","full");case"grapheme-ascii":case void 0:return ZX("grapheme","ascii");case"binary":return ZX("binary","full");case"binary-ascii":return ZX("binary","ascii")}}function d0(Q={}){let X=th(Q),Y=mh(X,Q),J=fh(X,Q);return P0(X,{...Q,experimentalCustomSlices:J}).map(gh,Y)}var uP=Map,PK=String.fromCharCode,RK={num:26,build:(Q)=>PK(Q+97)},eh={num:26,build:(Q)=>PK(Q+65)},lP={num:10,build:(Q)=>PK(Q+48)};function Qm(Q){let X=Fy(Q);return Q!==X?X:`%${HX(H9(Q,0),16)}`}function Xm(Q){if(typeof Q!=="string")throw Error("Unsupported");return decodeURIComponent(Q)}var Ym=()=>d0({unit:"binary",minLength:1,maxLength:1}).map(Qm,Xm),LG=void 0;function Jm(){if(LG===void 0)LG=q9(RK);return LG}var H2=void 0;function uG(Q){if(H2===void 0)H2=new uP;let X=c1(H2,Q);if(X===void 0)X=q9(RK,lP,{num:Q.length,build:(Y)=>Q[Y]}),L8(H2,Q,X);return X}function $m(Q){return q9(RK,eh,lP,{num:Q.length,build:(X)=>Q[X]})}var V2=void 0;function NK(Q){if(V2===void 0)V2=new uP;let X=c1(V2,Q);if(X===void 0)X=l0({weight:10,arbitrary:$m(Q)},{weight:1,arbitrary:Ym()}),L8(V2,Q,X);return X}function B4(Q,X={}){let Y=X.freq===void 0?6:X.freq,J=DP(X,"nil")?X.nil:null,$=[{arbitrary:y0(J),weight:1,fallbackValue:{default:J}},{arbitrary:Q,weight:Y-1}],Z={withCrossShrink:!0,depthSize:X.depthSize,maxDepth:X.maxDepth,depthIdentifier:X.depthIdentifier};return cG.from($,Z,"fc.option")}function Zm(Q){if(Q.length>63)return!1;return Q.length<4||Q[0]!=="x"||Q[1]!=="n"||Q[2]!=="-"||Q[3]!=="-"}var rP=Symbol("adapted-value");function Gm(Q,X){let Y=X(Q.value_);if(!Y.adapted)return Q;return new k(Y.value,rP)}var Km=class extends C0{constructor(Q,X){super();this.sourceArb=Q,this.adapter=X,this.adaptValue=(Y)=>Gm(Y,X)}generate(Q,X){let Y=this.sourceArb.generate(Q,X);return this.adaptValue(Y)}canShrinkWithoutContext(Q){return this.sourceArb.canShrinkWithoutContext(Q)&&!this.adapter(Q).adapted}shrink(Q,X){if(X===rP){if(!this.sourceArb.canShrinkWithoutContext(Q))return s.nil();return this.sourceArb.shrink(Q,void 0).map(this.adaptValue)}return this.sourceArb.shrink(Q,X).map(this.adaptValue)}};function oP(Q,X){return new Km(Q,X)}function Wm([Q,X]){return X===null?Q:`${Q}${X[0]}${X[1]}`}function Hm(Q){if(typeof Q!=="string"||Q.length===0)throw Error("Unsupported");if(Q.length===1)return[Q[0],null];return[Q[0],[S0(Q,1,Q.length-1),Q[Q.length-1]]]}function Vm(Q){let X=uG("");return Q0(X,B4(Q0(d0({unit:uG("-"),size:Q,maxLength:61}),X))).map(Wm,Hm).filter(Zm)}function _m(Q){return`${w0(Q[0],".")}.${Q[1]}`}function qm(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=Q.lastIndexOf(".");return[R1(S0(Q,0,X),"."),S0(Q,X+1)]}function Dm(Q){let[X,Y]=Q,J=Y.length;for(let $=0;$!==X.length;++$)if(J+=1+X[$].length,J>255)return{adapted:!0,value:[s0(X,0,$),Y]};return{adapted:!1,value:Q}}function MK(Q={}){let X=FK(Q.size),Y=DX("-1",X),J=d0({unit:Jm(),minLength:2,maxLength:63,size:Y});return oP(Q0(P0(Vm(X),{size:Y,minLength:1,maxLength:127}),J),Dm).map(_m,qm)}function Bm(Q){let X=Q[0].length;for(let Y=1;Y!==Q.length;++Y)if(X+=1+Q[Y].length,X>64)return{adapted:!0,value:s0(Q,0,Y)};return{adapted:!1,value:Q}}function Um(Q){return w0(Q,".")}function Om(Q){if(typeof Q!=="string")throw Error("Unsupported");return R1(Q,".")}function zm(Q){return`${Q[0]}@${Q[1]}`}function Fm(Q){if(typeof Q!=="string")throw Error("Unsupported");return R1(Q,"@",2)}function Lm(Q={}){return Q0(oP(P0(d0({unit:uG("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:Q.size}),{minLength:1,maxLength:32,size:Q.size}),Bm).map(Um,Om),MK({size:Q.size})).map(zm,Fm)}var{NEGATIVE_INFINITY:Pm,POSITIVE_INFINITY:lG,EPSILON:nP}=_4,AK=j(2146435072)*j(4294967296),Rm=-AK-j(1),DL=4503599627370496,Nm=j(4503599627370495),BL=j("9007199254740992"),rG=new Float64Array(1),UL=new Uint32Array(rG.buffer,rG.byteOffset);function Mm(Q){return rG[0]=Q,[UL[1],UL[0]]}function Am(Q){let{0:X,1:Y}=Mm(Q),J=X>>>31,$=X>>>20&2047,Z=(X&1048575)*4294967296+Y,G=$===0?-1022:$-1023,K=$===0?0:1;return K+=Z*nP,K*=J===0?1:-1,{exponent:G,significand:K}}function OL(Q,X){if(Q===-1022)return j(X*DL);return j((X-1)*DL)+(j(Q+1023)<<j(52))}function wK(Q){if(Q===lG)return AK;if(Q===Pm)return Rm;let X=Am(Q),Y=X.exponent,J=X.significand;if(Q>0||Q===0&&1/Q===lG)return OL(Y,J);else return-OL(Y,-J)-j(1)}function oG(Q){if(Q<0)return-oG(-Q-j(1));if(Q===AK)return lG;if(Q<BL)return _4(Q)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let X=Q-BL,Y=-1021+_4(X>>j(52));return(1+_4(X&Nm)*nP)*2**Y}var zL=Number.isInteger,FL=Object.is,PG=Number.NEGATIVE_INFINITY,RG=Number.POSITIVE_INFINITY;function iP(Q,X,Y,J){let{noDefaultInfinity:$=!1,minExcluded:Z=!1,maxExcluded:G=!1,min:K=$?-X:PG,max:W=$?X:RG}=Q,H=Z?K<-Y?-J:Math.max(K,-Y):K===PG?Math.max(K,-J):Math.max(K,-Y),_=G?W>Y?J:Math.min(W,Y):W===RG?Math.min(W,J):Math.min(W,Y);return{noDefaultInfinity:!1,minExcluded:Z||(K!==PG||Z)&&zL(H),maxExcluded:G||(W!==RG||G)&&zL(_),min:FL(H,-0)?0:H,max:FL(_,0)?-0:_,noNaN:Q.noNaN||!1}}var{NEGATIVE_INFINITY:aP,POSITIVE_INFINITY:sP,MAX_VALUE:wm}=Number,Cm=4503599627370495.5,nG=4503599627370496;function Tm(Q){return iP(Q,wm,Cm,nG)}function Im(Q){return Q===4503599627370496?sP:Q===-4503599627370496?aP:Q}function jm(Q){if(typeof Q!=="number")throw Error("Unsupported type");return Q===sP?nG:Q===aP?-nG:Q}var{isInteger:Em,isNaN:tP,NEGATIVE_INFINITY:Sm,POSITIVE_INFINITY:xm,MAX_VALUE:LL}=Number,vm=NaN;function PL(Q,X){if(tP(Q))throw Error("fc.double constraints."+X+" must be a 64-bit float");return wK(Q)}function km(Q){if(typeof Q!=="number")throw Error("Unsupported type");return wK(Q)}function ym(Q){return!Em(Q)}function RL(Q){let{noDefaultInfinity:X=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:Z=X?-LL:Sm,max:G=X?LL:xm}=Q,K=PL(Z,"min"),W=J?K+j(1):K,H=PL(G,"max"),_=$?H-j(1):H;if(_<W)throw Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Y)return e4({min:W,max:_}).map(oG,km);let V=_>j(0),q=V?W:W-j(1),D=V?_+j(1):_;return e4({min:q,max:D}).map((U)=>{if(_<U||U<W)return vm;else return oG(U)},(U)=>{if(typeof U!=="number")throw Error("Unsupported type");if(tP(U))return _!==D?D:q;return wK(U)})}function j2(Q={}){if(!Q.noInteger)return RL(Q);return RL(Tm(Q)).map(Im,jm).filter(ym)}var{NEGATIVE_INFINITY:bm,POSITIVE_INFINITY:iG}=Number,gm=Math.imul,aG=340282346638528860000000000000000000000,eP=2139095040,hm=-2139095041,sG=new Float32Array(1),mm=new Uint32Array(sG.buffer,sG.byteOffset);function dm(Q){return sG[0]=Q,mm[0]}function pm(Q){let X=dm(Q),Y=X>>>31,J=X>>>23&255,$=X&8388607,Z=J===0?-126:J-127,G=J===0?0:1;return G+=$/8388608,G*=Y===0?1:-1,{exponent:Z,significand:G}}function NL(Q,X){if(Q===-126)return X*8388608;return gm(Q+127,8388608)+(X-1)*8388608}function CK(Q){if(Q===iG)return eP;if(Q===bm)return hm;let X=pm(Q),Y=X.exponent,J=X.significand;if(Q>0||Q===0&&1/Q===iG)return NL(Y,J);else return-NL(Y,-J)-1}function tG(Q){if(Q<0)return-tG(-Q-1);if(Q===eP)return iG;if(Q<16777216)return Q*0.000000000000000000000000000000000000000000001401298464324817;let X=Q-16777216,Y=-125+(X>>23);return(1+(X&8388607)/8388608)*2**Y}var{NEGATIVE_INFINITY:QR,POSITIVE_INFINITY:XR}=Number,cm=aG,fm=8388607.5,eG=8388608;function um(Q){return iP(Q,cm,fm,eG)}function lm(Q){return Q===8388608?XR:Q===-8388608?QR:Q}function rm(Q){if(typeof Q!=="number")throw Error("Unsupported type");return Q===XR?eG:Q===QR?-eG:Q}var{isInteger:om,isNaN:YR}=Number,nm=Math.fround,im=Number.NEGATIVE_INFINITY,am=Number.POSITIVE_INFINITY,sm=NaN;function ML(Q,X){let Y="fc.float constraints."+X+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(YR(Q)||nm(Q)!==Q)throw Error(Y);return CK(Q)}function tm(Q){if(typeof Q!=="number")throw Error("Unsupported type");return CK(Q)}function em(Q){return!om(Q)}function AL(Q){let{noDefaultInfinity:X=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:Z=X?-aG:im,max:G=X?aG:am}=Q,K=ML(Z,"min"),W=J?K+1:K,H=ML(G,"max"),_=$?H-1:H;if(W>_)throw Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Y)return O0({min:W,max:_}).map(tG,tm);let V=_>0?W:W-1,q=_>0?_+1:_;return O0({min:V,max:q}).map((D)=>{if(D>_||D<W)return sm;else return tG(D)},(D)=>{if(typeof D!=="number")throw Error("Unsupported type");if(YR(D))return _!==q?q:V;return CK(D)})}function JR(Q={}){if(!Q.noInteger)return AL(Q);return AL(um(Q)).map(lm,rm).filter(em)}function Qd(Q){return Q.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function $R(Q){return Q.replace(/\*\//g,"*\\/")}var d1=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function C2(Q){let X=4294967295;for(let Y=0;Y<Q.length;++Y){let J=H9(Q,Y);if(J<128)X=d1[X&255^J]^X>>8;else if(J<2048)X=d1[X&255^(192|J>>6&31)]^X>>8,X=d1[X&255^(128|J&63)]^X>>8;else if(J>=55296&&J<57344){let $=H9(Q,++Y);if(J>=56320||$<56320||$>57343||Number.isNaN($))Y-=1,X=d1[X&255^239]^X>>8,X=d1[X&255^191]^X>>8,X=d1[X&255^189]^X>>8;else{let Z=(J&1023)+64,G=$&1023;X=d1[X&255^(240|Z>>8&7)]^X>>8,X=d1[X&255^(128|Z>>2&63)]^X>>8,X=d1[X&255^(128|G>>6&15|(Z&3)<<4)]^X>>8,X=d1[X&255^(128|G&63)]^X>>8}}else X=d1[X&255^(224|J>>12&15)]^X>>8,X=d1[X&255^(128|J>>6&63)]^X>>8,X=d1[X&255^(128|J&63)]^X>>8}return(X|0)+2147483648}var Xd=Object.getPrototypeOf,GX=class extends C0{constructor(Q){super();this.arb=Q}generate(Q,X){return this.arb.generate(Q,X)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){return s.nil()}};function T2(Q){if(Xd(Q)===GX.prototype&&Q.generate===GX.prototype.generate&&Q.canShrinkWithoutContext===GX.prototype.canShrinkWithoutContext&&Q.shrink===GX.prototype.shrink)return Q;return new GX(Q)}var{assign:Yd,keys:Jd}=Object;function ZR(Q){return Q0(T2(O0()),T2(O0({min:1,max:4294967295}))).map(([X,Y])=>{let J=()=>{let $={};return Yd((G,K)=>{let W=b0(G),H=b0(K),_=Q(C2(`${X}${W}`)%Y,C2(`${X}${H}`)%Y);return $[`[${W},${H}]`]=_,_},{toString:()=>{let G=Jd($).sort().map((K)=>`${K} => ${b0($[K])}`).map((K)=>`/* ${$R(K)} */`);return`function(a, b) {
47
+ ${mm(J)}`;return Z}function tL(Q){return aW(Q,o0)}async function eL(Q){let X=[];function Y(G){let W=rL(G);if(typeof W==="string")return W;return X.push(Promise.all([G,W])),"\u2026"}let $=aW(Q,Y);if(X.length===0)return $;let J=new c4(await Promise.all(X));function Z(G){let W=G8(J,G);if(W!==void 0)return W;return o0(G)}return aW(Q,Z)}function QM(Q,X){if(X.runConfiguration.includeErrorInReport)throw new h(Q);let Y=new h(Q,{cause:X.errorInstance});if(!("cause"in Y))hm(Y,{cause:X.errorInstance});return Y}function lm(Q){if(!Q.failed)return;throw QM(tL(Q),Q)}async function om(Q){if(!Q.failed)return;throw QM(await eL(Q),Q)}function rm(Q){if(Q.runConfiguration.asyncReporter)return Q.runConfiguration.asyncReporter(Q);else if(Q.runConfiguration.reporter)return Q.runConfiguration.reporter(Q);else return lm(Q)}async function im(Q){if(Q.runConfiguration.asyncReporter)return Q.runConfiguration.asyncReporter(Q);else if(Q.runConfiguration.reporter)return Q.runConfiguration.reporter(Q);else return om(Q)}function nm(Q,X,Y,$,J){let Z=new iL(Y,X,$,J);for(let G of Z){Q.runBeforeEach();let W=Q.run(G);Q.runAfterEach(),Z.handleResult(W)}return Z.runExecution}async function am(Q,X,Y,$,J){let Z=new iL(Y,X,$,J);for(let G of Z){await Q.runBeforeEach();let W=await Q.run(G);await Q.runAfterEach(),Z.handleResult(W)}return Z.runExecution}function XM(Q,X){if(Q===null||Q===void 0||Q.generate===null||Q.generate===void 0)throw Error("Invalid property encountered, please use a valid property");if(Q.run===null||Q.run===void 0)throw Error("Invalid property encountered, please use a valid property not an arbitrary");let Y=FH({...u8(),...X});if(Y.reporter!==void 0&&Y.asyncReporter!==void 0)throw Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(Y.asyncReporter!==void 0&&!Q.isAsync())throw Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let $=Tm(Q,Y),J=Y.path.length===0||Y.path.indexOf(":")===-1?Y.numRuns:-1,Z=Y.numRuns*Y.maxSkipsPerRun,G=(...K)=>$.shrink(...K),W=new Sm(Y.path.length===0?nL($,Y.seed,Y.randomType,Y.examples):sL(Y.path,v6(aL($,Y.seed,Y.randomType,Y.examples)),G),J,Z),H=!Y.endOnFailure?G:G0.nil;return $.isAsync()?am($,H,W,Y.verbose,Y.markInterruptAsFailure).then((K)=>K.toRunDetails(Y.seed,Y.path,Z,Y)):nm($,H,W,Y.verbose,Y.markInterruptAsFailure).toRunDetails(Y.seed,Y.path,Z,Y)}function sm(Q,X){let Y=XM(Q,X);if(Q.isAsync())return Y.then(im);else rm(Y)}function tm(Q,X){let Y=!Object.prototype.hasOwnProperty.call(Q,"isAsync")?new uL(Q,()=>!0):Q;return X.unbiased===!0?new oL(Y):Y}function YM(Q,X){let Y=FH(typeof X==="number"?{...u8(),numRuns:X}:{...u8(),...X}),$=tm(Q,Y),J=$.shrink.bind($);return(Y.path.length===0?v6(nL($,Y.seed,Y.randomType,Y.examples)):sL(Y.path,v6(aL($,Y.seed,Y.randomType,Y.examples)),J)).take(Y.numRuns).map((Z)=>Z.value_)}function em(Q,X){return[...YM(Q,X)]}function Qd(Q){return(Math.round(Q*100)/100).toFixed(2)}function Xd(Q,X,Y){let $=FH(typeof Y==="number"?{...u8(),numRuns:Y}:{...u8(),...Y}),J={};for(let H of YM(Q,Y)){let K=X(H),V=Array.isArray(K)?K:[K];for(let _ of V)J[_]=(J[_]||0)+1}let Z=Object.entries(J).sort((H,K)=>K[1]-H[1]).map((H)=>[H[0],`${Qd(H[1]*100/$.numRuns)}%`]),G=Z.map((H)=>H[0].length).reduce((H,K)=>Math.max(H,K),0),W=Z.map((H)=>H[1].length).reduce((H,K)=>Math.max(H,K),0);for(let H of Z)$.logger(`${H[0].padEnd(G,".")}..${H[1].padStart(W,".")}`)}var Yd=Object.assign;function sW(Q,X,Y,$){let J=Y(),Z=Q.clone(),G={mrng:Q.clone(),biasFactor:X,history:[]},W=(K)=>{let V=J[G.history.length];if(V!==void 0&&V.arb===K){let q=V.value;return T(G.history,{arb:K,value:q,context:V.context,mrng:V.mrng}),Z=V.mrng.clone(),q}let _=K.generate(Z,X);return T(G.history,{arb:K,value:_.value_,context:_.context,mrng:Z.clone()}),_.value};return new y(Yd((K,...V)=>{return W($(K,V))},{values(){return O0(G.history,(K)=>K.value)},[Z1](){return sW(Q,X,Y,$).value},[l8](){return o0(O0(G.history,(K)=>K.value))}}),G)}var TW=Array.isArray,MN=Object.keys,$d=Object.is;function Jd(Q){let X=new c4;return function($,J){let Z=G8(X,$);if(Z===void 0){let H=$(...J);return f8(X,$,[{args:J,value:H}]),H}let G=Z;for(let H of G)if(Q(J,H.args))return H.value;let W=$(...J);return T(G,{args:J,value:W}),W}}function $M(Q,X){if(Q!==null&&typeof Q==="object"&&X!==null&&typeof X==="object"){if(TW(Q)){if(!TW(X))return!1;if(Q.length!==X.length)return!1}else if(TW(X))return!1;if(MN(Q).length!==MN(X).length)return!1;for(let Y in Q){if(!(Y in X))return!1;if(!$M(Q[Y],X[Y]))return!1}return!0}else return $d(Q,X)}var Zd=class extends g0{constructor(...Q){super(...Q);this.arbitraryCache=Jd($M)}generate(Q,X){return sW(Q,X,()=>[],this.arbitraryCache)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(X===void 0)return G0.nil();let Y=X,$=Y.mrng,J=Y.biasFactor,Z=Y.history;return pL(Z.map((G)=>G.arb),Z.map((G)=>G.value),Z.map((G)=>G.context)).map((G)=>{function W(){let{value:H,context:K}=G;return O0(Z,(V,_)=>({arb:V.arb,value:H[_],context:K[_],mrng:V.mrng}))}return sW($,J,W,this.arbitraryCache)})}};function Gd(){return new Zd}var{floor:Wd,log:wN}=Math;function Hd(Q){return Wd(wN(Q)/wN(2))}function Kd(Q){if(Q===k(0))return k(0);return k(x1(Q).length)}function JM(Q,X,Y){if(Q===X)return[{min:Q,max:X}];if(Q<0&&X>0){let G=Y(-Q),W=Y(X);return[{min:-G,max:W},{min:X-W,max:X},{min:Q,max:Q+G}]}let $=Y(X-Q),J={min:Q,max:Q+$},Z={min:X-$,max:X};return Q<0?[Z,J]:[J,Z]}var{ceil:Vd,floor:_d}=Math;function PN(Q){return _d(Q/2)}function AN(Q){return Vd(Q/2)}function CN(Q,X,Y){let $=Q-X;function*J(){let G=Y?void 0:X,W=Y?$:PN($);for(let H=W;H>0;H=PN(H)){let K=H===$?X:Q-H;yield new y(K,G),G=K}}function*Z(){let G=Y?void 0:X,W=Y?$:AN($);for(let H=W;H<0;H=AN(H)){let K=H===$?X:Q-H;yield new y(K,G),G=K}}return $>0?v6(J()):v6(Z())}var jN=Math.sign,qd=Number.isInteger,Dd=Object.is,u5=class Q extends g0{constructor(X,Y){super();this.min=X,this.max=Y,this.ranges=JM(X,Y,Hd)}generate(X,Y){if(Y===void 0||X.nextInt(1,Y)!==1)return new y(X.nextInt(this.min,this.max),void 0);let $=this.ranges;if($.length===1){let G=$[0];return new y(X.nextInt(G.min,G.max),void 0)}let J=X.nextInt(-2*($.length-1),$.length-2),Z=J<0?$[0]:$[J+1];return new y(X.nextInt(Z.min,Z.max),void 0)}canShrinkWithoutContext(X){return typeof X==="number"&&qd(X)&&!Dd(X,-0)&&this.min<=X&&X<=this.max}shrink(X,Y){if(!Q.isValidContext(X,Y))return CN(X,this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min,!0);if(this.isLastChanceTry(X,Y))return G0.of(new y(Y,void 0));return CN(X,Y,!1)}isLastChanceTry(X,Y){if(X>0)return X===Y+1&&X>this.min;if(X<0)return X===Y-1&&X<this.max;return!1}static isValidContext(X,Y){if(Y===void 0)return!1;if(typeof Y!=="number")throw Error("Invalid context type passed to IntegerArbitrary (#1)");if(Y!==0&&jN(X)!==jN(Y))throw Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},TN=Number.isInteger;function Ud(Q){return{min:Q.min!==void 0?Q.min:-2147483648,max:Q.max!==void 0?Q.max:2147483647}}function A0(Q={}){let X=Ud(Q);if(X.min>X.max)throw Error("fc.integer maximum value should be equal or greater than the minimum one");if(!TN(X.min))throw Error("fc.integer minimum value should be an integer");if(!TN(X.max))throw Error("fc.integer maximum value should be an integer");return new u5(X.min,X.max)}var IN=new Map;function PH(Q){if(Q===void 0)return{depth:0};if(typeof Q!=="string")return Q;let X=G8(IN,Q);if(X!==void 0)return X;let Y={depth:0};return f8(IN,Q,Y),Y}function AH(){return{depth:0}}var Bd=class{constructor(Q,X,Y){this.arb=Q,this.mrng=X,this.biasFactor=Y}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},zd=Math.min,Od=Math.max,Fd=class{constructor(Q,X,Y,$){this.arb=Q,this.mrng=X,this.slices=Y,this.biasFactor=$,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(Q){if(Q!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let X=[];for(let Y=0;Y!==this.slices.length;++Y)if(this.slices[Y].length===Q)T(X,Y);if(X.length===0)return;this.activeSliceIndex=X[this.mrng.nextInt(0,X.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=Q-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new y(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let Q=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=Q.length-1,new y(Q[0],void 0);let X=this.mrng.nextInt(0,Q.length-1),Y=this.mrng.nextInt(0,Q.length-1);return this.nextIndexInSlice=zd(X,Y),this.lastIndexInSlice=Od(X,Y),new y(Q[this.nextIndexInSlice++],void 0)}};function EN(Q,X,Y,$){if($===void 0||Y.length===0||X.nextInt(1,$)!==1)return new Bd(Q,X,$);return new Fd(Q,X,Y,$)}var{floor:Rd,log:SN}=Math,Nd=Array.isArray;function Ld(Q,X){if(Q===X)return Q;return Q+Rd(SN(X-Q)/SN(2))}var ZM=class Q extends g0{constructor(X,Y,$,J,Z,G,W){super();this.arb=X,this.minLength=Y,this.maxGeneratedLength=$,this.maxLength=J,this.setBuilder=G,this.customSlices=W,this.lengthArb=A0({min:Y,max:$}),this.depthContext=PH(Z),this.cachedBiasedMaxLength=Ld(Y,$)}preFilter(X){if(this.setBuilder===void 0)return X;let Y=this.setBuilder();for(let $=0;$!==X.length;++$)Y.tryAdd(X[$]);return Y.getData()}static makeItCloneable(X,Y){return X[Z1]=()=>{let $=[];for(let J=0;J!==Y.length;++J)T($,Y[J].value);return this.makeItCloneable($,Y),$},X}generateNItemsNoDuplicates(X,Y,$,J){let Z=0,G=X(),W=EN(this.arb,$,this.customSlices,J);while(G.size()<Y&&Z<this.maxGeneratedLength){let H=W.next();if(G.tryAdd(H))Z=0;else Z+=1}return G.getData()}safeGenerateNItemsNoDuplicates(X,Y,$,J){let Z=Y-this.cachedBiasedMaxLength;if(Z<=0)return this.generateNItemsNoDuplicates(X,Y,$,J);this.depthContext.depth+=Z;try{return this.generateNItemsNoDuplicates(X,Y,$,J)}finally{this.depthContext.depth-=Z}}generateNItems(X,Y,$){let J=[],Z=EN(this.arb,Y,this.customSlices,$);Z.attemptExact(X);for(let G=0;G!==X;++G)T(J,Z.next());return J}safeGenerateNItems(X,Y,$){let J=X-this.cachedBiasedMaxLength;if(J<=0)return this.generateNItems(X,Y,$);this.depthContext.depth+=J;try{return this.generateNItems(X,Y,$)}finally{this.depthContext.depth-=J}}wrapper(X,Y,$,J){let Z=Y?this.preFilter(X):X,G=!1,W=[],H=[];for(let K=0;K!==Z.length;++K){let V=Z[K];G=G||V.hasToBeCloned,T(W,V.value),T(H,V.context)}if(G)Q.makeItCloneable(W,Z);return new y(W,{shrunkOnce:Y,lengthContext:X.length===Z.length&&$!==void 0?$:void 0,itemsContexts:H,startIndex:J})}generate(X,Y){let $,J;if(Y===void 0)$=this.lengthArb.generate(X,void 0).value;else if(this.minLength===this.maxGeneratedLength)$=this.lengthArb.generate(X,void 0).value,J=Y;else if(X.nextInt(1,Y)!==1)$=this.lengthArb.generate(X,void 0).value;else if(X.nextInt(1,Y)!==1)$=this.lengthArb.generate(X,void 0).value,J=Y;else{let G=this.cachedBiasedMaxLength;$=A0({min:this.minLength,max:G}).generate(X,void 0).value,J=Y}let Z=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,$,X,J):this.safeGenerateNItems($,X,J);return this.wrapper(Z,!1,void 0,0)}canShrinkWithoutContext(X){if(!Nd(X)||this.minLength>X.length||X.length>this.maxLength)return!1;for(let Y=0;Y!==X.length;++Y){if(!(Y in X))return!1;if(!this.arb.canShrinkWithoutContext(X[Y]))return!1}return this.preFilter(O0(X,(Y)=>new y(Y,void 0))).length===X.length}shrinkItemByItem(X,Y,$){let J=[];for(let Z=Y.startIndex;Z<$;++Z)T(J,S6(()=>this.arb.shrink(X[Z],Y.itemsContexts[Z]).map((G)=>{let W=O0($1(X,0,Z),(K,V)=>new y(p5(K),Y.itemsContexts[V])),H=O0($1(X,Z+1),(K,V)=>new y(p5(K),Y.itemsContexts[V+Z+1]));return[[...W,G,...H],void 0,Z]})));return G0.nil().join(...J)}shrinkImpl(X,Y){if(X.length===0)return G0.nil();let $=Y!==void 0?Y:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(X.length,$.lengthContext).drop($.shrunkOnce&&$.lengthContext===void 0&&X.length>this.minLength+1?1:0).map((J)=>{let Z=X.length-J.value;return[O0($1(X,Z),(G,W)=>new y(p5(G),$.itemsContexts[W+Z])),J.context,0]}).join(S6(()=>X.length>this.minLength?this.shrinkItemByItem(X,$,1):this.shrinkItemByItem(X,$,X.length))).join(X.length>this.minLength?S6(()=>{let J={shrunkOnce:!1,lengthContext:void 0,itemsContexts:$1($.itemsContexts,1),startIndex:0};return this.shrinkImpl($1(X,1),J).filter((Z)=>this.minLength<=Z[0].length+1).map((Z)=>{return[[new y(p5(X[0]),$.itemsContexts[0]),...Z[0]],void 0,0]})}):G0.nil())}shrink(X,Y){return this.shrinkImpl(X,Y).map(($)=>this.wrapper($[0],!0,$[1],$[2]))}},Md=Math.floor,wd=Math.min,S9=2147483647,h5=["xsmall","small","medium","large","xlarge"],Pd=["-4","-3","-2","-1","=","+1","+2","+3","+4"],CH="small";function Ad(Q,X){switch(X){case"xsmall":return Md(1.1*Q)+1;case"small":return 2*Q+10;case"medium":return 11*Q+100;case"large":return 101*Q+1000;case"xlarge":return 1001*Q+1e4;default:throw Error(`Unable to compute lengths based on received size: ${X}`)}}function X7(Q,X){let Y=nX(Pd,Q);if(Y===-1)return Q;let $=nX(h5,X);if($===-1)throw Error(`Unable to offset size based on the unknown defaulted one: ${X}`);let J=$+Y-4;return J<0?h5[0]:J>=h5.length?h5[h5.length-1]:h5[J]}function eX(Q,X,Y,$){let{baseSize:J=CH,defaultSizeToMaxWhenMaxSpecified:Z}=u8()||{},G=Q!==void 0?Q:$&&Z?"max":J;if(G==="max")return Y;let W=X7(G,J);return wd(Ad(X,W),Y)}function Cd(Q,X){if(typeof Q==="number")return 1/Q;let{baseSize:Y=CH,defaultSizeToMaxWhenMaxSpecified:$}=u8()||{},J=Q!==void 0?Q:X&&$?"max":Y;if(J==="max")return 0;switch(X7(J,Y)){case"xsmall":return 1;case"small":return 0.5;case"medium":return 0.25;case"large":return 0.125;case"xlarge":return 0.0625}}function jH(Q){let{baseSize:X=CH}=u8()||{};if(Q===void 0)return X;return X7(Q,X)}function C0(Q,X={}){let Y=X.size,$=X.minLength||0,J=X.maxLength,Z=X.depthIdentifier,G=J!==void 0?J:S9;return new ZM(Q,$,eX(Y,$,G,J!==void 0),G,Z,void 0,X.experimentalCustomSlices||[])}function J3(Q){return Q/k(2)}function vN(Q,X,Y){let $=Q-X;function*J(){let G=Y?void 0:X,W=Y?$:J3($);for(let H=W;H>0;H=J3(H)){let K=Q-H;yield new y(K,G),G=K}}function*Z(){let G=Y?void 0:X,W=Y?$:J3($);for(let H=W;H<0;H=J3(H)){let K=Q-H;yield new y(K,G),G=K}}return $>0?v6(J()):v6(Z())}var jd=class Q extends g0{constructor(X,Y){super();this.min=X,this.max=Y}generate(X,Y){let $=this.computeGenerateRange(X,Y);return new y(X.nextBigInt($.min,$.max),void 0)}computeGenerateRange(X,Y){if(Y===void 0||X.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let $=JM(this.min,this.max,Kd);if($.length===1)return $[0];let J=X.nextInt(-2*($.length-1),$.length-2);return J<0?$[0]:$[J+1]}canShrinkWithoutContext(X){return typeof X==="bigint"&&this.min<=X&&X<=this.max}shrink(X,Y){if(!Q.isValidContext(X,Y))return vN(X,this.defaultTarget(),!0);if(this.isLastChanceTry(X,Y))return G0.of(new y(Y,void 0));return vN(X,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return k(0);return this.min<0?this.max:this.min}isLastChanceTry(X,Y){if(X>0)return X===Y+k(1)&&X>this.min;if(X<0)return X===Y-k(1)&&X<this.max;return!1}static isValidContext(X,Y){if(Y===void 0)return!1;if(typeof Y!=="bigint")throw Error("Invalid context type passed to BigIntArbitrary (#1)");let $=X>0&&Y<0||X<0&&Y>0;if(Y!==k(0)&&$)throw Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function Td(Q){let Y=k(-1)<<k(255),$=(k(1)<<k(255))-k(1),J=Q.min,Z=Q.max;return{min:J!==void 0?J:Y-(Z!==void 0&&Z<k(0)?Z*Z:k(0)),max:Z!==void 0?Z:$+(J!==void 0&&J>k(0)?J*J:k(0))}}function Id(Q){if(Q[0]===void 0)return{};if(Q[1]===void 0)return Q[0];return{min:Q[0],max:Q[1]}}function x6(...Q){let X=Td(Id(Q));if(X.min>X.max)throw Error("fc.bigInt expects max to be greater than or equal to min");return new jd(X.min,X.max)}var Ed=Object.getPrototypeOf,lX=class extends g0{constructor(Q){super();this.arb=Q}generate(Q,X){return this.arb.generate(Q,void 0)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){return this.arb.shrink(Q,X)}};function N3(Q){if(Ed(Q)===lX.prototype&&Q.generate===lX.prototype.generate&&Q.canShrinkWithoutContext===lX.prototype.canShrinkWithoutContext&&Q.shrink===lX.prototype.shrink)return Q;return new lX(Q)}function Sd(Q){return Q===1}function vd(Q){if(typeof Q!=="boolean")throw Error("Unsupported input type");return Q===!0?1:0}function Y7(){return N3(A0({min:0,max:1}).map(Sd,vd))}var iX=Object.is,xd=class{constructor(Q){this.values=Q,this.fastValues=new c8(this.values);let X=!1,Y=!1;if(I6(this.fastValues,0))for(let $=0;$!==this.values.length;++$){let J=this.values[$];X=X||iX(J,-0),Y=Y||iX(J,0)}this.hasMinusZero=X,this.hasPlusZero=Y}has(Q){if(Q===0){if(iX(Q,0))return this.hasPlusZero;return this.hasMinusZero}return I6(this.fastValues,Q)}},GM=class extends g0{constructor(Q){super();this.values=Q}generate(Q,X){let Y=this.values.length===1?0:Q.nextInt(0,this.values.length-1),$=this.values[Y];if(!E9($))return new y($,Y);return new y($,Y,()=>$[Z1]())}canShrinkWithoutContext(Q){if(this.values.length===1)return iX(this.values[0],Q);if(this.fastValues===void 0)this.fastValues=new xd(this.values);return this.fastValues.has(Q)}shrink(Q,X){if(X===0||iX(Q,this.values[0]))return G0.nil();return G0.of(new y(this.values[0],0))}};function D4(...Q){if(Q.length===0)throw Error("fc.constantFrom expects at least one parameter");return new GM(Q)}function bd(Q){if(!Q||!Q.withBigInt)return D4(!1,null,void 0,0,"",NaN);return D4(!1,null,void 0,0,"",NaN,k(0))}function k0(Q){return new GM([Q])}var kd=class Q{constructor(){this.receivedLogs=[]}log(X){this.receivedLogs.push(X)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Z1](){return new Q}};function yd(){return k0(new kd)}var gd=NaN,hd=Number.isNaN;function WM(Q){return new F3(Q)}function HM(Q){if(!(Q instanceof F3)||Q.constructor!==F3)throw new h("Not a valid value for date unmapper");return R3(Q)}function md(Q){return(X)=>{return X===Q?new F3(gd):WM(X)}}function dd(Q){return(X)=>{let Y=HM(X);return hd(Y)?Q:Y}}var xN=Number.isNaN;function KM(Q={}){let X=Q.min!==void 0?R3(Q.min):-8640000000000000,Y=Q.max!==void 0?R3(Q.max):8640000000000000,$=Q.noInvalidDate;if(xN(X))throw Error("fc.date min must be valid instance of Date");if(xN(Y))throw Error("fc.date max must be valid instance of Date");if(X>Y)throw Error("fc.date max must be greater or equal to min");if($)return A0({min:X,max:Y}).map(WM,HM);let J=Y+1;return A0({min:X,max:Y+1}).map(md(J),dd(J))}var pd=class extends g0{constructor(Q,X){super();this.startArb=Q,this.chainer=X}generate(Q,X){let Y=[],$=Q.clone(),J=this.startArb.generate(Q,X);Y.push({arbitrary:this.startArb,value:J.value_,context:J.context,clonedMrng:$});while(!0){let G=this.chainer(J.value_);if(G===void 0)break;let W=Q.clone();J=G.generate(Q,X),Y.push({arbitrary:G,value:J.value_,context:J.context,clonedMrng:W})}let Z={biasFactor:X,entries:Y,currentShrinkLevel:0};return new y(J.value_,Z)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(!this.isSafeContext(X))return G0.nil();return new G0(this.shrinkIterator(X))}*shrinkIterator(Q){let{entries:X,currentShrinkLevel:Y,biasFactor:$}=Q;for(let J=Y;J<X.length;++J){let Z=X[J],G=Z.arbitrary.shrink(Z.value,Z.context);for(let W of G){let H=X.slice(0,J);H.push({arbitrary:Z.arbitrary,value:W.value_,context:W.context,clonedMrng:Z.clonedMrng});let K=W,V=Z.clonedMrng.clone();while(!0){let D=this.chainer(K.value_);if(D===void 0)break;let B=V.clone(),F=D.generate(V,$);H.push({arbitrary:D,value:F.value_,context:F.context,clonedMrng:B}),K=F}let _=H[H.length-1],q={biasFactor:$,entries:H,currentShrinkLevel:J};yield new y(_.value,q)}}}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"biasFactor"in Q&&"entries"in Q&&"currentShrinkLevel"in Q}};function VM(Q,X){return new pd(Q,X)}var fd=Symbol.iterator,cd=Array.isArray,ud=Object.is,ld=class Q extends g0{constructor(X,Y){super();this.arb=X,this.numValues=Y}generate(X,Y){let $=[];if(this.numValues<=0)return this.wrapper($);for(let J=0;J!==this.numValues-1;++J)T($,this.arb.generate(X.clone(),Y));return T($,this.arb.generate(X,Y)),this.wrapper($)}canShrinkWithoutContext(X){if(!cd(X)||X.length!==this.numValues)return!1;if(X.length===0)return!0;for(let Y=1;Y<X.length;++Y)if(!ud(X[0],X[Y]))return!1;return this.arb.canShrinkWithoutContext(X[0])}shrink(X,Y){if(X.length===0)return G0.nil();return new G0(this.shrinkImpl(X,Y!==void 0?Y:[])).map(($)=>this.wrapper($))}*shrinkImpl(X,Y){let $=O0(X,(Z,G)=>this.arb.shrink(Z,Y[G])[fd]()),J=O0($,(Z)=>Z.next());while(!J[0].done)yield O0(J,(Z)=>Z.value),J=O0($,(Z)=>Z.next())}static makeItCloneable(X,Y){return X[Z1]=()=>{let $=[];for(let J=0;J!==Y.length;++J)T($,Y[J].value);return this.makeItCloneable($,Y),$},X}wrapper(X){let Y=!1,$=[],J=[];for(let Z=0;Z!==X.length;++Z){let G=X[Z];Y=Y||G.hasToBeCloned,T($,G.value),T(J,G.context)}if(Y)Q.makeItCloneable($,X);return new y($,J)}};function od(Q,X){return new ld(Q,X)}var bN=class{constructor(Q){this.isEqual=Q,this.data=[]}tryAdd(Q){for(let X=0;X!==this.data.length;++X)if(this.isEqual(this.data[X],Q))return!1;return T(this.data,Q),!0}size(){return this.data.length}getData(){return this.data}},rd=Number.isNaN,id=class{constructor(Q){this.selector=Q,this.selectedItemsExceptNaN=new c8,this.data=[]}tryAdd(Q){let X=this.selector(Q);if(rd(X))return T(this.data,Q),!0;let Y=this.selectedItemsExceptNaN.size;if(aX(this.selectedItemsExceptNaN,X),Y!==this.selectedItemsExceptNaN.size)return T(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}},nd=Object.is,ad=class{constructor(Q){this.selector=Q,this.selectedItemsExceptMinusZero=new c8,this.data=[],this.hasMinusZero=!1}tryAdd(Q){let X=this.selector(Q);if(nd(X,-0)){if(this.hasMinusZero)return!1;return T(this.data,Q),this.hasMinusZero=!0,!0}let Y=this.selectedItemsExceptMinusZero.size;if(aX(this.selectedItemsExceptMinusZero,X),Y!==this.selectedItemsExceptMinusZero.size)return T(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}},sd=class{constructor(Q){this.selector=Q,this.selectedItems=new c8,this.data=[]}tryAdd(Q){let X=this.selector(Q),Y=this.selectedItems.size;if(aX(this.selectedItems,X),Y!==this.selectedItems.size)return T(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}};function td(Q){if(typeof Q.comparator==="function"){if(Q.selector===void 0){let W=Q.comparator,H=(K,V)=>W(K.value_,V.value_);return()=>new bN(H)}let{comparator:$,selector:J}=Q,Z=(W)=>J(W.value_),G=(W,H)=>$(Z(W),Z(H));return()=>new bN(G)}let X=Q.selector||(($)=>$),Y=($)=>X($.value_);switch(Q.comparator){case"IsStrictlyEqual":return()=>new id(Y);case"SameValueZero":return()=>new sd(Y);case"SameValue":case void 0:return()=>new ad(Y)}}function v9(Q,X={}){let Y=X.minLength!==void 0?X.minLength:0,$=X.maxLength!==void 0?X.maxLength:S9,J=eX(X.size,Y,$,X.maxLength!==void 0),Z=X.depthIdentifier,G=new ZM(Q,Y,J,$,Z,td(X),[]);if(Y===0)return G;return G.filter((W)=>W.length>=Y)}var{create:ed,defineProperty:Qp,getOwnPropertyDescriptor:Xp,getPrototypeOf:kN,prototype:Yp}=Object,$p=Reflect.ownKeys;function Jp(Q){let X=Q[1]?ed(null):{},Y=Q[0];for(let $=0;$!==Y.length;++$){let J=Y[$][0];if(J==="__proto__")Qp(X,J,{enumerable:!0,configurable:!0,writable:!0,value:Y[$][1]});else X[J]=Y[$][1]}return X}function Zp(Q){return Q!==void 0&&!!Q.configurable&&!!Q.enumerable&&!!Q.writable&&Q.get===void 0&&Q.set===void 0}function Gp(Q){if(typeof Q!=="object"||Q===null)throw new h("Incompatible instance received: should be a non-null object");let X=kN(Q)===null,Y=kN(Q)===Yp;if(!X&&!Y)throw new h("Incompatible instance received: should be of exact type Object");let $=O0($p(Q),(J)=>[J,Xp(Q,J)]);if(!hL($,([,J])=>Zp(J)))throw new h("Incompatible instance received: should contain only c/e/w properties without get/set");return[O0($,([J,Z])=>[J,Z.value]),X]}function Wp(Q){return Q[0]}function TH(Q,X,Y={}){let $=!!Y.noNullPrototype;return Z0(v9(Z0(Q,X),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:Wp,depthIdentifier:Y.depthIdentifier}),$?k0(!1):Y7()).map(Jp,Gp)}var{POSITIVE_INFINITY:Hp,MAX_SAFE_INTEGER:Kp,isInteger:Vp}=Number,_p=Math.floor,qp=Math.pow,Dp=Math.min,tW=class Q extends g0{static from(X,Y,$){if(X.length===0)throw Error(`${$} expects at least one weighted arbitrary`);let J=0;for(let G=0;G!==X.length;++G){if(X[G].arbitrary===void 0)throw Error(`${$} expects arbitraries to be specified`);let W=X[G].weight;if(J+=W,!Vp(W))throw Error(`${$} expects weights to be integer values`);if(W<0)throw Error(`${$} expects weights to be superior or equal to 0`)}if(J<=0)throw Error(`${$} expects the sum of weights to be strictly superior to 0`);let Z={depthBias:Cd(Y.depthSize,Y.maxDepth!==void 0),maxDepth:Y.maxDepth!==void 0?Y.maxDepth:Hp,withCrossShrink:!!Y.withCrossShrink};return new Q(X,Z,PH(Y.depthIdentifier))}constructor(X,Y,$){super();this.warbs=X,this.constraints=Y,this.context=$;let J=0;this.cumulatedWeights=[];for(let Z=0;Z!==X.length;++Z)J+=X[Z].weight,T(this.cumulatedWeights,J);this.totalWeight=J}generate(X,Y){if(this.mustGenerateFirst())return this.safeGenerateForIndex(X,0,Y);let $=X.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let J=0;J!==this.cumulatedWeights.length;++J)if($<this.cumulatedWeights[J])return this.safeGenerateForIndex(X,J,Y);throw Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(X){return this.canShrinkWithoutContextIndex(X)!==-1}shrink(X,Y){if(Y!==void 0){let J=Y,Z=J.selectedIndex,G=J.originalBias,W=this.warbs[Z].arbitrary.shrink(X,J.originalContext).map((H)=>this.mapIntoValue(Z,H,null,G));if(J.clonedMrngForFallbackFirst!==null){if(J.cachedGeneratedForFirst===void 0)J.cachedGeneratedForFirst=this.safeGenerateForIndex(J.clonedMrngForFallbackFirst,0,G);let H=J.cachedGeneratedForFirst;return G0.of(H).join(W)}return W}let $=this.canShrinkWithoutContextIndex(X);if($===-1)return G0.nil();return this.defaultShrinkForFirst($).join(this.warbs[$].arbitrary.shrink(X,void 0).map((J)=>this.mapIntoValue($,J,null,void 0)))}defaultShrinkForFirst(X){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(X)||this.warbs[0].fallbackValue===void 0)return G0.nil()}finally{--this.context.depth}let Y=new y(this.warbs[0].fallbackValue.default,void 0);return G0.of(this.mapIntoValue(0,Y,null,void 0))}canShrinkWithoutContextIndex(X){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(X)?0:-1;try{++this.context.depth;for(let Y=0;Y!==this.warbs.length;++Y){let $=this.warbs[Y];if($.weight!==0&&$.arbitrary.canShrinkWithoutContext(X))return Y}return-1}finally{--this.context.depth}}mapIntoValue(X,Y,$,J){let Z={selectedIndex:X,originalBias:J,originalContext:Y.context,clonedMrngForFallbackFirst:$};return new y(Y.value,Z)}safeGenerateForIndex(X,Y,$){++this.context.depth;try{let J=this.warbs[Y].arbitrary.generate(X,$),Z=this.mustFallbackToFirstInShrink(Y)?X.clone():null;return this.mapIntoValue(Y,J,Z,$)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(X){return X!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let X=this.constraints.depthBias;if(X<=0||this.warbs[0].weight===0)return 0;let Y=_p(qp(1+X,this.context.depth))-1;return-Dp(this.totalWeight*Y,Kp)||0}};function Up(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&!("generate"in Q)&&!("arbitrary"in Q)&&!("weight"in Q)}function yN(Q){if(jL(Q))return{arbitrary:Q,weight:1};return Q}function J1(...Q){let X=Q[0];if(Up(X)){let $=O0($1(Q,1),yN);return tW.from($,X,"fc.oneof")}let Y=O0(Q,yN);return tW.from(Y,{},"fc.oneof")}var Bp=Number.isInteger;function E6(Q){let X=typeof Q==="number"?Q:Q&&Q.max!==void 0?Q.max:2147483647;if(X<0)throw Error("fc.nat value should be greater than or equal to 0");if(!Bp(X))throw Error("fc.nat maximum value should be an integer");return new u5(0,X)}var zp=Object.is;function Op(Q){let X=0,Y=[];for(let $ of Q){let J=X;X=J+$.num;let Z=X-1;Y.push({from:J,to:Z,entry:$})}return Y}function Fp(Q,X){let Y=0,$=Q.length;while($-Y>1){let J=~~((Y+$)/2);if(X<Q[J].from)$=J;else Y=J}return Q[Y]}function Rp(Q){let X=Op(Q);return function($){let J=Fp(X,$);return J.entry.build($-J.from)}}function Np(Q){let X={mapping:new c4,negativeZeroIndex:void 0},Y=0;for(let $=0;$!==Q.length;++$){let J=Q[$];for(let Z=0;Z!==J.num;++Z){let G=J.build(Z);if(G===0&&1/G===f4.NEGATIVE_INFINITY)X.negativeZeroIndex=Y;else f8(X.mapping,G,Y);++Y}}return X}function Lp(Q){let X=null;return function($){if(X===null)X=Np(Q);let J=zp($,-0)?X.negativeZeroIndex:G8(X.mapping,$);if(J===void 0)throw new h("Unknown value encountered cannot be built using this mapToConstant");return J}}function Mp(Q){if(Q.length===0)throw new h("fc.mapToConstant expects at least one option");let X=0;for(let Y=0;Y!==Q.length;++Y){if(Q[Y].num<0)throw new h("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");X+=Q[Y].num}if(X===0)throw new h("fc.mapToConstant expects at least one choice among options");return X}function l5(...Q){return E6({max:Mp(Q)-1}).map(Rp(Q),Lp(Q))}function _M(Q,X,Y,$){if(X.length===0){if(Y>0)return;return[]}if($<=0)return;let J=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];while(J.length>0){let Z=kL(J);for(let G=Z.nextStartIndex;G<=X.length;++G){let W=d0(X,Z.endIndexChunks,G);if(Q.canShrinkWithoutContext(W)){let H=[...Z.chunks,W];if(G===X.length){if(H.length<Y)break;return H}if(T(J,{endIndexChunks:Z.endIndexChunks,nextStartIndex:G+1,chunks:Z.chunks}),H.length<$)T(J,{endIndexChunks:G,nextStartIndex:G+1,chunks:H});break}}}}function wp(Q){return y0(Q,"")}function qM(Q){return Q.minLength!==void 0?Q.minLength:0}function DM(Q){return Q.maxLength!==void 0?Q.maxLength:S9}function Pp(Q,X){return qM(X)<=Q.length&&Q.length<=DM(X)}function Ap(Q,X){return function($){if(typeof $!=="string")throw new h("Unsupported value");let J=_M(Q,$,qM(X),DM(X));if(J===void 0)throw new h("Unable to unmap received string");return J}}var UM=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function Cp(Q,X,Y){let $;try{$=Y(Q)}catch{return}for(let J of $)if(!X.canShrinkWithoutContext(J))return;return $}function jp(Q,X){let Y=[];for(let $ of UM){let J=Cp($,Q,X);if(J!==void 0)T(Y,J)}return Y}var gN=new WeakMap;function Tp(Q){let X=[];for(let Y of UM){let $=_M(Q,Y,0,S9);if($!==void 0)T(X,$)}return X}function Ip(Q,X){let Y=jh(gN,Q);if(Y===void 0)Y=Tp(Q),Ch(gN,Q,Y);let $=[];for(let J of Y)if(Pp(J,X))T($,J);return $}var Ep=[[0,127]],Sp=[[0,55295],[57344,1114111]],vp=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6000],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66000,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128000,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],xp=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],hN=String.fromCodePoint,bp=Math.min,kp=Math.max;function eW(Q){if(Q.length===1){let Y=hN(Q[0]);return{num:1,build:()=>Y}}let X=Q[0];return{num:Q[1]-Q[0]+1,build:(Y)=>hN(X+Y)}}function mN(Q,X){let Y=[],$=0,J=0;while($<Q.length&&J<X.length){let Z=Q[$],G=Z[0],W=Z.length===1?Z[0]:Z[1],H=X[J],K=H[0],V=H.length===1?H[0]:H[1];if(W<K)$+=1;else if(V<G)J+=1;else{let _=kp(G,K),q=bp(W,V);if(Y.length>=1){let D=Y[Y.length-1];if((D.length===1?D[0]:D[1])+1===_)_=D[0],kL(Y)}if(T(Y,_===q?[_]:[_,q]),W<=q)$+=1;if(V<=q)J+=1}}return Y}var dN=Object.create(null);function yp(Q){switch(Q){case"full":return Sp;case"ascii":return Ep}}function gp(Q,X){let Y=`${Q}:${X}`,$=dN[Y];if($!==void 0)return $;let J=yp(X),Z=Q==="binary"?J:mN(J,vp),G=[];for(let H of Z)T(G,eW(H));if(Q==="grapheme"){let H=mN(J,xp);for(let K of H){let V=eW(K);T(G,{num:V.num,build:(_)=>lh(V.build(_),"NFD")})}}let W=l5(...G);return dN[Y]=W,W}function oX(Q,X){return gp(Q,X)}function hp(Q){if(typeof Q.unit==="object")return Q.unit;switch(Q.unit){case"grapheme":return oX("grapheme","full");case"grapheme-composite":return oX("composite","full");case"grapheme-ascii":case void 0:return oX("grapheme","ascii");case"binary":return oX("binary","full");case"binary-ascii":return oX("binary","ascii")}}function a0(Q={}){let X=hp(Q),Y=Ap(X,Q),$=Ip(X,Q);return C0(X,{...Q,experimentalCustomSlices:$}).map(wp,Y)}var BM=Map,IH=String.fromCharCode,EH={num:26,build:(Q)=>IH(Q+97)},mp={num:26,build:(Q)=>IH(Q+65)},zM={num:10,build:(Q)=>IH(Q+48)};function dp(Q){let X=Jh(Q);return Q!==X?X:`%${sX(f5(Q,0),16)}`}function pp(Q){if(typeof Q!=="string")throw Error("Unsupported");return decodeURIComponent(Q)}var fp=()=>a0({unit:"binary",minLength:1,maxLength:1}).map(dp,pp),IW=void 0;function cp(){if(IW===void 0)IW=l5(EH);return IW}var Z3=void 0;function QH(Q){if(Z3===void 0)Z3=new BM;let X=G8(Z3,Q);if(X===void 0)X=l5(EH,zM,{num:Q.length,build:(Y)=>Q[Y]}),f8(Z3,Q,X);return X}function up(Q){return l5(EH,mp,zM,{num:Q.length,build:(X)=>Q[X]})}var G3=void 0;function SH(Q){if(G3===void 0)G3=new BM;let X=G8(G3,Q);if(X===void 0)X=J1({weight:10,arbitrary:up(Q)},{weight:1,arbitrary:fp()}),f8(G3,Q,X);return X}function l4(Q,X={}){let Y=X.freq===void 0?6:X.freq,$=mL(X,"nil")?X.nil:null,J=[{arbitrary:k0($),weight:1,fallbackValue:{default:$}},{arbitrary:Q,weight:Y-1}],Z={withCrossShrink:!0,depthSize:X.depthSize,maxDepth:X.maxDepth,depthIdentifier:X.depthIdentifier};return tW.from(J,Z,"fc.option")}function lp(Q){if(Q.length>63)return!1;return Q.length<4||Q[0]!=="x"||Q[1]!=="n"||Q[2]!=="-"||Q[3]!=="-"}var OM=Symbol("adapted-value");function op(Q,X){let Y=X(Q.value_);if(!Y.adapted)return Q;return new y(Y.value,OM)}var rp=class extends g0{constructor(Q,X){super();this.sourceArb=Q,this.adapter=X,this.adaptValue=(Y)=>op(Y,X)}generate(Q,X){let Y=this.sourceArb.generate(Q,X);return this.adaptValue(Y)}canShrinkWithoutContext(Q){return this.sourceArb.canShrinkWithoutContext(Q)&&!this.adapter(Q).adapted}shrink(Q,X){if(X===OM){if(!this.sourceArb.canShrinkWithoutContext(Q))return G0.nil();return this.sourceArb.shrink(Q,void 0).map(this.adaptValue)}return this.sourceArb.shrink(Q,X).map(this.adaptValue)}};function FM(Q,X){return new rp(Q,X)}function ip([Q,X]){return X===null?Q:`${Q}${X[0]}${X[1]}`}function np(Q){if(typeof Q!=="string"||Q.length===0)throw Error("Unsupported");if(Q.length===1)return[Q[0],null];return[Q[0],[d0(Q,1,Q.length-1),Q[Q.length-1]]]}function ap(Q){let X=QH("");return Z0(X,l4(Z0(a0({unit:QH("-"),size:Q,maxLength:61}),X))).map(ip,np).filter(lp)}function sp(Q){return`${y0(Q[0],".")}.${Q[1]}`}function tp(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=Q.lastIndexOf(".");return[b1(d0(Q,0,X),"."),d0(Q,X+1)]}function ep(Q){let[X,Y]=Q,$=Y.length;for(let J=0;J!==X.length;++J)if($+=1+X[J].length,$>255)return{adapted:!0,value:[$1(X,0,J),Y]};return{adapted:!1,value:Q}}function vH(Q={}){let X=jH(Q.size),Y=X7("-1",X),$=a0({unit:cp(),minLength:2,maxLength:63,size:Y});return FM(Z0(C0(ap(X),{size:Y,minLength:1,maxLength:127}),$),ep).map(sp,tp)}function Qf(Q){let X=Q[0].length;for(let Y=1;Y!==Q.length;++Y)if(X+=1+Q[Y].length,X>64)return{adapted:!0,value:$1(Q,0,Y)};return{adapted:!1,value:Q}}function Xf(Q){return y0(Q,".")}function Yf(Q){if(typeof Q!=="string")throw Error("Unsupported");return b1(Q,".")}function $f(Q){return`${Q[0]}@${Q[1]}`}function Jf(Q){if(typeof Q!=="string")throw Error("Unsupported");return b1(Q,"@",2)}function Zf(Q={}){return Z0(FM(C0(a0({unit:QH("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:Q.size}),{minLength:1,maxLength:32,size:Q.size}),Qf).map(Xf,Yf),vH({size:Q.size})).map($f,Jf)}var{NEGATIVE_INFINITY:Gf,POSITIVE_INFINITY:XH,EPSILON:RM}=f4,xH=k(2146435072)*k(4294967296),Wf=-xH-k(1),pN=4503599627370496,Hf=k(4503599627370495),fN=k("9007199254740992"),YH=new Float64Array(1),cN=new Uint32Array(YH.buffer,YH.byteOffset);function Kf(Q){return YH[0]=Q,[cN[1],cN[0]]}function Vf(Q){let{0:X,1:Y}=Kf(Q),$=X>>>31,J=X>>>20&2047,Z=(X&1048575)*4294967296+Y,G=J===0?-1022:J-1023,W=J===0?0:1;return W+=Z*RM,W*=$===0?1:-1,{exponent:G,significand:W}}function uN(Q,X){if(Q===-1022)return k(X*pN);return k((X-1)*pN)+(k(Q+1023)<<k(52))}function bH(Q){if(Q===XH)return xH;if(Q===Gf)return Wf;let X=Vf(Q),Y=X.exponent,$=X.significand;if(Q>0||Q===0&&1/Q===XH)return uN(Y,$);else return-uN(Y,-$)-k(1)}function $H(Q){if(Q<0)return-$H(-Q-k(1));if(Q===xH)return XH;if(Q<fN)return f4(Q)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let X=Q-fN,Y=-1021+f4(X>>k(52));return(1+f4(X&Hf)*RM)*2**Y}var lN=Number.isInteger,oN=Object.is,EW=Number.NEGATIVE_INFINITY,SW=Number.POSITIVE_INFINITY;function NM(Q,X,Y,$){let{noDefaultInfinity:J=!1,minExcluded:Z=!1,maxExcluded:G=!1,min:W=J?-X:EW,max:H=J?X:SW}=Q,K=Z?W<-Y?-$:Math.max(W,-Y):W===EW?Math.max(W,-$):Math.max(W,-Y),V=G?H>Y?$:Math.min(H,Y):H===SW?Math.min(H,$):Math.min(H,Y);return{noDefaultInfinity:!1,minExcluded:Z||(W!==EW||Z)&&lN(K),maxExcluded:G||(H!==SW||G)&&lN(V),min:oN(K,-0)?0:K,max:oN(V,0)?-0:V,noNaN:Q.noNaN||!1}}var{NEGATIVE_INFINITY:LM,POSITIVE_INFINITY:MM,MAX_VALUE:_f}=Number,qf=4503599627370495.5,wM=4503599627370496;function Df(Q){return NM(Q,_f,qf,wM)}function Uf(Q){return Q===4503599627370496?MM:Q===-4503599627370496?LM:Q}function Bf(Q){if(typeof Q!=="number")throw Error("Unsupported type");return Q===MM?wM:Q===LM?-4503599627370496:Q}var{isInteger:zf,isNaN:PM,NEGATIVE_INFINITY:Of,POSITIVE_INFINITY:Ff,MAX_VALUE:rN}=Number,Rf=NaN;function iN(Q,X){if(PM(Q))throw Error("fc.double constraints."+X+" must be a 64-bit float");return bH(Q)}function Nf(Q){if(typeof Q!=="number")throw Error("Unsupported type");return bH(Q)}function Lf(Q){return!zf(Q)}function nN(Q){let{noDefaultInfinity:X=!1,noNaN:Y=!1,minExcluded:$=!1,maxExcluded:J=!1,min:Z=X?-rN:Of,max:G=X?rN:Ff}=Q,W=iN(Z,"min"),H=$?W+k(1):W,K=iN(G,"max"),V=J?K-k(1):K;if(V<H)throw Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Y)return x6({min:H,max:V}).map($H,Nf);let _=V>k(0),q=_?H:H-k(1),D=_?V+k(1):V;return x6({min:q,max:D}).map((B)=>{if(V<B||B<H)return Rf;else return $H(B)},(B)=>{if(typeof B!=="number")throw Error("Unsupported type");if(PM(B))return V!==D?D:q;return bH(B)})}function A3(Q={}){if(!Q.noInteger)return nN(Q);return nN(Df(Q)).map(Uf,Bf).filter(Lf)}var{NEGATIVE_INFINITY:Mf,POSITIVE_INFINITY:JH}=Number,wf=Math.imul,ZH=340282346638528860000000000000000000000,AM=2139095040,Pf=-2139095041,GH=new Float32Array(1),Af=new Uint32Array(GH.buffer,GH.byteOffset);function Cf(Q){return GH[0]=Q,Af[0]}function jf(Q){let X=Cf(Q),Y=X>>>31,$=X>>>23&255,J=X&8388607,Z=$===0?-126:$-127,G=$===0?0:1;return G+=J/8388608,G*=Y===0?1:-1,{exponent:Z,significand:G}}function aN(Q,X){if(Q===-126)return X*8388608;return wf(Q+127,8388608)+(X-1)*8388608}function kH(Q){if(Q===JH)return AM;if(Q===Mf)return Pf;let X=jf(Q),Y=X.exponent,$=X.significand;if(Q>0||Q===0&&1/Q===JH)return aN(Y,$);else return-aN(Y,-$)-1}function WH(Q){if(Q<0)return-WH(-Q-1);if(Q===AM)return JH;if(Q<16777216)return Q*0.000000000000000000000000000000000000000000001401298464324817;let X=Q-16777216,Y=-125+(X>>23);return(1+(X&8388607)/8388608)*2**Y}var{NEGATIVE_INFINITY:CM,POSITIVE_INFINITY:jM}=Number,Tf=ZH,If=8388607.5,TM=8388608;function Ef(Q){return NM(Q,Tf,If,TM)}function Sf(Q){return Q===8388608?jM:Q===-8388608?CM:Q}function vf(Q){if(typeof Q!=="number")throw Error("Unsupported type");return Q===jM?TM:Q===CM?-8388608:Q}var{isInteger:xf,isNaN:IM}=Number,bf=Math.fround,kf=Number.NEGATIVE_INFINITY,yf=Number.POSITIVE_INFINITY,gf=NaN;function sN(Q,X){let Y="fc.float constraints."+X+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(IM(Q)||bf(Q)!==Q)throw Error(Y);return kH(Q)}function hf(Q){if(typeof Q!=="number")throw Error("Unsupported type");return kH(Q)}function mf(Q){return!xf(Q)}function tN(Q){let{noDefaultInfinity:X=!1,noNaN:Y=!1,minExcluded:$=!1,maxExcluded:J=!1,min:Z=X?-ZH:kf,max:G=X?ZH:yf}=Q,W=sN(Z,"min"),H=$?W+1:W,K=sN(G,"max"),V=J?K-1:K;if(H>V)throw Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Y)return A0({min:H,max:V}).map(WH,hf);let _=V>0?H:H-1,q=V>0?V+1:V;return A0({min:_,max:q}).map((D)=>{if(D>V||D<H)return gf;else return WH(D)},(D)=>{if(typeof D!=="number")throw Error("Unsupported type");if(IM(D))return V!==q?q:_;return kH(D)})}function EM(Q={}){if(!Q.noInteger)return tN(Q);return tN(Ef(Q)).map(Sf,vf).filter(mf)}function df(Q){return Q.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function SM(Q){return Q.replace(/\*\//g,"*\\/")}var J8=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function L3(Q){let X=4294967295;for(let Y=0;Y<Q.length;++Y){let $=f5(Q,Y);if($<128)X=J8[X&255^$]^X>>8;else if($<2048)X=J8[X&255^(192|$>>6&31)]^X>>8,X=J8[X&255^(128|$&63)]^X>>8;else if($>=55296&&$<57344){let J=f5(Q,++Y);if($>=56320||J<56320||J>57343||Number.isNaN(J))Y-=1,X=J8[X&255^239]^X>>8,X=J8[X&255^191]^X>>8,X=J8[X&255^189]^X>>8;else{let Z=($&1023)+64,G=J&1023;X=J8[X&255^(240|Z>>8&7)]^X>>8,X=J8[X&255^(128|Z>>2&63)]^X>>8,X=J8[X&255^(128|G>>6&15|(Z&3)<<4)]^X>>8,X=J8[X&255^(128|G&63)]^X>>8}}else X=J8[X&255^(224|$>>12&15)]^X>>8,X=J8[X&255^(128|$>>6&63)]^X>>8,X=J8[X&255^(128|$&63)]^X>>8}return(X|0)+2147483648}var pf=Object.getPrototypeOf,rX=class extends g0{constructor(Q){super();this.arb=Q}generate(Q,X){return this.arb.generate(Q,X)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){return G0.nil()}};function M3(Q){if(pf(Q)===rX.prototype&&Q.generate===rX.prototype.generate&&Q.canShrinkWithoutContext===rX.prototype.canShrinkWithoutContext&&Q.shrink===rX.prototype.shrink)return Q;return new rX(Q)}var{assign:ff,keys:cf}=Object;function vM(Q){return Z0(M3(A0()),M3(A0({min:1,max:4294967295}))).map(([X,Y])=>{let $=()=>{let J={};return ff((G,W)=>{let H=o0(G),K=o0(W),V=Q(L3(`${X}${H}`)%Y,L3(`${X}${K}`)%Y);return J[`[${H},${K}]`]=V,V},{toString:()=>{let G=cf(J).sort().map((W)=>`${W} => ${o0(J[W])}`).map((W)=>`/* ${SM(W)} */`);return`function(a, b) {
48
48
  // With hash and stringify coming from fast-check${G.length!==0?`
49
- ${w0(G,`
49
+ ${y0(G,`
50
50
  `)}`:""}
51
51
  const cmp = ${Q};
52
52
  const hA = hash('${X}' + stringify(a)) % ${Y};
53
53
  const hB = hash('${X}' + stringify(b)) % ${Y};
54
54
  return cmp(hA, hB);
55
- }`},[r0]:J})};return J()})}var $d=Object.assign;function Zd(){return ZR($d((Q,X)=>Q<X,{toString(){return"(hA, hB) => hA < hB"}}))}var Gd=Object.assign;function Kd(){return ZR(Gd((Q,X)=>Q-X,{toString(){return"(hA, hB) => hA - hB"}}))}var{defineProperties:Wd,keys:Hd}=Object;function Vd(Q){return Q0(P0(Q,{minLength:1}),T2(O0())).map(([X,Y])=>{let J=()=>{let $={},Z=(...K)=>{let W=b0(K),H=X[C2(`${Y}${W}`)%X.length];return $[W]=H,s6(H)?H[r0]():H};function G(K){let W=Z0(Z0(_P(Hd($)),(H)=>`${H} => ${b0($[H])}`),(H)=>`/* ${$R(H)} */`);return`function(...args) {
56
- // With hash and stringify coming from fast-check${W.length!==0?`
57
- ${W.join(`
55
+ }`},[Z1]:$})};return $()})}var uf=Object.assign;function lf(){return vM(uf((Q,X)=>Q<X,{toString(){return"(hA, hB) => hA < hB"}}))}var of=Object.assign;function rf(){return vM(of((Q,X)=>Q-X,{toString(){return"(hA, hB) => hA - hB"}}))}var{defineProperties:nf,keys:af}=Object;function sf(Q){return Z0(C0(Q,{minLength:1}),M3(A0())).map(([X,Y])=>{let $=()=>{let J={},Z=(...W)=>{let H=o0(W),K=X[L3(`${Y}${H}`)%X.length];return J[H]=K,E9(K)?K[Z1]():K};function G(W){let H=O0(O0(gL(af(J)),(K)=>`${K} => ${o0(J[K])}`),(K)=>`/* ${SM(K)} */`);return`function(...args) {
56
+ // With hash and stringify coming from fast-check${H.length!==0?`
57
+ ${H.join(`
58
58
  `)}`:""}
59
- const outs = ${K};
59
+ const outs = ${W};
60
60
  return outs[hash('${Y}' + stringify(args)) % outs.length];
61
- }`}return Wd(Z,{toString:{value:()=>G(b0(X))},[R8]:{value:()=>G(b0(X))},[D4]:{value:async()=>G(await qK(X))},[r0]:{value:J,configurable:!0}})};return J()})}var{MIN_SAFE_INTEGER:_d,MAX_SAFE_INTEGER:qd}=Number;function GR(){return new _9(_d,qd)}var Dd=Number.MAX_SAFE_INTEGER;function Bd(){return new _9(0,Dd)}var Ud=Number.parseInt;function Od(Q){let[X,Y]=Q;switch(X){case"oct":return`0${HX(Y,8)}`;case"hex":return`0x${HX(Y,16)}`;default:return`${Y}`}}function O2(Q,X){let Y=Ud(Q,X);if(HX(Y,X)!==Q)throw Error("Invalid value");return Y}function zd(Q){if(typeof Q!=="string")throw Error("Invalid type");if(Q.length>=2&&Q[0]==="0"){if(Q[1]==="x")return["hex",O2(S0(Q,2),16)];return["oct",O2(S0(Q,1),8)]}return["dec",O2(Q,10)]}function Fd(Q){return w0(Q,".")}function Ld(Q){if(typeof Q!=="string")throw Error("Invalid type");return Z0(R1(Q,"."),(X)=>O2(X,10))}function TK(){return Q0(a4(255),a4(255),a4(255),a4(255)).map(Fd,Ld)}function h8(Q){return Q0(m8("dec","oct","hex"),a4(Q)).map(Od,zd)}function NG(Q){return w0(Q,".")}function MG(Q){if(typeof Q!=="string")throw Error("Invalid type");return R1(Q,".")}function KR(){return l0(Q0(h8(255),h8(255),h8(255),h8(255)).map(NG,MG),Q0(h8(255),h8(255),h8(65535)).map(NG,MG),Q0(h8(255),h8(16777215)).map(NG,MG),h8(4294967295))}function IK(Q){if(Q.length===0)return[];else return R1(Q,":")}function jK(Q){let X=R1(Q,":");if(X.length>=2&&X[X.length-1].length<=4)return[s0(X,0,X.length-2),`${X[X.length-2]}:${X[X.length-1]}`];return[s0(X,0,X.length-1),X[X.length-1]]}function Pd(Q){return`${w0(Q[0],":")}:${Q[1]}`}function Rd(Q){if(typeof Q!=="string")throw Error("Invalid type");return jK(Q)}function Nd(Q){return`::${w0(Q[0],":")}:${Q[1]}`}function Md(Q){if(typeof Q!=="string")throw Error("Invalid type");if(!Yb(Q,"::"))throw Error("Invalid value");return jK(S0(Q,2))}function z2(Q){return`${w0(Q[0],":")}::${w0(Q[1],":")}:${Q[2]}`}function F2(Q){if(typeof Q!=="string")throw Error("Invalid type");let[X,Y]=R1(Q,"::",2),[J,$]=jK(Y);return[IK(X),J,$]}function Ad(Q){return z2([Q[0],[Q[1]],Q[2]])}function wd(Q){let X=F2(Q);return[X[0],w0(X[1],":"),X[2]]}function wL(Q){return`${w0(Q[0],":")}::${Q[1]}`}function CL(Q){if(typeof Q!=="string")throw Error("Invalid type");let[X,Y]=R1(Q,"::",2);return[IK(X),Y]}function Cd(Q){return`${w0(Q[0],":")}::`}function Td(Q){if(typeof Q!=="string")throw Error("Invalid type");if(!Jb(Q,"::"))throw Error("Invalid value");return[IK(S0(Q,0,Q.length-2))]}function Id([Q,X]){return`${Q}:${X}`}function jd(Q){if(typeof Q!=="string")throw new S("Invalid type");if(!Q.includes(":"))throw new S("Invalid value");return Q.split(":",2)}var Ed="0123456789abcdef",AG=void 0;function Sd(){if(AG===void 0)AG=O0({min:0,max:15}).map((Q)=>Ed[Q],(Q)=>{if(typeof Q!=="string")throw new S("Not a string");if(Q.length!==1)throw new S("Invalid length");let X=H9(Q,0);if(X<=57)return X-48;if(X<97)throw new S("Invalid character");return X-87});return AG}function WR(){let Q=d0({unit:Sd(),minLength:1,maxLength:4,size:"max"}),X=l0(Q0(Q,Q).map(Id,jd),TK());return l0(Q0(P0(Q,{minLength:6,maxLength:6,size:"max"}),X).map(Pd,Rd),Q0(P0(Q,{minLength:5,maxLength:5,size:"max"}),X).map(Nd,Md),Q0(P0(Q,{minLength:0,maxLength:1,size:"max"}),P0(Q,{minLength:4,maxLength:4,size:"max"}),X).map(z2,F2),Q0(P0(Q,{minLength:0,maxLength:2,size:"max"}),P0(Q,{minLength:3,maxLength:3,size:"max"}),X).map(z2,F2),Q0(P0(Q,{minLength:0,maxLength:3,size:"max"}),P0(Q,{minLength:2,maxLength:2,size:"max"}),X).map(z2,F2),Q0(P0(Q,{minLength:0,maxLength:4,size:"max"}),Q,X).map(Ad,wd),Q0(P0(Q,{minLength:0,maxLength:5,size:"max"}),X).map(wL,CL),Q0(P0(Q,{minLength:0,maxLength:6,size:"max"}),Q).map(wL,CL),Q0(P0(Q,{minLength:0,maxLength:7,size:"max"})).map(Cd,Td))}var xd=class extends C0{constructor(Q){super();this.name=Q,this.underlying=null}generate(Q,X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(Q,X)}canShrinkWithoutContext(Q){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(Q)}shrink(Q,X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(Q,X)}},vd=Object.getOwnPropertyNames;function kd(){let Q=new q4;return(Y)=>{let J=c1(Q,Y);if(J!==void 0)return J;return J=new xd(String(Y)),L8(Q,Y,J),J}}function HR(Q){let X=kd(),Y=Q(X),J=vd(Y);for(let $ of J){let Z=X($);Z.underlying=Y[$]}return Y}function yd(Q,X){for(let Y of Q){let J=X[Y]||{};if(J.maxLength===void 0||J.maxLength>0)return!0}return!1}function bd(Q,X){if(Q.length===0)return y0([]);if(!yd(Q,X))throw new S("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return Q0(...Q.map((Y)=>P0(y0(Y),X[Y]))).map((Y)=>Sy(Y)).filter((Y)=>Y.length>0)}var{assign:TL,create:L2,defineProperty:VR,getPrototypeOf:IL,prototype:gd}=Object;function hd(Q){return VR(L2(null),R8,{configurable:!1,enumerable:!1,writable:!1,value:()=>Q})}function jL(Q,X){return hd(`<${P1(Q)}#${X}>`)}function md(Q,X){let Y=L2(gd);for(let J in Q){let $=Q[J],Z=[];for(let G of $){let K=TL(L2(IL(G)),G);Z.push(K)}Y[J]=Z}for(let J in X){let $=X[J];for(let Z=0;Z!==$.length;++Z){let G=$[Z],K=Y[J][Z];for(let W in G){let H=G[W];K[W]=H.index===void 0?void 0:typeof H.index==="number"?Y[H.type][H.index]:Z0(H.index,(_)=>Y[H.type][_])}VR(K,R8,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let W=Q[J][Z],H=TL(L2(IL(W)),W);for(let _ in G){let V=G[_];H[_]=V.index===void 0?void 0:typeof V.index==="number"?jL(V.type,V.index):Z0(V.index,(q)=>jL(V.type,q))}return b0(H)}})}}return Y}function dd(Q){let X=0,Y=new q4;for(let $ in Q){let Z=Q[$];for(let G in Z){let K=Z[G];if(K.arity!=="inverse")continue;let W=c1(Y,K.type);if(W===void 0)W=new q4,L8(Y,K.type,W);if(ly(W,K.forwardRelationship))throw new S(`Cannot declare multiple inverse relationships for the same forward relationship ${P1(K.forwardRelationship)} on type ${P1(K.type)}`);L8(W,K.forwardRelationship,{type:$,property:G}),X+=1}}let J=new q4;if(X===0)return J;for(let $ in Q){let Z=Q[$],G=c1(Y,$);if(G===void 0)continue;for(let K in Z){let W=Z[K];if(W.arity==="inverse")continue;let H=c1(G,K);if(H===void 0)continue;if(H.type!==W.type)throw new S(`Inverse relationship ${P1(H.property)} on type ${P1(H.type)} references forward relationship ${P1(K)} but types do not match`);L8(J,W,H)}}if(J.size!==X)throw new S("Some inverse relationships could not be matched with their corresponding forward relationships");return J}var EL=Object.create;function pd(Q,X,Y){switch(Q){case"exclusive":return y0(Y);case"successor":return w2(O0({min:X!==void 0?X+1:0,max:Y}));case"any":return w2(O0({min:0,max:Y}))}}function cd(Q,X,Y,J,$,Z,G){let K=pd(X,Y,J);switch(Q){case"0-1":return B4(K,{nil:void 0,depthIdentifier:$}).generate(Z,G).value;case"1":return K.generate(Z,G).value;case"many":{let W=0,H=B4(e6(K,{depthIdentifier:$,selector:(V)=>V===J?V+ ++W:V,minLength:1}),{nil:[],depthIdentifier:$}).generate(Z,G).value,_=0;return Z0(H,(V)=>V===J?V+_++:V)}}}var fd=class extends C0{constructor(Q,X){super();this.relations=Q,this.defaultEntities=X;let Y=new W9,J=new W9;for(let $ in Q){let Z=Q[$];for(let G in Z){let K=Z[G];if(K.arity==="inverse")continue;if(K.strategy==="exclusive"){if(A2(Y,K.type))throw new S(`Cannot mix exclusive with other strategies for type ${P1(K.type)}`);WX(J,K.type)}else{if(A2(J,K.type))throw new S(`Cannot mix exclusive with other strategies for type ${P1(K.type)}`);WX(Y,K.type)}if(K.strategy==="successor"&&K.type!==$)throw new S("Cannot mix types for the strategy successor");if(K.strategy==="successor"&&K.arity==="1")throw new S("Cannot use an arity of 1 for the strategy successor")}}this.inversedRelations=dd(Q)}createEmptyLinksInstanceFor(Q){let X=EL(null),Y=this.relations[Q];for(let J in Y){let $=Y[J];if($.arity==="inverse")X[J]={type:$.type,index:[]}}return X}generate(Q,X){let Y=EL(null);for(let Z in this.relations)Y[Z]=[];let J=[];for(let Z of this.defaultEntities)x(J,{type:Z,indexInType:Y[Z].length,depth:0}),x(Y[Z],this.createEmptyLinksInstanceFor(Z));let $=-1;while(++$<J.length){let Z=J[$],G=this.relations[Z.type],K=Y[Z.type][Z.indexInType],W=OK();W.depth=Z.depth;for(let H in G){let _=G[H];if(_.arity==="inverse")continue;let V=_.type,q=Y[V],D=q.length,U=cd(_.arity,_.strategy||"any",V===Z.type?Z.indexInType:void 0,q.length,W,Q,X);K[H]={type:V,index:U};let P=U===void 0?[]:typeof U==="number"?[U]:U;for(let L of P){if(L>=D)x(J,{type:V,indexInType:L,depth:Z.depth+1}),x(q,this.createEmptyLinksInstanceFor(V));let M=c1(this.inversedRelations,_);if(M!==void 0){let w=q[L][M.property].index;x(w,Z.indexInType)}}}}return J.length=0,new k(Y,void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return s.nil()}};function ud(Q,X){return new fd(Q,X)}var{keys:ld,getOwnPropertySymbols:rd,getOwnPropertyDescriptor:od}=Object;function nd(Q){let X=ld(Q),Y=rd(Q);for(let J=0;J!==Y.length;++J){let $=Y[J],Z=od(Q,$);if(Z&&Z.enumerable)X.push($)}return X}var{create:id,defineProperty:ad,getOwnPropertyDescriptor:sd,getOwnPropertyNames:td,getOwnPropertySymbols:ed}=Object;function Qp(Q,X){return function(J){let $=J[1]?id(null):{};for(let Z=0;Z!==Q.length;++Z){let G=J[0][Z];if(G!==X)ad($,Q[Z],{value:G,configurable:!0,enumerable:!0,writable:!0})}return $}}function Xp(Q,X){return function(J){if(typeof J!=="object"||J===null)throw Error("Incompatible instance received: should be a non-null object");let $=Object.getPrototypeOf(J)===null,Z="constructor"in J&&J.constructor===Object;if(!$&&!Z)throw Error("Incompatible instance received: should be of exact type Object");let G=0,K=[];for(let _=0;_!==Q.length;++_){let V=sd(J,Q[_]);if(V!==void 0){if(!V.configurable||!V.enumerable||!V.writable)throw Error("Incompatible instance received: should contain only c/e/w properties");if(V.get!==void 0||V.set!==void 0)throw Error("Incompatible instance received: should contain only no get/set properties");++G,x(K,V.value)}else x(K,X)}let W=td(J).length,H=ed(J).length;if(G!==W+H)throw Error("Incompatible instance received: should not contain extra properties");return[K,$]}}var wG=Symbol("no-key");function CG(Q,X,Y){let J=nd(Q),$=[];for(let Z=0;Z!==J.length;++Z){let G=J[Z],K=Q[G];if(X===void 0||V4(X,G)!==-1)x($,K);else x($,B4(K,{nil:wG}))}return Q0(Q0(...$),Y?y0(!1):BX()).map(Qp(J,wG),Xp(J,wG))}function QK(Q,X){let Y=X!==void 0&&!!X.noNullPrototype;if(X===void 0)return CG(Q,void 0,Y);if(!(("requiredKeys"in X)&&X.requiredKeys!==void 0))return CG(Q,void 0,Y);let J=("requiredKeys"in X?X.requiredKeys:void 0)||[];for(let $=0;$!==J.length;++$){let Z=Object.getOwnPropertyDescriptor(Q,J[$]);if(Z===void 0)throw Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!Z.enumerable)throw Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return CG(Q,J,Y)}var Yp=Object.create;function Jp(Q,X,Y,J){let $=Yp(null);for(let Z in Q){let G=Q[Z],K=QK(G,J),W=X(Z),H=Y(Z),_={minLength:W,maxLength:W};$[Z]=H!==void 0?e6(K,{..._,selector:H}):P0(K,_)}return QK($)}var{create:SL,keys:$p}=Object;function Zp(Q,X,Y={}){let J=$p(Q),$=Y.initialPoolConstraints||SL(null),Z=Y.unicityConstraints||SL(null),G={noNullPrototype:Y.noNullPrototype};return bd(J,$).chain((K)=>ud(X,K).chain((W)=>Jp(Q,(H)=>W[H].length,(H)=>Z[H],G).map((H)=>md(H,W))))}function Gp(Q){return w0(Z0(Q,(X)=>X[X.length-1]===","?S0(X,0,X.length-1):X)," ")}function Kp(Q){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");let J=[];for(let $ of R1(Y," "))if(Q.canShrinkWithoutContext($))x(J,$);else if(Q.canShrinkWithoutContext($+","))x(J,$+",");else throw Error("Unsupported word");return J}}function Wp(Q){let X=w0(Q," ");if(X[X.length-1]===",")X=S0(X,0,X.length-1);return KK(X[0])+S0(X,1)+"."}function Hp(Q){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");if(Y.length<2||Y[Y.length-1]!=="."||Y[Y.length-2]===","||KK(gG(Y[0]))!==Y[0])throw Error("Unsupported value");let J=gG(Y[0])+S0(Y,1,Y.length-1),$=[],Z=R1(J," ");for(let G=0;G!==Z.length;++G){let K=Z[G];if(Q.canShrinkWithoutContext(K))x($,K);else if(G===Z.length-1&&Q.canShrinkWithoutContext(K+","))x($,K+",");else throw Error("Unsupported word")}return $}}function Vp(Q){return w0(Q," ")}function _p(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=R1(Q,". ");for(let Y=0;Y<X.length-1;++Y)X[Y]+=".";return X}var z=(Q,X)=>{return{arbitrary:y0(Q),weight:X}};function qp(){return l0(z("non",6),z("adipiscing",5),z("ligula",5),z("enim",5),z("pellentesque",5),z("in",5),z("augue",5),z("et",5),z("nulla",5),z("lorem",4),z("sit",4),z("sed",4),z("diam",4),z("fermentum",4),z("ut",4),z("eu",4),z("aliquam",4),z("mauris",4),z("vitae",4),z("felis",4),z("ipsum",3),z("dolor",3),z("amet,",3),z("elit",3),z("euismod",3),z("mi",3),z("orci",3),z("erat",3),z("praesent",3),z("egestas",3),z("leo",3),z("vel",3),z("sapien",3),z("integer",3),z("curabitur",3),z("convallis",3),z("purus",3),z("risus",2),z("suspendisse",2),z("lectus",2),z("nec,",2),z("ultricies",2),z("sed,",2),z("cras",2),z("elementum",2),z("ultrices",2),z("maecenas",2),z("massa,",2),z("varius",2),z("a,",2),z("semper",2),z("proin",2),z("nec",2),z("nisl",2),z("amet",2),z("duis",2),z("congue",2),z("libero",2),z("vestibulum",2),z("pede",2),z("blandit",2),z("sodales",2),z("ante",2),z("nibh",2),z("ac",2),z("aenean",2),z("massa",2),z("suscipit",2),z("sollicitudin",2),z("fusce",2),z("tempus",2),z("aliquam,",2),z("nunc",2),z("ullamcorper",2),z("rhoncus",2),z("metus",2),z("faucibus,",2),z("justo",2),z("magna",2),z("at",2),z("tincidunt",2),z("consectetur",1),z("tortor,",1),z("dignissim",1),z("congue,",1),z("non,",1),z("porttitor,",1),z("nonummy",1),z("molestie,",1),z("est",1),z("eleifend",1),z("mi,",1),z("arcu",1),z("scelerisque",1),z("vitae,",1),z("consequat",1),z("in,",1),z("pretium",1),z("volutpat",1),z("pharetra",1),z("tempor",1),z("bibendum",1),z("odio",1),z("dui",1),z("primis",1),z("faucibus",1),z("luctus",1),z("posuere",1),z("cubilia",1),z("curae,",1),z("hendrerit",1),z("velit",1),z("mauris,",1),z("gravida",1),z("ornare",1),z("ut,",1),z("pulvinar",1),z("varius,",1),z("turpis",1),z("nibh,",1),z("eros",1),z("id",1),z("aliquet",1),z("quis",1),z("lobortis",1),z("consectetuer",1),z("morbi",1),z("vehicula",1),z("tortor",1),z("tellus,",1),z("id,",1),z("eu,",1),z("quam",1),z("feugiat,",1),z("posuere,",1),z("iaculis",1),z("lectus,",1),z("tristique",1),z("mollis,",1),z("nisl,",1),z("vulputate",1),z("sem",1),z("vivamus",1),z("placerat",1),z("imperdiet",1),z("cursus",1),z("rutrum",1),z("iaculis,",1),z("augue,",1),z("lacus",1))}function Dp(Q={}){let{maxCount:X,mode:Y="words",size:J}=Q;if(X!==void 0&&X<1)throw Error("lorem has to produce at least one word/sentence");let $=qp();if(Y==="sentences")return P0(P0($,{minLength:1,size:"small"}).map(Wp,Hp($)),{minLength:1,maxLength:X,size:J}).map(Vp,_p);else return P0($,{minLength:1,maxLength:X,size:J}).map(Gp,Kp($))}function Bp(Q){return new Map(Q)}function Up(Q){if(typeof Q!=="object"||Q===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in Q)||Q.constructor!==Map)throw Error("Incompatible instance received: should be of exact type Map");return Array.from(Q)}function Op(Q){return Q[0]}function XK(Q,X,Y={}){return e6(Q0(Q,X),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:Op,depthIdentifier:Y.depthIdentifier,comparator:"SameValueZero"}).map(Bp,Up)}var _2=10;function zp(Q){let X={};return(Y)=>{let J=Y!==void 0?Y:_2;if(!DP(X,J)){let $=_2;_2=J-1,X[J]=Q(J),_2=$}return X[J]}}function Fp(Q){let X=0;while(Q>j(0)){if(Q&j(1))++X;Q>>=j(1)}return X}function Lp(Q,X){let Y=(j(1)<<j(X))-j(1),J=Q&Y,$=Fp(Q-J),Z=J;for(let G=j(1);G<=Y&&$!==0;G<<=j(1))if(!(Z&G))Z|=G,--$;return Z}function q2(Q,X){let Y=[];for(let J=Q.length-1;J!==-1;--J)if(X(Q[J])!==Q[J])x(Y,J);return Y}function Pp(Q,X,Y){let J=j(0);for(let $=0,Z=j(1);$!==Y.length;++$,Z<<=j(1))if(Q[Y[$]]!==X[Y[$]])J|=Z;return J}function TG(Q,X,Y,J){for(let $=0,Z=j(1);$!==Y.length;++$,Z<<=j(1))if(X&Z)Q[Y[$]]=J(Q[Y[$]])}var Rp=class extends C0{constructor(Q,X,Y){super();this.stringArb=Q,this.toggleCase=X,this.untoggleAll=Y}buildContextFor(Q,X){return{rawString:Q.value,rawStringContext:Q.context,flags:X.value,flagsContext:X.context}}generate(Q,X){let Y=this.stringArb.generate(Q,X),J=[...Y.value],$=q2(J,this.toggleCase),Z=e4(j(0),(j(1)<<j($.length))-j(1)).generate(Q,void 0);return TG(J,Z.value,$,this.toggleCase),new k(w0(J,""),this.buildContextFor(Y,Z))}canShrinkWithoutContext(Q){if(typeof Q!=="string")return!1;return this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(Q)):this.stringArb.canShrinkWithoutContext(Q)}shrink(Q,X){let Y;if(X!==void 0)Y=X;else if(this.untoggleAll!==void 0){let Z=this.untoggleAll(Q),G=[...Q],K=[...Z];Y={rawString:Z,rawStringContext:void 0,flags:Pp(K,G,q2(K,this.toggleCase)),flagsContext:void 0}}else Y={rawString:Q,rawStringContext:void 0,flags:j(0),flagsContext:void 0};let{rawString:J,flags:$}=Y;return this.stringArb.shrink(J,Y.rawStringContext).map((Z)=>{let G=[...Z.value],K=q2(G,this.toggleCase),W=Lp($,K.length);return TG(G,W,K,this.toggleCase),new k(w0(G,""),this.buildContextFor(Z,new k(W,void 0)))}).join(s4(()=>{let Z=[...J],G=q2(Z,this.toggleCase);return e4(j(0),(j(1)<<j(G.length))-j(1)).shrink($,Y.flagsContext).map((K)=>{let W=s0(Z);return TG(W,K.value,G,this.toggleCase),new k(w0(W,""),this.buildContextFor(new k(J,Y.rawStringContext),K))})}))}};function Np(Q){let X=KK(Q);if(X!==Q)return X;return gG(Q)}function Mp(Q,X){return new Rp(Q,X&&X.toggleCase||Np,X&&X.untoggleAll)}function Ap(Q){return GP.from(Q)}function wp(Q){if(!(Q instanceof GP))throw Error("Unexpected type");return[...Q]}function _R(Q={}){return P0(JR(Q),Q).map(Ap,wp)}function Cp(Q){return KP.from(Q)}function Tp(Q){if(!(Q instanceof KP))throw Error("Unexpected type");return[...Q]}function qR(Q={}){return P0(j2(Q),Q).map(Cp,Tp)}function U4(Q,X,Y,J,$){let Z=J.name,{min:G=X,max:K=Y,...W}=Q;if(G>K)throw Error(`Invalid range passed to ${Z}: min must be lower than or equal to max`);if(G<X)throw Error(`Invalid min value passed to ${Z}: min must be greater than or equal to ${X}`);if(K>Y)throw Error(`Invalid max value passed to ${Z}: max must be lower than or equal to ${Y}`);return P0($({min:G,max:K}),W).map((H)=>J.from(H),(H)=>{if(!(H instanceof J))throw Error("Invalid type");return[...H]})}function DR(Q={}){return U4(Q,-32768,32767,qy,O0)}function BR(Q={}){return U4(Q,-2147483648,2147483647,Dy,O0)}function UR(Q={}){return U4(Q,-128,127,_y,O0)}function OR(Q={}){return U4(Q,0,65535,Oy,O0)}function zR(Q={}){return U4(Q,0,4294967295,zy,O0)}function FR(Q={}){return U4(Q,0,255,By,O0)}function LR(Q={}){return U4(Q,0,255,Uy,O0)}function Ip(Q){return Q!==void 0}function xL(Q){if(Q.hasToBeCloned)return new k(Q.value_,{generatorContext:Q.context},()=>Q.value);return new k(Q.value_,{generatorContext:Q.context})}function vL(Q){if(Q.hasToBeCloned)return new k(Q.value_,{shrinkerContext:Q.context},()=>Q.value);return new k(Q.value_,{shrinkerContext:Q.context})}var jp=class extends C0{constructor(Q,X){super();this.generatorArbitrary=Q,this.shrinkerArbitrary=X}generate(Q,X){return xL(this.generatorArbitrary.generate(Q,X))}canShrinkWithoutContext(Q){return this.shrinkerArbitrary.canShrinkWithoutContext(Q)}shrink(Q,X){if(!Ip(X))return this.shrinkerArbitrary.shrink(Q,void 0).map(vL);if("generatorContext"in X)return this.generatorArbitrary.shrink(Q,X.generatorContext).map(xL);return this.shrinkerArbitrary.shrink(Q,X.shrinkerContext).map(vL)}};function YK(Q,X,Y){let J=O0({min:Q,max:X});if(X===Y)return J;return new jp(J,O0({min:Q,max:Y}))}var{min:Ep,max:JK}=Math,kL=$P.isArray,Sp=Object.entries;function xp(Q){let X=-1;for(let Y=0;Y!==Q.length;++Y)X=JK(X,Q[Y][0]);return X}function vp(Q,X){let Y=$P(Q);for(let J=0;J!==X.length;++J){let $=X[J];if($[0]<Q)Y[$[0]]=$[1]}return Y}function PR(Q,X={}){let{size:Y,minNumElements:J=0,maxLength:$=t6,maxNumElements:Z=$,noTrailingHole:G,depthIdentifier:K}=X,W=_X(Y,_X(Y,J,Z,X.maxNumElements!==void 0),$,X.maxLength!==void 0);if(J>$)throw Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(J>Z)throw Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let H=Ep(Z,$),_=X.maxNumElements!==void 0||Y!==void 0?Y:"=",V=e6(Q0(YK(0,JK(W-1,0),JK($-1,0)),Q),{size:_,minLength:J,maxLength:H,selector:(q)=>q[0],depthIdentifier:K}).map((q)=>{return vp(xp(q)+1,q)},(q)=>{if(!kL(q))throw Error("Not supported entry type");if(G&&q.length!==0&&!(q.length-1 in q))throw Error("No trailing hole");return Z0(Sp(q),(D)=>[Number(D[0]),D[1]])});if(G||$===J)return V;return Q0(V,YK(J,W,$)).map((q)=>{let D=q[0],U=q[1];if(D.length>=U)return D;let P=s0(D);return P.length=U,P},(q)=>{if(!kL(q))throw Error("Not supported entry type");return[q,q.length]})}function kp(Q){return new Set(Q)}function yp(Q){if(typeof Q!=="object"||Q===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in Q)||Q.constructor!==Set)throw Error("Incompatible instance received: should be of exact type Set");return Array.from(Q)}function RR(Q,X={}){return e6(Q,{minLength:X.minLength,maxLength:X.maxLength,size:X.size,depthIdentifier:X.depthIdentifier,comparator:"SameValueZero"}).map(kp,yp)}function bp(Q,X,Y,J,$,Z){return LK(Q,X,{maxKeys:Y,noNullPrototype:!Z,size:J,depthIdentifier:$})}function gp(Q){return l0(UR(Q),FR(Q),LR(Q),DR(Q),OR(Q),BR(Q),zR(Q),_R(Q),qR(Q))}function NR(Q){let{values:X,depthSize:Y}=Q,J=OK(),$=Q.maxDepth,Z=Q.maxKeys,G=Q.size,K=l0(...X,...Q.withBigInt?[e4()]:[],...Q.withDate?[mP()]:[]);return HR((W)=>({anything:l0({maxDepth:$,depthSize:Y,depthIdentifier:J},K,W("array"),W("object"),...Q.withMap?[W("map")]:[],...Q.withSet?[W("set")]:[],...Q.withObjectString?[W("anything").map((H)=>b0(H))]:[],...Q.withTypedArray?[gp({maxLength:Z,size:G})]:[],...Q.withSparseArray?[PR(W("anything"),{maxNumElements:Z,size:G,depthIdentifier:J})]:[]),keys:Q.withObjectString?l0({arbitrary:Q.key,weight:10},{arbitrary:W("anything").map((H)=>b0(H)),weight:1}):Q.key,array:P0(W("anything"),{maxLength:Z,size:G,depthIdentifier:J}),set:RR(W("anything"),{maxLength:Z,size:G,depthIdentifier:J}),map:l0(XK(W("keys"),W("anything"),{maxKeys:Z,size:G,depthIdentifier:J}),XK(W("anything"),W("anything"),{maxKeys:Z,size:G,depthIdentifier:J})),object:bp(W("keys"),W("anything"),Z,G,J,Q.withNullPrototype)})).anything}function hp(Q){switch(typeof Q){case"boolean":return new ZP(Q);case"number":return new _4(Q);case"string":return new P1(Q);default:return Q}}function mp(Q){if(typeof Q!=="object"||Q===null||!("constructor"in Q))return Q;return Q.constructor===ZP||Q.constructor===_4||Q.constructor===P1?Q.valueOf():Q}function dp(Q){return Q.map(hp,mp)}function pp(Q,X){return[BX(),GR(),j2(),X(Q),l0(X(Q),y0(null),y0(void 0))]}function cp(Q){return Q.map((X)=>dp(X))}function fp(Q,X){return X?cp(Q).concat(Q):Q}function MR(Q={}){let X={size:Q.size,unit:"stringUnit"in Q?Q.stringUnit:Q.withUnicodeString?"binary":void 0};return{key:Q.key!==void 0?Q.key:d0(X),values:fp(Q.values!==void 0?Q.values:pp(X,d0),Q.withBoxedValues===!0),depthSize:Q.depthSize,maxDepth:Q.maxDepth,maxKeys:Q.maxKeys,size:Q.size,withSet:Q.withSet===!0,withMap:Q.withMap===!0,withObjectString:Q.withObjectString===!0,withNullPrototype:Q.withNullPrototype===!0,withBigInt:Q.withBigInt===!0,withDate:Q.withDate===!0,withTypedArray:Q.withTypedArray===!0,withSparseArray:Q.withSparseArray===!0}}function up(Q){return LK(Q.key,NR(Q),{maxKeys:Q.maxKeys,noNullPrototype:!Q.withNullPrototype,size:Q.size})}function lp(Q){return up(MR(Q))}function rp(Q,X){let{depthSize:Y,maxDepth:J}=X;return{key:Q,values:[BX(),j2({noDefaultInfinity:!0,noNaN:!0}),Q,y0(null)],depthSize:Y,maxDepth:J}}function AR(Q){return NR(MR(Q))}function wR(Q={}){let X=Q.noUnicodeString===void 0||Q.noUnicodeString===!0;return AR(rp("stringUnit"in Q?d0({unit:Q.stringUnit}):X?d0():d0({unit:"binary"}),Q))}var{stringify:op,parse:np}=JSON;function ip(Q){if(typeof Q!=="string")throw new S("Cannot unmap the passed value");return np(Q)}function ap(Q={}){return wR(Q).map(op,ip)}var sp=Object.defineProperties;function IG(Q,X){return`Stream(${X!==void 0?`${w0(X,",")}\u2026`:`${Q} emitted`})`}var tp=class extends C0{constructor(Q,X){super();this.arb=Q,this.history=X}generate(Q,X){let Y=X!==void 0&&Q.nextInt(1,X)===1?X:void 0,J=()=>{let $=this.history?[]:null,Z=0;return sp(new s(function*(K,W){while(!0){let H=K.generate(W,Y).value;if(Z++,$!==null)x($,H);yield H}}(this.arb,Q.clone())),{toString:{value:()=>IG(Z,$!==null?$.map(b0):void 0)},[R8]:{value:()=>IG(Z,$!==null?$.map(b0):void 0)},[D4]:{value:async()=>IG(Z,$!==null?await Promise.all($.map(qK)):void 0)},[r0]:{value:J,enumerable:!0}})};return new k(J(),void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return s.nil()}};function ep(Q,X){return new tp(Q,X!==void 0&&typeof X==="object"&&"noHistory"in X?!X.noHistory:!0)}function Qc(Q){return w0(Q,"")}function yL(Q){if(typeof Q!=="string")throw Error("Cannot unmap the passed value");return[...Q]}function Xc(Q){switch(Q.length%4){case 0:return Q;case 3:return`${Q}=`;case 2:return`${Q}==`;default:return S0(Q,1)}}function Yc(Q){if(typeof Q!=="string"||Q.length%4!==0)throw Error("Invalid string received");let X=Q.indexOf("=");if(X===-1)return Q;if(Q.length-X>2)throw Error("Cannot unmap the passed value");return S0(Q,0,X)}var jG=String.fromCharCode;function Jc(Q){if(Q<26)return jG(Q+65);if(Q<52)return jG(Q+97-26);if(Q<62)return jG(Q+48-52);return Q===62?"+":"/"}function $c(Q){if(typeof Q!=="string"||Q.length!==1)throw new S("Invalid entry");let X=H9(Q,0);if(X>=65&&X<=90)return X-65;if(X>=97&&X<=122)return X-97+26;if(X>=48&&X<=57)return X-48+52;return X===43?62:X===47?63:-1}function Zc(){return O0({min:0,max:63}).map(Jc,$c)}function Gc(Q={}){let{minLength:X=0,maxLength:Y=t6,size:J}=Q,$=X+3-(X+3)%4,Z=Y-Y%4,G=Q.maxLength===void 0&&J===void 0?"=":J;if($>Z)throw new S("Minimal length should be inferior or equal to maximal length");if($%4!==0)throw new S("Minimal length of base64 strings must be a multiple of 4");if(Z%4!==0)throw new S("Maximal length of base64 strings must be a multiple of 4");let K=Zc();return P0(K,{minLength:$,maxLength:Z,size:G,experimentalCustomSlices:ph(K,yL)}).map(Qc,yL).map(Xc,Yc)}var bL=Object.is;function Kc(Q,X){let Y=new q4,J=0;for(let $ of Q)if(bL($,-0))++J;else L8(Y,$,(c1(Y,$)||0)+1);for(let $=0;$!==X.length;++$){if(!($ in X))return!1;let Z=X[$];if(bL(Z,-0)){if(J===0)return!1;--J}else{let G=c1(Y,Z)||0;if(G===0)return!1;L8(Y,Z,G-1)}}return!0}var{floor:Wc,log:gL}=Math,Hc=Array.isArray,CR=class extends C0{constructor(Q,X,Y,J){super();if(this.originalArray=Q,this.isOrdered=X,this.minLength=Y,this.maxLength=J,Y<0||Y>Q.length)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(J<0||J>Q.length)throw Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(Y>J)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new _9(Y,J),this.biasedLengthArb=Y!==J?new _9(Y,Y+Wc(gL(J-Y)/gL(2))):this.lengthArb}generate(Q,X){let Y=(X!==void 0&&Q.nextInt(1,X)===1?this.biasedLengthArb:this.lengthArb).generate(Q,void 0),J=Y.value,$=Z0(this.originalArray,(G,K)=>K),Z=[];for(let G=0;G!==J;++G){let K=Q.nextInt(0,$.length-1);x(Z,$[K]),VP($,K,1)}if(this.isOrdered)_P(Z,(G,K)=>G-K);return new k(Z0(Z,(G)=>this.originalArray[G]),Y.context)}canShrinkWithoutContext(Q){if(!Hc(Q))return!1;if(!this.lengthArb.canShrinkWithoutContext(Q.length))return!1;return Kc(this.originalArray,Q)}shrink(Q,X){if(Q.length===0)return s.nil();return this.lengthArb.shrink(Q.length,X).map((Y)=>{return new k(s0(Q,Q.length-Y.value),Y.context)}).join(Q.length>this.minLength?s4(()=>this.shrink(s0(Q,1),void 0).filter((Y)=>this.minLength<=Y.value.length+1).map((Y)=>new k([Q[0],...Y.value],void 0))):s.nil())}};function Vc(Q,X={}){let{minLength:Y=0,maxLength:J=Q.length}=X;return new CR(Q,!0,Y,J)}function _c(Q,X={}){let{minLength:Y=0,maxLength:J=Q.length}=X;return new CR(Q,!1,Y,J)}var qc={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},Dc={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function Bc(Q){return Q<10?P1(Q):qc[Q]}function hL(Q,X){let Y="";while(Q.length+Y.length<X)Y+="0";return Y+Q}function mL(Q){let X="";for(let Y=Q;Y!==0;){let J=Y>>5;X=Bc(Y-(J<<5))+X,Y=J}return X}function Uc(Q,X){let Y=~~(Q/1073741824),J=Q&1073741823;return hL(mL(Y),X-6)+hL(mL(J),6)}function TR(Q){return function(Y){return Uc(Y,Q)}}function EG(Q){if(typeof Q!=="string")throw new S("Unsupported type");let X=0,Y=1;for(let J=Q.length-1;J>=0;--J){let $=Dc[Q[J]];if($===void 0)throw new S("Unsupported type");X+=$*Y,Y*=32}return X}var Oc=TR(10),dL=TR(8);function zc(Q){return Oc(Q[0])+dL(Q[1])+dL(Q[2])}function Fc(Q){if(typeof Q!=="string"||Q.length!==26)throw Error("Unsupported type");return[EG(Q.slice(0,10)),EG(Q.slice(10,18)),EG(Q.slice(18))]}function Lc(){return Q0(O0({min:0,max:281474976710655}),O0({min:0,max:1099511627775}),O0({min:0,max:1099511627775})).map(zc,Fc)}function IR(Q){return $b(HX(Q,16),8,"0")}function Pc(Q){if(typeof Q!=="string")throw Error("Unsupported type");if(Q.length!==8)throw Error("Unsupported value: invalid length");let X=parseInt(Q,16);if(Q!==IR(X))throw Error("Unsupported value: invalid content");return X}function SG(Q,X){return O0({min:Q,max:X}).map(IR,Pc)}function Rc(Q){return`${Q[0]}-${S0(Q[1],4)}-${S0(Q[1],0,4)}-${S0(Q[2],0,4)}-${S0(Q[2],4)}${Q[3]}`}var Nc=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function Mc(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=Nc.exec(Q);if(X===null)throw Error("Unsupported type");return[X[1],X[3]+X[2],X[4]+S0(X[5],0,4),S0(X[5],4)]}var pL="0123456789abcdef";function Ac(Q){let X={},Y={};for(let Z=0;Z!==Q.length;++Z){let G=pL[Z],K=pL[Q[Z]];X[G]=K,Y[K]=G}function J(Z){return X[Z[0]]+S0(Z,1)}function $(Z){if(typeof Z!=="string")throw new S("Cannot produce non-string values");let G=Y[Z[0]];if(G===void 0)throw new S("Cannot produce strings not starting by the version in hexa code");return G+S0(Z,1)}return{versionsApplierMapper:J,versionsApplierUnmapper:$}}function wc(Q){let X={};for(let Y of Q){if(X[Y])throw new S(`Version ${Y} has been requested at least twice for uuid`);if(X[Y]=!0,Y<1||Y>15)throw new S(`Version must be a value in [1-15] for uuid, but received ${Y}`);if(~~Y!==Y)throw new S(`Version must be an integer value for uuid, but received ${Y}`)}if(Q.length===0)throw new S("Must provide at least one version for uuid")}function Cc(Q={}){let X=SG(0,4294967295),Y=Q.version!==void 0?typeof Q.version==="number"?[Q.version]:Q.version:[1,2,3,4,5,6,7,8];wc(Y);let{versionsApplierMapper:J,versionsApplierUnmapper:$}=Ac(Y);return Q0(X,SG(0,268435456*Y.length-1).map(J,$),SG(2147483648,3221225471),X).map(Rc,Mc)}function Tc(Q){return d0({unit:NK("-._~!$&'()*+,;=:"),size:Q})}function Ic([Q,X,Y]){return(Q===null?"":`${Q}@`)+X+(Y===null?"":`:${Y}`)}function jc(Q){if(typeof Q!=="string")throw Error("Unsupported");let X=Q.indexOf("@"),Y=X!==-1?Q.substring(0,X):null,J=/:(\d+)$/.exec(Q),$=J!==null?Number(J[1]):null;return[Y,J!==null?Q.substring(X+1,Q.length-J[1].length-1):Q.substring(X+1),$]}function Ec(Q){return`[${Q}]`}function Sc(Q){if(typeof Q!=="string"||Q[0]!=="["||Q[Q.length-1]!=="]")throw Error("Unsupported");return Q.substring(1,Q.length-1)}function jR(Q){let X=Q||{},Y=X.size,J=[MK({size:Y}),...X.withIPv4===!0?[TK()]:[],...X.withIPv6===!0?[WR().map(Ec,Sc)]:[],...X.withIPv4Extended===!0?[KR()]:[]];return Q0(X.withUserInfo===!0?B4(Tc(Y)):y0(null),l0(...J),X.withPort===!0?B4(a4(65535)):y0(null)).map(Ic,jc)}function ER(Q){return d0({unit:NK("-._~!$&'()*+,;=:@/?"),size:Q})}function SR(Q={}){return ER(Q.size)}function xR(Q={}){return d0({unit:NK("-._~!$&'()*+,;=:@"),size:Q.size})}function xc(Q){return w0(Z0(Q,(X)=>`/${X}`),"")}function vc(Q){if(typeof Q!=="string")throw Error("Incompatible value received: type");if(Q.length!==0&&Q[0]!=="/")throw Error("Incompatible value received: start");return VP(R1(Q,"/"),1)}function kc(Q){switch(Q){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function xG(Q,X){return P0(xR({size:Q}),{size:X}).map(xc,vc)}function yc(Q){let[X,Y]=kc(Q);if(X===Y)return xG(X,Y);return l0(xG(X,Y),xG(Y,X))}function vR(Q){return yc(FK((Q||{}).size))}function kR(Q={}){return ER(Q.size)}function bc(Q){let[X,Y,J]=Q;return`${X}://${Y}${J}${Q[3]===null?"":`?${Q[3]}`}${Q[4]===null?"":`#${Q[4]}`}`}var gc=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function hc(Q){if(typeof Q!=="string")throw Error("Incompatible value received: type");let X=gc.exec(Q);if(X===null)throw Error("Incompatible value received");let Y=X[1],J=X[2],$=X[3],Z=X[4],G=X[5];return[Y,J,$,Z!==void 0?Z.substring(1):null,G!==void 0?G.substring(1):null]}function mc(Q){let X=Q||{},Y=FK(X.size),J=X.authoritySettings!==void 0&&X.authoritySettings.size!==void 0?DX(X.authoritySettings.size,Y):Y,$={...X.authoritySettings,size:J};return Q0(m8(...X.validSchemes||["http","https"]),jR($),vR({size:Y}),X.withQueryParameters===!0?B4(kR({size:Y})):y0(null),X.withFragments===!0?B4(SR({size:Y})):y0(null)).map(bc,hc)}var dc=class Q{constructor(X,Y){this.commands=X,this.metadataForReplay=Y,this[r0]=function(){return new Q(this.commands.map((J)=>J.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let X=this.commands.filter((J)=>J.hasRan).map((J)=>J.toString()).join(","),Y=this.metadataForReplay();return Y.length!==0?`${X} /*${Y}*/`:X}},pc=class Q{constructor(X){if(this.cmd=X,this.hasRan=!1,VK(X)){let Y=X[R8];this[R8]=function(){return Y.call(X)}}if(_K(X)){let Y=X[D4];this[D4]=function(){return Y.call(X)}}}check(X){return this.cmd.check(X)}run(X,Y){return this.hasRan=!0,this.cmd.run(X,Y)}clone(){if(s6(this.cmd))return new Q(this.cmd[r0]());return new Q(this.cmd)}toString(){return this.cmd.toString()}},cL=class{static parse(Q){let[X,Y]=Q.split(":"),J=this.parseCounts(X),$=this.parseChanges(Y);return this.parseOccurences(J,$)}static stringify(Q){let X=this.countOccurences(Q);return`${this.stringifyCounts(X)}:${this.stringifyChanges(X)}`}static intToB64(Q){if(Q<26)return String.fromCharCode(Q+65);if(Q<52)return String.fromCharCode(Q+97-26);if(Q<62)return String.fromCharCode(Q+48-52);return String.fromCharCode(Q===62?43:47)}static b64ToInt(Q){if(Q>="a")return Q.charCodeAt(0)-97+26;if(Q>="A")return Q.charCodeAt(0)-65;if(Q>="0")return Q.charCodeAt(0)-48+52;return Q==="+"?62:63}static countOccurences(Q){return Q.reduce((X,Y)=>{if(X.length===0||X[X.length-1].count===64||X[X.length-1].value!==Y)X.push({value:Y,count:1});else X[X.length-1].count+=1;return X},[])}static parseOccurences(Q,X){let Y=[];for(let J=0;J!==Q.length;++J){let $=Q[J],Z=X[J];for(let G=0;G!==$;++G)Y.push(Z)}return Y}static stringifyChanges(Q){let X="";for(let Y=0;Y<Q.length;Y+=6){let J=Q.slice(Y,Y+6).reduceRight(($,Z)=>($<<1)+(Z.value?1:0),0);X+=this.intToB64(J)}return X}static parseChanges(Q){let X=Q.split("").map((J)=>this.b64ToInt(J)),Y=[];for(let J=0;J!==X.length;++J){let $=X[J];for(let Z=0;Z!==6;++Z,$>>=1)Y.push($%2===1)}return Y}static stringifyCounts(Q){return Q.map(({count:X})=>this.intToB64(X-1)).join("")}static parseCounts(Q){return Q.split("").map((X)=>this.b64ToInt(X)+1)}},cc=class extends C0{constructor(Q,X,Y,J,$){super();this.sourceReplayPath=J,this.disableReplayLog=$,this.oneCommandArb=l0(...Q).map((Z)=>new pc(Z)),this.lengthArb=YK(0,X,Y),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(cL.stringify(this.replayPath))}`}buildValueFor(Q,X){let Y=Q.map(($)=>$.value_),J={shrunkOnce:X,items:Q};return new k(new dc(Y,()=>this.metadataForReplay()),J)}generate(Q){let X=this.lengthArb.generate(Q,void 0).value,Y=Array(X);for(let J=0;J!==X;++J)Y[J]=this.oneCommandArb.generate(Q,void 0);return this.replayPathPosition=0,this.buildValueFor(Y,!1)}canShrinkWithoutContext(Q){return!1}filterOnExecution(Q){let X=[];for(let Y of Q)if(Y.value_.hasRan)this.replayPath.push(!0),X.push(Y);else this.replayPath.push(!1);return X}filterOnReplay(Q){return Q.filter((X,Y)=>{let J=this.replayPath[this.replayPathPosition+Y];if(J===void 0)throw Error("Too short replayPath");if(!J&&X.value_.hasRan)throw Error("Mismatch between replayPath and real execution");return J})}filterForShrinkImpl(Q){if(this.replayPathPosition===0)this.replayPath=this.sourceReplayPath!==null?cL.parse(this.sourceReplayPath):[];let X=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(Q):this.filterOnExecution(Q);return this.replayPathPosition+=Q.length,X}shrink(Q,X){if(X===void 0)return s.nil();let Y=X,J=Y.shrunkOnce,$=Y.items,Z=this.filterForShrinkImpl($);if(Z.length===0)return s.nil();let G=J?s.nil():new s([[]][Symbol.iterator]()),K=[];for(let W=0;W!==Z.length;++W)K.push(s4(()=>{let H=Z.slice(0,W);return this.lengthArb.shrink(Z.length-1-W,void 0).map((_)=>H.concat(Z.slice(Z.length-(_.value+1))))}));for(let W=0;W!==Z.length;++W)K.push(s4(()=>this.oneCommandArb.shrink(Z[W].value_,Z[W].context).map((H)=>Z.slice(0,W).concat([H],Z.slice(W+1)))));return G.join(...K).map((W)=>{return this.buildValueFor(W.map((H)=>new k(H.value_.clone(),H.context)),!0)})}};function fc(Q,X={}){let{size:Y,maxCommands:J=t6,disableReplayLog:$=!1,replayPath:Z=null}=X;return new cc(Q,_X(Y,0,J,X.maxCommands!==void 0),J,Z,$)}var uc=class{constructor(Q,X){this.s=Q,this.cmd=X}async check(Q){let X=null,Y=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{Y=await Promise.resolve(this.cmd.check(Q))}catch(J){throw X=J,J}}}]).task).faulty)throw X;return Y}async run(Q,X){let Y=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(Q,X)}catch(J){throw Y=J,J}}}]).task).faulty)throw Y}},lc=function*(Q,X){for(let Y of X)yield new uc(Q,Y)},yR=(Q,X,Y,J,$)=>{return Q.then((Z)=>{let{model:G,real:K}=Z,W=Y;for(let H of X)W=$(W,()=>{return J(H,G,K)});return W})},rc=(Q,X)=>{return yR({then:(Z)=>{Z(Q())}},X,void 0,(Z,G,K)=>{if(Z.check(G))Z.run(G,K)},(Z,G)=>G())},oc=(Q)=>{return typeof Q.then==="function"},bR=async(Q,X,Y=Promise.resolve())=>{return await yR({then:(G)=>{let K=Q();if(oc(K))return K.then(G);else return G(K)}},X,Y,async(G,K,W)=>{if(await G.check(K))await G.run(K,W)},(G,K)=>G.then(K))};function nc(Q,X){rc(Q,X)}async function ic(Q,X){await bR(Q,X)}async function ac(Q,X,Y){let J=bR(X,lc(Q,Y),Q.schedule(Promise.resolve(),"startModel"));await Q.waitFor(J),await Q.waitAll()}var D2=(Q)=>Q(),gR=class Q{constructor(X,Y){this.act=X,this.taskSelector=Y,this.lastTaskId=0,this.sourceTaskSelector=Y.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[r0]=function(){return new Q(this.act,this.sourceTaskSelector)}}static buildLog(X){return`[task\${${X.taskId}}] ${X.label.length!==0?`${X.schedulingType}::${X.label}`:X.schedulingType} ${X.status}${X.outputValue!==void 0?` with value ${Qd(X.outputValue)}`:""}`}log(X,Y,J,$,Z,G){this.triggeredTasks.push({status:Z,schedulingType:X,taskId:Y,label:J,metadata:$,outputValue:G!==void 0?b0(G):void 0})}scheduleInternal(X,Y,J,$,Z,G){let K=++this.lastTaskId,W=void 0,H=new Promise((_,V)=>{W=()=>{let q=Promise.resolve(G!==void 0?J.then(()=>G()):J);return q.then((D)=>{this.log(X,K,Y,$,"resolved",D),_(D)},(D)=>{this.log(X,K,Y,$,"rejected",D),V(D)}),q}});if(this.scheduledTasks.push({original:J,trigger:W,schedulingType:X,taskId:K,label:Y,metadata:$,customAct:Z}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return H}schedule(X,Y,J,$){return this.scheduleInternal("promise",Y||"",X,J,$||D2)}scheduleFunction(X,Y){return(...J)=>this.scheduleInternal("function",`${X.name}(${J.map(b0).join(",")})`,X(...J),void 0,Y||D2)}scheduleSequence(X,Y){let J={done:!1,faulty:!1},$={then:(_)=>_()},Z=()=>{},G=new Promise((_)=>{Z=()=>_({done:J.done,faulty:J.faulty})}),K=()=>{J.faulty=!0,Z()},W=()=>{J.done=!0,Z()},H=(_,V)=>{if(_>=X.length){V.then(W,K);return}V.then(()=>{let q=X[_],[D,U,P]=typeof q==="function"?[q,q.name,void 0]:[q.builder,q.label,q.metadata],L=this.scheduleInternal("sequence",U,$,P,Y||D2,()=>D());H(_+1,L)},K)};return H(0,$),Object.assign(J,{task:G})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw Error("No task scheduled");let X=this.taskSelector.nextTaskIndex(this.scheduledTasks),[Y]=this.scheduledTasks.splice(X,1);return Y.customAct(()=>{return Y.trigger().catch((J)=>{})})}waitOne(X){let Y=X||D2;return this.act(()=>Y(()=>this.internalWaitOne()))}async waitAll(X){while(this.scheduledTasks.length>0)await this.waitOne(X)}async internalWaitFor(X,Y){let J=!1,$=Y.customAct,Z=Y.onWaitStart,G=Y.onWaitIdle,K=Y.launchAwaiterOnInit,W=void 0,H=void 0,_=0,V=null,q=null,D=async()=>{_=50;for(_=50;!J&&_>0;--_)await Promise.resolve();if(!J&&this.scheduledTasks.length>0){if(Z!==void 0)Z();return q=this.waitOne($),q.then(()=>{return q=null,D()},(M)=>{throw q=null,J=!0,H(M),M})}if(!J&&G!==void 0)G();V=null},U=()=>{if(V!==null){_=51;return}V=D().catch(()=>{})},P=()=>{let M=this.scheduledWatchers.indexOf(U);if(M!==-1)this.scheduledWatchers.splice(M,1);if(M===0&&this.scheduledWatchers.length!==0)this.scheduledWatchers[0]()},L=new Promise((M,w)=>{W=(R)=>{P(),M(R)},H=(R)=>{P(),w(R)}});if(X.then((M)=>{if(J=!0,q===null)W(M);else q.then(()=>W(M),(w)=>H(w))},(M)=>{if(J=!0,q===null)H(M);else q.then(()=>H(M),()=>H(M))}),(this.scheduledTasks.length>0||K)&&this.scheduledWatchers.length===0)U();return this.scheduledWatchers.push(U),L}waitNext(X,Y){let J=void 0,$=X,Z=$<=0?Promise.resolve():new Promise((G)=>{J=()=>{if(--$<=0)G()}});return this.internalWaitFor(Z,{customAct:Y,onWaitStart:J,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(X){let Y=void 0,J=new Promise(($)=>Y=$);return this.internalWaitFor(J,{customAct:X,onWaitStart:void 0,onWaitIdle:Y,launchAwaiterOnInit:!0})}waitFor(X,Y){return this.internalWaitFor(X,{customAct:Y,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map((X)=>({status:"pending",schedulingType:X.schedulingType,taskId:X.taskId,label:X.label,metadata:X.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(Q.buildLog).map((X)=>`-> ${X}`).join(`
62
- `)+"`"}};function hR(Q){let X=0;return{clone:()=>hR(Q),nextTaskIndex:(Y)=>{if(Q.length<=X)throw Error("Invalid schedulerFor defined: too many tasks have been scheduled");let J=Y.findIndex(($)=>$.taskId===Q[X]);if(J===-1)throw Error("Invalid schedulerFor defined: unable to find next task");return++X,J}}}function fL(Q,X){return new gR(Q,hR(X))}function mR(Q){let X=Q.clone();return{clone:()=>mR(X),nextTaskIndex:(Y)=>{return Q.nextInt(0,Y.length-1)}}}var sc=class extends C0{constructor(Q){super();this.act=Q}generate(Q,X){return new k(new gR(this.act,mR(Q.clone())),void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return s.nil()}};function tc(Q){let{act:X=(Y)=>Y()}=Q||{};return new sc(X)}function ec(Q,X){let{act:Y=(J)=>J()}=Array.isArray(Q)?X||{}:Q||{};if(Array.isArray(Q))return fL(Y,Q);return function(J,...$){return fL(Y,$)}}function Qf(Q={}){return U4(Q,j("-9223372036854775808"),j("9223372036854775807"),Hy,e4)}function Xf(Q={}){return U4(Q,j(0),j("18446744073709551615"),Vy,e4)}function Yf(Q,X){return X}var{floor:vG,min:Jf}=Math;function Q8(Q,X){switch(Q.type){case"Char":return{astNode:Q,minLength:1};case"Repetition":switch(Q.quantifier.kind){case"*":{let Y=Q8(Q.expression,X);return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:0,to:X},expression:Y.astNode},minLength:0}}case"+":{let Y=Q8(Q.expression,X),J=Y.minLength>1?Y.minLength:1;return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:1,to:vG(X/J)},expression:Y.astNode},minLength:Y.minLength}}case"?":{let Y=Q8(Q.expression,X);if(X<Y.minLength)return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:0,to:0},expression:Y.astNode},minLength:0};return{astNode:{...Q,expression:Y.astNode},minLength:0}}case"Range":{let Y=Q.quantifier.from>1?vG(X/Q.quantifier.from):X,J=Q8(Q.expression,Y),$=J.minLength>1?J.minLength:1;if(Q.quantifier.to===void 0||Q.quantifier.to*$>X)return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",to:vG(X/$)},expression:J.astNode},minLength:Q.quantifier.from*J.minLength};return{astNode:{...Q,expression:J.astNode},minLength:Q.quantifier.from*J.minLength}}default:return Yf(Q.quantifier,{astNode:Q,minLength:0})}case"Quantifier":return{astNode:Q,minLength:0};case"Alternative":{let Y=0,J=[];for(let Z=0;Z!==Q.expressions.length;++Z){let G=X-Y,K=Q8(Q.expressions[Z],G);Y+=K.minLength,x(J,{value:K,allowance:G})}let $=[];for(let Z=0;Z!==J.length;++Z){let G=J[Z].value,K=J[Z].allowance,W=X-Y+G.minLength;x($,(W!==K?Q8(G.astNode,W):G).astNode)}return{astNode:{...Q,expressions:$},minLength:Y}}case"CharacterClass":return{astNode:Q,minLength:1};case"ClassRange":return{astNode:Q,minLength:1};case"Group":{let Y=Q8(Q.expression,X);return{astNode:{...Q,expression:Y.astNode},minLength:Y.minLength}}case"Disjunction":{if(Q.left===null){if(Q.right===null)return{astNode:Q,minLength:0};let $=Q8(Q.right,X),Z=$.minLength>X?null:$.astNode;return{astNode:{...Q,left:null,right:Z},minLength:0}}if(Q.right===null){let $=Q8(Q.left,X),Z=$.minLength>X?null:$.astNode;return{astNode:{...Q,left:Z,right:null},minLength:0}}let Y=Q8(Q.left,X),J=Q8(Q.right,X);if(Y.minLength>X)return J;if(J.minLength>X)return Y;return{astNode:{...Q,left:Y.astNode,right:J.astNode},minLength:Jf(Y.minLength,J.minLength)}}case"Assertion":return{astNode:Q,minLength:0};case"Backreference":return{astNode:Q,minLength:0};case"UnicodeProperty":return{astNode:Q,minLength:1}}}function $f(Q,X){return Q8(Q,X).astNode}function Zf(Q){return Error(`Unsupported AST node! Received: ${b0(Q)}`)}function P2(Q,X,Y){if(!X&&!Y)return Q;let J={hasStart:!1,hasEnd:!1},$=dR(Q,X,Y,J),Z=X&&!J.hasStart,G=Y&&!J.hasEnd;if(!Z&&!G)return $;let K=[];if(Z)K.push({type:"Assertion",kind:"^"}),K.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}});if(K.push($),G)K.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),K.push({type:"Assertion",kind:"$"});return{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:K}}}function dR(Q,X,Y,J){switch(Q.type){case"Char":return Q;case"Repetition":return Q;case"Quantifier":throw Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return J.hasStart=!0,J.hasEnd=!0,{...Q,expressions:Q.expressions.map(($,Z)=>P2($,X&&Z===0,Y&&Z===Q.expressions.length-1))};case"CharacterClass":return Q;case"ClassRange":return Q;case"Group":return{...Q,expression:dR(Q.expression,X,Y,J)};case"Disjunction":return J.hasStart=!0,J.hasEnd=!0,{...Q,left:Q.left!==null?P2(Q.left,X,Y):null,right:Q.right!==null?P2(Q.right,X,Y):null};case"Assertion":if(Q.kind==="^"||Q.kind==="Lookahead")return J.hasStart=!0,Q;else if(Q.kind==="$"||Q.kind==="Lookbehind")return J.hasEnd=!0,Q;else throw Error(`Assertions of kind ${Q.kind} not implemented yet!`);case"Backreference":return Q;case"UnicodeProperty":return Q;default:throw Zf(Q)}}function Gf(Q){return P2(Q,!0,!0)}function uL(Q,X){return Q[X]>="\uD800"&&Q[X]<="\uDBFF"&&Q[X+1]>="\uDC00"&&Q[X+1]<="\uDFFF"?2:1}function m0(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"}function $K(Q){return Q>="0"&&Q<="9"}function pR(Q,X){for(let Y=X;Y!==Q.length;++Y){let J=Q[Y];if(J==="\\")Y+=1;else if(J==="]")return Y}throw Error("Missing closing ']'")}function Kf(Q,X){let Y=0;for(let J=X;J!==Q.length;++J){let $=Q[J];if($==="\\")J+=1;else if($===")"){if(Y===0)return J;Y-=1}else if($==="[")J=pR(Q,J);else if($==="(")Y+=1}throw Error("Missing closing ')'")}function Wf(Q,X){let Y=!1;for(let J=X;J!==Q.length;++J){let $=Q[J];if($K($));else if(X===J)return-1;else if($===","){if(Y)return-1;Y=!0}else if($==="}")return J;else return-1}return-1}function Hf(Q,X,Y,J){switch(Q[X]){case"[":if(J===1)return X+1;return pR(Q,X+1)+1;case"{":{if(J===1)return X+1;let $=Wf(Q,X+1);if($===-1)return X+1;return $+1}case"(":if(J===1)return X+1;return Kf(Q,X+1)+1;case"]":case"}":case")":return X+1;case"\\":{let $=Q[X+1];switch($){case"x":if(m0(Q[X+2])&&m0(Q[X+3]))return X+4;throw Error(`Unexpected token '${Q.substring(X,X+4)}' found`);case"u":if(Q[X+2]==="{"){if(!Y)return X+2;if(Q[X+4]==="}"){if(m0(Q[X+3]))return X+5;throw Error(`Unexpected token '${Q.substring(X,X+5)}' found`)}if(Q[X+5]==="}"){if(m0(Q[X+3])&&m0(Q[X+4]))return X+6;throw Error(`Unexpected token '${Q.substring(X,X+6)}' found`)}if(Q[X+6]==="}"){if(m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5]))return X+7;throw Error(`Unexpected token '${Q.substring(X,X+7)}' found`)}if(Q[X+7]==="}"){if(m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5])&&m0(Q[X+6]))return X+8;throw Error(`Unexpected token '${Q.substring(X,X+8)}' found`)}if(Q[X+8]==="}"&&m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5])&&m0(Q[X+6])&&m0(Q[X+7]))return X+9;throw Error(`Unexpected token '${Q.substring(X,X+9)}' found`)}if(m0(Q[X+2])&&m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5]))return X+6;throw Error(`Unexpected token '${Q.substring(X,X+6)}' found`);case"p":case"P":{if(!Y)return X+2;let Z=X+2;for(;Z<Q.length&&Q[Z]!=="}";Z+=Q[Z]==="\\"?2:1);if(Q[Z]!=="}")throw Error("Invalid \\P definition");return Z+1}case"k":{let Z=X+2;for(;Z<Q.length&&Q[Z]!==">";++Z);if(Q[Z]!==">"){if(!Y)return X+2;throw Error("Invalid \\k definition")}return Z+1}default:if($K($)){let Z=Y?Q.length:Math.min(X+4,Q.length),G=X+2;for(;G<Z&&$K(Q[G]);++G);return G}return X+(Y?uL(Q,X+1):1)+1}}default:return X+(Y?uL(Q,X):1)}}function B2(Q,X,Y,J){let $=Hf(Q,X,Y,J);return Q.substring(X,$)}var lL={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},E2={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},qX=SK(E2),EK={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},ZK=SK(EK),cR={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},rL=SK(cR);function SK(Q){let X={};for(let Y of Object.keys(Q)){let J=Q[Y];if(Array.isArray(J))for(let $=0;$!==J.length;++$)X[J[$]]=Y;else X[J]=Y}return X}function Vf(Q){return Q in EK||Q in ZK}function _f(Q){return Q in E2||Q in qX}function oL(Q){if(Q in lL)return lL[Q];if(Q in qX)return qX[Q];if(Q in E2||Q==="General_Category"||Q==="Script"||Q==="Script_Extensions")return Q;throw Error(`Unknown Unicode property name: ${Q}`)}function nL(Q){if(Q in ZK)return ZK[Q];if(Q in rL)return rL[Q];if(Q in qX)return qX[Q];if(Q in EK||Q in cR||Q in E2)return Q;throw Error(`Unknown Unicode property value: ${Q}`)}function qf(Q,X){let Y=Q.indexOf("=");if(Y!==-1){let J=Q.substring(0,Y),$=Q.substring(Y+1);return{type:"UnicodeProperty",name:J,value:$,negative:X,shorthand:!1,binary:!1,canonicalName:oL(J),canonicalValue:nL($)}}if(Vf(Q))return{type:"UnicodeProperty",name:"General_Category",value:Q,negative:X,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:nL(Q)};if(_f(Q)){let J=oL(Q);return{type:"UnicodeProperty",name:Q,value:Q,negative:X,shorthand:!1,binary:!0,canonicalName:J,canonicalValue:J}}throw Error(`Invalid Unicode property: ${Q}`)}var kG=String.fromCodePoint;function yG(Q){let X=Q.pop();if(X===void 0)throw Error("Unable to extract token preceeding the currently parsed one");return X}function fR(Q){return Q>="0"&&Q<="9"}function R2(Q,X){return{type:"Char",kind:"simple",symbol:Q,value:Q,codePoint:Q.codePointAt(0)||-1,escaped:X}}function Z9(Q,X){return{type:"Char",kind:"meta",symbol:X,value:Q,codePoint:X.codePointAt(0)||-1}}function n4(Q,X){if(Q.length>1)return{type:"Alternative",expressions:Q};if(!X&&Q.length===0)throw Error("Unsupported no token");return Q[0]}function bG(Q){if(Q[0]==="\\"){let X=Q[1];switch(X){case"x":{let Y=Q.substring(2),J=Number.parseInt(Y,16);return{type:"Char",kind:"hex",symbol:kG(J),value:Q,codePoint:J}}case"u":{if(Q==="\\u")return R2("u",!0);let Y=Q[2]==="{"?Q.substring(3,Q.length-1):Q.substring(2),J=Number.parseInt(Y,16);return{type:"Char",kind:"unicode",symbol:kG(J),value:Q,codePoint:J}}case"0":return Z9(Q,"\x00");case"n":return Z9(Q,`
63
- `);case"f":return Z9(Q,"\f");case"r":return Z9(Q,"\r");case"t":return Z9(Q,"\t");case"v":return Z9(Q,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:Q,codePoint:NaN};default:if(fR(X)){let Y=Q.substring(1),J=Number(Y);return{type:"Char",kind:"decimal",symbol:kG(J),value:Q,codePoint:J}}if(Q.length>2&&(X==="p"||X==="P")){let Y=X==="P";return qf(Q.substring(3,Q.length-1),Y)}return R2(Q.substring(1),!0)}}return R2(Q)}function G9(Q,X,Y,J){let $=null;for(let Z=0,G=B2(X,Z,Y,0);Z!==X.length;Z+=G.length,G=B2(X,Z,Y,0)){let K=G[0];switch(K){case"|":if($===null)$=[];$.push(n4(Q.splice(0),!0)||null);break;case".":Q.push({type:"Char",kind:"meta",symbol:G,value:G,codePoint:NaN});break;case"*":case"+":{let W=yG(Q);Q.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"?":{let W=yG(Q);if(W.type==="Repetition")W.quantifier.greedy=!1,Q.push(W);else Q.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"{":{if(G==="{"){Q.push(R2(G));break}let W=yG(Q),H=G.substring(1,G.length-1).split(","),_=Number(H[0]),V=H.length===1?_:H[1].length!==0?Number(H[1]):void 0;Q.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:_,to:V}});break}case"[":{let W=G.substring(1,G.length-1),H=[],_=void 0,V=!1;for(let q=0,D=B2(W,q,Y,1);q!==W.length;q+=D.length,D=B2(W,q,Y,1)){if(q===0&&D==="^"){_=!0;continue}let U=bG(D);if(D==="-")H.push(U),V=!0;else{let P=H.length>=2?H[H.length-2]:void 0;if(V&&P!==void 0&&P.type==="Char"&&U.type==="Char")H.pop(),H.pop(),H.push({type:"ClassRange",from:P,to:U});else H.push(U);V=!1}}Q.push({type:"CharacterClass",expressions:H,negative:_});break}case"(":{let W=G.substring(1,G.length-1),H=[];if(W[0]==="?")if(W[1]===":")G9(H,W.substring(2),Y,J),Q.push({type:"Group",capturing:!1,expression:n4(H)});else if(W[1]==="="||W[1]==="!")G9(H,W.substring(2),Y,J),Q.push({type:"Assertion",kind:"Lookahead",negative:W[1]==="!"?!0:void 0,assertion:n4(H)});else if(W[1]==="<"&&(W[2]==="="||W[2]==="!"))G9(H,W.substring(3),Y,J),Q.push({type:"Assertion",kind:"Lookbehind",negative:W[2]==="!"?!0:void 0,assertion:n4(H)});else{let _=W.split(">");if(_.length<2||_[0][1]!=="<")throw Error(`Unsupported regex content found at ${JSON.stringify(G)}`);let V=++J.lastIndex,q=_[0].substring(2);J.named.set(q,V),G9(H,_.slice(1).join(">"),Y,J),Q.push({type:"Group",capturing:!0,nameRaw:q,name:q,number:V,expression:n4(H)})}else{let _=++J.lastIndex;G9(H,W,Y,J),Q.push({type:"Group",capturing:!0,number:_,expression:n4(H)})}break}default:if(G==="^")Q.push({type:"Assertion",kind:G});else if(G==="$")Q.push({type:"Assertion",kind:G});else if(G[0]==="\\"&&fR(G[1])){let W=Number(G.substring(1));if(Y||W<=J.lastIndex)Q.push({type:"Backreference",kind:"number",number:W,reference:W});else Q.push(bG(G))}else if(G[0]==="\\"&&G[1]==="k"&&G.length!==2){let W=G.substring(3,G.length-1);Q.push({type:"Backreference",kind:"name",number:J.named.get(W)||0,referenceRaw:W,reference:W})}else Q.push(bG(G));break}}if($!==null){$.push(n4(Q.splice(0),!0)||null);let Z={type:"Disjunction",left:$[0],right:$[1]};for(let G=2;G<$.length;++G)Z={type:"Disjunction",left:Z,right:$[G]};Q.push(Z)}}function Df(Q){let X=V4([...Q.flags],"u")!==-1,Y=Q.source,J=[];return G9(J,Y,X,{lastIndex:0,named:new Map}),n4(J)}var Bf=String.fromCodePoint;function Uf(Q){if(Q.binary||Q.shorthand)return Q.canonicalValue;return`${Q.canonicalName}=${Q.canonicalValue}`}function iL(Q,X,Y,J){let $=-1;for(let Z=X;Z<=Y;++Z)if(Q.test(Bf(Z))){if($===-1)$=Z}else if($!==-1){let G=Z-1;J.push($===G?[G]:[$,G]),$=-1}if($!==-1)J.push($===Y?[Y]:[$,Y])}function Of(Q,X){let Y=new RegExp(`^\\${X?"P":"p"}{${Q}}$`,"u"),J=[];return iL(Y,0,55295,J),iL(Y,57344,1114111,J),J}var aL=new Map;function zf(Q,X){let Y=`${X?"P":"p"}:${Q}`,J=aL.get(Y);if(J!==void 0)return J;let $=Of(Q,X);return aL.set(Y,$),$}function Ff(Q){return q9(...Z0(zf(Uf(Q),Q.negative),(X)=>fG(X)))}var Lf=String.fromCodePoint,sL=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],tL=[..."0123456789"],eL=[...` \r
64
- \v\f`],GK=[...`\r
65
- `],uR=[..."\x1E\x15"],Pf=[...GK,...uR],a6=()=>d0({unit:"grapheme-ascii",minLength:1,maxLength:1});function QP(Q){return new S(`Unsupported AST node! Received: ${b0(Q)}`)}function i4(Q,X,Y){switch(Q.type){case"Char":if(Q.kind==="meta")switch(Q.value){case"\\w":return m8(...sL);case"\\W":return a6().filter((J)=>V4(sL,J)===-1);case"\\d":return m8(...tL);case"\\D":return a6().filter((J)=>V4(tL,J)===-1);case"\\s":return m8(...eL);case"\\S":return a6().filter((J)=>V4(eL,J)===-1);case"\\b":case"\\B":throw new S(`Meta character ${Q.value} not implemented yet!`);case".":{let J=Y.dotAll?uR:Pf;return a6().filter(($)=>V4(J,$)===-1)}}if(Q.symbol===void 0)throw new S(`Unexpected undefined symbol received for non-meta Char! Received: ${b0(Q)}`);return y0(Q.symbol);case"Repetition":{let J=i4(Q.expression,X,Y);switch(Q.quantifier.kind){case"*":return d0({...X,unit:J});case"+":return d0({...X,minLength:1,unit:J});case"?":return d0({...X,minLength:0,maxLength:1,unit:J});case"Range":return d0({...X,minLength:Q.quantifier.from,maxLength:Q.quantifier.to,unit:J});default:throw QP(Q.quantifier)}}case"Quantifier":throw new S("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return Q0(...Z0(Q.expressions,(J)=>i4(J,X,Y))).map((J)=>w0(J,""));case"CharacterClass":if(Q.negative){let J=Z0(Q.expressions,($)=>i4($,X,Y));return a6().filter(($)=>qP(J,(Z)=>!Z.canShrinkWithoutContext($)))}return l0(...Z0(Q.expressions,(J)=>i4(J,X,Y)));case"ClassRange":{let J=Q.from.codePoint,$=Q.to.codePoint;return O0({min:J,max:$}).map((Z)=>Lf(Z),(Z)=>{if(typeof Z!=="string")throw new S("Invalid type");if([...Z].length!==1)throw new S("Invalid length");return H9(Z,0)})}case"Group":return i4(Q.expression,X,Y);case"Disjunction":return l0(Q.left!==null?i4(Q.left,X,Y):y0(""),Q.right!==null?i4(Q.right,X,Y):y0(""));case"Assertion":if(Q.kind==="^"||Q.kind==="$"){if(Y.multiline)if(Q.kind==="^")return l0(y0(""),Q0(d0({unit:a6()}),m8(...GK)).map((J)=>`${J[0]}${J[1]}`,(J)=>{if(typeof J!=="string"||J.length===0)throw new S("Invalid type");return[S0(J,0,J.length-1),J[J.length-1]]}));else return l0(y0(""),Q0(m8(...GK),d0({unit:a6()})).map((J)=>`${J[0]}${J[1]}`,(J)=>{if(typeof J!=="string"||J.length===0)throw new S("Invalid type");return[J[0],S0(J,1)]}));return y0("")}throw new S(`Assertions of kind ${Q.kind} not implemented yet!`);case"Backreference":throw new S("Backreference nodes not implemented yet!");case"UnicodeProperty":return Ff(Q);default:throw QP(Q)}}function Rf(Q,X={}){for(let K of Q.flags)if(K!=="d"&&K!=="g"&&K!=="m"&&K!=="s"&&K!=="u")throw new S(`Unable to use "stringMatching" against a regex using the flag ${K}`);let Y=X.maxLength,J={size:X.size,maxLength:Y},$={multiline:Q.multiline,dotAll:Q.dotAll},Z=Gf(Df(Q));if(Y!==void 0)Z=$f(Z,Y);let G=i4(Z,J,$);if(Y!==void 0)return G.filter((K)=>[...K].length<=Y);return G}function Nf(Q){let X=[];for(let Y=0;Y!==Q.length;++Y)X.push(Q[Y].next());return X}function Mf(Q,X){for(let Y=0;Y!==Q.length;++Y)X[Y]=Q[Y].next()}function Af(Q){for(let X=0;X!==Q.length;++X)if(Q[X].done)return!0;return!1}function*wf(...Q){let X=Nf(Q);while(!Af(X))yield X.map((Y)=>Y.value),Mf(Q,X)}function*Cf(Q){let X=Q;while(!0)yield X,++X}var Tf=class extends C0{constructor(Q,X){super();this.arb=Q,this.maxShrinks=X}generate(Q,X){let Y=this.arb.generate(Q,X);return this.valueMapper(Y,0)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){if(this.isSafeContext(X))return this.safeShrink(Q,X.originalContext,X.length);return this.safeShrink(Q,void 0,0)}safeShrink(Q,X,Y){let J=this.maxShrinks-Y;if(J<=0)return s.nil();return new s(wf(this.arb.shrink(Q,X),Cf(Y+1))).take(J).map(($)=>this.valueMapper($[0],$[1]))}valueMapper(Q,X){let Y={originalContext:Q.context,length:X};return new k(Q.value,Y)}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalContext"in Q&&"length"in Q}};function If(Q,X){return new Tf(Q,X)}var jf="module",Ef="4.8.0",Sf="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c";var UX=iY;function f1(){return(Q,X,Y)=>{return T(new p6(Q.map(uQ),(J)=>X(J.map(($)=>T($))),Y))}}function O4(Q,X){return f1()([],()=>(Y,J)=>Q(Y)?h(Y):y(new v0(J,F(Y))),X)}function xf(Q){return Q}function vf(Q){return(X)=>X.annotate(Q)}function kf(Q){return(X)=>vK(vK(X).annotate(Q))}function yf(Q){return(X)=>{return X.rebuild(iQ(X.ast,Q))}}function bf(Q){return Q}function gf(Q){return N(Q,aY)}function lR(Q){return H8(Q)?Q.value:{issues:[{message:iJ(Q.cause)}]}}function hf(Q,X){let Y=h0(Q),J={errors:"all",...X?.parseOptions},$=YU(X),Z=(G)=>{let K=new A5,W=m5(E$(Y(G,J),{onFailure:$,onSuccess:(_)=>({value:_})}),{scheduler:K});W.currentDispatcher?.flush();let H=W.pollUnsafe();if(H)return lR(H);return new Promise((_)=>{W.addObserver((V)=>{_(lR(V))})})};if("~standard"in Q){let G=Q;if("validate"in G["~standard"])return G;return Object.assign(G["~standard"],{validate:Z}),G}else return Object.assign(Q,{"~standard":{version:1,vendor:"effect",validate:Z}})}function rR(Q,X){let Y=MM(Q);if(X==="draft-2020-12"){let J=Y.schema;if(Object.keys(Y.definitions).length>0)J.$defs=Y.definitions;return J}else if(X==="draft-07"){let J=vz(Y),$=J.schema;if(Object.keys(J.definitions).length>0)$.definitions=J.definitions;return $}throw new globalThis.Error(`Unsupported target: ${X}`)}function mf(Q){let X={input(Y){return rR(Q,Y.target)},output(Y){return rR(N1(Q),Y.target)}};if("~standard"in Q){let Y=Q;if("jsonSchema"in Y["~standard"])return Y;return Object.assign(Y["~standard"],{jsonSchema:X}),Y}else return Object.assign(Q,{"~standard":{version:1,vendor:"effect",jsonSchema:X}})}var YN=Vz,df=qz;function S2(Q,X){let Y=h0(Q,X);return(J,$)=>{return X1(Y(J,$),(Z)=>new g8(Z))}}var pf=S2;function JN(Q,X){let Y=Dz(Q,X);return(J,$)=>{return g7(Y(J,$),(Z)=>new g8(Z))}}var cf=JN,$N=Bz,ff=$N;function ZN(Q,X){let Y=Uz(Q,X);return(J,$)=>{return F5(Y(J,$),(Z)=>new g8(Z))}}var uf=ZN;function GN(Q,X){let Y=S2(Q,X);return(J,$)=>{return MQ(Y(J,$))}}var lf=GN;function KN(Q,X){let Y=S2(Q,X);return(J,$)=>{return d4(Y(J,$))}}var rf=KN;function x2(Q,X){let Y=Q9(Q,X);return(J,$)=>{return X1(Y(J,$),(Z)=>new g8(Z))}}var WN=x2;function HN(Q,X){let Y=Oz(Q,X);return(J,$)=>{return g7(Y(J,$),(Z)=>new g8(Z))}}var of=HN,VN=zz,nf=VN;function _N(Q,X){let Y=Fz(Q,X);return(J,$)=>{return F5(Y(J,$),(Z)=>new g8(Z))}}var af=_N;function qN(Q,X){let Y=x2(Q,X);return(J,$)=>{return MQ(Y(J,$))}}var sf=qN;function DN(Q,X){let Y=x2(Q,X);return(J,$)=>{return d4(Y(J,$))}}var tf=DN,T=n6;function ef(Q){class X{}return Object.setPrototypeOf(X,Q)}function v2(Q){return N(Q,UX)&&Q[UX]===UX}var X6=_1((Q)=>T(dY(Q.ast),{schema:Q})),Qu=_1((Q)=>Q.schema),U9=_1((Q)=>X6(y2(Q))),Xu=_1((Q)=>Q.schema.members[0]),Yu=_1((Q)=>T(gZ(Q.ast),{schema:Q})),Ju=_1((Q)=>Q.schema),N1=_1((Q)=>T(U8(Q.ast),{schema:Q})),O9=_1((Q)=>T(Y1(Q.ast),{schema:Q})),OX="~effect/Schema/flip";function $u(Q){return N(Q,OX)&&Q[OX]===OX}function vK(Q){if($u(Q))return Q.schema.rebuild(B8(Q.ast));return T(B8(Q.ast),{[OX]:OX,schema:Q})}function t0(Q){let X=T(new g1(Q),{literal:Q,transform(Y){return X.pipe(p(t0(Y),{decode:r(()=>Y),encode:r(()=>Q)}))}});return X}function BN(Q){return new jZ(Q.map((X)=>v2(X)?X.ast:new g1(X)))}function Zu(Q){return T(BN(Q),{parts:Q})}function Gu(Q){return T(BN(Q).asTemplateLiteralParser(),{parts:Q})}function Ku(Q){return T(new IZ(Object.keys(Q).filter((X)=>typeof Q[Q[X]]!=="number").map((X)=>[X,Q[X]])),{enums:Q})}var Wu=T(VO),Hu=T(qO),gK=T(m6),hK=T(s5),mK=T(TZ),o=T(c6),Y6=T(SZ),UN=T(PO),ON=T(NO),k2=T(AO),Vu=T(WO),_u=T(UO);function qu(Q){return T(new EZ(Q))}function dK(Q,X){return T(Q,{fields:X,mapFields(Y,J){let $=Y(this.fields);return dK(vY($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function R0(Q){return dK(vY(Q,void 0),Q)}function Du(Q){return _1((X)=>X.mapFields(Qz(Q)))}function Bu(Q){return function(X){let Y={},J={};for(let $ in X.fields){let Z=O9(X.fields[$]);if(Object.hasOwn(Q,$))Y[Q[$]]=Z,J[Q[$]]=$;else Y[$]=Z}return R0(Y).pipe(p(X,j0({decode:fZ(J),encode:fZ(Q)})))}}function Uu(Q,X){return(Y)=>{let J=L5(Y.fields,N1),$=R0({...J,...Q});return Y.pipe(p($,j0({decode:(Z)=>{let G={...Z};for(let K in Q){let W=X[K],H=W(Z);if(O1(H))G[K]=H.value}return G},encode:(Z)=>{let G={...Z};for(let K in Q)delete G[K];return G}})))}}function zN(Q,X,Y){let J=Y?.keyValueCombiner?.decode||Y?.keyValueCombiner?.encode?new xY(Y.keyValueCombiner.decode,Y.keyValueCombiner.encode):void 0;return T(bO(Q.ast,X.ast,J),{key:Q,value:X})}function Ou(Q,X){return T(wO(Q.ast,X.map(uQ)),{schema:Q,records:X})}function FN(Q,X){return T(Q,{elements:X,mapElements(Y,J){let $=Y(this.elements);return FN(kZ($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function B9(Q){return FN(kZ(Q),Q)}function zu(Q,X){return T(CO(Q.ast,X.map(uQ)),{schema:Q,rest:X})}var f0=_1((Q)=>T(new H4(!1,[],[Q.ast]),{value:Q}));var Fu=_1((Q)=>T(new H4(!1,[Q.ast],[Q.ast]),{value:Q}));function Lu(Q){return J1([Q,f0(Q)]).pipe(p(f0(N1(Q)),j0({decode:DH,encode:(X)=>X.length===1?X[0]:X})))}function Pu(Q){return f0(Q).check(fN())}var Ru=_1((Q)=>{return T(new H4(!0,Q.ast.elements,Q.ast.rest),{schema:Q})});function LN(Q,X){return T(Q,{members:X,mapMembers(Y,J){let $=Y(this.members);return LN(kY($,this.ast.mode,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function J1(Q,X){return LN(kY(Q,X?.mode??"anyOf",void 0),Q)}function pK(Q){let X=Q.map(t0);return T(kY(X,"anyOf",void 0),{literals:Q,members:X,mapMembers(Y){return J1(Y(this.members))},pick(Y){return pK(Y)},transform(Y){return J1(X.map((J,$)=>J.transform(Y[$])))}})}var cK=_1((Q)=>J1([Q,hK])),y2=_1((Q)=>J1([Q,mK])),PN=_1((Q)=>J1([Q,hK,mK]));function RN(Q){return T(new yY(()=>Q().ast))}function Nu(...Q){return(X)=>X.check(...Q)}function Mu(Q,X){return(Y)=>T(l4(Y.ast,[bY(Q,X)]),{schema:Y})}function NN(Q){return(X)=>T(vO(X.ast,Q),{schema:X,identifier:Q})}function Au(Q,X){return(Y)=>{return(X.checks?Y.check(...X.checks):Y).pipe(NN(Q))}}function fK(Q){return(X)=>T(SO(X.ast,new hQ(Q,g)),{schema:X})}function MN(Q){return(X)=>T(xO(X.ast,new hQ(g,Q)),{schema:X})}function wu(Q){return AN(Q)}function AN(Q){return(X)=>X.pipe(fK(d5(Q)))}function Cu(Q){return wN(Q)}function wN(Q){return(X)=>X.pipe(MN(d5(Q)))}function p(Q,X){return(Y)=>{return T(pY(Y.ast,Q.ast,X?AY(X):h6()),{from:Y,to:Q})}}function Tu(Q){return(X)=>{return X.pipe(p(N1(X),Q))}}function uK(Q,X){return(Y)=>{return X?Q.pipe(p(Y,X)):Q.pipe(p(Y))}}function Iu(Q){return(X)=>{return O9(X).pipe(p(X,Q))}}function CN(Q){return(X)=>T(kO(X.ast,X1(Q,(Y)=>Y.issue)),{schema:X})}function lK(Q,X){let Y=X?.encodingStrategy==="omit"?DZ():b1();return(J)=>{return X6(O9(J)).pipe(p(J,{decode:gQ(X1(Q,($)=>$.issue)),encode:Y}))}}function ju(Q,X){return(Y)=>{return N1(Y).pipe(lK(Q,X),uK(X6(Y)))}}function TN(Q,X){let Y=X?.encodingStrategy==="omit"?DZ():b1();return(J)=>{return U9(O9(J)).pipe(p(J,{decode:gQ(X1(Q,($)=>$.issue)),encode:Y}))}}function Eu(Q,X){return(Y)=>{return N1(Y).pipe(TN(Q,X),uK(U9(Y)))}}function Q5(Q){return t0(Q).pipe(CN(h(Q)))}function Su(Q){return Q5(Q).pipe(lK(h(Q),{encodingStrategy:"omit"}))}function b2(Q,X){return R0({_tag:Q5(Q),...X})}function IN(Q){return(X)=>{let Y={},J={},$=(K)=>(W)=>K.includes(W[Q]);return Z(X),Object.assign(X,{cases:Y,isAnyOf:$,guards:J,match:G});function Z(K){let W=K.ast;if(EY(W)&&"members"in K&&globalThis.Array.isArray(K.members)&&K.members.every(v2))return K.members.forEach(Z);let H=lQ(W);if(H.length>0){let _=H.find((V)=>V.key===Q)?.literal;if(wX(_)){Y[_]=K,J[_]=YN(N1(K));return}}throw new globalThis.Error("No literal or unique symbol found")}function G(){if(arguments.length===1){let H=arguments[0];return function(_){return H[_[Q]](_)}}let K=arguments[0];return arguments[1][K[Q]](K)}}}function xu(Q){let X={},Y=[];for(let K of Object.keys(Q))Y.push(X[K]=b2(K,Q[K]));let J=J1(Y),{guards:$,isAnyOf:Z,match:G}=IN("_tag")(J);return T(J.ast,{cases:X,isAnyOf:Z,guards:$,match:G})}function vu(){return(Q)=>{class X{}return Object.setPrototypeOf(X,Q)}}function z4(Q,X){return O4((Y)=>Y instanceof Q,X)}function N0(){return(Q,X)=>{return new B0(Q.ast,AY(X))}}var z0=yZ;function ku(Q,X=void 0){return new u4(Q,X)}var oR="^\\S[\\s\\S]*\\S$|^\\S$|^$";function jN(Q){return z0((X)=>X.trim()===X,{expected:"a string with no leading or trailing whitespace",meta:{_tag:"isTrimmed",regExp:new globalThis.RegExp(oR)},toArbitraryConstraint:{string:{patterns:[oR]}},...Q})}var z9=oQ,yu=mZ,bu=dZ,gu=cZ,hu=(Q)=>{if(Q)return new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/};function mu(Q,X){let Y=hu(Q);return z9(Y,{expected:Q?`a UUID v${Q}`:"a UUID",meta:{_tag:"isUUID",regExp:Y,version:Q},...X})}var nR=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;function du(Q){return z9(nR,{expected:"a GUID",meta:{_tag:"isGUID",regExp:nR},...Q})}function pu(Q){let X=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return z9(X,{meta:{_tag:"isULID",regExp:X},...Q})}function EN(Q){let X=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return z9(X,{expected:"a base64 encoded string",meta:{_tag:"isBase64",regExp:X},...Q})}function cu(Q){let X=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return z9(X,{expected:"a base64url encoded string",meta:{_tag:"isBase64Url",regExp:X},...Q})}function fu(Q,X){let Y=JSON.stringify(Q);return z0((J)=>J.startsWith(Q),{expected:`a string starting with ${Y}`,meta:{_tag:"isStartsWith",startsWith:Q,regExp:new globalThis.RegExp(`^${Q}`)},toArbitraryConstraint:{string:{patterns:[`^${Q}`]}},...X})}function uu(Q,X){let Y=JSON.stringify(Q);return z0((J)=>J.endsWith(Q),{expected:`a string ending with ${Y}`,meta:{_tag:"isEndsWith",endsWith:Q,regExp:new globalThis.RegExp(`${Q}$`)},toArbitraryConstraint:{string:{patterns:[`${Q}$`]}},...X})}function lu(Q,X){let Y=JSON.stringify(Q);return z0((J)=>J.includes(Q),{expected:`a string including ${Y}`,meta:{_tag:"isIncludes",includes:Q,regExp:new globalThis.RegExp(Q)},toArbitraryConstraint:{string:{patterns:[Q]}},...X})}var iR="^[^a-z]*$";function ru(Q){return z0((X)=>X.toUpperCase()===X,{expected:"a string with all characters in uppercase",meta:{_tag:"isUppercased",regExp:new globalThis.RegExp(iR)},toArbitraryConstraint:{string:{patterns:[iR]}},...Q})}var aR="^[^A-Z]*$";function ou(Q){return z0((X)=>X.toLowerCase()===X,{expected:"a string with all characters in lowercase",meta:{_tag:"isLowercased",regExp:new globalThis.RegExp(aR)},toArbitraryConstraint:{string:{patterns:[aR]}},...Q})}var sR="^[^a-z]?.*$";function nu(Q){return z0((X)=>X.charAt(0).toUpperCase()===X.charAt(0),{expected:"a string with the first character in uppercase",meta:{_tag:"isCapitalized",regExp:new globalThis.RegExp(sR)},toArbitraryConstraint:{string:{patterns:[sR]}},...Q})}var tR="^[^A-Z]?.*$";function iu(Q){return z0((X)=>X.charAt(0).toLowerCase()===X.charAt(0),{expected:"a string with the first character in lowercase",meta:{_tag:"isUncapitalized",regExp:new globalThis.RegExp(tR)},toArbitraryConstraint:{string:{patterns:[tR]}},...Q})}function SN(Q){return z0((X)=>globalThis.Number.isFinite(X),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...Q})}function zX(Q){let X=U5(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((Z)=>X(Z,J),{expected:`a value greater than ${Y(J)}`,...Q.annotate?.(J),...$})}}function FX(Q){let X=uX(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((Z)=>X(Z,J),{expected:`a value greater than or equal to ${Y(J)}`,...Q.annotate?.(J),...$})}}function LX(Q){let X=cX(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((Z)=>X(Z,J),{expected:`a value less than ${Y(J)}`,...Q.annotate?.(J),...$})}}function PX(Q){let X=fX(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((Z)=>X(Z,J),{expected:`a value less than or equal to ${Y(J)}`,...Q.annotate?.(J),...$})}}function RX(Q){let X=uX(Q.order),Y=U5(Q.order),J=fX(Q.order),$=cX(Q.order),Z=Q.formatter??v;return(G,K)=>{let W=G.exclusiveMinimum?Y:X,H=G.exclusiveMaximum?$:J;return z0((_)=>W(_,G.minimum)&&H(_,G.maximum),{expected:`a value between ${Z(G.minimum)}${G.exclusiveMinimum?" (excluded)":""} and ${Z(G.maximum)}${G.exclusiveMaximum?" (excluded)":""}`,...Q.annotate?.(G),...K})}}function xN(Q){return(X,Y)=>{let J=Q.formatter??v;return z0(($)=>Q.remainder($,X)===Q.zero,{expected:`a value that is a multiple of ${J(X)}`,...Q.annotate?.(X),...Y})}}var au=zX({order:U1,annotate:(Q)=>({meta:{_tag:"isGreaterThan",exclusiveMinimum:Q},toArbitraryConstraint:{number:{min:Q,minExcluded:!0}}})}),vN=FX({order:U1,annotate:(Q)=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:Q},toArbitraryConstraint:{number:{min:Q}}})}),su=LX({order:U1,annotate:(Q)=>({meta:{_tag:"isLessThan",exclusiveMaximum:Q},toArbitraryConstraint:{number:{max:Q,maxExcluded:!0}}})}),tu=PX({order:U1,annotate:(Q)=>({meta:{_tag:"isLessThanOrEqualTo",maximum:Q},toArbitraryConstraint:{number:{max:Q}}})}),rK=RX({order:U1,annotate:(Q)=>{return{meta:{_tag:"isBetween",...Q},toArbitraryConstraint:{number:{min:Q.minimum,max:Q.maximum,...Q.exclusiveMinimum&&{minExcluded:!0},...Q.exclusiveMaximum&&{maxExcluded:!0}}}}}}),eu=xN({remainder:WD,zero:0,annotate:(Q)=>({expected:`a value that is a multiple of ${Q}`,meta:{_tag:"isMultipleOf",divisor:Q}})});function g2(Q){return z0((X)=>globalThis.Number.isSafeInteger(X),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...Q})}function Ql(Q){return new u4([g2(Q),rK({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...Q})}function Xl(Q){return new u4([g2(),rK({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...Q})}function kN(Q){return z0((X)=>!isNaN(X.getTime()),{expected:"a valid date",meta:{_tag:"isDateValid"},toArbitraryConstraint:{date:{noInvalidDate:!0}},...Q})}var yN=(Q)=>new globalThis.Date(Q.getTime()+1),bN=(Q)=>new globalThis.Date(Q.getTime()-1),Yl=zX({order:B5,annotate:(Q)=>({meta:{_tag:"isGreaterThanDate",exclusiveMinimum:Q},toArbitraryConstraint:{date:{min:yN(Q)}}})}),Jl=FX({order:B5,annotate:(Q)=>({meta:{_tag:"isGreaterThanOrEqualToDate",minimum:Q},toArbitraryConstraint:{date:{min:Q}}})}),$l=LX({order:B5,annotate:(Q)=>({meta:{_tag:"isLessThanDate",exclusiveMaximum:Q},toArbitraryConstraint:{date:{max:bN(Q)}}})}),Zl=PX({order:B5,annotate:(Q)=>({meta:{_tag:"isLessThanOrEqualToDate",maximum:Q},toArbitraryConstraint:{date:{max:Q}}})}),Gl=RX({order:B5,annotate:(Q)=>({meta:{_tag:"isBetweenDate",...Q},toArbitraryConstraint:{date:{min:Q.exclusiveMinimum?yN(Q.minimum):Q.minimum,max:Q.exclusiveMaximum?bN(Q.maximum):Q.maximum}}})}),gN=(Q)=>Q+globalThis.BigInt(1),hN=(Q)=>Q-globalThis.BigInt(1),Kl=zX({order:T8,annotate:(Q)=>({meta:{_tag:"isGreaterThanBigInt",exclusiveMinimum:Q},toArbitraryConstraint:{bigint:{min:gN(Q)}}})}),mN=FX({order:T8,annotate:(Q)=>({meta:{_tag:"isGreaterThanOrEqualToBigInt",minimum:Q},toArbitraryConstraint:{bigint:{min:Q}}})}),Wl=LX({order:T8,annotate:(Q)=>({meta:{_tag:"isLessThanBigInt",exclusiveMaximum:Q},toArbitraryConstraint:{bigint:{max:hN(Q)}}})}),Hl=PX({order:T8,annotate:(Q)=>({meta:{_tag:"isLessThanOrEqualToBigInt",maximum:Q},toArbitraryConstraint:{bigint:{max:Q}}})}),Vl=RX({order:T8,annotate:(Q)=>({meta:{_tag:"isBetweenBigInt",...Q},toArbitraryConstraint:{bigint:{min:Q.exclusiveMinimum?gN(Q.minimum):Q.minimum,max:Q.exclusiveMaximum?hN(Q.maximum):Q.maximum}}})}),_l=zX({order:p5,formatter:(Q)=>k8(Q)}),ql=FX({order:p5,formatter:(Q)=>k8(Q)}),Dl=LX({order:p5,formatter:(Q)=>k8(Q)}),Bl=PX({order:p5,formatter:(Q)=>k8(Q)}),Ul=RX({order:p5,formatter:(Q)=>k8(Q)});function dN(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.length>=Q,{expected:`a value with a length of at least ${Q}`,meta:{_tag:"isMinLength",minLength:Q},[m1]:!0,toArbitraryConstraint:{string:{minLength:Q},array:{minLength:Q}},...X})}function pN(Q){return dN(1,Q)}function Ol(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.length<=Q,{expected:`a value with a length of at most ${Q}`,meta:{_tag:"isMaxLength",maxLength:Q},[m1]:!0,toArbitraryConstraint:{string:{maxLength:Q},array:{maxLength:Q}},...X})}function cN(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),z0((J)=>J.length>=Q&&J.length<=X,{expected:Q===X?`a value with a length of ${Q}`:`a value with a length between ${Q} and ${X}`,meta:{_tag:"isLengthBetween",minimum:Q,maximum:X},[m1]:!0,toArbitraryConstraint:{string:{minLength:Q,maxLength:X},array:{minLength:Q,maxLength:X}},...Y})}function zl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.size>=Q,{expected:`a value with a size of at least ${Q}`,meta:{_tag:"isMinSize",minSize:Q},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q}},...X})}function Fl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.size<=Q,{expected:`a value with a size of at most ${Q}`,meta:{_tag:"isMaxSize",maxSize:Q},[m1]:!0,toArbitraryConstraint:{array:{maxLength:Q}},...X})}function Ll(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),z0((J)=>J.size>=Q&&J.size<=X,{expected:Q===X?`a value with a size of ${Q}`:`a value with a size between ${Q} and ${X}`,meta:{_tag:"isSizeBetween",minimum:Q,maximum:X},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q,maxLength:X}},...Y})}function Pl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Reflect.ownKeys(Y).length>=Q,{expected:`a value with at least ${Q===1?"1 entry":`${Q} entries`}`,meta:{_tag:"isMinProperties",minProperties:Q},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q}},...X})}function Rl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Reflect.ownKeys(Y).length<=Q,{expected:`a value with at most ${Q===1?"1 entry":`${Q} entries`}`,meta:{_tag:"isMaxProperties",maxProperties:Q},[m1]:!0,toArbitraryConstraint:{array:{maxLength:Q}},...X})}function Nl(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),z0((J)=>Reflect.ownKeys(J).length>=Q&&Reflect.ownKeys(J).length<=X,{expected:Q===X?`a value with exactly ${Q===1?"1 entry":`${Q} entries`}`:`a value with between ${Q} and ${X} entries`,meta:{_tag:"isPropertiesLengthBetween",minimum:Q,maximum:X},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q,maxLength:X}},...Y})}function Ml(Q,X){let Y=O9(Q),J=_z(Y.ast);return z0(($,Z,G)=>{let K=Reflect.ownKeys($),W=[];for(let H of K){let _=J(H,G);if(_!==void 0){if(W.push(new A0([H],_)),G.errors==="first")break}}if(K8(W))return new q0(Z,F($),W);return!0},{expected:"an object with property names matching the schema",meta:{_tag:"isPropertyNames",propertyNames:Y.ast},[m1]:!0,...X})}function fN(Q){let X=xX();return z0((Y)=>j3(Y,X).length===Y.length,{expected:"an array with unique items",meta:{_tag:"isUnique"},toArbitraryConstraint:{array:{comparator:X}},...Q})}var Al=o.check(pN()),wl=o.check(cN(1,1));function X5(Q){let X=f1()([Q],([Y])=>(J,$,Z)=>{if(iW(J)){if(I0(J))return x8;return a0(h0(Y)(J.value,Z),{onSuccess:F,onFailure:(G)=>new q0($,F(J),[new A0(["value"],G)])})}return y(new v0($,F(J)))},{typeConstructor:{_tag:"effect/Option"},generation:{runtime:"Schema.Option(?)",Type:"Option.Option<?>",importDeclaration:'import * as Option from "effect/Option"'},expected:"Option",toCodec:([Y])=>N0()(J1([R0({_tag:t0("Some"),value:Y}),R0({_tag:t0("None")})]),j0({decode:(J)=>J._tag==="None"?b():F(J.value),encode:(J)=>O1(J)?{_tag:"Some",value:J.value}:{_tag:"None"}})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"Option"}:{},J.constant(b()),Y.map(F))},toEquivalence:([Y])=>eW(Y),toFormatter:([Y])=>S1({onNone:()=>"none()",onSome:(J)=>`some(${Y(J)})`})});return T(X.ast,{value:Q})}function Cl(Q){return cK(Q).pipe(p(X5(N1(Q)),yU()))}function Tl(Q){return y2(Q).pipe(p(X5(N1(Q)),bU()))}function Il(Q,X){return PN(Q).pipe(p(X5(N1(Q)),gU(X)))}function jl(Q){return X6(Q).pipe(p(X5(N1(Q)),hU()))}function El(Q){return U9(Q).pipe(p(X5(N1(Q)),mU()))}function Sl(Q,X){let Y=X===void 0?"omit":X.onNoneEncoding,J=Y===null?null:void 0;return U9(cK(Q)).pipe(p(X5(N1(Q)),wY({decode:($)=>$.pipe(z5(CX),F),encode:Y==="omit"?O5:($)=>F(rX(O5($),()=>J))})))}function xl(Q,X){let Y=f1()([Q,X],([J,$])=>(Z,G,K)=>{if(!WH(Z))return y(new v0(G,F(Z)));switch(Z._tag){case"Success":return a0(nZ(J)(Z.success,K),{onSuccess:l,onFailure:(W)=>new q0(G,F(Z),[new A0(["success"],W)])});case"Failure":return a0(nZ($)(Z.failure,K),{onSuccess:f,onFailure:(W)=>new q0(G,F(Z),[new A0(["failure"],W)])})}},{typeConstructor:{_tag:"effect/Result"},generation:{runtime:"Schema.Result(?, ?)",Type:"Result.Result<?, ?>",importDeclaration:'import * as Result from "effect/Result"'},expected:"Result",toCodec:([J,$])=>N0()(J1([R0({_tag:t0("Success"),success:J}),R0({_tag:t0("Failure"),failure:$})]),j0({decode:(Z)=>Z._tag==="Success"?l(Z.success):f(Z.failure),encode:(Z)=>C1(Z)?{_tag:"Success",success:Z.success}:{_tag:"Failure",failure:Z.failure}})),toArbitrary:([J,$])=>(Z,G)=>{return Z.oneof(G?.isSuspend?{maxDepth:2,depthIdentifier:"Result"}:{},J.map(l),$.map(f))},toEquivalence:([J,$])=>HH(J,$),toFormatter:([J,$])=>o1({onSuccess:(Z)=>`success(${J(Z)})`,onFailure:(Z)=>`failure(${$(Z)})`})});return T(Y.ast,{success:Q,failure:X})}function uN(Q,X){let Y=typeof X?.label==="string"?h0(t0(X.label)):void 0,J=f1()([Q],([$])=>(Z,G,K)=>{if(ZZ(Z)){let W=Y!==void 0?X1(Y(Z.label,K),(H)=>new A0(["label"],H)):h4;return _8(W,()=>a0(h0($)(r5(Z),K),{onSuccess:()=>Z,onFailure:()=>{let H=F(Z);return new q0(G,H,[new A0(["value"],new G0(H))])}}))}return y(new v0(G,F(Z)))},{typeConstructor:{_tag:"effect/Redacted",options:X},generation:{runtime:X!==void 0?`Schema.Redacted(?, ${v(X)})`:"Schema.Redacted(?)",Type:"Redacted.Redacted<?>",importDeclaration:'import * as Redacted from "effect/Redacted"'},expected:"Redacted",toCodecJson:([$])=>N0()(oK($),{decode:r((Z)=>G4(Z,{label:X?.label})),encode:X?.disallowJsonEncode?_Z((Z)=>"Cannot serialize Redacted"+(O1(Z)&&typeof Z.value.label==="string"?` with label: "${Z.value.label}"`:"")):r(r5)}),toArbitrary:([$])=>()=>$.map((Z)=>G4(Z,{label:X?.label})),toFormatter:()=>globalThis.String,toEquivalence:([$])=>iB($)});return T(J.ast,{value:Q})}function oK(Q){return Q.pipe(fK(X1(OY)))}function vl(Q,X){return oK(Q).pipe(p(uN(N1(Q),{label:X?.label,disallowJsonEncode:X?.disallowEncode}),{decode:r((Y)=>G4(Y,{label:X?.label})),encode:X?.disallowEncode?_Z((Y)=>"Cannot encode Redacted"+(O1(Y)&&typeof Y.value.label==="string"?` with label: "${Y.value.label}"`:"")):r(r5)}))}function kK(Q,X){let Y=f1()([Q,X],([J,$])=>(Z,G,K)=>{if(!nJ(Z))return y(new v0(G,F(Z)));switch(Z._tag){case"Fail":return a0(h0(J)(Z.error,K),{onSuccess:GQ,onFailure:(W)=>new q0(G,F(Z),[new A0(["error"],W)])});case"Die":return a0(h0($)(Z.defect,K),{onSuccess:KQ,onFailure:(W)=>new q0(G,F(Z),[new A0(["defect"],W)])});case"Interrupt":return h(Z)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([J,$])=>N0()(J1([R0({_tag:t0("Fail"),error:J}),R0({_tag:t0("Die"),defect:$}),R0({_tag:t0("Interrupt"),fiberId:y2(m2)})]),j0({decode:(Z)=>{switch(Z._tag){case"Fail":return GQ(Z.error);case"Die":return KQ(Z.defect);case"Interrupt":return WQ(Z.fiberId)}},encode:g})),toArbitrary:([J,$])=>lN(J,$),toEquivalence:([J,$])=>rN(J,$),toFormatter:([J,$])=>oN(J,$)});return T(Y.ast,{error:Q,defect:X})}function lN(Q,X){return(Y,J)=>{return Y.oneof(J?.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},Y.constant(WQ()),Y.integer({min:1}).map(WQ),Q.map(($)=>GQ($)),X.map(($)=>KQ($)))}}function rN(Q,X){return(Y,J)=>{if(Y._tag!==J._tag)return!1;switch(Y._tag){case"Fail":return Q(Y.error,J.error);case"Die":return X(Y.defect,J.defect);case"Interrupt":return Y.fiberId===J.fiberId}}}function oN(Q,X){return(Y)=>{switch(Y._tag){case"Fail":return`Fail(${Q(Y.error)})`;case"Die":return`Die(${X(Y.defect)})`;case"Interrupt":return"Interrupt"}}}function yK(Q,X){let Y=f1()([Q,X],([J,$])=>{let Z=f0(kK(J,$));return(G,K,W)=>{if(!oJ(G))return y(new v0(K,F(G)));return a0(h0(Z)(G.reasons,W),{onSuccess:ZQ,onFailure:(H)=>new q0(K,F(G),[new A0(["failures"],H)])})}},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([J,$])=>N0()(f0(kK(J,$)),j0({decode:ZQ,encode:({reasons:Z})=>Z})),toArbitrary:([J,$])=>nN(J,$),toEquivalence:([J,$])=>iN(J,$),toFormatter:([J,$])=>aN(J,$)});return T(Y.ast,{error:Q,defect:X})}function nN(Q,X){return(Y,J)=>{return Y.array(lN(Q,X)(Y,J)).map(ZQ)}}function iN(Q,X){let Y=bW(rN(Q,X));return(J,$)=>Y(J.reasons,$.reasons)}function aN(Q,X){let Y=oN(Q,X);return(J)=>`Cause([${J.reasons.map(Y).join(", ")}])`}var sN=(Q)=>(Q?.includeStack===!0?1:0)|(Q?.excludeCause===!0?2:0),tN=(Q)=>{switch(Q){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},eR=[];function kl(Q){let X=sN(Q),Y=eR[X];if(Y!==void 0)return Y;let J=tN(X),$=z4(globalThis.Error,{typeConstructor:{_tag:"Error",...J===void 0?{}:{options:J}},generation:{runtime:J!==void 0?`Schema.Error(${v(J)})`:"Schema.Error()",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>N0()(rr,vU(J)),toArbitrary:()=>(Z)=>Z.string().map((G)=>new globalThis.Error(G))});return eR[X]=$,$}var QN=[];function yl(Q){let X=sN(Q),Y=QN[X];if(Y!==void 0)return Y;let J=aK.pipe(p(gK,kU(tN(X))));return QN[X]=J,J}function bl(Q,X,Y){let J=f1()([Q,X,Y],([$,Z,G])=>{let K=yK(Z,G);return(W,H,_)=>{if(!aJ(W))return y(new v0(H,F(W)));switch(W._tag){case"Success":return a0(h0($)(W.value,_),{onSuccess:VQ,onFailure:(V)=>new q0(H,F(W),[new A0(["value"],V)])});case"Failure":return a0(h0(K)(W.cause,_),{onSuccess:_Q,onFailure:(V)=>new q0(H,F(W),[new A0(["cause"],V)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([$,Z,G])=>N0()(J1([R0({_tag:t0("Success"),value:$}),R0({_tag:t0("Failure"),cause:yK(Z,G)})]),j0({decode:(K)=>K._tag==="Success"?VQ(K.value):_Q(K.cause),encode:(K)=>H8(K)?{_tag:"Success",value:K.value}:{_tag:"Failure",cause:K.cause}})),toArbitrary:([$,Z,G])=>(K,W)=>K.oneof(W?.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},$.map((H)=>VQ(H)),nN(Z,G)(K,W).map((H)=>_Q(H))),toEquivalence:([$,Z,G])=>{let K=iN(Z,G);return(W,H)=>{if(W._tag!==H._tag)return!1;switch(W._tag){case"Success":return $(W.value,H.value);case"Failure":return K(W.cause,H.cause)}}},toFormatter:([$,Z,G])=>{let K=aN(Z,G);return(W)=>{switch(W._tag){case"Success":return`Exit.Success(${$(W.value)})`;case"Failure":return`Exit.Failure(${K(W.cause)})`}}}});return T(J.ast,{value:Q,error:X,defect:Y})}function gl(Q,X){let Y=f1()([Q,X],([J,$])=>{let Z=f0(B9([J,$]));return(G,K,W)=>{if(G instanceof globalThis.Map)return a0(h0(Z)([...G],W),{onSuccess:(H)=>new globalThis.Map(H),onFailure:(H)=>new q0(K,F(G),[new A0(["entries"],H)])});return y(new v0(K,F(G)))}},{typeConstructor:{_tag:"ReadonlyMap"},generation:{runtime:"Schema.ReadonlyMap(?, ?)",Type:"globalThis.ReadonlyMap<?, ?>"},expected:"ReadonlyMap",toCodec:([J,$])=>N0()(f0(B9([J,$])),j0({decode:(Z)=>new globalThis.Map(Z),encode:(Z)=>[...Z.entries()]})),toArbitrary:([J,$])=>(Z,G)=>{return Z.oneof(G?.isSuspend?{maxDepth:2,depthIdentifier:"ReadonlyMap"}:{},Z.constant([]),Z.array(Z.tuple(J,$),G?.constraints?.array)).map((K)=>new globalThis.Map(K))},toEquivalence:([J,$])=>EX(J,$),toFormatter:([J,$])=>(Z)=>{let G=Z.size;if(G===0)return"ReadonlyMap(0) {}";let K=globalThis.Array.from(Z.entries()).sort().map(([W,H])=>`${J(W)} => ${$(H)}`);return`ReadonlyMap(${G}) { ${K.join(", ")} }`}});return T(Y.ast,{key:Q,value:X})}function hl(Q,X){let Y=f1()([Q,X],([J,$])=>{let Z=f0(B9([J,$]));return(G,K,W)=>{if(gB(G))return a0(h0(Z)(VY(G),W),{onSuccess:HY,onFailure:(H)=>new q0(K,F(G),[new A0(["entries"],H)])});return y(new v0(K,F(G)))}},{typeConstructor:{_tag:"effect/HashMap"},generation:{runtime:"Schema.HashMap(?, ?)",Type:"HashMap.HashMap<?, ?>",importDeclaration:'import * as HashMap from "effect/HashMap"'},expected:"HashMap",toCodec:([J,$])=>N0()(f0(B9([J,$])),j0({decode:HY,encode:VY})),toArbitrary:([J,$])=>(Z,G)=>{return Z.oneof(G?.isSuspend?{maxDepth:2,depthIdentifier:"HashMap"}:{},Z.constant([]),Z.array(Z.tuple(J,$),G?.constraints?.array)).map(HY)},toEquivalence:([J,$])=>EX(J,$),toFormatter:([J,$])=>(Z)=>{let G=hB(Z);if(G===0)return"HashMap(0) {}";let K=VY(Z).sort().map(([W,H])=>`${J(W)} => ${$(H)}`);return`HashMap(${G}) { ${K.join(", ")} }`}});return T(Y.ast,{key:Q,value:X})}function ml(Q){let X=f1()([Q],([Y])=>{let J=f0(Y);return($,Z,G)=>{if($ instanceof globalThis.Set)return a0(h0(J)([...$],G),{onSuccess:(K)=>new globalThis.Set(K),onFailure:(K)=>new q0(Z,F($),[new A0(["values"],K)])});return y(new v0(Z,F($)))}},{typeConstructor:{_tag:"ReadonlySet"},generation:{runtime:"Schema.ReadonlySet(?)",Type:"globalThis.ReadonlySet<?>"},expected:"ReadonlySet",toCodec:([Y])=>N0()(f0(Y),j0({decode:(J)=>new globalThis.Set(J),encode:(J)=>[...J.values()]})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"ReadonlySet"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map((Z)=>new globalThis.Set(Z))},toEquivalence:([Y])=>SX(Y),toFormatter:([Y])=>(J)=>{let $=J.size;if($===0)return"ReadonlySet(0) {}";let Z=globalThis.Array.from(J.values()).sort().map((G)=>`${Y(G)}`);return`ReadonlySet(${$}) { ${Z.join(", ")} }`}});return T(X.ast,{value:Q})}function dl(Q){let X=f1()([Q],([Y])=>{let J=f0(Y);return($,Z,G)=>{if(cB($))return a0(h0(J)(W1($),G),{onSuccess:qY,onFailure:(K)=>new q0(Z,F($),[new A0(["values"],K)])});return y(new v0(Z,F($)))}},{typeConstructor:{_tag:"effect/HashSet"},generation:{runtime:"Schema.HashSet(?)",Type:"HashSet.HashSet<?>"},expected:"HashSet",toCodec:([Y])=>N0()(f0(Y),j0({decode:qY,encode:W1})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"HashSet"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map(qY)},toEquivalence:([Y])=>SX(Y),toFormatter:([Y])=>(J)=>{let $=fB(J);if($===0)return"HashSet(0) {}";let Z=globalThis.Array.from(J).sort().map((G)=>`${Y(G)}`);return`HashSet(${$}) { ${Z.join(", ")} }`}});return T(X.ast,{value:Q})}function pl(Q){let X=f1()([Q],([Y])=>{let J=f0(Y);return($,Z,G)=>{if(t7($))return a0(h0(J)(W1($),G),{onSuccess:e7,onFailure:(K)=>new q0(Z,F($),[new A0(["values"],K)])});return y(new v0(Z,F($)))}},{typeConstructor:{_tag:"effect/Chunk"},generation:{runtime:"Schema.Chunk(?)",Type:"Chunk.Chunk<?>"},expected:"Chunk",toCodec:([Y])=>N0()(f0(Y),j0({decode:e7,encode:W1})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"Chunk"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map(e7)},toEquivalence:([Y])=>d$(Y),toFormatter:([Y])=>(J)=>{let $=JB(J);if($===0)return"Chunk(0) {}";let Z=globalThis.Array.from(J).sort().map((G)=>`${Y(G)}`);return`Chunk(${$}) { ${Z.join(", ")} }`}});return T(X.ast,{value:Q})}var cl=z4(globalThis.RegExp,{typeConstructor:{_tag:"RegExp"},generation:{runtime:"Schema.RegExp",Type:"globalThis.RegExp"},expected:"RegExp",toCodecJson:()=>N0()(R0({source:o,flags:o}),e1({decode:(Q)=>m4({try:()=>new globalThis.RegExp(Q.source,Q.flags),catch:(X)=>new G0(F(X),{message:globalThis.String(X)})}),encode:(Q)=>h({source:Q.source,flags:Q.flags})})),toArbitrary:()=>(Q)=>Q.tuple(Q.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),Q.uniqueArray(Q.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((X)=>X.join(""))).map(([X,Y])=>new globalThis.RegExp(X,Y)),toEquivalence:()=>(Q,X)=>Q.source===X.source&&Q.flags===X.flags}),eN=o.annotate({expected:"a string that will be decoded as a URL"}),QM=z4(globalThis.URL,{typeConstructor:{_tag:"URL"},generation:{runtime:"Schema.URL",Type:"globalThis.URL"},expected:"URL",toCodecJson:()=>N0()(eN,LZ),toArbitrary:()=>(Q)=>Q.webUrl().map((X)=>new globalThis.URL(X)),toEquivalence:()=>(Q,X)=>Q.toString()===X.toString()}),fl=eN.pipe(p(QM,LZ)),XM=o.annotate({expected:"a string in ISO 8601 format that will be decoded as a Date"}),nK=z4(globalThis.Date,{typeConstructor:{_tag:"Date"},generation:{runtime:"Schema.Date",Type:"globalThis.Date"},expected:"Date",toCodecJson:()=>N0()(XM,FZ),toArbitrary:()=>(Q,X)=>Q.date(X?.constraints?.date)}),ul=XM.pipe(p(nK,FZ)),YM=nK.check(kN()),h2=O4(S3,{typeConstructor:{_tag:"effect/Duration"},generation:{runtime:"Schema.Duration",Type:"Duration.Duration",importDeclaration:'import * as Duration from "effect/Duration"'},expected:"Duration",toCodecJson:()=>N0()(J1([R0({_tag:t0("Infinity")}),R0({_tag:t0("NegativeInfinity")}),R0({_tag:t0("Nanos"),value:k2}),R0({_tag:t0("Millis"),value:HM})]),j0({decode:(Q)=>{switch(Q._tag){case"Infinity":return i8;case"NegativeInfinity":return P6;case"Nanos":return a8(Q.value);case"Millis":return S4(Q.value)}},encode:(Q)=>{switch(Q.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:Q.value.nanos};case"Millis":return{_tag:"Millis",value:Q.value.millis}}}})),toArbitrary:()=>(Q)=>Q.oneof(Q.constant(i8),Q.constant(P6),Q.bigInt().map(a8),Q.maxSafeInteger().map(S4)),toFormatter:()=>globalThis.String,toEquivalence:()=>x3}),ll=o.annotate({expected:"a string that will be decoded as a Duration"}),rl=ll.pipe(p(h2,TU)),ol=globalThis.BigInt(0),nl=k2.check(mN(ol)).pipe(p(h2,IU)),il=Y6.check(vN(0)).pipe(p(h2,jU)),JM=o.annotate({expected:"a string that will be decoded as a BigDecimal"}),$M=O4(b$,{typeConstructor:{_tag:"effect/BigDecimal"},generation:{runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclaration:'import * as BigDecimal from "effect/BigDecimal"'},expected:"BigDecimal",toCodecJson:()=>N0()(JM,PZ),toArbitrary:()=>(Q)=>Q.tuple(Q.bigInt(),Q.integer({min:0,max:20})).map(([X,Y])=>v6(X,Y)),toFormatter:()=>(Q)=>k8(Q),toEquivalence:()=>h$}),al=JM.pipe(p($M,PZ)),sl=ZM(gK);function ZM(Q){return o.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json",contentSchema:Y1(Q.ast)}).pipe(p(Q,uU))}var GM=z4(globalThis.File,{typeConstructor:{_tag:"File"},generation:{runtime:"Schema.File",Type:"globalThis.File"},expected:"File",toCodecJson:()=>N0()(R0({data:o.check(EN()),type:o,name:o,lastModified:Y6}),e1({decode:(Q)=>o1(c5(Q.data),{onFailure:(X)=>y(new G0(F(Q.data),{message:X.message})),onSuccess:(X)=>{let Y=new globalThis.Uint8Array(X);return h(new globalThis.File([Y],Q.name,{type:Q.type,lastModified:Q.lastModified}))}}),encode:(Q)=>C$({try:async()=>{let X=new globalThis.Uint8Array(await Q.arrayBuffer());return{data:$Y(X),type:Q.type,name:Q.name,lastModified:Q.lastModified}},catch:(X)=>new G0(F(Q),{message:globalThis.String(X)})})}))}),KM=z4(globalThis.FormData,{typeConstructor:{_tag:"FormData"},generation:{runtime:"Schema.FormData",Type:"globalThis.FormData"},expected:"FormData",toCodecJson:()=>N0()(f0(B9([o,J1([R0({_tag:Q5("String"),value:o}),R0({_tag:Q5("File"),value:GM})])])),e1({decode:(Q)=>{let X=new globalThis.FormData;for(let[Y,J]of Q)X.append(Y,J.value);return h(X)},encode:(Q)=>{return h(globalThis.Array.from(Q.entries()).map(([X,Y])=>{if(typeof Y==="string")return[X,{_tag:"String",value:Y}];else return[X,{_tag:"File",value:Y}]}))}}))});function tl(Q){return KM.pipe(p(Q,lU))}var WM=z4(globalThis.URLSearchParams,{typeConstructor:{_tag:"URLSearchParams"},generation:{runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"},expected:"URLSearchParams",toCodecJson:()=>N0()(o.annotate({expected:"a query string that will be decoded as URLSearchParams"}),j0({decode:(Q)=>new globalThis.URLSearchParams(Q),encode:(Q)=>Q.toString()}))});function el(Q){return WM.pipe(p(Q,rU))}var m2=Y6.check(SN()),HM=Y6.check(g2()),Qr=o.annotate({expected:"a string that will be decoded as a number"}).pipe(p(Y6,n5)),Xr=o.annotate({expected:"a string that will be decoded as a finite number"}).pipe(p(m2,n5)),Yr=T(pZ).pipe(p(k2,CY)),VM=o.check(jN()),Jr=o.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(p(VM,CU())),$r=o.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,dU)),Zr=o.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,pU)),Gr=o.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,cU)),Kr=o.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,fU)),bK=J1([m2,ON,o]),Wr=R0({issues:f0(R0({message:o,path:U9(f0(J1([bK,R0({key:bK})])))}))}),Hr=pK([0,1]).pipe(p(UN,j0({decode:(Q)=>Q===1,encode:(Q)=>Q?1:0}))),_M=o.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),d2=z4(globalThis.Uint8Array,{typeConstructor:{_tag:"Uint8Array"},generation:{runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"},expected:"Uint8Array",toCodecJson:()=>N0()(_M,RZ),toArbitrary:()=>(Q)=>Q.uint8Array()}),Vr=_M.pipe(p(d2,RZ)),_r=o.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(p(d2,{decode:BU(),encode:NY()})),qr=o.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(p(d2,{decode:OU(),encode:MY()})),p2=O4((Q)=>c$(Q)&&KB(Q),{typeConstructor:{_tag:"effect/DateTime.Utc"},generation:{runtime:"Schema.DateTimeUtc",Type:"DateTime.Utc",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Utc",toCodecJson:()=>N0()(o,AZ),toArbitrary:()=>(Q,X)=>Q.date({noInvalidDate:!0,...X?.constraints?.date}).map((Y)=>HB(Y)),toFormatter:()=>(Q)=>Q.toString(),toEquivalence:()=>f$}),Dr=YM.pipe(p(p2,{decode:UZ(),encode:r(BB)})),Br=o.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(p(p2,AZ)),Ur=Y6.pipe(p(p2,{decode:UZ(),encode:r(UB)})),Or=O4(ZB,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Offset"},generation:{runtime:"Schema.TimeZoneOffset",Type:"DateTime.TimeZone.Offset",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Offset",toCodecJson:()=>N0()(Y6,oU),toArbitrary:()=>(Q)=>Q.integer({min:-43200000,max:50400000}).map((X)=>TQ(X)),toFormatter:()=>(Q)=>p4(Q),toEquivalence:()=>(Q,X)=>Q.offset===X.offset}),qM=o.annotate({expected:"an IANA time zone identifier"}),DM=O4(GB,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Named"},generation:{runtime:"Schema.TimeZoneNamed",Type:"DateTime.TimeZone.Named",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Named",toCodecJson:()=>N0()(qM,NZ),toArbitrary:()=>(Q)=>Q.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(u$)),toFormatter:()=>(Q)=>p4(Q),toEquivalence:()=>(Q,X)=>Q.id===X.id}),zr=qM.pipe(p(DM,NZ)),BM=o.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),UM=O4($B,{typeConstructor:{_tag:"effect/DateTime.TimeZone"},generation:{runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone",toCodecJson:()=>N0()(BM,MZ),toArbitrary:()=>(Q)=>Q.oneof(Q.integer({min:-43200000,max:50400000}).map((X)=>TQ(X)),Q.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(u$))),toFormatter:()=>(Q)=>p4(Q),toEquivalence:()=>(Q,X)=>p4(Q)===p4(X)}),Fr=BM.pipe(p(UM,MZ)),OM=o.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),zM=O4((Q)=>c$(Q)&&WB(Q),{typeConstructor:{_tag:"effect/DateTime.Zoned"},generation:{runtime:"Schema.DateTimeZoned",Type:"DateTime.Zoned",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Zoned",toCodecJson:()=>N0()(OM,wZ),toArbitrary:()=>(Q,X)=>Q.tuple(Q.date({noInvalidDate:!0,min:new globalThis.Date(-8639999949600000),max:new globalThis.Date(8639999949600000),...X?.constraints?.date}),Q.constantFrom("UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney")).map(([Y,J])=>VB(Y,{timeZone:J})),toFormatter:()=>(Q)=>YY(Q),toEquivalence:()=>f$}),Lr=OM.pipe(p(zM,wZ)),Pr=globalThis.Symbol.for("immer-draftable");function iK(Q,X,Y,J,$){let Z=Nr(Y,X,J),G=FM(X),K=class extends Q{constructor(...[W,H]){W=W??{};let _=Y.make(W,H);super({...W,..._},{...H,disableChecks:!0})}static[UX]=UX;get[G](){return G}static[Pr]=!0;static identifier=X;static fields=Y.fields;static get ast(){return Z(this).ast}static pipe(){return X0(this,arguments)}static rebuild(W){return Z(this).rebuild(W)}static make(W,H){return new this(W,H)}static makeOption(W,H){return oY(Z(this))(W??{},H)}static makeEffect(W,H){return Z(this).makeEffect(W??{},H)}static annotate(W){return this.rebuild(l6(this.ast,W))}static annotateKey(W){return this.rebuild(iQ(this.ast,W))}static check(...W){return this.rebuild(l4(this.ast,W))}static extend(W){return(H,_)=>{let V={...Y.fields,...H};return iK(this,W,dK(vY(V,Y.ast.checks,{identifier:W}),V),_,$)}}static mapFields(W,H){return Y.mapFields(W,H)}};if($!==void 0)Object.assign(K.prototype,$(X));return K}function Rr(Q){return new H0(r((X)=>new Q(X)),b1())}function FM(Q){return`~effect/Schema/Class/${Q}`}function Nr(Q,X,Y){let J;return($)=>{if(J===void 0){let Z=Rr($),G=T(new p6([Q.ast],()=>(K,W)=>{return K instanceof $||N(K,FM(X))?h(K):y(new v0(W,F(K)))},{identifier:X,[e5]:([K])=>new B0(K,Z),toCodec:([K])=>new B0(K.ast,Z),toArbitrary:([K])=>()=>K.map((W)=>new $(W)),toFormatter:([K])=>(W)=>`${$.identifier}(${K(W)})`,"~sentinels":lQ(Q.ast),...Y}));J=Q.pipe(p(G,Z))}return J}}function c2(Q){return v2(Q)}var LM=(Q)=>(X,Y)=>{let J=c2(X)?X:R0(X);return iK(lq,Q,J,Y,($)=>({toString(){return`${$}(${v({...this})})`}}))},Mr=(Q)=>{return(X,Y,J)=>{let $=c2(Y)?Y.mapFields((Z)=>({_tag:Q5(X),...Z}),{unsafePreserveChecks:!0}):b2(X,Y);return LM(Q??X)($,J)}},PM=(Q)=>(X,Y)=>{let J=c2(X)?X:R0(X);return iK(gX,Q,J,Y,(Z)=>({name:Z}))},Ar=(Q)=>{return(X,Y,J)=>{let $=c2(Y)?Y.mapFields((Z)=>({_tag:Q5(X),...Z}),{unsafePreserveChecks:!0}):b2(X,Y);return PM(Q??X)($,J)}};function RM(Q){let X=Wz(Q.ast);return(Y)=>X(Y,{})}function wr(Q){return RM(Q)(xK)}function Cr(Q){return(X)=>{return X.annotate({toFormatter:Q})}}function Tr(Q,X){return Y(Q.ast);function Y($){let Z=D8($)?.toFormatter;if(typeof Z==="function")return Z(b8($)?$.typeParameters.map(Y):[]);if(X?.onBefore){let G=X.onBefore($,Y);if(G!==void 0)return G}return J($)}function J($){switch($._tag){default:return v;case"Never":return()=>"never";case"Void":return()=>"void";case"Arrays":{let Z=$.elements.map(Y),G=$.rest.map(Y);return(K)=>{let W=[],H=0;for(;H<Z.length;H++)if(K.length<H+1){if(E0($.elements[H]))continue}else W.push(Z[H](K[H]));if(G.length>0){let[_,...V]=G;for(;H<K.length-V.length;H++)W.push(_(K[H]));for(let q=0;q<V.length;q++)H+=q,W.push(V[q](K[H]))}return"["+W.join(", ")+"]"}}case"Objects":{let Z=$.propertySignatures.map((K)=>Y(K.type)),G=$.indexSignatures.map((K)=>Y(K.type));if($.propertySignatures.length===0&&$.indexSignatures.length===0)return v;return(K)=>{let W=[],H=new Set;for(let _=0;_<Z.length;_++){let V=$.propertySignatures[_],q=V.name;if(H.add(q),E0(V.type)&&!Object.hasOwn(K,q))continue;W.push(`${R4(q)}: ${Z[_](K[q])}`)}for(let _=0;_<G.length;_++){let V=f6(K,$.indexSignatures[_].parameter);for(let q of V){if(H.has(q))continue;H.add(q),W.push(`${R4(q)}: ${G[_](K[q])}`)}}return W.length>0?"{ "+W.join(", ")+" }":"{}"}}case"Union":{let Z=(G)=>rQ(G,$.types);return(G)=>{let K=Z(G),W=K.map(QX);for(let H=0;H<K.length;H++){let _=W[H];if(_(G))return Y(K[H])(G)}return v(G)}}case"Suspend":{let Z=u6(()=>Y($.thunk()));return(G)=>Z()(G)}}}}function Ir(Q){return(X)=>X.annotate({toEquivalence:Q})}function jr(Q){return Mz(Q.ast)}function NM(Q){return Cz(Q.ast)}function MM(Q,X){let Y=NM(Q),J=Tz(Y,X);return{dialect:"draft-2020-12",schema:J.schema,definitions:J.definitions}}function AM(Q){return T(wM(Q.ast))}var wM=r6((Q)=>{let X=Er(Q,wM);return X!==Q&&E0(Q)?t5(X):X});function Er(Q,X){switch(Q._tag){case"Declaration":{let Y=Q.annotations?.toCodecJson??Q.annotations?.toCodec;if(Y8(Y)){let J=b8(Q)?Q.typeParameters.map((G)=>n6(Y1(G))):[],$=Y(J),Z=X($.to);return D0(Q,Z===$.to?[$]:[new B0(Z,$.transformation)])}return D0(Q,[iO])}case"Unknown":case"ObjectKeyword":return D0(Q,[aO]);case"Undefined":case"Void":case"Literal":case"Number":return Q.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return Q.toCodecStringTree();case"Objects":{if(Q.propertySignatures.some((Y)=>typeof Y.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:Q});return Q.recur(X)}case"Union":{let Y=sY(Q.types);if(Y!==Q.types)return new h1(Y,Q.mode,Q.annotations,Q.checks,Q.encoding,Q.context).recur(X);return Q.recur(X)}case"Arrays":case"Suspend":return Q.recur(X)}return Q}function CM(Q){return T(TM(U8(Q.ast)))}var TM=p0((Q)=>{let X=Sr(Q,TM);return X!==Q&&E0(Q)?t5(X):X});function Sr(Q,X){switch(Q._tag){case"Declaration":{let Y=Q.annotations?.toCodecIso??Q.annotations?.toCodec;if(Y8(Y)){let J=Y(Q.typeParameters.map((Z)=>n6(Z))),$=X(J.to);return D0(Q,$===J.to?[J]:[new B0($,J.transformation)])}return Q}case"Arrays":case"Objects":case"Union":case"Suspend":return Q.recur(X)}return Q}function IM(Q,X){return T(xM(X?.keepDeclarations===!0?SM(Q.ast):EM(Q.ast)))}function xr(Q,X){let Y=u5(Q.ast)??$Z(Q.ast),J=WN(IM(Q));return($)=>J($).pipe(j$((Z)=>vr(Z,{rootName:Y,...X})))}function vr(Q,X){let Y=X.rootName??"root",J=X.arrayItemName??"item",$=X.pretty??!0,Z=X.indent??" ",G=X.sortKeys??!0,K=new Set,W=[];return _(Y,Q,0),W.join($?`
66
- `:"");function H(V,q){W.push($?Z.repeat(V)+q:q)}function _(V,q,D,U){let{attrs:P,safe:L}=D9.tagInfo(V,U);if(q===void 0)H(D,`<${L}${P}/>`);else if(typeof q==="string")H(D,`<${L}${P}>${D9.escapeText(q)}</${L}>`);else if(typeof q!=="object"||q===null)H(D,`<${L}${P}>${D9.escapeText(v(q))}</${L}>`);else{if(K.has(q))throw new globalThis.Error("Cycle detected while serializing to XML.",{cause:q});K.add(q);try{if(globalThis.globalThis.Array.isArray(q)){if(q.length===0){H(D,`<${L}${P}/>`);return}H(D,`<${L}${P}>`);for(let R of q)_(J,R,D+1);H(D,`</${L}>`);return}let M=q,w=Object.keys(M);if(G)w.sort();if(w.length===0){H(D,`<${L}${P}/>`);return}H(D,`<${L}${P}>`);for(let R of w)_(D9.parseTagName(R).safe,M[R],D+1,R);H(D,`</${L}>`)}finally{K.delete(q)}}}}var D9={escapeText(Q){return Q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeAttribute(Q){return Q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},parseTagName(Q){let X=Q,Y=Q;if(!/^[A-Za-z_]/.test(Y))Y="_"+Y;if(Y=Y.replace(/[^A-Za-z0-9._-]/g,"_"),/^xml/i.test(Y))Y="_"+Y;return{safe:Y,changed:Y!==X}},tagInfo(Q,X){let{changed:Y,safe:J}=D9.parseTagName(Q),Z=Y||X&&X!==Q?` data-name="${D9.escapeAttribute(X??Q)}"`:"";return{safe:J,attrs:Z}}};function kr(Q){switch(Q._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}var yr=tZ(kr);function jM(Q,X,Y){switch(Q._tag){case"Declaration":{let J=Q.annotations?.toCodecJson??Q.annotations?.toCodec;if(Y8(J)){let $=b8(Q)?Q.typeParameters.map((K)=>T(X(Y1(K)))):[],Z=J($),G=X(Z.to);return D0(Q,G===Z.to?[Z]:[new B0(G,Z.transformation)])}return Y(Q)}case"Null":return D0(Q,[br]);case"Boolean":return D0(Q,[gr]);case"Unknown":case"ObjectKeyword":return D0(Q,[sO]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return Q.toCodecStringTree();case"Objects":{if(Q.propertySignatures.some((J)=>typeof J.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:Q});return Q.recur(X)}case"Union":{let J=yr(Q.types);if(J!==Q.types)return new h1(J,Q.mode,Q.annotations,Q.checks,Q.encoding,Q.context).recur(X);return Q.recur(X)}case"Arrays":case"Suspend":return Q.recur(X)}return Q}var br=new B0(new g1("null"),new H0(r(()=>null),r(()=>"null"))),gr=new B0(new h1([new g1("true"),new g1("false")],"anyOf"),new H0(r((Q)=>Q==="true"),g6())),EM=r6((Q)=>{let X=jM(Q,EM,(Y)=>D0(Y,[hr]));if(X!==Q&&E0(Q))return t5(X);return X}),hr=new B0(TZ,new H0(b1(),r(()=>{return}))),SM=r6((Q)=>{let X=jM(Q,SM,g);if(X!==Q&&E0(Q))return t5(X);return X}),XN="~effect/Schema/SERIALIZER_ENSURE_ARRAY",xM=r6((Q)=>{if(EY(Q)&&Q.annotations?.[XN])return Q;let X=mr(Q);if(jY(X)){let Y=new h1([X,pY(c6,X,new H0(_U(),b1()))],"anyOf",{[XN]:!0});return E0(Q)?dY(Y):Y}return X});function mr(Q){switch(Q._tag){default:return Q;case"Declaration":case"Arrays":case"Objects":case"Union":case"Suspend":return Q.recur(xM)}}function dr(Q){let X=CM(Q);return yz(aZ(X),iZ(X))}function pr(Q){return Z2()}function cr(Q){return Z2()}function fr(Q,X){return(Y)=>{return T(l6(Y.ast,{toCodecIso:()=>new B0(Q.ast,AY(X))}),{schema:Y})}}function ur(Q){let X=AM(Q),Y=aZ(X),J=iZ(X);return{empty:[],diff:($,Z)=>eY(Y($),Y(Z)),combine:($,Z)=>[...$,...Z],patch:($,Z)=>{let G=Y($),K=Ez(Z,G);return Object.is(K,G)?$:J(K)}}}function lr(Q){let X=RN(()=>Y),Y=J1([Q,f0(X),zN(o,X)]);return Y}var aK=T(fY),rr=R0({message:o,name:X6(o),stack:X6(o),cause:X6(aK)}),or=T(nO);function nr(Q){return D8(Q.ast)}function ir(Q){return Q.ast.context?.annotations}var L4=O(fM(),1),Go=["dist","build","_build","out","target",".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless","coverage",".nyc_output",".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox","__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target","tmp",".tmp",".state",".terraform",".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"],oM=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"],nM=new Set([">",">>","<","<<","<<<","<>",">&","<&","&>","&>>"]),iM=new Set([";","&&","||","|","|&","&"]),aM=(Q)=>typeof Q==="string",F4=(Q)=>{if(typeof Q==="object"&&"op"in Q&&typeof Q.op==="string")return Q.op;return null},Ko=(Q)=>typeof Q==="object"&&("comment"in Q),Wo=(Q)=>{try{let X=[...new Bun.Glob(Q).scanSync({onlyFiles:!1,dot:!0})];if(X.length>0)return X}catch{}return[Q]},Ho=(Q)=>{if(aM(Q))return[Q];if(typeof Q==="object"&&"op"in Q&&Q.op==="glob"&&"pattern"in Q)return Wo(String(Q.pattern));let X=F4(Q);if(X!==null){if(nM.has(X)||iM.has(X))return[];return[`__op_${X}__`]}if(Ko(Q))return[];return["__tripwire_cmd_sub__"]},uM=(Q,X)=>{let Y=[],J=[],$=[],Z=[],G=0;while(G<Q.length){let _=Q[G],V=F4(_);if(V!==null&&nM.has(V)){let q=Y.at(-1);if(q!==void 0&&/^[0-9]+$/.test(q)&&X.remaining>0)Y.pop(),X.remaining--;let D=Q[G+1];if(D!==void 0&&aM(D)){Z.push({op:V,target:D}),G+=2;continue}G++;continue}for(let q of Ho(_))Y.push(q);G++}if(Y.length===0)return null;for(let _=1;_<Y.length;_++){let V=Y[_];if(V.startsWith("-")&&V!=="-")$.push(V);else J.push(V)}let K=Y[0],W=K.lastIndexOf("/");return{head:W===-1?K:K.slice(W+1),tokens:Y,args:J,flags:$,redirects:Z,raw:Y.join(" ")}},Vo=(Q)=>`$${Q}`,_o=(Q)=>{let X=[];for(let Y=0;Y<Q.length;Y++){let J=Q[Y],$=Q[Y+1];if(F4(J)==="&"&&$!==void 0&&(F4($)===">"||F4($)===">>")){let Z={op:F4($)===">"?"&>":"&>>"};X.push(Z),Y++;continue}if(F4(J)===">"&&$!==void 0&&F4($)==="|"){X.push({op:">"}),Y++;continue}X.push(J)}return X},qo=(Q)=>{return Q.match(/(?<![\w$])\d+(?=[<>])/g)?.length??0},eK=(Q)=>{let X=/<<-?\s*(?:"(?<quoted>[^"]+)"|'(?<single>[^']+)'|(?<unquoted>[A-Za-z_][A-Za-z0-9_]*))/u.exec(Q);return X?.groups?.quoted??X?.groups?.single??X?.groups?.unquoted??null},Do=/(?:^|[|;&]\s*)(?:\/(?:usr\/bin|bin|usr\/local\/bin|opt\/homebrew\/bin)\/)?(?:sh|bash|zsh|dash|ksh|ash)(?:\s|$)/u,QW=(Q)=>Do.test(Q),sM=(Q)=>{let X=Q.split(`
67
- `),Y=[];for(let J=0;J<X.length;J++){let $=X[J];Y.push($);let Z=eK($);if(Z===null||QW($))continue;J++;while(J<X.length&&X[J].trim()!==Z)J++;if(J<X.length)Y.push("__HEREDOC_BODY__"),Y.push(X[J])}return Y.join(`
68
- `)},tM=(Q)=>{let X=new Map,Y=Q.split(`
69
- `);for(let J=0;J<Y.length;J++){let $=Y[J],Z=eK($);if(Z===null||QW($))continue;let G=[];J++;while(J<Y.length&&Y[J].trim()!==Z)G.push(Y[J]),J++;if(!X.has(Z))X.set(Z,G.join(`
70
- `))}return X},Bo=(Q)=>{let X=Q.split(`
71
- `),Y=[];for(let J=0;J<X.length;J++){let $=X[J],Z=eK($);if(Z===null||!QW($))continue;let G=[];J++;while(J<X.length&&X[J].trim()!==Z)G.push(X[J]),J++;if(G.length>0)Y.push(G.join(`
72
- `))}return Y},Uo=(Q,X)=>{for(let Y=X;Y<Q.length;Y++){let J=Q[Y];if(J==="\\"){Y++;continue}if(J==="`")return Y}return null},Oo=(Q,X)=>{let Y=1,J=null;for(let $=X;$<Q.length;$++){let Z=Q[$];if(Z==="\\"){$++;continue}if(J==="single"){if(Z==="'")J=null;continue}if(Z==="'"){J??="single";continue}if(Z==='"'){J=J==="double"?null:"double";continue}if(Z==="("){Y++;continue}if(Z===")"){if(Y--,Y===0)return $}}return null},zo=(Q)=>{let X=[],Y=null;for(let J=0;J<Q.length;J++){let $=Q[J];if($==="\\"){J++;continue}if(Y==="single"){if($==="'")Y=null;continue}if($==="'"){Y??="single";continue}if($==='"'){Y=Y==="double"?null:"double";continue}if($==="`"){let H=Uo(Q,J+1);if(H!==null)X.push(Q.slice(J+1,H)),J=H;continue}let Z=Q[J+1];if(!($==="$"&&Z==="(")&&!(Y===null&&($==="<"||$===">")&&Z==="("))continue;let W=Oo(Q,J+2);if(W!==null)X.push(Q.slice(J+2,W)),J=W}return X},eM=/^\$\{?HOME\}?(?:\/|$)/,QA=(Q)=>{if(Q===""||Q==="-")return!1;if(Q==="/"||Q==="~"||Q==="."||Q==="..")return!0;if(Q.startsWith("/")||Q.startsWith("~")||Q.startsWith("./")||Q.startsWith("../")||eM.test(Q))return!0;return!1},u2=(Q)=>{if(Q==="/")return 100;if(Q==="~"||eM.test(Q))return 90;if(/^\/(?<dir>etc|usr|bin|sbin|System|Library|var|boot|root|home)(?<suffix>\/|$)/.test(Q))return 80;if(Q.startsWith("/Users/"))return 70;if(Q.startsWith("/")||Q.startsWith("~"))return 60;if(Q.startsWith("../"))return 40;if(Q===".."||Q==="."||Q.startsWith("./"))return 10;return 50},Fo=new Set(["-e","--extension","-t","--type","-E","--exclude","-d","--max-depth","--min-depth","--exact-depth","-c","--color","--changed-within","--changed-before","-S","--size","-o","--owner","-j","--threads","-g","--glob","--format","--max-results","--ignore-file","--search-path","--base-directory","--path-separator","--and"]),Lo=(Q,X)=>{let Y=[],J=1;while(J<X){let $=Q[J];if(Fo.has($)){J+=2;continue}if($.startsWith("-")){J++;continue}if(QA($))Y.push($);J++}if(Y.length===0)return".";return Y.sort(($,Z)=>u2(Z)-u2($)),Y[0]},Po=(Q,X)=>{let Y=[];for(let J=1;J<X;J++){let $=Q[J];if($.startsWith("-"))break;if(QA($))Y.push($)}if(Y.length===0)return".";return Y.sort((J,$)=>u2($)-u2(J)),Y[0]},lM={execFlags:new Set(["-x","-X","--exec","--exec-batch"]),placeholders:new Set(["{}","{/}","{//}","{.}","{/.}"]),pickRoot:Lo},rM={execFlags:new Set(["-exec","-execdir","-ok","-okdir"]),placeholders:new Set(["{}"]),pickRoot:Po},Ro=Object.assign(Object.create(null),{fd:lM,fdfind:lM,find:rM,gfind:rM}),No=(Q,X,Y)=>Q.map((J)=>X.placeholders.has(J)?Y:J),Mo=(Q)=>{let X=Ro[Q.head];if(X===void 0)return[];let Y=[],J=Q.tokens;for(let $=1;$<J.length;$++){if(!X.execFlags.has(J[$]))continue;let Z=[],G=$+1;while(G<J.length){let H=J[G];if(H===";"||H==="+")break;Z.push(H),G++}if(Z.length===0)continue;let K=Z[0];if(X.placeholders.has(K))continue;let W=X.pickRoot(J,$);Y.push(L4.quote(No(Z,X,W))),$=G}return Y},Ao=/\$\(\s*cat\s+<<-?\s*['"]?(?<delimiter>\w+)['"]?\s*\n(?<body>[\s\S]*?)\n\s*\k<delimiter>\s*\)/u,wo=/\$\(\s*(?:printf|echo)\s+(?:-[a-zA-Z]+\s+)*'(?<content>[^']*)'/u,l2=(Q,X)=>{let Y=Ao.exec(Q);if(Y!==null){let $=Y.groups?.body??Q;if(X!==void 0&&$.trim()==="__HEREDOC_BODY__"){let Z=Y.groups?.delimiter,G=Z===void 0?void 0:X.get(Z);if(G!==void 0)return G}return $}let J=wo.exec(Q);if(J!==null)return J.groups?.content??Q;return Q},Co=new Set(["sh","bash","zsh","dash","ksh","ash"]),To=(Q)=>{if(!Co.has(Q.head))return[];let X=Q.tokens;for(let Y=1;Y<X.length;Y++){let J=X[Y];if(J==="-c"&&Y+1<X.length)return[X[Y+1]];if(J.startsWith("-")&&!J.startsWith("--")&&J.endsWith("c")&&J.length>2&&Y+1<X.length)return[X[Y+1]]}return[]},Io=new Set(["command","exec","env","time","nohup","setsid","nice","ionice","chronic","stdbuf","unbuffer","script","taskset","sudo","doas","xargs","watch"]),jo={command:new Set,env:new Set(["-u","--unset","-C","--chdir","-S","--split-string","--block-signal"]),time:new Set(["-f","--format","-o","--output"]),nice:new Set(["-n","--adjustment"]),ionice:new Set(["-c","--class","-n","--classdata","-p","--pid"]),stdbuf:new Set(["-i","--input","-o","--output","-e","--error"]),script:new Set(["-c","--command"]),taskset:new Set,sudo:new Set(["-u","--user","-g","--group","-C","--close-from","-D","--chdir","-h","--host","-p","--prompt","-r","--role","-t","--type","-U","--other-user","-R","--chroot","-T","--command-timeout"]),doas:new Set(["-a","-C","-u"]),xargs:new Set(["-I","-i","-J","-n","--max-args","-P","--max-procs","-s","--max-chars","-L","--max-lines","-E","--eof","-d","--delimiter","-a","--arg-file","--replace"]),watch:new Set(["-n","--interval"])},Eo=(Q)=>/^[A-Za-z_][A-Za-z0-9_]*=.*/u.test(Q),So=(Q)=>{let X=Q[0],Y=jo[X]??new Set,J=1;while(J<Q.length){let $=Q[J];if(X==="env"&&Eo($)){J++;continue}if(Y.has($)){J+=2;continue}if($.includes("=")&&Y.has($.slice(0,$.indexOf("=")))){J++;continue}if($.startsWith("--")&&$!=="--"){J++;continue}if($.startsWith("-")&&$!=="-"){J++;continue}break}return J},xo=(Q)=>{if(!Io.has(Q.head))return[];if(Q.head==="script")for(let J=1;J<Q.tokens.length-1;J++){let $=Q.tokens[J];if($==="-c"||$==="--command")return[Q.tokens[J+1]];if($.startsWith("--command="))return[$.slice(10)]}let X=So(Q.tokens),Y=L4.quote(Q.tokens.slice(X));return Y===""?[]:[Y]},vo=new Set(["eval"]),ko=(Q)=>{if(!vo.has(Q.head))return[];if(Q.tokens.length===2)return[Q.tokens[1]];let X=L4.quote(Q.tokens.slice(1));return X===""?[]:[X]},yo=new Set(["run","proxy","err","test","summary"]),bo=(Q)=>Q==="rtk",go=(Q)=>{let X=1;while(X<Q.length){let Y=Q[X];if(Y.startsWith("-")&&Y!=="-"&&Y!=="--"){X++;continue}break}return X},XA=(Q,X)=>{for(let Y=X;Y<Q.length;Y++){let J=Q[Y];if((J==="-c"||J==="--command")&&Y+1<Q.length)return Q[Y+1];if(J.startsWith("--command="))return J.slice(10)}return null},ho=(Q)=>{if(!bo(Q.head))return[];let X=go(Q.tokens),Y=Q.tokens[X];if(Y===void 0)return[];if(yo.has(Y)){let $=XA(Q.tokens,X+1);if($!==null)return $===""?[]:[$];let Z=X+1;while(Z<Q.tokens.length){let K=Q.tokens[Z];if(K==="--"){Z++;break}if(K.startsWith("-")&&K!=="-"){Z++;continue}break}let G=L4.quote(Q.tokens.slice(Z));return G===""?[]:[G]}let J=L4.quote(Q.tokens.slice(X));return J===""?[]:[J]},mo={timeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},gtimeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},chroot:{valueFlags:new Set(["--userspec","--groups"]),skipPositionals:1,dashCommand:!1},flock:{valueFlags:new Set(["-w","--wait","--timeout","-E","--conflict-exit-code"]),skipPositionals:1,dashCommand:!0},su:{valueFlags:new Set,skipPositionals:0,dashCommand:!0}},po=(Q)=>{let X=mo[Q.head];if(X===void 0)return[];if(X.dashCommand){let $=XA(Q.tokens,1);if($!==null)return $===""?[]:[$]}let Y=1;while(Y<Q.tokens.length){let $=Q.tokens[Y];if(X.valueFlags.has($)){Y+=2;continue}if($.includes("=")&&X.valueFlags.has($.slice(0,$.indexOf("=")))){Y++;continue}if($==="--"){Y++;break}if($.startsWith("-")&&$!=="-"){Y++;continue}break}Y+=X.skipPositionals;let J=L4.quote(Q.tokens.slice(Y));return J===""?[]:[J]},co=[Mo,To,xo,ko,ho,po],fo=(Q)=>{let X="",Y=!1,J=!1,$=!1;for(let Z of Q){if($){X+=Z,$=!1;continue}if(Z==="\\"){X+=Z,$=!0;continue}if(Z==="'"&&!J){Y=!Y,X+=Z;continue}if(Z==='"'&&!Y){J=!J,X+=Z;continue}X+=Z===`
73
- `&&!Y&&!J?" ; ":Z}return X},L9=(Q)=>{let X,Y=fo(sM(Q));try{X=L4.parse(Y,Vo)}catch{return[]}X=_o(X);let J={remaining:qo(Y)},$=[],Z=[];for(let W of X){let H=F4(W);if(H!==null&&iM.has(H)){let _=uM(Z,J);if(_!==null)$.push(_);Z=[];continue}Z.push(W)}let G=uM(Z,J);if(G!==null)$.push(G);for(let W of[...zo(Q),...Bo(Q)])for(let H of L9(W))$.push(H);let K=$.length;for(let W=0;W<K;W++){let H=$[W];for(let _ of co)for(let V of _(H))for(let q of L9(V))$.push(q)}return $},uo=(Q)=>Q.startsWith("./")?Q.slice(2):Q,XW=(Q,X=[],Y=[])=>{if(Q==="")return!1;let J=uo(Q);if(J===".."||J.startsWith("../")||J.includes("/../"))return!1;for(let $ of[...oM,...Y])if(J===$||J.startsWith(`${$}/`))return!0;for(let $ of[...Go,...X])if(J===$||J.startsWith(`${$}/`))return!0;return!1},YA=(Q=[],X=[])=>{let Y={"build outputs":["dist","build","_build","out","target"],"js framework outputs":[".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless"],"tests / coverage":["coverage",".nyc_output"],caches:[".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox"],"language / package":["__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target"],"tmp / state":["tmp",".tmp",".state",...oM],iac:[".terraform"],"bundler dev":[".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"]};if(Q.length>0)Y["custom relative"]=Q;if(X.length>0)Y["custom absolute"]=X;return Object.entries(Y).map(([J,$])=>` ${J}: ${$.join(", ")}`).join(`
74
- `)},q1=(Q)=>/(?<prefix>^|\s)#\s*tripwire-allow\b/.test(sM(Q));var P9=require("fs"),$A=require("os");var JA=E.Struct({pattern:E.String,message:E.String,action:E.optional(E.Union([E.Literal("deny"),E.Literal("ask")])),requiresFlags:E.optional(E.Array(E.String)),forbidsFlagValues:E.optional(E.Array(E.Struct({flag:E.String,values:E.Array(E.String)})))}),lo=E.Struct({protectedBranches:E.optional(E.Array(E.String)),enforceConventionalCommits:E.optional(E.Boolean)}),ro=E.Struct({relative:E.optional(E.Array(E.String)),absolute:E.optional(E.Array(E.String))}),oo=E.Struct({git:E.optional(lo),safePaths:E.optional(ro),blockedCommands:E.optional(E.Array(JA)),allowedCommands:E.optional(E.Array(JA))}),YW=`${$A.homedir()}/.config/tripwire/config.json`,no=(Q)=>U0.sync(()=>{try{return P9.accessSync(Q,P9.constants.R_OK),!0}catch{return!1}}),io=(Q)=>U0.try({try:()=>P9.readFileSync(Q,"utf8"),catch:(X)=>X}),ao=(Q)=>U0.try({try:()=>JSON.parse(Q),catch:(X)=>X}),so=(Q)=>E.decodeUnknownEffect(oo)(Q,{onExcessProperty:"error"}),J5=()=>({git:{protectedBranches:["main","master","develop","production","release"],enforceConventionalCommits:!0},safePaths:{},blockedCommands:[],allowedCommands:[]}),JW=(Q)=>({git:Q.git??J5().git,safePaths:Q.safePaths??J5().safePaths,blockedCommands:Q.blockedCommands??J5().blockedCommands,allowedCommands:Q.allowedCommands??J5().allowedCommands}),ZA=(Q=YW)=>U0.gen(function*(){if(!(yield*no(Q)))return{ok:!0,config:J5()};let Y=yield*io(Q),J=yield*ao(Y),$=yield*so(J);return{ok:!0,config:JW($)}}).pipe(U0.timeout(1000),U0.catchCause((X)=>{let Y={ok:!1,error:L1.pretty(X)};return U0.succeed(Y)}));var GA={allow:0,warn:1,ask:2,deny:3},I=(Q)=>({kind:"allow",rule:Q,message:""}),J6=(Q,X)=>({kind:"warn",rule:Q,message:X}),o0=(Q,X)=>({kind:"ask",rule:Q,message:X}),m=(Q,X)=>({kind:"deny",rule:Q,message:X}),NX=(Q)=>{let X=I("none");for(let Y of Q)if(GA[Y.kind]>GA[X.kind])X=Y;return X};var KA=E.Struct({hook_event_name:E.String,tool_name:E.optional(E.String),tool_input:E.optional(E.Unknown),tool_response:E.optional(E.Unknown),cwd:E.optional(E.String),session_id:E.optional(E.String),turn_id:E.optional(E.String),tool_use_id:E.optional(E.String)}),WA=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.command==="string",HA=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string"&&typeof Q.old_string==="string"&&typeof Q.new_string==="string",VA=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string"&&typeof Q.content==="string",_A=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string",qA=(Q,X)=>{if(typeof X!=="object"||X===null)return"";if(Q==="Bash"){let Y=X;return[Y.stdout??"",Y.stderr??""].filter((J)=>J.length>0).join(`
75
- `)}if(Q==="Read"){let Y=X;return Y.content??Y.file?.content??""}if(typeof X.content==="string")return X.content??"";return""};var r2=require("fs"),DA=require("os"),BA=require("path"),UA=`${DA.homedir()}/.claude/tripwire.log`;try{r2.mkdirSync(BA.dirname(UA),{recursive:!0})}catch{}var MX=(Q,X)=>{let Y=new Date().toISOString(),J=X instanceof Error?X.stack??X.message:String(X);try{r2.appendFileSync(UA,`[${Y}] [${Q}] ${J}
76
- `)}catch{}};var to=(Q)=>Q.tokens.slice(1).join(" "),OA=(Q,...X)=>Q.flags.some((Y)=>X.includes(Y)),eo=[{rule:"rm-rf-root",action:"deny",message:"rm -rf / is catastrophic. If the goal is cleaning a subdirectory, scope the path inside the project (e.g. ./dist).",match:(Q)=>Q.head==="rm"&&OA(Q,"-rf","-fr","-Rf","-fR")&&Q.tokens.includes("/")},{rule:"rm-rf-home",action:"deny",message:"rm -rf on $HOME / ~ would erase the home directory. Refuse.",match:(Q)=>Q.head==="rm"&&OA(Q,"-rf","-fr","-Rf","-fR")&&Q.tokens.some((X)=>/^(?<home>~|\$HOME|\$\{HOME\})$/.test(X))},{rule:"fork-bomb",action:"deny",message:"Fork bomb pattern detected. Refuse.",match:(Q,X)=>/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;/.test(X)},{rule:"source-script",action:"deny",message:"`source` / `.` executes a file in the current shell. Refuse arbitrary sourced scripts.",match:(Q)=>(Q.head==="source"||Q.head===".")&&Q.tokens.length>1},{rule:"dd-raw-device",action:"deny",message:"dd writing to a raw block device wipes the disk. Refuse.",match:(Q)=>Q.head==="dd"&&/\bof=\/dev\/(?<type>disk|sd|nvme|rdisk)/i.test(to(Q))},{rule:"mkfs",action:"deny",message:"mkfs formats a filesystem. Refuse.",match:(Q)=>/^mkfs(?<ext>\.[a-z0-9]+)?$/i.test(Q.head)},{rule:"kill-all",action:"deny",message:"kill -9 -1 kills every process you own. Refuse.",match:(Q)=>Q.head==="kill"&&Q.tokens.includes("-9")&&Q.tokens.includes("-1")},{rule:"chmod-777-recursive",action:"deny",message:"Recursive chmod 777 makes everything world-writable. Use 755 for directories, 644 for files, scoped narrowly.",match:(Q)=>Q.head==="chmod"&&Q.flags.some((X)=>X.includes("R"))&&Q.tokens.includes("777")},{rule:"no-verify",action:"deny",message:"--no-verify skips git hooks. Per policy: never skip hooks. Fix the underlying issue.",match:(Q)=>Q.tokens.includes("--no-verify")},{rule:"no-gpg-sign",action:"deny",message:"Bypassing GPG signing is off-limits unless explicitly requested.",match:(Q,X)=>/--no-gpg-sign\b|-c\s+commit\.gpgsign=false/.test(X)},{rule:"sudo",action:"ask",message:"sudo escalates privileges and is almost never needed in a coding session. If genuinely required, explain why; otherwise find a non-sudo path.",match:(Q)=>Q.head==="sudo"},{rule:"shutdown",action:"deny",message:"shutdown / reboot / halt control the machine. Refuse \u2014 system control should be done manually.",match:(Q)=>["shutdown","reboot","halt","poweroff"].includes(Q.head)},{rule:"launchctl-mutation",action:"deny",message:"launchctl load/unload/bootstrap/bootout/kickstart mutates system services. Refuse \u2014 surface the intent instead.",match:(Q)=>Q.head==="launchctl"&&typeof Q.tokens[1]==="string"&&["load","unload","bootstrap","bootout","kickstart","enable","disable"].includes(Q.tokens[1])},{rule:"defaults-write",action:"deny",message:"`defaults write` mutates macOS preferences. Refuse \u2014 surface the intent.",match:(Q)=>Q.head==="defaults"&&Q.tokens[1]==="write"},{rule:"csrutil",action:"deny",message:"csrutil controls System Integrity Protection. Refuse.",match:(Q)=>Q.head==="csrutil"},{rule:"nvram",action:"deny",message:"nvram modifies firmware variables. Refuse.",match:(Q)=>Q.head==="nvram"},{rule:"diskutil-destructive",action:"deny",message:"diskutil eraseDisk / reformat / partitionDisk wipes disks. Refuse.",match:(Q)=>Q.head==="diskutil"&&typeof Q.tokens[1]==="string"&&["eraseDisk","reformat","partitionDisk","eraseVolume","secureErase"].includes(Q.tokens[1])},{rule:"tmutil-destructive",action:"deny",message:"tmutil delete / disablelocal touches Time Machine. Refuse.",match:(Q)=>Q.head==="tmutil"&&typeof Q.tokens[1]==="string"&&["delete","disablelocal"].includes(Q.tokens[1])},{rule:"osascript",action:"ask",message:"osascript runs arbitrary AppleScript and can do almost anything (move files, send emails, drive apps). Confirm with the user what you want done before running it.",match:(Q)=>Q.head==="osascript"},{rule:"topgrade",action:"deny",message:"topgrade upgrades everything (brew, mas, npm globals, rust, mise). System upgrades should be done manually.",match:(Q)=>Q.head==="topgrade"},{rule:"rsync-delete",action:"deny",message:"rsync --delete removes files at the destination. High blast radius \u2014 surface the intent instead.",match:(Q)=>Q.head==="rsync"&&Q.flags.includes("--delete")},{rule:"softwareupdate-install",action:"deny",message:"`softwareupdate --install / -i / -d` triggers macOS system updates. Refuse \u2014 system updates should be done manually.",match:(Q)=>Q.head==="softwareupdate"&&Q.flags.some((X)=>X==="--install"||X==="-i"||X==="-d"||X.startsWith("--download"))},{rule:"pmset-write",action:"deny",message:"`pmset` (with arguments) writes power-management settings. Read-only `pmset -g` is fine; mutations need the user.",match:(Q)=>Q.head==="pmset"&&Q.tokens.length>1&&!Q.tokens.includes("-g")&&!Q.tokens.includes("-G")},{rule:"dscl-mutate",action:"deny",message:"`dscl . -create / -delete / -append / -change / -merge` modifies the local directory service (your user account, groups, etc.). Refuse.",match:(Q)=>Q.head==="dscl"&&Q.tokens.some((X)=>["-create","-delete","-append","-change","-merge","-passwd"].includes(X))},{rule:"xattr-quarantine-bypass",action:"deny",message:"`xattr -d com.apple.quarantine` removes Gatekeeper's quarantine bit \u2014 the macOS protection against running untrusted binaries. Refuse.",match:(Q)=>Q.head==="xattr"&&Q.tokens.includes("-d")&&Q.tokens.some((X)=>X.includes("com.apple.quarantine"))},{rule:"spctl-disable",action:"deny",message:"`spctl --master-disable` / `--global-disable` disables Gatekeeper system-wide. Refuse.",match:(Q)=>Q.head==="spctl"&&Q.flags.some((X)=>X==="--master-disable"||X==="--global-disable"||X==="--disable")},{rule:"kextload",action:"deny",message:"Loading a kernel extension (`kextload`, `kmutil load`) is a system-level mutation. Refuse \u2014 the user handles this manually.",match:(Q)=>Q.head==="kextload"||Q.head==="kextunload"||Q.head==="kmutil"&&(Q.tokens[1]==="load"||Q.tokens[1]==="unload")},{rule:"security-keychain-destructive",action:"deny",message:"`security delete-keychain / delete-generic-password / delete-internet-password / set-keychain-settings` mutates your Keychain (where CLIs store their secrets). Refuse \u2014 Keychain should be managed manually.",match:(Q)=>Q.head==="security"&&typeof Q.tokens[1]==="string"&&["delete-keychain","delete-generic-password","delete-internet-password","delete-certificate","delete-identity","set-keychain-settings","unlock-keychain","lock-keychain","create-keychain"].includes(Q.tokens[1])},{rule:"security-keychain-add-write",action:"ask",message:"`security add-generic-password / add-internet-password / add-certificate` writes to your Keychain. Other tools manage their own entries \u2014 confirm this is the right path before adding anything else manually.",match:(Q)=>Q.head==="security"&&typeof Q.tokens[1]==="string"&&["add-generic-password","add-internet-password","add-certificate"].includes(Q.tokens[1])},{rule:"systemsetup",action:"deny",message:"`systemsetup -set...` writes machine-wide settings (timezone, sleep, network time, restart-on-power-failure). Refuse.",match:(Q)=>Q.head==="systemsetup"&&Q.tokens.some((X)=>X.startsWith("-set"))},{rule:"scutil-set",action:"deny",message:"`scutil --set` writes system configuration (computer name, hostname, LocalHostName). Refuse \u2014 read-only `scutil --get` is fine.",match:(Q)=>Q.head==="scutil"&&Q.tokens.includes("--set")},{rule:"brew-mutation",action:"ask",message:"`brew install/uninstall/upgrade/untap` modifies the machine globally. Confirm before running.",match:(Q)=>Q.head==="brew"&&typeof Q.tokens[1]==="string"&&["install","uninstall","upgrade","reinstall","untap","tap"].includes(Q.tokens[1])},{rule:"mas-mutation",action:"ask",message:"`mas install/uninstall` changes installed Mac App Store apps. Confirm.",match:(Q)=>Q.head==="mas"&&typeof Q.tokens[1]==="string"&&["install","uninstall","purchase"].includes(Q.tokens[1])},{rule:"gh-destructive",action:"deny",message:"gh repo/release/issue delete is destructive on shared state. Refuse.",match:(Q)=>Q.head==="gh"&&typeof Q.tokens[1]==="string"&&typeof Q.tokens[2]==="string"&&["repo","release","issue","pr"].includes(Q.tokens[1])&&["delete","destroy","remove"].includes(Q.tokens[2])},{rule:"flyctl-destroy",action:"deny",message:"flyctl apps destroy / volumes destroy nukes deployed infra. Refuse.",match:(Q)=>Q.head==="flyctl"&&Q.tokens.some((X)=>X==="destroy"||X==="delete")},{rule:"gcloud-delete",action:"deny",message:"`gcloud ... delete` affects cloud resources. Refuse.",match:(Q)=>Q.head==="gcloud"&&Q.tokens.includes("delete")}],Qn=new Set(["rm-rf-root","rm-rf-home","fork-bomb","dd-raw-device","mkfs","kill-all","diskutil-destructive","tmutil-destructive","shutdown","csrutil","nvram","kextload","spctl-disable","xattr-quarantine-bypass","topgrade","softwareupdate-install","systemsetup","scutil-set","security-keychain-destructive","no-verify","no-gpg-sign"]),zA=(Q,X)=>{let Y=q1(X),J=[];for(let $ of Q)for(let Z of eo){if(!Z.match($,X))continue;if(Y&&!Qn.has(Z.rule))continue;J.push(Z.action==="deny"?m(Z.rule,Z.message):o0(Z.rule,Z.message));break}return J.length===0?I("bash-deny"):NX(J)};var Xn=["main","master","develop","production","release"],$W=(Q)=>Q.protectedBranches??Xn,Yn=/^(?<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?<scope>\([\w./\- ]+\))?!?:\s+\S/,Jn=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),$n=new Set(["--bare","--paginate","-p","--no-pager","--no-replace-objects","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-optional-locks","--exec-path","--html-path","--man-path","--info-path"]),Zn=(Q)=>{if(Q.head!=="git")return null;let X=Q.tokens.slice(1),Y=0;while(Y<X.length){let J=X[Y];if(Jn.has(J)){Y+=2;continue}if($n.has(J)){Y++;continue}if(J.startsWith("--git-dir=")||J.startsWith("--work-tree=")||J.startsWith("--namespace=")||J.startsWith("--super-prefix=")||J.startsWith("--exec-path=")){Y++;continue}if(J.startsWith("-")){Y++;continue}return{subcommand:J,subArgs:X.slice(Y+1)}}return null},Gn=(Q,X)=>{for(let Y=0;Y<Q.length;Y++){let J=Q[Y];if(J==="-m"||J==="--message"){let $=Q[Y+1];return $===void 0?null:l2($,X)}if(J.startsWith("--message="))return l2(J.slice(10),X);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test(J)){let $=Q[Y+1];return $===void 0?null:l2($,X)}}return null},Kn=(Q,X)=>{let Y=$W(X);for(let J of Q)for(let $ of Y)if(J===$||J.endsWith(`:${$}`)||J.endsWith(`/${$}`))return $;return null},Wn=(Q)=>Q.filter((X)=>!X.startsWith("-")),Hn=(Q)=>Q.filter((X)=>X.startsWith("-")),g0=(Q,...X)=>X.some((Y)=>Q.includes(Y)),Vn=({subArgs:Q,positional:X})=>{if(g0(Q,"--global","--system"))return m("git-config-global","Modifying global / system git config is off-limits \u2014 that is your personal identity. Read-only `git config --get` is fine.");if(!g0(Q,"--get","-l","--list","--get-all","--get-regexp")&&X.length>=2)return m("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return I("bash-git")},_n=({subArgs:Q})=>{if(g0(Q,"--cached"))return I("bash-git");return o0("git-rm","`git rm <path>` removes from the index AND the working tree. To untrack-only, use `git rm --cached <path>`. To delete the file separately, use `trash` / `rip`. Confirm intent.")},qn=({subArgs:Q,positional:X})=>{if(g0(Q,"--staged","-S")&&!g0(Q,"--worktree","-W"))return I("bash-git");if(X.length>0)return m("git-restore-discard","`git restore <path>` discards uncommitted changes in the working tree. Refuse \u2014 `git diff <path>` to inspect first, or `git stash push <path>` to preserve.");return I("bash-git")},Dn=({subArgs:Q,positional:X})=>{if(g0(Q,"-b","-B"))return I("bash-git");if(g0(Q,"-f","--force"))return m("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(Q.includes("--"))return m("git-checkout-discard","`git checkout -- <path>` discards uncommitted working-tree changes. Refuse \u2014 use `git stash push <path>` to preserve, or `git diff <path>` to inspect first.");if(X.length===1&&(X[0]==="."||X[0].startsWith("./")))return m("git-checkout-discard-all","`git checkout .` discards ALL uncommitted working-tree changes. Refuse \u2014 `git stash` to preserve, or `git diff` to inspect first.");return I("bash-git")},Bn=({subArgs:Q})=>{if(g0(Q,"-f","--force","--discard-changes"))return m("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return I("bash-git")},Un=({subArgs:Q,flags:X,positional:Y})=>{if(g0(Q,"--hard"))return m("git-reset-hard","`git reset --hard` discards all uncommitted changes AND moves HEAD. Refuse \u2014 describe the intent in chat. If undoing a published commit, `git revert <sha>` is safer.");if(g0(Q,"--keep"))return o0("git-reset-keep","`git reset --keep` resets HEAD but preserves uncommitted local changes. Confirm intent.");if(Y.length===0&&X.length===0)return I("bash-git");return o0("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},On=({flags:Q})=>{if(Q.some((X)=>/^-[a-zA-Z]*[df]/.test(X)||X==="--force"))return m("git-clean-fd","`git clean -fd` deletes untracked files (often your in-progress work). Refuse \u2014 inspect with `git clean -dn` (dry run) first. If genuinely needed, append ` # tripwire-allow: <reason>`.");return I("bash-git")},zn=({subArgs:Q,positional:X,config:Y})=>{if(g0(Q,"--abort","--quit","--continue","--skip","--edit-todo"))return I("bash-git");if(g0(Q,"-i","--interactive"))return m("git-rebase-interactive","`git rebase -i` rewrites history interactively. Refuse \u2014 too easy to lose commits in the agent loop. If this is genuinely required, do it manually outside the agent.");let J=X[0],$=$W(Y);if(J!==void 0&&$.includes(J))return o0("git-rebase-onto-protected",`Rebasing onto \`${J}\` rewrites history of the current branch. \`git merge ${J}\` is usually safer. Confirm intent.`);return o0("git-rebase","`git rebase` rewrites commit history. `git merge` is usually safer. Confirm intent.")},Fn=({subArgs:Q})=>{if(g0(Q,"--abort","--quit","--continue","--skip"))return I("bash-git");return o0("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},Ln=({subArgs:Q})=>{if(g0(Q,"--abort","--continue","--quit"))return I("bash-git");return o0("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},Pn=({subArgs:Q,config:X,heredocBodies:Y})=>{if(g0(Q,"--amend"))return m("git-commit-amend","`git commit --amend` rewrites the last commit. If it has been pushed, this causes upstream divergence. Refuse \u2014 surface the intent.");let J=Gn(Q,Y),$=g0(Q,"-F","--file","-c","-C","--reuse-message","--reedit-message"),Z=g0(Q,"--no-edit");if(J===null&&!$&&!Z)return m("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(J!==null&&X.enforceConventionalCommits!==!1&&!Yn.test(J))return m("git-commit-non-conventional",["Commit message must follow Conventional Commits format:"," `<type>(<scope>)?(!)?: <description>`","Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.","Examples:"," `fix(auth): handle expired token refresh`"," `feat: add bash-git rule`"," `chore: bump deps`",`Got: ${JSON.stringify(J)}`].join(`
77
- `));if(g0(Q,"-a","--all")||Q.some((G)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(G)))return o0("git-commit-auto-stage","`git commit -a / --all` auto-stages every tracked change. Explicit `git add <files>` first is usually clearer about what is being committed. Confirm.");return I("bash-git")},Rn=({subArgs:Q,flags:X,positional:Y,config:J})=>{if(X.some((Z)=>Z==="--force"||Z==="-f"||Z.startsWith("--force-with-lease")))return m("git-force-push","Force push is forbidden. If a branch needs to be reset upstream, surface the intent \u2014 there is almost always a non-force path.");if(g0(Q,"--delete","--mirror")||Q.some((Z)=>Z.startsWith(":")))return m("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let $=Kn(Y,J);if($!==null)return m("git-push-protected",`Refusing to push directly to protected branch \`${$}\`. Open a PR instead: \`gh pr create\`.`);return I("bash-git")},Nn=({subArgs:Q,flags:X,positional:Y,config:J})=>{let $=X.find((Z)=>Z==="-D"||Z==="-d"||Z==="--delete"||/^-[a-zA-Z]*D/.test(Z)||/^-[a-zA-Z]*d/.test(Z));if($!==void 0){let Z=Y,G=$W(J),K=Z.find((W)=>G.includes(W));if(K!==void 0)return m("git-branch-delete-protected",`Refusing to delete protected branch \`${K}\`.`);if($==="-D"||$.includes("D"))return m("git-branch-force-delete",`\`git branch -D ${Z.join(" ")}\` force-deletes branches even if unmerged (potential data loss). To delete a merged branch, use \`-d\`. To force, append \` # tripwire-allow: <reason>\`.`);return o0("git-branch-delete",`\`git branch -d ${Z.join(" ")}\` deletes a branch (merged-only check). Confirm intent.`)}if(g0(Q,"-m","-M","--move"))return o0("git-branch-move","Renaming a branch can confuse pushed remotes. Confirm intent.");return I("bash-git")},Mn=({subArgs:Q})=>{if(g0(Q,"-d","--delete"))return m("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return I("bash-git")},An=({subArgs:Q})=>{let X=Q[0]??"push";if(X==="drop"||X==="clear")return m("git-stash-drop",`\`git stash ${X}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return I("bash-git")},wn=({flags:Q})=>{if(Q.some((X)=>X.startsWith("--prune=")||X==="--aggressive"))return m("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return I("bash-git")},Cn=({subArgs:Q})=>{let X=Q[0];if(X==="add"||X==="remove"||X==="rm"||X==="set-url"||X==="rename")return o0("git-remote-mutate",`\`git remote ${X}\` changes which remote you're pushing to. Confirm \u2014 accidentally pointing at the wrong remote is high blast-radius.`);return I("bash-git")},FA=({subcommand:Q,subArgs:X})=>{let Y=X[0]??"";if(["add","remove","rm","deinit","sync","set-url"].includes(Y))return o0("git-submodule-worktree-mutate",`\`git ${Q} ${Y}\` modifies repo structure. Confirm intent.`);return I("bash-git")},Tn=new Map([["config",Vn],["add",()=>I("bash-git")],["mv",()=>I("bash-git")],["rm",_n],["restore",qn],["checkout",Dn],["switch",Bn],["reset",Un],["clean",On],["rebase",zn],["cherry-pick",Fn],["merge",Ln],["commit",Pn],["push",Rn],["branch",Nn],["tag",Mn],["stash",An],["filter-branch",({subcommand:Q})=>m("git-filter",`\`git ${Q}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:Q})=>m("git-filter",`\`git ${Q}\` rewrites entire repo history. Refuse.`)],["gc",wn],["update-ref",()=>m("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",Cn],["submodule",FA],["worktree",FA],["init",({subcommand:Q})=>J6(`git-${Q}`,`\`git ${Q}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)],["clone",({subcommand:Q})=>J6(`git-${Q}`,`\`git ${Q}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)]]),In=(Q,X,Y)=>{let{subcommand:J,subArgs:$}=Q,Z=Hn($),G=Wn($);if(new Set(["status","diff","log","show","blame","rev-parse","rev-list","ls-files","ls-tree","cat-file","reflog","describe","shortlog","whatchanged","archive","bundle","fsck","fetch","ls-remote","help","version","grep","name-rev","merge-base","symbolic-ref","check-ignore","count-objects","verify-commit","verify-tag"]).has(J)){if(J==="reflog"&&($[0]==="expire"||g0($,"--expire")))return m("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if(J==="symbolic-ref"&&G.length>=2)return m("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return I("bash-git")}let W=Tn.get(J);if(W!==void 0)return W({subcommand:J,subArgs:$,flags:Z,positional:G,config:X,heredocBodies:Y});return J6("git-unknown-subcommand",`\`git ${J}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},LA=(Q,X,Y)=>{if(q1(X))return I("bash-git");let J=tM(X);for(let $ of Q){let Z=Zn($);if(Z===null)continue;let G=In(Z,Y,J);if(G!==null&&G.kind!=="allow")return G}return I("bash-git")};var jn=new Set(["curl","wget","wget2","aria2c","xh"]),En=new Set(["bash","sh","zsh","fish"]),Sn=(Q)=>{for(let X=0;X<Q.length-1;X++){let Y=Q[X],J=Q[X+1];if(jn.has(Y.head)&&En.has(J.head))return!0}return!1},xn=[{head:"cargo",subcommand:"install",rule:"cargo-install",message:"Confirm before `cargo install <crate>`: this builds and installs arbitrary code from crates.io into ~/.cargo/bin globally."},{head:"go",subcommand:"install",rule:"go-install",message:"Confirm before `go install`: this fetches and installs arbitrary Go code globally."},{head:"gem",subcommand:"install",rule:"gem-install",message:"Confirm before `gem install`: pulls arbitrary code from rubygems.org."}],PA=(Q,X)=>{if(q1(X))return I("bash-network-install");if(Sn(Q))return m("curl-pipe-shell","Piping `curl` / `wget` directly into a shell runs whatever the remote URL serves. Refuse \u2014 download to a file, inspect, then run if appropriate. If you genuinely need this, append ` # tripwire-allow: <reason>` (and explain to the user what you're running).");for(let Y of Q)for(let J of xn)if(Y.head===J.head&&Y.tokens[1]===J.subcommand)return o0(J.rule,J.message);return I("bash-network-install")};var vn=[{rule:"redirect-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:"Refusing to write into a .env file via shell redirect / tee / cp / mv. .env files hold secrets \u2014 never overwrite from a tool call."},{rule:"redirect-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refusing to write into .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"redirect-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refusing to write into ~/.ssh/ via shell."},{rule:"redirect-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refusing to overwrite a private-key-shaped file via shell."},{rule:"redirect-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refusing to write into ~/.aws/credentials via shell."},{rule:"redirect-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refusing to write into ~/.netrc via shell."},{rule:"redirect-block-device",pattern:/^\/dev\/(?<type>sd|disk|nvme|rdisk)/i,message:"Redirecting into a raw block device wipes the disk. Refuse."}],ZW=(Q)=>{for(let X of vn)if(X.pattern.test(Q))return m(X.rule,X.message);return null},RA=(Q,X)=>{if(q1(X))return I("bash-redirect");for(let Y of Q){for(let J of Y.redirects)if(J.op===">"||J.op===">>"){let $=ZW(J.target);if($!==null)return $}if(Y.head==="tee")for(let J of Y.args){let $=ZW(J);if($!==null)return $}if(Y.head==="cp"||Y.head==="mv"){let J=Y.args.at(-1);if(J!==void 0){let $=ZW(J);if($!==null)return $}}}return I("bash-redirect")};var kn=(Q,X)=>{let Y=!1,J=[];for(let G of Q.tokens.slice(1)){if(!Y&&G==="--"){Y=!0;continue}if(!Y&&G.startsWith("-")&&G!=="-")continue;J.push(G)}let $=X.relative??[],Z=X.absolute??[];return J.filter((G)=>!XW(G,$,Z))},yn=(Q,X)=>{if(!Q.tokens.includes("-delete"))return null;let Y=[];for(let G of Q.tokens.slice(1)){if(G.startsWith("-"))break;Y.push(G)}let J=Y.length===0?["."]:Y,$=X.relative??[],Z=X.absolute??[];return J.filter((G)=>!XW(G,$,Z))},NA=(Q,X,Y)=>{if(q1(X))return I("bash-scoped-rm");let J=[];for(let K of Q){if(K.head==="rm"){let W=kn(K,Y);if(W.length>0)J.push({kind:"rm",targets:W});continue}if(K.head==="find"){let W=yn(K,Y);if(W!==null&&W.length>0)J.push({kind:"find -delete",targets:W})}}if(J.length===0)return I("bash-scoped-rm");let $=Y.relative??[],Z=Y.absolute??[],G=J.map((K)=>` \u2022 ${K.kind} on: ${K.targets.map((W)=>JSON.stringify(W)).join(", ")}`).join(`
78
- `);return m("destructive-outside-safe-paths",`Destructive deletion outside known-safe scopes is blocked. Use \`trash\` (macOS Trash, recoverable) or \`rip\` (graveyard at /tmp/graveyard-$USER, recoverable until reboot) instead. Real \`rm\` and \`find -delete\` are allowed only inside ephemeral build / cache / state directories:
79
- ${YA($,Z)}
61
+ }`}return nf(Z,{toString:{value:()=>G(o0(X))},[l8]:{value:()=>G(o0(X))},[u4]:{value:async()=>G(await LH(X))},[Z1]:{value:$,configurable:!0}})};return $()})}var{MIN_SAFE_INTEGER:tf,MAX_SAFE_INTEGER:ef}=Number;function xM(){return new u5(tf,ef)}var Qc=Number.MAX_SAFE_INTEGER;function Xc(){return new u5(0,Qc)}var Yc=Number.parseInt;function $c(Q){let[X,Y]=Q;switch(X){case"oct":return`0${sX(Y,8)}`;case"hex":return`0x${sX(Y,16)}`;default:return`${Y}`}}function q3(Q,X){let Y=Yc(Q,X);if(sX(Y,X)!==Q)throw Error("Invalid value");return Y}function Jc(Q){if(typeof Q!=="string")throw Error("Invalid type");if(Q.length>=2&&Q[0]==="0"){if(Q[1]==="x")return["hex",q3(d0(Q,2),16)];return["oct",q3(d0(Q,1),8)]}return["dec",q3(Q,10)]}function Zc(Q){return y0(Q,".")}function Gc(Q){if(typeof Q!=="string")throw Error("Invalid type");return O0(b1(Q,"."),(X)=>q3(X,10))}function yH(){return Z0(E6(255),E6(255),E6(255),E6(255)).map(Zc,Gc)}function q4(Q){return Z0(D4("dec","oct","hex"),E6(Q)).map($c,Jc)}function vW(Q){return y0(Q,".")}function xW(Q){if(typeof Q!=="string")throw Error("Invalid type");return b1(Q,".")}function bM(){return J1(Z0(q4(255),q4(255),q4(255),q4(255)).map(vW,xW),Z0(q4(255),q4(255),q4(65535)).map(vW,xW),Z0(q4(255),q4(16777215)).map(vW,xW),q4(4294967295))}function gH(Q){if(Q.length===0)return[];else return b1(Q,":")}function hH(Q){let X=b1(Q,":");if(X.length>=2&&X[X.length-1].length<=4)return[$1(X,0,X.length-2),`${X[X.length-2]}:${X[X.length-1]}`];return[$1(X,0,X.length-1),X[X.length-1]]}function Wc(Q){return`${y0(Q[0],":")}:${Q[1]}`}function Hc(Q){if(typeof Q!=="string")throw Error("Invalid type");return hH(Q)}function Kc(Q){return`::${y0(Q[0],":")}:${Q[1]}`}function Vc(Q){if(typeof Q!=="string")throw Error("Invalid type");if(!fh(Q,"::"))throw Error("Invalid value");return hH(d0(Q,2))}function D3(Q){return`${y0(Q[0],":")}::${y0(Q[1],":")}:${Q[2]}`}function U3(Q){if(typeof Q!=="string")throw Error("Invalid type");let[X,Y]=b1(Q,"::",2),[$,J]=hH(Y);return[gH(X),$,J]}function _c(Q){return D3([Q[0],[Q[1]],Q[2]])}function qc(Q){let X=U3(Q);return[X[0],y0(X[1],":"),X[2]]}function eN(Q){return`${y0(Q[0],":")}::${Q[1]}`}function QL(Q){if(typeof Q!=="string")throw Error("Invalid type");let[X,Y]=b1(Q,"::",2);return[gH(X),Y]}function Dc(Q){return`${y0(Q[0],":")}::`}function Uc(Q){if(typeof Q!=="string")throw Error("Invalid type");if(!ch(Q,"::"))throw Error("Invalid value");return[gH(d0(Q,0,Q.length-2))]}function Bc([Q,X]){return`${Q}:${X}`}function zc(Q){if(typeof Q!=="string")throw new h("Invalid type");if(!Q.includes(":"))throw new h("Invalid value");return Q.split(":",2)}var Oc="0123456789abcdef",bW=void 0;function Fc(){if(bW===void 0)bW=A0({min:0,max:15}).map((Q)=>Oc[Q],(Q)=>{if(typeof Q!=="string")throw new h("Not a string");if(Q.length!==1)throw new h("Invalid length");let X=f5(Q,0);if(X<=57)return X-48;if(X<97)throw new h("Invalid character");return X-87});return bW}function kM(){let Q=a0({unit:Fc(),minLength:1,maxLength:4,size:"max"}),X=J1(Z0(Q,Q).map(Bc,zc),yH());return J1(Z0(C0(Q,{minLength:6,maxLength:6,size:"max"}),X).map(Wc,Hc),Z0(C0(Q,{minLength:5,maxLength:5,size:"max"}),X).map(Kc,Vc),Z0(C0(Q,{minLength:0,maxLength:1,size:"max"}),C0(Q,{minLength:4,maxLength:4,size:"max"}),X).map(D3,U3),Z0(C0(Q,{minLength:0,maxLength:2,size:"max"}),C0(Q,{minLength:3,maxLength:3,size:"max"}),X).map(D3,U3),Z0(C0(Q,{minLength:0,maxLength:3,size:"max"}),C0(Q,{minLength:2,maxLength:2,size:"max"}),X).map(D3,U3),Z0(C0(Q,{minLength:0,maxLength:4,size:"max"}),Q,X).map(_c,qc),Z0(C0(Q,{minLength:0,maxLength:5,size:"max"}),X).map(eN,QL),Z0(C0(Q,{minLength:0,maxLength:6,size:"max"}),Q).map(eN,QL),Z0(C0(Q,{minLength:0,maxLength:7,size:"max"})).map(Dc,Uc))}var Rc=class extends g0{constructor(Q){super();this.name=Q,this.underlying=null}generate(Q,X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(Q,X)}canShrinkWithoutContext(Q){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(Q)}shrink(Q,X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(Q,X)}},Nc=Object.getOwnPropertyNames;function Lc(){let Q=new c4;return(Y)=>{let $=G8(Q,Y);if($!==void 0)return $;return $=new Rc(String(Y)),f8(Q,Y,$),$}}function yM(Q){let X=Lc(),Y=Q(X),$=Nc(Y);for(let J of $){let Z=X(J);Z.underlying=Y[J]}return Y}function Mc(Q,X){for(let Y of Q){let $=X[Y]||{};if($.maxLength===void 0||$.maxLength>0)return!0}return!1}function wc(Q,X){if(Q.length===0)return k0([]);if(!Mc(Q,X))throw new h("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return Z0(...Q.map((Y)=>C0(k0(Y),X[Y]))).map((Y)=>Oh(Y)).filter((Y)=>Y.length>0)}var{assign:XL,create:B3,defineProperty:gM,getPrototypeOf:YL,prototype:Pc}=Object;function Ac(Q){return gM(B3(null),l8,{configurable:!1,enumerable:!1,writable:!1,value:()=>Q})}function $L(Q,X){return Ac(`<${x1(Q)}#${X}>`)}function Cc(Q,X){let Y=B3(Pc);for(let $ in Q){let J=Q[$],Z=[];for(let G of J){let W=XL(B3(YL(G)),G);Z.push(W)}Y[$]=Z}for(let $ in X){let J=X[$];for(let Z=0;Z!==J.length;++Z){let G=J[Z],W=Y[$][Z];for(let H in G){let K=G[H];W[H]=K.index===void 0?void 0:typeof K.index==="number"?Y[K.type][K.index]:O0(K.index,(V)=>Y[K.type][V])}gM(W,l8,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let H=Q[$][Z],K=XL(B3(YL(H)),H);for(let V in G){let _=G[V];K[V]=_.index===void 0?void 0:typeof _.index==="number"?$L(_.type,_.index):O0(_.index,(q)=>$L(_.type,q))}return o0(K)}})}}return Y}function jc(Q){let X=0,Y=new c4;for(let J in Q){let Z=Q[J];for(let G in Z){let W=Z[G];if(W.arity!=="inverse")continue;let H=G8(Y,W.type);if(H===void 0)H=new c4,f8(Y,W.type,H);if(Sh(H,W.forwardRelationship))throw new h(`Cannot declare multiple inverse relationships for the same forward relationship ${x1(W.forwardRelationship)} on type ${x1(W.type)}`);f8(H,W.forwardRelationship,{type:J,property:G}),X+=1}}let $=new c4;if(X===0)return $;for(let J in Q){let Z=Q[J],G=G8(Y,J);if(G===void 0)continue;for(let W in Z){let H=Z[W];if(H.arity==="inverse")continue;let K=G8(G,W);if(K===void 0)continue;if(K.type!==H.type)throw new h(`Inverse relationship ${x1(K.property)} on type ${x1(K.type)} references forward relationship ${x1(W)} but types do not match`);f8($,H,K)}}if($.size!==X)throw new h("Some inverse relationships could not be matched with their corresponding forward relationships");return $}var{assign:JL,create:w3}=Object;function Tc(Q,X,Y){switch(Q){case"exclusive":return k0(Y);case"successor":return N3(A0({min:X!==void 0?X+1:0,max:Y}));case"any":return N3(A0({min:0,max:Y}))}}function Ic(Q,X,Y,$,J){let Z=Tc(X,Y,$);switch(Q){case"0-1":return l4(Z,{nil:void 0,depthIdentifier:J});case"1":return Z;case"many":{let G=0;return l4(v9(Z,{depthIdentifier:J,selector:(W)=>W===$?W+ ++G:W,minLength:1}),{nil:[],depthIdentifier:J}).map((W)=>{let H=0;return O0(W,(K)=>K===$?K+H++:K)})}}}function hM(Q,X){let Y=w3(null),$=Q[X];for(let J in $){let Z=$[J];if(Z.arity==="inverse")Y[J]={type:Z.type,index:[]}}return Y}function Ec(Q){let X=new c8,Y=new c8;for(let $ in Q){let J=Q[$];for(let Z in J){let G=J[Z];if(G.arity==="inverse")continue;if(G.strategy==="exclusive"){if(I6(X,G.type))throw new h(`Cannot mix exclusive with other strategies for type ${x1(G.type)}`);aX(Y,G.type)}else{if(I6(Y,G.type))throw new h(`Cannot mix exclusive with other strategies for type ${x1(G.type)}`);aX(X,G.type)}if(G.strategy==="successor"&&G.type!==$)throw new h("Cannot mix types for the strategy successor");if(G.strategy==="successor"&&G.arity==="1")throw new h("Cannot use an arity of 1 for the strategy successor")}}}function Sc(Q,X){let{producedLinks:Y,toBeProducedEntities:$}=Q,J=Q.nextIndex+X,Z=JL(w3(null),Y);function G(_){if(Z[_]===Y[_])Z[_]=$1(Y[_]);return Z[_]}function W(_,q){let D=G(_);if(D[q]===Y[_][q])D[q]=JL(w3(null),Y[_][q]);return D[q]}function H(_,q,D){let B=W(_,q),F=Y[_][q];if(F!==void 0&&B[D]===F[D]){let N=B[D];B[D]={type:N.type,index:typeof N.index==="object"?$1(N.index):N.index}}return B[D]}let K=void 0,V=$[J];return{setOutboundLink:(_,q)=>{let D=W(V.type,V.indexInType);D[_]=q},enqueueNewEntity:(_,q)=>{let D=G(q),B=D.length;if(K===void 0)K=$1($);return T(K,{type:q,indexInType:B,depth:V.depth+1}),T(D,hM(_,q)),B},appendBackReference:(_,q,D)=>{let B=H(_,q,D).index;T(B,V.indexInType)},commit:()=>({producedLinks:Z,toBeProducedEntities:K!==void 0?K:$,nextIndex:J+1})}}function vc(Q,X){let Y=w3(null);for(let J in Q)Y[J]=[];let $=[];for(let J of X)T($,{type:J,indexInType:Y[J].length,depth:0}),T(Y[J],hM(Q,J));return{producedLinks:Y,toBeProducedEntities:$,nextIndex:0}}function xc(Q,X,Y,$){let J=Y.producedLinks,Z=Y.toBeProducedEntities[Y.nextIndex+$],G=Q[Z.type],W=AH();W.depth=Z.depth;let H=[],K=[];for(let V in G){let _=G[V];if(_.arity==="inverse")continue;let q=_.type,D=J[q].length;T(H,Ic(_.arity,_.strategy||"any",q===Z.type?Z.indexInType:void 0,D,W)),T(K,{name:V,relation:_,sentinelLinkIndex:D})}if(H.length===0)return;return Z0(...H).map((V)=>{let _=Sc(Y,$);for(let q=0;q!==V.length;++q){let D=V[q],{name:B,relation:F,sentinelLinkIndex:N}=K[q],M=[],w=D===void 0?[]:typeof D==="number"?[D]:D;for(let A of w){let s;if(A>=N)s=_.enqueueNewEntity(Q,F.type);else s=A;T(M,s);let L=G8(X,F);if(L!==void 0)_.appendBackReference(F.type,s,L.property)}_.setOutboundLink(B,{type:F.type,index:D===void 0?void 0:typeof D==="number"?M[0]:M})}return _.commit()})}function bc(Q,X){Ec(Q);let Y=jc(Q);return VM(k0(vc(Q,X)),($)=>{if($.nextIndex>=$.toBeProducedEntities.length)return;let J=0,Z=void 0;while(Z===void 0&&$.nextIndex+J<$.toBeProducedEntities.length)Z=xc(Q,Y,$,J),J+=1;return Z}).map(($)=>{return $.producedLinks})}var{keys:kc,getOwnPropertySymbols:yc,getOwnPropertyDescriptor:gc}=Object;function hc(Q){let X=kc(Q),Y=yc(Q);for(let $=0;$!==Y.length;++$){let J=Y[$],Z=gc(Q,J);if(Z&&Z.enumerable)X.push(J)}return X}var{create:mc,defineProperty:dc,getOwnPropertyDescriptor:pc,getOwnPropertyNames:fc,getOwnPropertySymbols:cc}=Object;function uc(Q,X){return function($){let J=$[$.length-1]?mc(null):{};for(let Z=0;Z!==Q.length;++Z){let G=$[Z];if(G!==X){let W=Q[Z];if(W==="__proto__")dc(J,W,{value:G,configurable:!0,enumerable:!0,writable:!0});else J[W]=G}}return J}}function lc(Q,X){return function($){if(typeof $!=="object"||$===null)throw Error("Incompatible instance received: should be a non-null object");let J=Object.getPrototypeOf($)===null,Z="constructor"in $&&$.constructor===Object;if(!J&&!Z)throw Error("Incompatible instance received: should be of exact type Object");let G=0,W=[];for(let V=0;V!==Q.length;++V){let _=pc($,Q[V]);if(_!==void 0){if(!_.configurable||!_.enumerable||!_.writable)throw Error("Incompatible instance received: should contain only c/e/w properties");if(_.get!==void 0||_.set!==void 0)throw Error("Incompatible instance received: should contain only no get/set properties");++G,T(W,_.value)}else T(W,X)}let H=fc($).length,K=cc($).length;if(G!==H+K)throw Error("Incompatible instance received: should not contain extra properties");return[...W,J]}}var kW=Symbol("no-key");function yW(Q,X,Y){let $=hc(Q),J=[];for(let Z=0;Z!==$.length;++Z){let G=$[Z],W=Q[G];if(X===void 0||nX(X,G)!==-1)T(J,W);else T(J,l4(W,{nil:kW}))}return Z0(...J,Y?k0(!1):Y7()).map(uc($,kW),lc($,kW))}function HH(Q,X){let Y=X!==void 0&&!!X.noNullPrototype;if(X===void 0)return yW(Q,void 0,Y);if(!(("requiredKeys"in X)&&X.requiredKeys!==void 0))return yW(Q,void 0,Y);let $=("requiredKeys"in X?X.requiredKeys:void 0)||[];for(let J=0;J!==$.length;++J){let Z=Object.getOwnPropertyDescriptor(Q,$[J]);if(Z===void 0)throw Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!Z.enumerable)throw Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return yW(Q,$,Y)}var oc=Object.create;function rc(Q,X,Y,$){let J=oc(null);for(let Z in Q){let G=Q[Z],W=HH(G,$),H=X(Z),K=Y(Z),V={minLength:H,maxLength:H};J[Z]=K!==void 0?v9(W,{...V,selector:K}):C0(W,V)}return HH(J)}var{create:ZL,keys:ic}=Object;function nc(Q,X,Y={}){let $=ic(Q),J=Y.initialPoolConstraints||ZL(null),Z=Y.unicityConstraints||ZL(null),G={noNullPrototype:Y.noNullPrototype};return wc($,J).chain((W)=>bc(X,W).chain((H)=>rc(Q,(K)=>H[K].length,(K)=>Z[K],G).map((K)=>Cc(K,H))))}function ac(Q){return y0(O0(Q,(X)=>X[X.length-1]===","?d0(X,0,X.length-1):X)," ")}function sc(Q){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");let $=[];for(let J of b1(Y," "))if(Q.canShrinkWithoutContext(J))T($,J);else if(Q.canShrinkWithoutContext(J+","))T($,J+",");else throw Error("Unsupported word");return $}}function tc(Q){let X=y0(Q," ");if(X[X.length-1]===",")X=d0(X,0,X.length-1);return BH(X[0])+d0(X,1)+"."}function ec(Q){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");if(Y.length<2||Y[Y.length-1]!=="."||Y[Y.length-2]===","||BH(rW(Y[0]))!==Y[0])throw Error("Unsupported value");let $=rW(Y[0])+d0(Y,1,Y.length-1),J=[],Z=b1($," ");for(let G=0;G!==Z.length;++G){let W=Z[G];if(Q.canShrinkWithoutContext(W))T(J,W);else if(G===Z.length-1&&Q.canShrinkWithoutContext(W+","))T(J,W+",");else throw Error("Unsupported word")}return J}}function Qu(Q){return y0(Q," ")}function Xu(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=b1(Q,". ");for(let Y=0;Y<X.length-1;++Y)X[Y]+=".";return X}var O=(Q,X)=>{return{arbitrary:k0(Q),weight:X}};function Yu(){return J1(O("non",6),O("adipiscing",5),O("ligula",5),O("enim",5),O("pellentesque",5),O("in",5),O("augue",5),O("et",5),O("nulla",5),O("lorem",4),O("sit",4),O("sed",4),O("diam",4),O("fermentum",4),O("ut",4),O("eu",4),O("aliquam",4),O("mauris",4),O("vitae",4),O("felis",4),O("ipsum",3),O("dolor",3),O("amet,",3),O("elit",3),O("euismod",3),O("mi",3),O("orci",3),O("erat",3),O("praesent",3),O("egestas",3),O("leo",3),O("vel",3),O("sapien",3),O("integer",3),O("curabitur",3),O("convallis",3),O("purus",3),O("risus",2),O("suspendisse",2),O("lectus",2),O("nec,",2),O("ultricies",2),O("sed,",2),O("cras",2),O("elementum",2),O("ultrices",2),O("maecenas",2),O("massa,",2),O("varius",2),O("a,",2),O("semper",2),O("proin",2),O("nec",2),O("nisl",2),O("amet",2),O("duis",2),O("congue",2),O("libero",2),O("vestibulum",2),O("pede",2),O("blandit",2),O("sodales",2),O("ante",2),O("nibh",2),O("ac",2),O("aenean",2),O("massa",2),O("suscipit",2),O("sollicitudin",2),O("fusce",2),O("tempus",2),O("aliquam,",2),O("nunc",2),O("ullamcorper",2),O("rhoncus",2),O("metus",2),O("faucibus,",2),O("justo",2),O("magna",2),O("at",2),O("tincidunt",2),O("consectetur",1),O("tortor,",1),O("dignissim",1),O("congue,",1),O("non,",1),O("porttitor,",1),O("nonummy",1),O("molestie,",1),O("est",1),O("eleifend",1),O("mi,",1),O("arcu",1),O("scelerisque",1),O("vitae,",1),O("consequat",1),O("in,",1),O("pretium",1),O("volutpat",1),O("pharetra",1),O("tempor",1),O("bibendum",1),O("odio",1),O("dui",1),O("primis",1),O("faucibus",1),O("luctus",1),O("posuere",1),O("cubilia",1),O("curae,",1),O("hendrerit",1),O("velit",1),O("mauris,",1),O("gravida",1),O("ornare",1),O("ut,",1),O("pulvinar",1),O("varius,",1),O("turpis",1),O("nibh,",1),O("eros",1),O("id",1),O("aliquet",1),O("quis",1),O("lobortis",1),O("consectetuer",1),O("morbi",1),O("vehicula",1),O("tortor",1),O("tellus,",1),O("id,",1),O("eu,",1),O("quam",1),O("feugiat,",1),O("posuere,",1),O("iaculis",1),O("lectus,",1),O("tristique",1),O("mollis,",1),O("nisl,",1),O("vulputate",1),O("sem",1),O("vivamus",1),O("placerat",1),O("imperdiet",1),O("cursus",1),O("rutrum",1),O("iaculis,",1),O("augue,",1),O("lacus",1))}function $u(Q={}){let{maxCount:X,mode:Y="words",size:$}=Q;if(X!==void 0&&X<1)throw Error("lorem has to produce at least one word/sentence");let J=Yu();if(Y==="sentences")return C0(C0(J,{minLength:1,size:"small"}).map(tc,ec(J)),{minLength:1,maxLength:X,size:$}).map(Qu,Xu);else return C0(J,{minLength:1,maxLength:X,size:$}).map(ac,sc(J))}function Ju(Q){return new Map(Q)}function Zu(Q){if(typeof Q!=="object"||Q===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in Q)||Q.constructor!==Map)throw Error("Incompatible instance received: should be of exact type Map");return Array.from(Q)}function Gu(Q){return Q[0]}function KH(Q,X,Y={}){return v9(Z0(Q,X),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:Gu,depthIdentifier:Y.depthIdentifier,comparator:"SameValueZero"}).map(Ju,Zu)}var W3=10;function Wu(Q){let X={};return(Y)=>{let $=Y!==void 0?Y:W3;if(!mL(X,$)){let J=W3;W3=$-1,X[$]=Q($),W3=J}return X[$]}}function Hu(Q){let X=0;while(Q>k(0)){if(Q&k(1))++X;Q>>=k(1)}return X}function Ku(Q,X){let Y=(k(1)<<k(X))-k(1),$=Q&Y,J=Hu(Q-$),Z=$;for(let G=k(1);G<=Y&&J!==0;G<<=k(1))if(!(Z&G))Z|=G,--J;return Z}function H3(Q,X){let Y=[];for(let $=Q.length-1;$!==-1;--$)if(X(Q[$])!==Q[$])T(Y,$);return Y}function Vu(Q,X,Y){let $=k(0);for(let J=0,Z=k(1);J!==Y.length;++J,Z<<=k(1))if(Q[Y[J]]!==X[Y[J]])$|=Z;return $}function gW(Q,X,Y,$){for(let J=0,Z=k(1);J!==Y.length;++J,Z<<=k(1))if(X&Z)Q[Y[J]]=$(Q[Y[J]])}var _u=class extends g0{constructor(Q,X,Y){super();this.stringArb=Q,this.toggleCase=X,this.untoggleAll=Y}buildContextFor(Q,X){return{rawString:Q.value,rawStringContext:Q.context,flags:X.value,flagsContext:X.context}}generate(Q,X){let Y=this.stringArb.generate(Q,X),$=[...Y.value],J=H3($,this.toggleCase),Z=x6(k(0),(k(1)<<k(J.length))-k(1)).generate(Q,void 0);return gW($,Z.value,J,this.toggleCase),new y(y0($,""),this.buildContextFor(Y,Z))}canShrinkWithoutContext(Q){if(typeof Q!=="string")return!1;return this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(Q)):this.stringArb.canShrinkWithoutContext(Q)}shrink(Q,X){let Y;if(X!==void 0)Y=X;else if(this.untoggleAll!==void 0){let Z=this.untoggleAll(Q),G=[...Q],W=[...Z];Y={rawString:Z,rawStringContext:void 0,flags:Vu(W,G,H3(W,this.toggleCase)),flagsContext:void 0}}else Y={rawString:Q,rawStringContext:void 0,flags:k(0),flagsContext:void 0};let{rawString:$,flags:J}=Y;return this.stringArb.shrink($,Y.rawStringContext).map((Z)=>{let G=[...Z.value],W=H3(G,this.toggleCase),H=Ku(J,W.length);return gW(G,H,W,this.toggleCase),new y(y0(G,""),this.buildContextFor(Z,new y(H,void 0)))}).join(S6(()=>{let Z=[...$],G=H3(Z,this.toggleCase);return x6(k(0),(k(1)<<k(G.length))-k(1)).shrink(J,Y.flagsContext).map((W)=>{let H=$1(Z);return gW(H,W.value,G,this.toggleCase),new y(y0(H,""),this.buildContextFor(new y($,Y.rawStringContext),W))})}))}};function qu(Q){let X=BH(Q);if(X!==Q)return X;return rW(Q)}function Du(Q,X){return new _u(Q,X&&X.toggleCase||qu,X&&X.untoggleAll)}function Uu(Q){return vL.from(Q)}function Bu(Q){if(!(Q instanceof vL))throw Error("Unexpected type");return[...Q]}function mM(Q={}){return C0(EM(Q),Q).map(Uu,Bu)}function zu(Q){return xL.from(Q)}function Ou(Q){if(!(Q instanceof xL))throw Error("Unexpected type");return[...Q]}function dM(Q={}){return C0(A3(Q),Q).map(zu,Ou)}function o4(Q,X,Y,$,J){let Z=$.name,{min:G=X,max:W=Y,...H}=Q;if(G>W)throw Error(`Invalid range passed to ${Z}: min must be lower than or equal to max`);if(G<X)throw Error(`Invalid min value passed to ${Z}: min must be greater than or equal to ${X}`);if(W>Y)throw Error(`Invalid max value passed to ${Z}: max must be lower than or equal to ${Y}`);return C0(J({min:G,max:W}),H).map((K)=>$.from(K),(K)=>{if(!(K instanceof $))throw Error("Invalid type");return[...K]})}function pM(Q={}){return o4(Q,-32768,32767,tg,A0)}function fM(Q={}){return o4(Q,-2147483648,2147483647,eg,A0)}function cM(Q={}){return o4(Q,-128,127,sg,A0)}function uM(Q={}){return o4(Q,0,65535,Yh,A0)}function lM(Q={}){return o4(Q,0,4294967295,$h,A0)}function oM(Q={}){return o4(Q,0,255,Qh,A0)}function rM(Q={}){return o4(Q,0,255,Xh,A0)}function Fu(Q){return Q!==void 0}function GL(Q){if(Q.hasToBeCloned)return new y(Q.value_,{generatorContext:Q.context},()=>Q.value);return new y(Q.value_,{generatorContext:Q.context})}function WL(Q){if(Q.hasToBeCloned)return new y(Q.value_,{shrinkerContext:Q.context},()=>Q.value);return new y(Q.value_,{shrinkerContext:Q.context})}var Ru=class extends g0{constructor(Q,X){super();this.generatorArbitrary=Q,this.shrinkerArbitrary=X}generate(Q,X){return GL(this.generatorArbitrary.generate(Q,X))}canShrinkWithoutContext(Q){return this.shrinkerArbitrary.canShrinkWithoutContext(Q)}shrink(Q,X){if(!Fu(X))return this.shrinkerArbitrary.shrink(Q,void 0).map(WL);if("generatorContext"in X)return this.generatorArbitrary.shrink(Q,X.generatorContext).map(GL);return this.shrinkerArbitrary.shrink(Q,X.shrinkerContext).map(WL)}};function VH(Q,X,Y){let $=A0({min:Q,max:X});if(X===Y)return $;return new Ru($,A0({min:Q,max:Y}))}var{min:Nu,max:_H}=Math,HL=EL.isArray,Lu=Object.entries;function Mu(Q){let X=-1;for(let Y=0;Y!==Q.length;++Y)X=_H(X,Q[Y][0]);return X}function wu(Q,X){let Y=EL(Q);for(let $=0;$!==X.length;++$){let J=X[$];if(J[0]<Q)Y[J[0]]=J[1]}return Y}function iM(Q,X={}){let{size:Y,minNumElements:$=0,maxLength:J=S9,maxNumElements:Z=J,noTrailingHole:G,depthIdentifier:W}=X,H=eX(Y,eX(Y,$,Z,X.maxNumElements!==void 0),J,X.maxLength!==void 0);if($>J)throw Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if($>Z)throw Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let K=Nu(Z,J),V=X.maxNumElements!==void 0||Y!==void 0?Y:"=",_=v9(Z0(VH(0,_H(H-1,0),_H(J-1,0)),Q),{size:V,minLength:$,maxLength:K,selector:(q)=>q[0],depthIdentifier:W}).map((q)=>{return wu(Mu(q)+1,q)},(q)=>{if(!HL(q))throw Error("Not supported entry type");if(G&&q.length!==0&&!(q.length-1 in q))throw Error("No trailing hole");return O0(Lu(q),(D)=>[Number(D[0]),D[1]])});if(G||J===$)return _;return Z0(_,VH($,H,J)).map((q)=>{let D=q[0],B=q[1];if(D.length>=B)return D;let F=$1(D);return F.length=B,F},(q)=>{if(!HL(q))throw Error("Not supported entry type");return[q,q.length]})}function Pu(Q){return new Set(Q)}function Au(Q){if(typeof Q!=="object"||Q===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in Q)||Q.constructor!==Set)throw Error("Incompatible instance received: should be of exact type Set");return Array.from(Q)}function nM(Q,X={}){return v9(Q,{minLength:X.minLength,maxLength:X.maxLength,size:X.size,depthIdentifier:X.depthIdentifier,comparator:"SameValueZero"}).map(Pu,Au)}function Cu(Q,X,Y,$,J,Z){return TH(Q,X,{maxKeys:Y,noNullPrototype:!Z,size:$,depthIdentifier:J})}function ju(Q){return J1(cM(Q),oM(Q),rM(Q),pM(Q),uM(Q),fM(Q),lM(Q),mM(Q),dM(Q))}function aM(Q){let{values:X,depthSize:Y}=Q,$=AH(),J=Q.maxDepth,Z=Q.maxKeys,G=Q.size,W=J1(...X,...Q.withBigInt?[x6()]:[],...Q.withDate?[KM()]:[]);return yM((H)=>({anything:J1({maxDepth:J,depthSize:Y,depthIdentifier:$},W,H("array"),H("object"),...Q.withMap?[H("map")]:[],...Q.withSet?[H("set")]:[],...Q.withObjectString?[H("anything").map((K)=>o0(K))]:[],...Q.withTypedArray?[ju({maxLength:Z,size:G})]:[],...Q.withSparseArray?[iM(H("anything"),{maxNumElements:Z,size:G,depthIdentifier:$})]:[]),keys:Q.withObjectString?J1({arbitrary:Q.key,weight:10},{arbitrary:H("anything").map((K)=>o0(K)),weight:1}):Q.key,array:C0(H("anything"),{maxLength:Z,size:G,depthIdentifier:$}),set:nM(H("anything"),{maxLength:Z,size:G,depthIdentifier:$}),map:J1(KH(H("keys"),H("anything"),{maxKeys:Z,size:G,depthIdentifier:$}),KH(H("anything"),H("anything"),{maxKeys:Z,size:G,depthIdentifier:$})),object:Cu(H("keys"),H("anything"),Z,G,$,Q.withNullPrototype)})).anything}function Tu(Q){switch(typeof Q){case"boolean":return new SL(Q);case"number":return new f4(Q);case"string":return new x1(Q);default:return Q}}function Iu(Q){if(typeof Q!=="object"||Q===null||!("constructor"in Q))return Q;return Q.constructor===SL||Q.constructor===f4||Q.constructor===x1?Q.valueOf():Q}function Eu(Q){return Q.map(Tu,Iu)}function Su(Q,X){return[Y7(),xM(),A3(),X(Q),J1(X(Q),k0(null),k0(void 0))]}function vu(Q){return Q.map((X)=>Eu(X))}function xu(Q,X){return X?vu(Q).concat(Q):Q}function sM(Q={}){let X={size:Q.size,unit:"stringUnit"in Q?Q.stringUnit:Q.withUnicodeString?"binary":void 0};return{key:Q.key!==void 0?Q.key:a0(X),values:xu(Q.values!==void 0?Q.values:Su(X,a0),Q.withBoxedValues===!0),depthSize:Q.depthSize,maxDepth:Q.maxDepth,maxKeys:Q.maxKeys,size:Q.size,withSet:Q.withSet===!0,withMap:Q.withMap===!0,withObjectString:Q.withObjectString===!0,withNullPrototype:Q.withNullPrototype===!0,withBigInt:Q.withBigInt===!0,withDate:Q.withDate===!0,withTypedArray:Q.withTypedArray===!0,withSparseArray:Q.withSparseArray===!0}}function bu(Q){return TH(Q.key,aM(Q),{maxKeys:Q.maxKeys,noNullPrototype:!Q.withNullPrototype,size:Q.size})}function ku(Q){return bu(sM(Q))}function yu(Q,X){let{depthSize:Y,maxDepth:$}=X;return{key:Q,values:[Y7(),A3({noDefaultInfinity:!0,noNaN:!0}),Q,k0(null)],depthSize:Y,maxDepth:$}}function tM(Q){return aM(sM(Q))}function eM(Q={}){let X=Q.noUnicodeString===void 0||Q.noUnicodeString===!0;return tM(yu("stringUnit"in Q?a0({unit:Q.stringUnit}):X?a0():a0({unit:"binary"}),Q))}var{stringify:gu,parse:hu}=JSON;function mu(Q){if(typeof Q!=="string")throw new h("Cannot unmap the passed value");return hu(Q)}function du(Q={}){return eM(Q).map(gu,mu)}var pu=Object.defineProperties;function hW(Q,X){return`Stream(${X!==void 0?`${y0(X,",")}\u2026`:`${Q} emitted`})`}var fu=class extends g0{constructor(Q,X){super();this.arb=Q,this.history=X}generate(Q,X){let Y=X!==void 0&&Q.nextInt(1,X)===1?X:void 0,$=()=>{let J=this.history?[]:null,Z=0,W=new G0(function*(H,K){while(!0){let V=H.generate(K,Y).value;if(Z++,J!==null)T(J,V);yield V}}(this.arb,Q.clone()));return pu(W,{toString:{value:()=>hW(Z,J!==null?J.map(o0):void 0)},[l8]:{value:()=>hW(Z,J!==null?J.map(o0):void 0)},[u4]:{value:async()=>hW(Z,J!==null?await Promise.all(J.map(LH)):void 0)},[Z1]:{value:$,enumerable:!0}})};return new y($(),void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return G0.nil()}};function cu(Q,X){return new fu(Q,X!==void 0&&typeof X==="object"&&"noHistory"in X?!X.noHistory:!0)}function uu(Q){return y0(Q,"")}function KL(Q){if(typeof Q!=="string")throw Error("Cannot unmap the passed value");return[...Q]}function lu(Q){switch(Q.length%4){case 0:return Q;case 3:return`${Q}=`;case 2:return`${Q}==`;default:return d0(Q,1)}}function ou(Q){if(typeof Q!=="string"||Q.length%4!==0)throw Error("Invalid string received");let X=Q.indexOf("=");if(X===-1)return Q;if(Q.length-X>2)throw Error("Cannot unmap the passed value");return d0(Q,0,X)}var mW=String.fromCharCode;function ru(Q){if(Q<26)return mW(Q+65);if(Q<52)return mW(Q+97-26);if(Q<62)return mW(Q+48-52);return Q===62?"+":"/"}function iu(Q){if(typeof Q!=="string"||Q.length!==1)throw new h("Invalid entry");let X=f5(Q,0);if(X>=65&&X<=90)return X-65;if(X>=97&&X<=122)return X-97+26;if(X>=48&&X<=57)return X-48+52;return X===43?62:X===47?63:-1}function nu(){return A0({min:0,max:63}).map(ru,iu)}function au(Q={}){let{minLength:X=0,maxLength:Y=S9,size:$}=Q,J=X+3-(X+3)%4,Z=Y-Y%4,G=Q.maxLength===void 0&&$===void 0?"=":$;if(J>Z)throw new h("Minimal length should be inferior or equal to maximal length");if(J%4!==0)throw new h("Minimal length of base64 strings must be a multiple of 4");if(Z%4!==0)throw new h("Maximal length of base64 strings must be a multiple of 4");let W=nu();return C0(W,{minLength:J,maxLength:Z,size:G,experimentalCustomSlices:jp(W,KL)}).map(uu,KL).map(lu,ou)}var VL=Object.is;function su(Q,X){let Y=new c4,$=0;for(let J of Q)if(VL(J,-0))++$;else f8(Y,J,(G8(Y,J)||0)+1);for(let J=0;J!==X.length;++J){if(!(J in X))return!1;let Z=X[J];if(VL(Z,-0)){if($===0)return!1;--$}else{let G=G8(Y,Z)||0;if(G===0)return!1;f8(Y,Z,G-1)}}return!0}var{floor:tu,log:_L}=Math,eu=Array.isArray,Qw=class extends g0{constructor(Q,X,Y,$){super();if(this.originalArray=Q,this.isOrdered=X,this.minLength=Y,this.maxLength=$,Y<0||Y>Q.length)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if($<0||$>Q.length)throw Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(Y>$)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new u5(Y,$),this.biasedLengthArb=Y!==$?new u5(Y,Y+tu(_L($-Y)/_L(2))):this.lengthArb}generate(Q,X){let Y=(X!==void 0&&Q.nextInt(1,X)===1?this.biasedLengthArb:this.lengthArb).generate(Q,void 0),$=Y.value,J=O0(this.originalArray,(G,W)=>W),Z=[];for(let G=0;G!==$;++G){let W=Q.nextInt(0,J.length-1);T(Z,J[W]),yL(J,W,1)}if(this.isOrdered)gL(Z,(G,W)=>G-W);return new y(O0(Z,(G)=>this.originalArray[G]),Y.context)}canShrinkWithoutContext(Q){if(!eu(Q))return!1;if(!this.lengthArb.canShrinkWithoutContext(Q.length))return!1;return su(this.originalArray,Q)}shrink(Q,X){if(Q.length===0)return G0.nil();return this.lengthArb.shrink(Q.length,X).map((Y)=>{return new y($1(Q,Q.length-Y.value),Y.context)}).join(Q.length>this.minLength?S6(()=>this.shrink($1(Q,1),void 0).filter((Y)=>this.minLength<=Y.value.length+1).map((Y)=>new y([Q[0],...Y.value],void 0))):G0.nil())}};function Ql(Q,X={}){let{minLength:Y=0,maxLength:$=Q.length}=X;return new Qw(Q,!0,Y,$)}function Xl(Q,X={}){let{minLength:Y=0,maxLength:$=Q.length}=X;return new Qw(Q,!1,Y,$)}var Yl={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},$l={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function Jl(Q){return Q<10?x1(Q):Yl[Q]}function qL(Q,X){let Y="";while(Q.length+Y.length<X)Y+="0";return Y+Q}function DL(Q){let X="";for(let Y=Q;Y!==0;){let $=Y>>5;X=Jl(Y-($<<5))+X,Y=$}return X}function Zl(Q,X){let Y=~~(Q/1073741824),$=Q&1073741823;return qL(DL(Y),X-6)+qL(DL($),6)}function Xw(Q){return function(Y){return Zl(Y,Q)}}function dW(Q){if(typeof Q!=="string")throw new h("Unsupported type");let X=0,Y=1;for(let $=Q.length-1;$>=0;--$){let J=Q[$],Z=$l[J];if(Z===void 0)throw new h("Unsupported type");X+=Z*Y,Y*=32}return X}var Gl=Xw(10),UL=Xw(8);function Wl(Q){return Gl(Q[0])+UL(Q[1])+UL(Q[2])}function Hl(Q){if(typeof Q!=="string"||Q.length!==26)throw Error("Unsupported type");return[dW(Q.slice(0,10)),dW(Q.slice(10,18)),dW(Q.slice(18))]}function Kl(){return Z0(A0({min:0,max:281474976710655}),A0({min:0,max:1099511627775}),A0({min:0,max:1099511627775})).map(Wl,Hl)}function Yw(Q){return uh(sX(Q,16),8,"0")}function Vl(Q){if(typeof Q!=="string")throw Error("Unsupported type");if(Q.length!==8)throw Error("Unsupported value: invalid length");let X=parseInt(Q,16);if(Q!==Yw(X))throw Error("Unsupported value: invalid content");return X}function pW(Q,X){return A0({min:Q,max:X}).map(Yw,Vl)}function _l(Q){return`${Q[0]}-${d0(Q[1],4)}-${d0(Q[1],0,4)}-${d0(Q[2],0,4)}-${d0(Q[2],4)}${Q[3]}`}var ql=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function Dl(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=ql.exec(Q);if(X===null)throw Error("Unsupported type");return[X[1],X[3]+X[2],X[4]+d0(X[5],0,4),d0(X[5],4)]}var BL="0123456789abcdef";function Ul(Q){let X={},Y={};for(let Z=0;Z!==Q.length;++Z){let G=BL[Z],W=BL[Q[Z]];X[G]=W,Y[W]=G}function $(Z){return X[Z[0]]+d0(Z,1)}function J(Z){if(typeof Z!=="string")throw new h("Cannot produce non-string values");let G=Y[Z[0]];if(G===void 0)throw new h("Cannot produce strings not starting by the version in hexa code");return G+d0(Z,1)}return{versionsApplierMapper:$,versionsApplierUnmapper:J}}function Bl(Q){let X={};for(let Y of Q){if(X[Y])throw new h(`Version ${Y} has been requested at least twice for uuid`);if(X[Y]=!0,Y<1||Y>15)throw new h(`Version must be a value in [1-15] for uuid, but received ${Y}`);if(~~Y!==Y)throw new h(`Version must be an integer value for uuid, but received ${Y}`)}if(Q.length===0)throw new h("Must provide at least one version for uuid")}function zl(Q={}){let X=pW(0,4294967295),Y=Q.version!==void 0?typeof Q.version==="number"?[Q.version]:Q.version:[1,2,3,4,5,6,7,8];Bl(Y);let{versionsApplierMapper:$,versionsApplierUnmapper:J}=Ul(Y);return Z0(X,pW(0,268435456*Y.length-1).map($,J),pW(2147483648,3221225471),X).map(_l,Dl)}function Ol(Q){return a0({unit:SH("-._~!$&'()*+,;=:"),size:Q})}function Fl([Q,X,Y]){return(Q===null?"":`${Q}@`)+X+(Y===null?"":`:${Y}`)}function Rl(Q){if(typeof Q!=="string")throw Error("Unsupported");let X=Q.indexOf("@"),Y=X!==-1?Q.substring(0,X):null,$=/:(\d+)$/.exec(Q),J=$!==null?Number($[1]):null;return[Y,$!==null?Q.substring(X+1,Q.length-$[1].length-1):Q.substring(X+1),J]}function Nl(Q){return`[${Q}]`}function Ll(Q){if(typeof Q!=="string"||Q[0]!=="["||Q[Q.length-1]!=="]")throw Error("Unsupported");return Q.substring(1,Q.length-1)}function $w(Q){let X=Q||{},Y=X.size,$=[vH({size:Y}),...X.withIPv4===!0?[yH()]:[],...X.withIPv6===!0?[kM().map(Nl,Ll)]:[],...X.withIPv4Extended===!0?[bM()]:[]];return Z0(X.withUserInfo===!0?l4(Ol(Y)):k0(null),J1(...$),X.withPort===!0?l4(E6(65535)):k0(null)).map(Fl,Rl)}function Jw(Q){return a0({unit:SH("-._~!$&'()*+,;=:@/?"),size:Q})}function Zw(Q={}){return Jw(Q.size)}function Gw(Q={}){return a0({unit:SH("-._~!$&'()*+,;=:@"),size:Q.size})}function Ml(Q){let X="";for(let Y=0;Y!==Q.length;++Y)X+="/"+Q[Y];return X}function wl(Q){if(typeof Q!=="string")throw Error("Incompatible value received: type");if(Q.length!==0&&Q[0]!=="/")throw Error("Incompatible value received: start");return yL(b1(Q,"/"),1)}function Pl(Q){switch(Q){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function fW(Q,X){return C0(Gw({size:Q}),{size:X}).map(Ml,wl)}function Al(Q){let[X,Y]=Pl(Q);if(X===Y)return fW(X,Y);return J1(fW(X,Y),fW(Y,X))}function Ww(Q){return Al(jH((Q||{}).size))}function Hw(Q={}){return Jw(Q.size)}function Cl(Q){let[X,Y,$]=Q;return`${X}://${Y}${$}${Q[3]===null?"":`?${Q[3]}`}${Q[4]===null?"":`#${Q[4]}`}`}var jl=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function Tl(Q){if(typeof Q!=="string")throw Error("Incompatible value received: type");let X=jl.exec(Q);if(X===null)throw Error("Incompatible value received");let Y=X[1],$=X[2],J=X[3],Z=X[4],G=X[5];return[Y,$,J,Z!==void 0?Z.substring(1):null,G!==void 0?G.substring(1):null]}function Il(Q){let X=Q||{},Y=jH(X.size),$=X.authoritySettings!==void 0&&X.authoritySettings.size!==void 0?X7(X.authoritySettings.size,Y):Y,J={...X.authoritySettings,size:$};return Z0(D4(...X.validSchemes||["http","https"]),$w(J),Ww({size:Y}),X.withQueryParameters===!0?l4(Hw({size:Y})):k0(null),X.withFragments===!0?l4(Zw({size:Y})):k0(null)).map(Cl,Tl)}var El=class Q{constructor(X,Y){this.commands=X,this.metadataForReplay=Y,this[Z1]=function(){return new Q(this.commands.map(($)=>$.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let X=this.commands.filter(($)=>$.hasRan).map(($)=>$.toString()).join(","),Y=this.metadataForReplay();return Y.length!==0?`${X} /*${Y}*/`:X}},Sl=class Q{constructor(X){if(this.cmd=X,this.hasRan=!1,RH(X)){let Y=X[l8];this[l8]=function(){return Y.call(X)}}if(NH(X)){let Y=X[u4];this[u4]=function(){return Y.call(X)}}}check(X){return this.cmd.check(X)}run(X,Y){return this.hasRan=!0,this.cmd.run(X,Y)}clone(){if(E9(this.cmd))return new Q(this.cmd[Z1]());return new Q(this.cmd)}toString(){return this.cmd.toString()}},zL=class{static parse(Q){let[X,Y]=Q.split(":"),$=this.parseCounts(X),J=this.parseChanges(Y);return this.parseOccurences($,J)}static stringify(Q){let X=this.countOccurences(Q);return`${this.stringifyCounts(X)}:${this.stringifyChanges(X)}`}static intToB64(Q){if(Q<26)return String.fromCharCode(Q+65);if(Q<52)return String.fromCharCode(Q+97-26);if(Q<62)return String.fromCharCode(Q+48-52);return String.fromCharCode(Q===62?43:47)}static b64ToInt(Q){if(Q>="a")return Q.charCodeAt(0)-97+26;if(Q>="A")return Q.charCodeAt(0)-65;if(Q>="0")return Q.charCodeAt(0)-48+52;return Q==="+"?62:63}static countOccurences(Q){return Q.reduce((X,Y)=>{if(X.length===0||X[X.length-1].count===64||X[X.length-1].value!==Y)X.push({value:Y,count:1});else X[X.length-1].count+=1;return X},[])}static parseOccurences(Q,X){let Y=[];for(let $=0;$!==Q.length;++$){let J=Q[$],Z=X[$];for(let G=0;G!==J;++G)Y.push(Z)}return Y}static stringifyChanges(Q){let X="";for(let Y=0;Y<Q.length;Y+=6){let $=Q.slice(Y,Y+6).reduceRight((J,Z)=>(J<<1)+(Z.value?1:0),0);X+=this.intToB64($)}return X}static parseChanges(Q){let X=Q.split("").map(($)=>this.b64ToInt($)),Y=[];for(let $=0;$!==X.length;++$){let J=X[$];for(let Z=0;Z!==6;++Z,J>>=1)Y.push(J%2===1)}return Y}static stringifyCounts(Q){return Q.map(({count:X})=>this.intToB64(X-1)).join("")}static parseCounts(Q){return Q.split("").map((X)=>this.b64ToInt(X)+1)}},vl=class extends g0{constructor(Q,X,Y,$,J){super();this.sourceReplayPath=$,this.disableReplayLog=J,this.oneCommandArb=J1(...Q).map((Z)=>new Sl(Z)),this.lengthArb=VH(0,X,Y),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(zL.stringify(this.replayPath))}`}buildValueFor(Q,X){let Y=Q.map((J)=>J.value_),$={shrunkOnce:X,items:Q};return new y(new El(Y,()=>this.metadataForReplay()),$)}generate(Q){let X=this.lengthArb.generate(Q,void 0).value,Y=Array(X);for(let $=0;$!==X;++$)Y[$]=this.oneCommandArb.generate(Q,void 0);return this.replayPathPosition=0,this.buildValueFor(Y,!1)}canShrinkWithoutContext(Q){return!1}filterOnExecution(Q){let X=[];for(let Y of Q)if(Y.value_.hasRan)this.replayPath.push(!0),X.push(Y);else this.replayPath.push(!1);return X}filterOnReplay(Q){return Q.filter((X,Y)=>{let $=this.replayPath[this.replayPathPosition+Y];if($===void 0)throw Error("Too short replayPath");if(!$&&X.value_.hasRan)throw Error("Mismatch between replayPath and real execution");return $})}filterForShrinkImpl(Q){if(this.replayPathPosition===0)this.replayPath=this.sourceReplayPath!==null?zL.parse(this.sourceReplayPath):[];let X=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(Q):this.filterOnExecution(Q);return this.replayPathPosition+=Q.length,X}shrink(Q,X){if(X===void 0)return G0.nil();let Y=X,$=Y.shrunkOnce,J=Y.items,Z=this.filterForShrinkImpl(J);if(Z.length===0)return G0.nil();let G=$?G0.nil():new G0([[]][Symbol.iterator]()),W=[];for(let H=0;H!==Z.length;++H)W.push(S6(()=>{let K=Z.slice(0,H);return this.lengthArb.shrink(Z.length-1-H,void 0).map((V)=>K.concat(Z.slice(Z.length-(V.value+1))))}));for(let H=0;H!==Z.length;++H)W.push(S6(()=>this.oneCommandArb.shrink(Z[H].value_,Z[H].context).map((K)=>Z.slice(0,H).concat([K],Z.slice(H+1)))));return G.join(...W).map((H)=>{return this.buildValueFor(H.map((K)=>new y(K.value_.clone(),K.context)),!0)})}};function xl(Q,X={}){let{size:Y,maxCommands:$=S9,disableReplayLog:J=!1,replayPath:Z=null}=X;return new vl(Q,eX(Y,0,$,X.maxCommands!==void 0),$,Z,J)}var bl=class{constructor(Q,X){this.s=Q,this.cmd=X}async check(Q){let X=null,Y=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{Y=await Promise.resolve(this.cmd.check(Q))}catch($){throw X=$,$}}}]).task).faulty)throw X;return Y}async run(Q,X){let Y=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(Q,X)}catch($){throw Y=$,$}}}]).task).faulty)throw Y}},kl=function*(Q,X){for(let Y of X)yield new bl(Q,Y)},Kw=(Q,X,Y,$,J)=>{return Q.then((Z)=>{let{model:G,real:W}=Z,H=Y;for(let K of X)H=J(H,()=>{return $(K,G,W)});return H})},yl=(Q,X)=>{return Kw({then:(Z)=>{Z(Q())}},X,void 0,(Z,G,W)=>{if(Z.check(G))Z.run(G,W)},(Z,G)=>G())},gl=(Q)=>{return typeof Q.then==="function"},Vw=async(Q,X,Y=Promise.resolve())=>{return await Kw({then:(G)=>{let W=Q();if(gl(W))return W.then(G);else return G(W)}},X,Y,async(G,W,H)=>{if(await G.check(W))await G.run(W,H)},(G,W)=>G.then(W))};function hl(Q,X){yl(Q,X)}async function ml(Q,X){await Vw(Q,X)}async function dl(Q,X,Y){let $=kl(Q,Y),J=Vw(X,$,Q.schedule(Promise.resolve(),"startModel"));await Q.waitFor(J),await Q.waitAll()}var K3=(Q)=>Q(),_w=class Q{constructor(X,Y){this.act=X,this.taskSelector=Y,this.lastTaskId=0,this.sourceTaskSelector=Y.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Z1]=function(){return new Q(this.act,this.sourceTaskSelector)}}static buildLog(X){return`[task\${${X.taskId}}] ${X.label.length!==0?`${X.schedulingType}::${X.label}`:X.schedulingType} ${X.status}${X.outputValue!==void 0?` with value ${df(X.outputValue)}`:""}`}log(X,Y,$,J,Z,G){this.triggeredTasks.push({status:Z,schedulingType:X,taskId:Y,label:$,metadata:J,outputValue:G!==void 0?o0(G):void 0})}scheduleInternal(X,Y,$,J,Z,G){let W=++this.lastTaskId,H=void 0,K=new Promise((V,_)=>{H=()=>{let q=Promise.resolve(G!==void 0?$.then(()=>G()):$);return q.then((D)=>{this.log(X,W,Y,J,"resolved",D),V(D)},(D)=>{this.log(X,W,Y,J,"rejected",D),_(D)}),q}});if(this.scheduledTasks.push({original:$,trigger:H,schedulingType:X,taskId:W,label:Y,metadata:J,customAct:Z}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return K}schedule(X,Y,$,J){return this.scheduleInternal("promise",Y||"",X,$,J||K3)}scheduleFunction(X,Y){return(...$)=>this.scheduleInternal("function",`${X.name}(${$.map(o0).join(",")})`,X(...$),void 0,Y||K3)}scheduleSequence(X,Y){let $={done:!1,faulty:!1},J={then:(V)=>V()},Z=()=>{},G=new Promise((V)=>{Z=()=>V({done:$.done,faulty:$.faulty})}),W=()=>{$.faulty=!0,Z()},H=()=>{$.done=!0,Z()},K=(V,_)=>{if(V>=X.length){_.then(H,W);return}_.then(()=>{let q=X[V],[D,B,F]=typeof q==="function"?[q,q.name,void 0]:[q.builder,q.label,q.metadata],N=this.scheduleInternal("sequence",B,J,F,Y||K3,()=>D());K(V+1,N)},W)};return K(0,J),Object.assign($,{task:G})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw Error("No task scheduled");let X=this.taskSelector.nextTaskIndex(this.scheduledTasks),[Y]=this.scheduledTasks.splice(X,1);return Y.customAct(()=>{return Y.trigger().catch(($)=>{})})}waitOne(X){let Y=X||K3;return this.act(()=>Y(()=>this.internalWaitOne()))}async waitAll(X){while(this.scheduledTasks.length>0)await this.waitOne(X)}async internalWaitFor(X,Y){let $=!1,J=Y.customAct,Z=Y.onWaitStart,G=Y.onWaitIdle,W=Y.launchAwaiterOnInit,H=void 0,K=void 0,V=0,_=null,q=null,D=async()=>{V=50;for(V=50;!$&&V>0;--V)await Promise.resolve();if(!$&&this.scheduledTasks.length>0){if(Z!==void 0)Z();return q=this.waitOne(J),q.then(()=>{return q=null,D()},(M)=>{throw q=null,$=!0,K(M),M})}if(!$&&G!==void 0)G();_=null},B=()=>{if(_!==null){V=51;return}_=D().catch(()=>{})},F=()=>{let M=this.scheduledWatchers.indexOf(B);if(M!==-1)this.scheduledWatchers.splice(M,1);if(M===0&&this.scheduledWatchers.length!==0)this.scheduledWatchers[0]()},N=new Promise((M,w)=>{H=(A)=>{F(),M(A)},K=(A)=>{F(),w(A)}});if(X.then((M)=>{if($=!0,q===null)H(M);else q.then(()=>H(M),(w)=>K(w))},(M)=>{if($=!0,q===null)K(M);else q.then(()=>K(M),()=>K(M))}),(this.scheduledTasks.length>0||W)&&this.scheduledWatchers.length===0)B();return this.scheduledWatchers.push(B),N}waitNext(X,Y){let $=void 0,J=X,Z=J<=0?Promise.resolve():new Promise((G)=>{$=()=>{if(--J<=0)G()}});return this.internalWaitFor(Z,{customAct:Y,onWaitStart:$,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(X){let Y=void 0,$=new Promise((J)=>Y=J);return this.internalWaitFor($,{customAct:X,onWaitStart:void 0,onWaitIdle:Y,launchAwaiterOnInit:!0})}waitFor(X,Y){return this.internalWaitFor(X,{customAct:Y,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map((X)=>({status:"pending",schedulingType:X.schedulingType,taskId:X.taskId,label:X.label,metadata:X.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(Q.buildLog).map((X)=>`-> ${X}`).join(`
62
+ `)+"`"}};function qw(Q){let X=0;return{clone:()=>qw(Q),nextTaskIndex:(Y)=>{if(Q.length<=X)throw Error("Invalid schedulerFor defined: too many tasks have been scheduled");let $=Y.findIndex((J)=>J.taskId===Q[X]);if($===-1)throw Error("Invalid schedulerFor defined: unable to find next task");return++X,$}}}function OL(Q,X){return new _w(Q,qw(X))}function Dw(Q){let X=Q.clone();return{clone:()=>Dw(X),nextTaskIndex:(Y)=>{return Q.nextInt(0,Y.length-1)}}}var pl=class extends g0{constructor(Q){super();this.act=Q}generate(Q,X){return new y(new _w(this.act,Dw(Q.clone())),void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return G0.nil()}};function fl(Q){let{act:X=(Y)=>Y()}=Q||{};return new pl(X)}function cl(Q,X){let{act:Y=($)=>$()}=Array.isArray(Q)?X||{}:Q||{};if(Array.isArray(Q))return OL(Y,Q);return function($,...J){return OL(Y,J)}}function ul(Q={}){return o4(Q,k("-9223372036854775808"),k("9223372036854775807"),ng,x6)}function ll(Q={}){return o4(Q,k(0),k("18446744073709551615"),ag,x6)}function ol(Q,X){return X}var{floor:cW,min:rl}=Math;function w8(Q,X){switch(Q.type){case"Char":return{astNode:Q,minLength:1};case"Repetition":switch(Q.quantifier.kind){case"*":{let Y=w8(Q.expression,X);return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:0,to:X},expression:Y.astNode},minLength:0}}case"+":{let Y=w8(Q.expression,X),$=Y.minLength>1?Y.minLength:1;return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:1,to:cW(X/$)},expression:Y.astNode},minLength:Y.minLength}}case"?":{let Y=w8(Q.expression,X);if(X<Y.minLength)return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:0,to:0},expression:Y.astNode},minLength:0};return{astNode:{...Q,expression:Y.astNode},minLength:0}}case"Range":{let Y=Q.quantifier.from>1?cW(X/Q.quantifier.from):X,$=w8(Q.expression,Y),J=$.minLength>1?$.minLength:1;if(Q.quantifier.to===void 0||Q.quantifier.to*J>X)return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",to:cW(X/J)},expression:$.astNode},minLength:Q.quantifier.from*$.minLength};return{astNode:{...Q,expression:$.astNode},minLength:Q.quantifier.from*$.minLength}}default:return ol(Q.quantifier,{astNode:Q,minLength:0})}case"Quantifier":return{astNode:Q,minLength:0};case"Alternative":{let Y=0,$=[];for(let Z=0;Z!==Q.expressions.length;++Z){let G=X-Y,W=w8(Q.expressions[Z],G);Y+=W.minLength,T($,{value:W,allowance:G})}let J=[];for(let Z=0;Z!==$.length;++Z){let G=$[Z].value,W=$[Z].allowance,H=X-Y+G.minLength;T(J,(H!==W?w8(G.astNode,H):G).astNode)}return{astNode:{...Q,expressions:J},minLength:Y}}case"CharacterClass":return{astNode:Q,minLength:1};case"ClassRange":return{astNode:Q,minLength:1};case"Group":{let Y=w8(Q.expression,X);return{astNode:{...Q,expression:Y.astNode},minLength:Y.minLength}}case"Disjunction":{if(Q.left===null){if(Q.right===null)return{astNode:Q,minLength:0};let J=w8(Q.right,X),Z=J.minLength>X?null:J.astNode;return{astNode:{...Q,left:null,right:Z},minLength:0}}if(Q.right===null){let J=w8(Q.left,X),Z=J.minLength>X?null:J.astNode;return{astNode:{...Q,left:Z,right:null},minLength:0}}let Y=w8(Q.left,X),$=w8(Q.right,X);if(Y.minLength>X)return $;if($.minLength>X)return Y;return{astNode:{...Q,left:Y.astNode,right:$.astNode},minLength:rl(Y.minLength,$.minLength)}}case"Assertion":return{astNode:Q,minLength:0};case"Backreference":return{astNode:Q,minLength:0};case"UnicodeProperty":return{astNode:Q,minLength:1}}}function il(Q,X){return w8(Q,X).astNode}function nl(Q){return Error(`Unsupported AST node! Received: ${o0(Q)}`)}function z3(Q,X,Y){if(!X&&!Y)return Q;let $={hasStart:!1,hasEnd:!1},J=Uw(Q,X,Y,$),Z=X&&!$.hasStart,G=Y&&!$.hasEnd;if(!Z&&!G)return J;let W=[];if(Z)W.push({type:"Assertion",kind:"^"}),W.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}});if(W.push(J),G)W.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),W.push({type:"Assertion",kind:"$"});return{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:W}}}function Uw(Q,X,Y,$){switch(Q.type){case"Char":return Q;case"Repetition":return Q;case"Quantifier":throw Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return $.hasStart=!0,$.hasEnd=!0,{...Q,expressions:Q.expressions.map((J,Z)=>z3(J,X&&Z===0,Y&&Z===Q.expressions.length-1))};case"CharacterClass":return Q;case"ClassRange":return Q;case"Group":return{...Q,expression:Uw(Q.expression,X,Y,$)};case"Disjunction":return $.hasStart=!0,$.hasEnd=!0,{...Q,left:Q.left!==null?z3(Q.left,X,Y):null,right:Q.right!==null?z3(Q.right,X,Y):null};case"Assertion":if(Q.kind==="^"||Q.kind==="Lookahead")return $.hasStart=!0,Q;else if(Q.kind==="$"||Q.kind==="Lookbehind")return $.hasEnd=!0,Q;else throw Error(`Assertions of kind ${Q.kind} not implemented yet!`);case"Backreference":return Q;case"UnicodeProperty":return Q;default:throw nl(Q)}}function al(Q){return z3(Q,!0,!0)}function FL(Q,X){return Q[X]>="\uD800"&&Q[X]<="\uDBFF"&&Q[X+1]>="\uDC00"&&Q[X+1]<="\uDFFF"?2:1}function n0(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"}function qH(Q){return Q>="0"&&Q<="9"}function Bw(Q,X){for(let Y=X;Y!==Q.length;++Y){let $=Q[Y];if($==="\\")Y+=1;else if($==="]")return Y}throw Error("Missing closing ']'")}function sl(Q,X){let Y=0;for(let $=X;$!==Q.length;++$){let J=Q[$];if(J==="\\")$+=1;else if(J===")"){if(Y===0)return $;Y-=1}else if(J==="[")$=Bw(Q,$);else if(J==="(")Y+=1}throw Error("Missing closing ')'")}function tl(Q,X){let Y=!1;for(let $=X;$!==Q.length;++$){let J=Q[$];if(qH(J));else if(X===$)return-1;else if(J===","){if(Y)return-1;Y=!0}else if(J==="}")return $;else return-1}return-1}function el(Q,X,Y,$){switch(Q[X]){case"[":if($===1)return X+1;return Bw(Q,X+1)+1;case"{":{if($===1)return X+1;let J=tl(Q,X+1);if(J===-1)return X+1;return J+1}case"(":if($===1)return X+1;return sl(Q,X+1)+1;case"]":case"}":case")":return X+1;case"\\":{let J=Q[X+1];switch(J){case"x":if(n0(Q[X+2])&&n0(Q[X+3]))return X+4;throw Error(`Unexpected token '${Q.substring(X,X+4)}' found`);case"u":if(Q[X+2]==="{"){if(!Y)return X+2;if(Q[X+4]==="}"){if(n0(Q[X+3]))return X+5;throw Error(`Unexpected token '${Q.substring(X,X+5)}' found`)}if(Q[X+5]==="}"){if(n0(Q[X+3])&&n0(Q[X+4]))return X+6;throw Error(`Unexpected token '${Q.substring(X,X+6)}' found`)}if(Q[X+6]==="}"){if(n0(Q[X+3])&&n0(Q[X+4])&&n0(Q[X+5]))return X+7;throw Error(`Unexpected token '${Q.substring(X,X+7)}' found`)}if(Q[X+7]==="}"){if(n0(Q[X+3])&&n0(Q[X+4])&&n0(Q[X+5])&&n0(Q[X+6]))return X+8;throw Error(`Unexpected token '${Q.substring(X,X+8)}' found`)}if(Q[X+8]==="}"&&n0(Q[X+3])&&n0(Q[X+4])&&n0(Q[X+5])&&n0(Q[X+6])&&n0(Q[X+7]))return X+9;throw Error(`Unexpected token '${Q.substring(X,X+9)}' found`)}if(n0(Q[X+2])&&n0(Q[X+3])&&n0(Q[X+4])&&n0(Q[X+5]))return X+6;throw Error(`Unexpected token '${Q.substring(X,X+6)}' found`);case"p":case"P":{if(!Y)return X+2;let Z=X+2;for(;Z<Q.length&&Q[Z]!=="}";Z+=Q[Z]==="\\"?2:1);if(Q[Z]!=="}")throw Error("Invalid \\P definition");return Z+1}case"k":{let Z=X+2;for(;Z<Q.length&&Q[Z]!==">";++Z);if(Q[Z]!==">"){if(!Y)return X+2;throw Error("Invalid \\k definition")}return Z+1}default:if(qH(J)){let Z=Y?Q.length:Math.min(X+4,Q.length),G=X+2;for(;G<Z&&qH(Q[G]);++G);return G}return X+(Y?FL(Q,X+1):1)+1}}default:return X+(Y?FL(Q,X):1)}}function V3(Q,X,Y,$){let J=el(Q,X,Y,$);return Q.substring(X,J)}var RL={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},C3={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},Q7=dH(C3),mH={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},DH=dH(mH),zw={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},NL=dH(zw);function dH(Q){let X={};for(let Y of Object.keys(Q)){let $=Q[Y];if(Array.isArray($))for(let J=0;J!==$.length;++J)X[$[J]]=Y;else X[$]=Y}return X}function Qo(Q){return Q in mH||Q in DH}function Xo(Q){return Q in C3||Q in Q7}function LL(Q){if(Q in RL)return RL[Q];if(Q in Q7)return Q7[Q];if(Q in C3||Q==="General_Category"||Q==="Script"||Q==="Script_Extensions")return Q;throw Error(`Unknown Unicode property name: ${Q}`)}function ML(Q){if(Q in DH)return DH[Q];if(Q in NL)return NL[Q];if(Q in Q7)return Q7[Q];if(Q in mH||Q in zw||Q in C3)return Q;throw Error(`Unknown Unicode property value: ${Q}`)}function Yo(Q,X){let Y=Q.indexOf("=");if(Y!==-1){let $=Q.substring(0,Y),J=Q.substring(Y+1);return{type:"UnicodeProperty",name:$,value:J,negative:X,shorthand:!1,binary:!1,canonicalName:LL($),canonicalValue:ML(J)}}if(Qo(Q))return{type:"UnicodeProperty",name:"General_Category",value:Q,negative:X,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:ML(Q)};if(Xo(Q)){let $=LL(Q);return{type:"UnicodeProperty",name:Q,value:Q,negative:X,shorthand:!1,binary:!0,canonicalName:$,canonicalValue:$}}throw Error(`Invalid Unicode property: ${Q}`)}var uW=String.fromCodePoint;function lW(Q){let X=Q.pop();if(X===void 0)throw Error("Unable to extract token preceeding the currently parsed one");return X}function Ow(Q){return Q>="0"&&Q<="9"}function O3(Q,X){return{type:"Char",kind:"simple",symbol:Q,value:Q,codePoint:Q.codePointAt(0)||-1,escaped:X}}function m5(Q,X){return{type:"Char",kind:"meta",symbol:X,value:Q,codePoint:X.codePointAt(0)||-1}}function T6(Q,X){if(Q.length>1)return{type:"Alternative",expressions:Q};if(!X&&Q.length===0)throw Error("Unsupported no token");return Q[0]}function oW(Q){if(Q[0]==="\\"){let X=Q[1];switch(X){case"x":{let Y=Q.substring(2),$=Number.parseInt(Y,16);return{type:"Char",kind:"hex",symbol:uW($),value:Q,codePoint:$}}case"u":{if(Q==="\\u")return O3("u",!0);let Y=Q[2]==="{"?Q.substring(3,Q.length-1):Q.substring(2),$=Number.parseInt(Y,16);return{type:"Char",kind:"unicode",symbol:uW($),value:Q,codePoint:$}}case"0":return m5(Q,"\x00");case"n":return m5(Q,`
63
+ `);case"f":return m5(Q,"\f");case"r":return m5(Q,"\r");case"t":return m5(Q,"\t");case"v":return m5(Q,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:Q,codePoint:NaN};default:if(Ow(X)){let Y=Q.substring(1),$=Number(Y);return{type:"Char",kind:"decimal",symbol:uW($),value:Q,codePoint:$}}if(Q.length>2&&(X==="p"||X==="P")){let Y=X==="P";return Yo(Q.substring(3,Q.length-1),Y)}return O3(Q.substring(1),!0)}}return O3(Q)}function d5(Q,X,Y,$){let J=null;for(let Z=0,G=V3(X,Z,Y,0);Z!==X.length;Z+=G.length,G=V3(X,Z,Y,0)){let W=G[0];switch(W){case"|":if(J===null)J=[];J.push(T6(Q.splice(0),!0)||null);break;case".":Q.push({type:"Char",kind:"meta",symbol:G,value:G,codePoint:NaN});break;case"*":case"+":{let H=lW(Q);Q.push({type:"Repetition",expression:H,quantifier:{type:"Quantifier",kind:W,greedy:!0}});break}case"?":{let H=lW(Q);if(H.type==="Repetition")H.quantifier.greedy=!1,Q.push(H);else Q.push({type:"Repetition",expression:H,quantifier:{type:"Quantifier",kind:W,greedy:!0}});break}case"{":{if(G==="{"){Q.push(O3(G));break}let H=lW(Q),K=G.substring(1,G.length-1).split(","),V=Number(K[0]),_=K.length===1?V:K[1].length!==0?Number(K[1]):void 0;Q.push({type:"Repetition",expression:H,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:V,to:_}});break}case"[":{let H=G.substring(1,G.length-1),K=[],V=void 0,_=!1;for(let q=0,D=V3(H,q,Y,1);q!==H.length;q+=D.length,D=V3(H,q,Y,1)){if(q===0&&D==="^"){V=!0;continue}let B=oW(D);if(D==="-")K.push(B),_=!0;else{let F=K.length>=2?K[K.length-2]:void 0;if(_&&F!==void 0&&F.type==="Char"&&B.type==="Char")K.pop(),K.pop(),K.push({type:"ClassRange",from:F,to:B});else K.push(B);_=!1}}Q.push({type:"CharacterClass",expressions:K,negative:V});break}case"(":{let H=G.substring(1,G.length-1),K=[];if(H[0]==="?")if(H[1]===":")d5(K,H.substring(2),Y,$),Q.push({type:"Group",capturing:!1,expression:T6(K)});else if(H[1]==="="||H[1]==="!")d5(K,H.substring(2),Y,$),Q.push({type:"Assertion",kind:"Lookahead",negative:H[1]==="!"?!0:void 0,assertion:T6(K)});else if(H[1]==="<"&&(H[2]==="="||H[2]==="!"))d5(K,H.substring(3),Y,$),Q.push({type:"Assertion",kind:"Lookbehind",negative:H[2]==="!"?!0:void 0,assertion:T6(K)});else{let V=H.split(">");if(V.length<2||V[0][1]!=="<")throw Error(`Unsupported regex content found at ${JSON.stringify(G)}`);let _=++$.lastIndex,q=V[0].substring(2);$.named.set(q,_),d5(K,V.slice(1).join(">"),Y,$),Q.push({type:"Group",capturing:!0,nameRaw:q,name:q,number:_,expression:T6(K)})}else{let V=++$.lastIndex;d5(K,H,Y,$),Q.push({type:"Group",capturing:!0,number:V,expression:T6(K)})}break}default:if(G==="^")Q.push({type:"Assertion",kind:G});else if(G==="$")Q.push({type:"Assertion",kind:G});else if(G[0]==="\\"&&Ow(G[1])){let H=Number(G.substring(1));if(Y||H<=$.lastIndex)Q.push({type:"Backreference",kind:"number",number:H,reference:H});else Q.push(oW(G))}else if(G[0]==="\\"&&G[1]==="k"&&G.length!==2){let H=G.substring(3,G.length-1);Q.push({type:"Backreference",kind:"name",number:$.named.get(H)||0,referenceRaw:H,reference:H})}else Q.push(oW(G));break}}if(J!==null){J.push(T6(Q.splice(0),!0)||null);let Z={type:"Disjunction",left:J[0],right:J[1]};for(let G=2;G<J.length;++G)Z={type:"Disjunction",left:Z,right:J[G]};Q.push(Z)}}function $o(Q){let X=nX([...Q.flags],"u")!==-1,Y=Q.source,$=[];return d5($,Y,X,{lastIndex:0,named:new Map}),T6($)}var Jo=String.fromCodePoint;function Zo(Q){if(Q.binary||Q.shorthand)return Q.canonicalValue;return`${Q.canonicalName}=${Q.canonicalValue}`}function wL(Q,X,Y,$){let J=-1;for(let Z=X;Z<=Y;++Z)if(Q.test(Jo(Z))){if(J===-1)J=Z}else if(J!==-1){let G=Z-1;$.push(J===G?[G]:[J,G]),J=-1}if(J!==-1)$.push(J===Y?[Y]:[J,Y])}function Go(Q,X){let Y=new RegExp(`^\\${X?"P":"p"}{${Q}}$`,"u"),$=[];return wL(Y,0,55295,$),wL(Y,57344,1114111,$),$}var PL=new Map;function Wo(Q,X){let Y=`${X?"P":"p"}:${Q}`,$=PL.get(Y);if($!==void 0)return $;let J=Go(Q,X);return PL.set(Y,J),J}function Ho(Q){return l5(...O0(Wo(Zo(Q),Q.negative),(X)=>eW(X)))}var Ko=String.fromCodePoint,Fw=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Rw=[..."0123456789"],Nw=[...` \r
64
+ \v\f`],UH=[...`\r
65
+ `],Lw=[..."\x1E\x15"],Vo=[...UH,...Lw],_o=new c8(Fw),qo=new c8(Rw),Do=new c8(Nw),Uo=new c8(Lw),Bo=new c8(Vo),T9=()=>a0({unit:"grapheme-ascii",minLength:1,maxLength:1});function AL(Q){return new h(`Unsupported AST node! Received: ${o0(Q)}`)}function I9(Q,X,Y){switch(Q.type){case"Char":if(Q.kind==="meta")switch(Q.value){case"\\w":return D4(...Fw);case"\\W":return T9().filter(($)=>!I6(_o,$));case"\\d":return D4(...Rw);case"\\D":return T9().filter(($)=>!I6(qo,$));case"\\s":return D4(...Nw);case"\\S":return T9().filter(($)=>!I6(Do,$));case"\\b":case"\\B":throw new h(`Meta character ${Q.value} not implemented yet!`);case".":{let $=Y.dotAll?Uo:Bo;return T9().filter((J)=>!I6($,J))}}if(Q.symbol===void 0)throw new h(`Unexpected undefined symbol received for non-meta Char! Received: ${o0(Q)}`);return k0(Q.symbol);case"Repetition":{let $=I9(Q.expression,X,Y);switch(Q.quantifier.kind){case"*":return a0({...X,unit:$});case"+":return a0({...X,minLength:1,unit:$});case"?":return a0({...X,minLength:0,maxLength:1,unit:$});case"Range":return a0({...X,minLength:Q.quantifier.from,maxLength:Q.quantifier.to,unit:$});default:throw AL(Q.quantifier)}}case"Quantifier":throw new h("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":{let $=[],J="";for(let Z of Q.expressions)if(Z.type==="Char"&&Z.kind!=="meta"&&Z.symbol!==void 0)J+=Z.symbol;else if(Y.multiline||Z.type!=="Assertion"||Z.kind!=="^"&&Z.kind!=="$"){if(J!=="")T($,k0(J)),J="";T($,I9(Z,X,Y))}if(J!=="")T($,k0(J));if($.length===0)return k0("");if($.length===1)return $[0];return Z0(...$).map((Z)=>y0(Z,""))}case"CharacterClass":if(Q.negative){let $=O0(Q.expressions,(J)=>I9(J,X,Y));return T9().filter((J)=>hL($,(Z)=>!Z.canShrinkWithoutContext(J)))}return J1(...O0(Q.expressions,($)=>I9($,X,Y)));case"ClassRange":{let $=Q.from.codePoint,J=Q.to.codePoint;return A0({min:$,max:J}).map((Z)=>Ko(Z),(Z)=>{if(typeof Z!=="string")throw new h("Invalid type");if([...Z].length!==1)throw new h("Invalid length");return f5(Z,0)})}case"Group":return I9(Q.expression,X,Y);case"Disjunction":{let $=[Q.left,Q.right],J=[];for(let Z=0;Z!==$.length;++Z){let G=$[Z];if(G===null)T(J,k0(""));else if(G.type==="Disjunction")T($,G.left),T($,G.right);else T(J,I9(G,X,Y))}return J1(...J)}case"Assertion":if(Q.kind==="^"||Q.kind==="$"){if(Y.multiline)if(Q.kind==="^")return J1(k0(""),Z0(a0({unit:T9()}),D4(...UH)).map(($)=>`${$[0]}${$[1]}`,($)=>{if(typeof $!=="string"||$.length===0)throw new h("Invalid type");return[d0($,0,$.length-1),$[$.length-1]]}));else return J1(k0(""),Z0(D4(...UH),a0({unit:T9()})).map(($)=>`${$[0]}${$[1]}`,($)=>{if(typeof $!=="string"||$.length===0)throw new h("Invalid type");return[$[0],d0($,1)]}));return k0("")}throw new h(`Assertions of kind ${Q.kind} not implemented yet!`);case"Backreference":throw new h("Backreference nodes not implemented yet!");case"UnicodeProperty":return Ho(Q);default:throw AL(Q)}}function zo(Q,X={}){for(let W of Q.flags)if(W!=="d"&&W!=="g"&&W!=="m"&&W!=="s"&&W!=="u")throw new h(`Unable to use "stringMatching" against a regex using the flag ${W}`);let Y=X.maxLength,$={size:X.size,maxLength:Y},J={multiline:Q.multiline,dotAll:Q.dotAll},Z=al($o(Q));if(Y!==void 0)Z=il(Z,Y);let G=I9(Z,$,J);if(Y!==void 0)return G.filter((W)=>[...W].length<=Y);return G}function Oo(Q){let X=[];for(let Y=0;Y!==Q.length;++Y)X.push(Q[Y].next());return X}function Fo(Q,X){for(let Y=0;Y!==Q.length;++Y)X[Y]=Q[Y].next()}function Ro(Q){for(let X=0;X!==Q.length;++X)if(Q[X].done)return!0;return!1}function*No(...Q){let X=Oo(Q);while(!Ro(X))yield X.map((Y)=>Y.value),Fo(Q,X)}function*Lo(Q){let X=Q;while(!0)yield X,++X}var Mo=class extends g0{constructor(Q,X){super();this.arb=Q,this.maxShrinks=X}generate(Q,X){let Y=this.arb.generate(Q,X);return this.valueMapper(Y,0)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){if(this.isSafeContext(X))return this.safeShrink(Q,X.originalContext,X.length);return this.safeShrink(Q,void 0,0)}safeShrink(Q,X,Y){let $=this.maxShrinks-Y;if($<=0)return G0.nil();return new G0(No(this.arb.shrink(Q,X),Lo(Y+1))).take($).map((J)=>this.valueMapper(J[0],J[1]))}valueMapper(Q,X){let Y={originalContext:Q.context,length:X};return new y(Q.value,Y)}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalContext"in Q&&"length"in Q}};function wo(Q,X){return new Mo(Q,X)}var Po="module",Ao="4.9.0",Co="0d3c2547dce556f72413607849377530d18ea283";var $7=f2;function H8(){return(Q,X,Y)=>{return E(new P9(Q.map(TX),($)=>X($.map((J)=>E(J))),Y))}}function A8(Q,X){return H8()([],()=>(Y,$)=>Q(Y)?f(Y):p(new u0($,R(Y))),X)}function jo(Q){return Q}function To(Q){return(X)=>X.annotate(Q)}function Io(Q){return(X)=>pH(pH(X).annotate(Q))}function Eo(Q){return(X)=>{return X.rebuild(bX(X.ast,Q))}}function So(Q){return Q}function Mw(Q){return Y1(Q)?Q.value:{issues:[{message:iJ(Q.cause)}]}}function vo(Q,X){let Y=i0(Q),$={errors:"all",...X?.parseOptions},J=Rz(X),Z=(G)=>{let W=new X5,H=F5(SZ(Y(G,$),{onFailure:J,onSuccess:(V)=>({value:V})}),{scheduler:W});H.currentDispatcher?.flush();let K=H.pollUnsafe();if(K)return Mw(K);return new Promise((V)=>{H.addObserver((_)=>{V(Mw(_))})})};if("~standard"in Q){let G=Q;if("validate"in G["~standard"])return G;return Object.assign(G["~standard"],{validate:Z}),G}else return Object.assign(Q,{"~standard":{version:1,vendor:"effect",validate:Z}})}function ww(Q,X){let Y=EA(Q);if(X==="draft-2020-12"){let $=Y.schema;if(Object.keys(Y.definitions).length>0)$.$defs=Y.definitions;return $}else if(X==="draft-07"){let $=WR(Y),J=$.schema;if(Object.keys($.definitions).length>0)J.definitions=$.definitions;return J}throw new globalThis.Error(`Unsupported target: ${X}`)}function xo(Q){let X={input(Y){return ww(Q,Y.target)},output(Y){return ww(k1(Q),Y.target)}};if("~standard"in Q){let Y=Q;if("jsonSchema"in Y["~standard"])return Y;return Object.assign(Y["~standard"],{jsonSchema:X}),Y}else return Object.assign(Q,{"~standard":{version:1,vendor:"effect",jsonSchema:X}})}var kw=VF,bo=qF;function S3(Q,X){let Y=i0(Q,X);return($,J)=>{return c2(Y($,J))}}var ko=S3;function yw(Q,X){let Y;for(let $ of Q.reasons){if(!pQ($)||!eG($.error))throw new globalThis.Error(X,{cause:Q});Y??=$.error}if(Y===void 0)throw new globalThis.Error(X,{cause:Q});return Y}function gw(Q){return mY(Q).then((X)=>{if(Y1(X))return X.value;throw yw(X.cause,"Promise adapter can only reject schema errors")})}function hw(Q){let X=U6(Q);if(Y1(X))return X.value;throw yw(X.cause,"Sync adapter can only throw schema errors")}function mw(Q,X){let Y=DF(Q,X);return($,J)=>{return dw(Y($,J))}}function dw(Q){return Y1(Q)?V9(Q.value):v4(Z4(Q.cause,(X)=>new C6(X)))}var yo=mw,go=XW,ho=UF;function pw(Q,X){let Y=BF(Q,X);return($,J)=>{return a9(Y($,J),(Z)=>new C6(Z))}}var mo=pw;function fw(Q,X){let Y=S3(Q,X);return($,J)=>{return gw(Y($,J))}}var po=fw;function cw(Q,X){let Y=S3(Q,X);return($,J)=>{return hw(Y($,J))}}var fo=cw;function v3(Q,X){let Y=x5(Q,X);return($,J)=>{return c2(Y($,J))}}var uw=v3;function lw(Q,X){let Y=zF(Q,X);return($,J)=>{return dw(Y($,J))}}var co=lw,uo=$W,lo=OF;function ow(Q,X){let Y=FF(Q,X);return($,J)=>{return a9(Y($,J),(Z)=>new C6(Z))}}var oo=ow;function rw(Q,X){let Y=v3(Q,X);return($,J)=>{return gw(Y($,J))}}var ro=rw;function iw(Q,X){let Y=v3(Q,X);return($,J)=>{return hw(Y($,J))}}var io=iw,E=mX;function x3(Q){return C(Q,$7)&&Q[$7]===$7}var k6=P1((Q)=>E(kX(Q.ast),{schema:Q})),no=P1((Q)=>Q.schema),P8=P1((Q)=>k6(y3(Q))),ao=P1((Q)=>Q.schema.members[0]),so=P1((Q)=>E(lG(Q.ast),{schema:Q})),to=P1((Q)=>Q.schema),k1=P1((Q)=>E(z1(Q.ast),{schema:Q})),s5=P1((Q)=>E(O1(Q.ast),{schema:Q})),J7="~effect/Schema/flip";function eo(Q){return C(Q,J7)&&Q[J7]===J7}function pH(Q){if(eo(Q))return Q.schema.rebuild(k8(Q.ast));return E(k8(Q.ast),{[J7]:J7,schema:Q})}function p0(Q){let X=E(new $8(Q),{literal:Q,transform(Y){return X.pipe(l(p0(Y),{decode:Y0(()=>Y),encode:Y0(()=>Q)}))}});return X}function nw(Q){return new yG(Q.map((X)=>x3(X)?X.ast:new $8(X)))}function Qr(Q){return E(nw(Q),{parts:Q})}function Xr(Q){return E(nw(Q).asTemplateLiteralParser(),{parts:Q})}function Yr(Q){return E(new kG(Object.keys(Q).filter((X)=>typeof Q[Q[X]]!=="number").map((X)=>[X,Q[X]])),{enums:Q})}var $r=E(CO),Jr=E(TO),uH=E(N9),F0=E(bG),lH=E(MO),n=E(L6),b3=E(hG),aw=E(yO),sw=E(hO),U4=E(dO),Zr=E(PO),Gr=E(SO);function Wr(Q){return E(new gG(Q))}function oH(Q,X){return E(Q,{fields:X,mapFields(Y,$){let J=Y(this.fields);return oH(j2(J,$?.unsafePreserveChecks?this.ast.checks:void 0),J)}})}function m(Q){return oH(j2(Q,void 0),Q)}function Hr(Q){return P1((X)=>X.mapFields(CF(Q)))}var Kr=(Q)=>typeof Q==="symbol"?Q:globalThis.String(Q);function Vr(Q){return function(X){let Y={},$=Object.create(null),J=Object.create(null),Z=new Set;for(let G of Reflect.ownKeys(X.fields)){let W=s5(X.fields[G]),H=Object.hasOwn(Q,G),K=H?Q[G]:G,V=Kr(K);if(Z.has(V))throw new globalThis.Error(`Duplicate encoded keys: ${O4(K)}`);if(Z.add(V),b(Y,K,W),H)$[G]=K,J[K]=G}return m(Y).pipe(l(X,h0({decode:GW(J),encode:GW($)})))}}function _r(Q,X){return(Y)=>{let $=f7(Y.fields,k1),J=m({...$,...Q});return Y.pipe(l(J,h0({decode:(Z)=>{let G={...Z};for(let W in Q){let H=X[W],K=H(Z);if(L1(K))b(G,W,K.value)}return G},encode:(Z)=>{let G={...Z};for(let W in Q)delete G[W];return G}})))}}function tw(Q,X,Y){let $=Y?.keyValueCombiner?.decode||Y?.keyValueCombiner?.encode?new A2(Y.keyValueCombiner.decode,Y.keyValueCombiner.encode):void 0;return E(aO(Q.ast,X.ast,$),{key:Q,value:X})}function qr(Q,X){return E(pO(Q.ast,X.map(TX)),{schema:Q,records:X})}function ew(Q,X){return E(Q,{elements:X,mapElements(Y,$){let J=Y(this.elements);return ew(pG(J,$?.unsafePreserveChecks?this.ast.checks:void 0),J)}})}function r5(Q){return ew(pG(Q),Q)}function Dr(Q,X){return E(fO(Q.ast,X.map(TX)),{schema:Q,rest:X})}var e0=P1((Q)=>E(new g8(!1,[],[Q.ast]),{value:Q}));var Ur=P1((Q)=>E(new g8(!1,[Q.ast],[Q.ast]),{value:Q}));function Br(Q){return Q1([Q,e0(Q)]).pipe(l(e0(k1(Q)),h0({decode:TV,encode:(X)=>X.length===1?X[0]:X})))}function zr(Q){return e0(Q).check($K())}var Or=P1((Q)=>{return E(new g8(!0,Q.ast.elements,Q.ast.rest),{schema:Q})});function QP(Q,X){return E(Q,{members:X,mapMembers(Y,$){let J=Y(this.members);return QP(T2(J,this.ast.mode,$?.unsafePreserveChecks?this.ast.checks:void 0),J)}})}function Q1(Q,X){return QP(T2(Q,X?.mode??"anyOf",void 0),Q)}function k3(Q){let X=Q.map(p0);return E(T2(X,"anyOf",void 0),{literals:Q,members:X,mapMembers(Y){return Q1(Y(this.members))},pick(Y){return k3(Y)},transform(Y){return Q1(X.map(($,J)=>$.transform(Y[J])))}})}var rH=P1((Q)=>Q1([Q,F0])),y3=P1((Q)=>Q1([Q,lH])),XP=P1((Q)=>Q1([Q,F0,lH]));function YP(Q){return E(new I2(()=>Q().ast))}function Fr(...Q){return(X)=>X.check(...Q)}function Rr(Q,X){return(Y)=>E(h8(Y.ast,[S2(Q,X)]),{schema:Y})}function $P(Q){return(X)=>E(iO(X.ast,Q),{schema:X,identifier:Q})}function Nr(Q,X){return(Y)=>{return(X.checks?Y.check(...X.checks):Y).pipe($P(Q))}}function iH(Q){return(X)=>E(oO(X.ast,new PX(Q,u)),{schema:X})}function JP(Q){return(X)=>E(rO(X.ast,new PX(u,Q)),{schema:X})}function Lr(Q){return ZP(Q)}function ZP(Q){return(X)=>iH(dY(Q))(X)}function Mr(Q){return GP(Q)}function GP(Q){return(X)=>JP(dY(Q))(X)}function l(Q,X){return(Y)=>{return E(b2(Y.ast,Q.ast,X?O2(X):A5()),{from:Y,to:Q})}}function wr(Q){return(X)=>{return l(k1(X),Q)(X)}}function nH(Q,X){return(Y)=>{return X?l(Y,X)(Q):l(Y)(Q)}}function Pr(Q){return(X)=>{return l(X,Q)(s5(X))}}function WP(Q){return(X)=>E(nO(X.ast,aH(Q)),{schema:X})}function aH(Q){return U9(Q,(X)=>D9(()=>Z4(X,(Y)=>Y.issue)))}function sH(Q,X){let Y=X?.encodingStrategy==="omit"?BG():b8();return($)=>{return k6(s5($)).pipe(l($,{decode:MX(aH(Q)),encode:Y}))}}function Ar(Q,X){return(Y)=>{return k1(Y).pipe(sH(Q,X),nH(k6(Y)))}}function HP(Q,X){let Y=X?.encodingStrategy==="omit"?BG():b8();return($)=>{return P8(s5($)).pipe(l($,{decode:MX(aH(Q)),encode:Y}))}}function Cr(Q,X){return(Y)=>{return k1(Y).pipe(HP(Q,X),nH(P8(Y)))}}function x9(Q){return p0(Q).pipe(WP(f(Q)))}function jr(Q){return x9(Q).pipe(sH(f(Q),{encodingStrategy:"omit"}))}function g3(Q,X){return m({_tag:x9(Q),...X})}function KP(Q){return(X)=>{let Y={},$=[],J=new Set,Z={},G=(K)=>(V)=>K.includes(V[Q]);return W(X),Object.assign(X,{cases:Y,discriminants:$,isAnyOf:G,guards:Z,match:H});function W(K){let V=K.ast;if(jX(V)&&"members"in K&&globalThis.Array.isArray(K.members)&&K.members.every(x3))return K.members.forEach(W);let _=IX(V);if(_.length>0){let q=_.find((D)=>D.key===Q)?.literal;if(F7(q)){let D=typeof q==="number"?globalThis.String(q):q;if(J.has(D))throw new globalThis.Error(`Duplicate discriminant: ${globalThis.String(q)}`);J.add(D),$.push(q),b(Y,q,K),b(Z,q,kw(k1(K)));return}}throw new globalThis.Error("No literal or unique symbol found")}function H(){if(arguments.length===1){let D=arguments[0];return function(B){let F=B[Q];return(Object.hasOwn(D,F)?D[F]:void 0)(B)}}let K=arguments[0],V=arguments[1],_=K[Q];return(Object.hasOwn(V,_)?V[_]:void 0)(K)}}}function Tr(Q){let X={},Y=[];for(let W of Object.keys(Q)){let H=g3(W,Q[W]);b(X,W,H),Y.push(H)}let $=Q1(Y),{guards:J,isAnyOf:Z,match:G}=KP("_tag")($);return E($.ast,{cases:X,isAnyOf:Z,guards:J,match:G})}function Ir(){return(Q)=>{return Q}}function y6(Q,X){return A8((Y)=>Y instanceof Q,X)}function v0(){return(Q,X)=>{return new m0(Q.ast,O2(X))}}var j0=E2;function Er(Q,X=void 0){return new N6(Q,X)}function A1(Q,X){return l1(Q,F0,({annotations:Y})=>Y===void 0?X:X.annotate(Y))}var Pw="^\\S[\\s\\S]*\\S$|^\\S$|^$";function tH(Q){let X=new globalThis.RegExp(Pw);return j0((Y)=>Y.trim()===Y,{expected:"a string with no leading or trailing whitespace",representation:{id:"effect/schema/isTrimmed",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isTrimmed()"}),arbitrary:{constraint:{patterns:[Pw]}},...Q})}var Sr=a("effect/schema/isTrimmed",F0,({annotations:Q})=>tH(Q));function b9(Q,X){let{source:Y,flags:$}=Q,J=$===""?`new RegExp(${P(Y)})`:`new RegExp(${P(Y)}, ${P($)})`;return SX(Q,{toCode:()=>({runtime:`Schema.isPattern(${J})`}),...X})}var vr=m({source:n,flags:n}).check(j0((Q)=>{let X=wV(()=>new globalThis.RegExp(Q.source,Q.flags));return E1(X)&&X.success.source===Q.source&&X.success.flags===Q.flags})),xr={id:"effect/schema/isPattern",payloadSchema:vr,revive:({annotations:Q,payload:X})=>b9(new globalThis.RegExp(X.source,X.flags),Q)};function VP(Q){return rG({toCode:()=>({runtime:"Schema.isStringFinite()"}),...Q})}var br=a("effect/schema/isStringFinite",F0,({annotations:Q})=>VP(Q));function _P(Q){return iG({toCode:()=>({runtime:"Schema.isStringBigInt()"}),...Q})}var kr=a("effect/schema/isStringBigInt",F0,({annotations:Q})=>_P(Q));function qP(Q){return aG({toCode:()=>({runtime:"Schema.isStringSymbol()"}),...Q})}var yr=a("effect/schema/isStringSymbol",F0,({annotations:Q})=>qP(Q)),gr=(Q)=>{if(Q)return new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/};function DP(Q,X){let Y=gr(Q);return b9(Y,{expected:Q?`a UUID v${Q}`:"a UUID",representation:{id:"effect/schema/isUUID",payload:{version:Q??null}},toJsonSchema:()=>({pattern:Y.source,format:"uuid"}),toCode:()=>({runtime:Q===void 0?"Schema.isUUID()":`Schema.isUUID(${Q})`}),...X})}var hr=a("effect/schema/isUUID",m({version:Q1([k3([1,2,3,4,5,6,7,8]),F0])}),({annotations:Q,payload:X})=>DP(X.version??void 0,Q)),Aw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;function UP(Q){return b9(Aw,{expected:"a GUID",representation:{id:"effect/schema/isGUID",payload:null},toJsonSchema:()=>({pattern:Aw.source}),toCode:()=>({runtime:"Schema.isGUID()"}),...Q})}var mr=a("effect/schema/isGUID",F0,({annotations:Q})=>UP(Q));function BP(Q){let X=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return b9(X,{representation:{id:"effect/schema/isULID",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isULID()"}),...Q})}var dr=a("effect/schema/isULID",F0,({annotations:Q})=>BP(Q));function eH(Q){let X=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return b9(X,{expected:"a base64 encoded string",representation:{id:"effect/schema/isBase64",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isBase64()"}),...Q})}var pr=a("effect/schema/isBase64",F0,({annotations:Q})=>eH(Q));function zP(Q){let X=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return b9(X,{expected:"a base64url encoded string",representation:{id:"effect/schema/isBase64Url",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isBase64Url()"}),...Q})}var fr=a("effect/schema/isBase64Url",F0,({annotations:Q})=>zP(Q));function OP(Q,X){let Y=JSON.stringify(Q),$=new globalThis.RegExp(`^${y5(Q)}`);return j0((J)=>J.startsWith(Q),{expected:`a string starting with ${Y}`,representation:{id:"effect/schema/isStartsWith",payload:{startsWith:Q}},toJsonSchema:()=>({pattern:$.source}),toCode:()=>({runtime:`Schema.isStartsWith(${P(Q)})`}),arbitrary:{constraint:{patterns:[$.source]}},...X})}var cr=a("effect/schema/isStartsWith",m({startsWith:n}),({annotations:Q,payload:X})=>OP(X.startsWith,Q));function FP(Q,X){let Y=JSON.stringify(Q),$=new globalThis.RegExp(`${y5(Q)}$`);return j0((J)=>J.endsWith(Q),{expected:`a string ending with ${Y}`,representation:{id:"effect/schema/isEndsWith",payload:{endsWith:Q}},toJsonSchema:()=>({pattern:$.source}),toCode:()=>({runtime:`Schema.isEndsWith(${P(Q)})`}),arbitrary:{constraint:{patterns:[$.source]}},...X})}var ur=a("effect/schema/isEndsWith",m({endsWith:n}),({annotations:Q,payload:X})=>FP(X.endsWith,Q));function RP(Q,X){let Y=JSON.stringify(Q),$=new globalThis.RegExp(y5(Q));return j0((J)=>J.includes(Q),{expected:`a string including ${Y}`,representation:{id:"effect/schema/isIncludes",payload:{includes:Q}},toJsonSchema:()=>({pattern:$.source}),toCode:()=>({runtime:`Schema.isIncludes(${P(Q)})`}),arbitrary:{constraint:{patterns:[$.source]}},...X})}var lr=a("effect/schema/isIncludes",m({includes:n}),({annotations:Q,payload:X})=>RP(X.includes,Q)),Cw="^[^a-z]*$";function NP(Q){let X=new globalThis.RegExp(Cw);return j0((Y)=>Y.toUpperCase()===Y,{expected:"a string with all characters in uppercase",representation:{id:"effect/schema/isUppercased",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isUppercased()"}),arbitrary:{constraint:{patterns:[Cw]}},...Q})}var or=a("effect/schema/isUppercased",F0,({annotations:Q})=>NP(Q)),jw="^[^A-Z]*$";function LP(Q){let X=new globalThis.RegExp(jw);return j0((Y)=>Y.toLowerCase()===Y,{expected:"a string with all characters in lowercase",representation:{id:"effect/schema/isLowercased",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isLowercased()"}),arbitrary:{constraint:{patterns:[jw]}},...Q})}var rr=a("effect/schema/isLowercased",F0,({annotations:Q})=>LP(Q)),Tw="^[^a-z]?.*$";function MP(Q){let X=new globalThis.RegExp(Tw);return j0((Y)=>Y.charAt(0).toUpperCase()===Y.charAt(0),{expected:"a string with the first character in uppercase",representation:{id:"effect/schema/isCapitalized",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isCapitalized()"}),arbitrary:{constraint:{patterns:[Tw]}},...Q})}var ir=a("effect/schema/isCapitalized",F0,({annotations:Q})=>MP(Q)),Iw="^[^A-Z]?.*$";function wP(Q){let X=new globalThis.RegExp(Iw);return j0((Y)=>Y.charAt(0).toLowerCase()===Y.charAt(0),{expected:"a string with the first character in lowercase",representation:{id:"effect/schema/isUncapitalized",payload:null},toJsonSchema:()=>({pattern:X.source}),toCode:()=>({runtime:"Schema.isUncapitalized()"}),arbitrary:{constraint:{patterns:[Iw]}},...Q})}var nr=a("effect/schema/isUncapitalized",F0,({annotations:Q})=>wP(Q)),o8=E(M2),PP=fG,ar=a("effect/schema/isFinite",F0,({annotations:Q})=>PP(Q));function Z7(Q){let X=Y6(Q.order),Y=Q.formatter??P;return($,J)=>{return j0((Z)=>X(Z,$),{expected:`a value greater than ${Y($)}`,arbitrary:{constraint:{ordered:{order:Q.order,minimum:$,exclusiveMinimum:!0}}},...Q.annotate?.($),...J})}}function G7(Q){let X=DQ(Q.order),Y=Q.formatter??P;return($,J)=>{return j0((Z)=>X(Z,$),{expected:`a value greater than or equal to ${Y($)}`,arbitrary:{constraint:{ordered:{order:Q.order,minimum:$}}},...Q.annotate?.($),...J})}}function W7(Q){let X=o9(Q.order),Y=Q.formatter??P;return($,J)=>{return j0((Z)=>X(Z,$),{expected:`a value less than ${Y($)}`,arbitrary:{constraint:{ordered:{order:Q.order,maximum:$,exclusiveMaximum:!0}}},...Q.annotate?.($),...J})}}function H7(Q){let X=qQ(Q.order),Y=Q.formatter??P;return($,J)=>{return j0((Z)=>X(Z,$),{expected:`a value less than or equal to ${Y($)}`,arbitrary:{constraint:{ordered:{order:Q.order,maximum:$}}},...Q.annotate?.($),...J})}}function K7(Q){let X=DQ(Q.order),Y=Y6(Q.order),$=qQ(Q.order),J=o9(Q.order),Z=Q.formatter??P;return(G,W)=>{let H=G.exclusiveMinimum?Y:X,K=G.exclusiveMaximum?J:$;return j0((V)=>H(V,G.minimum)&&K(V,G.maximum),{expected:`a value between ${Z(G.minimum)}${G.exclusiveMinimum?" (excluded)":""} and ${Z(G.maximum)}${G.exclusiveMaximum?" (excluded)":""}`,arbitrary:{constraint:{ordered:{order:Q.order,minimum:G.minimum,maximum:G.maximum,...G.exclusiveMinimum&&{exclusiveMinimum:!0},...G.exclusiveMaximum&&{exclusiveMaximum:!0}}}},...Q.annotate?.(G),...W})}}function AP(Q){return(X,Y)=>{let $=Q.formatter??P;return j0((J)=>Q.remainder(J,X)===Q.zero,{expected:`a value that is a multiple of ${$(X)}`,...Q.annotate?.(X),...Y})}}function i5(Q){if(!globalThis.Number.isFinite(Q))throw new globalThis.RangeError(`Expected a finite number, got ${P(Q)}`);return Q}var CP=Z7({order:D1,annotate:(Q)=>({representation:{id:"effect/schema/isGreaterThan",payload:{exclusiveMinimum:i5(Q)}},toJsonSchema:()=>({exclusiveMinimum:Q}),toCode:()=>({runtime:`Schema.isGreaterThan(${P(Q)})`})})}),sr=a("effect/schema/isGreaterThan",m({exclusiveMinimum:o8}),({annotations:Q,payload:X})=>CP(X.exclusiveMinimum,Q)),QK=G7({order:D1,annotate:(Q)=>({representation:{id:"effect/schema/isGreaterThanOrEqualTo",payload:{minimum:i5(Q)}},toJsonSchema:()=>({minimum:Q}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${P(Q)})`})})}),tr=a("effect/schema/isGreaterThanOrEqualTo",m({minimum:o8}),({annotations:Q,payload:X})=>QK(X.minimum,Q)),jP=W7({order:D1,annotate:(Q)=>({representation:{id:"effect/schema/isLessThan",payload:{exclusiveMaximum:i5(Q)}},toJsonSchema:()=>({exclusiveMaximum:Q}),toCode:()=>({runtime:`Schema.isLessThan(${P(Q)})`})})}),er=a("effect/schema/isLessThan",m({exclusiveMaximum:o8}),({annotations:Q,payload:X})=>jP(X.exclusiveMaximum,Q)),TP=H7({order:D1,annotate:(Q)=>({representation:{id:"effect/schema/isLessThanOrEqualTo",payload:{maximum:i5(Q)}},toJsonSchema:()=>({maximum:Q}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${P(Q)})`})})}),Qi=a("effect/schema/isLessThanOrEqualTo",m({maximum:o8}),({annotations:Q,payload:X})=>TP(X.maximum,Q)),h3=K7({order:D1,annotate:(Q)=>{let X=Q.exclusiveMinimum?!0:void 0,Y=Q.exclusiveMaximum?!0:void 0;return{representation:{id:"effect/schema/isBetween",payload:{minimum:i5(Q.minimum),maximum:i5(Q.maximum),...X&&{exclusiveMinimum:X},...Y&&{exclusiveMaximum:Y}}},toJsonSchema:()=>({[X?"exclusiveMinimum":"minimum"]:Q.minimum,[Y?"exclusiveMaximum":"maximum"]:Q.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${P(Q.minimum)}, maximum: ${P(Q.maximum)}, exclusiveMinimum: ${P(X)}, exclusiveMaximum: ${P(Y)} })`})}}}),Xi=a("effect/schema/isBetween",m({minimum:o8,maximum:o8,exclusiveMinimum:P8(p0(!0)),exclusiveMaximum:P8(p0(!0))}),({annotations:Q,payload:X})=>h3(X,Q)),IP=AP({remainder:wU,zero:0,annotate:(Q)=>({expected:`a value that is a multiple of ${Q}`,representation:{id:"effect/schema/isMultipleOf",payload:{divisor:Q}},toJsonSchema:()=>({multipleOf:Q}),toCode:()=>({runtime:`Schema.isMultipleOf(${P(Q)})`})})}),Yi=a("effect/schema/isMultipleOf",m({divisor:o8}),({annotations:Q,payload:X})=>IP(X.divisor,Q));function V7(Q){return j0((X)=>globalThis.Number.isSafeInteger(X),{expected:"an integer",representation:{id:"effect/schema/isInt",payload:null},toJsonSchema:()=>({type:"integer"}),toCode:()=>({runtime:"Schema.isInt()"}),arbitrary:{constraint:{integer:!0}},...Q})}var $i=a("effect/schema/isInt",F0,({annotations:Q})=>V7(Q)),k9=b3.check(V7()),W8=k9.check(QK(0));function Ji(Q){return new N6([V7(),h3({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...Q})}function Zi(Q){return new N6([V7(),h3({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...Q})}function n5(Q){if(globalThis.Number.isNaN(Q.getTime()))throw new globalThis.RangeError(`Expected a valid Date, got ${P(Q)}`);return Q.toISOString()}function a5(Q){return`new Date(${P(Q.getTime())})`}var EP=Z7({order:t6,annotate:(Q)=>{return{representation:{id:"effect/schema/isGreaterThanDate",payload:{exclusiveMinimum:n5(Q)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanDate(${a5(Q)})`})}}}),SP=G7({order:t6,annotate:(Q)=>{return{representation:{id:"effect/schema/isGreaterThanOrEqualToDate",payload:{minimum:n5(Q)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToDate(${a5(Q)})`})}}}),vP=W7({order:t6,annotate:(Q)=>{return{representation:{id:"effect/schema/isLessThanDate",payload:{exclusiveMaximum:n5(Q)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanDate(${a5(Q)})`})}}}),xP=H7({order:t6,annotate:(Q)=>{return{representation:{id:"effect/schema/isLessThanOrEqualToDate",payload:{maximum:n5(Q)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanOrEqualToDate(${a5(Q)})`})}}}),bP=K7({order:t6,annotate:(Q)=>{let X=Q.exclusiveMinimum?!0:void 0,Y=Q.exclusiveMaximum?!0:void 0;return{representation:{id:"effect/schema/isBetweenDate",payload:{minimum:n5(Q.minimum),maximum:n5(Q.maximum),...X&&{exclusiveMinimum:X},...Y&&{exclusiveMaximum:Y}}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isBetweenDate({ minimum: ${a5(Q.minimum)}, maximum: ${a5(Q.maximum)}, exclusiveMinimum: ${P(X)}, exclusiveMaximum: ${P(Y)} })`})}}}),kP=Z7({order:_8,annotate:(Q)=>{return{representation:{id:"effect/schema/isGreaterThanBigInt",payload:{exclusiveMinimum:Q.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanBigInt(${P(Q)})`})}}}),yP=G7({order:_8,annotate:(Q)=>{return{representation:{id:"effect/schema/isGreaterThanOrEqualToBigInt",payload:{minimum:Q.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToBigInt(${P(Q)})`})}}}),gP=W7({order:_8,annotate:(Q)=>{return{representation:{id:"effect/schema/isLessThanBigInt",payload:{exclusiveMaximum:Q.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanBigInt(${P(Q)})`})}}}),hP=H7({order:_8,annotate:(Q)=>{return{representation:{id:"effect/schema/isLessThanOrEqualToBigInt",payload:{maximum:Q.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanOrEqualToBigInt(${P(Q)})`})}}}),mP=K7({order:_8,annotate:(Q)=>{let X=Q.exclusiveMinimum?!0:void 0,Y=Q.exclusiveMaximum?!0:void 0;return{representation:{id:"effect/schema/isBetweenBigInt",payload:{minimum:Q.minimum.toString(10),maximum:Q.maximum.toString(10),...X&&{exclusiveMinimum:X},...Y&&{exclusiveMaximum:Y}}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isBetweenBigInt({ minimum: ${P(Q.minimum)}, maximum: ${P(Q.maximum)}, exclusiveMinimum: ${P(X)}, exclusiveMaximum: ${P(Y)} })`})}}}),Gi=Z7({order:b4,formatter:(Q)=>W4(Q)}),Wi=G7({order:b4,formatter:(Q)=>W4(Q)}),Hi=W7({order:b4,formatter:(Q)=>W4(Q)}),Ki=H7({order:b4,formatter:(Q)=>W4(Q)}),Vi=K7({order:b4,formatter:(Q)=>W4(Q)});function XK(Q,X){return Q=Math.max(0,Math.floor(Q)),j0((Y)=>Y.length>=Q,{expected:`a value with a length of at least ${Q}`,representation:{id:"effect/schema/isMinLength",payload:{minLength:Q}},toJsonSchema:({type:Y})=>Y==="array"?{minItems:Q}:{minLength:Q},toCode:()=>({runtime:`Schema.isMinLength(${Q})`}),[f1]:!0,arbitrary:{constraint:{minLength:Q}},...X})}var _i=a("effect/schema/isMinLength",m({minLength:W8}),({annotations:Q,payload:X})=>XK(X.minLength,Q));function dP(Q){return XK(1,Q)}function pP(Q,X){return Q=Math.max(0,Math.floor(Q)),j0((Y)=>Y.length<=Q,{expected:`a value with a length of at most ${Q}`,representation:{id:"effect/schema/isMaxLength",payload:{maxLength:Q}},toJsonSchema:({type:Y})=>Y==="array"?{maxItems:Q}:{maxLength:Q},toCode:()=>({runtime:`Schema.isMaxLength(${Q})`}),[f1]:!0,arbitrary:{constraint:{maxLength:Q}},...X})}var qi=a("effect/schema/isMaxLength",m({maxLength:W8}),({annotations:Q,payload:X})=>pP(X.maxLength,Q));function YK(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),j0(($)=>$.length>=Q&&$.length<=X,{expected:Q===X?`a value with a length of ${Q}`:`a value with a length between ${Q} and ${X}`,representation:{id:"effect/schema/isLengthBetween",payload:{minimum:Q,maximum:X}},toJsonSchema:({type:$})=>$==="array"?{allOf:[{minItems:Q},{maxItems:X}]}:{allOf:[{minLength:Q},{maxLength:X}]},toCode:()=>({runtime:`Schema.isLengthBetween(${Q}, ${X})`}),[f1]:!0,arbitrary:{constraint:{minLength:Q,maxLength:X}},...Y})}var Di=a("effect/schema/isLengthBetween",m({minimum:W8,maximum:W8}),({annotations:Q,payload:X})=>YK(X.minimum,X.maximum,Q));function fP(Q,X){return Q=Math.max(0,Math.floor(Q)),j0((Y)=>Y.size>=Q,{expected:`a value with a size of at least ${Q}`,representation:{id:"effect/schema/isMinSize",payload:{minSize:Q}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isMinSize(${Q})`}),[f1]:!0,arbitrary:{constraint:{minLength:Q}},...X})}var Ui=a("effect/schema/isMinSize",m({minSize:W8}),({annotations:Q,payload:X})=>fP(X.minSize,Q));function cP(Q,X){return Q=Math.max(0,Math.floor(Q)),j0((Y)=>Y.size<=Q,{expected:`a value with a size of at most ${Q}`,representation:{id:"effect/schema/isMaxSize",payload:{maxSize:Q}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isMaxSize(${Q})`}),[f1]:!0,arbitrary:{constraint:{maxLength:Q}},...X})}var Bi=a("effect/schema/isMaxSize",m({maxSize:W8}),({annotations:Q,payload:X})=>cP(X.maxSize,Q));function uP(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),j0(($)=>$.size>=Q&&$.size<=X,{expected:Q===X?`a value with a size of ${Q}`:`a value with a size between ${Q} and ${X}`,representation:{id:"effect/schema/isSizeBetween",payload:{minimum:Q,maximum:X}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isSizeBetween(${Q}, ${X})`}),[f1]:!0,arbitrary:{constraint:{minLength:Q,maxLength:X}},...Y})}var zi=a("effect/schema/isSizeBetween",m({minimum:W8,maximum:W8}),({annotations:Q,payload:X})=>uP(X.minimum,X.maximum,Q));function lP(Q,X){return Q=Math.max(0,Math.floor(Q)),j0((Y)=>Reflect.ownKeys(Y).length>=Q,{expected:`a value with at least ${Q===1?"1 entry":`${Q} entries`}`,representation:{id:"effect/schema/isMinProperties",payload:{minProperties:Q}},toJsonSchema:()=>({minProperties:Q}),toCode:()=>({runtime:`Schema.isMinProperties(${Q})`}),[f1]:!0,arbitrary:{constraint:{minLength:Q}},...X})}var Oi=a("effect/schema/isMinProperties",m({minProperties:W8}),({annotations:Q,payload:X})=>lP(X.minProperties,Q));function oP(Q,X){return Q=Math.max(0,Math.floor(Q)),j0((Y)=>Reflect.ownKeys(Y).length<=Q,{expected:`a value with at most ${Q===1?"1 entry":`${Q} entries`}`,representation:{id:"effect/schema/isMaxProperties",payload:{maxProperties:Q}},toJsonSchema:()=>({maxProperties:Q}),toCode:()=>({runtime:`Schema.isMaxProperties(${Q})`}),[f1]:!0,arbitrary:{constraint:{maxLength:Q}},...X})}var Fi=a("effect/schema/isMaxProperties",m({maxProperties:W8}),({annotations:Q,payload:X})=>oP(X.maxProperties,Q));function rP(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),j0(($)=>Reflect.ownKeys($).length>=Q&&Reflect.ownKeys($).length<=X,{expected:Q===X?`a value with exactly ${Q===1?"1 entry":`${Q} entries`}`:`a value with between ${Q} and ${X} entries`,representation:{id:"effect/schema/isPropertiesLengthBetween",payload:{minimum:Q,maximum:X}},toJsonSchema:()=>({minProperties:Q,maxProperties:X}),toCode:()=>({runtime:`Schema.isPropertiesLengthBetween(${Q}, ${X})`}),[f1]:!0,arbitrary:{constraint:{minLength:Q,maxLength:X}},...Y})}var Ri=a("effect/schema/isPropertiesLengthBetween",m({minimum:W8,maximum:W8}),({annotations:Q,payload:X})=>rP(X.minimum,X.maximum,Q));function iP(Q,X){let Y=s5(Q),$=_F(Y.ast);return j0((J,Z,G)=>{let W=Reflect.ownKeys(J),H=[];for(let K of W){let V=$(K,G);if(V!==void 0){if(H.push(new S0([K],V)),G.errors==="first")break}}if(e8(H))return new N0(Z,R(J),H);return!0},{expected:"an object with property names matching the schema",representation:{id:"effect/schema/isPropertyNames",payload:null,schemas:[Y.ast]},toJsonSchema:({schemas:J})=>({propertyNames:J[0]}),toCode:({schemas:J})=>({runtime:`Schema.isPropertyNames(${J[0].runtime})`}),[f1]:!0,...X})}var Ni=a("effect/schema/isPropertyNames",F0,({annotations:Q,schemas:X})=>iP(X[0],Q));function $K(Q){return j0((X)=>l7(X).length===X.length,{expected:"an array with unique items",representation:{id:"effect/schema/isUnique",payload:null},toJsonSchema:()=>({uniqueItems:!0}),toCode:()=>({runtime:"Schema.isUnique()"}),arbitrary:{constraint:{unique:!0}},...Q})}var Li=a("effect/schema/isUnique",F0,({annotations:Q})=>$K(Q)),Mi=n.check(dP()),wi=n.check(YK(1,1));function g6(Q){let X=H8()([Q],([Y])=>($,J,Z)=>{if(y7($)){if(I0($))return v8;return K1(i0(Y)($.value,Z),{onSuccess:R,onFailure:(G)=>new N0(J,R($),[new S0(["value"],G)])})}return p(new u0(J,R($)))},{representation:{id:"effect/schema/Option",payload:null},toCode:({typeParameters:Y})=>({runtime:`Schema.Option(${Y[0].runtime})`,Type:`Option.Option<${Y[0].Type}>`,importDeclarations:['import * as Option from "effect/Option"']}),expected:"Option",toCodec:([Y])=>v0()(Q1([m({_tag:p0("Some"),value:Y}),m({_tag:p0("None")})]),h0({decode:($)=>$._tag==="None"?d():R($.value),encode:($)=>L1($)?{_tag:"Some",value:$.value}:{_tag:"None"}})),toArbitrary:([Y])=>($,J)=>{let Z=$.constant(d()),G=$.oneof(Z,Y.arbitrary.map(R));return t5($,J,Z,G)},toEquivalence:([Y])=>BV(Y),toFormatter:([Y])=>T8({onNone:()=>"none()",onSome:($)=>`some(${Y($)})`})});return E(X.ast,{value:Q})}var Pi=l1("effect/schema/Option",F0,({annotations:Q,typeParameters:X})=>{let Y=g6(X[0]);return Q===void 0?Y:Y.annotate(Q)});function Ai(Q){return rH(Q).pipe(l(g6(k1(Q)),tz()))}function Ci(Q){return y3(Q).pipe(l(g6(k1(Q)),ez()))}function ji(Q,X){return XP(Q).pipe(l(g6(k1(Q)),QO(X)))}function Ti(Q){return k6(Q).pipe(l(g6(k1(Q)),XO()))}function Ii(Q){return P8(Q).pipe(l(g6(k1(Q)),YO()))}function Ei(Q,X){let Y=X===void 0?"omit":X.onNoneEncoding,$=Y===null?null:void 0;return P8(rH(Q)).pipe(l(g6(k1(Q)),F2({decode:(J)=>J.pipe(n9(R7),R),encode:Y==="omit"?i9:(J)=>R(g7(i9(J),()=>$))})))}function nP(Q,X){let Y=H8()([Q,X],([$,J])=>(Z,G,W)=>{if(!PV(Z))return p(new u0(G,R(Z)));switch(Z._tag){case"Success":return K1(QW($)(Z.success,W),{onSuccess:t,onFailure:(H)=>new N0(G,R(Z),[new S0(["success"],H)])});case"Failure":return K1(QW(J)(Z.failure,W),{onSuccess:i,onFailure:(H)=>new N0(G,R(Z),[new S0(["failure"],H)])})}},{representation:{id:"effect/schema/Result",payload:null},toCode:({typeParameters:$})=>({runtime:`Schema.Result(${$[0].runtime}, ${$[1].runtime})`,Type:`Result.Result<${$[0].Type}, ${$[1].Type}>`,importDeclarations:['import * as Result from "effect/Result"']}),expected:"Result",toCodec:([$,J])=>v0()(Q1([m({_tag:p0("Success"),success:$}),m({_tag:p0("Failure"),failure:J})]),h0({decode:(Z)=>Z._tag==="Success"?t(Z.success):i(Z.failure),encode:(Z)=>E1(Z)?{_tag:"Success",success:Z.success}:{_tag:"Failure",failure:Z.failure}})),toArbitrary:([$,J])=>(Z,G)=>{let W=GA(Z,$.terminal?.map((K)=>t(K)),J.terminal?.map((K)=>i(K))),H=Z.oneof($.arbitrary.map((K)=>t(K)),J.arbitrary.map((K)=>i(K)));return t5(Z,G,W,H)},toEquivalence:([$,J])=>AV($,J),toFormatter:([$,J])=>B8({onSuccess:(Z)=>`success(${$(Z)})`,onFailure:(Z)=>`failure(${J(Z)})`})});return E(Y.ast,{success:Q,failure:X})}var Si=l1("effect/schema/Result",F0,({annotations:Q,typeParameters:X})=>{let Y=nP(X[0],X[1]);return Q===void 0?Y:Y.annotate(Q)}),vi=A8((Q)=>{if(!j1(Q))return!1;let X=globalThis.Object.keys(Q);return X.length>0&&X.every((Y)=>{switch(Y){case"label":return typeof Q[Y]==="string";case"disallowJsonEncode":return Q[Y]===!0;default:return!1}})}),xi=Q1([F0,vi]);function JK(Q,X){let Y=typeof X?.label==="string"?X.label:void 0,$=X?.disallowJsonEncode===!0,J=Y!==void 0?$?{label:Y,disallowJsonEncode:!0}:{label:Y}:$?{disallowJsonEncode:!0}:void 0,Z=Y!==void 0?i0(p0(Y)):void 0,G=H8()([Q],([W])=>(H,K,V)=>{if(WG(H)){let _=Z!==void 0?R5(Z(H.label,V),(q)=>new S0(["label"],q)):D6;return F8(_,()=>K1(i0(W)(M5(H),V),{onSuccess:()=>H,onFailure:()=>{let q=R(H);return new N0(K,q,[new S0(["value"],new q0(q))])}}))}return p(new u0(K,R(H)))},{representation:{id:"effect/schema/Redacted",payload:J??null},toCode:({typeParameters:W})=>({runtime:J!==void 0?`Schema.Redacted(${W[0].runtime}, ${P(J)})`:`Schema.Redacted(${W[0].runtime})`,Type:`Redacted.Redacted<${W[0].Type}>`,importDeclarations:['import * as Redacted from "effect/Redacted"']}),expected:"Redacted",toCodecJson:([W])=>v0()(ZK(W),{decode:Y0((H)=>K4(H,{label:Y})),encode:$?DG((H)=>"Cannot serialize Redacted"+(L1(H)&&typeof H.value.label==="string"?` with label: "${H.value.label}"`:"")):Y0(M5)}),toArbitrary:([W])=>()=>({arbitrary:W.arbitrary.map((H)=>K4(H,{label:Y})),terminal:W.terminal?.map((H)=>K4(H,{label:Y}))}),toFormatter:()=>globalThis.String,toEquivalence:([W])=>qz(W)});return E(G.ast,{value:Q})}var bi=l1("effect/schema/Redacted",xi,({annotations:Q,payload:X,typeParameters:Y})=>{let $=JK(Y[0],X??void 0);return Q===void 0?$:$.annotate(Q)});function ZK(Q){return iH(R5(H2))(Q)}function ki(Q,X){return ZK(Q).pipe(l(JK(k1(Q),{label:X?.label,disallowJsonEncode:X?.disallowEncode}),{decode:Y0((Y)=>K4(Y,{label:X?.label})),encode:X?.disallowEncode?DG((Y)=>"Cannot encode Redacted"+(L1(Y)&&typeof Y.value.label==="string"?` with label: "${Y.value.label}"`:"")):Y0(M5)}))}function T3(Q,X){let Y=H8()([Q,X],([$,J])=>(Z,G,W)=>{if(!oJ(Z))return p(new u0(G,R(Z)));switch(Z._tag){case"Fail":return K1(i0($)(Z.error,W),{onSuccess:cQ,onFailure:(H)=>new N0(G,R(Z),[new S0(["error"],H)])});case"Die":return K1(i0(J)(Z.defect,W),{onSuccess:uQ,onFailure:(H)=>new N0(G,R(Z),[new S0(["defect"],H)])});case"Interrupt":return f(Z)}},{representation:{id:"effect/schema/CauseReason",payload:null},toCode:({typeParameters:$})=>({runtime:`Schema.CauseReason(${$[0].runtime}, ${$[1].runtime})`,Type:`Cause.Failure<${$[0].Type}, ${$[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause.Failure",toCodec:([$,J])=>v0()(Q1([m({_tag:p0("Fail"),error:$}),m({_tag:p0("Die"),defect:J}),m({_tag:p0("Interrupt"),fiberId:y3(o8)})]),h0({decode:(Z)=>{switch(Z._tag){case"Fail":return cQ(Z.error);case"Die":return uQ(Z.defect);case"Interrupt":return lQ(Z.fiberId)}},encode:u})),toArbitrary:([$,J])=>aP($,J),toEquivalence:([$,J])=>sP($,J),toFormatter:([$,J])=>tP($,J)});return E(Y.ast,{error:Q,defect:X})}var yi=l1("effect/schema/CauseReason",F0,({annotations:Q,typeParameters:X})=>{let Y=T3(X[0],X[1]);return Q===void 0?Y:Y.annotate(Q)});function aP(Q,X){return(Y,$)=>{let J=Y.constant(lQ()),Z=Y.oneof(J,Y.integer({min:1}).map(lQ),Q.arbitrary.map((G)=>cQ(G)),X.arbitrary.map((G)=>uQ(G)));return t5(Y,$,J,Z)}}function sP(Q,X){return(Y,$)=>{if(Y._tag!==$._tag)return!1;switch(Y._tag){case"Fail":return Q(Y.error,$.error);case"Die":return X(Y.defect,$.defect);case"Interrupt":return Y.fiberId===$.fiberId}}}function tP(Q,X){return(Y)=>{switch(Y._tag){case"Fail":return`Fail(${Q(Y.error)})`;case"Die":return`Die(${X(Y.defect)})`;case"Interrupt":return"Interrupt"}}}function I3(Q,X){let Y=H8()([Q,X],([$,J])=>{let Z=e0(T3($,J));return(G,W,H)=>{if(!lJ(G))return p(new u0(W,R(G)));return K1(i0(Z)(G.reasons,H),{onSuccess:fQ,onFailure:(K)=>new N0(W,R(G),[new S0(["failures"],K)])})}},{representation:{id:"effect/schema/Cause",payload:null},toCode:({typeParameters:$})=>({runtime:`Schema.Cause(${$[0].runtime}, ${$[1].runtime})`,Type:`Cause.Cause<${$[0].Type}, ${$[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause",toCodec:([$,J])=>v0()(e0(T3($,J)),h0({decode:fQ,encode:({reasons:Z})=>Z})),toArbitrary:([$,J])=>eP($,J),toEquivalence:([$,J])=>QA($,J),toFormatter:([$,J])=>XA($,J)});return E(Y.ast,{error:Q,defect:X})}var gi=l1("effect/schema/Cause",F0,({annotations:Q,typeParameters:X})=>{let Y=I3(X[0],X[1]);return Q===void 0?Y:Y.annotate(Q)});function eP(Q,X){return(Y,$)=>{let J=aP(Q,X)(Y,$),Z=Y.constant(rJ),G=Y.array(J.arbitrary).map(fQ);return t5(Y,$,Z,G)}}function QA(Q,X){let Y=QV(sP(Q,X));return($,J)=>Y($.reasons,J.reasons)}function XA(Q,X){let Y=tP(Q,X);return($)=>`Cause([${$.reasons.map(Y).join(", ")}])`}var hi=A8((Q)=>{if(!j1(Q))return!1;let X=globalThis.Object.keys(Q);return X.length>0&&X.every((Y)=>(Y==="includeStack"||Y==="excludeCause")&&Q[Y]===!0)}),mi=Q1([F0,hi]),YA=(Q)=>(Q?.includeStack===!0?1:0)|(Q?.excludeCause===!0?2:0),$A=(Q)=>{switch(Q){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},Ew=[];function JA(Q){let X=YA(Q),Y=Ew[X];if(Y!==void 0)return Y;let $=$A(X),J=y6(globalThis.Error,{representation:{id:"effect/schema/Error",payload:$??null},toCode:()=>({runtime:$!==void 0?`Schema.Error(${P($)})`:"Schema.Error()",Type:"globalThis.Error"}),expected:"Error",toCodecJson:()=>v0()(Sa,az($)),toArbitrary:()=>(Z)=>Z.string().map((G)=>new globalThis.Error(G))});return Ew[X]=J,J}var di=l1("effect/schema/Error",mi,({annotations:Q,payload:X})=>{let Y=JA(X??void 0);return Q===void 0?Y:Y.annotate(Q)}),Sw=[];function pi(Q){let X=YA(Q),Y=Sw[X];if(Y!==void 0)return Y;let $=p3.pipe(l(uH,sz($A(X))));return Sw[X]=$,$}function ZA(Q,X,Y){let $=H8()([Q,X,Y],([J,Z,G])=>{let W=I3(Z,G);return(H,K,V)=>{if(!nJ(H))return p(new u0(K,R(H)));switch(H._tag){case"Success":return K1(i0(J)(H.value,V),{onSuccess:V9,onFailure:(_)=>new N0(K,R(H),[new S0(["value"],_)])});case"Failure":return K1(i0(W)(H.cause,V),{onSuccess:v4,onFailure:(_)=>new N0(K,R(H),[new S0(["cause"],_)])})}}},{representation:{id:"effect/schema/Exit",payload:null},toCode:({typeParameters:J})=>({runtime:`Schema.Exit(${J[0].runtime}, ${J[1].runtime}, ${J[2].runtime})`,Type:`Exit.Exit<${J[0].Type}, ${J[1].Type}, ${J[2].Type}>`,importDeclarations:['import * as Exit from "effect/Exit"']}),expected:"Exit",toCodec:([J,Z,G])=>v0()(Q1([m({_tag:p0("Success"),value:J}),m({_tag:p0("Failure"),cause:I3(Z,G)})]),h0({decode:(W)=>W._tag==="Success"?V9(W.value):v4(W.cause),encode:(W)=>Y1(W)?{_tag:"Success",value:W.value}:{_tag:"Failure",cause:W.cause}})),toArbitrary:([J,Z,G])=>(W,H)=>{let K=eP(Z,G)(W,H),V=GA(W,J.terminal?.map((q)=>V9(q)),K.terminal?.map((q)=>v4(q))),_=W.oneof(J.arbitrary.map((q)=>V9(q)),K.arbitrary.map((q)=>v4(q)));return t5(W,H,V,_)},toEquivalence:([J,Z,G])=>{let W=QA(Z,G);return(H,K)=>{if(H._tag!==K._tag)return!1;switch(H._tag){case"Success":return J(H.value,K.value);case"Failure":return W(H.cause,K.cause)}}},toFormatter:([J,Z,G])=>{let W=XA(Z,G);return(H)=>{switch(H._tag){case"Success":return`Exit.Success(${J(H.value)})`;case"Failure":return`Exit.Failure(${W(H.cause)})`}}}});return E($.ast,{value:Q,error:X,defect:Y})}var fi=l1("effect/schema/Exit",F0,({annotations:Q,typeParameters:X})=>{let Y=ZA(X[0],X[1],X[2]);return Q===void 0?Y:Y.annotate(Q)});function GA(Q,X,Y){return X===void 0?Y:Y===void 0?X:Q.oneof(X,Y)}function t5(Q,X,Y,$){return{arbitrary:Y===void 0||X.recursion===void 0?$:Q.oneof(X.recursion,Y,$),terminal:Y}}function vw(Q,X,Y,$){return $===void 0?Q.array(X,Y):Q.uniqueArray(X,{...Y,comparator:$})}function m3(Q,X,Y,$,J,Z){let G=X.constraint,W=G===void 0||G.minLength===void 0&&G.maxLength===void 0?void 0:{...G.minLength!==void 0?{minLength:G.minLength}:{},...G.maxLength!==void 0?{maxLength:G.maxLength}:{}};if(W?.minLength!==void 0&&W.maxLength!==void 0&&W.minLength>W.maxLength)throw new globalThis.Error("Unable to derive an arbitrary for size constraints");let H=W?.minLength??0,K=H===0?Q.constant([]):$===void 0?void 0:vw(Q,$,{...W,maxLength:H},Z),V=t5(Q,X,K,vw(Q,Y,W,Z));return{arbitrary:V.arbitrary.map(J),terminal:V.terminal?.map(J)}}function WA(Q,X,Y,$,J){return m3(Q,X,Q.tuple(Y.arbitrary,$.arbitrary),Y.terminal===void 0||$.terminal===void 0?void 0:Q.tuple(Y.terminal,$.terminal),J,([Z],[G])=>o(Z,G))}function HA(Q,X){let Y=H8()([Q,X],([$,J])=>{let Z=e0(r5([$,J]));return(G,W,H)=>{if(G instanceof globalThis.Map)return K1(i0(Z)([...G],H),{onSuccess:(K)=>new globalThis.Map(K),onFailure:(K)=>new N0(W,R(G),[new S0(["entries"],K)])});return p(new u0(W,R(G)))}},{representation:{id:"effect/schema/ReadonlyMap",payload:null},toCode:({typeParameters:$})=>({runtime:`Schema.ReadonlyMap(${$[0].runtime}, ${$[1].runtime})`,Type:`globalThis.ReadonlyMap<${$[0].Type}, ${$[1].Type}>`}),expected:"ReadonlyMap",toCodec:([$,J])=>v0()(e0(r5([$,J])),h0({decode:(Z)=>new globalThis.Map(Z),encode:(Z)=>[...Z.entries()]})),toArbitrary:([$,J])=>(Z,G)=>WA(Z,G,$,J,(W)=>new globalThis.Map(W)),toEquivalence:([$,J])=>w7($,J),toFormatter:([$,J])=>(Z)=>{let G=Z.size;if(G===0)return"ReadonlyMap(0) {}";let W=globalThis.Array.from(Z.entries()).sort().map(([H,K])=>`${$(H)} => ${J(K)}`);return`ReadonlyMap(${G}) { ${W.join(", ")} }`}});return E(Y.ast,{key:Q,value:X})}var ci=l1("effect/schema/ReadonlyMap",F0,({annotations:Q,typeParameters:X})=>{let Y=HA(X[0],X[1]);return Q===void 0?Y:Y.annotate(Q)});function KA(Q,X){let Y=H8()([Q,X],([$,J])=>{let Z=e0(r5([$,J]));return(G,W,H)=>{if(Qz(G))return K1(i0(Z)($2(G),H),{onSuccess:Y2,onFailure:(K)=>new N0(W,R(G),[new S0(["entries"],K)])});return p(new u0(W,R(G)))}},{representation:{id:"effect/schema/HashMap",payload:null},toCode:({typeParameters:$})=>({runtime:`Schema.HashMap(${$[0].runtime}, ${$[1].runtime})`,Type:`HashMap.HashMap<${$[0].Type}, ${$[1].Type}>`,importDeclarations:['import * as HashMap from "effect/HashMap"']}),expected:"HashMap",toCodec:([$,J])=>v0()(e0(r5([$,J])),h0({decode:Y2,encode:$2})),toArbitrary:([$,J])=>(Z,G)=>WA(Z,G,$,J,Y2),toEquivalence:([$,J])=>w7($,J),toFormatter:([$,J])=>(Z)=>{let G=Xz(Z);if(G===0)return"HashMap(0) {}";let W=$2(Z).sort().map(([H,K])=>`${$(H)} => ${J(K)}`);return`HashMap(${G}) { ${W.join(", ")} }`}});return E(Y.ast,{key:Q,value:X})}var ui=l1("effect/schema/HashMap",F0,({annotations:Q,typeParameters:X})=>{let Y=KA(X[0],X[1]);return Q===void 0?Y:Y.annotate(Q)});function VA(Q){let X=H8()([Q],([Y])=>{let $=e0(Y);return(J,Z,G)=>{if(J instanceof globalThis.Set)return K1(i0($)([...J],G),{onSuccess:(W)=>new globalThis.Set(W),onFailure:(W)=>new N0(Z,R(J),[new S0(["values"],W)])});return p(new u0(Z,R(J)))}},{representation:{id:"effect/schema/ReadonlySet",payload:null},toCode:({typeParameters:Y})=>({runtime:`Schema.ReadonlySet(${Y[0].runtime})`,Type:`globalThis.ReadonlySet<${Y[0].Type}>`}),expected:"ReadonlySet",toCodec:([Y])=>v0()(e0(Y),h0({decode:($)=>new globalThis.Set($),encode:($)=>[...$.values()]})),toArbitrary:([Y])=>($,J)=>m3($,J,Y.arbitrary,Y.terminal,(Z)=>new globalThis.Set(Z),o),toEquivalence:([Y])=>P7(Y),toFormatter:([Y])=>($)=>{let J=$.size;if(J===0)return"ReadonlySet(0) {}";let Z=globalThis.Array.from($.values()).sort().map((G)=>`${Y(G)}`);return`ReadonlySet(${J}) { ${Z.join(", ")} }`}});return E(X.ast,{value:Q})}var li=l1("effect/schema/ReadonlySet",F0,({annotations:Q,typeParameters:X})=>{let Y=VA(X[0]);return Q===void 0?Y:Y.annotate(Q)});function _A(Q){let X=H8()([Q],([Y])=>{let $=e0(Y);return(J,Z,G)=>{if(Zz(J))return K1(i0($)(M1(J),G),{onSuccess:Z2,onFailure:(W)=>new N0(Z,R(J),[new S0(["values"],W)])});return p(new u0(Z,R(J)))}},{representation:{id:"effect/schema/HashSet",payload:null},toCode:({typeParameters:Y})=>({runtime:`Schema.HashSet(${Y[0].runtime})`,Type:`HashSet.HashSet<${Y[0].Type}>`}),expected:"HashSet",toCodec:([Y])=>v0()(e0(Y),h0({decode:Z2,encode:M1})),toArbitrary:([Y])=>($,J)=>m3($,J,Y.arbitrary,Y.terminal,Z2,o),toEquivalence:([Y])=>P7(Y),toFormatter:([Y])=>($)=>{let J=Gz($);if(J===0)return"HashSet(0) {}";let Z=globalThis.Array.from($).sort().map((G)=>`${Y(G)}`);return`HashSet(${J}) { ${Z.join(", ")} }`}});return E(X.ast,{value:Q})}var oi=l1("effect/schema/HashSet",F0,({annotations:Q,typeParameters:X})=>{let Y=_A(X[0]);return Q===void 0?Y:Y.annotate(Q)});function qA(Q){let X=H8()([Q],([Y])=>{let $=e0(Y);return(J,Z,G)=>{if(uY(J))return K1(i0($)(M1(J),G),{onSuccess:lY,onFailure:(W)=>new N0(Z,R(J),[new S0(["values"],W)])});return p(new u0(Z,R(J)))}},{representation:{id:"effect/schema/Chunk",payload:null},toCode:({typeParameters:Y})=>({runtime:`Schema.Chunk(${Y[0].runtime})`,Type:`Chunk.Chunk<${Y[0].Type}>`}),expected:"Chunk",toCodec:([Y])=>v0()(e0(Y),h0({decode:lY,encode:M1})),toArbitrary:([Y])=>($,J)=>m3($,J,Y.arbitrary,Y.terminal,lY),toEquivalence:([Y])=>pZ(Y),toFormatter:([Y])=>($)=>{let J=LB($);if(J===0)return"Chunk(0) {}";let Z=globalThis.Array.from($).sort().map((G)=>`${Y(G)}`);return`Chunk(${J}) { ${Z.join(", ")} }`}});return E(X.ast,{value:Q})}var ri=l1("effect/schema/Chunk",F0,({annotations:Q,typeParameters:X})=>{let Y=qA(X[0]);return Q===void 0?Y:Y.annotate(Q)}),DA=y6(globalThis.RegExp,{representation:{id:"effect/schema/RegExp",payload:null},toCode:()=>({runtime:"Schema.RegExp",Type:"globalThis.RegExp"}),expected:"RegExp",toCodecJson:()=>v0()(m({source:n,flags:n}),N8({decode:(Q)=>O5({try:()=>new globalThis.RegExp(Q.source,Q.flags),catch:(X)=>new q0(R(X),{message:globalThis.String(X)})}),encode:(Q)=>f({source:Q.source,flags:Q.flags})})),toArbitrary:()=>(Q)=>Q.tuple(Q.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),Q.uniqueArray(Q.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((X)=>X.join(""))).map(([X,Y])=>new globalThis.RegExp(X,Y)),toEquivalence:()=>(Q,X)=>Q.source===X.source&&Q.flags===X.flags}),ii=A1("effect/schema/RegExp",DA),UA=n.annotate({expected:"a string that will be decoded as a URL"}),GK=y6(globalThis.URL,{representation:{id:"effect/schema/URL",payload:null},toCode:()=>({runtime:"Schema.URL",Type:"globalThis.URL"}),expected:"URL",toCodecJson:()=>v0()(UA,LG),toArbitrary:()=>(Q)=>Q.webUrl().map((X)=>new globalThis.URL(X)),toEquivalence:()=>(Q,X)=>Q.toString()===X.toString()}),ni=A1("effect/schema/URL",GK),ai=UA.pipe(l(GK,LG));function WK(Q,X,Y){let $={...X};if(Q?.minimum!==void 0){let J=Y===void 0?Q.minimum:Y(Q.minimum),Z=Q.exclusiveMinimum?new globalThis.Date(J.getTime()+1):J;if($.min===void 0||Z.getTime()>$.min.getTime())$.min=Z}if(Q?.maximum!==void 0){let J=Y===void 0?Q.maximum:Y(Q.maximum),Z=Q.exclusiveMaximum?new globalThis.Date(J.getTime()-1):J;if($.max===void 0||Z.getTime()<$.max.getTime())$.max=Z}return $}var BA=n.annotate({expected:"a string that will be decoded as a Date"}),r8=A8((Q)=>Q instanceof globalThis.Date&&!globalThis.Number.isNaN(Q.getTime()),{representation:{id:"effect/schema/Date",payload:null},toCode:()=>({runtime:"Schema.Date",Type:"globalThis.Date"}),expected:"a valid Date",toCodecJson:()=>v0()(BA,NG),toArbitrary:()=>(Q,X)=>Q.date(WK(X?.constraint?.ordered?.order===t6?X.constraint.ordered:void 0,{noInvalidDate:!0}))}),si=A1("effect/schema/Date",r8),ti=BA.pipe(l(r8,NG)),ei=k9.pipe(l(r8,cz)),_7=A8(I$,{representation:{id:"effect/schema/Duration",payload:null},toCode:()=>({runtime:"Schema.Duration",Type:"Duration.Duration",importDeclarations:['import * as Duration from "effect/Duration"']}),expected:"Duration",toCodecJson:()=>v0()(Q1([m({_tag:p0("Infinity")}),m({_tag:p0("NegativeInfinity")}),m({_tag:p0("Nanos"),value:U4}),m({_tag:p0("Millis"),value:k9})]),h0({decode:(Q)=>{switch(Q._tag){case"Infinity":return P4;case"NegativeInfinity":return Y9;case"Nanos":return Y4(Q.value);case"Millis":return G6(Q.value)}},encode:(Q)=>{switch(Q.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:Q.value.nanos};case"Millis":return{_tag:"Millis",value:Q.value.millis}}}})),toArbitrary:()=>(Q)=>Q.oneof(Q.constant(P4),Q.constant(Y9),Q.bigInt().map(Y4),Q.maxSafeInteger().map(G6)),toFormatter:()=>globalThis.String,toEquivalence:()=>E$}),Qn=A1("effect/schema/Duration",_7),Xn=n.annotate({expected:"a string that will be decoded as a Duration"}),Yn=Xn.pipe(l(_7,uz)),$n=U4.pipe(l(_7,lz)),Jn=b3.pipe(l(_7,oz)),zA=n.annotate({expected:"a string that will be decoded as a BigDecimal"}),OA=20,FA="Unable to derive an arbitrary for the ordered BigDecimal constraints";function E3(Q,X){return B6(Q,X).value}function Zn(Q,X,Y){return Y?E3(mZ(Q,X),X)+globalThis.BigInt(1):E3(hZ(Q,X),X)}function Gn(Q,X,Y){return Y?E3(hZ(Q,X),X)-globalThis.BigInt(1):E3(mZ(Q,X),X)}function Wn(Q){return Math.max(OA,Q.minimum?.scale??0,Q.maximum?.scale??0,Q.exclusiveMinimum&&Q.minimum!==void 0?Q.minimum.scale+1:0,Q.exclusiveMaximum&&Q.maximum!==void 0?Q.maximum.scale+1:0)}function fH(Q,X){let Y={};if(Q.minimum!==void 0)Y.min=Zn(Q.minimum,X,Q.exclusiveMinimum===!0);if(Q.maximum!==void 0)Y.max=Gn(Q.maximum,X,Q.exclusiveMaximum===!0);if(Y.min!==void 0&&Y.max!==void 0&&Y.min>Y.max)return;return Y}function Hn(Q){let X=Wn(Q);if(fH(Q,X)===void 0)throw new globalThis.Error(FA);let Y=0,$=X;while(Y<$){let J=Y+Math.floor(($-Y)/2);if(fH(Q,J)===void 0)Y=J+1;else $=J}return{min:Y,max:X}}var HK=A8(cY,{representation:{id:"effect/schema/BigDecimal",payload:null},toCode:()=>({runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclarations:['import * as BigDecimal from "effect/BigDecimal"']}),expected:"BigDecimal",toCodecJson:()=>v0()(zA,MG),toArbitrary:()=>(Q,X)=>{let Y=X.constraint?.ordered?.order===b4?X.constraint.ordered:void 0;if(Y===void 0)return Q.tuple(Q.bigInt(),Q.integer({min:0,max:OA})).map(([$,J])=>p1($,J));return Q.integer(Hn(Y)).chain(($)=>{let J=fH(Y,$);if(J===void 0)throw new globalThis.Error(FA);return Q.bigInt(J).map((Z)=>p1(Z,$))})},toFormatter:()=>(Q)=>W4(Q),toEquivalence:()=>yZ}),Kn=A1("effect/schema/BigDecimal",HK),Vn=zA.pipe(l(HK,MG)),_n=n.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json"}),qn=RA(uH);function RA(Q){return _n.pipe(l(Q,WO))}var KK=y6(globalThis.File,{representation:{id:"effect/schema/File",payload:null},toCode:()=>({runtime:"Schema.File",Type:"globalThis.File"}),expected:"File",toCodecJson:()=>v0()(m({data:n.check(eH()),type:n,name:n,lastModified:k9}),N8({decode:(Q)=>B8(N5(Q.data),{onFailure:(X)=>p(new q0(R(Q.data),{message:X.message})),onSuccess:(X)=>{let Y=new globalThis.Uint8Array(X);return f(new globalThis.File([Y],Q.name,{type:Q.type,lastModified:Q.lastModified}))}}),encode:(Q)=>jZ({try:async()=>{let X=new globalThis.Uint8Array(await Q.arrayBuffer());return{data:sY(X),type:Q.type,name:Q.name,lastModified:Q.lastModified}},catch:(X)=>new q0(R(Q),{message:globalThis.String(X)})})}))}),Dn=A1("effect/schema/File",KK),VK=y6(globalThis.FormData,{representation:{id:"effect/schema/FormData",payload:null},toCode:()=>({runtime:"Schema.FormData",Type:"globalThis.FormData"}),expected:"FormData",toCodecJson:()=>v0()(e0(r5([n,Q1([m({_tag:x9("String"),value:n}),m({_tag:x9("File"),value:KK})])])),N8({decode:(Q)=>{let X=new globalThis.FormData;for(let[Y,$]of Q)X.append(Y,$.value);return f(X)},encode:(Q)=>{return f(globalThis.Array.from(Q.entries()).map(([X,Y])=>{if(typeof Y==="string")return[X,{_tag:"String",value:Y}];else return[X,{_tag:"File",value:Y}]}))}}))}),Un=A1("effect/schema/FormData",VK);function Bn(Q){return VK.pipe(l(Q,HO))}var _K=y6(globalThis.URLSearchParams,{representation:{id:"effect/schema/URLSearchParams",payload:null},toCode:()=>({runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"}),expected:"URLSearchParams",toCodecJson:()=>v0()(n.annotate({expected:"a query string that will be decoded as URLSearchParams"}),h0({decode:(Q)=>new globalThis.URLSearchParams(Q),encode:(Q)=>Q.toString()}))}),zn=A1("effect/schema/URLSearchParams",_K);function On(Q){return _K.pipe(l(Q,KO))}var Fn=n.annotate({expected:"a string that will be decoded as a number"}).pipe(l(b3,C5)),Rn=n.annotate({expected:"a string that will be decoded as a finite number"}).pipe(l(o8,C5)),Nn=E(nG).pipe(l(U4,R2)),NA=n.check(tH()),Ln=n.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(l(NA,fz())),Mn=n.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(l(n,$O)),wn=n.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(l(n,JO)),Pn=n.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(l(n,ZO)),An=n.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(l(n,GO)),cH=Q1([o8,sw,n]),Cn=m({issues:e0(m({message:n,path:P8(e0(Q1([cH,m({key:cH})])))}))}),jn=k3([0,1]).pipe(l(aw,h0({decode:(Q)=>Q===1,encode:(Q)=>Q?1:0}))),LA=n.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),q7=y6(globalThis.Uint8Array,{representation:{id:"effect/schema/Uint8Array",payload:null},toCode:()=>({runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"}),expected:"Uint8Array",toCodecJson:()=>v0()(LA,wG),toArbitrary:()=>(Q)=>Q.uint8Array()}),Tn=A1("effect/schema/Uint8Array",q7),In=LA.pipe(l(q7,wG)),En=n.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(l(q7,{decode:Ez(),encode:B2()})),Sn=n.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(l(q7,{decode:vz(),encode:z2()})),D7=A8((Q)=>cZ(Q)&&AB(Q),{representation:{id:"effect/schema/DateTimeUtc",payload:null},toCode:()=>({runtime:"Schema.DateTimeUtc",Type:"DateTime.Utc",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.Utc",toCodecJson:()=>v0()(n,CG),toArbitrary:()=>(Q,X)=>Q.date(WK(X?.constraint?.ordered?.order===lZ?X.constraint.ordered:void 0,{noInvalidDate:!0},iY)).map((Y)=>jB(Y)),toFormatter:()=>(Q)=>Q.toString(),toEquivalence:()=>uZ}),vn=A1("effect/schema/DateTimeUtc",D7),xn=r8.pipe(l(D7,{decode:FG(),encode:Y0(iY)})),bn=n.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(l(D7,CG)),kn=k9.pipe(l(D7,{decode:FG(),encode:Y0(vB)})),MA=A8(wB,{representation:{id:"effect/schema/TimeZoneOffset",payload:null},toCode:()=>({runtime:"Schema.TimeZoneOffset",Type:"DateTime.TimeZone.Offset",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.TimeZone.Offset",toCodecJson:()=>v0()(k9,VO),toArbitrary:()=>(Q)=>Q.integer({min:-43200000,max:50400000}).map((X)=>KX(X)),toFormatter:()=>(Q)=>z6(Q),toEquivalence:()=>(Q,X)=>Q.offset===X.offset}),yn=A1("effect/schema/TimeZoneOffset",MA),wA=n.annotate({expected:"an IANA time zone identifier"}),qK=A8(PB,{representation:{id:"effect/schema/TimeZoneNamed",payload:null},toCode:()=>({runtime:"Schema.TimeZoneNamed",Type:"DateTime.TimeZone.Named",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.TimeZone.Named",toCodecJson:()=>v0()(wA,PG),toArbitrary:()=>(Q)=>Q.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(oZ)),toFormatter:()=>(Q)=>z6(Q),toEquivalence:()=>(Q,X)=>Q.id===X.id}),gn=A1("effect/schema/TimeZoneNamed",qK),hn=wA.pipe(l(qK,PG)),PA=n.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),DK=A8(MB,{representation:{id:"effect/schema/TimeZone",payload:null},toCode:()=>({runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.TimeZone",toCodecJson:()=>v0()(PA,AG),toArbitrary:()=>(Q)=>Q.oneof(Q.integer({min:-43200000,max:50400000}).map((X)=>KX(X)),Q.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(oZ))),toFormatter:()=>(Q)=>z6(Q),toEquivalence:()=>(Q,X)=>z6(Q)===z6(X)}),mn=A1("effect/schema/TimeZone",DK),dn=PA.pipe(l(DK,AG)),AA=n.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),UK=A8((Q)=>cZ(Q)&&CB(Q),{representation:{id:"effect/schema/DateTimeZoned",payload:null},toCode:()=>({runtime:"Schema.DateTimeZoned",Type:"DateTime.Zoned",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.Zoned",toCodecJson:()=>v0()(AA,jG),toArbitrary:()=>(Q,X)=>Q.tuple(Q.date(WK(X?.constraint?.ordered?.order===lZ?X.constraint.ordered:void 0,{max:new globalThis.Date(8639999949600000),min:new globalThis.Date(-8639999949600000),noInvalidDate:!0},iY)),Q.constantFrom("UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney")).map(([Y,$])=>TB(Y,{timeZone:$})),toFormatter:()=>(Q)=>nY(Q),toEquivalence:()=>uZ}),pn=A1("effect/schema/DateTimeZoned",UK),fn=AA.pipe(l(UK,jG)),cn=globalThis.Symbol.for("immer-draftable"),xw={};function BK(Q,X,Y,$,J){let Z=ln(Y,X,$),G=CA(X),W=class extends Q{constructor(...[H,K]){let _=K?.["~payload"],q=_?.token===xw?_.value:Y.make(H??{},K);super(q,{...K,disableChecks:!0,"~payload":{token:xw,value:q}})}static[$7]=$7;get[G](){return G}static[cn]=!0;static identifier=X;static fields=Y.fields;static get ast(){return Z(this).ast}static pipe(){return H0(this,arguments)}static rebuild(H){return Z(this).rebuild(H)}static make(H,K){return new this(H,K)}static makeOption(H,K){return p2(Z(this))(H??{},K)}static makeEffect(H,K){return Z(this).makeEffect(H??{},K)}static annotate(H){return this.rebuild(V4(this.ast,H))}static annotateKey(H){return this.rebuild(bX(this.ast,H))}static check(...H){return this.rebuild(h8(this.ast,H))}static extend(H){return(K,V)=>{let _=U7(K)?K:m(K),q={...Y.fields,..._.fields},D=j2(q,Y.ast.checks,{identifier:H});return BK(this,H,oH(h8(D,_.ast.checks),q),V,J)}}static mapFields(H,K){return Y.mapFields(H,K)}};if(J!==void 0)Object.assign(W.prototype,J(X));return W}function un(Q){return new z0(Y0((X)=>new Q(X)),b8())}function CA(Q){return`~effect/Schema/Class/${Q}`}function ln(Q,X,Y){let $;return(J)=>{if($!==void 0)return $;let Z=un(J),G=E(new P9([Q.ast],()=>(W,H)=>{return W instanceof J||C(W,CA(X))?f(W):p(new u0(H,R(W)))},{identifier:X,[h2]:([W])=>new m0(W,Z),toCodec:([W])=>new m0(W.ast,Z),toArbitrary:([W])=>()=>({arbitrary:W.arbitrary.map((H)=>new J(H)),terminal:W.terminal?.map((H)=>new J(H))}),toFormatter:([W])=>(H)=>`${J.identifier}(${W(H)})`,[OX]:IX(Q.ast),...Y}));return $=l(G,Z)(Q)}}function U7(Q){return x3(Q)}var jA=(Q)=>(X,Y)=>{let $=U7(X)?X:m(X);return BK(WU,Q,$,Y,(J)=>({toString(){return`${J}(${P({...this})})`}}))},on=(Q)=>{return(X,Y,$)=>{let J=U7(Y)?Y.mapFields((Z)=>({_tag:x9(X),...Z}),{unsafePreserveChecks:!0}):g3(X,Y);return jA(Q??X)(J,$)}},TA=(Q)=>(X,Y)=>{let $=U7(X)?X:m(X);return BK(S7,Q,$,Y,(Z)=>({name:Z}))},rn=(Q)=>{return(X,Y,$)=>{let J=U7(Y)?Y.mapFields((Z)=>({_tag:x9(X),...Z}),{unsafePreserveChecks:!0}):g3(X,Y);return TA(Q??X)(J,$)}};function IA(Q){let X=VW(Q.ast);return(Y)=>X(Y,{})}function nn(Q,X){if(X?.report===!0){let Y=VW(Q.ast),$=pF();return oF(Q.ast,$),{value:Y(j3,{}),report:fF($)}}return IA(Q)(j3)}function an(Q){return(X)=>{return X.annotate({toFormatter:Q})}}function sn(Q,X){return Y(Q.ast);function Y(J){let Z=h4(J)?.toFormatter;if(typeof Z==="function")return Z(M9(J)?J.typeParameters.map(Y):[]);if(X?.onBefore){let G=X.onBefore(J,Y);if(G!==void 0)return G}return $(J)}function $(J){switch(J._tag){default:return P;case"Never":return()=>"never";case"Void":return()=>"void";case"Arrays":{let Z=J.elements.map(Y),G=J.rest.map(Y);return(W)=>{let H=[],K=0;for(;K<Z.length;K++)if(W.length<K+1){if(f0(J.elements[K]))continue}else H.push(Z[K](W[K]));if(G.length>0){let[V,..._]=G;for(;K<W.length-_.length;K++)H.push(V(W[K]));for(let q=0;q<_.length;q++)H.push(_[q](W[K+q]))}return"["+H.join(", ")+"]"}}case"Objects":{let Z=J.propertySignatures.map((W)=>Y(W.type)),G=J.indexSignatures.map((W)=>Y(W.type));if(J.propertySignatures.length===0&&J.indexSignatures.length===0)return P;return(W)=>{let H=[],K=new Set;for(let V=0;V<Z.length;V++){let _=J.propertySignatures[V],q=_.name;if(K.add(q),f0(_.type)&&!Object.hasOwn(W,q))continue;H.push(`${O4(q)}: ${Z[V](W[q])}`)}for(let V=0;V<G.length;V++){let _=I5(W,J.indexSignatures[V].parameter);for(let q of _){if(K.has(q))continue;K.add(q),H.push(`${O4(q)}: ${G[V](W[q])}`)}}return H.length>0?"{ "+H.join(", ")+" }":"{}"}}case"Union":{let Z=z1(J).types,G=(H)=>EX(H,Z),W=new Map(Z.map((H,K)=>[H,[hX(H),Y(J.types[K])]]));return(H)=>{let K=G(H);for(let V=0;V<K.length;V++){let[_,q]=W.get(K[V]);if(_(H))return q(H)}return P(H)}}case"Suspend":{let Z=A9(()=>Y(J.thunk()));return(G)=>Z()(G)}}}}function tn(Q){return(X)=>X.annotate({toEquivalence:Q})}function en(Q){return rF(Q.ast)}function Qa(Q){return _W(Q.ast)}function EA(Q,X){let Y=_W(d3(Q.ast));return tF(Y,X)}function SA(Q){return E(d3(Q.ast),{schema:Q})}var Xa=P6((Q)=>{let X=$a(Q,d3),Y=Q.context;if(X===Q||Y===void 0)return X;return x2(X,zK(Y))}),d3=s0((Q)=>{let X=R6(Q),Y=Xa(Q);if(X===void 0||Y.encoding===void 0)return Y;let $=M6(Y);if(R6($)!==void 0||G2($)===X)return Y;let J=V4($,{[zX]:X});return P6(()=>J)(Y)});function zK(Q){return Q.defaultValue===void 0?Q:new y8(Q.isOptional,Q.isMutable,void 0,Q.annotations)}function vA(Q){if(Q.propertySignatures.some((X)=>typeof X.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:Q})}function xA(Q){return(X)=>{let Y=new Map;for(let Z=0;Z<X.length;Z++)Y.set(O1(X[Z]),Z);let $=[...X].sort((Z,G)=>{Z=O1(Z),G=O1(G);let W=Q(Z),H=Q(G);if(W!==H)return W-H;return Y.get(Z)-Y.get(G)});if(!$.some((Z,G)=>Z!==X[G]))return X;return $}}var Ya=xA((Q)=>{switch(Q._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}});function $a(Q,X){switch(Q._tag){case"Declaration":{let Y=Q.annotations?.toCodecJson??Q.annotations?.toCodec;if(!r1(Y))return L0(Q,[sG]);let $=Q.typeParameters.map((Z)=>mX(O1(Z))),J=Y($);return J===void 0?Q:L0(Q,[w6(J,X)])}case"Unknown":return L0(Q,[sG]);case"ObjectKeyword":return L0(Q,[HF]);case"Undefined":case"Void":case"Literal":case"Number":return Q.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return Q.toCodecStringTree();case"Objects":return vA(Q),Q.recur(X,g2);case"Union":{let Y=Ya(Q.types);if(Y!==Q.types)return new u1(Y,Q.mode,Q.annotations,Q.checks,Q.encoding,Q.context,Q.encodingChecks).recur(X);return Q.recur(X)}case"Arrays":case"Suspend":return Q.recur(X)}return Q}function bA(Q){return E(kA(z1(Q.ast)))}var kA=s0((Q)=>{let X=Ja(Q,kA);return X!==Q&&Q.context!==void 0?x2(X,zK(Q.context)):X});function Ja(Q,X){switch(Q._tag){case"Declaration":{let Y=Q.annotations?.toCodecIso??Q.annotations?.toCodec;if(r1(Y)){let $=Y(Q.typeParameters.map((J)=>mX(J)));return L0(Q,[w6($,X)])}return Q}case"Arrays":case"Objects":case"Union":case"Suspend":return Q.recur(X)}return Q}function yA(Q){return E(mA(Q.ast),{schema:Q})}function Za(Q){return E(dA(Q.ast))}function Ga(Q,X){let Y=R6(Q.ast)??GG(Q.ast),$=uw(yA(Q));return(J)=>$(J).pipe(EZ((Z)=>Wa(Z,{rootName:Y,...X})))}function Wa(Q,X){let Y=X.rootName??"root",$=X.arrayItemName??"item",J=X.pretty??!0,Z=X.indent??" ",G=X.sortKeys??!0,W=new Set,H=[];return V(Y,Q,0),H.join(J?`
66
+ `:"");function K(_,q){H.push(J?Z.repeat(_)+q:q)}function V(_,q,D,B){let{attrs:F,safe:N}=o5.tagInfo(_,B);if(q===void 0)K(D,`<${N}${F}/>`);else if(typeof q==="string")K(D,`<${N}${F}>${o5.escapeText(q)}</${N}>`);else if(typeof q!=="object"||q===null)K(D,`<${N}${F}>${o5.escapeText(P(q))}</${N}>`);else{if(W.has(q))throw new globalThis.Error("Cycle detected while serializing to XML.",{cause:q});W.add(q);try{if(globalThis.globalThis.Array.isArray(q)){if(q.length===0){K(D,`<${N}${F}/>`);return}K(D,`<${N}${F}>`);for(let A of q)V($,A,D+1);K(D,`</${N}>`);return}let M=q,w=Object.keys(M);if(G)w.sort();if(w.length===0){K(D,`<${N}${F}/>`);return}K(D,`<${N}${F}>`);for(let A of w)V(o5.parseTagName(A).safe,M[A],D+1,A);K(D,`</${N}>`)}finally{W.delete(q)}}}}var o5={escapeText(Q){return Q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeAttribute(Q){return Q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},parseTagName(Q){let X=Q,Y=Q;if(!/^[A-Za-z_]/.test(Y))Y="_"+Y;if(Y=Y.replace(/[^A-Za-z0-9._-]/g,"_"),/^xml/i.test(Y))Y="_"+Y;return{safe:Y,changed:Y!==X}},tagInfo(Q,X){let{changed:Y,safe:$}=o5.parseTagName(Q),Z=Y||X&&X!==Q?` data-name="${o5.escapeAttribute(X??Q)}"`:"";return{safe:$,attrs:Z}}},Ha=xA((Q)=>{switch(Q._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}});function Ka(Q,X,Y){switch(Q._tag){case"Declaration":{let $=Q.typeParameters.map((K)=>E(X(O1(K)))),J=Q.annotations?.toCodecStringTree;if(r1(J)){let K=J($);if(K===void 0)return Q;return L0(Q,[w6(K,X)])}let Z=Q.annotations?.toCodecJson,G=r1(Z)?Z($):void 0,W=G===void 0?Q.annotations?.toCodec:void 0,H=G??(r1(W)?W($):void 0);return H===void 0?Y(Q):L0(Q,[w6(H,X)])}case"Null":return L0(Q,[Va]);case"Boolean":return L0(Q,[_a]);case"Unknown":case"ObjectKeyword":return L0(Q,[tG]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return Q.toCodecStringTree();case"Objects":return vA(Q),Q.recur(X,g2);case"Union":{let $=Ha(Q.types);if($!==Q.types)return new u1($,Q.mode,Q.annotations,Q.checks,Q.encoding,Q.context,Q.encodingChecks).recur(X);return Q.recur(X)}case"Arrays":case"Suspend":return Q.recur(X)}return Q}var Va=new m0(new $8("null"),new z0(Y0(()=>null),Y0(()=>"null"))),_a=new m0(new u1([new $8("true"),new $8("false")],"anyOf"),new z0(Y0((Q)=>Q==="true"),R9())),gA="~effect/Schema/SERIALIZER_ENSURE_ARRAY",hA=(Q)=>jX(Q)&&Q.annotations?.[gA]===!0,mA=P6((Q)=>{if(hA(Q))return Q;let X=Ka(Q,mA,(Y)=>{throw new globalThis.Error("Missing structural codec for StringTree",{cause:Y})});if(X!==Q&&Q.context!==void 0)return x2(X,zK(Q.context));return X}),bw=(Q)=>f0(Q)?kX(N9):N9,qa=new z0(Y0((Q)=>typeof Q==="string"?[Q]:Q),b8()),dA=P6((Q)=>{if(hA(Q))return Q;let X=Da(Q);if(CX(X)){let Y=b2(new u1([new g8(X.isMutable,X.elements.map(bw),X.rest.map(bw)),L6],"anyOf",{[gA]:!0}),X,qa);return f0(Q)?kX(Y):Y}return X});function Da(Q){return Q._tag==="Declaration"||Q._tag==="Arrays"||Q._tag==="Objects"||Q._tag==="Union"||Q._tag==="Suspend"?Q.recur(dA):Q}var Ua=a("effect/schema/isGreaterThanDate",m({exclusiveMinimum:r8}),({annotations:Q,payload:X})=>EP(X.exclusiveMinimum,Q)),Ba=a("effect/schema/isGreaterThanOrEqualToDate",m({minimum:r8}),({annotations:Q,payload:X})=>SP(X.minimum,Q)),za=a("effect/schema/isLessThanDate",m({exclusiveMaximum:r8}),({annotations:Q,payload:X})=>vP(X.exclusiveMaximum,Q)),Oa=a("effect/schema/isLessThanOrEqualToDate",m({maximum:r8}),({annotations:Q,payload:X})=>xP(X.maximum,Q)),Fa=a("effect/schema/isBetweenDate",m({minimum:r8,maximum:r8,exclusiveMinimum:P8(p0(!0)),exclusiveMaximum:P8(p0(!0))}),({annotations:Q,payload:X})=>bP(X,Q)),Ra=a("effect/schema/isGreaterThanBigInt",m({exclusiveMinimum:U4}),({annotations:Q,payload:X})=>kP(X.exclusiveMinimum,Q)),Na=a("effect/schema/isGreaterThanOrEqualToBigInt",m({minimum:U4}),({annotations:Q,payload:X})=>yP(X.minimum,Q)),La=a("effect/schema/isLessThanBigInt",m({exclusiveMaximum:U4}),({annotations:Q,payload:X})=>gP(X.exclusiveMaximum,Q)),Ma=a("effect/schema/isLessThanOrEqualToBigInt",m({maximum:U4}),({annotations:Q,payload:X})=>hP(X.maximum,Q)),wa=a("effect/schema/isBetweenBigInt",m({minimum:U4,maximum:U4,exclusiveMinimum:P8(p0(!0)),exclusiveMaximum:P8(p0(!0))}),({annotations:Q,payload:X})=>mP(X,Q));function Pa(Q){let X=bA(Q);return KR(JW(X),YW(X))}function Aa(Q){return X3()}function Ca(Q){return X3()}function ja(Q,X){return(Y)=>{return E(V4(Y.ast,{toCodecIso:()=>new m0(Q.ast,O2(X))}),{schema:Y})}}function Ta(Q){let X=SA(Q),Y=JW(X),$=YW(X);return{empty:[],diff:(J,Z)=>n2(Y(J),Y(Z)),combine:(J,Z)=>[...J,...Z],patch:(J,Z)=>{let G=Y(J),W=JR(Z,G);return Object.is(W,G)?J:$(W)}}}function Ia(Q){let X=YP(()=>Y),Y=Q1([Q,e0(X),tw(n,X)]);return Y}var p3=E(V4(T5,{toCode:()=>({runtime:"Schema.Json",Type:"Schema.Json"})})),Ea=A1("effect/schema/Json",p3),Sa=m({message:n,name:k6(n),stack:k6(n),cause:k6(p3)}),pA=E(V4(WF,{toCode:()=>({runtime:"Schema.MutableJson",Type:"Schema.MutableJson"})})),va=A1("effect/schema/MutableJson",pA);function xa(Q){return h4(Q.ast)}function ba(Q){return Q.ast.context?.annotations}var i4=z(tA(),1),la=["dist","build","_build","out","target",".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless","coverage",".nyc_output",".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox","__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target","tmp",".tmp",".state",".terraform",".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"],YC=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"],$C=new Set([">",">>","<","<<","<<<","<>",">&","<&","&>","&>>"]),JC=new Set([";","&&","||","|","|&","&"]),ZC=(Q)=>typeof Q==="string",r4=(Q)=>{if(typeof Q==="object"&&"op"in Q&&typeof Q.op==="string")return Q.op;return null},oa=(Q)=>typeof Q==="object"&&("comment"in Q),ra=(Q)=>{try{let X=[...new Bun.Glob(Q).scanSync({onlyFiles:!1,dot:!0})];if(X.length>0)return X}catch{}return[Q]},ia=(Q)=>{if(ZC(Q))return[Q];if(typeof Q==="object"&&"op"in Q&&Q.op==="glob"&&"pattern"in Q)return ra(String(Q.pattern));let X=r4(Q);if(X!==null){if($C.has(X)||JC.has(X))return[];return[`__op_${X}__`]}if(oa(Q))return[];return["__tripwire_cmd_sub__"]},eA=(Q,X)=>{let Y=[],$=[],J=[],Z=[],G=0;while(G<Q.length){let V=Q[G],_=r4(V);if(_!==null&&$C.has(_)){let q=Y.at(-1);if(q!==void 0&&/^[0-9]+$/.test(q)&&X.remaining>0)Y.pop(),X.remaining--;let D=Q[G+1];if(D!==void 0&&ZC(D)){Z.push({op:_,target:D}),G+=2;continue}G++;continue}for(let q of ia(V))Y.push(q);G++}if(Y.length===0)return null;for(let V=1;V<Y.length;V++){let _=Y[V];if(_.startsWith("-")&&_!=="-")J.push(_);else $.push(_)}let W=Y[0],H=W.lastIndexOf("/");return{head:H===-1?W:W.slice(H+1),tokens:Y,args:$,flags:J,redirects:Z,raw:Y.join(" ")}},na=(Q)=>`$${Q}`,aa=(Q)=>{let X=[];for(let Y=0;Y<Q.length;Y++){let $=Q[Y],J=Q[Y+1];if(r4($)==="&"&&J!==void 0&&(r4(J)===">"||r4(J)===">>")){let Z={op:r4(J)===">"?"&>":"&>>"};X.push(Z),Y++;continue}if(r4($)===">"&&J!==void 0&&r4(J)==="|"){X.push({op:">"}),Y++;continue}X.push($)}return X},sa=(Q)=>{return Q.match(/(?<![\w$])\d+(?=[<>])/g)?.length??0},RK=(Q)=>{let X=/<<-?\s*(?:"(?<quoted>[^"]+)"|'(?<single>[^']+)'|(?<unquoted>[A-Za-z_][A-Za-z0-9_]*))/u.exec(Q);return X?.groups?.quoted??X?.groups?.single??X?.groups?.unquoted??null},ta=/(?:^|[|;&]\s*)(?:\/(?:usr\/bin|bin|usr\/local\/bin|opt\/homebrew\/bin)\/)?(?:sh|bash|zsh|dash|ksh|ash)(?:\s|$)/u,NK=(Q)=>ta.test(Q),GC=(Q)=>{let X=Q.split(`
67
+ `),Y=[];for(let $=0;$<X.length;$++){let J=X[$];Y.push(J);let Z=RK(J);if(Z===null||NK(J))continue;$++;while($<X.length&&X[$].trim()!==Z)$++;if($<X.length)Y.push("__HEREDOC_BODY__"),Y.push(X[$])}return Y.join(`
68
+ `)},WC=(Q)=>{let X=new Map,Y=Q.split(`
69
+ `);for(let $=0;$<Y.length;$++){let J=Y[$],Z=RK(J);if(Z===null||NK(J))continue;let G=[];$++;while($<Y.length&&Y[$].trim()!==Z)G.push(Y[$]),$++;if(!X.has(Z))X.set(Z,G.join(`
70
+ `))}return X},ea=(Q)=>{let X=Q.split(`
71
+ `),Y=[];for(let $=0;$<X.length;$++){let J=X[$],Z=RK(J);if(Z===null||!NK(J))continue;let G=[];$++;while($<X.length&&X[$].trim()!==Z)G.push(X[$]),$++;if(G.length>0)Y.push(G.join(`
72
+ `))}return Y},Qs=(Q,X)=>{for(let Y=X;Y<Q.length;Y++){let $=Q[Y];if($==="\\"){Y++;continue}if($==="`")return Y}return null},Xs=(Q,X)=>{let Y=1,$=null;for(let J=X;J<Q.length;J++){let Z=Q[J];if(Z==="\\"){J++;continue}if($==="single"){if(Z==="'")$=null;continue}if(Z==="'"){$??="single";continue}if(Z==='"'){$=$==="double"?null:"double";continue}if(Z==="("){Y++;continue}if(Z===")"){if(Y--,Y===0)return J}}return null},Ys=(Q)=>{let X=[],Y=null;for(let $=0;$<Q.length;$++){let J=Q[$];if(J==="\\"){$++;continue}if(Y==="single"){if(J==="'")Y=null;continue}if(J==="'"){Y??="single";continue}if(J==='"'){Y=Y==="double"?null:"double";continue}if(J==="`"){let K=Qs(Q,$+1);if(K!==null)X.push(Q.slice($+1,K)),$=K;continue}let Z=Q[$+1];if(!(J==="$"&&Z==="(")&&!(Y===null&&(J==="<"||J===">")&&Z==="("))continue;let H=Xs(Q,$+2);if(H!==null)X.push(Q.slice($+2,H)),$=H}return X},HC=/^\$\{?HOME\}?(?:\/|$)/,KC=(Q)=>{if(Q===""||Q==="-")return!1;if(Q==="/"||Q==="~"||Q==="."||Q==="..")return!0;if(Q.startsWith("/")||Q.startsWith("~")||Q.startsWith("./")||Q.startsWith("../")||HC.test(Q))return!0;return!1},c3=(Q)=>{if(Q==="/")return 100;if(Q==="~"||HC.test(Q))return 90;if(/^\/(?<dir>etc|usr|bin|sbin|System|Library|var|boot|root|home)(?<suffix>\/|$)/.test(Q))return 80;if(Q.startsWith("/Users/"))return 70;if(Q.startsWith("/")||Q.startsWith("~"))return 60;if(Q.startsWith("../"))return 40;if(Q===".."||Q==="."||Q.startsWith("./"))return 10;return 50},$s=new Set(["-e","--extension","-t","--type","-E","--exclude","-d","--max-depth","--min-depth","--exact-depth","-c","--color","--changed-within","--changed-before","-S","--size","-o","--owner","-j","--threads","-g","--glob","--format","--max-results","--ignore-file","--search-path","--base-directory","--path-separator","--and"]),Js=(Q,X)=>{let Y=[],$=1;while($<X){let J=Q[$];if($s.has(J)){$+=2;continue}if(J.startsWith("-")){$++;continue}if(KC(J))Y.push(J);$++}if(Y.length===0)return".";return Y.sort((J,Z)=>c3(Z)-c3(J)),Y[0]},Zs=(Q,X)=>{let Y=[];for(let $=1;$<X;$++){let J=Q[$];if(J.startsWith("-"))break;if(KC(J))Y.push(J)}if(Y.length===0)return".";return Y.sort(($,J)=>c3(J)-c3($)),Y[0]},QC={execFlags:new Set(["-x","-X","--exec","--exec-batch"]),placeholders:new Set(["{}","{/}","{//}","{.}","{/.}"]),pickRoot:Js},XC={execFlags:new Set(["-exec","-execdir","-ok","-okdir"]),placeholders:new Set(["{}"]),pickRoot:Zs},Gs=Object.assign(Object.create(null),{fd:QC,fdfind:QC,find:XC,gfind:XC}),Ws=(Q,X,Y)=>Q.map(($)=>X.placeholders.has($)?Y:$),Hs=(Q)=>{let X=Gs[Q.head];if(X===void 0)return[];let Y=[],$=Q.tokens;for(let J=1;J<$.length;J++){if(!X.execFlags.has($[J]))continue;let Z=[],G=J+1;while(G<$.length){let K=$[G];if(K===";"||K==="+")break;Z.push(K),G++}if(Z.length===0)continue;let W=Z[0];if(X.placeholders.has(W))continue;let H=X.pickRoot($,J);Y.push(i4.quote(Ws(Z,X,H))),J=G}return Y},Ks=/\$\(\s*cat\s+<<-?\s*['"]?(?<delimiter>\w+)['"]?\s*\n(?<body>[\s\S]*?)\n\s*\k<delimiter>\s*\)/u,Vs=/\$\(\s*(?:printf|echo)\s+(?:-[a-zA-Z]+\s+)*'(?<content>[^']*)'/u,u3=(Q,X)=>{let Y=Ks.exec(Q);if(Y!==null){let J=Y.groups?.body??Q;if(X!==void 0&&J.trim()==="__HEREDOC_BODY__"){let Z=Y.groups?.delimiter,G=Z===void 0?void 0:X.get(Z);if(G!==void 0)return G}return J}let $=Vs.exec(Q);if($!==null)return $.groups?.content??Q;return Q},_s=new Set(["sh","bash","zsh","dash","ksh","ash"]),qs=(Q)=>{if(!_s.has(Q.head))return[];let X=Q.tokens;for(let Y=1;Y<X.length;Y++){let $=X[Y];if($==="-c"&&Y+1<X.length)return[X[Y+1]];if($.startsWith("-")&&!$.startsWith("--")&&$.endsWith("c")&&$.length>2&&Y+1<X.length)return[X[Y+1]]}return[]},Ds=new Set(["command","exec","env","time","nohup","setsid","nice","ionice","chronic","stdbuf","unbuffer","script","taskset","sudo","doas","xargs","watch"]),Us={command:new Set,env:new Set(["-u","--unset","-C","--chdir","-S","--split-string","--block-signal"]),time:new Set(["-f","--format","-o","--output"]),nice:new Set(["-n","--adjustment"]),ionice:new Set(["-c","--class","-n","--classdata","-p","--pid"]),stdbuf:new Set(["-i","--input","-o","--output","-e","--error"]),script:new Set(["-c","--command"]),taskset:new Set,sudo:new Set(["-u","--user","-g","--group","-C","--close-from","-D","--chdir","-h","--host","-p","--prompt","-r","--role","-t","--type","-U","--other-user","-R","--chroot","-T","--command-timeout"]),doas:new Set(["-a","-C","-u"]),xargs:new Set(["-I","-i","-J","-n","--max-args","-P","--max-procs","-s","--max-chars","-L","--max-lines","-E","--eof","-d","--delimiter","-a","--arg-file","--replace"]),watch:new Set(["-n","--interval"])},Bs=(Q)=>/^[A-Za-z_][A-Za-z0-9_]*=.*/u.test(Q),zs=(Q)=>{let X=Q[0],Y=Us[X]??new Set,$=1;while($<Q.length){let J=Q[$];if(X==="env"&&Bs(J)){$++;continue}if(Y.has(J)){$+=2;continue}if(J.includes("=")&&Y.has(J.slice(0,J.indexOf("=")))){$++;continue}if(J.startsWith("--")&&J!=="--"){$++;continue}if(J.startsWith("-")&&J!=="-"){$++;continue}break}return $},Os=(Q)=>{if(!Ds.has(Q.head))return[];if(Q.head==="script")for(let $=1;$<Q.tokens.length-1;$++){let J=Q.tokens[$];if(J==="-c"||J==="--command")return[Q.tokens[$+1]];if(J.startsWith("--command="))return[J.slice(10)]}let X=zs(Q.tokens),Y=i4.quote(Q.tokens.slice(X));return Y===""?[]:[Y]},Fs=new Set(["eval"]),Rs=(Q)=>{if(!Fs.has(Q.head))return[];if(Q.tokens.length===2)return[Q.tokens[1]];let X=i4.quote(Q.tokens.slice(1));return X===""?[]:[X]},Ns=new Set(["run","proxy","err","test","summary"]),Ls=(Q)=>Q==="rtk",Ms=(Q)=>{let X=1;while(X<Q.length){let Y=Q[X];if(Y.startsWith("-")&&Y!=="-"&&Y!=="--"){X++;continue}break}return X},VC=(Q,X)=>{for(let Y=X;Y<Q.length;Y++){let $=Q[Y];if(($==="-c"||$==="--command")&&Y+1<Q.length)return Q[Y+1];if($.startsWith("--command="))return $.slice(10)}return null},ws=(Q)=>{if(!Ls(Q.head))return[];let X=Ms(Q.tokens),Y=Q.tokens[X];if(Y===void 0)return[];if(Ns.has(Y)){let J=VC(Q.tokens,X+1);if(J!==null)return J===""?[]:[J];let Z=X+1;while(Z<Q.tokens.length){let W=Q.tokens[Z];if(W==="--"){Z++;break}if(W.startsWith("-")&&W!=="-"){Z++;continue}break}let G=i4.quote(Q.tokens.slice(Z));return G===""?[]:[G]}let $=i4.quote(Q.tokens.slice(X));return $===""?[]:[$]},Ps={timeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},gtimeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},chroot:{valueFlags:new Set(["--userspec","--groups"]),skipPositionals:1,dashCommand:!1},flock:{valueFlags:new Set(["-w","--wait","--timeout","-E","--conflict-exit-code"]),skipPositionals:1,dashCommand:!0},su:{valueFlags:new Set,skipPositionals:0,dashCommand:!0}},As=(Q)=>{let X=Ps[Q.head];if(X===void 0)return[];if(X.dashCommand){let J=VC(Q.tokens,1);if(J!==null)return J===""?[]:[J]}let Y=1;while(Y<Q.tokens.length){let J=Q.tokens[Y];if(X.valueFlags.has(J)){Y+=2;continue}if(J.includes("=")&&X.valueFlags.has(J.slice(0,J.indexOf("=")))){Y++;continue}if(J==="--"){Y++;break}if(J.startsWith("-")&&J!=="-"){Y++;continue}break}Y+=X.skipPositionals;let $=i4.quote(Q.tokens.slice(Y));return $===""?[]:[$]},Cs=[Hs,qs,Os,Rs,ws,As],js=(Q)=>{let X="",Y=!1,$=!1,J=!1;for(let Z of Q){if(J){X+=Z,J=!1;continue}if(Z==="\\"){X+=Z,J=!0;continue}if(Z==="'"&&!$){Y=!Y,X+=Z;continue}if(Z==='"'&&!Y){$=!$,X+=Z;continue}X+=Z===`
73
+ `&&!Y&&!$?" ; ":Z}return X},QQ=(Q)=>{let X,Y=js(GC(Q));try{X=i4.parse(Y,na)}catch{return[]}X=aa(X);let $={remaining:sa(Y)},J=[],Z=[];for(let H of X){let K=r4(H);if(K!==null&&JC.has(K)){let V=eA(Z,$);if(V!==null)J.push(V);Z=[];continue}Z.push(H)}let G=eA(Z,$);if(G!==null)J.push(G);for(let H of[...Ys(Q),...ea(Q)])for(let K of QQ(H))J.push(K);let W=J.length;for(let H=0;H<W;H++){let K=J[H];for(let V of Cs)for(let _ of V(K))for(let q of QQ(_))J.push(q)}return J},Ts=(Q)=>Q.startsWith("./")?Q.slice(2):Q,LK=(Q,X=[],Y=[])=>{if(Q==="")return!1;let $=Ts(Q);if($===".."||$.startsWith("../")||$.includes("/../"))return!1;for(let J of[...YC,...Y])if($===J||$.startsWith(`${J}/`))return!0;for(let J of[...la,...X])if($===J||$.startsWith(`${J}/`))return!0;return!1},_C=(Q=[],X=[])=>{let Y={"build outputs":["dist","build","_build","out","target"],"js framework outputs":[".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless"],"tests / coverage":["coverage",".nyc_output"],caches:[".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox"],"language / package":["__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target"],"tmp / state":["tmp",".tmp",".state",...YC],iac:[".terraform"],"bundler dev":[".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"]};if(Q.length>0)Y["custom relative"]=Q;if(X.length>0)Y["custom absolute"]=X;return Object.entries(Y).map(([$,J])=>` ${$}: ${J.join(", ")}`).join(`
74
+ `)},C1=(Q)=>/(?<prefix>^|\s)#\s*tripwire-allow\b/.test(GC(Q));var XQ=require("fs"),DC=require("os");var qC=g.Struct({pattern:g.String,message:g.String,action:g.optional(g.Union([g.Literal("deny"),g.Literal("ask")])),requiresFlags:g.optional(g.Array(g.String)),forbidsFlagValues:g.optional(g.Array(g.Struct({flag:g.String,values:g.Array(g.String)})))}),Is=g.Struct({protectedBranches:g.optional(g.Array(g.String)),enforceConventionalCommits:g.optional(g.Boolean)}),Es=g.Struct({relative:g.optional(g.Array(g.String)),absolute:g.optional(g.Array(g.String))}),Ss=g.Struct({git:g.optional(Is),safePaths:g.optional(Es),blockedCommands:g.optional(g.Array(qC)),allowedCommands:g.optional(g.Array(qC))}),MK=`${DC.homedir()}/.config/tripwire/config.json`,vs=(Q)=>w0.sync(()=>{try{return XQ.accessSync(Q,XQ.constants.R_OK),!0}catch{return!1}}),xs=(Q)=>w0.try({try:()=>XQ.readFileSync(Q,"utf8"),catch:(X)=>X}),bs=(Q)=>w0.try({try:()=>JSON.parse(Q),catch:(X)=>X}),ks=(Q)=>g.decodeUnknownEffect(Ss)(Q,{onExcessProperty:"error"}),g9=()=>({git:{protectedBranches:["main","master","develop","production","release"],enforceConventionalCommits:!0},safePaths:{},blockedCommands:[],allowedCommands:[]}),wK=(Q)=>({git:Q.git??g9().git,safePaths:Q.safePaths??g9().safePaths,blockedCommands:Q.blockedCommands??g9().blockedCommands,allowedCommands:Q.allowedCommands??g9().allowedCommands}),UC=(Q=MK)=>w0.gen(function*(){if(!(yield*vs(Q)))return{ok:!0,config:g9()};let Y=yield*xs(Q),$=yield*bs(Y),J=yield*ks($);return{ok:!0,config:wK(J)}}).pipe(w0.timeout(1000),w0.catchCause((X)=>{let Y={ok:!1,error:B1.pretty(X)};return w0.succeed(Y)}));var BC={allow:0,warn:1,ask:2,deny:3},v=(Q)=>({kind:"allow",rule:Q,message:""}),h6=(Q,X)=>({kind:"warn",rule:Q,message:X}),G1=(Q,X)=>({kind:"ask",rule:Q,message:X}),c=(Q,X)=>({kind:"deny",rule:Q,message:X}),B7=(Q)=>{let X=v("none");for(let Y of Q)if(BC[Y.kind]>BC[X.kind])X=Y;return X};var zC=g.Struct({hook_event_name:g.String,tool_name:g.optional(g.String),tool_input:g.optional(g.Unknown),tool_response:g.optional(g.Unknown),cwd:g.optional(g.String),session_id:g.optional(g.String),turn_id:g.optional(g.String),tool_use_id:g.optional(g.String)}),OC=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.command==="string",FC=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string"&&typeof Q.old_string==="string"&&typeof Q.new_string==="string",RC=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string"&&typeof Q.content==="string",NC=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string",LC=(Q,X)=>{if(typeof X!=="object"||X===null)return"";if(Q==="Bash"){let Y=X;return[Y.stdout??"",Y.stderr??""].filter(($)=>$.length>0).join(`
75
+ `)}if(Q==="Read"){let Y=X;return Y.content??Y.file?.content??""}if(typeof X.content==="string")return X.content??"";return""};var l3=require("fs"),MC=require("os"),wC=require("path"),PC=`${MC.homedir()}/.claude/tripwire.log`;try{l3.mkdirSync(wC.dirname(PC),{recursive:!0})}catch{}var z7=(Q,X)=>{let Y=new Date().toISOString(),$=X instanceof Error?X.stack??X.message:String(X);try{l3.appendFileSync(PC,`[${Y}] [${Q}] ${$}
76
+ `)}catch{}};var ys=(Q)=>Q.tokens.slice(1).join(" "),AC=(Q,...X)=>Q.flags.some((Y)=>X.includes(Y)),gs=[{rule:"rm-rf-root",action:"deny",message:"rm -rf / is catastrophic. If the goal is cleaning a subdirectory, scope the path inside the project (e.g. ./dist).",match:(Q)=>Q.head==="rm"&&AC(Q,"-rf","-fr","-Rf","-fR")&&Q.tokens.includes("/")},{rule:"rm-rf-home",action:"deny",message:"rm -rf on $HOME / ~ would erase the home directory. Refuse.",match:(Q)=>Q.head==="rm"&&AC(Q,"-rf","-fr","-Rf","-fR")&&Q.tokens.some((X)=>/^(?<home>~|\$HOME|\$\{HOME\})$/.test(X))},{rule:"fork-bomb",action:"deny",message:"Fork bomb pattern detected. Refuse.",match:(Q,X)=>/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;/.test(X)},{rule:"source-script",action:"deny",message:"`source` / `.` executes a file in the current shell. Refuse arbitrary sourced scripts.",match:(Q)=>(Q.head==="source"||Q.head===".")&&Q.tokens.length>1},{rule:"dd-raw-device",action:"deny",message:"dd writing to a raw block device wipes the disk. Refuse.",match:(Q)=>Q.head==="dd"&&/\bof=\/dev\/(?<type>disk|sd|nvme|rdisk)/i.test(ys(Q))},{rule:"mkfs",action:"deny",message:"mkfs formats a filesystem. Refuse.",match:(Q)=>/^mkfs(?<ext>\.[a-z0-9]+)?$/i.test(Q.head)},{rule:"kill-all",action:"deny",message:"kill -9 -1 kills every process you own. Refuse.",match:(Q)=>Q.head==="kill"&&Q.tokens.includes("-9")&&Q.tokens.includes("-1")},{rule:"chmod-777-recursive",action:"deny",message:"Recursive chmod 777 makes everything world-writable. Use 755 for directories, 644 for files, scoped narrowly.",match:(Q)=>Q.head==="chmod"&&Q.flags.some((X)=>X.includes("R"))&&Q.tokens.includes("777")},{rule:"no-verify",action:"deny",message:"--no-verify skips git hooks. Per policy: never skip hooks. Fix the underlying issue.",match:(Q)=>Q.tokens.includes("--no-verify")},{rule:"no-gpg-sign",action:"deny",message:"Bypassing GPG signing is off-limits unless explicitly requested.",match:(Q,X)=>/--no-gpg-sign\b|-c\s+commit\.gpgsign=false/.test(X)},{rule:"sudo",action:"ask",message:"sudo escalates privileges and is almost never needed in a coding session. If genuinely required, explain why; otherwise find a non-sudo path.",match:(Q)=>Q.head==="sudo"},{rule:"shutdown",action:"deny",message:"shutdown / reboot / halt control the machine. Refuse \u2014 system control should be done manually.",match:(Q)=>["shutdown","reboot","halt","poweroff"].includes(Q.head)},{rule:"launchctl-mutation",action:"deny",message:"launchctl load/unload/bootstrap/bootout/kickstart mutates system services. Refuse \u2014 surface the intent instead.",match:(Q)=>Q.head==="launchctl"&&typeof Q.tokens[1]==="string"&&["load","unload","bootstrap","bootout","kickstart","enable","disable"].includes(Q.tokens[1])},{rule:"defaults-write",action:"deny",message:"`defaults write` mutates macOS preferences. Refuse \u2014 surface the intent.",match:(Q)=>Q.head==="defaults"&&Q.tokens[1]==="write"},{rule:"csrutil",action:"deny",message:"csrutil controls System Integrity Protection. Refuse.",match:(Q)=>Q.head==="csrutil"},{rule:"nvram",action:"deny",message:"nvram modifies firmware variables. Refuse.",match:(Q)=>Q.head==="nvram"},{rule:"diskutil-destructive",action:"deny",message:"diskutil eraseDisk / reformat / partitionDisk wipes disks. Refuse.",match:(Q)=>Q.head==="diskutil"&&typeof Q.tokens[1]==="string"&&["eraseDisk","reformat","partitionDisk","eraseVolume","secureErase"].includes(Q.tokens[1])},{rule:"tmutil-destructive",action:"deny",message:"tmutil delete / disablelocal touches Time Machine. Refuse.",match:(Q)=>Q.head==="tmutil"&&typeof Q.tokens[1]==="string"&&["delete","disablelocal"].includes(Q.tokens[1])},{rule:"osascript",action:"ask",message:"osascript runs arbitrary AppleScript and can do almost anything (move files, send emails, drive apps). Confirm with the user what you want done before running it.",match:(Q)=>Q.head==="osascript"},{rule:"topgrade",action:"deny",message:"topgrade upgrades everything (brew, mas, npm globals, rust, mise). System upgrades should be done manually.",match:(Q)=>Q.head==="topgrade"},{rule:"rsync-delete",action:"deny",message:"rsync --delete removes files at the destination. High blast radius \u2014 surface the intent instead.",match:(Q)=>Q.head==="rsync"&&Q.flags.includes("--delete")},{rule:"softwareupdate-install",action:"deny",message:"`softwareupdate --install / -i / -d` triggers macOS system updates. Refuse \u2014 system updates should be done manually.",match:(Q)=>Q.head==="softwareupdate"&&Q.flags.some((X)=>X==="--install"||X==="-i"||X==="-d"||X.startsWith("--download"))},{rule:"pmset-write",action:"deny",message:"`pmset` (with arguments) writes power-management settings. Read-only `pmset -g` is fine; mutations need the user.",match:(Q)=>Q.head==="pmset"&&Q.tokens.length>1&&!Q.tokens.includes("-g")&&!Q.tokens.includes("-G")},{rule:"dscl-mutate",action:"deny",message:"`dscl . -create / -delete / -append / -change / -merge` modifies the local directory service (your user account, groups, etc.). Refuse.",match:(Q)=>Q.head==="dscl"&&Q.tokens.some((X)=>["-create","-delete","-append","-change","-merge","-passwd"].includes(X))},{rule:"xattr-quarantine-bypass",action:"deny",message:"`xattr -d com.apple.quarantine` removes Gatekeeper's quarantine bit \u2014 the macOS protection against running untrusted binaries. Refuse.",match:(Q)=>Q.head==="xattr"&&Q.tokens.includes("-d")&&Q.tokens.some((X)=>X.includes("com.apple.quarantine"))},{rule:"spctl-disable",action:"deny",message:"`spctl --master-disable` / `--global-disable` disables Gatekeeper system-wide. Refuse.",match:(Q)=>Q.head==="spctl"&&Q.flags.some((X)=>X==="--master-disable"||X==="--global-disable"||X==="--disable")},{rule:"kextload",action:"deny",message:"Loading a kernel extension (`kextload`, `kmutil load`) is a system-level mutation. Refuse \u2014 the user handles this manually.",match:(Q)=>Q.head==="kextload"||Q.head==="kextunload"||Q.head==="kmutil"&&(Q.tokens[1]==="load"||Q.tokens[1]==="unload")},{rule:"security-keychain-destructive",action:"deny",message:"`security delete-keychain / delete-generic-password / delete-internet-password / set-keychain-settings` mutates your Keychain (where CLIs store their secrets). Refuse \u2014 Keychain should be managed manually.",match:(Q)=>Q.head==="security"&&typeof Q.tokens[1]==="string"&&["delete-keychain","delete-generic-password","delete-internet-password","delete-certificate","delete-identity","set-keychain-settings","unlock-keychain","lock-keychain","create-keychain"].includes(Q.tokens[1])},{rule:"security-keychain-add-write",action:"ask",message:"`security add-generic-password / add-internet-password / add-certificate` writes to your Keychain. Other tools manage their own entries \u2014 confirm this is the right path before adding anything else manually.",match:(Q)=>Q.head==="security"&&typeof Q.tokens[1]==="string"&&["add-generic-password","add-internet-password","add-certificate"].includes(Q.tokens[1])},{rule:"systemsetup",action:"deny",message:"`systemsetup -set...` writes machine-wide settings (timezone, sleep, network time, restart-on-power-failure). Refuse.",match:(Q)=>Q.head==="systemsetup"&&Q.tokens.some((X)=>X.startsWith("-set"))},{rule:"scutil-set",action:"deny",message:"`scutil --set` writes system configuration (computer name, hostname, LocalHostName). Refuse \u2014 read-only `scutil --get` is fine.",match:(Q)=>Q.head==="scutil"&&Q.tokens.includes("--set")},{rule:"brew-mutation",action:"ask",message:"`brew install/uninstall/upgrade/untap` modifies the machine globally. Confirm before running.",match:(Q)=>Q.head==="brew"&&typeof Q.tokens[1]==="string"&&["install","uninstall","upgrade","reinstall","untap","tap"].includes(Q.tokens[1])},{rule:"mas-mutation",action:"ask",message:"`mas install/uninstall` changes installed Mac App Store apps. Confirm.",match:(Q)=>Q.head==="mas"&&typeof Q.tokens[1]==="string"&&["install","uninstall","purchase"].includes(Q.tokens[1])},{rule:"gh-destructive",action:"deny",message:"gh repo/release/issue delete is destructive on shared state. Refuse.",match:(Q)=>Q.head==="gh"&&typeof Q.tokens[1]==="string"&&typeof Q.tokens[2]==="string"&&["repo","release","issue","pr"].includes(Q.tokens[1])&&["delete","destroy","remove"].includes(Q.tokens[2])},{rule:"flyctl-destroy",action:"deny",message:"flyctl apps destroy / volumes destroy nukes deployed infra. Refuse.",match:(Q)=>Q.head==="flyctl"&&Q.tokens.some((X)=>X==="destroy"||X==="delete")},{rule:"gcloud-delete",action:"deny",message:"`gcloud ... delete` affects cloud resources. Refuse.",match:(Q)=>Q.head==="gcloud"&&Q.tokens.includes("delete")}],hs=new Set(["rm-rf-root","rm-rf-home","fork-bomb","dd-raw-device","mkfs","kill-all","diskutil-destructive","tmutil-destructive","shutdown","csrutil","nvram","kextload","spctl-disable","xattr-quarantine-bypass","topgrade","softwareupdate-install","systemsetup","scutil-set","security-keychain-destructive","no-verify","no-gpg-sign"]),CC=(Q,X)=>{let Y=C1(X),$=[];for(let J of Q)for(let Z of gs){if(!Z.match(J,X))continue;if(Y&&!hs.has(Z.rule))continue;$.push(Z.action==="deny"?c(Z.rule,Z.message):G1(Z.rule,Z.message));break}return $.length===0?v("bash-deny"):B7($)};var ms=["main","master","develop","production","release"],PK=(Q)=>Q.protectedBranches??ms,ds=/^(?<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?<scope>\([\w./\- ]+\))?!?:\s+\S/,ps=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),fs=new Set(["--bare","--paginate","-p","--no-pager","--no-replace-objects","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-optional-locks","--exec-path","--html-path","--man-path","--info-path"]),cs=(Q)=>{if(Q.head!=="git")return null;let X=Q.tokens.slice(1),Y=0;while(Y<X.length){let $=X[Y];if(ps.has($)){Y+=2;continue}if(fs.has($)){Y++;continue}if($.startsWith("--git-dir=")||$.startsWith("--work-tree=")||$.startsWith("--namespace=")||$.startsWith("--super-prefix=")||$.startsWith("--exec-path=")){Y++;continue}if($.startsWith("-")){Y++;continue}return{subcommand:$,subArgs:X.slice(Y+1)}}return null},us=(Q,X)=>{for(let Y=0;Y<Q.length;Y++){let $=Q[Y];if($==="-m"||$==="--message"){let J=Q[Y+1];return J===void 0?null:u3(J,X)}if($.startsWith("--message="))return u3($.slice(10),X);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test($)){let J=Q[Y+1];return J===void 0?null:u3(J,X)}}return null},ls=(Q,X)=>{let Y=PK(X);for(let $ of Q)for(let J of Y)if($===J||$.endsWith(`:${J}`)||$.endsWith(`/${J}`))return J;return null},os=(Q)=>Q.filter((X)=>!X.startsWith("-")),rs=(Q)=>Q.filter((X)=>X.startsWith("-")),r0=(Q,...X)=>X.some((Y)=>Q.includes(Y)),is=({subArgs:Q,positional:X})=>{if(r0(Q,"--global","--system"))return c("git-config-global","Modifying global / system git config is off-limits \u2014 that is your personal identity. Read-only `git config --get` is fine.");if(!r0(Q,"--get","-l","--list","--get-all","--get-regexp")&&X.length>=2)return c("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return v("bash-git")},ns=({subArgs:Q})=>{if(r0(Q,"--cached"))return v("bash-git");return G1("git-rm","`git rm <path>` removes from the index AND the working tree. To untrack-only, use `git rm --cached <path>`. To delete the file separately, use `trash` / `rip`. Confirm intent.")},as=({subArgs:Q,positional:X})=>{if(r0(Q,"--staged","-S")&&!r0(Q,"--worktree","-W"))return v("bash-git");if(X.length>0)return c("git-restore-discard","`git restore <path>` discards uncommitted changes in the working tree. Refuse \u2014 `git diff <path>` to inspect first, or `git stash push <path>` to preserve.");return v("bash-git")},ss=({subArgs:Q,positional:X})=>{if(r0(Q,"-b","-B"))return v("bash-git");if(r0(Q,"-f","--force"))return c("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(Q.includes("--"))return c("git-checkout-discard","`git checkout -- <path>` discards uncommitted working-tree changes. Refuse \u2014 use `git stash push <path>` to preserve, or `git diff <path>` to inspect first.");if(X.length===1&&(X[0]==="."||X[0].startsWith("./")))return c("git-checkout-discard-all","`git checkout .` discards ALL uncommitted working-tree changes. Refuse \u2014 `git stash` to preserve, or `git diff` to inspect first.");return v("bash-git")},ts=({subArgs:Q})=>{if(r0(Q,"-f","--force","--discard-changes"))return c("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return v("bash-git")},es=({subArgs:Q,flags:X,positional:Y})=>{if(r0(Q,"--hard"))return c("git-reset-hard","`git reset --hard` discards all uncommitted changes AND moves HEAD. Refuse \u2014 describe the intent in chat. If undoing a published commit, `git revert <sha>` is safer.");if(r0(Q,"--keep"))return G1("git-reset-keep","`git reset --keep` resets HEAD but preserves uncommitted local changes. Confirm intent.");if(Y.length===0&&X.length===0)return v("bash-git");return G1("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},Qt=({flags:Q})=>{if(Q.some((X)=>/^-[a-zA-Z]*[df]/.test(X)||X==="--force"))return c("git-clean-fd","`git clean -fd` deletes untracked files (often your in-progress work). Refuse \u2014 inspect with `git clean -dn` (dry run) first. If genuinely needed, append ` # tripwire-allow: <reason>`.");return v("bash-git")},Xt=({subArgs:Q,positional:X,config:Y})=>{if(r0(Q,"--abort","--quit","--continue","--skip","--edit-todo"))return v("bash-git");if(r0(Q,"-i","--interactive"))return c("git-rebase-interactive","`git rebase -i` rewrites history interactively. Refuse \u2014 too easy to lose commits in the agent loop. If this is genuinely required, do it manually outside the agent.");let $=X[0],J=PK(Y);if($!==void 0&&J.includes($))return G1("git-rebase-onto-protected",`Rebasing onto \`${$}\` rewrites history of the current branch. \`git merge ${$}\` is usually safer. Confirm intent.`);return G1("git-rebase","`git rebase` rewrites commit history. `git merge` is usually safer. Confirm intent.")},Yt=({subArgs:Q})=>{if(r0(Q,"--abort","--quit","--continue","--skip"))return v("bash-git");return G1("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},$t=({subArgs:Q})=>{if(r0(Q,"--abort","--continue","--quit"))return v("bash-git");return G1("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},Jt=({subArgs:Q,config:X,heredocBodies:Y})=>{if(r0(Q,"--amend"))return c("git-commit-amend","`git commit --amend` rewrites the last commit. If it has been pushed, this causes upstream divergence. Refuse \u2014 surface the intent.");let $=us(Q,Y),J=r0(Q,"-F","--file","-c","-C","--reuse-message","--reedit-message"),Z=r0(Q,"--no-edit");if($===null&&!J&&!Z)return c("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if($!==null&&X.enforceConventionalCommits!==!1&&!ds.test($))return c("git-commit-non-conventional",["Commit message must follow Conventional Commits format:"," `<type>(<scope>)?(!)?: <description>`","Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.","Examples:"," `fix(auth): handle expired token refresh`"," `feat: add bash-git rule`"," `chore: bump deps`",`Got: ${JSON.stringify($)}`].join(`
77
+ `));if(r0(Q,"-a","--all")||Q.some((G)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(G)))return G1("git-commit-auto-stage","`git commit -a / --all` auto-stages every tracked change. Explicit `git add <files>` first is usually clearer about what is being committed. Confirm.");return v("bash-git")},Zt=({subArgs:Q,flags:X,positional:Y,config:$})=>{if(X.some((Z)=>Z==="--force"||Z==="-f"||Z.startsWith("--force-with-lease")))return c("git-force-push","Force push is forbidden. If a branch needs to be reset upstream, surface the intent \u2014 there is almost always a non-force path.");if(r0(Q,"--delete","--mirror")||Q.some((Z)=>Z.startsWith(":")))return c("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let J=ls(Y,$);if(J!==null)return c("git-push-protected",`Refusing to push directly to protected branch \`${J}\`. Open a PR instead: \`gh pr create\`.`);return v("bash-git")},Gt=({subArgs:Q,flags:X,positional:Y,config:$})=>{let J=X.find((Z)=>Z==="-D"||Z==="-d"||Z==="--delete"||/^-[a-zA-Z]*D/.test(Z)||/^-[a-zA-Z]*d/.test(Z));if(J!==void 0){let Z=Y,G=PK($),W=Z.find((H)=>G.includes(H));if(W!==void 0)return c("git-branch-delete-protected",`Refusing to delete protected branch \`${W}\`.`);if(J==="-D"||J.includes("D"))return c("git-branch-force-delete",`\`git branch -D ${Z.join(" ")}\` force-deletes branches even if unmerged (potential data loss). To delete a merged branch, use \`-d\`. To force, append \` # tripwire-allow: <reason>\`.`);return G1("git-branch-delete",`\`git branch -d ${Z.join(" ")}\` deletes a branch (merged-only check). Confirm intent.`)}if(r0(Q,"-m","-M","--move"))return G1("git-branch-move","Renaming a branch can confuse pushed remotes. Confirm intent.");return v("bash-git")},Wt=({subArgs:Q})=>{if(r0(Q,"-d","--delete"))return c("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return v("bash-git")},Ht=({subArgs:Q})=>{let X=Q[0]??"push";if(X==="drop"||X==="clear")return c("git-stash-drop",`\`git stash ${X}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return v("bash-git")},Kt=({flags:Q})=>{if(Q.some((X)=>X.startsWith("--prune=")||X==="--aggressive"))return c("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return v("bash-git")},Vt=({subArgs:Q})=>{let X=Q[0];if(X==="add"||X==="remove"||X==="rm"||X==="set-url"||X==="rename")return G1("git-remote-mutate",`\`git remote ${X}\` changes which remote you're pushing to. Confirm \u2014 accidentally pointing at the wrong remote is high blast-radius.`);return v("bash-git")},jC=({subcommand:Q,subArgs:X})=>{let Y=X[0]??"";if(["add","remove","rm","deinit","sync","set-url"].includes(Y))return G1("git-submodule-worktree-mutate",`\`git ${Q} ${Y}\` modifies repo structure. Confirm intent.`);return v("bash-git")},_t=new Map([["config",is],["add",()=>v("bash-git")],["mv",()=>v("bash-git")],["rm",ns],["restore",as],["checkout",ss],["switch",ts],["reset",es],["clean",Qt],["rebase",Xt],["cherry-pick",Yt],["merge",$t],["commit",Jt],["push",Zt],["branch",Gt],["tag",Wt],["stash",Ht],["filter-branch",({subcommand:Q})=>c("git-filter",`\`git ${Q}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:Q})=>c("git-filter",`\`git ${Q}\` rewrites entire repo history. Refuse.`)],["gc",Kt],["update-ref",()=>c("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",Vt],["submodule",jC],["worktree",jC],["init",({subcommand:Q})=>h6(`git-${Q}`,`\`git ${Q}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)],["clone",({subcommand:Q})=>h6(`git-${Q}`,`\`git ${Q}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)]]),qt=(Q,X,Y)=>{let{subcommand:$,subArgs:J}=Q,Z=rs(J),G=os(J);if(new Set(["status","diff","log","show","blame","rev-parse","rev-list","ls-files","ls-tree","cat-file","reflog","describe","shortlog","whatchanged","archive","bundle","fsck","fetch","ls-remote","help","version","grep","name-rev","merge-base","symbolic-ref","check-ignore","count-objects","verify-commit","verify-tag"]).has($)){if($==="reflog"&&(J[0]==="expire"||r0(J,"--expire")))return c("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if($==="symbolic-ref"&&G.length>=2)return c("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return v("bash-git")}let H=_t.get($);if(H!==void 0)return H({subcommand:$,subArgs:J,flags:Z,positional:G,config:X,heredocBodies:Y});return h6("git-unknown-subcommand",`\`git ${$}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},TC=(Q,X,Y)=>{if(C1(X))return v("bash-git");let $=WC(X);for(let J of Q){let Z=cs(J);if(Z===null)continue;let G=qt(Z,Y,$);if(G!==null&&G.kind!=="allow")return G}return v("bash-git")};var Dt=new Set(["curl","wget","wget2","aria2c","xh"]),Ut=new Set(["bash","sh","zsh","fish"]),Bt=(Q)=>{for(let X=0;X<Q.length-1;X++){let Y=Q[X],$=Q[X+1];if(Dt.has(Y.head)&&Ut.has($.head))return!0}return!1},zt=[{head:"cargo",subcommand:"install",rule:"cargo-install",message:"Confirm before `cargo install <crate>`: this builds and installs arbitrary code from crates.io into ~/.cargo/bin globally."},{head:"go",subcommand:"install",rule:"go-install",message:"Confirm before `go install`: this fetches and installs arbitrary Go code globally."},{head:"gem",subcommand:"install",rule:"gem-install",message:"Confirm before `gem install`: pulls arbitrary code from rubygems.org."}],IC=(Q,X)=>{if(C1(X))return v("bash-network-install");if(Bt(Q))return c("curl-pipe-shell","Piping `curl` / `wget` directly into a shell runs whatever the remote URL serves. Refuse \u2014 download to a file, inspect, then run if appropriate. If you genuinely need this, append ` # tripwire-allow: <reason>` (and explain to the user what you're running).");for(let Y of Q)for(let $ of zt)if(Y.head===$.head&&Y.tokens[1]===$.subcommand)return G1($.rule,$.message);return v("bash-network-install")};var Ot=[{rule:"redirect-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:"Refusing to write into a .env file via shell redirect / tee / cp / mv. .env files hold secrets \u2014 never overwrite from a tool call."},{rule:"redirect-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refusing to write into .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"redirect-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refusing to write into ~/.ssh/ via shell."},{rule:"redirect-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refusing to overwrite a private-key-shaped file via shell."},{rule:"redirect-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refusing to write into ~/.aws/credentials via shell."},{rule:"redirect-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refusing to write into ~/.netrc via shell."},{rule:"redirect-block-device",pattern:/^\/dev\/(?<type>sd|disk|nvme|rdisk)/i,message:"Redirecting into a raw block device wipes the disk. Refuse."}],AK=(Q)=>{for(let X of Ot)if(X.pattern.test(Q))return c(X.rule,X.message);return null},EC=(Q,X)=>{if(C1(X))return v("bash-redirect");for(let Y of Q){for(let $ of Y.redirects)if($.op===">"||$.op===">>"){let J=AK($.target);if(J!==null)return J}if(Y.head==="tee")for(let $ of Y.args){let J=AK($);if(J!==null)return J}if(Y.head==="cp"||Y.head==="mv"){let $=Y.args.at(-1);if($!==void 0){let J=AK($);if(J!==null)return J}}}return v("bash-redirect")};var Ft=(Q,X)=>{let Y=!1,$=[];for(let G of Q.tokens.slice(1)){if(!Y&&G==="--"){Y=!0;continue}if(!Y&&G.startsWith("-")&&G!=="-")continue;$.push(G)}let J=X.relative??[],Z=X.absolute??[];return $.filter((G)=>!LK(G,J,Z))},Rt=(Q,X)=>{if(!Q.tokens.includes("-delete"))return null;let Y=[];for(let G of Q.tokens.slice(1)){if(G.startsWith("-"))break;Y.push(G)}let $=Y.length===0?["."]:Y,J=X.relative??[],Z=X.absolute??[];return $.filter((G)=>!LK(G,J,Z))},SC=(Q,X,Y)=>{if(C1(X))return v("bash-scoped-rm");let $=[];for(let W of Q){if(W.head==="rm"){let H=Ft(W,Y);if(H.length>0)$.push({kind:"rm",targets:H});continue}if(W.head==="find"){let H=Rt(W,Y);if(H!==null&&H.length>0)$.push({kind:"find -delete",targets:H})}}if($.length===0)return v("bash-scoped-rm");let J=Y.relative??[],Z=Y.absolute??[],G=$.map((W)=>` \u2022 ${W.kind} on: ${W.targets.map((H)=>JSON.stringify(H)).join(", ")}`).join(`
78
+ `);return c("destructive-outside-safe-paths",`Destructive deletion outside known-safe scopes is blocked. Use \`trash\` (macOS Trash, recoverable) or \`rip\` (graveyard at /tmp/graveyard-$USER, recoverable until reboot) instead. Real \`rm\` and \`find -delete\` are allowed only inside ephemeral build / cache / state directories:
79
+ ${_C(J,Z)}
80
80
 
81
81
  Flagged targets:
82
82
  ${G}
83
83
 
84
- If raw \`rm\` is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var bn=(Q)=>Q==="-x"||Q==="-xf"||Q==="-xzf"||Q==="-xjf"||Q==="-xJf"||Q==="-xvf"||Q==="-xvzf"||Q==="-xvjf"||Q==="--extract"||/^-[xvzjJtf]+$/.test(Q),gn=(Q)=>{for(let X=0;X<Q.tokens.length;X++){let Y=Q.tokens[X];if(Y==="-C"||Y==="--directory")return Q.tokens[X+1]??null;if(Y.startsWith("--directory="))return Y.slice(12)}return null},MA=(Q)=>{return Q==="/"||/^(?<home>~|\$HOME|\$\{HOME\})$/.test(Q)},AA=(Q,X)=>{if(q1(X))return I("bash-tar-explosion");for(let Y of Q){if(Y.head!=="tar")continue;if(!(Y.flags.some(bn)||Y.tokens.includes("--extract")))continue;let $=gn(Y);if($!==null&&MA($))return m("tar-extract-to-root",`tar -x with -C ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory (e.g. ./tmp/extract) and inspect before moving anything elsewhere.`)}for(let Y of Q){if(Y.head!=="unzip")continue;for(let J=0;J<Y.tokens.length;J++)if(Y.tokens[J]==="-d"){let $=Y.tokens[J+1];if($!==void 0&&MA($))return m("unzip-to-root",`unzip -d ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}}return I("bash-tar-explosion")};var hn=[{rule:"use-bun-not-npm",action:"deny",message:"Use `bun` instead of `npm`. Translations: `npm install` \u2192 `bun install`, `npm install <pkg>` \u2192 `bun add <pkg>`, `npm install -D <pkg>` \u2192 `bun add -d <pkg>`, `npm run X` \u2192 `bun run X` (or `bun X` for bin scripts), `npm test` \u2192 `bun test`. If you genuinely need npm (publishing to a registry that requires it, working in a different repo), append ` # tripwire-allow: <reason>` to the command.",fires:(Q)=>Q.head==="npm"},{rule:"use-bunx-not-npx",action:"deny",message:"Use `bunx` instead of `npx`. Same usage shape, faster, no implicit npm cache.",fires:(Q)=>Q.head==="npx"},{rule:"use-bun-not-pnpm",action:"deny",message:"Use `bun` instead of `pnpm`. The user is bun-only across their repos.",fires:(Q)=>Q.head==="pnpm"},{rule:"use-bun-not-yarn",action:"deny",message:"Use `bun` instead of `yarn`. The user is bun-only.",fires:(Q)=>Q.head==="yarn"},{rule:"use-uv-not-pip",action:"deny",message:"Use `uv` instead of `pip`. Translations: `pip install <pkg>` \u2192 `uv add <pkg>` (project dependency) or `uv pip install <pkg>` (env-only escape hatch). `pip freeze` \u2192 `uv pip freeze`. `pip list` \u2192 `uv pip list`. The user is uv-only across Python repos.",fires:(Q)=>Q.head==="pip"||Q.head==="pip3"},{rule:"use-uv-sync-not-venv",action:"deny",message:"`python -m venv` creates a bare venv; use `uv sync` instead. uv sync creates the venv AND installs from pyproject.toml + uv.lock in one atomic step. To activate: `source .venv/bin/activate` after.",fires:(Q)=>(Q.head==="python"||Q.head==="python3")&&Q.tokens.includes("-m")&&Q.tokens.includes("venv")},{rule:"uv-sync-over-uv-venv",action:"deny",message:"Use `uv sync` instead of `uv venv`. `uv venv` creates an empty venv that you then have to populate; `uv sync` creates the venv AND resolves+installs from pyproject.toml + uv.lock in one step. The only reason to use `uv venv` standalone is when there is no pyproject.toml \u2014 and in that case, `uv init` first.",fires:(Q)=>Q.head==="uv"&&Q.tokens[1]==="venv"},{rule:"use-bun-patch-not-patch-package",action:"deny",message:"Use `bun patch` instead of `patch-package`. Bun has built-in patch support that integrates with bun.lock; patch-package is npm-era and produces patches in a different format.",fires:(Q)=>Q.head==="patch-package"},{rule:"consider-fd",action:"warn",message:'Consider `fd` instead of `find`. Faster, simpler syntax, respects .gitignore by default. Examples: `find . -name "*.ts"` \u2192 `fd -e ts`, `find . -type f -name "X"` \u2192 `fd -t f X`, `find PATH ...` \u2192 `fd ... PATH`. The user has both installed; either works.',fires:(Q)=>Q.head==="find"},{rule:"consider-rg",action:"warn",message:'Consider `rg` (ripgrep) instead of `grep`. Faster; recurses by default; respects .gitignore by default (use `-u`/`-uu` to include ignored/hidden files); searches the CWD when no path is given. NOT a clean flag-for-flag swap; some flags differ or are unneeded. Carry over fine: `-i`, `-n`, `-v`, `-l`, `-c`. WATCH OUT: `-r` is NOT recursive in rg \u2014 it means `--replace` (rg already recurses), so `rg -rn "PATTERN" dir/` silently parses as `--replace=n` and rewrites every match to the literal "n" while exiting 0. Drop the `-r`: `grep -rn PATTERN .` \u2192 `rg -n PATTERN`. And `grep --include`/`--exclude` become `rg -g GLOB`/`-g !GLOB`.',fires:(Q)=>Q.head==="grep"||Q.head==="egrep"||Q.head==="fgrep"},{rule:"consider-btop",action:"warn",message:"Consider `btop` instead of `top`. Better UI, more info, modern.",fires:(Q)=>Q.head==="top"},{rule:"consider-dust",action:"warn",message:"Consider `dust` instead of `du -sh`. Sorted, colorful, faster.",fires:(Q)=>Q.head==="du"},{rule:"consider-duf",action:"warn",message:"Consider `duf` instead of `df -h`. Better formatting, more readable.",fires:(Q)=>Q.head==="df"},{rule:"consider-procs",action:"warn",message:"Consider `procs` instead of `ps aux`. Better filtering and output.",fires:(Q)=>Q.head==="ps"}],wA=(Q,X)=>{if(q1(X))return I("bash-tool-policy");for(let Y of Q)for(let J of hn)if(J.fires(Y))return J.action==="deny"?m(J.rule,J.message):J6(J.rule,J.message);return I("bash-tool-policy")};var mn="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",dn=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]]),CA=(Q)=>dn.get(Q)??Q,TA=(Q)=>{let X=Q.lastIndexOf("/");return X===-1?Q:Q.slice(X+1)},pn=(Q,X)=>Q.some((Y)=>Y===X||Y.startsWith(`${X}=`)),cn=(Q,X)=>{for(let Y=0;Y<Q.length;Y++){let J=Q[Y];if(J===X)return Q[Y+1]??"";if(J.startsWith(`${X}=`))return J.slice(X.length+1)}return null},fn=(Q)=>{let X=[],Y=Q.tokens.slice(1);for(let J=0;J<Y.length;J++){let $=Y[J];if($.startsWith("-")){if(!$.includes("=")&&Y[J+1]!==void 0&&!Y[J+1].startsWith("-"))J++;continue}X.push($)}return X},IA=(Q,X)=>{let Y=X.pattern,J=L9(Y);if(J.length===0)return!1;let $=J[0].tokens,Z=$[0];if(Z===void 0)return!1;let G=$.slice(1);for(let K of Q){if(TA(K.head)!==TA(Z))continue;if(G.length>0){let _=fn(K);if(!G.every((q,D)=>_[D]!==void 0&&CA(_[D])===CA(q)))continue}if((X.requiresFlags??[]).some((_)=>!pn(K.tokens,_)))continue;if(!(X.forbidsFlagValues??[]).every((_)=>{let V=cn(K.tokens,_.flag);return V!==null&&_.values.includes(V)}))continue;if(G.length===0&&X.requiresFlags===void 0&&X.forbidsFlagValues===void 0)return!0;return!0}return!1},jA=(Q,X,Y,J)=>{if(q1(X))return I("config-custom");for(let $ of J)if(IA(Q,$))return I("config-custom");for(let $ of Y)if(IA(Q,$)){let Z=$.message.includes("tripwire-allow")?$.message:`${$.message} ${mn}`;return $.action==="ask"?o0("config-custom",Z):m("config-custom",Z)}return I("config-custom")};var EA=require("fs"),SA=(Q,X)=>{let Y=new Set(Q.split(`
85
- `).map((J)=>J.trim()).filter((J)=>J.length>0));return X.split(`
86
- `).filter((J)=>J.trim().length>0).filter((J)=>!Y.has(J.trim()))},xA=(Q)=>{try{return EA.readFileSync(Q,"utf8")}catch{return""}};var un=[/\bTODO\s*:/i,/\bFIXME\s*:/i,/\bXXX\s*:/i,/\bHACK\s*:/i,/\bfor now\b/i,/\bnot implemented\b/i,/\bNotImplementedError\b/,/\btemp fix\b/i,/\bfallback\b/i,/\bplaceholder\b/i,/\bbackwards?[ -]?compat(?<ibility>ibility)?\b/i,/\bfor later\b/i,/\blater on\b/i,/\bget back to\b/i,/\bI'?ll fix\b/i,/\bto be implemented\b/i,/\bnot yet (?<state>implemented|done)\b/i,/\bstubbed\b/i],ln=/\.(?<ext>ts|tsx|js|jsx|mjs|cjs|py|rs|go|rb|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|zsh|bash|lua|ex|exs|clj|scala|dart)$/i,rn=/(?<prefix>^|\/)(?<dir>__tests__|tests?|spec|fixtures?|mocks?|__mocks__|stories)(?<suffix>\/|$)|\.(?<ext>test|spec|fixture|mock|stories)\.[^/]+$/i,on=/tripwire-allow\b/,nn=(Q)=>{if(on.test(Q))return!1;for(let X of un)if(X.test(Q))return!0;return!1},GW=(Q)=>{let X=Q.file_path;if(!ln.test(X)||rn.test(X))return I("lazy-code");let Y="content"in Q?Q.content:Q.new_string,J="content"in Q?xA(X):Q.old_string,$=[];for(let K of SA(J,Y))if(nn(K))$.push(K.slice(0,200));if($.length===0)return I("lazy-code");let Z=$.slice(0,3).map((K)=>` \u2022 ${K}`).join(`
87
- `),G=$.length>3?`
88
- \u2026and ${$.length-3} more`:"";return J6("lazy-code-marker",["Heads up: line(s) you just added contain words that often signal incomplete or deferred work. The write went through \u2014 this is a flag, not a block.","",'Why this exists: AI coding agents have a strong pull toward stubbing things, deferring "for now," and shipping half-built fallbacks instead of finishing the work in the same turn. The point of this warning is to push back on that pull on every iteration. If you stubbed something out for time, finish it this turn rather than leaving deferred work for later.',"",'If the marker is genuinely permanent \u2014 a real product term ("auth fallback flow", "retry fallback chain", an HTML input placeholder, a public API field literally named "placeholder"), a logging tag, or a comment intentionally left for a human reader \u2014 no action needed. To silence the flag on subsequent edits of that line, append `tripwire-allow: <one-line reason>` (any comment syntax: `//`, `#`, `--`, etc.).',"","Flagged additions:",Z+G].join(`
89
- `))};var vA=require("path");var an=[{pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,rule:"env-file",message:".env files hold secrets that should never be sent to the model. Refuse to write or edit. If an example is needed, create .env.example with redacted placeholders."},{pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,rule:"dev-vars",message:".dev.vars holds Cloudflare/Wrangler secrets. Do not modify."},{pattern:/(?<prefix>^|\/)\.ssh\//,rule:"ssh-dir",message:"Never write into ~/.ssh/. Refuse."},{pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)(?<pub>\.pub)?$/,rule:"ssh-key",message:"SSH key file. Refuse."},{pattern:/\.(?<ext>pem|key|p12|pfx)$/i,rule:"private-key",message:"Private key file. Refuse to overwrite. If generating a new key, use a different filename and let the user review."},{pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,rule:"secrets-file",message:"Secrets file. Refuse."},{pattern:/(?<prefix>^|\/)\.aws\/credentials$/,rule:"aws-credentials",message:"AWS credentials file. Refuse."},{pattern:/(?<prefix>^|\/)\.netrc$/,rule:"netrc",message:".netrc holds host credentials. Refuse."}],KW=(Q)=>{let X=vA.resolve(Q.file_path);for(let Y of an)if(Y.pattern.test(X))return m(Y.rule,Y.message);return I("path-protect")};var kA=require("child_process"),$6=require("fs"),yA=require("os"),o2=require("path"),sn="/opt/homebrew/bin/betterleaks",tn=(Q)=>{let X=new Map;for(let Y of Q)X.set(Y.RuleID,(X.get(Y.RuleID)??0)+1);return[...X.entries()].map(([Y,J])=>({rule:Y,count:J}))};var en=(Q,X)=>{let Y=Q,J=[...X].toSorted(($,Z)=>Z.Secret.length-$.Secret.length);for(let $ of J){if($.Secret==="")continue;Y=Y.replaceAll($.Secret,`[REDACTED:${$.RuleID}]`)}return Y},bA=(Q,X=5000)=>{if(Q.length===0)return{hits:[],redacted:Q};let Y=$6.mkdtempSync(o2.join(yA.tmpdir(),"tripwire-scan-")),J=o2.join(Y,"input"),$=o2.join(Y,"report.json");try{if($6.writeFileSync(J,Q),kA.spawnSync(sn,["detect","--no-git","--no-banner","--no-color","--report-format","json","--report-path",$,"--source",J,"--exit-code","0","--log-level","error"],{encoding:"utf8",timeout:X,maxBuffer:67108864}).error!==void 0)return{hits:[],redacted:Q};let G;try{let K=$6.readFileSync($,"utf8"),W=JSON.parse(K||"[]");G=Array.isArray(W)?W:[]}catch{return{hits:[],redacted:Q}}if(G.length===0)return{hits:[],redacted:Q};return{hits:tn(G),redacted:en(Q,G)}}finally{try{$6.rmSync(Y,{recursive:!0,force:!0})}catch{}}};var gA=(Q)=>{let X=qA(Q.toolName,Q.response);if(X.length===0)return I("post-secret-scrub");let{hits:Y,redacted:J}=bA(X);if(Y.length===0)return I("post-secret-scrub");let $=Y.map((Z)=>`${Z.rule}\xD7${Z.count}`).join(", ");return m("secrets-in-output",[`tripwire intercepted ${Y.length} secret pattern(s) in this tool's output (${$}). The original output was withheld so the secret never enters the model context. A redacted form is below \u2014 work from this, do not re-run the same command in a way that re-fetches the underlying secret.`,"","Redacted output:",J.slice(0,16000)+(J.length>16000?`
84
+ If raw \`rm\` is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var Nt=(Q)=>Q==="-x"||Q==="-xf"||Q==="-xzf"||Q==="-xjf"||Q==="-xJf"||Q==="-xvf"||Q==="-xvzf"||Q==="-xvjf"||Q==="--extract"||/^-[xvzjJtf]+$/.test(Q),Lt=(Q)=>{for(let X=0;X<Q.tokens.length;X++){let Y=Q.tokens[X];if(Y==="-C"||Y==="--directory")return Q.tokens[X+1]??null;if(Y.startsWith("--directory="))return Y.slice(12)}return null},vC=(Q)=>{return Q==="/"||/^(?<home>~|\$HOME|\$\{HOME\})$/.test(Q)},xC=(Q,X)=>{if(C1(X))return v("bash-tar-explosion");for(let Y of Q){if(Y.head!=="tar")continue;if(!(Y.flags.some(Nt)||Y.tokens.includes("--extract")))continue;let J=Lt(Y);if(J!==null&&vC(J))return c("tar-extract-to-root",`tar -x with -C ${J} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory (e.g. ./tmp/extract) and inspect before moving anything elsewhere.`)}for(let Y of Q){if(Y.head!=="unzip")continue;for(let $=0;$<Y.tokens.length;$++)if(Y.tokens[$]==="-d"){let J=Y.tokens[$+1];if(J!==void 0&&vC(J))return c("unzip-to-root",`unzip -d ${J} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}}return v("bash-tar-explosion")};var Mt=[{rule:"use-bun-not-npm",action:"deny",message:"Use `bun` instead of `npm`. Translations: `npm install` \u2192 `bun install`, `npm install <pkg>` \u2192 `bun add <pkg>`, `npm install -D <pkg>` \u2192 `bun add -d <pkg>`, `npm run X` \u2192 `bun run X` (or `bun X` for bin scripts), `npm test` \u2192 `bun test`. If you genuinely need npm (publishing to a registry that requires it, working in a different repo), append ` # tripwire-allow: <reason>` to the command.",fires:(Q)=>Q.head==="npm"},{rule:"use-bunx-not-npx",action:"deny",message:"Use `bunx` instead of `npx`. Same usage shape, faster, no implicit npm cache.",fires:(Q)=>Q.head==="npx"},{rule:"use-bun-not-pnpm",action:"deny",message:"Use `bun` instead of `pnpm`. The user is bun-only across their repos.",fires:(Q)=>Q.head==="pnpm"},{rule:"use-bun-not-yarn",action:"deny",message:"Use `bun` instead of `yarn`. The user is bun-only.",fires:(Q)=>Q.head==="yarn"},{rule:"use-uv-not-pip",action:"deny",message:"Use `uv` instead of `pip`. Translations: `pip install <pkg>` \u2192 `uv add <pkg>` (project dependency) or `uv pip install <pkg>` (env-only escape hatch). `pip freeze` \u2192 `uv pip freeze`. `pip list` \u2192 `uv pip list`. The user is uv-only across Python repos.",fires:(Q)=>Q.head==="pip"||Q.head==="pip3"},{rule:"use-uv-sync-not-venv",action:"deny",message:"`python -m venv` creates a bare venv; use `uv sync` instead. uv sync creates the venv AND installs from pyproject.toml + uv.lock in one atomic step. To activate: `source .venv/bin/activate` after.",fires:(Q)=>(Q.head==="python"||Q.head==="python3")&&Q.tokens.includes("-m")&&Q.tokens.includes("venv")},{rule:"uv-sync-over-uv-venv",action:"deny",message:"Use `uv sync` instead of `uv venv`. `uv venv` creates an empty venv that you then have to populate; `uv sync` creates the venv AND resolves+installs from pyproject.toml + uv.lock in one step. The only reason to use `uv venv` standalone is when there is no pyproject.toml \u2014 and in that case, `uv init` first.",fires:(Q)=>Q.head==="uv"&&Q.tokens[1]==="venv"},{rule:"use-bun-patch-not-patch-package",action:"deny",message:"Use `bun patch` instead of `patch-package`. Bun has built-in patch support that integrates with bun.lock; patch-package is npm-era and produces patches in a different format.",fires:(Q)=>Q.head==="patch-package"},{rule:"consider-fd",action:"warn",message:'Consider `fd` instead of `find`. Faster, simpler syntax, respects .gitignore by default. Examples: `find . -name "*.ts"` \u2192 `fd -e ts`, `find . -type f -name "X"` \u2192 `fd -t f X`, `find PATH ...` \u2192 `fd ... PATH`. The user has both installed; either works.',fires:(Q)=>Q.head==="find"},{rule:"consider-rg",action:"warn",message:'Consider `rg` (ripgrep) instead of `grep`. Faster; recurses by default; respects .gitignore by default (use `-u`/`-uu` to include ignored/hidden files); searches the CWD when no path is given. NOT a clean flag-for-flag swap; some flags differ or are unneeded. Carry over fine: `-i`, `-n`, `-v`, `-l`, `-c`. WATCH OUT: `-r` is NOT recursive in rg, it means `--replace` (rg already recurses), so `rg -rn "PATTERN" dir/` silently parses as `--replace=n` and rewrites every match to the literal "n" while exiting 0. Drop the `-r`: `grep -rn PATTERN .` \u2192 `rg -n PATTERN`. And `grep --include`/`--exclude` become `rg -g GLOB`/`-g !GLOB`.',fires:(Q)=>Q.head==="grep"||Q.head==="egrep"||Q.head==="fgrep"},{rule:"rg-r-is-replace",action:"warn",message:'STOP \u2014 your rg output is probably mangled. `-r` in rg means `--replace`, NOT recursive, so any `-r{X}` flag combo silently rewrites every match to the literal string "{X}" and exits 0 with no error. ripgrep is always recursive by default \u2014 there is no `-r` for recursion. If you want to search: drop the `-r` entirely (`rg -rn PATTERN` \u2192 `rg -n PATTERN`). If you genuinely want text substitution: use `--replace` explicitly.',fires:(Q)=>{if(Q.head!=="rg")return!1;return Q.flags.some((X)=>X.startsWith("-")&&!X.startsWith("--")&&X.includes("r"))}},{rule:"consider-btop",action:"warn",message:"Consider `btop` instead of `top`. Better UI, more info, modern.",fires:(Q)=>Q.head==="top"},{rule:"consider-dust",action:"warn",message:"Consider `dust` instead of `du -sh`. Sorted, colorful, faster.",fires:(Q)=>Q.head==="du"},{rule:"consider-duf",action:"warn",message:"Consider `duf` instead of `df -h`. Better formatting, more readable.",fires:(Q)=>Q.head==="df"},{rule:"consider-procs",action:"warn",message:"Consider `procs` instead of `ps aux`. Better filtering and output.",fires:(Q)=>Q.head==="ps"}],bC=(Q,X)=>{if(C1(X))return v("bash-tool-policy");for(let Y of Q)for(let $ of Mt)if($.fires(Y))return $.action==="deny"?c($.rule,$.message):h6($.rule,$.message);return v("bash-tool-policy")};var wt="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",Pt=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]]),kC=(Q)=>Pt.get(Q)??Q,yC=(Q)=>{let X=Q.lastIndexOf("/");return X===-1?Q:Q.slice(X+1)},At=(Q,X)=>Q.some((Y)=>Y===X||Y.startsWith(`${X}=`)),Ct=(Q,X)=>{for(let Y=0;Y<Q.length;Y++){let $=Q[Y];if($===X)return Q[Y+1]??"";if($.startsWith(`${X}=`))return $.slice(X.length+1)}return null},jt=(Q)=>{let X=[],Y=Q.tokens.slice(1);for(let $=0;$<Y.length;$++){let J=Y[$];if(J.startsWith("-")){if(!J.includes("=")&&Y[$+1]!==void 0&&!Y[$+1].startsWith("-"))$++;continue}X.push(J)}return X},gC=(Q,X)=>{let Y=X.pattern,$=QQ(Y);if($.length===0)return!1;let J=$[0].tokens,Z=J[0];if(Z===void 0)return!1;let G=J.slice(1);for(let W of Q){if(yC(W.head)!==yC(Z))continue;if(G.length>0){let V=jt(W);if(!G.every((q,D)=>V[D]!==void 0&&kC(V[D])===kC(q)))continue}if((X.requiresFlags??[]).some((V)=>!At(W.tokens,V)))continue;if(!(X.forbidsFlagValues??[]).every((V)=>{let _=Ct(W.tokens,V.flag);return _!==null&&V.values.includes(_)}))continue;if(G.length===0&&X.requiresFlags===void 0&&X.forbidsFlagValues===void 0)return!0;return!0}return!1},hC=(Q,X,Y,$)=>{if(C1(X))return v("config-custom");for(let J of $)if(gC(Q,J))return v("config-custom");for(let J of Y)if(gC(Q,J)){let Z=J.message.includes("tripwire-allow")?J.message:`${J.message} ${wt}`;return J.action==="ask"?G1("config-custom",Z):c("config-custom",Z)}return v("config-custom")};var mC=require("fs"),dC=(Q,X)=>{let Y=new Set(Q.split(`
85
+ `).map(($)=>$.trim()).filter(($)=>$.length>0));return X.split(`
86
+ `).filter(($)=>$.trim().length>0).filter(($)=>!Y.has($.trim()))},pC=(Q)=>{try{return mC.readFileSync(Q,"utf8")}catch{return""}};var Tt=[/\bTODO\s*:/i,/\bFIXME\s*:/i,/\bXXX\s*:/i,/\bHACK\s*:/i,/\bfor now\b/i,/\bnot implemented\b/i,/\bNotImplementedError\b/,/\btemp fix\b/i,/\bfallback\b/i,/\bplaceholder\b/i,/\bbackwards?[ -]?compat(?<ibility>ibility)?\b/i,/\bfor later\b/i,/\blater on\b/i,/\bget back to\b/i,/\bI'?ll fix\b/i,/\bto be implemented\b/i,/\bnot yet (?<state>implemented|done)\b/i,/\bstubbed\b/i],It=/\.(?<ext>ts|tsx|js|jsx|mjs|cjs|py|rs|go|rb|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|zsh|bash|lua|ex|exs|clj|scala|dart)$/i,Et=/(?<prefix>^|\/)(?<dir>__tests__|tests?|spec|fixtures?|mocks?|__mocks__|stories)(?<suffix>\/|$)|\.(?<ext>test|spec|fixture|mock|stories)\.[^/]+$/i,St=/tripwire-allow\b/,vt=(Q)=>{if(St.test(Q))return!1;for(let X of Tt)if(X.test(Q))return!0;return!1},CK=(Q)=>{let X=Q.file_path;if(!It.test(X)||Et.test(X))return v("lazy-code");let Y="content"in Q?Q.content:Q.new_string,$="content"in Q?pC(X):Q.old_string,J=[];for(let W of dC($,Y))if(vt(W))J.push(W.slice(0,200));if(J.length===0)return v("lazy-code");let Z=J.slice(0,3).map((W)=>` \u2022 ${W}`).join(`
87
+ `),G=J.length>3?`
88
+ \u2026and ${J.length-3} more`:"";return h6("lazy-code-marker",["Heads up: line(s) you just added contain words that often signal incomplete or deferred work. The write went through \u2014 this is a flag, not a block.","",'Why this exists: AI coding agents have a strong pull toward stubbing things, deferring "for now," and shipping half-built fallbacks instead of finishing the work in the same turn. The point of this warning is to push back on that pull on every iteration. If you stubbed something out for time, finish it this turn rather than leaving deferred work for later.',"",'If the marker is genuinely permanent \u2014 a real product term ("auth fallback flow", "retry fallback chain", an HTML input placeholder, a public API field literally named "placeholder"), a logging tag, or a comment intentionally left for a human reader \u2014 no action needed. To silence the flag on subsequent edits of that line, append `tripwire-allow: <one-line reason>` (any comment syntax: `//`, `#`, `--`, etc.).',"","Flagged additions:",Z+G].join(`
89
+ `))};var fC=require("path");var xt=[{pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,rule:"env-file",message:".env files hold secrets that should never be sent to the model. Refuse to write or edit. If an example is needed, create .env.example with redacted placeholders."},{pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,rule:"dev-vars",message:".dev.vars holds Cloudflare/Wrangler secrets. Do not modify."},{pattern:/(?<prefix>^|\/)\.ssh\//,rule:"ssh-dir",message:"Never write into ~/.ssh/. Refuse."},{pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)(?<pub>\.pub)?$/,rule:"ssh-key",message:"SSH key file. Refuse."},{pattern:/\.(?<ext>pem|key|p12|pfx)$/i,rule:"private-key",message:"Private key file. Refuse to overwrite. If generating a new key, use a different filename and let the user review."},{pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,rule:"secrets-file",message:"Secrets file. Refuse."},{pattern:/(?<prefix>^|\/)\.aws\/credentials$/,rule:"aws-credentials",message:"AWS credentials file. Refuse."},{pattern:/(?<prefix>^|\/)\.netrc$/,rule:"netrc",message:".netrc holds host credentials. Refuse."}],jK=(Q)=>{let X=fC.resolve(Q.file_path);for(let Y of xt)if(Y.pattern.test(X))return c(Y.rule,Y.message);return v("path-protect")};var cC=require("child_process"),m6=require("fs"),uC=require("os"),o3=require("path"),bt="/opt/homebrew/bin/betterleaks",kt=(Q)=>{let X=new Map;for(let Y of Q)X.set(Y.RuleID,(X.get(Y.RuleID)??0)+1);return[...X.entries()].map(([Y,$])=>({rule:Y,count:$}))};var yt=(Q,X)=>{let Y=Q,$=[...X].toSorted((J,Z)=>Z.Secret.length-J.Secret.length);for(let J of $){if(J.Secret==="")continue;Y=Y.replaceAll(J.Secret,`[REDACTED:${J.RuleID}]`)}return Y},lC=(Q,X=5000)=>{if(Q.length===0)return{hits:[],redacted:Q};let Y=m6.mkdtempSync(o3.join(uC.tmpdir(),"tripwire-scan-")),$=o3.join(Y,"input"),J=o3.join(Y,"report.json");try{if(m6.writeFileSync($,Q),cC.spawnSync(bt,["detect","--no-git","--no-banner","--no-color","--report-format","json","--report-path",J,"--source",$,"--exit-code","0","--log-level","error"],{encoding:"utf8",timeout:X,maxBuffer:67108864}).error!==void 0)return{hits:[],redacted:Q};let G;try{let W=m6.readFileSync(J,"utf8"),H=JSON.parse(W||"[]");G=Array.isArray(H)?H:[]}catch{return{hits:[],redacted:Q}}if(G.length===0)return{hits:[],redacted:Q};return{hits:kt(G),redacted:yt(Q,G)}}finally{try{m6.rmSync(Y,{recursive:!0,force:!0})}catch{}}};var oC=(Q)=>{let X=LC(Q.toolName,Q.response);if(X.length===0)return v("post-secret-scrub");let{hits:Y,redacted:$}=lC(X);if(Y.length===0)return v("post-secret-scrub");let J=Y.map((Z)=>`${Z.rule}\xD7${Z.count}`).join(", ");return c("secrets-in-output",[`tripwire intercepted ${Y.length} secret pattern(s) in this tool's output (${J}). The original output was withheld so the secret never enters the model context. A redacted form is below \u2014 work from this, do not re-run the same command in a way that re-fetches the underlying secret.`,"","Redacted output:",$.slice(0,16000)+($.length>16000?`
90
90
  \u2026[truncated]`:"")].join(`
91
- `))};var hA=require("path");var Qi=[{rule:"read-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:".env files hold secrets that should never enter the model context. Refuse to read. If the goal is documenting required env vars, look at .env.example or describe the schema from memory."},{rule:"read-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refuse to read .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"read-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refuse to read files inside ~/.ssh/."},{rule:"read-ssh-key",pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)$/,message:"Refuse to read SSH private key files."},{rule:"read-private-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refuse to read private-key-shaped files."},{rule:"read-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refuse to read ~/.aws/credentials."},{rule:"read-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refuse to read ~/.netrc (host credentials)."},{rule:"read-secrets-file",pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,message:"Refuse to read a file named secrets.{json,yaml,toml,env}."}],mA=(Q)=>{let X=hA.resolve(Q.file_path);for(let Y of Qi)if(Y.pattern.test(X))return m(Y.rule,Y.message);return I("read-protect")};var Xi=async()=>{let Q=[];for await(let X of process.stdin)Q.push(X);return Buffer.concat(Q).toString("utf8")},Z6=()=>{process.stdout.write(`{"continue": true}
92
- `)},Yi=(Q)=>Q.turn_id!==void 0,pA=(Q,X)=>{let Y=Q.hook_event_name,J=`[tripwire:${X.rule}] ${X.message}`;if(Yi(Q)){process.stdout.write(`${JSON.stringify({continue:!0,systemMessage:J})}
93
- `);return}let $={hookEventName:Y,additionalContext:J};process.stdout.write(`${JSON.stringify({continue:!0,hookSpecificOutput:$})}
94
- `)},dA=(Q,X)=>{let Y={hookSpecificOutput:{hookEventName:Q,permissionDecision:X.kind==="deny"?"deny":"ask",permissionDecisionReason:`[tripwire:${X.rule}] ${X.message}`}};process.stdout.write(`${JSON.stringify(Y)}
95
- `)},Ji=(Q)=>{let X={continue:!0,decision:"block",reason:`[tripwire:${Q.rule}] ${Q.message}`};process.stdout.write(`${JSON.stringify(X)}
96
- `)},VW=(Q)=>{let X=Q.toLowerCase();if(X==="bash"||X==="exec"||X==="shell"||X==="run_command")return"Bash";if(X==="read"||X==="read_file")return"Read";if(X==="write"||X==="write_file")return"Write";if(X==="edit"||X==="edit_file"||X==="multiedit"||X==="apply_patch")return"Edit";if(X==="webfetch"||X==="web_fetch"||X==="fetch")return"WebFetch";return Q},$i=(Q,X,Y)=>U0.gen(function*(){let J=yield*U0.exit(U0.try({try:X,catch:($)=>$}).pipe(U0.timeout(Y)));if(V8.isSuccess(J))return J.value;return MX(Q,L1.pretty(J.cause)),I(Q)}),cA=(Q,X,Y)=>{let J=[];if(Q==="Bash"&&WA(X)){let G=X,K=L9(G.command);return J.push({name:"bash-deny",fn:()=>zA(K,G.command)}),J.push({name:"bash-git",fn:()=>LA(K,G.command,Y.git??{enforceConventionalCommits:!0})}),J.push({name:"bash-scoped-rm",fn:()=>NA(K,G.command,Y.safePaths??{})}),J.push({name:"bash-redirect",fn:()=>RA(K,G.command)}),J.push({name:"bash-network-install",fn:()=>PA(K,G.command)}),J.push({name:"bash-tar-explosion",fn:()=>AA(K,G.command)}),J.push({name:"bash-tool-policy",fn:()=>wA(K,G.command)}),J.push({name:"config-custom",fn:()=>jA(K,G.command,Y.blockedCommands??[],Y.allowedCommands??[])}),J}if(Q==="Read"&&_A(X)){let G=X;return J.push({name:"read-protect",fn:()=>mA(G)}),J}let $=(Q==="Edit"||Q==="MultiEdit")&&HA(X),Z=Q==="Write"&&VA(X);if($){let G=X;J.push({name:"path-protect",fn:()=>KW(G)}),J.push({name:"lazy-code",fn:()=>GW(G)})}else if(Z){let G=X;J.push({name:"path-protect",fn:()=>KW(G)}),J.push({name:"lazy-code",fn:()=>GW(G)})}return J},fA=(Q,X)=>{if(Q==="Bash"||Q==="Read"||Q==="WebFetch")return[{name:"post-secret-scrub",fn:()=>gA({toolName:Q,response:X})}];return[]},Zi=(Q,X)=>U0.gen(function*(){if(Q.length===0)return I("no-rules");let Y=[];for(let J of Q)Y.push(yield*$i(J.name,J.fn,X));return NX(Y)}),WW=(Q)=>{if(Q.length===0)return I("no-rules");return NX(Q.map((X)=>X.fn()))},HW=(Q,X=J5())=>{let Y=JW(X),J=VW(Q.tool_name??"");if(Q.hook_event_name==="PreToolUse")return WW(cA(J,Q.tool_input,Y));if(Q.hook_event_name==="PostToolUse")return WW(fA(J,Q.tool_response));return I("no-rules")},Gi=(Q,X,Y)=>{if(X.kind==="warn"){pA(Q,X);return}Z6()},Ki=(Q,X,Y)=>{let J=Q.hook_event_name,$=VW(Q.tool_name??"");if(J==="PreToolUse"&&$==="Bash"){Gi(Q,X,Y);return}if(X.kind==="warn"){pA(Q,X);return}Z6()},Wi=(Q)=>`tripwire config at ${YW} failed to load, so ALL custom safety policy is inactive. Failing closed until it is fixed. Fix the JSON, then this clears on the next `+`call (the shim daemon caches config at warm \u2014 restart it there). Error: ${Q}`,Hi=U0.gen(function*(){let Q=yield*ZA(),X=yield*U0.promise(Xi),Y=yield*U0.exit(U0.try({try:()=>JSON.parse(X),catch:(G)=>G}));if(V8.isFailure(Y)){MX("parse",L1.pretty(Y.cause)),Z6();return}let J=yield*U0.exit(E.decodeUnknownEffect(KA)(Y.value));if(V8.isFailure(J)){MX("decode",L1.pretty(J.cause)),Z6();return}let $=J.value;if(!Q.ok){if($.hook_event_name==="PreToolUse"){dA($.hook_event_name,m("config-error",Wi(Q.error)));return}Z6();return}let Z=Q.config;if($.hook_event_name==="PreToolUse"){let G=HW($,Z);if(G.kind==="deny"||G.kind==="ask"){dA($.hook_event_name,G);return}Ki($,G,Z);return}if($.hook_event_name==="PostToolUse"){let G=HW($,Z);if(G.kind==="deny"){Ji(G);return}Z6();return}Z6()}),Vi=Hi.pipe(U0.catchCause((Q)=>{return MX("dispatch-fatal",L1.pretty(Q)),Z6(),U0.void}));if(require.main==module)a7.runMain(Vi);})
91
+ `))};var rC=require("path");var gt=[{rule:"read-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:".env files hold secrets that should never enter the model context. Refuse to read. If the goal is documenting required env vars, look at .env.example or describe the schema from memory."},{rule:"read-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refuse to read .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"read-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refuse to read files inside ~/.ssh/."},{rule:"read-ssh-key",pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)$/,message:"Refuse to read SSH private key files."},{rule:"read-private-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refuse to read private-key-shaped files."},{rule:"read-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refuse to read ~/.aws/credentials."},{rule:"read-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refuse to read ~/.netrc (host credentials)."},{rule:"read-secrets-file",pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,message:"Refuse to read a file named secrets.{json,yaml,toml,env}."}],iC=(Q)=>{let X=rC.resolve(Q.file_path);for(let Y of gt)if(Y.pattern.test(X))return c(Y.rule,Y.message);return v("read-protect")};var ht=async()=>{let Q=[];for await(let X of process.stdin)Q.push(X);return Buffer.concat(Q).toString("utf8")},d6=()=>{process.stdout.write(`{"continue": true}
92
+ `)},mt=(Q)=>Q.turn_id!==void 0,aC=(Q,X)=>{let Y=Q.hook_event_name,$=`[tripwire:${X.rule}] ${X.message}`;if(mt(Q)){process.stdout.write(`${JSON.stringify({continue:!0,systemMessage:$})}
93
+ `);return}let J={hookEventName:Y,additionalContext:$};process.stdout.write(`${JSON.stringify({continue:!0,hookSpecificOutput:J})}
94
+ `)},nC=(Q,X)=>{let Y={hookSpecificOutput:{hookEventName:Q,permissionDecision:X.kind==="deny"?"deny":"ask",permissionDecisionReason:`[tripwire:${X.rule}] ${X.message}`}};process.stdout.write(`${JSON.stringify(Y)}
95
+ `)},dt=(Q)=>{let X={continue:!0,decision:"block",reason:`[tripwire:${Q.rule}] ${Q.message}`};process.stdout.write(`${JSON.stringify(X)}
96
+ `)},EK=(Q)=>{let X=Q.toLowerCase();if(X==="bash"||X==="exec"||X==="shell"||X==="run_command")return"Bash";if(X==="read"||X==="read_file")return"Read";if(X==="write"||X==="write_file")return"Write";if(X==="edit"||X==="edit_file"||X==="multiedit"||X==="apply_patch")return"Edit";if(X==="webfetch"||X==="web_fetch"||X==="fetch")return"WebFetch";return Q},pt=(Q,X,Y)=>w0.gen(function*(){let $=yield*w0.exit(w0.try({try:X,catch:(J)=>J}).pipe(w0.timeout(Y)));if(S8.isSuccess($))return $.value;return z7(Q,B1.pretty($.cause)),v(Q)}),sC=(Q,X,Y)=>{let $=[];if(Q==="Bash"&&OC(X)){let G=X,W=QQ(G.command);return $.push({name:"bash-deny",fn:()=>CC(W,G.command)}),$.push({name:"bash-git",fn:()=>TC(W,G.command,Y.git??{enforceConventionalCommits:!0})}),$.push({name:"bash-scoped-rm",fn:()=>SC(W,G.command,Y.safePaths??{})}),$.push({name:"bash-redirect",fn:()=>EC(W,G.command)}),$.push({name:"bash-network-install",fn:()=>IC(W,G.command)}),$.push({name:"bash-tar-explosion",fn:()=>xC(W,G.command)}),$.push({name:"bash-tool-policy",fn:()=>bC(W,G.command)}),$.push({name:"config-custom",fn:()=>hC(W,G.command,Y.blockedCommands??[],Y.allowedCommands??[])}),$}if(Q==="Read"&&NC(X)){let G=X;return $.push({name:"read-protect",fn:()=>iC(G)}),$}let J=(Q==="Edit"||Q==="MultiEdit")&&FC(X),Z=Q==="Write"&&RC(X);if(J){let G=X;$.push({name:"path-protect",fn:()=>jK(G)}),$.push({name:"lazy-code",fn:()=>CK(G)})}else if(Z){let G=X;$.push({name:"path-protect",fn:()=>jK(G)}),$.push({name:"lazy-code",fn:()=>CK(G)})}return $},tC=(Q,X)=>{if(Q==="Bash"||Q==="Read"||Q==="WebFetch")return[{name:"post-secret-scrub",fn:()=>oC({toolName:Q,response:X})}];return[]},ft=(Q,X)=>w0.gen(function*(){if(Q.length===0)return v("no-rules");let Y=[];for(let $ of Q)Y.push(yield*pt($.name,$.fn,X));return B7(Y)}),TK=(Q)=>{if(Q.length===0)return v("no-rules");return B7(Q.map((X)=>X.fn()))},IK=(Q,X=g9())=>{let Y=wK(X),$=EK(Q.tool_name??"");if(Q.hook_event_name==="PreToolUse")return TK(sC($,Q.tool_input,Y));if(Q.hook_event_name==="PostToolUse")return TK(tC($,Q.tool_response));return v("no-rules")},ct=(Q,X,Y)=>{if(X.kind==="warn"){aC(Q,X);return}d6()},ut=(Q,X,Y)=>{let $=Q.hook_event_name,J=EK(Q.tool_name??"");if($==="PreToolUse"&&J==="Bash"){ct(Q,X,Y);return}if(X.kind==="warn"){aC(Q,X);return}d6()},lt=(Q)=>`tripwire config at ${MK} failed to load, so ALL custom safety policy is inactive. Failing closed until it is fixed. Fix the JSON, then this clears on the next `+`call (the shim daemon caches config at warm \u2014 restart it there). Error: ${Q}`,ot=w0.gen(function*(){let Q=yield*UC(),X=yield*w0.promise(ht),Y=yield*w0.exit(w0.try({try:()=>JSON.parse(X),catch:(G)=>G}));if(S8.isFailure(Y)){z7("parse",B1.pretty(Y.cause)),d6();return}let $=yield*w0.exit(g.decodeUnknownEffect(zC)(Y.value));if(S8.isFailure($)){z7("decode",B1.pretty($.cause)),d6();return}let J=$.value;if(!Q.ok){if(J.hook_event_name==="PreToolUse"){nC(J.hook_event_name,c("config-error",lt(Q.error)));return}d6();return}let Z=Q.config;if(J.hook_event_name==="PreToolUse"){let G=IK(J,Z);if(G.kind==="deny"||G.kind==="ask"){nC(J.hook_event_name,G);return}ut(J,G,Z);return}if(J.hook_event_name==="PostToolUse"){let G=IK(J,Z);if(G.kind==="deny"){dt(G);return}d6();return}d6()}),rt=ot.pipe(w0.catchCause((Q)=>{return z7("dispatch-fatal",B1.pretty(Q)),d6(),w0.void}));if(require.main==module)pY.runMain(rt);})