@superglue/cli 1.1.107 → 1.1.108
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/.claude-plugin/plugin.json +1 -1
- package/dist/cli.js +14 -8
- package/dist/skills/superglue/SKILL.md +1 -0
- package/dist/skills/superglue/references/suitecloud.md +188 -0
- package/package.json +1 -1
- package/skills/superglue/SKILL.md +1 -0
- package/skills/superglue/references/suitecloud.md +188 -0
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var jU=Object.create;var Id=Object.defineProperty;var CU=Object.getOwnPropertyDescriptor;var SU=Object.getOwnPropertyNames;var BU=Object.getPrototypeOf,QU=Object.prototype.hasOwnProperty;var Pe=(o,e)=>()=>(o&&(e=o(o=0)),e);var f=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),mE=(o,e)=>{for(var t in e)Id(o,t,{get:e[t],enumerable:!0})},lE=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of SU(e))!QU.call(o,i)&&i!==t&&Id(o,i,{get:()=>e[i],enumerable:!(a=CU(e,i))||a.enumerable});return o};var pe=(o,e,t)=>(t=o!=null?jU(BU(o)):{},lE(e||!o||!o.__esModule?Id(t,"default",{value:o,enumerable:!0}):t,o)),Sy=o=>lE(Id({},"__esModule",{value:!0}),o);var hE=f((tje,pE)=>{"use strict";var uE=9007199254740991,_U="[object Arguments]",DU="[object Function]",TU="[object GeneratorFunction]",RU=/^(?:0|[1-9]\d*)$/;function NU(o,e){for(var t=-1,a=Array(o);++t<o;)a[t]=e(t);return a}function OU(o,e){return function(t){return o(e(t))}}var jd=Object.prototype,By=jd.hasOwnProperty,dE=jd.toString,UU=jd.propertyIsEnumerable,MU=OU(Object.keys,Object);function LU(o,e){var t=GU(o)||HU(o)?NU(o.length,String):[],a=t.length,i=!!a;for(var r in o)(e||By.call(o,r))&&!(i&&(r=="length"||FU(r,a)))&&t.push(r);return t}function PU(o){if(!$U(o))return MU(o);var e=[];for(var t in Object(o))By.call(o,t)&&t!="constructor"&&e.push(t);return e}function FU(o,e){return e=e??uE,!!e&&(typeof o=="number"||RU.test(o))&&o>-1&&o%1==0&&o<e}function $U(o){var e=o&&o.constructor,t=typeof e=="function"&&e.prototype||jd;return o===t}function HU(o){return VU(o)&&By.call(o,"callee")&&(!UU.call(o,"callee")||dE.call(o)==_U)}var GU=Array.isArray;function gE(o){return o!=null&&JU(o.length)&&!YU(o)}function VU(o){return ZU(o)&&gE(o)}function YU(o){var e=WU(o)?dE.call(o):"";return e==DU||e==TU}function JU(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=uE}function WU(o){var e=typeof o;return!!o&&(e=="object"||e=="function")}function ZU(o){return!!o&&typeof o=="object"}function KU(o){return gE(o)?LU(o):PU(o)}pE.exports=KU});var $E=f((Wm,ac)=>{"use strict";var XU=200,qE="__lodash_hash_undefined__",eM=800,oM=16,EE=9007199254740991,IE="[object Arguments]",tM="[object Array]",aM="[object AsyncFunction]",iM="[object Boolean]",rM="[object Date]",nM="[object Error]",jE="[object Function]",sM="[object GeneratorFunction]",cM="[object Map]",mM="[object Number]",lM="[object Null]",CE="[object Object]",uM="[object Proxy]",dM="[object RegExp]",gM="[object Set]",pM="[object String]",hM="[object Undefined]",fM="[object WeakMap]",bM="[object ArrayBuffer]",yM="[object DataView]",kM="[object Float32Array]",AM="[object Float64Array]",vM="[object Int8Array]",wM="[object Int16Array]",xM="[object Int32Array]",zM="[object Uint8Array]",qM="[object Uint8ClampedArray]",EM="[object Uint16Array]",IM="[object Uint32Array]",jM=/[\\^$.*+?()[\]{}|]/g,CM=/^\[object .+?Constructor\]$/,SM=/^(?:0|[1-9]\d*)$/,Ve={};Ve[kM]=Ve[AM]=Ve[vM]=Ve[wM]=Ve[xM]=Ve[zM]=Ve[qM]=Ve[EM]=Ve[IM]=!0;Ve[IE]=Ve[tM]=Ve[bM]=Ve[iM]=Ve[yM]=Ve[rM]=Ve[nM]=Ve[jE]=Ve[cM]=Ve[mM]=Ve[CE]=Ve[dM]=Ve[gM]=Ve[pM]=Ve[fM]=!1;var SE=typeof global=="object"&&global&&global.Object===Object&&global,BM=typeof self=="object"&&self&&self.Object===Object&&self,Xm=SE||BM||Function("return this")(),BE=typeof Wm=="object"&&Wm&&!Wm.nodeType&&Wm,Zm=BE&&typeof ac=="object"&&ac&&!ac.nodeType&&ac,QE=Zm&&Zm.exports===BE,Qy=QE&&SE.process,fE=(function(){try{var o=Zm&&Zm.require&&Zm.require("util").types;return o||Qy&&Qy.binding&&Qy.binding("util")}catch{}})(),bE=fE&&fE.isTypedArray;function QM(o,e,t){switch(t.length){case 0:return o.call(e);case 1:return o.call(e,t[0]);case 2:return o.call(e,t[0],t[1]);case 3:return o.call(e,t[0],t[1],t[2])}return o.apply(e,t)}function _M(o,e){for(var t=-1,a=Array(o);++t<o;)a[t]=e(t);return a}function DM(o){return function(e){return o(e)}}function TM(o,e){return o?.[e]}function RM(o,e){return function(t){return o(e(t))}}var NM=Array.prototype,OM=Function.prototype,Bd=Object.prototype,_y=Xm["__core-js_shared__"],Qd=OM.toString,mr=Bd.hasOwnProperty,yE=(function(){var o=/[^.]+$/.exec(_y&&_y.keys&&_y.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),_E=Bd.toString,UM=Qd.call(Object),MM=RegExp("^"+Qd.call(mr).replace(jM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cd=QE?Xm.Buffer:void 0,kE=Xm.Symbol,AE=Xm.Uint8Array,vE=Cd?Cd.allocUnsafe:void 0,DE=RM(Object.getPrototypeOf,Object),wE=Object.create,LM=Bd.propertyIsEnumerable,PM=NM.splice,Yn=kE?kE.toStringTag:void 0,Sd=(function(){try{var o=Uy(Object,"defineProperty");return o({},"",{}),o}catch{}})(),FM=Cd?Cd.isBuffer:void 0,xE=Math.max,$M=Date.now,TE=Uy(Xm,"Map"),Km=Uy(Object,"create"),HM=(function(){function o(){}return function(e){if(!Wn(e))return{};if(wE)return wE(e);o.prototype=e;var t=new o;return o.prototype=void 0,t}})();function Jn(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function GM(){this.__data__=Km?Km(null):{},this.size=0}function VM(o){var e=this.has(o)&&delete this.__data__[o];return this.size-=e?1:0,e}function YM(o){var e=this.__data__;if(Km){var t=e[o];return t===qE?void 0:t}return mr.call(e,o)?e[o]:void 0}function JM(o){var e=this.__data__;return Km?e[o]!==void 0:mr.call(e,o)}function WM(o,e){var t=this.__data__;return this.size+=this.has(o)?0:1,t[o]=Km&&e===void 0?qE:e,this}Jn.prototype.clear=GM;Jn.prototype.delete=VM;Jn.prototype.get=YM;Jn.prototype.has=JM;Jn.prototype.set=WM;function lr(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function ZM(){this.__data__=[],this.size=0}function KM(o){var e=this.__data__,t=_d(e,o);if(t<0)return!1;var a=e.length-1;return t==a?e.pop():PM.call(e,t,1),--this.size,!0}function XM(o){var e=this.__data__,t=_d(e,o);return t<0?void 0:e[t][1]}function eL(o){return _d(this.__data__,o)>-1}function oL(o,e){var t=this.__data__,a=_d(t,o);return a<0?(++this.size,t.push([o,e])):t[a][1]=e,this}lr.prototype.clear=ZM;lr.prototype.delete=KM;lr.prototype.get=XM;lr.prototype.has=eL;lr.prototype.set=oL;function ic(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function tL(){this.size=0,this.__data__={hash:new Jn,map:new(TE||lr),string:new Jn}}function aL(o){var e=Td(this,o).delete(o);return this.size-=e?1:0,e}function iL(o){return Td(this,o).get(o)}function rL(o){return Td(this,o).has(o)}function nL(o,e){var t=Td(this,o),a=t.size;return t.set(o,e),this.size+=t.size==a?0:1,this}ic.prototype.clear=tL;ic.prototype.delete=aL;ic.prototype.get=iL;ic.prototype.has=rL;ic.prototype.set=nL;function rc(o){var e=this.__data__=new lr(o);this.size=e.size}function sL(){this.__data__=new lr,this.size=0}function cL(o){var e=this.__data__,t=e.delete(o);return this.size=e.size,t}function mL(o){return this.__data__.get(o)}function lL(o){return this.__data__.has(o)}function uL(o,e){var t=this.__data__;if(t instanceof lr){var a=t.__data__;if(!TE||a.length<XU-1)return a.push([o,e]),this.size=++t.size,this;t=this.__data__=new ic(a)}return t.set(o,e),this.size=t.size,this}rc.prototype.clear=sL;rc.prototype.delete=cL;rc.prototype.get=mL;rc.prototype.has=lL;rc.prototype.set=uL;function dL(o,e){var t=Ny(o),a=!t&&Ry(o),i=!t&&!a&&UE(o),r=!t&&!a&&!i&&LE(o),n=t||a||i||r,s=n?_M(o.length,String):[],c=s.length;for(var m in o)(e||mr.call(o,m))&&!(n&&(m=="length"||i&&(m=="offset"||m=="parent")||r&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||NE(m,c)))&&s.push(m);return s}function Dy(o,e,t){(t!==void 0&&!Rd(o[e],t)||t===void 0&&!(e in o))&&Oy(o,e,t)}function gL(o,e,t){var a=o[e];(!(mr.call(o,e)&&Rd(a,t))||t===void 0&&!(e in o))&&Oy(o,e,t)}function _d(o,e){for(var t=o.length;t--;)if(Rd(o[t][0],e))return t;return-1}function Oy(o,e,t){e=="__proto__"&&Sd?Sd(o,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):o[e]=t}var pL=IL();function Dd(o){return o==null?o===void 0?hM:lM:Yn&&Yn in Object(o)?jL(o):DL(o)}function zE(o){return el(o)&&Dd(o)==IE}function hL(o){if(!Wn(o)||QL(o))return!1;var e=Ly(o)?MM:CM;return e.test(OL(o))}function fL(o){return el(o)&&ME(o.length)&&!!Ve[Dd(o)]}function bL(o){if(!Wn(o))return _L(o);var e=OE(o),t=[];for(var a in o)a=="constructor"&&(e||!mr.call(o,a))||t.push(a);return t}function RE(o,e,t,a,i){o!==e&&pL(e,function(r,n){if(i||(i=new rc),Wn(r))yL(o,e,n,t,RE,a,i);else{var s=a?a(Ty(o,n),r,n+"",o,e,i):void 0;s===void 0&&(s=r),Dy(o,n,s)}},PE)}function yL(o,e,t,a,i,r,n){var s=Ty(o,t),c=Ty(e,t),m=n.get(c);if(m){Dy(o,t,m);return}var l=r?r(s,c,t+"",o,e,n):void 0,u=l===void 0;if(u){var d=Ny(c),g=!d&&UE(c),h=!d&&!g&&LE(c);l=c,d||g||h?Ny(s)?l=s:UL(s)?l=zL(s):g?(u=!1,l=vL(c,!0)):h?(u=!1,l=xL(c,!0)):l=[]:ML(c)||Ry(c)?(l=s,Ry(s)?l=LL(s):(!Wn(s)||Ly(s))&&(l=CL(c))):u=!1}u&&(n.set(c,l),i(l,c,a,r,n),n.delete(c)),Dy(o,t,l)}function kL(o,e){return RL(TL(o,e,FE),o+"")}var AL=Sd?function(o,e){return Sd(o,"toString",{configurable:!0,enumerable:!1,value:FL(e),writable:!0})}:FE;function vL(o,e){if(e)return o.slice();var t=o.length,a=vE?vE(t):new o.constructor(t);return o.copy(a),a}function wL(o){var e=new o.constructor(o.byteLength);return new AE(e).set(new AE(o)),e}function xL(o,e){var t=e?wL(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.length)}function zL(o,e){var t=-1,a=o.length;for(e||(e=Array(a));++t<a;)e[t]=o[t];return e}function qL(o,e,t,a){var i=!t;t||(t={});for(var r=-1,n=e.length;++r<n;){var s=e[r],c=a?a(t[s],o[s],s,t,o):void 0;c===void 0&&(c=o[s]),i?Oy(t,s,c):gL(t,s,c)}return t}function EL(o){return kL(function(e,t){var a=-1,i=t.length,r=i>1?t[i-1]:void 0,n=i>2?t[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,n&&SL(t[0],t[1],n)&&(r=i<3?void 0:r,i=1),e=Object(e);++a<i;){var s=t[a];s&&o(e,s,a,r)}return e})}function IL(o){return function(e,t,a){for(var i=-1,r=Object(e),n=a(e),s=n.length;s--;){var c=n[o?s:++i];if(t(r[c],c,r)===!1)break}return e}}function Td(o,e){var t=o.__data__;return BL(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Uy(o,e){var t=TM(o,e);return hL(t)?t:void 0}function jL(o){var e=mr.call(o,Yn),t=o[Yn];try{o[Yn]=void 0;var a=!0}catch{}var i=_E.call(o);return a&&(e?o[Yn]=t:delete o[Yn]),i}function CL(o){return typeof o.constructor=="function"&&!OE(o)?HM(DE(o)):{}}function NE(o,e){var t=typeof o;return e=e??EE,!!e&&(t=="number"||t!="symbol"&&SM.test(o))&&o>-1&&o%1==0&&o<e}function SL(o,e,t){if(!Wn(t))return!1;var a=typeof e;return(a=="number"?My(t)&&NE(e,t.length):a=="string"&&e in t)?Rd(t[e],o):!1}function BL(o){var e=typeof o;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?o!=="__proto__":o===null}function QL(o){return!!yE&&yE in o}function OE(o){var e=o&&o.constructor,t=typeof e=="function"&&e.prototype||Bd;return o===t}function _L(o){var e=[];if(o!=null)for(var t in Object(o))e.push(t);return e}function DL(o){return _E.call(o)}function TL(o,e,t){return e=xE(e===void 0?o.length-1:e,0),function(){for(var a=arguments,i=-1,r=xE(a.length-e,0),n=Array(r);++i<r;)n[i]=a[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=a[i];return s[e]=t(n),QM(o,this,s)}}function Ty(o,e){if(!(e==="constructor"&&typeof o[e]=="function")&&e!="__proto__")return o[e]}var RL=NL(AL);function NL(o){var e=0,t=0;return function(){var a=$M(),i=oM-(a-t);if(t=a,i>0){if(++e>=eM)return arguments[0]}else e=0;return o.apply(void 0,arguments)}}function OL(o){if(o!=null){try{return Qd.call(o)}catch{}try{return o+""}catch{}}return""}function Rd(o,e){return o===e||o!==o&&e!==e}var Ry=zE((function(){return arguments})())?zE:function(o){return el(o)&&mr.call(o,"callee")&&!LM.call(o,"callee")},Ny=Array.isArray;function My(o){return o!=null&&ME(o.length)&&!Ly(o)}function UL(o){return el(o)&&My(o)}var UE=FM||$L;function Ly(o){if(!Wn(o))return!1;var e=Dd(o);return e==jE||e==sM||e==aM||e==uM}function ME(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=EE}function Wn(o){var e=typeof o;return o!=null&&(e=="object"||e=="function")}function el(o){return o!=null&&typeof o=="object"}function ML(o){if(!el(o)||Dd(o)!=CE)return!1;var e=DE(o);if(e===null)return!0;var t=mr.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Qd.call(t)==UM}var LE=bE?DM(bE):fL;function LL(o){return qL(o,PE(o))}function PE(o){return My(o)?dL(o,!0):bL(o)}var PL=EL(function(o,e,t){RE(o,e,t)});function FL(o){return function(){return o}}function FE(o){return o}function $L(){return!1}ac.exports=PL});var i1=f((aje,a1)=>{"use strict";var YE=200,$y="__lodash_hash_undefined__",HL=1/0,GL=9007199254740991,VL="[object Function]",YL="[object GeneratorFunction]",JL=/[\\^$.*+?()[\]{}|]/g,WL=/^\[object .+?Constructor\]$/,ZL=typeof global=="object"&&global&&global.Object===Object&&global,KL=typeof self=="object"&&self&&self.Object===Object&&self,Hy=ZL||KL||Function("return this")();function XL(o,e,t){switch(t.length){case 0:return o.call(e);case 1:return o.call(e,t[0]);case 2:return o.call(e,t[0],t[1]);case 3:return o.call(e,t[0],t[1],t[2])}return o.apply(e,t)}function eP(o,e){for(var t=-1,a=o?o.length:0,i=0,r=[];++t<a;){var n=o[t];e(n,t,o)&&(r[i++]=n)}return r}function JE(o,e){var t=o?o.length:0;return!!t&&iP(o,e,0)>-1}function WE(o,e,t){for(var a=-1,i=o?o.length:0;++a<i;)if(t(e,o[a]))return!0;return!1}function oP(o,e){for(var t=-1,a=o?o.length:0,i=Array(a);++t<a;)i[t]=e(o[t],t,o);return i}function tP(o,e){for(var t=-1,a=e.length,i=o.length;++t<a;)o[i+t]=e[t];return o}function aP(o,e,t,a){for(var i=o.length,r=t+(a?1:-1);a?r--:++r<i;)if(e(o[r],r,o))return r;return-1}function iP(o,e,t){if(e!==e)return aP(o,rP,t);for(var a=t-1,i=o.length;++a<i;)if(o[a]===e)return a;return-1}function rP(o){return o!==o}function nP(o){return function(e){return o(e)}}function ZE(o,e){return o.has(e)}function sP(o,e){return o?.[e]}function cP(o){var e=!1;if(o!=null&&typeof o.toString!="function")try{e=!!(o+"")}catch{}return e}function KE(o){var e=-1,t=Array(o.size);return o.forEach(function(a){t[++e]=a}),t}var mP=Array.prototype,lP=Function.prototype,XE=Object.prototype,Py=Hy["__core-js_shared__"],HE=(function(){var o=/[^.]+$/.exec(Py&&Py.keys&&Py.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),e1=lP.toString,Gy=XE.hasOwnProperty,uP=XE.toString,dP=RegExp("^"+e1.call(Gy).replace(JL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gP=mP.splice,GE=Math.max,pP=Vy(Hy,"Map"),Fy=Vy(Hy,"Set"),ol=Vy(Object,"create");function Zn(o){var e=-1,t=o?o.length:0;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function hP(){this.__data__=ol?ol(null):{}}function fP(o){return this.has(o)&&delete this.__data__[o]}function bP(o){var e=this.__data__;if(ol){var t=e[o];return t===$y?void 0:t}return Gy.call(e,o)?e[o]:void 0}function yP(o){var e=this.__data__;return ol?e[o]!==void 0:Gy.call(e,o)}function kP(o,e){var t=this.__data__;return t[o]=ol&&e===void 0?$y:e,this}Zn.prototype.clear=hP;Zn.prototype.delete=fP;Zn.prototype.get=bP;Zn.prototype.has=yP;Zn.prototype.set=kP;function nc(o){var e=-1,t=o?o.length:0;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function AP(){this.__data__=[]}function vP(o){var e=this.__data__,t=Nd(e,o);if(t<0)return!1;var a=e.length-1;return t==a?e.pop():gP.call(e,t,1),!0}function wP(o){var e=this.__data__,t=Nd(e,o);return t<0?void 0:e[t][1]}function xP(o){return Nd(this.__data__,o)>-1}function zP(o,e){var t=this.__data__,a=Nd(t,o);return a<0?t.push([o,e]):t[a][1]=e,this}nc.prototype.clear=AP;nc.prototype.delete=vP;nc.prototype.get=wP;nc.prototype.has=xP;nc.prototype.set=zP;function sc(o){var e=-1,t=o?o.length:0;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function qP(){this.__data__={hash:new Zn,map:new(pP||nc),string:new Zn}}function EP(o){return Od(this,o).delete(o)}function IP(o){return Od(this,o).get(o)}function jP(o){return Od(this,o).has(o)}function CP(o,e){return Od(this,o).set(o,e),this}sc.prototype.clear=qP;sc.prototype.delete=EP;sc.prototype.get=IP;sc.prototype.has=jP;sc.prototype.set=CP;function tl(o){var e=-1,t=o?o.length:0;for(this.__data__=new sc;++e<t;)this.add(o[e])}function SP(o){return this.__data__.set(o,$y),this}function BP(o){return this.__data__.has(o)}tl.prototype.add=tl.prototype.push=SP;tl.prototype.has=BP;function Nd(o,e){for(var t=o.length;t--;)if(LP(o[t][0],e))return t;return-1}function VE(o,e,t,a){var i=-1,r=JE,n=!0,s=o.length,c=[],m=e.length;if(!s)return c;t&&(e=oP(e,nP(t))),a?(r=WE,n=!1):e.length>=YE&&(r=ZE,n=!1,e=new tl(e));e:for(;++i<s;){var l=o[i],u=t?t(l):l;if(l=a||l!==0?l:0,n&&u===u){for(var d=m;d--;)if(e[d]===u)continue e;c.push(l)}else r(e,u,a)||c.push(l)}return c}function QP(o){if(!t1(o)||OP(o))return!1;var e=o1(o)||cP(o)?dP:WL;return e.test(UP(o))}function _P(o,e){return e=GE(e===void 0?o.length-1:e,0),function(){for(var t=arguments,a=-1,i=GE(t.length-e,0),r=Array(i);++a<i;)r[a]=t[e+a];a=-1;for(var n=Array(e+1);++a<e;)n[a]=t[a];return n[e]=r,XL(o,this,n)}}function DP(o,e,t){var a=-1,i=JE,r=o.length,n=!0,s=[],c=s;if(t)n=!1,i=WE;else if(r>=YE){var m=e?null:RP(o);if(m)return KE(m);n=!1,i=ZE,c=new tl}else c=e?[]:s;e:for(;++a<r;){var l=o[a],u=e?e(l):l;if(l=t||l!==0?l:0,n&&u===u){for(var d=c.length;d--;)if(c[d]===u)continue e;e&&c.push(u),s.push(l)}else i(c,u,t)||(c!==s&&c.push(u),s.push(l))}return s}function TP(o,e,t){for(var a=-1,i=o.length;++a<i;)var r=r?tP(VE(r,o[a],e,t),VE(o[a],r,e,t)):o[a];return r&&r.length?DP(r,e,t):[]}var RP=Fy&&1/KE(new Fy([,-0]))[1]==HL?function(o){return new Fy(o)}:GP;function Od(o,e){var t=o.__data__;return NP(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Vy(o,e){var t=sP(o,e);return QP(t)?t:void 0}function NP(o){var e=typeof o;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?o!=="__proto__":o===null}function OP(o){return!!HE&&HE in o}function UP(o){if(o!=null){try{return e1.call(o)}catch{}try{return o+""}catch{}}return""}var MP=_P(function(o){return TP(eP(o,FP))});function LP(o,e){return o===e||o!==o&&e!==e}function PP(o){return o!=null&&$P(o.length)&&!o1(o)}function FP(o){return HP(o)&&PP(o)}function o1(o){var e=t1(o)?uP.call(o):"";return e==VL||e==YL}function $P(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=GL}function t1(o){var e=typeof o;return!!o&&(e=="object"||e=="function")}function HP(o){return!!o&&typeof o=="object"}function GP(){}a1.exports=MP});var Md=f(ur=>{"use strict";var Zy=ur&&ur.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(ur,"__esModule",{value:!0});ur.toJsonSchema=KP;ur.convertRequiredToArray=al;ur.generateDefaultFromSchema=il;ur.parseJsonSafe=Ud;ur.normalizeToolSchemas=XP;var Yy=Zy(hE()),Jy=Zy($E()),VP=Zy(i1());function cc(o,e){if(o===e)return!0;if(o===null||e===null||typeof o!="object"||typeof e!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t=Object.keys(o),a=Object.keys(e);if(t.length!==a.length)return!1;let i=e;return t.every(r=>r in i&&cc(o[r],i[r]))}var YP={required:!1,requiredDepth:Number.POSITIVE_INFINITY,postProcessFnc:null,strings:{preProcessFnc:null},arrays:{mode:"all"},objects:{preProcessFnc:null,postProcessFnc:null,additionalProperties:!0}},JP={string:function(e){return typeof e=="string"},number:function(e){return typeof e=="number"&&isFinite(e)},integer:function(e){return typeof e=="number"&&e%1===0},boolean:function(e){return typeof e=="boolean"},array:function(e){return e instanceof Array},null:function(e){return e===null},date:function(e){return e instanceof Date},any:function(e){return!0},object:function(e){return e&&typeof e=="object"&&!(e instanceof Array)&&!(e instanceof Date)}},mc={typeNames:["integer","number","string","array","object","boolean","null","date"],getType(o){return mc.typeNames.find(e=>JP[e](o))},mergeSchemaObjs(o,e){if(!o||!e)return null;let t=(0,Yy.default)(o),a=(0,Yy.default)(e);if(!cc(t,a)){if(o.type==="array"&&e.type==="array"&&cc((0,VP.default)(t,a),["items"])){let r=t.length>a.length?e:o,n=t.length>a.length?o:e;if((0,Yy.default)(r).reduce((c,m)=>cc(r[m],n[m])&&c,!0))return r}if(o.type!=="object"||e.type!=="object")return null}let i={};for(let r=0,{length:n}=t;r<n;r++){let s=t[r];if(mc.getType(o[s])==="object"){let c=mc.mergeSchemaObjs(o[s],e[s]);if(c)i[s]=c;else{if(o.type==="object"||e.type==="object")return{type:"object"};if(s!=="items"||o.type!=="array"||e.type!=="array")return null}}else if(s==="type")if(o[s]!==e[s])if(o[s]==="integer"&&e[s]==="number"||o[s]==="number"&&e[s]==="integer")i[s]="number";else return null;else i[s]=o[s];else{if(!cc(o[s],e[s]))return null;i[s]=o[s]}}return i}};function WP(o){let e;for(let t=0,{length:a}=o;t<a;t++){let i=o[t];if(t>0&&(i==="integer"&&e==="number"?i="number":i==="number"&&e==="integer"&&(e="number"),e!==i))return null;e=i}return e}function ZP(o){return WP(o.map(e=>mc.getType(e)))}var Wy=class{constructor(e){this.options=(0,Jy.default)({},YP,e),this.depth=0,this.getObjectSchemaDefault=this.getObjectSchemaDefault.bind(this),this.getStringSchemaDefault=this.getStringSchemaDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this),this.commmonPostProcessDefault=this.commmonPostProcessDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this)}getCommonArrayItemSchema(e){let t=e.map(a=>{this.depth++;let i=this.getSchema(a);return this.depth--,i});return t.reduce((a,i)=>mc.mergeSchemaObjs(a,i),t.pop())}getObjectSchemaDefault(e){let t={type:"object"},a=Object.keys(e);return a.length>0&&(t.properties=a.reduce((i,r)=>(this.depth++,i[r]=this.getSchema(e[r]),this.depth--,i),{})),t}getObjectSchema(e){return this.options.objects.preProcessFnc?this.options.objects.preProcessFnc(e,this.getObjectSchemaDefault):this.getObjectSchemaDefault(e)}getArraySchemaMerging(e){let t={type:"array"},a=ZP(e);if(a)if(t.items={type:a},a!=="integer"&&a!=="number"){let i=this.getCommonArrayItemSchema(e);i&&(t.items=i)}else this.options.required&&(t.items.required=!0);return t}getArraySchemaNoMerging(e){let t={type:"array"};return e.length>0&&(this.depth++,t.items=this.getSchema(e[0]),this.depth--),t}getArraySchemaTuple(e){let t={type:"array"};return e.length>0&&(t.items=e.map(a=>{this.depth++;let i=this.getSchema(a);return this.depth--,i})),t}getArraySchemaUniform(e){let t=this.getArraySchemaNoMerging(e);if(e.length>1)for(let a=1;a<e.length;a++){this.depth++;let i=this.getSchema(e[a]);if(this.depth--,!cc(t.items,i))throw new Error("Invalid schema, incompatible array items")}return t}getArraySchema(e){if(e.length===0)return{type:"array"};switch(this.options.arrays.mode){case"all":return this.getArraySchemaMerging(e);case"first":return this.getArraySchemaNoMerging(e);case"uniform":return this.getArraySchemaUniform(e);case"tuple":return this.getArraySchemaTuple(e);default:throw new Error(`Unknown array mode option '${this.options.arrays.mode}'`)}}getStringSchemaDefault(e){return{type:"string"}}getStringSchema(e){return this.options.strings.preProcessFnc?this.options.strings.preProcessFnc(e,this.getStringSchemaDefault):this.getStringSchemaDefault(e)}commmonPostProcessDefault(e,t,a){return this.options.required&&this.depth<=this.options.requiredDepth?(0,Jy.default)({},t,{required:!0}):t}objectPostProcessDefault(e,t){return this.options.objects.additionalProperties===!1&&Object.getOwnPropertyNames(t).length>0?(0,Jy.default)({},e,{additionalProperties:!1}):e}getSchema(e){let t=mc.getType(e);t||(t="null");let a;switch(t){case"object":a=this.getObjectSchema(e);break;case"array":a=this.getArraySchema(e);break;case"string":a=this.getStringSchema(e);break;default:a={type:t}}return this.options.postProcessFnc?a=this.options.postProcessFnc(t,a,e,this.commmonPostProcessDefault):a=this.commmonPostProcessDefault(t,a,e),t==="object"&&(this.options.objects.postProcessFnc?a=this.options.objects.postProcessFnc(a,e,this.objectPostProcessDefault):a=this.objectPostProcessDefault(a,e)),a}};function KP(o,e){return new Wy(e).getSchema(o)}function al(o){if(!o||typeof o!="object")return o;if(Array.isArray(o))return o.map(t=>al(t));let e={...o};if(delete e.required,e.properties&&typeof e.properties=="object"){let t=[],a={};for(let[i,r]of Object.entries(e.properties)){let n=r;if(n&&typeof n=="object"&&n.required===!0){t.push(i);let{required:s,...c}=n;a[i]=al(c)}else a[i]=al(n)}e.properties=a,t.length>0&&(e.required=t)}return e.items&&(e.items=al(e.items)),e}function il(o){if(!o||typeof o!="object")return null;if(o.const!==void 0)return o.const;if(o.enum&&Array.isArray(o.enum)&&o.enum.length>0)return o.enum[0];if(o.default!==void 0)return o.default;if(o.oneOf&&Array.isArray(o.oneOf)&&o.oneOf.length>0)return il(o.oneOf[0]);if(o.anyOf&&Array.isArray(o.anyOf)&&o.anyOf.length>0)return il(o.anyOf[0]);switch(Array.isArray(o.type)?o.type[0]:o.type){case"string":case"number":case"integer":case"boolean":return null;case"null":return null;case"array":return o.items?[]:[];case"object":let t={};if(o.properties&&typeof o.properties=="object"){let a=o.required||[];for(let[i,r]of Object.entries(o.properties))t[i]=il(r)}return t;default:if(o.properties&&typeof o.properties=="object"){let a={};for(let[i,r]of Object.entries(o.properties))a[i]=il(r);return a}return null}}function Ud(o){if(typeof o!="string")return o;try{return JSON.parse(o)}catch{return o}}function XP(o){let e={...o};return e.inputSchema&&(e.inputSchema=Ud(e.inputSchema)),e.outputSchema&&(e.outputSchema=Ud(e.outputSchema)),e.responseSchema&&(e.responseSchema=Ud(e.responseSchema)),e}});var Ht=f(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.PLAYBOOK_LIMITS=N.MCP_SERVER_AUTH_MODES=N.OAUTH_POPUP_CLOSED_MESSAGE=N.OAUTH_CONTINUATION_REASON_MAX_CHARS=N.AGENT_REQUEST_BUSY_STATUSES=N.AGENT_SESSION_RESOURCE_KINDS=N.AGENT_MESSAGE_SCHEMA_VERSION=N.AGENT_APPROVAL_MODES=N.ConfirmationAction=N.LOADABLE_MARKDOWN_NAMES=N.SKILL_REFERENCE_NAMES=N.SKILL_BODY_NAMES=N.AGENT_CHECKLIST_MAX_LABEL_CHARS=N.AGENT_CHECKLIST_MAX_ITEMS=N.AGENT_CHECKLIST_MIN_ITEMS=N.DYNAMIC_AGENT_TOOLS=N.AGENT_TOOLS=N.AGENT_NATIVE_TOOLS=N.PLAYBOOK_PLAYGROUND_DRAFT_ID=N.PLAYGROUND_TOOL_DRAFT_ID=N.AgentType=N.FileStatus=N.MAX_BULK_RESOURCE_SHARE_OPERATIONS=N.MAX_BULK_MUTATION_IDS=N.RunExecutionKind=N.RequestSource=N.RunStatus=N.CredentialMode=N.UpsertMode=N.LogLevel=N.PaginationType=N.DecompressionMethod=N.AuthType=N.FileType=N.CacheMode=N.HttpMethod=N.SupportedFileType=N.RUN_COMMAND_EFFECT_KINDS=void 0;N.isRequestConfig=eF;N.isTransformConfig=oF;N.RUN_COMMAND_EFFECT_KINDS=["tool","tool_state","system","project","schedule","mcp_server","role","playbook","artifact","share","file"];var r1;(function(o){o.JSON="JSON",o.CSV="CSV",o.XML="XML",o.HTML="HTML",o.YAML="YAML",o.EXCEL="EXCEL",o.PDF="PDF",o.DOCX="DOCX",o.PPTX="PPTX",o.ZIP="ZIP",o.GZIP="GZIP",o.BINARY="BINARY",o.RAW="RAW",o.AUTO="AUTO"})(r1||(N.SupportedFileType=r1={}));var n1;(function(o){o.GET="GET",o.POST="POST",o.PUT="PUT",o.DELETE="DELETE",o.PATCH="PATCH",o.HEAD="HEAD",o.OPTIONS="OPTIONS"})(n1||(N.HttpMethod=n1={}));var s1;(function(o){o.ENABLED="ENABLED",o.READONLY="READONLY",o.WRITEONLY="WRITEONLY",o.DISABLED="DISABLED"})(s1||(N.CacheMode=s1={}));var c1;(function(o){o.CSV="CSV",o.JSON="JSON",o.XML="XML",o.YAML="YAML",o.EXCEL="EXCEL",o.HTML="HTML",o.PDF="PDF",o.DOCX="DOCX",o.PPTX="PPTX",o.ZIP="ZIP",o.BINARY="BINARY",o.RAW="RAW",o.AUTO="AUTO"})(c1||(N.FileType=c1={}));var m1;(function(o){o.NONE="NONE",o.OAUTH2="OAUTH2",o.HEADER="HEADER",o.QUERY_PARAM="QUERY_PARAM"})(m1||(N.AuthType=m1={}));var l1;(function(o){o.GZIP="GZIP",o.DEFLATE="DEFLATE",o.NONE="NONE",o.AUTO="AUTO",o.ZIP="ZIP"})(l1||(N.DecompressionMethod=l1={}));var u1;(function(o){o.OFFSET_BASED="OFFSET_BASED",o.PAGE_BASED="PAGE_BASED",o.CURSOR_BASED="CURSOR_BASED",o.DISABLED="DISABLED"})(u1||(N.PaginationType=u1={}));var d1;(function(o){o.DEBUG="DEBUG",o.INFO="INFO",o.WARN="WARN",o.ERROR="ERROR"})(d1||(N.LogLevel=d1={}));var g1;(function(o){o.CREATE="CREATE",o.UPDATE="UPDATE",o.UPSERT="UPSERT"})(g1||(N.UpsertMode=g1={}));var p1;(function(o){o.MERGE="MERGE",o.REPLACE="REPLACE"})(p1||(N.CredentialMode=p1={}));var h1;(function(o){o.RUNNING="RUNNING",o.SUCCESS="SUCCESS",o.FAILED="FAILED",o.ABORTED="ABORTED"})(h1||(N.RunStatus=h1={}));var f1;(function(o){o.API="api",o.FRONTEND="frontend",o.AGENT="agent",o.SCHEDULER="scheduler",o.MCP="mcp",o.TOOL_CHAIN="tool-chain",o.WEBHOOK="webhook",o.CLI="cli"})(f1||(N.RequestSource=f1={}));var b1;(function(o){o.FULL="full",o.DRAFT="draft",o.SINGLE_STEP="single-step"})(b1||(N.RunExecutionKind=b1={}));N.MAX_BULK_MUTATION_IDS=100;N.MAX_BULK_RESOURCE_SHARE_OPERATIONS=1e3;function eF(o){return!o||typeof o!="object"?!1:o.type==="request"||!("type"in o)||o.type===void 0}function oF(o){return o?.type==="transform"}var y1;(function(o){o.PENDING="PENDING",o.UPLOADING="UPLOADING",o.PROCESSING="PROCESSING",o.COMPLETED="COMPLETED",o.FAILED="FAILED"})(y1||(N.FileStatus=y1={}));var Jr;(function(o){o.MAIN="main",o.PLAYGROUND="playground",o.SYSTEM_PLAYGROUND="system_playground",o.PLAYBOOK_PLAYGROUND="playbook_playground",o.ARTIFACT_PLAYGROUND="artifact_playground",o.ACCESS_RULES="access_rules"})(Jr||(N.AgentType=Jr={}));N.PLAYGROUND_TOOL_DRAFT_ID="@playground-draft";N.PLAYBOOK_PLAYGROUND_DRAFT_ID="@playground-draft";N.AGENT_NATIVE_TOOLS=["run_command","load_skill","create_artifact","use_checklist","set_credentials","authenticate_oauth"];N.AGENT_TOOLS={[Jr.MAIN]:[...N.AGENT_NATIVE_TOOLS],[Jr.PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.SYSTEM_PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.PLAYBOOK_PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.ARTIFACT_PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.ACCESS_RULES]:[...N.AGENT_NATIVE_TOOLS]};N.DYNAMIC_AGENT_TOOLS=["web_search"];N.AGENT_CHECKLIST_MIN_ITEMS=4;N.AGENT_CHECKLIST_MAX_ITEMS=15;N.AGENT_CHECKLIST_MAX_LABEL_CHARS=120;N.SKILL_BODY_NAMES=["superglue-info","tool-building","tool-editing","system-setup","access-management","tool-deployment","notifications","artifacts","playbooks","projects","superglue-brain","email","workspace-apps","meetings"];N.SKILL_REFERENCE_NAMES=["http","graphql","postgres","mssql","odbc","redis","mongodb","sftp-smb","tool-files","tunnel-handling"];N.LOADABLE_MARKDOWN_NAMES=[...N.SKILL_BODY_NAMES,...N.SKILL_REFERENCE_NAMES];var k1;(function(o){o.CONFIRMED="confirmed",o.DECLINED="declined",o.OAUTH_SUCCESS="oauth_success",o.OAUTH_FAILURE="oauth_failure"})(k1||(N.ConfirmationAction=k1={}));N.AGENT_APPROVAL_MODES=["ask","act"];N.AGENT_MESSAGE_SCHEMA_VERSION=1;N.AGENT_SESSION_RESOURCE_KINDS=["tool","system","playbook","artifact"];N.AGENT_REQUEST_BUSY_STATUSES=["queued","claimed","running","cancelling"];N.OAUTH_CONTINUATION_REASON_MAX_CHARS=500;N.OAUTH_POPUP_CLOSED_MESSAGE="OAuth authentication did not complete.";N.MCP_SERVER_AUTH_MODES=["oauth","creator_api_key"];N.PLAYBOOK_LIMITS={name:120,whenToRun:500,inputs:25e3,instructions:1e5,completionCriteria:25e3,systemRefs:10,toolRefs:25,credentialRefs:10,fileRefs:15,compiledRender:512e3}});var tF,v1,A1,aF,iF,rF,nF,w1=Pe(()=>{"use strict";tF=o=>{let e=A1(o,0);if(e===void 0||!iF(o[e]))return;let t=A1(o,e+1);if(t!==void 0)return rF(o,e,t)},v1=tF,A1=(o,e)=>{for(let t=e;t<o.length;t+=1){let a=o[t];if(!aF(a))return t}},aF=o=>o===" "||o===" "||o===`
|
|
2
|
+
"use strict";var jU=Object.create;var Id=Object.defineProperty;var CU=Object.getOwnPropertyDescriptor;var SU=Object.getOwnPropertyNames;var BU=Object.getPrototypeOf,QU=Object.prototype.hasOwnProperty;var Pe=(o,e)=>()=>(o&&(e=o(o=0)),e);var f=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),mE=(o,e)=>{for(var t in e)Id(o,t,{get:e[t],enumerable:!0})},lE=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of SU(e))!QU.call(o,i)&&i!==t&&Id(o,i,{get:()=>e[i],enumerable:!(a=CU(e,i))||a.enumerable});return o};var pe=(o,e,t)=>(t=o!=null?jU(BU(o)):{},lE(e||!o||!o.__esModule?Id(t,"default",{value:o,enumerable:!0}):t,o)),Sy=o=>lE(Id({},"__esModule",{value:!0}),o);var hE=f((tje,pE)=>{"use strict";var uE=9007199254740991,_U="[object Arguments]",DU="[object Function]",TU="[object GeneratorFunction]",RU=/^(?:0|[1-9]\d*)$/;function NU(o,e){for(var t=-1,a=Array(o);++t<o;)a[t]=e(t);return a}function OU(o,e){return function(t){return o(e(t))}}var jd=Object.prototype,By=jd.hasOwnProperty,dE=jd.toString,UU=jd.propertyIsEnumerable,MU=OU(Object.keys,Object);function LU(o,e){var t=GU(o)||HU(o)?NU(o.length,String):[],a=t.length,i=!!a;for(var r in o)(e||By.call(o,r))&&!(i&&(r=="length"||FU(r,a)))&&t.push(r);return t}function PU(o){if(!$U(o))return MU(o);var e=[];for(var t in Object(o))By.call(o,t)&&t!="constructor"&&e.push(t);return e}function FU(o,e){return e=e??uE,!!e&&(typeof o=="number"||RU.test(o))&&o>-1&&o%1==0&&o<e}function $U(o){var e=o&&o.constructor,t=typeof e=="function"&&e.prototype||jd;return o===t}function HU(o){return VU(o)&&By.call(o,"callee")&&(!UU.call(o,"callee")||dE.call(o)==_U)}var GU=Array.isArray;function gE(o){return o!=null&&JU(o.length)&&!YU(o)}function VU(o){return ZU(o)&&gE(o)}function YU(o){var e=WU(o)?dE.call(o):"";return e==DU||e==TU}function JU(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=uE}function WU(o){var e=typeof o;return!!o&&(e=="object"||e=="function")}function ZU(o){return!!o&&typeof o=="object"}function KU(o){return gE(o)?LU(o):PU(o)}pE.exports=KU});var $E=f((Wm,ac)=>{"use strict";var XU=200,qE="__lodash_hash_undefined__",eM=800,oM=16,EE=9007199254740991,IE="[object Arguments]",tM="[object Array]",aM="[object AsyncFunction]",iM="[object Boolean]",rM="[object Date]",nM="[object Error]",jE="[object Function]",sM="[object GeneratorFunction]",cM="[object Map]",mM="[object Number]",lM="[object Null]",CE="[object Object]",uM="[object Proxy]",dM="[object RegExp]",gM="[object Set]",pM="[object String]",hM="[object Undefined]",fM="[object WeakMap]",bM="[object ArrayBuffer]",yM="[object DataView]",kM="[object Float32Array]",AM="[object Float64Array]",vM="[object Int8Array]",wM="[object Int16Array]",xM="[object Int32Array]",zM="[object Uint8Array]",qM="[object Uint8ClampedArray]",EM="[object Uint16Array]",IM="[object Uint32Array]",jM=/[\\^$.*+?()[\]{}|]/g,CM=/^\[object .+?Constructor\]$/,SM=/^(?:0|[1-9]\d*)$/,Ve={};Ve[kM]=Ve[AM]=Ve[vM]=Ve[wM]=Ve[xM]=Ve[zM]=Ve[qM]=Ve[EM]=Ve[IM]=!0;Ve[IE]=Ve[tM]=Ve[bM]=Ve[iM]=Ve[yM]=Ve[rM]=Ve[nM]=Ve[jE]=Ve[cM]=Ve[mM]=Ve[CE]=Ve[dM]=Ve[gM]=Ve[pM]=Ve[fM]=!1;var SE=typeof global=="object"&&global&&global.Object===Object&&global,BM=typeof self=="object"&&self&&self.Object===Object&&self,Xm=SE||BM||Function("return this")(),BE=typeof Wm=="object"&&Wm&&!Wm.nodeType&&Wm,Zm=BE&&typeof ac=="object"&&ac&&!ac.nodeType&&ac,QE=Zm&&Zm.exports===BE,Qy=QE&&SE.process,fE=(function(){try{var o=Zm&&Zm.require&&Zm.require("util").types;return o||Qy&&Qy.binding&&Qy.binding("util")}catch{}})(),bE=fE&&fE.isTypedArray;function QM(o,e,t){switch(t.length){case 0:return o.call(e);case 1:return o.call(e,t[0]);case 2:return o.call(e,t[0],t[1]);case 3:return o.call(e,t[0],t[1],t[2])}return o.apply(e,t)}function _M(o,e){for(var t=-1,a=Array(o);++t<o;)a[t]=e(t);return a}function DM(o){return function(e){return o(e)}}function TM(o,e){return o?.[e]}function RM(o,e){return function(t){return o(e(t))}}var NM=Array.prototype,OM=Function.prototype,Bd=Object.prototype,_y=Xm["__core-js_shared__"],Qd=OM.toString,mr=Bd.hasOwnProperty,yE=(function(){var o=/[^.]+$/.exec(_y&&_y.keys&&_y.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),_E=Bd.toString,UM=Qd.call(Object),MM=RegExp("^"+Qd.call(mr).replace(jM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cd=QE?Xm.Buffer:void 0,kE=Xm.Symbol,AE=Xm.Uint8Array,vE=Cd?Cd.allocUnsafe:void 0,DE=RM(Object.getPrototypeOf,Object),wE=Object.create,LM=Bd.propertyIsEnumerable,PM=NM.splice,Yn=kE?kE.toStringTag:void 0,Sd=(function(){try{var o=Uy(Object,"defineProperty");return o({},"",{}),o}catch{}})(),FM=Cd?Cd.isBuffer:void 0,xE=Math.max,$M=Date.now,TE=Uy(Xm,"Map"),Km=Uy(Object,"create"),HM=(function(){function o(){}return function(e){if(!Wn(e))return{};if(wE)return wE(e);o.prototype=e;var t=new o;return o.prototype=void 0,t}})();function Jn(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function GM(){this.__data__=Km?Km(null):{},this.size=0}function VM(o){var e=this.has(o)&&delete this.__data__[o];return this.size-=e?1:0,e}function YM(o){var e=this.__data__;if(Km){var t=e[o];return t===qE?void 0:t}return mr.call(e,o)?e[o]:void 0}function JM(o){var e=this.__data__;return Km?e[o]!==void 0:mr.call(e,o)}function WM(o,e){var t=this.__data__;return this.size+=this.has(o)?0:1,t[o]=Km&&e===void 0?qE:e,this}Jn.prototype.clear=GM;Jn.prototype.delete=VM;Jn.prototype.get=YM;Jn.prototype.has=JM;Jn.prototype.set=WM;function lr(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function ZM(){this.__data__=[],this.size=0}function KM(o){var e=this.__data__,t=_d(e,o);if(t<0)return!1;var a=e.length-1;return t==a?e.pop():PM.call(e,t,1),--this.size,!0}function XM(o){var e=this.__data__,t=_d(e,o);return t<0?void 0:e[t][1]}function eL(o){return _d(this.__data__,o)>-1}function oL(o,e){var t=this.__data__,a=_d(t,o);return a<0?(++this.size,t.push([o,e])):t[a][1]=e,this}lr.prototype.clear=ZM;lr.prototype.delete=KM;lr.prototype.get=XM;lr.prototype.has=eL;lr.prototype.set=oL;function ic(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function tL(){this.size=0,this.__data__={hash:new Jn,map:new(TE||lr),string:new Jn}}function aL(o){var e=Td(this,o).delete(o);return this.size-=e?1:0,e}function iL(o){return Td(this,o).get(o)}function rL(o){return Td(this,o).has(o)}function nL(o,e){var t=Td(this,o),a=t.size;return t.set(o,e),this.size+=t.size==a?0:1,this}ic.prototype.clear=tL;ic.prototype.delete=aL;ic.prototype.get=iL;ic.prototype.has=rL;ic.prototype.set=nL;function rc(o){var e=this.__data__=new lr(o);this.size=e.size}function sL(){this.__data__=new lr,this.size=0}function cL(o){var e=this.__data__,t=e.delete(o);return this.size=e.size,t}function mL(o){return this.__data__.get(o)}function lL(o){return this.__data__.has(o)}function uL(o,e){var t=this.__data__;if(t instanceof lr){var a=t.__data__;if(!TE||a.length<XU-1)return a.push([o,e]),this.size=++t.size,this;t=this.__data__=new ic(a)}return t.set(o,e),this.size=t.size,this}rc.prototype.clear=sL;rc.prototype.delete=cL;rc.prototype.get=mL;rc.prototype.has=lL;rc.prototype.set=uL;function dL(o,e){var t=Ny(o),a=!t&&Ry(o),i=!t&&!a&&UE(o),r=!t&&!a&&!i&&LE(o),n=t||a||i||r,s=n?_M(o.length,String):[],c=s.length;for(var m in o)(e||mr.call(o,m))&&!(n&&(m=="length"||i&&(m=="offset"||m=="parent")||r&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||NE(m,c)))&&s.push(m);return s}function Dy(o,e,t){(t!==void 0&&!Rd(o[e],t)||t===void 0&&!(e in o))&&Oy(o,e,t)}function gL(o,e,t){var a=o[e];(!(mr.call(o,e)&&Rd(a,t))||t===void 0&&!(e in o))&&Oy(o,e,t)}function _d(o,e){for(var t=o.length;t--;)if(Rd(o[t][0],e))return t;return-1}function Oy(o,e,t){e=="__proto__"&&Sd?Sd(o,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):o[e]=t}var pL=IL();function Dd(o){return o==null?o===void 0?hM:lM:Yn&&Yn in Object(o)?jL(o):DL(o)}function zE(o){return el(o)&&Dd(o)==IE}function hL(o){if(!Wn(o)||QL(o))return!1;var e=Ly(o)?MM:CM;return e.test(OL(o))}function fL(o){return el(o)&&ME(o.length)&&!!Ve[Dd(o)]}function bL(o){if(!Wn(o))return _L(o);var e=OE(o),t=[];for(var a in o)a=="constructor"&&(e||!mr.call(o,a))||t.push(a);return t}function RE(o,e,t,a,i){o!==e&&pL(e,function(r,n){if(i||(i=new rc),Wn(r))yL(o,e,n,t,RE,a,i);else{var s=a?a(Ty(o,n),r,n+"",o,e,i):void 0;s===void 0&&(s=r),Dy(o,n,s)}},PE)}function yL(o,e,t,a,i,r,n){var s=Ty(o,t),c=Ty(e,t),m=n.get(c);if(m){Dy(o,t,m);return}var l=r?r(s,c,t+"",o,e,n):void 0,u=l===void 0;if(u){var d=Ny(c),g=!d&&UE(c),h=!d&&!g&&LE(c);l=c,d||g||h?Ny(s)?l=s:UL(s)?l=zL(s):g?(u=!1,l=vL(c,!0)):h?(u=!1,l=xL(c,!0)):l=[]:ML(c)||Ry(c)?(l=s,Ry(s)?l=LL(s):(!Wn(s)||Ly(s))&&(l=CL(c))):u=!1}u&&(n.set(c,l),i(l,c,a,r,n),n.delete(c)),Dy(o,t,l)}function kL(o,e){return RL(TL(o,e,FE),o+"")}var AL=Sd?function(o,e){return Sd(o,"toString",{configurable:!0,enumerable:!1,value:FL(e),writable:!0})}:FE;function vL(o,e){if(e)return o.slice();var t=o.length,a=vE?vE(t):new o.constructor(t);return o.copy(a),a}function wL(o){var e=new o.constructor(o.byteLength);return new AE(e).set(new AE(o)),e}function xL(o,e){var t=e?wL(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.length)}function zL(o,e){var t=-1,a=o.length;for(e||(e=Array(a));++t<a;)e[t]=o[t];return e}function qL(o,e,t,a){var i=!t;t||(t={});for(var r=-1,n=e.length;++r<n;){var s=e[r],c=a?a(t[s],o[s],s,t,o):void 0;c===void 0&&(c=o[s]),i?Oy(t,s,c):gL(t,s,c)}return t}function EL(o){return kL(function(e,t){var a=-1,i=t.length,r=i>1?t[i-1]:void 0,n=i>2?t[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,n&&SL(t[0],t[1],n)&&(r=i<3?void 0:r,i=1),e=Object(e);++a<i;){var s=t[a];s&&o(e,s,a,r)}return e})}function IL(o){return function(e,t,a){for(var i=-1,r=Object(e),n=a(e),s=n.length;s--;){var c=n[o?s:++i];if(t(r[c],c,r)===!1)break}return e}}function Td(o,e){var t=o.__data__;return BL(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Uy(o,e){var t=TM(o,e);return hL(t)?t:void 0}function jL(o){var e=mr.call(o,Yn),t=o[Yn];try{o[Yn]=void 0;var a=!0}catch{}var i=_E.call(o);return a&&(e?o[Yn]=t:delete o[Yn]),i}function CL(o){return typeof o.constructor=="function"&&!OE(o)?HM(DE(o)):{}}function NE(o,e){var t=typeof o;return e=e??EE,!!e&&(t=="number"||t!="symbol"&&SM.test(o))&&o>-1&&o%1==0&&o<e}function SL(o,e,t){if(!Wn(t))return!1;var a=typeof e;return(a=="number"?My(t)&&NE(e,t.length):a=="string"&&e in t)?Rd(t[e],o):!1}function BL(o){var e=typeof o;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?o!=="__proto__":o===null}function QL(o){return!!yE&&yE in o}function OE(o){var e=o&&o.constructor,t=typeof e=="function"&&e.prototype||Bd;return o===t}function _L(o){var e=[];if(o!=null)for(var t in Object(o))e.push(t);return e}function DL(o){return _E.call(o)}function TL(o,e,t){return e=xE(e===void 0?o.length-1:e,0),function(){for(var a=arguments,i=-1,r=xE(a.length-e,0),n=Array(r);++i<r;)n[i]=a[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=a[i];return s[e]=t(n),QM(o,this,s)}}function Ty(o,e){if(!(e==="constructor"&&typeof o[e]=="function")&&e!="__proto__")return o[e]}var RL=NL(AL);function NL(o){var e=0,t=0;return function(){var a=$M(),i=oM-(a-t);if(t=a,i>0){if(++e>=eM)return arguments[0]}else e=0;return o.apply(void 0,arguments)}}function OL(o){if(o!=null){try{return Qd.call(o)}catch{}try{return o+""}catch{}}return""}function Rd(o,e){return o===e||o!==o&&e!==e}var Ry=zE((function(){return arguments})())?zE:function(o){return el(o)&&mr.call(o,"callee")&&!LM.call(o,"callee")},Ny=Array.isArray;function My(o){return o!=null&&ME(o.length)&&!Ly(o)}function UL(o){return el(o)&&My(o)}var UE=FM||$L;function Ly(o){if(!Wn(o))return!1;var e=Dd(o);return e==jE||e==sM||e==aM||e==uM}function ME(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=EE}function Wn(o){var e=typeof o;return o!=null&&(e=="object"||e=="function")}function el(o){return o!=null&&typeof o=="object"}function ML(o){if(!el(o)||Dd(o)!=CE)return!1;var e=DE(o);if(e===null)return!0;var t=mr.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Qd.call(t)==UM}var LE=bE?DM(bE):fL;function LL(o){return qL(o,PE(o))}function PE(o){return My(o)?dL(o,!0):bL(o)}var PL=EL(function(o,e,t){RE(o,e,t)});function FL(o){return function(){return o}}function FE(o){return o}function $L(){return!1}ac.exports=PL});var i1=f((aje,a1)=>{"use strict";var YE=200,$y="__lodash_hash_undefined__",HL=1/0,GL=9007199254740991,VL="[object Function]",YL="[object GeneratorFunction]",JL=/[\\^$.*+?()[\]{}|]/g,WL=/^\[object .+?Constructor\]$/,ZL=typeof global=="object"&&global&&global.Object===Object&&global,KL=typeof self=="object"&&self&&self.Object===Object&&self,Hy=ZL||KL||Function("return this")();function XL(o,e,t){switch(t.length){case 0:return o.call(e);case 1:return o.call(e,t[0]);case 2:return o.call(e,t[0],t[1]);case 3:return o.call(e,t[0],t[1],t[2])}return o.apply(e,t)}function eP(o,e){for(var t=-1,a=o?o.length:0,i=0,r=[];++t<a;){var n=o[t];e(n,t,o)&&(r[i++]=n)}return r}function JE(o,e){var t=o?o.length:0;return!!t&&iP(o,e,0)>-1}function WE(o,e,t){for(var a=-1,i=o?o.length:0;++a<i;)if(t(e,o[a]))return!0;return!1}function oP(o,e){for(var t=-1,a=o?o.length:0,i=Array(a);++t<a;)i[t]=e(o[t],t,o);return i}function tP(o,e){for(var t=-1,a=e.length,i=o.length;++t<a;)o[i+t]=e[t];return o}function aP(o,e,t,a){for(var i=o.length,r=t+(a?1:-1);a?r--:++r<i;)if(e(o[r],r,o))return r;return-1}function iP(o,e,t){if(e!==e)return aP(o,rP,t);for(var a=t-1,i=o.length;++a<i;)if(o[a]===e)return a;return-1}function rP(o){return o!==o}function nP(o){return function(e){return o(e)}}function ZE(o,e){return o.has(e)}function sP(o,e){return o?.[e]}function cP(o){var e=!1;if(o!=null&&typeof o.toString!="function")try{e=!!(o+"")}catch{}return e}function KE(o){var e=-1,t=Array(o.size);return o.forEach(function(a){t[++e]=a}),t}var mP=Array.prototype,lP=Function.prototype,XE=Object.prototype,Py=Hy["__core-js_shared__"],HE=(function(){var o=/[^.]+$/.exec(Py&&Py.keys&&Py.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),e1=lP.toString,Gy=XE.hasOwnProperty,uP=XE.toString,dP=RegExp("^"+e1.call(Gy).replace(JL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gP=mP.splice,GE=Math.max,pP=Vy(Hy,"Map"),Fy=Vy(Hy,"Set"),ol=Vy(Object,"create");function Zn(o){var e=-1,t=o?o.length:0;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function hP(){this.__data__=ol?ol(null):{}}function fP(o){return this.has(o)&&delete this.__data__[o]}function bP(o){var e=this.__data__;if(ol){var t=e[o];return t===$y?void 0:t}return Gy.call(e,o)?e[o]:void 0}function yP(o){var e=this.__data__;return ol?e[o]!==void 0:Gy.call(e,o)}function kP(o,e){var t=this.__data__;return t[o]=ol&&e===void 0?$y:e,this}Zn.prototype.clear=hP;Zn.prototype.delete=fP;Zn.prototype.get=bP;Zn.prototype.has=yP;Zn.prototype.set=kP;function nc(o){var e=-1,t=o?o.length:0;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function AP(){this.__data__=[]}function vP(o){var e=this.__data__,t=Nd(e,o);if(t<0)return!1;var a=e.length-1;return t==a?e.pop():gP.call(e,t,1),!0}function wP(o){var e=this.__data__,t=Nd(e,o);return t<0?void 0:e[t][1]}function xP(o){return Nd(this.__data__,o)>-1}function zP(o,e){var t=this.__data__,a=Nd(t,o);return a<0?t.push([o,e]):t[a][1]=e,this}nc.prototype.clear=AP;nc.prototype.delete=vP;nc.prototype.get=wP;nc.prototype.has=xP;nc.prototype.set=zP;function sc(o){var e=-1,t=o?o.length:0;for(this.clear();++e<t;){var a=o[e];this.set(a[0],a[1])}}function qP(){this.__data__={hash:new Zn,map:new(pP||nc),string:new Zn}}function EP(o){return Od(this,o).delete(o)}function IP(o){return Od(this,o).get(o)}function jP(o){return Od(this,o).has(o)}function CP(o,e){return Od(this,o).set(o,e),this}sc.prototype.clear=qP;sc.prototype.delete=EP;sc.prototype.get=IP;sc.prototype.has=jP;sc.prototype.set=CP;function tl(o){var e=-1,t=o?o.length:0;for(this.__data__=new sc;++e<t;)this.add(o[e])}function SP(o){return this.__data__.set(o,$y),this}function BP(o){return this.__data__.has(o)}tl.prototype.add=tl.prototype.push=SP;tl.prototype.has=BP;function Nd(o,e){for(var t=o.length;t--;)if(LP(o[t][0],e))return t;return-1}function VE(o,e,t,a){var i=-1,r=JE,n=!0,s=o.length,c=[],m=e.length;if(!s)return c;t&&(e=oP(e,nP(t))),a?(r=WE,n=!1):e.length>=YE&&(r=ZE,n=!1,e=new tl(e));e:for(;++i<s;){var l=o[i],u=t?t(l):l;if(l=a||l!==0?l:0,n&&u===u){for(var d=m;d--;)if(e[d]===u)continue e;c.push(l)}else r(e,u,a)||c.push(l)}return c}function QP(o){if(!t1(o)||OP(o))return!1;var e=o1(o)||cP(o)?dP:WL;return e.test(UP(o))}function _P(o,e){return e=GE(e===void 0?o.length-1:e,0),function(){for(var t=arguments,a=-1,i=GE(t.length-e,0),r=Array(i);++a<i;)r[a]=t[e+a];a=-1;for(var n=Array(e+1);++a<e;)n[a]=t[a];return n[e]=r,XL(o,this,n)}}function DP(o,e,t){var a=-1,i=JE,r=o.length,n=!0,s=[],c=s;if(t)n=!1,i=WE;else if(r>=YE){var m=e?null:RP(o);if(m)return KE(m);n=!1,i=ZE,c=new tl}else c=e?[]:s;e:for(;++a<r;){var l=o[a],u=e?e(l):l;if(l=t||l!==0?l:0,n&&u===u){for(var d=c.length;d--;)if(c[d]===u)continue e;e&&c.push(u),s.push(l)}else i(c,u,t)||(c!==s&&c.push(u),s.push(l))}return s}function TP(o,e,t){for(var a=-1,i=o.length;++a<i;)var r=r?tP(VE(r,o[a],e,t),VE(o[a],r,e,t)):o[a];return r&&r.length?DP(r,e,t):[]}var RP=Fy&&1/KE(new Fy([,-0]))[1]==HL?function(o){return new Fy(o)}:GP;function Od(o,e){var t=o.__data__;return NP(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Vy(o,e){var t=sP(o,e);return QP(t)?t:void 0}function NP(o){var e=typeof o;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?o!=="__proto__":o===null}function OP(o){return!!HE&&HE in o}function UP(o){if(o!=null){try{return e1.call(o)}catch{}try{return o+""}catch{}}return""}var MP=_P(function(o){return TP(eP(o,FP))});function LP(o,e){return o===e||o!==o&&e!==e}function PP(o){return o!=null&&$P(o.length)&&!o1(o)}function FP(o){return HP(o)&&PP(o)}function o1(o){var e=t1(o)?uP.call(o):"";return e==VL||e==YL}function $P(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=GL}function t1(o){var e=typeof o;return!!o&&(e=="object"||e=="function")}function HP(o){return!!o&&typeof o=="object"}function GP(){}a1.exports=MP});var Md=f(ur=>{"use strict";var Zy=ur&&ur.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(ur,"__esModule",{value:!0});ur.toJsonSchema=KP;ur.convertRequiredToArray=al;ur.generateDefaultFromSchema=il;ur.parseJsonSafe=Ud;ur.normalizeToolSchemas=XP;var Yy=Zy(hE()),Jy=Zy($E()),VP=Zy(i1());function cc(o,e){if(o===e)return!0;if(o===null||e===null||typeof o!="object"||typeof e!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t=Object.keys(o),a=Object.keys(e);if(t.length!==a.length)return!1;let i=e;return t.every(r=>r in i&&cc(o[r],i[r]))}var YP={required:!1,requiredDepth:Number.POSITIVE_INFINITY,postProcessFnc:null,strings:{preProcessFnc:null},arrays:{mode:"all"},objects:{preProcessFnc:null,postProcessFnc:null,additionalProperties:!0}},JP={string:function(e){return typeof e=="string"},number:function(e){return typeof e=="number"&&isFinite(e)},integer:function(e){return typeof e=="number"&&e%1===0},boolean:function(e){return typeof e=="boolean"},array:function(e){return e instanceof Array},null:function(e){return e===null},date:function(e){return e instanceof Date},any:function(e){return!0},object:function(e){return e&&typeof e=="object"&&!(e instanceof Array)&&!(e instanceof Date)}},mc={typeNames:["integer","number","string","array","object","boolean","null","date"],getType(o){return mc.typeNames.find(e=>JP[e](o))},mergeSchemaObjs(o,e){if(!o||!e)return null;let t=(0,Yy.default)(o),a=(0,Yy.default)(e);if(!cc(t,a)){if(o.type==="array"&&e.type==="array"&&cc((0,VP.default)(t,a),["items"])){let r=t.length>a.length?e:o,n=t.length>a.length?o:e;if((0,Yy.default)(r).reduce((c,m)=>cc(r[m],n[m])&&c,!0))return r}if(o.type!=="object"||e.type!=="object")return null}let i={};for(let r=0,{length:n}=t;r<n;r++){let s=t[r];if(mc.getType(o[s])==="object"){let c=mc.mergeSchemaObjs(o[s],e[s]);if(c)i[s]=c;else{if(o.type==="object"||e.type==="object")return{type:"object"};if(s!=="items"||o.type!=="array"||e.type!=="array")return null}}else if(s==="type")if(o[s]!==e[s])if(o[s]==="integer"&&e[s]==="number"||o[s]==="number"&&e[s]==="integer")i[s]="number";else return null;else i[s]=o[s];else{if(!cc(o[s],e[s]))return null;i[s]=o[s]}}return i}};function WP(o){let e;for(let t=0,{length:a}=o;t<a;t++){let i=o[t];if(t>0&&(i==="integer"&&e==="number"?i="number":i==="number"&&e==="integer"&&(e="number"),e!==i))return null;e=i}return e}function ZP(o){return WP(o.map(e=>mc.getType(e)))}var Wy=class{constructor(e){this.options=(0,Jy.default)({},YP,e),this.depth=0,this.getObjectSchemaDefault=this.getObjectSchemaDefault.bind(this),this.getStringSchemaDefault=this.getStringSchemaDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this),this.commmonPostProcessDefault=this.commmonPostProcessDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this)}getCommonArrayItemSchema(e){let t=e.map(a=>{this.depth++;let i=this.getSchema(a);return this.depth--,i});return t.reduce((a,i)=>mc.mergeSchemaObjs(a,i),t.pop())}getObjectSchemaDefault(e){let t={type:"object"},a=Object.keys(e);return a.length>0&&(t.properties=a.reduce((i,r)=>(this.depth++,i[r]=this.getSchema(e[r]),this.depth--,i),{})),t}getObjectSchema(e){return this.options.objects.preProcessFnc?this.options.objects.preProcessFnc(e,this.getObjectSchemaDefault):this.getObjectSchemaDefault(e)}getArraySchemaMerging(e){let t={type:"array"},a=ZP(e);if(a)if(t.items={type:a},a!=="integer"&&a!=="number"){let i=this.getCommonArrayItemSchema(e);i&&(t.items=i)}else this.options.required&&(t.items.required=!0);return t}getArraySchemaNoMerging(e){let t={type:"array"};return e.length>0&&(this.depth++,t.items=this.getSchema(e[0]),this.depth--),t}getArraySchemaTuple(e){let t={type:"array"};return e.length>0&&(t.items=e.map(a=>{this.depth++;let i=this.getSchema(a);return this.depth--,i})),t}getArraySchemaUniform(e){let t=this.getArraySchemaNoMerging(e);if(e.length>1)for(let a=1;a<e.length;a++){this.depth++;let i=this.getSchema(e[a]);if(this.depth--,!cc(t.items,i))throw new Error("Invalid schema, incompatible array items")}return t}getArraySchema(e){if(e.length===0)return{type:"array"};switch(this.options.arrays.mode){case"all":return this.getArraySchemaMerging(e);case"first":return this.getArraySchemaNoMerging(e);case"uniform":return this.getArraySchemaUniform(e);case"tuple":return this.getArraySchemaTuple(e);default:throw new Error(`Unknown array mode option '${this.options.arrays.mode}'`)}}getStringSchemaDefault(e){return{type:"string"}}getStringSchema(e){return this.options.strings.preProcessFnc?this.options.strings.preProcessFnc(e,this.getStringSchemaDefault):this.getStringSchemaDefault(e)}commmonPostProcessDefault(e,t,a){return this.options.required&&this.depth<=this.options.requiredDepth?(0,Jy.default)({},t,{required:!0}):t}objectPostProcessDefault(e,t){return this.options.objects.additionalProperties===!1&&Object.getOwnPropertyNames(t).length>0?(0,Jy.default)({},e,{additionalProperties:!1}):e}getSchema(e){let t=mc.getType(e);t||(t="null");let a;switch(t){case"object":a=this.getObjectSchema(e);break;case"array":a=this.getArraySchema(e);break;case"string":a=this.getStringSchema(e);break;default:a={type:t}}return this.options.postProcessFnc?a=this.options.postProcessFnc(t,a,e,this.commmonPostProcessDefault):a=this.commmonPostProcessDefault(t,a,e),t==="object"&&(this.options.objects.postProcessFnc?a=this.options.objects.postProcessFnc(a,e,this.objectPostProcessDefault):a=this.objectPostProcessDefault(a,e)),a}};function KP(o,e){return new Wy(e).getSchema(o)}function al(o){if(!o||typeof o!="object")return o;if(Array.isArray(o))return o.map(t=>al(t));let e={...o};if(delete e.required,e.properties&&typeof e.properties=="object"){let t=[],a={};for(let[i,r]of Object.entries(e.properties)){let n=r;if(n&&typeof n=="object"&&n.required===!0){t.push(i);let{required:s,...c}=n;a[i]=al(c)}else a[i]=al(n)}e.properties=a,t.length>0&&(e.required=t)}return e.items&&(e.items=al(e.items)),e}function il(o){if(!o||typeof o!="object")return null;if(o.const!==void 0)return o.const;if(o.enum&&Array.isArray(o.enum)&&o.enum.length>0)return o.enum[0];if(o.default!==void 0)return o.default;if(o.oneOf&&Array.isArray(o.oneOf)&&o.oneOf.length>0)return il(o.oneOf[0]);if(o.anyOf&&Array.isArray(o.anyOf)&&o.anyOf.length>0)return il(o.anyOf[0]);switch(Array.isArray(o.type)?o.type[0]:o.type){case"string":case"number":case"integer":case"boolean":return null;case"null":return null;case"array":return o.items?[]:[];case"object":let t={};if(o.properties&&typeof o.properties=="object"){let a=o.required||[];for(let[i,r]of Object.entries(o.properties))t[i]=il(r)}return t;default:if(o.properties&&typeof o.properties=="object"){let a={};for(let[i,r]of Object.entries(o.properties))a[i]=il(r);return a}return null}}function Ud(o){if(typeof o!="string")return o;try{return JSON.parse(o)}catch{return o}}function XP(o){let e={...o};return e.inputSchema&&(e.inputSchema=Ud(e.inputSchema)),e.outputSchema&&(e.outputSchema=Ud(e.outputSchema)),e.responseSchema&&(e.responseSchema=Ud(e.responseSchema)),e}});var Ht=f(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.PLAYBOOK_LIMITS=N.MCP_SERVER_AUTH_MODES=N.OAUTH_POPUP_CLOSED_MESSAGE=N.OAUTH_CONTINUATION_REASON_MAX_CHARS=N.AGENT_REQUEST_BUSY_STATUSES=N.AGENT_SESSION_RESOURCE_KINDS=N.AGENT_MESSAGE_SCHEMA_VERSION=N.AGENT_APPROVAL_MODES=N.ConfirmationAction=N.LOADABLE_MARKDOWN_NAMES=N.SKILL_REFERENCE_NAMES=N.SKILL_BODY_NAMES=N.AGENT_CHECKLIST_MAX_LABEL_CHARS=N.AGENT_CHECKLIST_MAX_ITEMS=N.AGENT_CHECKLIST_MIN_ITEMS=N.DYNAMIC_AGENT_TOOLS=N.AGENT_TOOLS=N.AGENT_NATIVE_TOOLS=N.PLAYBOOK_PLAYGROUND_DRAFT_ID=N.PLAYGROUND_TOOL_DRAFT_ID=N.AgentType=N.FileStatus=N.MAX_BULK_RESOURCE_SHARE_OPERATIONS=N.MAX_BULK_MUTATION_IDS=N.RunExecutionKind=N.RequestSource=N.RunStatus=N.CredentialMode=N.UpsertMode=N.LogLevel=N.PaginationType=N.DecompressionMethod=N.AuthType=N.FileType=N.CacheMode=N.HttpMethod=N.SupportedFileType=N.RUN_COMMAND_EFFECT_KINDS=void 0;N.isRequestConfig=eF;N.isTransformConfig=oF;N.RUN_COMMAND_EFFECT_KINDS=["tool","tool_state","system","project","schedule","mcp_server","role","playbook","artifact","share","file"];var r1;(function(o){o.JSON="JSON",o.CSV="CSV",o.XML="XML",o.HTML="HTML",o.YAML="YAML",o.EXCEL="EXCEL",o.PDF="PDF",o.DOCX="DOCX",o.PPTX="PPTX",o.ZIP="ZIP",o.GZIP="GZIP",o.BINARY="BINARY",o.RAW="RAW",o.AUTO="AUTO"})(r1||(N.SupportedFileType=r1={}));var n1;(function(o){o.GET="GET",o.POST="POST",o.PUT="PUT",o.DELETE="DELETE",o.PATCH="PATCH",o.HEAD="HEAD",o.OPTIONS="OPTIONS"})(n1||(N.HttpMethod=n1={}));var s1;(function(o){o.ENABLED="ENABLED",o.READONLY="READONLY",o.WRITEONLY="WRITEONLY",o.DISABLED="DISABLED"})(s1||(N.CacheMode=s1={}));var c1;(function(o){o.CSV="CSV",o.JSON="JSON",o.XML="XML",o.YAML="YAML",o.EXCEL="EXCEL",o.HTML="HTML",o.PDF="PDF",o.DOCX="DOCX",o.PPTX="PPTX",o.ZIP="ZIP",o.BINARY="BINARY",o.RAW="RAW",o.AUTO="AUTO"})(c1||(N.FileType=c1={}));var m1;(function(o){o.NONE="NONE",o.OAUTH2="OAUTH2",o.HEADER="HEADER",o.QUERY_PARAM="QUERY_PARAM"})(m1||(N.AuthType=m1={}));var l1;(function(o){o.GZIP="GZIP",o.DEFLATE="DEFLATE",o.NONE="NONE",o.AUTO="AUTO",o.ZIP="ZIP"})(l1||(N.DecompressionMethod=l1={}));var u1;(function(o){o.OFFSET_BASED="OFFSET_BASED",o.PAGE_BASED="PAGE_BASED",o.CURSOR_BASED="CURSOR_BASED",o.DISABLED="DISABLED"})(u1||(N.PaginationType=u1={}));var d1;(function(o){o.DEBUG="DEBUG",o.INFO="INFO",o.WARN="WARN",o.ERROR="ERROR"})(d1||(N.LogLevel=d1={}));var g1;(function(o){o.CREATE="CREATE",o.UPDATE="UPDATE",o.UPSERT="UPSERT"})(g1||(N.UpsertMode=g1={}));var p1;(function(o){o.MERGE="MERGE",o.REPLACE="REPLACE"})(p1||(N.CredentialMode=p1={}));var h1;(function(o){o.RUNNING="RUNNING",o.SUCCESS="SUCCESS",o.FAILED="FAILED",o.ABORTED="ABORTED"})(h1||(N.RunStatus=h1={}));var f1;(function(o){o.API="api",o.FRONTEND="frontend",o.AGENT="agent",o.SCHEDULER="scheduler",o.MCP="mcp",o.TOOL_CHAIN="tool-chain",o.WEBHOOK="webhook",o.CLI="cli"})(f1||(N.RequestSource=f1={}));var b1;(function(o){o.FULL="full",o.DRAFT="draft",o.SINGLE_STEP="single-step"})(b1||(N.RunExecutionKind=b1={}));N.MAX_BULK_MUTATION_IDS=100;N.MAX_BULK_RESOURCE_SHARE_OPERATIONS=1e3;function eF(o){return!o||typeof o!="object"?!1:o.type==="request"||!("type"in o)||o.type===void 0}function oF(o){return o?.type==="transform"}var y1;(function(o){o.PENDING="PENDING",o.UPLOADING="UPLOADING",o.PROCESSING="PROCESSING",o.COMPLETED="COMPLETED",o.FAILED="FAILED"})(y1||(N.FileStatus=y1={}));var Jr;(function(o){o.MAIN="main",o.PLAYGROUND="playground",o.SYSTEM_PLAYGROUND="system_playground",o.PLAYBOOK_PLAYGROUND="playbook_playground",o.ARTIFACT_PLAYGROUND="artifact_playground",o.ACCESS_RULES="access_rules"})(Jr||(N.AgentType=Jr={}));N.PLAYGROUND_TOOL_DRAFT_ID="@playground-draft";N.PLAYBOOK_PLAYGROUND_DRAFT_ID="@playground-draft";N.AGENT_NATIVE_TOOLS=["run_command","load_skill","create_artifact","use_checklist","set_credentials","authenticate_oauth"];N.AGENT_TOOLS={[Jr.MAIN]:[...N.AGENT_NATIVE_TOOLS],[Jr.PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.SYSTEM_PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.PLAYBOOK_PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.ARTIFACT_PLAYGROUND]:[...N.AGENT_NATIVE_TOOLS],[Jr.ACCESS_RULES]:[...N.AGENT_NATIVE_TOOLS]};N.DYNAMIC_AGENT_TOOLS=["web_search"];N.AGENT_CHECKLIST_MIN_ITEMS=4;N.AGENT_CHECKLIST_MAX_ITEMS=15;N.AGENT_CHECKLIST_MAX_LABEL_CHARS=120;N.SKILL_BODY_NAMES=["superglue-info","tool-building","tool-editing","system-setup","access-management","tool-deployment","notifications","artifacts","playbooks","projects","superglue-brain","email","workspace-apps","meetings"];N.SKILL_REFERENCE_NAMES=["http","graphql","postgres","mssql","odbc","redis","mongodb","sftp-smb","suitecloud","tool-files","tunnel-handling"];N.LOADABLE_MARKDOWN_NAMES=[...N.SKILL_BODY_NAMES,...N.SKILL_REFERENCE_NAMES];var k1;(function(o){o.CONFIRMED="confirmed",o.DECLINED="declined",o.OAUTH_SUCCESS="oauth_success",o.OAUTH_FAILURE="oauth_failure"})(k1||(N.ConfirmationAction=k1={}));N.AGENT_APPROVAL_MODES=["ask","act"];N.AGENT_MESSAGE_SCHEMA_VERSION=1;N.AGENT_SESSION_RESOURCE_KINDS=["tool","system","playbook","artifact"];N.AGENT_REQUEST_BUSY_STATUSES=["queued","claimed","running","cancelling"];N.OAUTH_CONTINUATION_REASON_MAX_CHARS=500;N.OAUTH_POPUP_CLOSED_MESSAGE="OAuth authentication did not complete.";N.MCP_SERVER_AUTH_MODES=["oauth","creator_api_key"];N.PLAYBOOK_LIMITS={name:120,whenToRun:500,inputs:25e3,instructions:1e5,completionCriteria:25e3,systemRefs:10,toolRefs:25,credentialRefs:10,fileRefs:15,compiledRender:512e3}});var tF,v1,A1,aF,iF,rF,nF,w1=Pe(()=>{"use strict";tF=o=>{let e=A1(o,0);if(e===void 0||!iF(o[e]))return;let t=A1(o,e+1);if(t!==void 0)return rF(o,e,t)},v1=tF,A1=(o,e)=>{for(let t=e;t<o.length;t+=1){let a=o[t];if(!aF(a))return t}},aF=o=>o===" "||o===" "||o===`
|
|
3
3
|
`||o==="\r",iF=o=>o==="{"||o==="[",rF=(o,e,t)=>{let a;for(let i=t-1;i>e;i-=1){let r=o[i];if(r==="\r")return;if(r===`
|
|
4
4
|
`)return nF(a);if(a===void 0)a=r;else if(a[0]===r)a+=r;else return}},nF=o=>o===void 0?0:o[0]===" "?o.length:o});var x1,Ky,sF,cF,z1=Pe(()=>{"use strict";x1=(o,e)=>{let t=Ky(o,"toPrecision",e,e);return t===void 0?Ky(o,"toExponential",e,e):t},Ky=(o,e,t,a)=>{let r=o[e](a).replace(sF,"$1").replace(cF,"$1");return r.length<=t?r:a===1?void 0:Ky(o,e,t,a-1)},sF=/(e)\+/iu,cF=/\.?0*($|e)/iu});var E1,mF,lF,q1,I1=Pe(()=>{"use strict";E1=(o,e)=>{if(typeof o!="string")throw new TypeError(`Input must be a JSON string: ${o}`);mF(e)},mF=o=>{if(lF(o),o<0)throw new TypeError(`"maxSize" argument must be positive: ${o}`);if(o<q1)throw new TypeError(`"maxSize" argument must be at least ${q1}: ${o}`)},lF=o=>{if(o===void 0)throw new TypeError('"maxSize" argument must be defined');if(!Number.isInteger(o))throw new TypeError(`"maxSize" argument must be an integer: ${o}`)},q1=7});var Ld,j1,Pd,uF,dF,gF,pF,C1,hF,fF,bF,yF,kF,AF,Xy=Pe(()=>{"use strict";Ld=(o,e,t)=>{let a=C1(e,t);return j1(o,e,a)},j1=(o,e,t)=>{if(t>=e)return t;let a=o[t];return a>=kF&&a<=AF?j1(o,e,t+1):t},Pd=(o,e,t)=>{if(t===void 0)return t;let a=C1(e,t);return uF(o,a)},uF=(o,e)=>dF(o,e)?e-3:gF(o,e)?e-2:pF(o,e)?e-1:e,dF=(o,e)=>e>=3&&o[e-3]>=hF&&o[e-3]<=fF,gF=(o,e)=>e>=2&&o[e-2]>=bF,pF=(o,e)=>e>=1&&o[e-1]>=yF,C1=(o,e)=>e<0||Object.is(e,-0)?Math.max(o+e,0):e,hF=240,fF=244,bF=224,yF=194,kF=128,AF=191});var S1,B1=Pe(()=>{"use strict";Xy();S1=(o,e,t)=>{let a=globalThis.Buffer.from(o),i=Ld(a,a.length,e),r=Pd(a,a.length,t);return i===0&&r>=a.length?a.toString():a.toString("utf8",i,r)}});var Q1,_1=Pe(()=>{"use strict";Q1=/[\uD800-\uDFFF]/gu});var Fd,wF,tk=Pe(()=>{"use strict";_1();Fd=o=>wF(o)?o.replace(Q1,"\uFFFD"):o,wF=o=>{for(let e=0;e<o.length;e+=1){let t=o.codePointAt(e);if(t>=55296&&t<=57343)return!0}return!1}});var ak,D1=Pe(()=>{"use strict";ak=({input:o,targetByteCount:e,firstStartSurrogate:t,lastStartSurrogate:a,firstEndSurrogate:i,lastEndSurrogate:r,increment:n,canBacktrack:s,shift:c,charIndexInit:m})=>{let l=m,u=l,d=0;for(;d<e;l+=n){u=l;let h=o.charCodeAt(l);if(Number.isNaN(h))break;if(h<=127){d+=1;continue}if(h<=2047){d+=2;continue}if(d+=3,h<t||h>a)continue;let k=o.charCodeAt(l+n);Number.isNaN(k)||k<i||k>r||(d+=1,l+=n)}return(s&&d>e?u:l)+c}});var ik,IF,jF,T1=Pe(()=>{"use strict";D1();ik=(o,e,t)=>e<0||Object.is(e,-0)?jF(o,e,t):IF(o,e,t),IF=(o,e,t)=>ak({input:o,targetByteCount:e,firstStartSurrogate:55296,lastStartSurrogate:56319,firstEndSurrogate:56320,lastEndSurrogate:57343,increment:1,canBacktrack:t,shift:0,charIndexInit:0}),jF=(o,e,t)=>ak({input:o,targetByteCount:-e,firstStartSurrogate:56320,lastStartSurrogate:57343,firstEndSurrogate:55296,lastEndSurrogate:56319,increment:-1,canBacktrack:!t,shift:1,charIndexInit:o.length-1})});var $d,CF,R1=Pe(()=>{"use strict";tk();T1();$d=(o,e,t)=>{let a=ik(o,e,!1),i=CF(o,t),r=a===0&&i===void 0?o:o.slice(a,i);return Fd(r)},CF=(o,e)=>{if(e===void 0)return e;let t=ik(o,e,!0);return t===o.length?void 0:t}});var O1,SF,rk,N1,BF,QF,Hd,U1=Pe(()=>{"use strict";Xy();O1=(o,e,t)=>{let{textEncoder:a,textDecoder:i}=SF(),r=BF(o),{written:n}=a.encodeInto(o,r),s=Ld(r,n,e),c=Pd(r,n,t),m=c===void 0?n:Math.min(c,n),l=r.subarray(s,m);return i.decode(l)},SF=()=>(rk===void 0&&(rk=new globalThis.TextEncoder,N1=new globalThis.TextDecoder("utf8",{fatal:!1})),{textEncoder:rk,textDecoder:N1}),BF=o=>{let e=o.length*3;return e>QF?new Uint8Array(e):((Hd===void 0||Hd.length<e)&&(Hd=new Uint8Array(e)),Hd)},QF=1e5});var M1,nk,L1,P1=Pe(()=>{"use strict";M1=(o,e)=>{if(e===void 0)return e;let t=nk(o,e);return t>=o.length*L1?void 0:t},nk=(o,e)=>e<=o.length*-L1?0:e,L1=4});var F1,_F,DF,$1,H1=Pe(()=>{"use strict";F1=(o,e,t)=>{if(typeof o!="string")throw new TypeError(`First argument must be a string: ${o}`);_F(e),DF(t)},_F=o=>{if(o===void 0)throw new TypeError("Second argument is required.");$1("Second",o)},DF=o=>{o!==void 0&&$1("Third",o)},$1=(o,e)=>{if(!Number.isInteger(e))throw new TypeError(`${o} argument must be an integer: ${e}`)}});var G1,TF,sk,V1=Pe(()=>{"use strict";G1=o=>{let e=!0,t=0;for(let a=0;a<sk;a+=1){let i=TF(o,a);i<=127||(e&&(e=!1),i>2047&&(t+=1))}return{asciiOnly:e,longCharsPercentage:t/sk}},TF=(o,e)=>{let t=sk-1,a=1-(t-e)/t,i=Math.round(a*(o.length-1));return o.charCodeAt(i)},sk=50});var RF,Y1,NF,OF,UF,MF,J1,W1=Pe(()=>{"use strict";B1();R1();U1();P1();tk();H1();V1();RF=(o,e,t)=>{if(F1(o,e,t),o==="")return o;let a=nk(o,e),i=M1(o,t);return i===void 0&&Object.is(a,0)?Fd(o):NF(o,a,i)},Y1=RF,NF=(o,e,t)=>{if(o.length<=OF)return $d(o,e,t);let{asciiOnly:a,longCharsPercentage:i}=G1(o);return a?MF(o,e,t):i>=UF?$d(o,e,t):J1(o,e,t)},OF=200,UF=.4,MF=(o,e,t)=>"Buffer"in globalThis&&"from"in globalThis.Buffer?S1(o,e,t):J1(o,e,t),J1=(o,e,t)=>"TextEncoder"in globalThis?O1(o,e,t):$d(o,e,t)});var K1,LF,PF,FF,$F,rl,Z1,X1=Pe(()=>{"use strict";W1();K1=(o,e)=>{let t=JSON.stringify(o),a=FF(t),i=Y1(a,0,e-Z1.length-rl.length*2),n=`${LF(i)}${Z1}`;return $F(n)},LF=o=>o.replace(PF,""),PF=/(\\|\\u[0-9a-fA-F]{0,3})$/u,FF=o=>o.slice(rl.length,-rl.length),$F=o=>`${rl}${o}${rl}`,rl='"',Z1="..."});var eI,oI=Pe(()=>{"use strict";eI=o=>globalThis.Buffer.byteLength(o)});var ck,HF,GF,VF,YF,JF,WF,tI=Pe(()=>{"use strict";ck=o=>{let e=o.length,t=e;for(let a=0;a<e;a+=1){let i=o.charCodeAt(a);if(i<=HF)continue;if(i<=GF){t+=1;continue}if(t+=2,i<VF||i>YF)continue;let r=o.charCodeAt(a+1);r<JF||r>WF||(a+=1)}return t},HF=127,GF=2047,VF=55296,YF=56319,JF=56320,WF=57343});var aI,ZF,KF,XF,Gd,iI=Pe(()=>{"use strict";aI=()=>ZF.bind(void 0,new TextEncoder),ZF=(o,e)=>{let t=KF(e);return o.encodeInto(e,t).written},KF=o=>{let e=o.length*3;return e>XF?new Uint8Array(e):((Gd===void 0||Gd.length<e)&&(Gd=new Uint8Array(e)),Gd)},XF=1e5});var o$,t$,rI,nI=Pe(()=>{"use strict";oI();tI();iI();o$=()=>"Buffer"in globalThis&&"byteLength"in globalThis.Buffer?eI:"TextEncoder"in globalThis?t$.bind(void 0,aI()):ck,t$=(o,e)=>e.length<100?ck(e):o(e),rI=o$()});var sI,a$,i$,r$,n$,mk,cI=Pe(()=>{"use strict";nI();sI=o=>{if(o===null)return a$;if(o===!0)return i$;if(o===!1)return r$;let e=typeof o;return e==="object"?n$:e==="number"?JSON.stringify(o).length:mk(o)},a$=4,i$=4,r$=5,n$=2,mk=o=>rI(JSON.stringify(o))});var Vd,lI,uI,dI,s$,gI,mI,pI,c$,nl=Pe(()=>{"use strict";cI();Vd=({size:o,increment:e,maxSize:t,truncatedProps:a,path:i,value:r})=>{let n=o+e,s=n>t;return s?{size:o,stop:s,truncatedProps:[...a,{path:i,value:r}]}:{size:n,stop:s,truncatedProps:a}},lI=o=>sI(o),uI=(o,e,t)=>{let a=gI({empty:o,indent:e,depth:t,keySpaceSize:0}),i=pI(o);return a+i},dI=({key:o,empty:e,indent:t,depth:a})=>{let i=gI({empty:e,indent:t,depth:a,keySpaceSize:1}),r=mk(o),n=pI(e);return i+r+s$+n},s$=1,gI=({empty:o,indent:e,depth:t,keySpaceSize:a})=>{if(e===void 0)return 0;let i=mI+e*(t+1),r=o?mI+e*t:0;return a+i+r},mI=1,pI=o=>o?0:c$,c$=1});var Yd,m$,lk=Pe(()=>{"use strict";nl();Yd=({parent:o,truncatedProps:e,path:t,increment:a,maxSize:i,key:r,empty:n,size:s,truncateValue:c,indent:m,depth:l})=>{let u=o[r],d=[...t,r],{size:g,stop:h,truncatedProps:k}=Vd({size:s,increment:a,maxSize:i,truncatedProps:e,path:d,value:u});return h?{empty:n,size:g,truncatedProps:k}:m$({value:u,truncatedProps:e,path:d,maxSize:i,empty:n,size:s,newSize:g,truncateValue:c,indent:m,depth:l})},m$=({value:o,truncatedProps:e,path:t,maxSize:a,empty:i,size:r,newSize:n,truncateValue:s,indent:c,depth:m})=>{let{value:l,size:u,truncatedProps:d}=s({value:o,truncatedProps:e,path:t,size:n,maxSize:a,indent:c,depth:m+1});return l===void 0?{empty:i,size:r,truncatedProps:d}:{empty:!1,size:u,value:l,truncatedProps:d}}});var hI,fI=Pe(()=>{"use strict";lk();nl();hI=({array:o,truncatedProps:e,path:t,size:a,maxSize:i,truncateValue:r,indent:n,depth:s})=>{let c=[],m={empty:!0,size:a,truncatedProps:e};for(let l=0;l<o.length;l+=1){let u=uI(m.empty,n,s);m=Yd({parent:o,truncatedProps:m.truncatedProps,path:t,increment:u,maxSize:i,key:l,empty:m.empty,size:m.size,truncateValue:r,indent:n,depth:s}),m.value!==void 0&&c.push(m.value)}return{value:c,size:m.size,truncatedProps:m.truncatedProps}}});var bI,yI=Pe(()=>{"use strict";lk();nl();bI=({object:o,truncatedProps:e,path:t,size:a,maxSize:i,truncateValue:r,indent:n,depth:s})=>{let c={},m={empty:!0,size:a,truncatedProps:e};for(let l in o){let u=dI({key:l,empty:m.empty,indent:n,depth:s});m=Yd({parent:o,truncatedProps:m.truncatedProps,path:t,increment:u,maxSize:i,key:l,empty:m.empty,size:m.size,truncateValue:r,indent:n,depth:s}),m.value!==void 0&&(c[l]=m.value)}return{value:c,size:m.size,truncatedProps:m.truncatedProps}}});var Jd,l$,kI=Pe(()=>{"use strict";fI();yI();nl();Jd=({value:o,truncatedProps:e,path:t,size:a,maxSize:i,indent:r,depth:n})=>{let s=lI(o),{size:c,stop:m,truncatedProps:l}=Vd({size:a,increment:s,maxSize:i,truncatedProps:e,path:t,value:o});return m?{value:void 0,size:c,truncatedProps:l}:l$({value:o,truncatedProps:l,path:t,size:c,maxSize:i,indent:r,depth:n})},l$=({value:o,truncatedProps:e,path:t,size:a,maxSize:i,indent:r,depth:n})=>typeof o!="object"||o===null?{value:o,size:a,truncatedProps:e}:Array.isArray(o)?hI({array:o,truncatedProps:e,path:t,size:a,maxSize:i,truncateValue:Jd,indent:r,depth:n}):bI({object:o,truncatedProps:e,path:t,size:a,maxSize:i,truncateValue:Jd,indent:r,depth:n})});var AI={};mE(AI,{default:()=>d$});var u$,d$,g$,p$,h$,vI=Pe(()=>{"use strict";w1();z1();I1();X1();kI();u$=(o,e)=>{E1(o,e);let t=g$(o),a=p$(o),{value:i,truncatedProps:r}=Jd({value:a,truncatedProps:[],path:[],size:0,maxSize:e,indent:t,depth:0});return{jsonString:h$({newValue:i,value:a,maxSize:e,indent:t}),truncatedProps:r}},d$=u$,g$=o=>{let e=v1(o);return typeof e=="string"?e.length:e},p$=o=>{try{return JSON.parse(o)}catch(e){throw new TypeError(`Invalid JSON string: "${o}"
|
|
5
5
|
${e.message}`)}},h$=({newValue:o,value:e,maxSize:t,indent:a})=>o!==void 0?JSON.stringify(o,void 0,a):typeof e=="number"?x1(e,t):K1(e,t)});var xI=f(wI=>{"use strict";Object.defineProperty(wI,"__esModule",{value:!0})});var Wr=f(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.CronField=void 0;var uk=class o{#e=!1;#o=!1;#a=!1;#i=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(e,t={rawValue:""}){if(!Array.isArray(e))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(e.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...t,rawValue:t.rawValue??""},this.#i=e.sort(o.sorter),this.#a=this.options.wildcard!==void 0?this.options.wildcard:this.#r(),this.#e=this.options.rawValue.includes("L")||e.includes("L"),this.#o=this.options.rawValue.includes("?")||e.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#o}get isWildcard(){return this.#a}get values(){return this.#i}static sorter(e,t){let a=typeof e=="number",i=typeof t=="number";return a&&i?e-t:!a&&!i?e.localeCompare(t):a?-1:1}static findNearestValueInList(e,t,a=!1){if(a){for(let i=e.length-1;i>=0;i--)if(e[i]<t)return e[i];return null}for(let i=0;i<e.length;i++)if(e[i]>t)return e[i];return null}findNearestValue(e,t=!1){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#a,values:this.#i}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join("")}`:"",a=s=>c=>new RegExp(`^\\d{0,2}${c}$`).test(s),i=s=>(e=s,typeof s=="number"?s>=this.min&&s<=this.max:this.chars.some(a(s)));if(!this.#i.every(i))throw new Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let n=this.#i.find((s,c)=>this.#i.indexOf(s)!==c);if(n)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${n}`)}#r(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#i.includes(e))}};Wd.CronField=uk});var zI=f(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.CronDayOfMonth=void 0;var f$=Wr(),b$=1,y$=31,k$=Object.freeze(["L"]),dk=class extends f$.CronField{static get min(){return b$}static get max(){return y$}static get chars(){return k$}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}};Zd.CronDayOfMonth=dk});var qI=f(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.CronDayOfWeek=void 0;var A$=Wr(),v$=0,w$=7,x$=Object.freeze(["L"]),gk=class extends A$.CronField{static get min(){return v$}static get max(){return w$}static get chars(){return x$}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};Kd.CronDayOfWeek=gk});var EI=f(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.CronHour=void 0;var z$=Wr(),q$=0,E$=23,I$=Object.freeze([]),pk=class extends z$.CronField{static get min(){return q$}static get max(){return E$}static get chars(){return I$}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}};Xd.CronHour=pk});var II=f(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.CronMinute=void 0;var j$=Wr(),C$=0,S$=59,B$=Object.freeze([]),hk=class extends j$.CronField{static get min(){return C$}static get max(){return S$}static get chars(){return B$}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}};eg.CronMinute=hk});var aj=f(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});var gr=class extends Error{},qk=class extends gr{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},Ek=class extends gr{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},Ik=class extends gr{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},Xr=class extends gr{},cg=class extends gr{constructor(e){super(`Invalid unit ${e}`)}},Eo=class extends gr{},Na=class extends gr{constructor(){super("Zone is an abstract class")}},L="numeric",wa="short",xt="long",mg={year:L,month:L,day:L},i2={year:L,month:wa,day:L},Q$={year:L,month:wa,day:L,weekday:wa},r2={year:L,month:xt,day:L},n2={year:L,month:xt,day:L,weekday:xt},s2={hour:L,minute:L},c2={hour:L,minute:L,second:L},m2={hour:L,minute:L,second:L,timeZoneName:wa},l2={hour:L,minute:L,second:L,timeZoneName:xt},u2={hour:L,minute:L,hourCycle:"h23"},d2={hour:L,minute:L,second:L,hourCycle:"h23"},g2={hour:L,minute:L,second:L,hourCycle:"h23",timeZoneName:wa},p2={hour:L,minute:L,second:L,hourCycle:"h23",timeZoneName:xt},h2={year:L,month:L,day:L,hour:L,minute:L},f2={year:L,month:L,day:L,hour:L,minute:L,second:L},b2={year:L,month:wa,day:L,hour:L,minute:L},y2={year:L,month:wa,day:L,hour:L,minute:L,second:L},_$={year:L,month:wa,day:L,weekday:wa,hour:L,minute:L},k2={year:L,month:xt,day:L,hour:L,minute:L,timeZoneName:wa},A2={year:L,month:xt,day:L,hour:L,minute:L,second:L,timeZoneName:wa},v2={year:L,month:xt,day:L,weekday:xt,hour:L,minute:L,timeZoneName:xt},w2={year:L,month:xt,day:L,weekday:xt,hour:L,minute:L,second:L,timeZoneName:xt},on=class{get type(){throw new Na}get name(){throw new Na}get ianaName(){return this.name}get isUniversal(){throw new Na}offsetName(e,t){throw new Na}formatOffset(e,t){throw new Na}offset(e){throw new Na}equals(e){throw new Na}get isValid(){throw new Na}},fk=null,dl=class o extends on{static get instance(){return fk===null&&(fk=new o),fk}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:a}){return _2(e,t,a)}formatOffset(e,t){return ul(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},jk=new Map;function D$(o){let e=jk.get(o);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:o,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),jk.set(o,e)),e}var T$={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function R$(o,e){let t=o.format(e).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,i,r,n,s,c,m,l]=a;return[n,i,r,s,c,m,l]}function N$(o,e){let t=o.formatToParts(e),a=[];for(let i=0;i<t.length;i++){let{type:r,value:n}=t[i],s=T$[r];r==="era"?a[s]=n:ue(s)||(a[s]=parseInt(n,10))}return a}var bk=new Map,pr=class o extends on{static create(e){let t=bk.get(e);return t===void 0&&bk.set(e,t=new o(e)),t}static resetCache(){bk.clear(),jk.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=o.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:a}){return _2(e,t,a,this.name)}formatOffset(e,t){return ul(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let a=D$(this.name),[i,r,n,s,c,m,l]=a.formatToParts?N$(a,t):R$(a,t);s==="BC"&&(i=-Math.abs(i)+1);let d=fg({year:i,month:r,day:n,hour:c===24?0:c,minute:m,second:l,millisecond:0}),g=+t,h=g%1e3;return g-=h>=0?h:1e3+h,(d-g)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},jI={};function O$(o,e={}){let t=JSON.stringify([o,e]),a=jI[t];return a||(a=new Intl.ListFormat(o,e),jI[t]=a),a}var Ck=new Map;function Sk(o,e={}){let t=JSON.stringify([o,e]),a=Ck.get(t);return a===void 0&&(a=new Intl.DateTimeFormat(o,e),Ck.set(t,a)),a}var Bk=new Map;function U$(o,e={}){let t=JSON.stringify([o,e]),a=Bk.get(t);return a===void 0&&(a=new Intl.NumberFormat(o,e),Bk.set(t,a)),a}var Qk=new Map;function M$(o,e={}){let{base:t,...a}=e,i=JSON.stringify([o,a]),r=Qk.get(i);return r===void 0&&(r=new Intl.RelativeTimeFormat(o,e),Qk.set(i,r)),r}var cl=null;function L$(){return cl||(cl=new Intl.DateTimeFormat().resolvedOptions().locale,cl)}var _k=new Map;function x2(o){let e=_k.get(o);return e===void 0&&(e=new Intl.DateTimeFormat(o).resolvedOptions(),_k.set(o,e)),e}var Dk=new Map;function P$(o){let e=Dk.get(o);if(!e){let t=new Intl.Locale(o);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...z2,...e}),Dk.set(o,e)}return e}function F$(o){let e=o.indexOf("-x-");e!==-1&&(o=o.substring(0,e));let t=o.indexOf("-u-");if(t===-1)return[o];{let a,i;try{a=Sk(o).resolvedOptions(),i=o}catch{let c=o.substring(0,t);a=Sk(c).resolvedOptions(),i=c}let{numberingSystem:r,calendar:n}=a;return[i,r,n]}}function $$(o,e,t){return(t||e)&&(o.includes("-u-")||(o+="-u"),t&&(o+=`-ca-${t}`),e&&(o+=`-nu-${e}`)),o}function H$(o){let e=[];for(let t=1;t<=12;t++){let a=Ke.utc(2009,t,1);e.push(o(a))}return e}function G$(o){let e=[];for(let t=1;t<=7;t++){let a=Ke.utc(2016,11,13+t);e.push(o(a))}return e}function og(o,e,t,a){let i=o.listingMode();return i==="error"?null:i==="en"?t(e):a(e)}function V$(o){return o.numberingSystem&&o.numberingSystem!=="latn"?!1:o.numberingSystem==="latn"||!o.locale||o.locale.startsWith("en")||x2(o.locale).numberingSystem==="latn"}var Tk=class{constructor(e,t,a){this.padTo=a.padTo||0,this.floor=a.floor||!1;let{padTo:i,floor:r,...n}=a;if(!t||Object.keys(n).length>0){let s={useGrouping:!1,...a};a.padTo>0&&(s.minimumIntegerDigits=a.padTo),this.inf=U$(e,s)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{let t=this.floor?Math.floor(e):Gk(e,3);return ho(t,this.padTo)}}},Rk=class{constructor(e,t,a){this.opts=a,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let n=-1*(e.offset/60),s=n>=0?`Etc/GMT+${n}`:`Etc/GMT${n}`;e.offset!==0&&pr.create(s).valid?(i=s,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let r={...this.opts};r.timeZone=r.timeZone||i,this.dtf=Sk(t,r)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){let a=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:a}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Nk=class{constructor(e,t,a){this.opts={style:"long",...a},!t&&B2()&&(this.rtf=M$(e,a))}format(e,t){return this.rtf?this.rtf.format(e,t):pH(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},z2={firstDay:1,minimalDays:4,weekend:[6,7]},Fe=class o{static fromOpts(e){return o.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,a,i,r=!1){let n=e||Ye.defaultLocale,s=n||(r?"en-US":L$()),c=t||Ye.defaultNumberingSystem,m=a||Ye.defaultOutputCalendar,l=Uk(i)||Ye.defaultWeekSettings;return new o(s,c,m,l,n)}static resetCache(){cl=null,Ck.clear(),Bk.clear(),Qk.clear(),_k.clear(),Dk.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:a,weekSettings:i}={}){return o.create(e,t,a,i)}constructor(e,t,a,i,r){let[n,s,c]=F$(e);this.locale=n,this.numberingSystem=t||s||null,this.outputCalendar=a||c||null,this.weekSettings=i,this.intl=$$(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=V$(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:o.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Uk(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return og(this,e,R2,()=>{let a=this.intl==="ja"||this.intl.startsWith("ja-");t&=!a;let i=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";if(!this.monthsCache[r][e]){let n=a?s=>this.dtFormatter(s,i).format():s=>this.extract(s,i,"month");this.monthsCache[r][e]=H$(n)}return this.monthsCache[r][e]})}weekdays(e,t=!1){return og(this,e,U2,()=>{let a=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=G$(r=>this.extract(r,a,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return og(this,void 0,()=>M2,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ke.utc(2016,11,13,9),Ke.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return og(this,e,L2,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ke.utc(-40,1,1),Ke.utc(2017,1,1)].map(a=>this.extract(a,t,"era"))),this.eraCache[e]})}extract(e,t,a){let i=this.dtFormatter(e,t),r=i.formatToParts(),n=r.find(s=>s.type.toLowerCase()===a);return n?n.value:null}numberFormatter(e={}){return new Tk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Rk(e,this.intl,t)}relFormatter(e={}){return new Nk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return O$(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||x2(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Q2()?P$(this.locale):z2}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},yk=null,zt=class o extends on{static get utcInstance(){return yk===null&&(yk=new o(0)),yk}static instance(e){return e===0?o.utcInstance:new o(e)}static parseSpecifier(e){if(e){let t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new o(bg(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ul(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ul(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ul(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},lg=class extends on{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Kr(o,e){if(ue(o)||o===null)return e;if(o instanceof on)return o;if(X$(o)){let t=o.toLowerCase();return t==="default"?e:t==="local"||t==="system"?dl.instance:t==="utc"||t==="gmt"?zt.utcInstance:zt.parseSpecifier(t)||pr.create(o)}else return en(o)?zt.instance(o):typeof o=="object"&&"offset"in o&&typeof o.offset=="function"?o:new lg(o)}var Pk={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},CI={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Y$=Pk.hanidec.replace(/[\[|\]]/g,"").split("");function J$(o){let e=parseInt(o,10);if(isNaN(e)){e="";for(let t=0;t<o.length;t++){let a=o.charCodeAt(t);if(o[t].search(Pk.hanidec)!==-1)e+=Y$.indexOf(o[t]);else for(let i in CI){let[r,n]=CI[i];a>=r&&a<=n&&(e+=a-r)}}return parseInt(e,10)}else return e}var Ok=new Map;function W$(){Ok.clear()}function Aa({numberingSystem:o},e=""){let t=o||"latn",a=Ok.get(t);a===void 0&&(a=new Map,Ok.set(t,a));let i=a.get(e);return i===void 0&&(i=new RegExp(`${Pk[t]}${e}`),a.set(e,i)),i}var SI=()=>Date.now(),BI="system",QI=null,_I=null,DI=null,TI=60,RI,NI=null,Ye=class{static get now(){return SI}static set now(e){SI=e}static set defaultZone(e){BI=e}static get defaultZone(){return Kr(BI,dl.instance)}static get defaultLocale(){return QI}static set defaultLocale(e){QI=e}static get defaultNumberingSystem(){return _I}static set defaultNumberingSystem(e){_I=e}static get defaultOutputCalendar(){return DI}static set defaultOutputCalendar(e){DI=e}static get defaultWeekSettings(){return NI}static set defaultWeekSettings(e){NI=Uk(e)}static get twoDigitCutoffYear(){return TI}static set twoDigitCutoffYear(e){TI=e%100}static get throwOnInvalid(){return RI}static set throwOnInvalid(e){RI=e}static resetCaches(){Fe.resetCache(),pr.resetCache(),Ke.resetCache(),W$()}},wt=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},q2=[0,31,59,90,120,151,181,212,243,273,304,334],E2=[0,31,60,91,121,152,182,213,244,274,305,335];function Vt(o,e){return new wt("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${o}, which is invalid`)}function Fk(o,e,t){let a=new Date(Date.UTC(o,e-1,t));o<100&&o>=0&&a.setUTCFullYear(a.getUTCFullYear()-1900);let i=a.getUTCDay();return i===0?7:i}function I2(o,e,t){return t+(pl(o)?E2:q2)[e-1]}function j2(o,e){let t=pl(o)?E2:q2,a=t.findIndex(r=>r<e),i=e-t[a];return{month:a+1,day:i}}function $k(o,e){return(o-e+7)%7+1}function ug(o,e=4,t=1){let{year:a,month:i,day:r}=o,n=I2(a,i,r),s=$k(Fk(a,i,r),t),c=Math.floor((n-s+14-e)/7),m;return c<1?(m=a-1,c=gl(m,e,t)):c>gl(a,e,t)?(m=a+1,c=1):m=a,{weekYear:m,weekNumber:c,weekday:s,...yg(o)}}function OI(o,e=4,t=1){let{weekYear:a,weekNumber:i,weekday:r}=o,n=$k(Fk(a,1,e),t),s=gc(a),c=i*7+r-n-7+e,m;c<1?(m=a-1,c+=gc(m)):c>s?(m=a+1,c-=gc(a)):m=a;let{month:l,day:u}=j2(m,c);return{year:m,month:l,day:u,...yg(o)}}function kk(o){let{year:e,month:t,day:a}=o,i=I2(e,t,a);return{year:e,ordinal:i,...yg(o)}}function UI(o){let{year:e,ordinal:t}=o,{month:a,day:i}=j2(e,t);return{year:e,month:a,day:i,...yg(o)}}function MI(o,e){if(!ue(o.localWeekday)||!ue(o.localWeekNumber)||!ue(o.localWeekYear)){if(!ue(o.weekday)||!ue(o.weekNumber)||!ue(o.weekYear))throw new Xr("Cannot mix locale-based week fields with ISO-based week fields");return ue(o.localWeekday)||(o.weekday=o.localWeekday),ue(o.localWeekNumber)||(o.weekNumber=o.localWeekNumber),ue(o.localWeekYear)||(o.weekYear=o.localWeekYear),delete o.localWeekday,delete o.localWeekNumber,delete o.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Z$(o,e=4,t=1){let a=hg(o.weekYear),i=Yt(o.weekNumber,1,gl(o.weekYear,e,t)),r=Yt(o.weekday,1,7);return a?i?r?!1:Vt("weekday",o.weekday):Vt("week",o.weekNumber):Vt("weekYear",o.weekYear)}function K$(o){let e=hg(o.year),t=Yt(o.ordinal,1,gc(o.year));return e?t?!1:Vt("ordinal",o.ordinal):Vt("year",o.year)}function C2(o){let e=hg(o.year),t=Yt(o.month,1,12),a=Yt(o.day,1,dg(o.year,o.month));return e?t?a?!1:Vt("day",o.day):Vt("month",o.month):Vt("year",o.year)}function S2(o){let{hour:e,minute:t,second:a,millisecond:i}=o,r=Yt(e,0,23)||e===24&&t===0&&a===0&&i===0,n=Yt(t,0,59),s=Yt(a,0,59),c=Yt(i,0,999);return r?n?s?c?!1:Vt("millisecond",i):Vt("second",a):Vt("minute",t):Vt("hour",e)}function ue(o){return typeof o>"u"}function en(o){return typeof o=="number"}function hg(o){return typeof o=="number"&&o%1===0}function X$(o){return typeof o=="string"}function eH(o){return Object.prototype.toString.call(o)==="[object Date]"}function B2(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Q2(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function oH(o){return Array.isArray(o)?o:[o]}function LI(o,e,t){if(o.length!==0)return o.reduce((a,i)=>{let r=[e(i),i];return a&&t(a[0],r[0])===a[0]?a:r},null)[1]}function tH(o,e){return e.reduce((t,a)=>(t[a]=o[a],t),{})}function hc(o,e){return Object.prototype.hasOwnProperty.call(o,e)}function Uk(o){if(o==null)return null;if(typeof o!="object")throw new Eo("Week settings must be an object");if(!Yt(o.firstDay,1,7)||!Yt(o.minimalDays,1,7)||!Array.isArray(o.weekend)||o.weekend.some(e=>!Yt(e,1,7)))throw new Eo("Invalid week settings");return{firstDay:o.firstDay,minimalDays:o.minimalDays,weekend:Array.from(o.weekend)}}function Yt(o,e,t){return hg(o)&&o>=e&&o<=t}function aH(o,e){return o-e*Math.floor(o/e)}function ho(o,e=2){let t=o<0,a;return t?a="-"+(""+-o).padStart(e,"0"):a=(""+o).padStart(e,"0"),a}function Zr(o){if(!(ue(o)||o===null||o===""))return parseInt(o,10)}function Kn(o){if(!(ue(o)||o===null||o===""))return parseFloat(o)}function Hk(o){if(!(ue(o)||o===null||o==="")){let e=parseFloat("0."+o)*1e3;return Math.floor(e)}}function Gk(o,e,t="round"){let a=10**e;switch(t){case"expand":return o>0?Math.ceil(o*a)/a:Math.floor(o*a)/a;case"trunc":return Math.trunc(o*a)/a;case"round":return Math.round(o*a)/a;case"floor":return Math.floor(o*a)/a;case"ceil":return Math.ceil(o*a)/a;default:throw new RangeError(`Value rounding ${t} is out of range`)}}function pl(o){return o%4===0&&(o%100!==0||o%400===0)}function gc(o){return pl(o)?366:365}function dg(o,e){let t=aH(e-1,12)+1,a=o+(e-t)/12;return t===2?pl(a)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function fg(o){let e=Date.UTC(o.year,o.month-1,o.day,o.hour,o.minute,o.second,o.millisecond);return o.year<100&&o.year>=0&&(e=new Date(e),e.setUTCFullYear(o.year,o.month-1,o.day)),+e}function PI(o,e,t){return-$k(Fk(o,1,e),t)+e-1}function gl(o,e=4,t=1){let a=PI(o,e,t),i=PI(o+1,e,t);return(gc(o)-a+i)/7}function Mk(o){return o>99?o:o>Ye.twoDigitCutoffYear?1900+o:2e3+o}function _2(o,e,t,a=null){let i=new Date(o),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};a&&(r.timeZone=a);let n={timeZoneName:e,...r},s=new Intl.DateTimeFormat(t,n).formatToParts(i).find(c=>c.type.toLowerCase()==="timezonename");return s?s.value:null}function bg(o,e){let t=parseInt(o,10);Number.isNaN(t)&&(t=0);let a=parseInt(e,10)||0,i=t<0||Object.is(t,-0)?-a:a;return t*60+i}function D2(o){let e=Number(o);if(typeof o=="boolean"||o===""||!Number.isFinite(e))throw new Eo(`Invalid unit value ${o}`);return e}function gg(o,e){let t={};for(let a in o)if(hc(o,a)){let i=o[a];if(i==null)continue;t[e(a)]=D2(i)}return t}function ul(o,e){let t=Math.trunc(Math.abs(o/60)),a=Math.trunc(Math.abs(o%60)),i=o>=0?"+":"-";switch(e){case"short":return`${i}${ho(t,2)}:${ho(a,2)}`;case"narrow":return`${i}${t}${a>0?`:${a}`:""}`;case"techie":return`${i}${ho(t,2)}${ho(a,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function yg(o){return tH(o,["hour","minute","second","millisecond"])}var iH=["January","February","March","April","May","June","July","August","September","October","November","December"],T2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rH=["J","F","M","A","M","J","J","A","S","O","N","D"];function R2(o){switch(o){case"narrow":return[...rH];case"short":return[...T2];case"long":return[...iH];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var N2=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],O2=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],nH=["M","T","W","T","F","S","S"];function U2(o){switch(o){case"narrow":return[...nH];case"short":return[...O2];case"long":return[...N2];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var M2=["AM","PM"],sH=["Before Christ","Anno Domini"],cH=["BC","AD"],mH=["B","A"];function L2(o){switch(o){case"narrow":return[...mH];case"short":return[...cH];case"long":return[...sH];default:return null}}function lH(o){return M2[o.hour<12?0:1]}function uH(o,e){return U2(e)[o.weekday-1]}function dH(o,e){return R2(e)[o.month-1]}function gH(o,e){return L2(e)[o.year<0?0:1]}function pH(o,e,t="always",a=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(o)===-1;if(t==="auto"&&r){let u=o==="days";switch(e){case 1:return u?"tomorrow":`next ${i[o][0]}`;case-1:return u?"yesterday":`last ${i[o][0]}`;case 0:return u?"today":`this ${i[o][0]}`}}let n=Object.is(e,-0)||e<0,s=Math.abs(e),c=s===1,m=i[o],l=a?c?m[1]:m[2]||m[1]:c?i[o][0]:o;return n?`${s} ${l} ago`:`in ${s} ${l}`}function FI(o,e){let t="";for(let a of o)a.literal?t+=a.val:t+=e(a.val);return t}var hH={D:mg,DD:i2,DDD:r2,DDDD:n2,t:s2,tt:c2,ttt:m2,tttt:l2,T:u2,TT:d2,TTT:g2,TTTT:p2,f:h2,ff:b2,fff:k2,ffff:v2,F:f2,FF:y2,FFF:A2,FFFF:w2},vt=class o{static create(e,t={}){return new o(e,t)}static parseFormat(e){let t=null,a="",i=!1,r=[];for(let n=0;n<e.length;n++){let s=e.charAt(n);s==="'"?((a.length>0||i)&&r.push({literal:i||/^\s+$/.test(a),val:a===""?"'":a}),t=null,a="",i=!i):i||s===t?a+=s:(a.length>0&&r.push({literal:/^\s+$/.test(a),val:a}),a=s,t=s)}return a.length>0&&r.push({literal:i||/^\s+$/.test(a),val:a}),r}static macroTokenToFormatOpts(e){return hH[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,a=void 0){if(this.opts.forceSimple)return ho(e,t);let i={...this.opts};return t>0&&(i.padTo=t),a&&(i.signDisplay=a),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){let a=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(g,h)=>this.loc.extract(e,g,h),n=g=>e.isOffsetFixed&&e.offset===0&&g.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,g.format):"",s=()=>a?lH(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(g,h)=>a?dH(e,g):r(h?{month:g}:{month:g,day:"numeric"},"month"),m=(g,h)=>a?uH(e,g):r(h?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),l=g=>{let h=o.macroTokenToFormatOpts(g);return h?this.formatWithSystemDefault(e,h):g},u=g=>a?gH(e,g):r({era:g},"era"),d=g=>{switch(g){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return n({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return n({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return n({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return i?r({day:"numeric"},"day"):this.num(e.day);case"dd":return i?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return m("short",!0);case"cccc":return m("long",!0);case"ccccc":return m("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return m("short",!1);case"EEEE":return m("long",!1);case"EEEEE":return m("narrow",!1);case"L":return i?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?r({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return i?r({month:"numeric"},"month"):this.num(e.month);case"MM":return i?r({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return i?r({year:"numeric"},"year"):this.num(e.year);case"yy":return i?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(g)}};return FI(o.parseFormat(t),d)}formatDurationFromString(e,t){let a=this.opts.signMode==="negativeLargestOnly"?-1:1,i=l=>{switch(l[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},r=(l,u)=>d=>{let g=i(d);if(g){let h=u.isNegativeDuration&&g!==u.largestUnit?a:1,k;return this.opts.signMode==="negativeLargestOnly"&&g!==u.largestUnit?k="never":this.opts.signMode==="all"?k="always":k="auto",this.num(l.get(g)*h,d.length,k)}else return d},n=o.parseFormat(t),s=n.reduce((l,{literal:u,val:d})=>u?l:l.concat(d),[]),c=e.shiftTo(...s.map(i).filter(l=>l)),m={isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]};return FI(n,r(c,m))}},P2=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fc(...o){let e=o.reduce((t,a)=>t+a.source,"");return RegExp(`^${e}$`)}function bc(...o){return e=>o.reduce(([t,a,i],r)=>{let[n,s,c]=r(e,i);return[{...t,...n},s||a,c]},[{},null,1]).slice(0,2)}function yc(o,...e){if(o==null)return[null,null];for(let[t,a]of e){let i=t.exec(o);if(i)return a(i)}return[null,null]}function F2(...o){return(e,t)=>{let a={},i;for(i=0;i<o.length;i++)a[o[i]]=Zr(e[t+i]);return[a,null,t+i]}}var $2=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,fH=`(?:${$2.source}?(?:\\[(${P2.source})\\])?)?`,Vk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,H2=RegExp(`${Vk.source}${fH}`),Yk=RegExp(`(?:[Tt]${H2.source})?`),bH=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,yH=/(\d{4})-?W(\d\d)(?:-?(\d))?/,kH=/(\d{4})-?(\d{3})/,AH=F2("weekYear","weekNumber","weekDay"),vH=F2("year","ordinal"),wH=/(\d{4})-(\d\d)-(\d\d)/,G2=RegExp(`${Vk.source} ?(?:${$2.source}|(${P2.source}))?`),xH=RegExp(`(?: ${G2.source})?`);function pc(o,e,t){let a=o[e];return ue(a)?t:Zr(a)}function zH(o,e){return[{year:pc(o,e),month:pc(o,e+1,1),day:pc(o,e+2,1)},null,e+3]}function kc(o,e){return[{hours:pc(o,e,0),minutes:pc(o,e+1,0),seconds:pc(o,e+2,0),milliseconds:Hk(o[e+3])},null,e+4]}function hl(o,e){let t=!o[e]&&!o[e+1],a=bg(o[e+1],o[e+2]),i=t?null:zt.instance(a);return[{},i,e+3]}function fl(o,e){let t=o[e]?pr.create(o[e]):null;return[{},t,e+1]}var qH=RegExp(`^T?${Vk.source}$`),EH=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function IH(o){let[e,t,a,i,r,n,s,c,m]=o,l=e[0]==="-",u=c&&c[0]==="-",d=(g,h=!1)=>g!==void 0&&(h||g&&l)?-g:g;return[{years:d(Kn(t)),months:d(Kn(a)),weeks:d(Kn(i)),days:d(Kn(r)),hours:d(Kn(n)),minutes:d(Kn(s)),seconds:d(Kn(c),c==="-0"),milliseconds:d(Hk(m),u)}]}var jH={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Jk(o,e,t,a,i,r,n){let s={year:e.length===2?Mk(Zr(e)):Zr(e),month:T2.indexOf(t)+1,day:Zr(a),hour:Zr(i),minute:Zr(r)};return n&&(s.second=Zr(n)),o&&(s.weekday=o.length>3?N2.indexOf(o)+1:O2.indexOf(o)+1),s}var CH=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function SH(o){let[,e,t,a,i,r,n,s,c,m,l,u]=o,d=Jk(e,i,a,t,r,n,s),g;return c?g=jH[c]:m?g=0:g=bg(l,u),[d,new zt(g)]}function BH(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var QH=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,_H=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,DH=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function $I(o){let[,e,t,a,i,r,n,s]=o;return[Jk(e,i,a,t,r,n,s),zt.utcInstance]}function TH(o){let[,e,t,a,i,r,n,s]=o;return[Jk(e,s,t,a,i,r,n),zt.utcInstance]}var RH=fc(bH,Yk),NH=fc(yH,Yk),OH=fc(kH,Yk),UH=fc(H2),V2=bc(zH,kc,hl,fl),MH=bc(AH,kc,hl,fl),LH=bc(vH,kc,hl,fl),PH=bc(kc,hl,fl);function FH(o){return yc(o,[RH,V2],[NH,MH],[OH,LH],[UH,PH])}function $H(o){return yc(BH(o),[CH,SH])}function HH(o){return yc(o,[QH,$I],[_H,$I],[DH,TH])}function GH(o){return yc(o,[EH,IH])}var VH=bc(kc);function YH(o){return yc(o,[qH,VH])}var JH=fc(wH,xH),WH=fc(G2),ZH=bc(kc,hl,fl);function KH(o){return yc(o,[JH,V2],[WH,ZH])}var HI="Invalid Duration",Y2={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},XH={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Y2},Gt=146097/400,lc=146097/4800,eG={years:{quarters:4,months:12,weeks:Gt/7,days:Gt,hours:Gt*24,minutes:Gt*24*60,seconds:Gt*24*60*60,milliseconds:Gt*24*60*60*1e3},quarters:{months:3,weeks:Gt/28,days:Gt/4,hours:Gt*24/4,minutes:Gt*24*60/4,seconds:Gt*24*60*60/4,milliseconds:Gt*24*60*60*1e3/4},months:{weeks:lc/7,days:lc,hours:lc*24,minutes:lc*24*60,seconds:lc*24*60*60,milliseconds:lc*24*60*60*1e3},...Y2},es=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],oG=es.slice(0).reverse();function dr(o,e,t=!1){let a={values:t?e.values:{...o.values,...e.values||{}},loc:o.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||o.conversionAccuracy,matrix:e.matrix||o.matrix};return new Ao(a)}function J2(o,e){var t;let a=(t=e.milliseconds)!=null?t:0;for(let i of oG.slice(1))e[i]&&(a+=e[i]*o[i].milliseconds);return a}function GI(o,e){let t=J2(o,e)<0?-1:1;es.reduceRight((a,i)=>{if(ue(e[i]))return a;if(a){let r=e[a]*t,n=o[i][a],s=Math.floor(r/n);e[i]+=s*t,e[a]-=s*n*t}return i},null),es.reduce((a,i)=>{if(ue(e[i]))return a;if(a){let r=e[a]%1;e[a]-=r,e[i]+=r*o[a][i]}return i},null)}function VI(o){let e={};for(let[t,a]of Object.entries(o))a!==0&&(e[t]=a);return e}var Ao=class o{constructor(e){let t=e.conversionAccuracy==="longterm"||!1,a=t?eG:XH;e.matrix&&(a=e.matrix),this.values=e.values,this.loc=e.loc||Fe.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=a,this.isLuxonDuration=!0}static fromMillis(e,t){return o.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Eo(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new o({values:gg(e,o.normalizeUnit),loc:Fe.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(en(e))return o.fromMillis(e);if(o.isDuration(e))return e;if(typeof e=="object")return o.fromObject(e);throw new Eo(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){let[a]=GH(e);return a?o.fromObject(a,t):o.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){let[a]=YH(e);return a?o.fromObject(a,t):o.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Eo("need to specify a reason the Duration is invalid");let a=e instanceof wt?e:new wt(e,t);if(Ye.throwOnInvalid)throw new Ik(a);return new o({invalid:a})}static normalizeUnit(e){let t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new cg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let a={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?vt.create(this.loc,a).formatDurationFromString(this,e):HI}toHuman(e={}){if(!this.isValid)return HI;let t=e.showZeros!==!1,a=es.map(i=>{let r=this.values[i];return ue(r)||r===0&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(r)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(a)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Gk(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Ke.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?J2(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let t=o.fromDurationLike(e),a={};for(let i of es)(hc(t.values,i)||hc(this.values,i))&&(a[i]=t.get(i)+this.get(i));return dr(this,{values:a},!0)}minus(e){if(!this.isValid)return this;let t=o.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let a of Object.keys(this.values))t[a]=D2(e(this.values[a],a));return dr(this,{values:t},!0)}get(e){return this[o.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let t={...this.values,...gg(e,o.normalizeUnit)};return dr(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:a,matrix:i}={}){let n={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:i,conversionAccuracy:a};return dr(this,n)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return GI(this.matrix,e),dr(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=VI(this.normalize().shiftToAll().toObject());return dr(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(n=>o.normalizeUnit(n));let t={},a={},i=this.toObject(),r;for(let n of es)if(e.indexOf(n)>=0){r=n;let s=0;for(let m in a)s+=this.matrix[m][n]*a[m],a[m]=0;en(i[n])&&(s+=i[n]);let c=Math.trunc(s);t[n]=c,a[n]=(s*1e3-c*1e3)/1e3}else en(i[n])&&(a[n]=i[n]);for(let n in a)a[n]!==0&&(t[r]+=n===r?a[n]:a[n]/this.matrix[r][n]);return GI(this.matrix,t),dr(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return dr(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=VI(this.values);return dr(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(a,i){return a===void 0||a===0?i===void 0||i===0:a===i}for(let a of es)if(!t(this.values[a],e.values[a]))return!1;return!0}},uc="Invalid Interval";function tG(o,e){return!o||!o.isValid?ts.invalid("missing or invalid start"):!e||!e.isValid?ts.invalid("missing or invalid end"):e<o?ts.invalid("end before start",`The end of an interval must be after its start, but you had start=${o.toISO()} and end=${e.toISO()}`):null}var ts=class o{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Eo("need to specify a reason the Interval is invalid");let a=e instanceof wt?e:new wt(e,t);if(Ye.throwOnInvalid)throw new Ek(a);return new o({invalid:a})}static fromDateTimes(e,t){let a=sl(e),i=sl(t),r=tG(a,i);return r??new o({start:a,end:i})}static after(e,t){let a=Ao.fromDurationLike(t),i=sl(e);return o.fromDateTimes(i,i.plus(a))}static before(e,t){let a=Ao.fromDurationLike(t),i=sl(e);return o.fromDateTimes(i.minus(a),i)}static fromISO(e,t){let[a,i]=(e||"").split("/",2);if(a&&i){let r,n;try{r=Ke.fromISO(a,t),n=r.isValid}catch{n=!1}let s,c;try{s=Ke.fromISO(i,t),c=s.isValid}catch{c=!1}if(n&&c)return o.fromDateTimes(r,s);if(n){let m=Ao.fromISO(i,t);if(m.isValid)return o.after(r,m)}else if(c){let m=Ao.fromISO(a,t);if(m.isValid)return o.before(s,m)}}return o.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;let a=this.start.startOf(e,t),i;return t!=null&&t.useLocaleWeeks?i=this.end.reconfigure({locale:a.locale}):i=this.end,i=i.startOf(e,t),Math.floor(i.diff(a,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?o.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];let t=e.map(sl).filter(n=>this.contains(n)).sort((n,s)=>n.toMillis()-s.toMillis()),a=[],{s:i}=this,r=0;for(;i<this.e;){let n=t[r]||this.e,s=+n>+this.e?this.e:n;a.push(o.fromDateTimes(i,s)),i=s,r+=1}return a}splitBy(e){let t=Ao.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:a}=this,i=1,r,n=[];for(;a<this.e;){let s=this.start.plus(t.mapUnits(c=>c*i));r=+s>+this.e?this.e:s,n.push(o.fromDateTimes(a,r)),a=r,i+=1}return n}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let t=this.s>e.s?this.s:e.s,a=this.e<e.e?this.e:e.e;return t>=a?null:o.fromDateTimes(t,a)}union(e){if(!this.isValid)return this;let t=this.s<e.s?this.s:e.s,a=this.e>e.e?this.e:e.e;return o.fromDateTimes(t,a)}static merge(e){let[t,a]=e.sort((i,r)=>i.s-r.s).reduce(([i,r],n)=>r?r.overlaps(n)||r.abutsStart(n)?[i,r.union(n)]:[i.concat([r]),n]:[i,n],[[],null]);return a&&t.push(a),t}static xor(e){let t=null,a=0,i=[],r=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),n=Array.prototype.concat(...r),s=n.sort((c,m)=>c.time-m.time);for(let c of s)a+=c.type==="s"?1:-1,a===1?t=c.time:(t&&+t!=+c.time&&i.push(o.fromDateTimes(t,c.time)),t=null);return o.merge(i)}difference(...e){return o.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:uc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=mg,t={}){return this.isValid?vt.create(this.s.loc.clone(t),e).formatInterval(this):uc}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:uc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:uc}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:uc}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:uc}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Ao.invalid(this.invalidReason)}mapEndpoints(e){return o.fromDateTimes(e(this.s),e(this.e))}},os=class{static hasDST(e=Ye.defaultZone){let t=Ke.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pr.isValidZone(e)}static normalizeZone(e){return Kr(e,Ye.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Fe.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Fe.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Fe.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:a=null,locObj:i=null,outputCalendar:r="gregory"}={}){return(i||Fe.create(t,a,r)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:a=null,locObj:i=null,outputCalendar:r="gregory"}={}){return(i||Fe.create(t,a,r)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:a=null,locObj:i=null}={}){return(i||Fe.create(t,a,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:a=null,locObj:i=null}={}){return(i||Fe.create(t,a,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Fe.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Fe.create(t,null,"gregory").eras(e)}static features(){return{relative:B2(),localeWeek:Q2()}}};function YI(o,e){let t=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),a=t(e)-t(o);return Math.floor(Ao.fromMillis(a).as("days"))}function aG(o,e,t){let a=[["years",(c,m)=>m.year-c.year],["quarters",(c,m)=>m.quarter-c.quarter+(m.year-c.year)*4],["months",(c,m)=>m.month-c.month+(m.year-c.year)*12],["weeks",(c,m)=>{let l=YI(c,m);return(l-l%7)/7}],["days",YI]],i={},r=o,n,s;for(let[c,m]of a)t.indexOf(c)>=0&&(n=c,i[c]=m(o,e),s=r.plus(i),s>e?(i[c]--,o=r.plus(i),o>e&&(s=o,i[c]--,o=r.plus(i))):o=s);return[o,i,s,n]}function iG(o,e,t,a){let[i,r,n,s]=aG(o,e,t),c=e-i,m=t.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);m.length===0&&(n<e&&(n=i.plus({[s]:1})),n!==i&&(r[s]=(r[s]||0)+c/(n-i)));let l=Ao.fromObject(r,a);return m.length>0?Ao.fromMillis(c,a).shiftTo(...m).plus(l):l}var rG="missing Intl.DateTimeFormat.formatToParts support";function _e(o,e=t=>t){return{regex:o,deser:([t])=>e(J$(t))}}var nG="\xA0",W2=`[ ${nG}]`,Z2=new RegExp(W2,"g");function sG(o){return o.replace(/\./g,"\\.?").replace(Z2,W2)}function JI(o){return o.replace(/\./g,"").replace(Z2," ").toLowerCase()}function va(o,e){return o===null?null:{regex:RegExp(o.map(sG).join("|")),deser:([t])=>o.findIndex(a=>JI(t)===JI(a))+e}}function WI(o,e){return{regex:o,deser:([,t,a])=>bg(t,a),groups:e}}function tg(o){return{regex:o,deser:([e])=>e}}function cG(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function mG(o,e){let t=Aa(e),a=Aa(e,"{2}"),i=Aa(e,"{3}"),r=Aa(e,"{4}"),n=Aa(e,"{6}"),s=Aa(e,"{1,2}"),c=Aa(e,"{1,3}"),m=Aa(e,"{1,6}"),l=Aa(e,"{1,9}"),u=Aa(e,"{2,4}"),d=Aa(e,"{4,6}"),g=w=>({regex:RegExp(cG(w.val)),deser:([x])=>x,literal:!0}),k=(w=>{if(o.literal)return g(w);switch(w.val){case"G":return va(e.eras("short"),0);case"GG":return va(e.eras("long"),0);case"y":return _e(m);case"yy":return _e(u,Mk);case"yyyy":return _e(r);case"yyyyy":return _e(d);case"yyyyyy":return _e(n);case"M":return _e(s);case"MM":return _e(a);case"MMM":return va(e.months("short",!0),1);case"MMMM":return va(e.months("long",!0),1);case"L":return _e(s);case"LL":return _e(a);case"LLL":return va(e.months("short",!1),1);case"LLLL":return va(e.months("long",!1),1);case"d":return _e(s);case"dd":return _e(a);case"o":return _e(c);case"ooo":return _e(i);case"HH":return _e(a);case"H":return _e(s);case"hh":return _e(a);case"h":return _e(s);case"mm":return _e(a);case"m":return _e(s);case"q":return _e(s);case"qq":return _e(a);case"s":return _e(s);case"ss":return _e(a);case"S":return _e(c);case"SSS":return _e(i);case"u":return tg(l);case"uu":return tg(s);case"uuu":return _e(t);case"a":return va(e.meridiems(),0);case"kkkk":return _e(r);case"kk":return _e(u,Mk);case"W":return _e(s);case"WW":return _e(a);case"E":case"c":return _e(t);case"EEE":return va(e.weekdays("short",!1),1);case"EEEE":return va(e.weekdays("long",!1),1);case"ccc":return va(e.weekdays("short",!0),1);case"cccc":return va(e.weekdays("long",!0),1);case"Z":case"ZZ":return WI(new RegExp(`([+-]${s.source})(?::(${a.source}))?`),2);case"ZZZ":return WI(new RegExp(`([+-]${s.source})(${a.source})?`),2);case"z":return tg(/[a-z_+-/]{1,256}?/i);case" ":return tg(/[^\S\n\r]/);default:return g(w)}})(o)||{invalidReason:rG};return k.token=o,k}var lG={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function uG(o,e,t){let{type:a,value:i}=o;if(a==="literal"){let c=/^\s+$/.test(i);return{literal:!c,val:c?" ":i}}let r=e[a],n=a;a==="hour"&&(e.hour12!=null?n=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?n="hour12":n="hour24":n=t.hour12?"hour12":"hour24");let s=lG[n];if(typeof s=="object"&&(s=s[r]),s)return{literal:!1,val:s}}function dG(o){return[`^${o.map(t=>t.regex).reduce((t,a)=>`${t}(${a.source})`,"")}$`,o]}function gG(o,e,t){let a=o.match(e);if(a){let i={},r=1;for(let n in t)if(hc(t,n)){let s=t[n],c=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(a.slice(r,r+c))),r+=c}return[a,i]}else return[a,{}]}function pG(o){let e=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},t=null,a;return ue(o.z)||(t=pr.create(o.z)),ue(o.Z)||(t||(t=new zt(o.Z)),a=o.Z),ue(o.q)||(o.M=(o.q-1)*3+1),ue(o.h)||(o.h<12&&o.a===1?o.h+=12:o.h===12&&o.a===0&&(o.h=0)),o.G===0&&o.y&&(o.y=-o.y),ue(o.u)||(o.S=Hk(o.u)),[Object.keys(o).reduce((r,n)=>{let s=e(n);return s&&(r[s]=o[n]),r},{}),t,a]}var Ak=null;function hG(){return Ak||(Ak=Ke.fromMillis(1555555555555)),Ak}function fG(o,e){if(o.literal)return o;let t=vt.macroTokenToFormatOpts(o.val),a=ej(t,e);return a==null||a.includes(void 0)?o:a}function K2(o,e){return Array.prototype.concat(...o.map(t=>fG(t,e)))}var pg=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=K2(vt.parseFormat(t),e),this.units=this.tokens.map(a=>mG(a,e)),this.disqualifyingUnit=this.units.find(a=>a.invalidReason),!this.disqualifyingUnit){let[a,i]=dG(this.units);this.regex=RegExp(a,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){let[t,a]=gG(e,this.regex,this.handlers),[i,r,n]=a?pG(a):[null,null,void 0];if(hc(a,"a")&&hc(a,"H"))throw new Xr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:a,result:i,zone:r,specificOffset:n}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function X2(o,e,t){return new pg(o,t).explainFromTokens(e)}function bG(o,e,t){let{result:a,zone:i,specificOffset:r,invalidReason:n}=X2(o,e,t);return[a,i,r,n]}function ej(o,e){if(!o)return null;let a=vt.create(e,o).dtFormatter(hG()),i=a.formatToParts(),r=a.resolvedOptions();return i.map(n=>uG(n,o,r))}var vk="Invalid DateTime",ZI=864e13;function ml(o){return new wt("unsupported zone",`the zone "${o.name}" is not supported`)}function wk(o){return o.weekData===null&&(o.weekData=ug(o.c)),o.weekData}function xk(o){return o.localWeekData===null&&(o.localWeekData=ug(o.c,o.loc.getMinDaysInFirstWeek(),o.loc.getStartOfWeek())),o.localWeekData}function Xn(o,e){let t={ts:o.ts,zone:o.zone,c:o.c,o:o.o,loc:o.loc,invalid:o.invalid};return new Ke({...t,...e,old:t})}function oj(o,e,t){let a=o-e*60*1e3,i=t.offset(a);if(e===i)return[a,e];a-=(i-e)*60*1e3;let r=t.offset(a);return i===r?[a,i]:[o-Math.min(i,r)*60*1e3,Math.max(i,r)]}function ag(o,e){o+=e*60*1e3;let t=new Date(o);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function rg(o,e,t){return oj(fg(o),e,t)}function KI(o,e){let t=o.o,a=o.c.year+Math.trunc(e.years),i=o.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,r={...o.c,year:a,month:i,day:Math.min(o.c.day,dg(a,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},n=Ao.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),s=fg(r),[c,m]=oj(s,t,o.zone);return n!==0&&(c+=n,m=o.zone.offset(c)),{ts:c,o:m}}function dc(o,e,t,a,i,r){let{setZone:n,zone:s}=t;if(o&&Object.keys(o).length!==0||e){let c=e||s,m=Ke.fromObject(o,{...t,zone:c,specificOffset:r});return n?m:m.setZone(s)}else return Ke.invalid(new wt("unparsable",`the input "${i}" can't be parsed as ${a}`))}function ig(o,e,t=!0){return o.isValid?vt.create(Fe.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(o,e):null}function zk(o,e,t){let a=o.c.year>9999||o.c.year<0,i="";if(a&&o.c.year>=0&&(i+="+"),i+=ho(o.c.year,a?6:4),t==="year")return i;if(e){if(i+="-",i+=ho(o.c.month),t==="month")return i;i+="-"}else if(i+=ho(o.c.month),t==="month")return i;return i+=ho(o.c.day),i}function XI(o,e,t,a,i,r,n){let s=!t||o.c.millisecond!==0||o.c.second!==0,c="";switch(n){case"day":case"month":case"year":break;default:if(c+=ho(o.c.hour),n==="hour")break;if(e){if(c+=":",c+=ho(o.c.minute),n==="minute")break;s&&(c+=":",c+=ho(o.c.second))}else{if(c+=ho(o.c.minute),n==="minute")break;s&&(c+=ho(o.c.second))}if(n==="second")break;s&&(!a||o.c.millisecond!==0)&&(c+=".",c+=ho(o.c.millisecond,3))}return i&&(o.isOffsetFixed&&o.offset===0&&!r?c+="Z":o.o<0?(c+="-",c+=ho(Math.trunc(-o.o/60)),c+=":",c+=ho(Math.trunc(-o.o%60))):(c+="+",c+=ho(Math.trunc(o.o/60)),c+=":",c+=ho(Math.trunc(o.o%60)))),r&&(c+="["+o.zone.ianaName+"]"),c}var tj={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},yG={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},kG={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ng=["year","month","day","hour","minute","second","millisecond"],AG=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],vG=["year","ordinal","hour","minute","second","millisecond"];function sg(o){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[o.toLowerCase()];if(!e)throw new cg(o);return e}function e2(o){switch(o.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return sg(o)}}function wG(o){if(ll===void 0&&(ll=Ye.now()),o.type!=="iana")return o.offset(ll);let e=o.name,t=Lk.get(e);return t===void 0&&(t=o.offset(ll),Lk.set(e,t)),t}function o2(o,e){let t=Kr(e.zone,Ye.defaultZone);if(!t.isValid)return Ke.invalid(ml(t));let a=Fe.fromObject(e),i,r;if(ue(o.year))i=Ye.now();else{for(let c of ng)ue(o[c])&&(o[c]=tj[c]);let n=C2(o)||S2(o);if(n)return Ke.invalid(n);let s=wG(t);[i,r]=rg(o,s,t)}return new Ke({ts:i,zone:t,loc:a,o:r})}function t2(o,e,t){let a=ue(t.round)?!0:t.round,i=ue(t.rounding)?"trunc":t.rounding,r=(s,c)=>(s=Gk(s,a||t.calendary?0:2,t.calendary?"round":i),e.loc.clone(t).relFormatter(t).format(s,c)),n=s=>t.calendary?e.hasSame(o,s)?0:e.startOf(s).diff(o.startOf(s),s).get(s):e.diff(o,s).get(s);if(t.unit)return r(n(t.unit),t.unit);for(let s of t.units){let c=n(s);if(Math.abs(c)>=1)return r(c,s)}return r(o>e?-0:0,t.units[t.units.length-1])}function a2(o){let e={},t;return o.length>0&&typeof o[o.length-1]=="object"?(e=o[o.length-1],t=Array.from(o).slice(0,o.length-1)):t=Array.from(o),[e,t]}var ll,Lk=new Map,Ke=class o{constructor(e){let t=e.zone||Ye.defaultZone,a=e.invalid||(Number.isNaN(e.ts)?new wt("invalid input"):null)||(t.isValid?null:ml(t));this.ts=ue(e.ts)?Ye.now():e.ts;let i=null,r=null;if(!a)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[i,r]=[e.old.c,e.old.o];else{let s=en(e.o)&&!e.old?e.o:t.offset(this.ts);i=ag(this.ts,s),a=Number.isNaN(i.year)?new wt("invalid input"):null,i=a?null:i,r=a?null:s}this._zone=t,this.loc=e.loc||Fe.create(),this.invalid=a,this.weekData=null,this.localWeekData=null,this.c=i,this.o=r,this.isLuxonDateTime=!0}static now(){return new o({})}static local(){let[e,t]=a2(arguments),[a,i,r,n,s,c,m]=t;return o2({year:a,month:i,day:r,hour:n,minute:s,second:c,millisecond:m},e)}static utc(){let[e,t]=a2(arguments),[a,i,r,n,s,c,m]=t;return e.zone=zt.utcInstance,o2({year:a,month:i,day:r,hour:n,minute:s,second:c,millisecond:m},e)}static fromJSDate(e,t={}){let a=eH(e)?e.valueOf():NaN;if(Number.isNaN(a))return o.invalid("invalid input");let i=Kr(t.zone,Ye.defaultZone);return i.isValid?new o({ts:a,zone:i,loc:Fe.fromObject(t)}):o.invalid(ml(i))}static fromMillis(e,t={}){if(en(e))return e<-ZI||e>ZI?o.invalid("Timestamp out of range"):new o({ts:e,zone:Kr(t.zone,Ye.defaultZone),loc:Fe.fromObject(t)});throw new Eo(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(en(e))return new o({ts:e*1e3,zone:Kr(t.zone,Ye.defaultZone),loc:Fe.fromObject(t)});throw new Eo("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};let a=Kr(t.zone,Ye.defaultZone);if(!a.isValid)return o.invalid(ml(a));let i=Fe.fromObject(t),r=gg(e,e2),{minDaysInFirstWeek:n,startOfWeek:s}=MI(r,i),c=Ye.now(),m=ue(t.specificOffset)?a.offset(c):t.specificOffset,l=!ue(r.ordinal),u=!ue(r.year),d=!ue(r.month)||!ue(r.day),g=u||d,h=r.weekYear||r.weekNumber;if((g||l)&&h)throw new Xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&l)throw new Xr("Can't mix ordinal dates with month/day");let k=h||r.weekday&&!g,w,x,E=ag(c,m);k?(w=AG,x=yG,E=ug(E,n,s)):l?(w=vG,x=kG,E=kk(E)):(w=ng,x=tj);let q=!1;for(let ve of w){let xe=r[ve];ue(xe)?q?r[ve]=x[ve]:r[ve]=E[ve]:q=!0}let _=k?Z$(r,n,s):l?K$(r):C2(r),D=_||S2(r);if(D)return o.invalid(D);let H=k?OI(r,n,s):l?UI(r):r,[J,X]=rg(H,m,a),Y=new o({ts:J,zone:a,o:X,loc:i});return r.weekday&&g&&e.weekday!==Y.weekday?o.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${Y.toISO()}`):Y.isValid?Y:o.invalid(Y.invalid)}static fromISO(e,t={}){let[a,i]=FH(e);return dc(a,i,t,"ISO 8601",e)}static fromRFC2822(e,t={}){let[a,i]=$H(e);return dc(a,i,t,"RFC 2822",e)}static fromHTTP(e,t={}){let[a,i]=HH(e);return dc(a,i,t,"HTTP",t)}static fromFormat(e,t,a={}){if(ue(e)||ue(t))throw new Eo("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:r=null}=a,n=Fe.fromOpts({locale:i,numberingSystem:r,defaultToEN:!0}),[s,c,m,l]=bG(n,e,t);return l?o.invalid(l):dc(s,c,a,`format ${t}`,e,m)}static fromString(e,t,a={}){return o.fromFormat(e,t,a)}static fromSQL(e,t={}){let[a,i]=KH(e);return dc(a,i,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Eo("need to specify a reason the DateTime is invalid");let a=e instanceof wt?e:new wt(e,t);if(Ye.throwOnInvalid)throw new qk(a);return new o({invalid:a})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let a=ej(e,Fe.fromObject(t));return a?a.map(i=>i?i.val:null).join(""):null}static expandFormat(e,t={}){return K2(vt.parseFormat(e),Fe.fromObject(t)).map(i=>i.val).join("")}static resetCache(){ll=void 0,Lk.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?wk(this).weekYear:NaN}get weekNumber(){return this.isValid?wk(this).weekNumber:NaN}get weekday(){return this.isValid?wk(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?xk(this).weekday:NaN}get localWeekNumber(){return this.isValid?xk(this).weekNumber:NaN}get localWeekYear(){return this.isValid?xk(this).weekYear:NaN}get ordinal(){return this.isValid?kk(this.c).ordinal:NaN}get monthShort(){return this.isValid?os.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?os.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?os.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?os.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,a=fg(this.c),i=this.zone.offset(a-e),r=this.zone.offset(a+e),n=this.zone.offset(a-i*t),s=this.zone.offset(a-r*t);if(n===s)return[this];let c=a-n*t,m=a-s*t,l=ag(c,n),u=ag(m,s);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[Xn(this,{ts:c}),Xn(this,{ts:m})]:[this]}get isInLeapYear(){return pl(this.year)}get daysInMonth(){return dg(this.year,this.month)}get daysInYear(){return this.isValid?gc(this.year):NaN}get weeksInWeekYear(){return this.isValid?gl(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?gl(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:a,calendar:i}=vt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:a,outputCalendar:i}}toUTC(e=0,t={}){return this.setZone(zt.instance(e),t)}toLocal(){return this.setZone(Ye.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:a=!1}={}){if(e=Kr(e,Ye.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(t||a){let r=e.offset(this.ts),n=this.toObject();[i]=rg(n,r,e)}return Xn(this,{ts:i,zone:e})}else return o.invalid(ml(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:a}={}){let i=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:a});return Xn(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=gg(e,e2),{minDaysInFirstWeek:a,startOfWeek:i}=MI(t,this.loc),r=!ue(t.weekYear)||!ue(t.weekNumber)||!ue(t.weekday),n=!ue(t.ordinal),s=!ue(t.year),c=!ue(t.month)||!ue(t.day),m=s||c,l=t.weekYear||t.weekNumber;if((m||n)&&l)throw new Xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&n)throw new Xr("Can't mix ordinal dates with month/day");let u;r?u=OI({...ug(this.c,a,i),...t},a,i):ue(t.ordinal)?(u={...this.toObject(),...t},ue(t.day)&&(u.day=Math.min(dg(u.year,u.month),u.day))):u=UI({...kk(this.c),...t});let[d,g]=rg(u,this.o,this.zone);return Xn(this,{ts:d,o:g})}plus(e){if(!this.isValid)return this;let t=Ao.fromDurationLike(e);return Xn(this,KI(this,t))}minus(e){if(!this.isValid)return this;let t=Ao.fromDurationLike(e).negate();return Xn(this,KI(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let a={},i=Ao.normalizeUnit(e);switch(i){case"years":a.month=1;case"quarters":case"months":a.day=1;case"weeks":case"days":a.hour=0;case"hours":a.minute=0;case"minutes":a.second=0;case"seconds":a.millisecond=0;break}if(i==="weeks")if(t){let r=this.loc.getStartOfWeek(),{weekday:n}=this;n<r&&(a.weekNumber=this.weekNumber-1),a.weekday=r}else a.weekday=1;if(i==="quarters"){let r=Math.ceil(this.month/3);a.month=(r-1)*3+1}return this.set(a)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?vt.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):vk}toLocaleString(e=mg,t={}){return this.isValid?vt.create(this.loc.clone(t),e).formatDateTime(this):vk}toLocaleParts(e={}){return this.isValid?vt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:a=!1,includeOffset:i=!0,extendedZone:r=!1,precision:n="milliseconds"}={}){if(!this.isValid)return null;n=sg(n);let s=e==="extended",c=zk(this,s,n);return ng.indexOf(n)>=3&&(c+="T"),c+=XI(this,s,t,a,i,r,n),c}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?zk(this,e==="extended",sg(t)):null}toISOWeekDate(){return ig(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:a=!0,includePrefix:i=!1,extendedZone:r=!1,format:n="extended",precision:s="milliseconds"}={}){return this.isValid?(s=sg(s),(i&&ng.indexOf(s)>=3?"T":"")+XI(this,n==="extended",t,e,a,r,s)):null}toRFC2822(){return ig(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ig(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?zk(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:a=!0}={}){let i="HH:mm:ss.SSS";return(t||e)&&(a&&(i+=" "),t?i+="z":e&&(i+="ZZ")),ig(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():vk}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",a={}){if(!this.isValid||!e.isValid)return Ao.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...a},r=oH(t).map(Ao.normalizeUnit),n=e.valueOf()>this.valueOf(),s=n?this:e,c=n?e:this,m=iG(s,c,r,i);return n?m.negate():m}diffNow(e="milliseconds",t={}){return this.diff(o.now(),e,t)}until(e){return this.isValid?ts.fromDateTimes(this,e):this}hasSame(e,t,a){if(!this.isValid)return!1;let i=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t,a)<=i&&i<=r.endOf(t,a)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let t=e.base||o.fromObject({},{zone:this.zone}),a=e.padding?this<t?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],r=e.unit;return Array.isArray(e.unit)&&(i=e.unit,r=void 0),t2(t,this.plus(a),{...e,numeric:"always",units:i,unit:r})}toRelativeCalendar(e={}){return this.isValid?t2(e.base||o.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(o.isDateTime))throw new Eo("min requires all arguments be DateTimes");return LI(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(o.isDateTime))throw new Eo("max requires all arguments be DateTimes");return LI(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,a={}){let{locale:i=null,numberingSystem:r=null}=a,n=Fe.fromOpts({locale:i,numberingSystem:r,defaultToEN:!0});return X2(n,e,t)}static fromStringExplain(e,t,a={}){return o.fromFormatExplain(e,t,a)}static buildFormatParser(e,t={}){let{locale:a=null,numberingSystem:i=null}=t,r=Fe.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});return new pg(r,e)}static fromFormatParser(e,t,a={}){if(ue(e)||ue(t))throw new Eo("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:r=null}=a,n=Fe.fromOpts({locale:i,numberingSystem:r,defaultToEN:!0});if(!n.equals(t.locale))throw new Eo(`fromFormatParser called with a locale of ${n}, but the format parser was created for ${t.locale}`);let{result:s,zone:c,specificOffset:m,invalidReason:l}=t.explainFromTokens(e);return l?o.invalid(l):dc(s,c,a,`format ${t.format}`,e,m)}static get DATE_SHORT(){return mg}static get DATE_MED(){return i2}static get DATE_MED_WITH_WEEKDAY(){return Q$}static get DATE_FULL(){return r2}static get DATE_HUGE(){return n2}static get TIME_SIMPLE(){return s2}static get TIME_WITH_SECONDS(){return c2}static get TIME_WITH_SHORT_OFFSET(){return m2}static get TIME_WITH_LONG_OFFSET(){return l2}static get TIME_24_SIMPLE(){return u2}static get TIME_24_WITH_SECONDS(){return d2}static get TIME_24_WITH_SHORT_OFFSET(){return g2}static get TIME_24_WITH_LONG_OFFSET(){return p2}static get DATETIME_SHORT(){return h2}static get DATETIME_SHORT_WITH_SECONDS(){return f2}static get DATETIME_MED(){return b2}static get DATETIME_MED_WITH_SECONDS(){return y2}static get DATETIME_MED_WITH_WEEKDAY(){return _$}static get DATETIME_FULL(){return k2}static get DATETIME_FULL_WITH_SECONDS(){return A2}static get DATETIME_HUGE(){return v2}static get DATETIME_HUGE_WITH_SECONDS(){return w2}};function sl(o){if(Ke.isDateTime(o))return o;if(o&&o.valueOf&&en(o.valueOf()))return Ke.fromJSDate(o);if(o&&typeof o=="object")return Ke.fromObject(o);throw new Eo(`Unknown datetime argument: ${o}, of type ${typeof o}`)}var xG="3.7.2";qt.DateTime=Ke;qt.Duration=Ao;qt.FixedOffsetZone=zt;qt.IANAZone=pr;qt.Info=os;qt.Interval=ts;qt.InvalidZone=lg;qt.Settings=Ye;qt.SystemZone=dl;qt.VERSION=xG;qt.Zone=on});var vg=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.CronDate=Wo.DAYS_IN_MONTH=Wo.DateMathOp=Wo.TimeUnit=void 0;var as=aj(),No;(function(o){o.Second="Second",o.Minute="Minute",o.Hour="Hour",o.Day="Day",o.Month="Month",o.Year="Year"})(No||(Wo.TimeUnit=No={}));var kg;(function(o){o.Add="Add",o.Subtract="Subtract"})(kg||(Wo.DateMathOp=kg={}));Wo.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var Ag=class o{#e;#o=null;#a=null;#i={add:{[No.Year]:this.addYear.bind(this),[No.Month]:this.addMonth.bind(this),[No.Day]:this.addDay.bind(this),[No.Hour]:this.addHour.bind(this),[No.Minute]:this.addMinute.bind(this),[No.Second]:this.addSecond.bind(this)},subtract:{[No.Year]:this.subtractYear.bind(this),[No.Month]:this.subtractMonth.bind(this),[No.Day]:this.subtractDay.bind(this),[No.Hour]:this.subtractHour.bind(this),[No.Minute]:this.subtractMinute.bind(this),[No.Second]:this.subtractSecond.bind(this)}};constructor(e,t){let a={zone:t};if(e?e instanceof o?(this.#e=e.#e,this.#o=e.#o,this.#a=e.#a):e instanceof Date?this.#e=as.DateTime.fromJSDate(e,a):typeof e=="number"?this.#e=as.DateTime.fromMillis(e,a):(this.#e=as.DateTime.fromISO(e,a),this.#e.isValid||(this.#e=as.DateTime.fromRFC2822(e,a)),this.#e.isValid||(this.#e=as.DateTime.fromSQL(e,a)),this.#e.isValid||(this.#e=as.DateTime.fromFormat(e,"EEE, d MMM yyyy HH:mm:ss",a))):this.#e=as.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${e}`);t&&t!==this.#e.zoneName&&(this.#e=this.#e.setZone(t))}static#r(e){return e%4===0&&e%100!==0||e%400===0}get dstStart(){return this.#o}set dstStart(e){this.#o=e}get dstEnd(){return this.#a}set dstEnd(e){this.#a=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){this.#i.add[e]()}subtractUnit(e){this.#i.subtract[e]()}invokeDateOperation(e,t){if(e===kg.Add){this.addUnit(t);return}if(e===kg.Subtract){this.subtractUnit(t);return}throw new Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#t().day}getUTCFullYear(){return this.#t().year}getUTCDay(){let e=this.#t().weekday;return e===7?0:e}getUTCMonth(){return this.#t().month-1}getUTCHours(){return this.#t().hour}getUTCMinutes(){return this.#t().minute}getUTCSeconds(){return this.#t().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:e,month:t}=this.#e;if(t===2){let a=o.#r(this.#e.year);return e===Wo.DAYS_IN_MONTH[t-1]-(a?0:1)}return e===Wo.DAYS_IN_MONTH[t-1]}isLastWeekdayOfMonth(){let{day:e,month:t}=this.#e,a;return t===2?a=Wo.DAYS_IN_MONTH[t-1]-(o.#r(this.#e.year)?0:1):a=Wo.DAYS_IN_MONTH[t-1],e>a-7}applyDateOperation(e,t,a){if(t===No.Month||t===No.Day){this.invokeDateOperation(e,t);return}let i=this.getHours();this.invokeDateOperation(e,t);let r=this.getHours(),n=r-i;n===2?a!==24&&(this.dstStart=r):n===0&&this.getMinutes()===0&&this.getSeconds()===0&&a!==24&&(this.dstEnd=r)}#t(){return this.#e.toUTC()}};Wo.CronDate=Ag;Wo.default=Ag});var ij=f(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.CronMonth=void 0;var zG=vg(),qG=Wr(),EG=1,IG=12,jG=Object.freeze([]),Wk=class extends qG.CronField{static get min(){return EG}static get max(){return IG}static get chars(){return jG}static get daysInMonth(){return zG.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}};wg.CronMonth=Wk});var rj=f(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.CronSecond=void 0;var CG=Wr(),SG=0,BG=59,QG=Object.freeze([]),Zk=class extends CG.CronField{static get min(){return SG}static get max(){return BG}static get chars(){return QG}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}};xg.CronSecond=Zk});var zg=f(nt=>{"use strict";var _G=nt&&nt.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),tn=nt&&nt.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&_G(e,o,t)};Object.defineProperty(nt,"__esModule",{value:!0});tn(xI(),nt);tn(zI(),nt);tn(qI(),nt);tn(Wr(),nt);tn(EI(),nt);tn(II(),nt);tn(ij(),nt);tn(rj(),nt)});var Xk=f(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.CronFieldCollection=void 0;var Jt=zg(),Kk=class o{#e;#o;#a;#i;#r;#t;static from(e,t){return new o({second:this.resolveField(Jt.CronSecond,e.second,t.second),minute:this.resolveField(Jt.CronMinute,e.minute,t.minute),hour:this.resolveField(Jt.CronHour,e.hour,t.hour),dayOfMonth:this.resolveField(Jt.CronDayOfMonth,e.dayOfMonth,t.dayOfMonth),month:this.resolveField(Jt.CronMonth,e.month,t.month),dayOfWeek:this.resolveField(Jt.CronDayOfWeek,e.dayOfWeek,t.dayOfWeek)})}static resolveField(e,t,a){return a?a instanceof Jt.CronField?a:new e(a):t}constructor({second:e,minute:t,hour:a,dayOfMonth:i,month:r,dayOfWeek:n}){if(!e)throw new Error("Validation error, Field second is missing");if(!t)throw new Error("Validation error, Field minute is missing");if(!a)throw new Error("Validation error, Field hour is missing");if(!i)throw new Error("Validation error, Field dayOfMonth is missing");if(!r)throw new Error("Validation error, Field month is missing");if(!n)throw new Error("Validation error, Field dayOfWeek is missing");if(r.values.length===1&&!i.hasLastChar&&!(parseInt(i.values[0],10)<=Jt.CronMonth.daysInMonth[r.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=e,this.#o=t,this.#a=a,this.#r=r,this.#t=n,this.#i=i}get second(){return this.#e}get minute(){return this.#o}get hour(){return this.#a}get dayOfMonth(){return this.#i}get month(){return this.#r}get dayOfWeek(){return this.#t}static compactField(e){if(e.length===0)return[];let t=[],a;return e.forEach((i,r,n)=>{if(a===void 0){a={start:i,count:1};return}let s=n[r-1]||a.start,c=n[r+1];if(i==="L"||i==="W"){t.push(a),t.push({start:i,count:1}),a=void 0;return}if(a.step===void 0&&c!==void 0){let m=i-s,l=c-i;if(m<=l){a={...a,count:2,end:i,step:m};return}a.step=1}i-(a.end??0)===a.step?(a.count++,a.end=i):(a.count===1?t.push({start:a.start,count:1}):a.count===2?(t.push({start:a.start,count:1}),t.push({start:a.end??s,count:1})):t.push(a),a={start:i,count:1})}),a&&t.push(a),t}static#c(e,t,a){let i=t.step;return i?i===1&&t.start===e.min&&t.end&&t.end>=a?e.hasQuestionMarkChar?"?":"*":i!==1&&t.start===e.min&&t.end&&t.end>=a-i+1?`*/${i}`:null:null}static#n(e,t){let a=e.step;if(a===1)return`${e.start}-${e.end}`;let i=e.start===0?e.count-1:e.count;if(!a)throw new Error("Unexpected range step");if(!e.end)throw new Error("Unexpected range end");if(a*i>e.end){let r=(s,c)=>{if(typeof e.start!="number")throw new Error("Unexpected range start");return c%a===0?e.start+c:null};if(typeof e.start!="number")throw new Error("Unexpected range start");let n={length:e.end-e.start+1};return Array.from(n,r).filter(s=>s!==null).join(",")}return e.end===t-a+1?`${e.start}/${a}`:`${e.start}-${e.end}/${a}`}stringifyField(e){let t=e.max,a=e.values;if(e instanceof Jt.CronDayOfWeek){t=6;let r=this.#t.values;a=r[r.length-1]===7?r.slice(0,-1):r}e instanceof Jt.CronDayOfMonth&&(t=this.#r.values.length===1?Jt.CronMonth.daysInMonth[this.#r.values[0]-1]:e.max);let i=o.compactField(a);if(i.length===1){let r=o.#c(e,i[0],t);if(r)return r}return i.map(r=>{let n=r.count===1?r.start.toString():o.#n(r,t);return e instanceof Jt.CronDayOfWeek&&e.nthDay>0?`${n}#${e.nthDay}`:n}).join(",")}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#o),this.stringifyField(this.#a),this.stringifyField(this.#i),this.stringifyField(this.#r),this.stringifyField(this.#t)),t.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#o.serialize(),hour:this.#a.serialize(),dayOfMonth:this.#i.serialize(),month:this.#r.serialize(),dayOfWeek:this.#t.serialize()}}};qg.CronFieldCollection=Kk});var eA=f(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.CronExpression=Wt.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=Wt.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var io=vg();Wt.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range";Wt.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";var nj=1e4,Eg=class o{#e;#o;#a;#i;#r;#t;#c=null;#n=!1;constructor(e,t){this.#e=t,this.#o=t.tz,this.#i=t.startDate?new io.CronDate(t.startDate,this.#o):null,this.#r=t.endDate?new io.CronDate(t.endDate,this.#o):null;let a=t.currentDate??t.startDate;if(a){let i=new io.CronDate(a,this.#o);this.#i&&i.getTime()<this.#i.getTime()?a=this.#i:this.#r&&i.getTime()>this.#r.getTime()&&(a=this.#r)}this.#a=new io.CronDate(a,this.#o),this.#t=e}get fields(){return this.#t}static fieldsToExpression(e,t){return new o(e,t||{})}static#s(e,t){return t.some(a=>a===e)}#m(e,t){return e[t?e.length-1:0]}#u(e){let t=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#c===t)return this.#n;let a=new io.CronDate(e);a.setStartOfDay();let i=new io.CronDate(e);return i.setEndOfDay(),this.#c=t,this.#n=a.getUTCOffset()!==i.getUTCOffset(),this.#n}#l(e,t,a){let i=this.#t.second.values,r=e.getSeconds(),n=this.#t.second.findNearestValue(r,a);if(n!==null){e.setSeconds(n);return}e.applyDateOperation(t,io.TimeUnit.Minute,this.#t.hour.values.length),e.setSeconds(this.#m(i,a))}#d(e,t,a){let i=this.#t.minute.values,r=this.#t.second.values,n=e.getMinutes(),s=this.#t.minute.findNearestValue(n,a);if(s!==null){e.setMinutes(s),e.setSeconds(this.#m(r,a));return}e.applyDateOperation(t,io.TimeUnit.Hour,this.#t.hour.values.length),e.setMinutes(this.#m(i,a)),e.setSeconds(this.#m(r,a))}static#p(e,t){let a=t.isLastWeekdayOfMonth();return e.some(i=>{let r=parseInt(i.toString().charAt(0),10)%7;if(Number.isNaN(r))throw new Error(`Invalid last weekday of the month expression: ${i}`);return t.getDay()===r&&a})}next(){return this.#f()}prev(){return this.#f(!0)}hasNext(){let e=this.#a;try{return this.#f(),!0}catch{return!1}finally{this.#a=e}}hasPrev(){let e=this.#a;try{return this.#f(!0),!0}catch{return!1}finally{this.#a=e}}take(e){let t=[];if(e>=0)for(let a=0;a<e;a++)try{t.push(this.next())}catch{return t}else for(let a=0;a>e;a--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#a=new io.CronDate(e||this.#e.currentDate)}stringify(e=!1){return this.#t.stringify(e)}includesDate(e){let{second:t,minute:a,hour:i,month:r}=this.#t,n=new io.CronDate(e,this.#o);return!(!t.values.includes(n.getSeconds())||!a.values.includes(n.getMinutes())||!i.values.includes(n.getHours())||!r.values.includes(n.getMonth()+1)||!this.#g(n)||this.#t.dayOfWeek.nthDay>0&&Math.ceil(n.getDate()/7)!==this.#t.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#g(e){let t=this.#t.dayOfMonth.isWildcard,a=!t,i=this.#t.dayOfWeek.isWildcard,r=!i,n=o.#s(e.getDate(),this.#t.dayOfMonth.values)||this.#t.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=o.#s(e.getDay(),this.#t.dayOfWeek.values)||this.#t.dayOfWeek.hasLastChar&&o.#p(this.#t.dayOfWeek.values,e);return!!(a&&r&&(n||s)||n&&!r||t&&!i&&s)}#b(e,t,a){let i=this.#t.hour.values,r=i,n=e.getHours(),s=o.#s(n,i),c=e.dstStart===n,m=e.dstEnd===n;if(c)return o.#s(n-1,i)?!0:(e.invokeDateOperation(t,io.TimeUnit.Hour),!1);if(m&&!a)return e.dstEnd=null,e.applyDateOperation(io.DateMathOp.Add,io.TimeUnit.Hour,r.length),!1;if(s)return!0;e.dstStart=null;let l=this.#t.hour.findNearestValue(n,a);if(l===null)return e.applyDateOperation(t,io.TimeUnit.Day,r.length),!1;if(this.#u(e)){let u=a?n-l:l-n;for(let d=0;d<u;d++)e.applyDateOperation(t,io.TimeUnit.Hour,r.length)}else e.setHours(l);return e.setMinutes(this.#m(this.#t.minute.values,a)),e.setSeconds(this.#m(this.#t.second.values,a)),!1}#h(e){if(!this.#i&&!this.#r)return;let t=e.getTime();if(this.#i&&t<this.#i.getTime())throw new Error(Wt.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#r&&t>this.#r.getTime())throw new Error(Wt.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#f(e=!1){let t=e?io.DateMathOp.Subtract:io.DateMathOp.Add,a=new io.CronDate(this.#a),i=a.getTime(),r=0;for(;++r<nj;){if(this.#h(a),!this.#g(a)){a.applyDateOperation(t,io.TimeUnit.Day,this.#t.hour.values.length);continue}if(!(this.#t.dayOfWeek.nthDay<=0||Math.ceil(a.getDate()/7)===this.#t.dayOfWeek.nthDay)){a.applyDateOperation(t,io.TimeUnit.Day,this.#t.hour.values.length);continue}if(!o.#s(a.getMonth()+1,this.#t.month.values)){a.applyDateOperation(t,io.TimeUnit.Month,this.#t.hour.values.length);continue}if(this.#b(a,t,e)){if(!o.#s(a.getMinutes(),this.#t.minute.values)){this.#d(a,t,e);continue}if(!o.#s(a.getSeconds(),this.#t.second.values)){this.#l(a,t,e);continue}if(i===a.getTime()){(t==="Add"||a.getMilliseconds()===0)&&a.applyDateOperation(t,io.TimeUnit.Second,this.#t.hour.values.length);continue}break}}if(r>nj)throw new Error(Wt.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return a.getMilliseconds()!==0&&a.setMilliseconds(0),this.#a=a,a}[Symbol.iterator](){return{next:()=>({value:this.#f(),done:!this.hasNext()})}}};Wt.CronExpression=Eg;Wt.default=Eg});var sj=f(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.seededRandom=RG;function DG(o){let e=2166136261;for(let t=0;t<o.length;t++)e^=o.charCodeAt(t),e=Math.imul(e,16777619);return()=>e>>>0}function TG(o){return()=>{let e=o+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function RG(o){let e=o?DG(o)():Math.floor(Math.random()*1e10);return TG(e)}});var Ig=f(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.CronExpressionParser=Xt.DayOfWeek=Xt.Months=Xt.CronUnit=Xt.PredefinedExpressions=void 0;var NG=Xk(),OG=eA(),UG=sj(),Zt=zg(),tA;(function(o){o["@yearly"]="0 0 0 1 1 *",o["@annually"]="0 0 0 1 1 *",o["@monthly"]="0 0 0 1 * *",o["@weekly"]="0 0 0 * * 0",o["@daily"]="0 0 0 * * *",o["@hourly"]="0 0 * * * *",o["@minutely"]="0 * * * * *",o["@secondly"]="* * * * * *",o["@weekdays"]="0 0 0 * * 1-5",o["@weekends"]="0 0 0 * * 0,6"})(tA||(Xt.PredefinedExpressions=tA={}));var Kt;(function(o){o.Second="Second",o.Minute="Minute",o.Hour="Hour",o.DayOfMonth="DayOfMonth",o.Month="Month",o.DayOfWeek="DayOfWeek"})(Kt||(Xt.CronUnit=Kt={}));var aA;(function(o){o[o.jan=1]="jan",o[o.feb=2]="feb",o[o.mar=3]="mar",o[o.apr=4]="apr",o[o.may=5]="may",o[o.jun=6]="jun",o[o.jul=7]="jul",o[o.aug=8]="aug",o[o.sep=9]="sep",o[o.oct=10]="oct",o[o.nov=11]="nov",o[o.dec=12]="dec"})(aA||(Xt.Months=aA={}));var iA;(function(o){o[o.sun=0]="sun",o[o.mon=1]="mon",o[o.tue=2]="tue",o[o.wed=3]="wed",o[o.thu=4]="thu",o[o.fri=5]="fri",o[o.sat=6]="sat"})(iA||(Xt.DayOfWeek=iA={}));var rA=class o{static parse(e,t={}){let{strict:a=!1,hashSeed:i}=t,r=(0,UG.seededRandom)(i);e=tA[e]||e;let n=o.#e(e,a);if(!(n.dayOfMonth==="*"||n.dayOfWeek==="*"||!a))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");let s=o.#o(Kt.Second,n.second,Zt.CronSecond.constraints,r),c=o.#o(Kt.Minute,n.minute,Zt.CronMinute.constraints,r),m=o.#o(Kt.Hour,n.hour,Zt.CronHour.constraints,r),l=o.#o(Kt.Month,n.month,Zt.CronMonth.constraints,r),u=o.#o(Kt.DayOfMonth,n.dayOfMonth,Zt.CronDayOfMonth.constraints,r),{dayOfWeek:d,nthDayOfWeek:g}=o.#u(n.dayOfWeek),h=o.#o(Kt.DayOfWeek,d,Zt.CronDayOfWeek.constraints,r),k=new NG.CronFieldCollection({second:new Zt.CronSecond(s,{rawValue:n.second}),minute:new Zt.CronMinute(c,{rawValue:n.minute}),hour:new Zt.CronHour(m,{rawValue:n.hour}),dayOfMonth:new Zt.CronDayOfMonth(u,{rawValue:n.dayOfMonth}),month:new Zt.CronMonth(l,{rawValue:n.month}),dayOfWeek:new Zt.CronDayOfWeek(h,{rawValue:n.dayOfWeek,nthDayOfWeek:g})});return new OG.CronExpression(k,{...t,expression:e})}static#e(e,t){if(t&&!e.length)throw new Error("Invalid cron expression");e=e||"0 * * * * *";let a=e.trim().split(/\s+/);if(t&&a.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(a.length>6)throw new Error("Invalid cron expression, too many fields");let i=["*","*","*","*","*","0"];a.length<i.length&&a.unshift(...i.slice(a.length));let[r,n,s,c,m,l]=a;return{second:r,minute:n,hour:s,dayOfMonth:c,month:m,dayOfWeek:l}}static#o(e,t,a,i){if((e===Kt.Month||e===Kt.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,r=>{r=r.toLowerCase();let n=aA[r]||iA[r];if(n===void 0)throw new Error(`Validation error, cannot resolve alias "${r}"`);return n.toString()})),!a.validChars.test(t))throw new Error(`Invalid characters, got value: ${t}`);return t=this.#a(t,a),t=this.#i(t,a,i),this.#r(e,t,a)}static#a(e,t){return e.replace(/[*?]/g,t.min+"-"+t.max)}static#i(e,t,a){let i=a();return e.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(r,n,s,c)=>{if(n&&s&&c){let m=parseInt(n,10),l=parseInt(s,10),u=parseInt(c,10);if(m>l)throw new Error(`Invalid range: ${m}-${l}, min > max`);if(u<=0)throw new Error(`Invalid step: ${u}, must be positive`);let d=Math.max(m,t.min),g=Math.floor(i*u),h=[];for(let k=Math.floor(d/u)*u+g;k<=l;k+=u)k>=d&&h.push(k);return h.join(",")}else if(n&&s){let m=parseInt(n,10),l=parseInt(s,10);if(m>l)throw new Error(`Invalid range: ${m}-${l}, min > max`);return String(Math.floor(i*(l-m+1))+m)}else if(c){let m=parseInt(c,10);if(m<=0)throw new Error(`Invalid step: ${m}, must be positive`);let l=Math.floor(i*m),u=[];for(let d=Math.floor(t.min/m)*m+l;d<=t.max;d+=m)d>=t.min&&u.push(d);return u.join(",")}else return String(Math.floor(i*(t.max-t.min+1)+t.min))})}static#r(e,t,a){let i=[];function r(s,c){if(Array.isArray(s))i.push(...s);else if(o.#l(c,s))i.push(s);else{let m=parseInt(s.toString(),10);if(!(m>=c.min&&m<=c.max))throw new Error(`Constraint error, got value ${s} expected range ${c.min}-${c.max}`);i.push(e===Kt.DayOfWeek?m%7:s)}}return t.split(",").forEach(s=>{if(!(s.length>0))throw new Error("Invalid list value format");r(o.#t(e,s,a),a)}),i}static#t(e,t,a){let i=t.split("/");if(i.length>2)throw new Error(`Invalid repeat: ${t}`);return i.length===2?(isNaN(parseInt(i[0],10))||(i[0]=`${i[0]}-${a.max}`),o.#m(e,i[0],parseInt(i[1],10),a)):o.#m(e,t,1,a)}static#c(e,t,a){if(!(!isNaN(e)&&!isNaN(t)&&e>=a.min&&t<=a.max))throw new Error(`Constraint error, got range ${e}-${t} expected range ${a.min}-${a.max}`);if(e>t)throw new Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#n(e){if(!(!isNaN(e)&&e>0))throw new Error(`Constraint error, cannot repeat at every ${e} time.`)}static#s(e,t,a,i){let r=[];e===Kt.DayOfWeek&&a%7===0&&r.push(0);for(let n=t;n<=a;n+=i)r.indexOf(n)===-1&&r.push(n);return r}static#m(e,t,a,i){let r=t.split("-");if(r.length<=1)return isNaN(+t)?t:+t;let[n,s]=r.map(c=>parseInt(c,10));return this.#c(n,s,i),this.#n(a),this.#s(e,n,s,a)}static#u(e){let t=e.split("#");if(t.length<=1)return{dayOfWeek:t[0]};let a=+t[t.length-1],i=e.match(/([,-/])/);if(i!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${i?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(a)&&a>=1&&a<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:t[0],nthDayOfWeek:a}}static#l(e,t){return e.chars.some(a=>t.toString().includes(a))}};Xt.CronExpressionParser=rA});var cj=f(Oa=>{"use strict";var MG=Oa&&Oa.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),LG=Oa&&Oa.__setModuleDefault||(Object.create?(function(o,e){Object.defineProperty(o,"default",{enumerable:!0,value:e})}):function(o,e){o.default=e}),PG=Oa&&Oa.__importStar||(function(){var o=function(e){return o=Object.getOwnPropertyNames||function(t){var a=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(a[a.length]=i);return a},o(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var a=o(e),i=0;i<a.length;i++)a[i]!=="default"&&MG(t,e,a[i]);return LG(t,e),t}})();Object.defineProperty(Oa,"__esModule",{value:!0});Oa.CronFileParser=void 0;var FG=Ig(),nA=class o{static async parseFile(e){let{readFile:t}=await Promise.resolve().then(()=>PG(require("fs/promises"))),a=await t(e,"utf8");return o.#e(a)}static parseFileSync(e){let{readFileSync:t}=require("fs"),a=t(e,"utf8");return o.#e(a)}static#e(e){let t=e.split(`
|
|
6
6
|
`),a={variables:{},expressions:[],errors:{}};for(let i of t){let r=i.trim();if(r.length===0||r.startsWith("#"))continue;let n=r.match(/^(.*)=(.*)$/);if(n){let[,s,c]=n;a.variables[s]=c.replace(/["']/g,"");continue}try{let s=o.#o(r);a.expressions.push(s.interval)}catch(s){a.errors[r]=s}}return a}static#o(e){let t=e.split(" ");return{interval:FG.CronExpressionParser.parse(t.slice(0,5).join(" ")),command:t.slice(5,t.length)}}};Oa.CronFileParser=nA});var mj=f(Io=>{"use strict";var $G=Io&&Io.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),HG=Io&&Io.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$G(e,o,t)};Object.defineProperty(Io,"__esModule",{value:!0});Io.CronFileParser=Io.CronExpressionParser=Io.CronExpression=Io.CronFieldCollection=Io.CronDate=void 0;var GG=Ig(),VG=vg();Object.defineProperty(Io,"CronDate",{enumerable:!0,get:function(){return VG.CronDate}});var YG=Xk();Object.defineProperty(Io,"CronFieldCollection",{enumerable:!0,get:function(){return YG.CronFieldCollection}});var JG=eA();Object.defineProperty(Io,"CronExpression",{enumerable:!0,get:function(){return JG.CronExpression}});var WG=Ig();Object.defineProperty(Io,"CronExpressionParser",{enumerable:!0,get:function(){return WG.CronExpressionParser}});var ZG=cj();Object.defineProperty(Io,"CronFileParser",{enumerable:!0,get:function(){return ZG.CronFileParser}});HG(zg(),Io);Io.default=GG.CronExpressionParser});var xa=f(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.Err=st.Valid=st.err=st.valid=void 0;var KG=o=>new jg(o);st.valid=KG;var XG=o=>new Cg(o);st.err=XG;var jg=class{constructor(e){this.value=e}isValid(){return!0}isError(){return!this.isValid()}getValue(){return this.value}getError(){throw new Error("Tried to get error from a valid.")}map(e){return(0,st.valid)(e(this.value))}mapErr(e){return(0,st.valid)(this.value)}};st.Valid=jg;var Cg=class{constructor(e){this.error=e}isError(){return!0}isValid(){return!this.isError()}getValue(){throw new Error("Tried to get success value from an error.")}getError(){return this.error}map(e){return(0,st.err)(this.error)}mapErr(e){return(0,st.err)(e(this.error))}};st.Err=Cg});var za=f(lj=>{"use strict";Object.defineProperty(lj,"__esModule",{value:!0})});var an=f(sA=>{"use strict";Object.defineProperty(sA,"__esModule",{value:!0});Ua();var ye=xa();za();var eV=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],oV=["sun","mon","tue","wed","thu","fri","sat"],tV=(o,e)=>e[o].lowerLimit===e.preset[o].minValue&&e[o].upperLimit===e.preset[o].maxValue,bl=(o,e,t)=>{if(e==="months"&&t.useAliases&&eV.indexOf(o.toLowerCase())!==-1||e==="daysOfWeek"&&t.useAliases&&oV.indexOf(o.toLowerCase())!==-1)return(0,ye.valid)(!0);let a=Number(o);if(Number.isNaN(a))return(0,ye.err)(`Element '${o}' of ${e} field is invalid.`);if(a%1!==0)return(0,ye.err)(`Element '${o}' of ${e} field is not an integer.`);let{lowerLimit:i}=t[e],{upperLimit:r}=t[e];return i&&a<i?(0,ye.err)(`Number '${a}' of ${e} field is smaller than lower limit '${i}'.`):r&&a>r?(0,ye.err)(`Number '${a}' of ${e} field is bigger than upper limit '${r}'.`):(0,ye.valid)(!0)},aV=(o,e,t)=>{if(o==="*")return tV(e,t)?(0,ye.valid)(!0):(0,ye.err)(`Field ${e} uses wildcard '*', but is limited to ${t[e].lowerLimit}-${t[e].upperLimit}.`);if(o==="")return(0,ye.err)(`One of the elements is empty in ${e} field.`);if(e==="daysOfMonth"&&t.useLastDayOfMonth&&o==="L")return(0,ye.valid)(!0);if(e==="daysOfWeek"&&t.useLastDayOfWeek&&o.endsWith("L")){let a=o.slice(0,-1);return a===""?(0,ye.valid)(!0):bl(a,e,t)}if(e==="daysOfMonth"&&t.useNearestWeekday&&o.endsWith("W")){let a=o.slice(0,-1);return a===""?(0,ye.err)("The 'W' must be preceded by a day."):t.useLastDayOfMonth&&a==="L"?(0,ye.valid)(!0):bl(a,e,t)}if(e==="daysOfWeek"&&t.useNthWeekdayOfMonth&&o.indexOf("#")!==-1){let[a,i,...r]=o.split("#");if(r.length!==0)return(0,ye.err)(`Unexpected number of '#' in ${o}, can only be used once.`);let n=Number(i);return!i||Number.isNaN(n)?(0,ye.err)(`Unexpected value following the '#' symbol, a positive number was expected but found ${i}.`):n>5?(0,ye.err)("Number of occurrence of the day of the week cannot be greater than 5."):bl(a,e,t)}return bl(o,e,t)},uj=(o,e,t,a)=>o==="*"?(0,ye.err)(`'*' can't be part of a range in ${e} field.`):o===""?(0,ye.err)(`One of the range elements is empty in ${e} field.`):t.useLastDayOfMonth&&e==="daysOfMonth"&&o==="L"&&a===0?(0,ye.valid)(!0):bl(o,e,t),iV=(o,e,t)=>{let a=o.split("-");if(a.length>2)return(0,ye.err)(`List element '${o}' is not valid. (More than one '-').`);if(a.length===1)return aV(a[0],e,t);if(a.length===2){let i=uj(a[0],e,t,0),r=uj(a[1],e,t,1);return i.isError()?i:r.isError()?r:Number(a[0])>Number(a[1])?(0,ye.err)(`Lower range end '${a[0]}' is bigger than upper range end '${a[1]}' of ${e} field.`):(0,ye.valid)(!0)}return(0,ye.err)("Some other error in checkFirstStepElement (rangeArray less than 1)")},rV=(o,e,t)=>{let a=o.split("/");if(a.length>2)return(0,ye.err)(`List element '${o}' is not valid. (More than one '/').`);if(!t.allowStepping)return(0,ye.err)("Stepping ('/') is not allowed.");let i=iV(a[0],e,t);if(i.isError())return i;if(a.length===2){let r=a[1];if(!r)return(0,ye.err)(`Second step element '${r}' of '${o}' is not valid (doesnt exist).`);if(Number.isNaN(Number(r)))return(0,ye.err)(`Second step element '${r}' of '${o}' is not valid (not a number).`);let n=Number(r);if(n===0)return(0,ye.err)(`Second step element '${r}' of '${o}' cannot be zero.`);if(n<0)return(0,ye.err)(`Second step element '${r}' of '${o}' cannot be negative.`);if(n%1!==0)return(0,ye.err)(`Second step element '${r}' of '${o}' is not an integer.`);let{lowerLimit:s,upperLimit:c}=t[e];if(c&&n>c)return(0,ye.err)(`Second step element '${r}' of '${o}' is bigger than the upper limit '${c}'.`);let m=a[0].split("-");if(m.length===2){let l=Number(m[0]),u=Number(m[1]);if(!Number.isNaN(l)&&!Number.isNaN(u)){if(n<=0)return(0,ye.err)(`Step value '${r}' must be greater than 0.`);let d=u-l+1;if(n>=d)return(0,ye.err)(`Step value '${r}' is too large for the range '${l}-${u}'.`)}}}return(0,ye.valid)(!0)},nV=(o,e,t)=>{if(!["seconds","minutes","hours","daysOfMonth","months","daysOfWeek","years"].includes(e))return(0,ye.err)([`Cron field type '${e}' does not exist.`]);if(o==="?")return e==="daysOfMonth"||e==="daysOfWeek"?t.useBlankDay?(0,ye.valid)(!0):(0,ye.err)([`useBlankDay is not enabled, but is used in ${e} field.`]):(0,ye.err)([`blank notation is not allowed in ${e} field.`]);let a=o.split(","),i=[];if(a.forEach(n=>{i.push(rV(n,e,t))}),i.every(n=>n.isValid()))return(0,ye.valid)(!0);let r=[];return i.forEach(n=>{n.isError()&&r.push(n.getError())}),(0,ye.err)(r)};sA.default=nV});var dj=f(yl=>{"use strict";var sV=yl&&yl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(yl,"__esModule",{value:!0});Ua();var cV=xa(),mV=sV(an());za();var lV=(o,e)=>{if(!o.seconds)return(0,cV.err)(["seconds field is undefined, but useSeconds options is enabled."]);let{seconds:t}=o;return(0,mV.default)(t,"seconds",e)};yl.default=lV});var gj=f(kl=>{"use strict";var uV=kl&&kl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(kl,"__esModule",{value:!0});Ua();var dV=xa(),gV=uV(an());za();var pV=(o,e)=>{if(!o.minutes)return(0,dV.err)(["minutes field is undefined."]);let{minutes:t}=o;return(0,gV.default)(t,"minutes",e)};kl.default=pV});var pj=f(Al=>{"use strict";var hV=Al&&Al.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Al,"__esModule",{value:!0});Ua();var fV=xa(),bV=hV(an());za();var yV=(o,e)=>{if(!o.hours)return(0,fV.err)(["hours field is undefined."]);let{hours:t}=o;return(0,bV.default)(t,"hours",e)};Al.default=yV});var hj=f(wl=>{"use strict";var kV=wl&&wl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(wl,"__esModule",{value:!0});Ua();var vl=xa(),AV=kV(an());za();var vV=(o,e)=>{if(!o.daysOfMonth)return(0,vl.err)(["daysOfMonth field is undefined."]);let{daysOfMonth:t}=o;return e.allowOnlyOneBlankDayField&&e.useBlankDay&&o.daysOfMonth==="?"&&o.daysOfWeek==="?"?(0,vl.err)(["Cannot use blank value in daysOfMonth and daysOfWeek field when allowOnlyOneBlankDayField option is enabled."]):e.mustHaveBlankDayField&&o.daysOfMonth!=="?"&&o.daysOfWeek!=="?"?(0,vl.err)(["Cannot specify both daysOfMonth and daysOfWeek field when mustHaveBlankDayField option is enabled."]):e.useLastDayOfMonth&&o.daysOfMonth.indexOf("L")!==-1&&o.daysOfMonth.match(/[,/]/)?(0,vl.err)(["Cannot specify last day of month with lists, or ranges (symbols ,/)."]):e.useNearestWeekday&&o.daysOfMonth.indexOf("W")!==-1&&o.daysOfMonth.match(/[,/-]/)?(0,vl.err)(["Cannot specify nearest weekday with lists, steps or ranges (symbols ,-/)."]):(0,AV.default)(t,"daysOfMonth",e)};wl.default=vV});var fj=f(xl=>{"use strict";var wV=xl&&xl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(xl,"__esModule",{value:!0});Ua();var xV=xa(),zV=wV(an());za();var qV=(o,e)=>{if(!o.months)return(0,xV.err)(["months field is undefined."]);let{months:t}=o;return(0,zV.default)(t,"months",e)};xl.default=qV});var bj=f(ql=>{"use strict";var EV=ql&&ql.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(ql,"__esModule",{value:!0});Ua();var zl=xa(),IV=EV(an());za();var jV=(o,e)=>{if(!o.daysOfWeek)return(0,zl.err)(["daysOfWeek field is undefined."]);let{daysOfWeek:t}=o;return e.allowOnlyOneBlankDayField&&o.daysOfMonth==="?"&&o.daysOfWeek==="?"?(0,zl.err)(["Cannot use blank value in daysOfMonth and daysOfWeek field when allowOnlyOneBlankDayField option is enabled."]):e.mustHaveBlankDayField&&o.daysOfMonth!=="?"&&o.daysOfWeek!=="?"?(0,zl.err)(["Cannot specify both daysOfMonth and daysOfWeek field when mustHaveBlankDayField option is enabled."]):e.useLastDayOfWeek&&o.daysOfWeek.indexOf("L")!==-1&&o.daysOfWeek.match(/[,/-]/)?(0,zl.err)(["Cannot specify last day of week with lists, steps or ranges (symbols ,-/)."]):e.useNthWeekdayOfMonth&&o.daysOfWeek.indexOf("#")!==-1&&o.daysOfWeek.match(/[,/-]/)?(0,zl.err)(["Cannot specify Nth weekday of month with lists, steps or ranges (symbols ,-/)."]):(0,IV.default)(t,"daysOfWeek",e)};ql.default=jV});var yj=f(El=>{"use strict";var CV=El&&El.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(El,"__esModule",{value:!0});Ua();var SV=xa(),BV=CV(an());za();var QV=(o,e)=>{if(!o.years)return(0,SV.err)(["years field is undefined, but useYears option is enabled."]);let{years:t}=o;return(0,BV.default)(t,"years",e)};El.default=QV});var zj=f((NCe,xj)=>{"use strict";function is(o){this._maxSize=o,this.clear()}is.prototype.clear=function(){this._size=0,this._values=Object.create(null)};is.prototype.get=function(o){return this._values[o]};is.prototype.set=function(o,e){return this._size>=this._maxSize&&this.clear(),o in this._values||this._size++,this._values[o]=e};var _V=/[^.^\]^[]+|(?=\[\]|\.\.)/g,wj=/^\d+$/,DV=/^\d/,TV=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,RV=/^\s*(['"]?)(.*?)(\1)\s*$/,lA=512,kj=new is(lA),Aj=new is(lA),vj=new is(lA);xj.exports={Cache:is,split:mA,normalizePath:cA,setter:function(o){var e=cA(o);return Aj.get(o)||Aj.set(o,function(a,i){for(var r=0,n=e.length,s=a;r<n-1;){var c=e[r];if(c==="__proto__"||c==="constructor"||c==="prototype")return a;s=s[e[r++]]}s[e[r]]=i})},getter:function(o,e){var t=cA(o);return vj.get(o)||vj.set(o,function(i){for(var r=0,n=t.length;r<n;)if(i!=null||!e)i=i[t[r++]];else return;return i})},join:function(o){return o.reduce(function(e,t){return e+(uA(t)||wj.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(o,e,t){NV(Array.isArray(o)?o:mA(o),e,t)}};function cA(o){return kj.get(o)||kj.set(o,mA(o).map(function(e){return e.replace(RV,"$2")}))}function mA(o){return o.match(_V)||[""]}function NV(o,e,t){var a=o.length,i,r,n,s;for(r=0;r<a;r++)i=o[r],i&&(MV(i)&&(i='"'+i+'"'),s=uA(i),n=!s&&/^\d+$/.test(i),e.call(t,i,s,n,r,o))}function uA(o){return typeof o=="string"&&o&&["'",'"'].indexOf(o.charAt(0))!==-1}function OV(o){return o.match(DV)&&!o.match(wj)}function UV(o){return TV.test(o)}function MV(o){return!uA(o)&&(OV(o)||UV(o))}});var Ij=f((OCe,Ej)=>{"use strict";var LV=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Sg=o=>o.match(LV)||[],Bg=o=>o[0].toUpperCase()+o.slice(1),dA=(o,e)=>Sg(o).join(e).toLowerCase(),qj=o=>Sg(o).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),PV=o=>Bg(qj(o)),FV=o=>dA(o,"_"),$V=o=>dA(o,"-"),HV=o=>Bg(dA(o," ")),GV=o=>Sg(o).map(Bg).join(" ");Ej.exports={words:Sg,upperFirst:Bg,camelCase:qj,pascalCase:PV,snakeCase:FV,kebabCase:$V,sentenceCase:HV,titleCase:GV}});var Cj=f((UCe,gA)=>{"use strict";gA.exports=function(o){return jj(VV(o),o)};gA.exports.array=jj;function jj(o,e){var t=o.length,a=new Array(t),i={},r=t,n=YV(e),s=JV(o);for(e.forEach(function(m){if(!s.has(m[0])||!s.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});r--;)i[r]||c(o[r],r,new Set);return a;function c(m,l,u){if(u.has(m)){var d;try{d=", node was:"+JSON.stringify(m)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!s.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!i[l]){i[l]=!0;var g=n.get(m)||new Set;if(g=Array.from(g),l=g.length){u.add(m);do{var h=g[--l];c(h,s.get(h),u)}while(l);u.delete(m)}a[--t]=m}}}function VV(o){for(var e=new Set,t=0,a=o.length;t<a;t++){var i=o[t];e.add(i[0]),e.add(i[1])}return Array.from(e)}function YV(o){for(var e=new Map,t=0,a=o.length;t<a;t++){var i=o[t];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function JV(o){for(var e=new Map,t=0,a=o.length;t<a;t++)e.set(o[t],t);return e}});var AA={};mE(AA,{ArraySchema:()=>_l,BooleanSchema:()=>Cl,DateSchema:()=>wc,LazySchema:()=>Ug,MixedSchema:()=>jl,NumberSchema:()=>Bl,ObjectSchema:()=>Ql,Schema:()=>jo,StringSchema:()=>Sl,TupleSchema:()=>Dl,ValidationError:()=>vo,addMethod:()=>EY,array:()=>Kj,bool:()=>Hj,boolean:()=>Hj,date:()=>kA,defaultLocale:()=>Lj,getIn:()=>bA,isSchema:()=>rs,lazy:()=>zY,mixed:()=>$j,number:()=>Vj,object:()=>Zj,printValue:()=>La,reach:()=>iY,ref:()=>aY,setLocale:()=>qY,string:()=>Gj,tuple:()=>Xj});function oY(o){return o!=+o?"NaN":o===0&&1/o<0?"-0":""+o}function Sj(o,e=!1){if(o==null||o===!0||o===!1)return""+o;let t=typeof o;if(t==="number")return oY(o);if(t==="string")return e?`"${o}"`:o;if(t==="function")return"[Function "+(o.name||"anonymous")+"]";if(t==="symbol")return XV.call(o).replace(eY,"Symbol($1)");let a=WV.call(o).slice(8,-1);return a==="Date"?isNaN(o.getTime())?""+o:o.toISOString(o):a==="Error"||o instanceof Error?"["+ZV.call(o)+"]":a==="RegExp"?KV.call(o):null}function La(o,e){let t=Sj(o,e);return t!==null?t:JSON.stringify(o,function(a,i){let r=Sj(this[a],e);return r!==null?r:i},2)}function Rj(o){return o==null?[]:[].concat(o)}function aY(o,e){return new Pa(o,e)}function Ac(o){function e({value:t,path:a="",options:i,originalValue:r,schema:n},s,c){let{name:m,test:l,params:u,message:d,skipAbsent:g}=o,{parent:h,context:k,abortEarly:w=n.spec.abortEarly,disableStackTrace:x=n.spec.disableStackTrace}=i,E={value:t,parent:h,context:k};function q(xe={}){let He=Pj(Object.assign({value:t,originalValue:r,label:n.spec.label,path:xe.path||a,spec:n.spec,disableStackTrace:xe.disableStackTrace||x},u,xe.params),E),Jo=new vo(vo.formatError(xe.message||d,He),t,He.path,xe.type||m,He.disableStackTrace);return Jo.params=He,Jo}let _=w?s:c,D={path:a,parent:h,type:m,from:i.from,createError:q,resolve(xe){return Fj(xe,E)},options:i,originalValue:r,schema:n},H=xe=>{vo.isError(xe)?_(xe):xe?c(null):_(q())},J=xe=>{vo.isError(xe)?_(xe):s(xe)};if(g&&qa(t))return H(!0);let Y;try{var ve;if(Y=l.call(D,t,D),typeof((ve=Y)==null?void 0:ve.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${D.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Y).then(H,J)}}catch(xe){J(xe);return}H(Y)}return e.OPTIONS=o,e}function Pj(o,e){if(!o)return o;for(let t of Object.keys(o))o[t]=Fj(o[t],e);return o}function Fj(o,e){return Pa.isRef(o)?o.getValue(e.value,e.parent,e.context):o}function bA(o,e,t,a=t){let i,r,n;return e?((0,ea.forEach)(e,(s,c,m)=>{let l=c?s.slice(1,s.length-1):s;o=o.resolve({context:a,parent:i,value:t});let u=o.type==="tuple",d=m?parseInt(l,10):0;if(o.innerType||u){if(u&&!m)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${n}" must contain an index to the tuple element, e.g. "${n}[0]"`);if(t&&d>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${e}. because there is no value at that index. `);i=t,t=t&&t[d],o=u?o.spec.types[d]:o.innerType}if(!m){if(!o.fields||!o.fields[l])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${n} which is a type: "${o.type}")`);i=t,t=t&&t[l],o=o.fields[l]}r=l,n=c?"["+s+"]":"."+s}),{schema:o,parent:i,parentPath:r}):{parent:i,parentPath:e,schema:o}}function iY(o,e,t,a){return bA(o,e,t,a).schema}function vc(o,e=new Map){if(rs(o)||!o||typeof o!="object")return o;if(e.has(o))return e.get(o);let t;if(o instanceof Date)t=new Date(o.getTime()),e.set(o,t);else if(o instanceof RegExp)t=new RegExp(o),e.set(o,t);else if(Array.isArray(o)){t=new Array(o.length),e.set(o,t);for(let a=0;a<o.length;a++)t[a]=vc(o[a],e)}else if(o instanceof Map){t=new Map,e.set(o,t);for(let[a,i]of o.entries())t.set(a,vc(i,e))}else if(o instanceof Set){t=new Set,e.set(o,t);for(let a of o)t.add(vc(a,e))}else if(o instanceof Object){t={},e.set(o,t);for(let[a,i]of Object.entries(o))t[a]=vc(i,e)}else throw Error(`Unable to clone ${o}`);return t}function rY(o){if(!(o!=null&&o.length))return;let e=[],t="",a=!1,i=!1;for(let r=0;r<o.length;r++){let n=o[r];if(n==="["&&!i){t&&(e.push(...t.split(".").filter(Boolean)),t=""),a=!0;continue}if(n==="]"&&!i){t&&(/^\d+$/.test(t)?e.push(t):e.push(t.replace(/^"|"$/g,"")),t=""),a=!1;continue}if(n==='"'){i=!i;continue}if(n==="."&&!a&&!i){t&&(e.push(t),t="");continue}t+=n}return t&&e.push(...t.split(".").filter(Boolean)),e}function nY(o,e){let t=e?`${e}.${o.path}`:o.path;return o.errors.map(a=>({message:a,path:rY(t)}))}function yA(o,e){var t;if(!((t=o.inner)!=null&&t.length)&&o.errors.length)return nY(o,e);let a=e?`${e}.${o.path}`:o.path;return o.inner.flatMap(i=>yA(i,a))}function $j(o){return new jl(o)}function Hj(){return new Cl}function mY(o){let e=fA(o);if(!e)return Date.parse?Date.parse(o):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function fA(o){var e,t;let a=cY.exec(o);return a?{year:hr(a[1]),month:hr(a[2],1)-1,day:hr(a[3],1),hour:hr(a[4]),minute:hr(a[5]),second:hr(a[6]),millisecond:a[7]?hr(a[7].substring(0,3)):0,precision:(e=(t=a[7])==null?void 0:t.length)!=null?e:void 0,z:a[8]||void 0,plusMinus:a[9]||void 0,hourOffset:hr(a[10]),minuteOffset:hr(a[11])}:null}function hr(o,e=0){return Number(o)||e}function Gj(){return new Sl}function Vj(){return new Bl}function kA(){return new wc}function vY(o,e=[]){let t=[],a=new Set,i=new Set(e.map(([n,s])=>`${n}-${s}`));function r(n,s){let c=(0,ea.split)(n)[0];a.add(c),i.has(`${s}-${c}`)||t.push([s,c])}for(let n of Object.keys(o)){let s=o[n];a.add(n),Pa.isRef(s)&&s.isSibling?r(s.path,n):rs(s)&&"deps"in s&&s.deps.forEach(c=>r(c,n))}return Tj.default.array(Array.from(a),t).reverse()}function Bj(o,e){let t=1/0;return o.some((a,i)=>{var r;if((r=e.path)!=null&&r.includes(a))return t=i,!0}),t}function Jj(o){return(e,t)=>Bj(o,e)-Bj(o,t)}function Tg(o){if("fields"in o){let e={};for(let[t,a]of Object.entries(o.fields))e[t]=Tg(a);return o.setFields(e)}if(o.type==="array"){let e=o.optional();return e.innerType&&(e.innerType=Tg(e.innerType)),e}return o.type==="tuple"?o.optional().clone({types:o.spec.types.map(Tg)}):"optional"in o?o.optional():o}function _j(o,e){let t=Object.keys(o.fields);return Object.keys(e).filter(a=>t.indexOf(a)===-1)}function Zj(o){return new Ql(o)}function Kj(o){return new _l(o)}function Xj(o){return new Dl(o)}function zY(o){return new Ug(o)}function Dj(o){try{return o()}catch(e){if(vo.isError(e))return Promise.reject(e);throw e}}function qY(o){Object.keys(o).forEach(e=>{Object.keys(o[e]).forEach(t=>{Lj[e][t]=o[e][t]})})}function EY(o,e,t){if(!o||!rs(o.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof e!="string")throw new TypeError("A Method name must be provided");if(typeof t!="function")throw new TypeError("Method function must be provided");o.prototype[e]=t}var ea,Il,Tj,WV,ZV,KV,XV,eY,Nj,Oj,Uj,tY,Rg,vo,Ma,ct,rn,pA,hA,_g,Dg,Mj,Lj,rs,Ng,Qg,Pa,qa,Og,jo,sY,jl,Cl,cY,lY,uY,dY,gY,pY,hY,fY,bY,yY,Sl,kY,Bl,Yj,AY,wc,Wj,wY,Qj,xY,Ql,_l,Dl,Ug,vA=Pe(()=>{"use strict";ea=pe(zj()),Il=pe(Ij()),Tj=pe(Cj()),WV=Object.prototype.toString,ZV=Error.prototype.toString,KV=RegExp.prototype.toString,XV=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",eY=/^Symbol\((.*)\)(.*)$/;tY=/\$\{\s*(\w+)\s*\}/g;Nj=Symbol.toStringTag;Rg=class{constructor(e,t,a,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Nj]="Error",this.name="ValidationError",this.value=t,this.path=a,this.type=i,this.errors=[],this.inner=[],Rj(e).forEach(r=>{if(vo.isError(r)){this.errors.push(...r.errors);let n=r.inner.length?r.inner:[r];this.inner.push(...n)}else this.errors.push(r)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}};Oj=Symbol.hasInstance;Uj=Symbol.toStringTag;vo=class o extends Error{static formatError(e,t){let a=t.label||t.path||"this";return t=Object.assign({},t,{path:a,originalPath:t.path}),typeof e=="string"?e.replace(tY,(i,r)=>La(t[r])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,a,i,r){let n=new Rg(e,t,a,i);if(r)return n;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Uj]="Error",this.name=n.name,this.message=n.message,this.type=n.type,this.value=n.value,this.path=n.path,this.errors=n.errors,this.inner=n.inner,Error.captureStackTrace&&Error.captureStackTrace(this,o)}static[Oj](e){return Rg[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}},Ma={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:o,type:e,value:t,originalValue:a})=>{let i=a!=null&&a!==t?` (cast from the value \`${La(a,!0)}\`).`:".";return e!=="mixed"?`${o} must be a \`${e}\` type, but the final value was: \`${La(t,!0)}\``+i:`${o} must match the configured type. The validated value was: \`${La(t,!0)}\``+i}},ct={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},rn={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},pA={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},hA={isValue:"${path} field must be ${value}"},_g={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Dg={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Mj={notType:o=>{let{path:e,value:t,spec:a}=o,i=a.types.length;if(Array.isArray(t)){if(t.length<i)return`${e} tuple value has too few items, expected a length of ${i} but got ${t.length} for value: \`${La(t,!0)}\``;if(t.length>i)return`${e} tuple value has too many items, expected a length of ${i} but got ${t.length} for value: \`${La(t,!0)}\``}return vo.formatError(Ma.notType,o)}},Lj=Object.assign(Object.create(null),{mixed:Ma,string:ct,number:rn,date:pA,object:_g,array:Dg,boolean:hA,tuple:Mj}),rs=o=>o&&o.__isYupSchema__,Ng=class o{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:a,then:i,otherwise:r}=t,n=typeof a=="function"?a:(...s)=>s.every(c=>c===a);return new o(e,(s,c)=>{var m;let l=n(...s)?i:r;return(m=l?.(c))!=null?m:c})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let a=this.refs.map(r=>r.getValue(t?.value,t?.parent,t?.context)),i=this.fn(a,e,t);if(i===void 0||i===e)return e;if(!rs(i))throw new TypeError("conditions must return a schema object");return i.resolve(t)}},Qg={context:"$",value:"."};Pa=class{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Qg.context,this.isValue=this.key[0]===Qg.value,this.isSibling=!this.isContext&&!this.isValue;let a=this.isContext?Qg.context:this.isValue?Qg.value:"";this.path=this.key.slice(a.length),this.getter=this.path&&(0,ea.getter)(this.path,!0),this.map=t.map}getValue(e,t,a){let i=this.isContext?a:this.isValue?e:t;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(e,t){return this.getValue(e,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};Pa.prototype.__isYupRef=!0;qa=o=>o==null;Og=class o extends Set{describe(){let e=[];for(let t of this.values())e.push(Pa.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(let a of this.values())t.push(e(a));return t}clone(){return new o(this.values())}merge(e,t){let a=this.clone();return e.forEach(i=>a.add(i)),t.forEach(i=>a.delete(i)),a}};jo=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Og,this._blacklist=new Og,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ma.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e?.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=vc(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let a=e(this);return this._mutate=t,a}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,a=e.clone(),i=Object.assign({},t.spec,a.spec);return a.spec=i,a.internalTests=Object.assign({},t.internalTests,a.internalTests),a._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),a._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),a.tests=t.tests,a.exclusiveTests=t.exclusiveTests,a.withMutation(r=>{e.tests.forEach(n=>{r.test(n.OPTIONS)})}),a.transforms=[...t.transforms,...a.transforms],a}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let a=t.conditions;t=t.clone(),t.conditions=[],t=a.reduce((i,r)=>r.resolve(i,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,a,i,r;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(a=e.abortEarly)!=null?a:this.spec.abortEarly,recursive:(i=e.recursive)!=null?i:this.spec.recursive,disableStackTrace:(r=e.disableStackTrace)!=null?r:this.spec.disableStackTrace})}cast(e,t={}){let a=this.resolve(Object.assign({},t,{value:e})),i=t.assert==="ignore-optionality",r=a._cast(e,t);if(t.assert!==!1&&!a.isType(r)){if(i&&qa(r))return r;let n=La(e),s=La(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${a.type}".
|
|
7
7
|
|
|
8
8
|
attempted value: ${n}
|
|
9
|
-
`+(s!==n?`result of cast: ${s}`:""))}return r}_cast(e,t){let a=e===void 0?e:this.transforms.reduce((i,r)=>r.call(this,i,e,this,t),e);return a===void 0&&(a=this.getDefault(t)),a}_validate(e,t={},a,i){let{path:r,originalValue:n=e,strict:s=this.spec.strict}=t,c=e;s||(c=this._cast(c,Object.assign({assert:!1},t)));let m=[];for(let l of Object.values(this.internalTests))l&&m.push(l);this.runTests({path:r,value:c,originalValue:n,options:t,tests:m},a,l=>{if(l.length)return i(l,c);this.runTests({path:r,value:c,originalValue:n,options:t,tests:this.tests},a,i)})}runTests(e,t,a){let i=!1,{tests:r,value:n,originalValue:s,path:c,options:m}=e,l=k=>{i||(i=!0,t(k,n))},u=k=>{i||(i=!0,a(k,n))},d=r.length,g=[];if(!d)return u([]);let h={value:n,originalValue:s,path:c,options:m,schema:this};for(let k=0;k<r.length;k++){let w=r[k];w(h,l,function(E){E&&(Array.isArray(E)?g.push(...E):g.push(E)),--d<=0&&u(g)})}}asNestedTest({key:e,index:t,parent:a,parentPath:i,originalParent:r,options:n}){let s=e??t;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");let c=typeof s=="number",m=a[s],l=Object.assign({},n,{strict:!0,parent:a,value:m,originalValue:r[s],key:void 0,[c?"index":"key"]:s,path:c||s.includes(".")?`${i||""}[${c?s:`"${s}"`}]`:(i?`${i}.`:"")+e});return(u,d,g)=>this.resolve(l)._validate(m,l,d,g)}validate(e,t){var a;let i=this.resolve(Object.assign({},t,{value:e})),r=(a=t?.disableStackTrace)!=null?a:i.spec.disableStackTrace;return new Promise((n,s)=>i._validate(e,t,(c,m)=>{vo.isError(c)&&(c.value=m),s(c)},(c,m)=>{c.length?s(new vo(c,m,void 0,void 0,r)):n(m)}))}validateSync(e,t){var a;let i=this.resolve(Object.assign({},t,{value:e})),r,n=(a=t?.disableStackTrace)!=null?a:i.spec.disableStackTrace;return i._validate(e,Object.assign({},t,{sync:!0}),(s,c)=>{throw vo.isError(s)&&(s.value=c),s},(s,c)=>{if(s.length)throw new vo(s,e,void 0,void 0,n);r=c}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,a=>{if(vo.isError(a))return!1;throw a})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(a){if(vo.isError(a))return!1;throw a}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):vc(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){let a=this.clone({nullable:e});return a.internalTests.nullable=Ac({message:t,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),a}optionality(e,t){let a=this.clone({optional:e});return a.internalTests.optionality=Ac({message:t,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(e=Ma.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Ma.notNull){return this.nullability(!1,e)}required(e=Ma.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Ma.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),i=Ac(t),r=t.exclusive||t.name&&a.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(a.exclusiveTests[t.name]=!!t.exclusive),a.tests=a.tests.filter(n=>!(n.OPTIONS.name===t.name&&(r||n.OPTIONS.test===i.OPTIONS.test))),a.tests.push(i),a}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let a=this.clone(),i=Rj(e).map(r=>new Pa(r));return i.forEach(r=>{r.isSibling&&a.deps.push(r.key)}),a.conditions.push(typeof t=="function"?new Ng(i,t):Ng.fromOptions(i,t)),a}typeError(e){let t=this.clone();return t.internalTests.typeError=Ac({message:e,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Ma.oneOf){let a=this.clone();return e.forEach(i=>{a._whitelist.add(i),a._blacklist.delete(i)}),a.internalTests.whiteList=Ac({message:t,name:"oneOf",skipAbsent:!0,test(i){let r=this.schema._whitelist,n=r.resolveAll(this.resolve);return n.includes(i)?!0:this.createError({params:{values:Array.from(r).join(", "),resolved:n}})}}),a}notOneOf(e,t=Ma.notOneOf){let a=this.clone();return e.forEach(i=>{a._blacklist.add(i),a._whitelist.delete(i)}),a.internalTests.blacklist=Ac({message:t,name:"notOneOf",test(i){let r=this.schema._blacklist,n=r.resolveAll(this.resolve);return n.includes(i)?this.createError({params:{values:Array.from(r).join(", "),resolved:n}}):!0}}),a}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){let t=(e?this.resolve(e):this).clone(),{label:a,meta:i,optional:r,nullable:n}=t.spec;return{meta:i,label:a,optional:r,nullable:n,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((c,m,l)=>l.findIndex(u=>u.OPTIONS.name===c.OPTIONS.name)===m).map(c=>{let m=c.OPTIONS.params&&e?Pj(Object.assign({},c.OPTIONS.params),e):c.OPTIONS.params;return{name:c.OPTIONS.name,params:m}})}}get"~standard"(){let e=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await e.validate(a,{abortEarly:!1})}}catch(i){if(i instanceof vo)return{issues:yA(i)};throw i}}}}};jo.prototype.__isYupSchema__=!0;for(let o of["validate","validateSync"])jo.prototype[`${o}At`]=function(e,t,a={}){let{parent:i,parentPath:r,schema:n}=bA(this,e,t,a.context);return n[o](i&&i[r],Object.assign({},a,{parent:i,path:e}))};for(let o of["equals","is"])jo.prototype[o]=jo.prototype.oneOf;for(let o of["not","nope"])jo.prototype[o]=jo.prototype.notOneOf;sY=()=>!0;jl=class extends jo{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:sY},e))}};$j.prototype=jl.prototype;Cl=class extends jo{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t)=>{if(this.spec.coerce&&!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=hA.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return qa(t)||t===!0}})}isFalse(e=hA.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return qa(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};Hj.prototype=Cl.prototype;cY=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;lY=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uY=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,dY=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gY="^\\d{4}-\\d{2}-\\d{2}",pY="\\d{2}:\\d{2}:\\d{2}",hY="(([+-]\\d{2}(:?\\d{2})?)|Z)",fY=new RegExp(`${gY}T${pY}(\\.\\d+)?${hY}$`),bY=o=>qa(o)||o===o.trim(),yY={}.toString();Sl=class extends jo{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;let a=e!=null&&e.toString?e.toString():e;return a===yY?e:a})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Ma.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=ct.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(a){return a.length===this.resolve(e)}})}min(e,t=ct.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(a){return a.length>=this.resolve(e)}})}max(e,t=ct.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(a){return a.length<=this.resolve(e)}})}matches(e,t){let a=!1,i,r;return t&&(typeof t=="object"?{excludeEmptyString:a=!1,message:i,name:r}=t:i=t),this.test({name:r||"matches",message:i||ct.matches,params:{regex:e},skipAbsent:!0,test:n=>n===""&&a||n.search(e)!==-1})}email(e=ct.email){return this.matches(lY,{name:"email",message:e,excludeEmptyString:!0})}url(e=ct.url){return this.matches(uY,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ct.uuid){return this.matches(dY,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",a,i;return e&&(typeof e=="object"?{message:t="",allowOffset:a=!1,precision:i=void 0}=e:t=e),this.matches(fY,{name:"datetime",message:t||ct.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||ct.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:r=>{if(!r||a)return!0;let n=fA(r);return n?!!n.z:!1}}).test({name:"datetime_precision",message:t||ct.datetime_precision,params:{precision:i},skipAbsent:!0,test:r=>{if(!r||i==null)return!0;let n=fA(r);return n?n.precision===i:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ct.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:bY})}lowercase(e=ct.lowercase){return this.transform(t=>qa(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>qa(t)||t===t.toLowerCase()})}uppercase(e=ct.uppercase){return this.transform(t=>qa(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>qa(t)||t===t.toUpperCase()})}};Gj.prototype=Sl.prototype;kY=o=>o!=+o;Bl=class extends jo{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!kY(e)}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce)return e;let a=e;if(typeof a=="string"){if(a=a.replace(/\s/g,""),a==="")return NaN;a=+a}return this.isType(a)||a===null?a:parseFloat(a)})})}min(e,t=rn.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(a){return a>=this.resolve(e)}})}max(e,t=rn.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(a){return a<=this.resolve(e)}})}lessThan(e,t=rn.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(a){return a<this.resolve(e)}})}moreThan(e,t=rn.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(a){return a>this.resolve(e)}})}positive(e=rn.positive){return this.moreThan(0,e)}negative(e=rn.negative){return this.lessThan(0,e)}integer(e=rn.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>qa(e)?e:e|0)}round(e){var t;let a=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(a.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+a.join(", "));return this.transform(i=>qa(i)?i:Math[e](i))}};Vj.prototype=Bl.prototype;Yj=new Date(""),AY=o=>Object.prototype.toString.call(o)==="[object Date]";wc=class o extends jo{constructor(){super({type:"date",check(e){return AY(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=mY(e),isNaN(e)?o.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let a;if(Pa.isRef(e))a=e;else{let i=this.cast(e);if(!this._typeCheck(i))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);a=i}return a}min(e,t=pA.min){let a=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(a)}})}max(e,t=pA.max){let a=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(a)}})}};wc.INVALID_DATE=Yj;kA.prototype=wc.prototype;kA.INVALID_DATE=Yj;Wj=(o,e,t)=>{if(typeof o!="string")return o;let a=o;try{a=JSON.parse(o)}catch{}return t.isType(a)?a:o};wY=(o,e)=>{let t=[...(0,ea.normalizePath)(e)];if(t.length===1)return t[0]in o;let a=t.pop(),i=(0,ea.getter)((0,ea.join)(t),!0)(o);return!!(i&&a in i)},Qj=o=>Object.prototype.toString.call(o)==="[object Object]";xY=Jj([]);Ql=class extends jo{constructor(e){super({type:"object",check(t){return Qj(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=xY,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var a;let i=super._cast(e,t);if(i===void 0)return this.getDefault(t);if(!this._typeCheck(i))return i;let r=this.fields,n=(a=t.stripUnknown)!=null?a:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),c={},m=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),l=!1;for(let u of s){let d=r[u],g=u in i,h=i[u];if(d){let k;m.path=(t.path?`${t.path}.`:"")+u,d=d.resolve({value:h,context:t.context,parent:c});let w=d instanceof jo?d.spec:void 0,x=w?.strict;if(w!=null&&w.strip){l=l||u in i;continue}k=!t.__validating||!x?d.cast(h,m):h,k!==void 0&&(c[u]=k)}else g&&!n&&(c[u]=h);(g!==u in c||c[u]!==h)&&(l=!0)}return l?c:i}_validate(e,t={},a,i){let{from:r=[],originalValue:n=e,recursive:s=this.spec.recursive}=t;t.from=[{schema:this,value:n},...r],t.__validating=!0,t.originalValue=n,super._validate(e,t,a,(c,m)=>{if(!s||!Qj(m)){i(c,m);return}n=n||m;let l=[];for(let u of this._nodes){let d=this.fields[u];!d||Pa.isRef(d)||l.push(d.asNestedTest({options:t,key:u,parent:m,parentPath:t.path,originalParent:n}))}this.runTests({tests:l,value:m,originalValue:n,options:t},a,u=>{i(u.sort(this._sortErrors).concat(c),m)})})}clone(e){let t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),a=t.fields;for(let[i,r]of Object.entries(this.fields)){let n=a[i];a[i]=n===void 0?r:n}return t.withMutation(i=>i.setFields(a,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(a=>{var i;let r=this.fields[a],n=e;(i=n)!=null&&i.value&&(n=Object.assign({},n,{parent:n.value,value:n.value[a]})),t[a]=r&&"getDefault"in r?r.getDefault(n):void 0}),t}setFields(e,t){let a=this.clone();return a.fields=e,a._nodes=vY(e,t),a._sortErrors=Jj(Object.keys(e)),t&&(a._excludedEdges=t),a}shape(e,t=[]){return this.clone().withMutation(a=>{let i=a._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),i=[...a._excludedEdges,...t]),a.setFields(Object.assign(a.fields,e),i)})}partial(){let e={};for(let[t,a]of Object.entries(this.fields))e[t]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(e)}deepPartial(){return Tg(this)}pick(e){let t={};for(let a of e)this.fields[a]&&(t[a]=this.fields[a]);return this.setFields(t,this._excludedEdges.filter(([a,i])=>e.includes(a)&&e.includes(i)))}omit(e){let t=[];for(let a of Object.keys(this.fields))e.includes(a)||t.push(a);return this.pick(t)}from(e,t,a){let i=(0,ea.getter)(e,!0);return this.transform(r=>{if(!r)return r;let n=r;return wY(r,e)&&(n=Object.assign({},r),a||delete n[e],n[t]=i(r)),n})}json(){return this.transform(Wj)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||_g.exact,test(t){if(t==null)return!0;let a=_j(this.schema,t);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=_g.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:t,test(i){if(i==null)return!0;let r=_j(this.schema,i);return!e||r.length===0||this.createError({params:{unknown:r.join(", ")}})}});return a.spec.noUnknown=e,a}unknown(e=!0,t=_g.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;let a={};for(let i of Object.keys(t))a[e(i)]=t[i];return a})}camelCase(){return this.transformKeys(Il.camelCase)}snakeCase(){return this.transformKeys(Il.snakeCase)}constantCase(){return this.transformKeys(e=>(0,Il.snakeCase)(e).toUpperCase())}describe(e){let t=(e?this.resolve(e):this).clone(),a=super.describe(e);a.fields={};for(let[r,n]of Object.entries(t.fields)){var i;let s=e;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),a.fields[r]=n.describe(s)}return a}};Zj.prototype=Ql.prototype;_l=class extends jo{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){let a=super._cast(e,t);if(!this._typeCheck(a)||!this.innerType)return a;let i=!1,r=a.map((n,s)=>{let c=this.innerType.cast(n,Object.assign({},t,{path:`${t.path||""}[${s}]`,parent:a,originalValue:n,value:n,index:s}));return c!==n&&(i=!0),c});return i?r:a}_validate(e,t={},a,i){var r;let n=this.innerType,s=(r=t.recursive)!=null?r:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,a,(c,m)=>{var l;if(!s||!n||!this._typeCheck(m)){i(c,m);return}let u=new Array(m.length);for(let g=0;g<m.length;g++){var d;u[g]=n.asNestedTest({options:t,index:g,parent:m,parentPath:t.path,originalParent:(d=t.originalValue)!=null?d:e})}this.runTests({value:m,tests:u,originalValue:(l=t.originalValue)!=null?l:e,options:t},a,g=>i(g.concat(c),m))})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(Wj)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!rs(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+La(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Dg.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(a){return a.length===this.resolve(e)}})}min(e,t){return t=t||Dg.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(a){return a.length>=this.resolve(e)}})}max(e,t){return t=t||Dg.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(a){return a.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(a,i,r)=>!e(a,i,r):a=>!!a;return this.transform(a=>a!=null?a.filter(t):a)}describe(e){let t=(e?this.resolve(e):this).clone(),a=super.describe(e);if(t.innerType){var i;let r=e;(i=r)!=null&&i.value&&(r=Object.assign({},r,{parent:r.value,value:r.value[0]})),a.innerType=t.innerType.describe(r)}return a}};Kj.prototype=_l.prototype;Dl=class extends jo{constructor(e){super({type:"tuple",spec:{types:e},check(t){let a=this.spec.types;return Array.isArray(t)&&t.length===a.length}}),this.withMutation(()=>{this.typeError(Mj.notType)})}_cast(e,t){let{types:a}=this.spec,i=super._cast(e,t);if(!this._typeCheck(i))return i;let r=!1,n=a.map((s,c)=>{let m=s.cast(i[c],Object.assign({},t,{path:`${t.path||""}[${c}]`,parent:i,originalValue:i[c],value:i[c],index:c}));return m!==i[c]&&(r=!0),m});return r?n:i}_validate(e,t={},a,i){let r=this.spec.types;super._validate(e,t,a,(n,s)=>{var c;if(!this._typeCheck(s)){i(n,s);return}let m=[];for(let[u,d]of r.entries()){var l;m[u]=d.asNestedTest({options:t,index:u,parent:s,parentPath:t.path,originalParent:(l=t.originalValue)!=null?l:e})}this.runTests({value:s,tests:m,originalValue:(c=t.originalValue)!=null?c:e,options:t},a,u=>i(u.concat(n),s))})}describe(e){let t=(e?this.resolve(e):this).clone(),a=super.describe(e);return a.innerType=t.spec.types.map((i,r)=>{var n;let s=e;return(n=s)!=null&&n.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),i.describe(s)}),a}};Xj.prototype=Dl.prototype;Ug=class o{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(t,a={})=>{let i=this.builder(t,a);if(!rs(i))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(i=i.optional()),i.resolve(a)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){let t=new o(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:a,parent:i,options:r}=e,n=i[a??t];return this._resolve(n,Object.assign({},r,{value:n,parent:i})).asNestedTest(e)}validate(e,t){return Dj(()=>this._resolve(e,t).validate(e,t))}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,a){return Dj(()=>this._resolve(t,a).validateAt(e,t,a))}validateSyncAt(e,t,a){return this._resolve(t,a).validateSyncAt(e,t,a)}isValid(e,t){try{return this._resolve(e,t).isValid(e,t)}catch(a){if(vo.isError(a))return Promise.resolve(!1);throw a}}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}get"~standard"(){let e=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await e.validate(a,{abortEarly:!1})}}catch(i){if(vo.isError(i))return{issues:yA(i)};throw i}}}}}});var eC=f(wA=>{"use strict";Object.defineProperty(wA,"__esModule",{value:!0});wA.default=[{name:"npm-node-cron",preset:{presetId:"npm-node-cron",useSeconds:!0,useYears:!1,useAliases:!0,useBlankDay:!1,allowOnlyOneBlankDayField:!1,mustHaveBlankDayField:!1,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1,useNthWeekdayOfMonth:!1,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:1,maxValue:31},months:{minValue:0,maxValue:11},daysOfWeek:{minValue:0,maxValue:6},years:{minValue:1970,maxValue:2099}}},{name:"aws-cloud-watch",preset:{presetId:"aws-cloud-watch",useSeconds:!1,useYears:!0,useAliases:!0,useBlankDay:!0,allowOnlyOneBlankDayField:!0,mustHaveBlankDayField:!0,useLastDayOfMonth:!0,useLastDayOfWeek:!0,useNearestWeekday:!0,useNthWeekdayOfMonth:!0,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:1,maxValue:31},months:{minValue:1,maxValue:12},daysOfWeek:{minValue:1,maxValue:7},years:{minValue:1970,maxValue:2199}}},{name:"npm-cron-schedule",preset:{presetId:"npm-cron-schedule",useSeconds:!0,useYears:!1,useAliases:!0,useBlankDay:!1,allowOnlyOneBlankDayField:!1,mustHaveBlankDayField:!1,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1,useNthWeekdayOfMonth:!1,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:1,maxValue:31},months:{minValue:1,maxValue:12},daysOfWeek:{minValue:0,maxValue:7},years:{minValue:1970,maxValue:2099}}}]});var iC=f(wo=>{"use strict";var IY=wo&&wo.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),jY=wo&&wo.__setModuleDefault||(Object.create?(function(o,e){Object.defineProperty(o,"default",{enumerable:!0,value:e})}):function(o,e){o.default=e}),CY=wo&&wo.__importStar||function(o){if(o&&o.__esModule)return o;var e={};if(o!=null)for(var t in o)t!=="default"&&Object.prototype.hasOwnProperty.call(o,t)&&IY(e,o,t);return jY(e,o),e},SY=wo&&wo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(wo,"__esModule",{value:!0});wo.validateOptions=wo.registerOptionPreset=wo.getOptionPresets=wo.getOptionPreset=void 0;var U=CY((vA(),Sy(AA)));vA();var xc=xa(),oC=SY(eC());za();var ns={default:{presetId:"default",useSeconds:!1,useYears:!1,useAliases:!1,useBlankDay:!1,allowOnlyOneBlankDayField:!1,allowStepping:!0,mustHaveBlankDayField:!1,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1,useNthWeekdayOfMonth:!1,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:0,maxValue:31},months:{minValue:0,maxValue:12},daysOfWeek:{minValue:0,maxValue:7},years:{minValue:1970,maxValue:2099}}},aC=U.object({presetId:U.string().required(),useSeconds:U.boolean().required(),useYears:U.boolean().required(),useAliases:U.boolean(),useBlankDay:U.boolean().required(),allowOnlyOneBlankDayField:U.boolean().required(),allowStepping:U.boolean(),mustHaveBlankDayField:U.boolean(),useLastDayOfMonth:U.boolean(),useLastDayOfWeek:U.boolean(),useNearestWeekday:U.boolean(),useNthWeekdayOfMonth:U.boolean(),seconds:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),minutes:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),hours:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),daysOfMonth:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),months:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),daysOfWeek:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),years:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required()}).required(),BY=o=>ns[o]?(0,xc.valid)(ns[o]):(0,xc.err)(`Option preset '${o}' not found.`);wo.getOptionPreset=BY;var QY=()=>ns;wo.getOptionPresets=QY;var _Y=(o,e)=>{ns[o]=aC.validateSync(e,{strict:!1,abortEarly:!1,stripUnknown:!0,recursive:!0})};wo.registerOptionPreset=_Y;function DY(){for(let o=0;o<oC.default.length;o+=1){let{name:e,preset:t}=oC.default[o];(0,wo.registerOptionPreset)(e,t)}}DY();var tC=new Map;function TY(o,e){var t;return o+((t=JSON.stringify(e))!==null&&t!==void 0?t:"")}function RY(o){return U.object({presetId:U.string().required(),preset:aC.required(),useSeconds:U.boolean().required(),useYears:U.boolean().required(),useAliases:U.boolean(),useBlankDay:U.boolean().required(),allowOnlyOneBlankDayField:U.boolean().required(),allowStepping:U.boolean(),mustHaveBlankDayField:U.boolean(),useLastDayOfMonth:U.boolean(),useLastDayOfWeek:U.boolean(),useNearestWeekday:U.boolean(),useNthWeekdayOfMonth:U.boolean(),seconds:U.object({lowerLimit:U.number().min(o.seconds.minValue).max(o.seconds.maxValue),upperLimit:U.number().min(o.seconds.minValue).max(o.seconds.maxValue)}).required(),minutes:U.object({lowerLimit:U.number().min(o.minutes.minValue).max(o.minutes.maxValue),upperLimit:U.number().min(o.minutes.minValue).max(o.minutes.maxValue)}).required(),hours:U.object({lowerLimit:U.number().min(o.hours.minValue).max(o.hours.maxValue),upperLimit:U.number().min(o.hours.minValue).max(o.hours.maxValue)}).required(),daysOfMonth:U.object({lowerLimit:U.number().min(o.daysOfMonth.minValue).max(o.daysOfMonth.maxValue),upperLimit:U.number().min(o.daysOfMonth.minValue).max(o.daysOfMonth.maxValue)}).required(),months:U.object({lowerLimit:U.number().min(o.months.minValue).max(o.months.maxValue),upperLimit:U.number().min(o.months.minValue).max(o.months.maxValue)}).required(),daysOfWeek:U.object({lowerLimit:U.number().min(o.daysOfWeek.minValue).max(o.daysOfWeek.maxValue),upperLimit:U.number().min(o.daysOfWeek.minValue).max(o.daysOfWeek.maxValue)}).required(),years:U.object({lowerLimit:U.number().min(o.years.minValue).max(o.years.maxValue),upperLimit:U.number().min(o.years.minValue).max(o.years.maxValue)}).required()}).required()}function NY(o,e){var t,a,i,r,n,s,c,m,l,u,d,g,h,k,w,x,E,q,_,D,H;let J=Object.assign(Object.assign({presetId:o.presetId,preset:o},{useSeconds:o.useSeconds,useYears:o.useYears,useAliases:(t=o.useAliases)!==null&&t!==void 0?t:!1,useBlankDay:o.useBlankDay,allowOnlyOneBlankDayField:o.allowOnlyOneBlankDayField,allowStepping:(a=o.allowStepping)!==null&&a!==void 0?a:!0,mustHaveBlankDayField:(i=o.mustHaveBlankDayField)!==null&&i!==void 0?i:!1,useLastDayOfMonth:(r=o.useLastDayOfMonth)!==null&&r!==void 0?r:!1,useLastDayOfWeek:(n=o.useLastDayOfWeek)!==null&&n!==void 0?n:!1,useNearestWeekday:(s=o.useNearestWeekday)!==null&&s!==void 0?s:!1,useNthWeekdayOfMonth:(c=o.useNthWeekdayOfMonth)!==null&&c!==void 0?c:!1,seconds:{lowerLimit:(m=o.seconds.lowerLimit)!==null&&m!==void 0?m:o.seconds.minValue,upperLimit:(l=o.seconds.upperLimit)!==null&&l!==void 0?l:o.seconds.maxValue},minutes:{lowerLimit:(u=o.minutes.lowerLimit)!==null&&u!==void 0?u:o.minutes.minValue,upperLimit:(d=o.minutes.upperLimit)!==null&&d!==void 0?d:o.minutes.maxValue},hours:{lowerLimit:(g=o.hours.lowerLimit)!==null&&g!==void 0?g:o.hours.minValue,upperLimit:(h=o.hours.upperLimit)!==null&&h!==void 0?h:o.hours.maxValue},daysOfMonth:{lowerLimit:(k=o.daysOfMonth.lowerLimit)!==null&&k!==void 0?k:o.daysOfMonth.minValue,upperLimit:(w=o.daysOfMonth.upperLimit)!==null&&w!==void 0?w:o.daysOfMonth.maxValue},months:{lowerLimit:(x=o.months.lowerLimit)!==null&&x!==void 0?x:o.months.minValue,upperLimit:(E=o.months.upperLimit)!==null&&E!==void 0?E:o.months.maxValue},daysOfWeek:{lowerLimit:(q=o.daysOfWeek.lowerLimit)!==null&&q!==void 0?q:o.daysOfWeek.minValue,upperLimit:(_=o.daysOfWeek.upperLimit)!==null&&_!==void 0?_:o.daysOfWeek.maxValue},years:{lowerLimit:(D=o.years.lowerLimit)!==null&&D!==void 0?D:o.years.minValue,upperLimit:(H=o.years.upperLimit)!==null&&H!==void 0?H:o.years.maxValue}}),e);return RY(o).validateSync(J,{strict:!1,abortEarly:!1,stripUnknown:!0,recursive:!0})}var OY=o=>{try{let e;if(o.preset)if(typeof o.preset=="string"){if(!ns[o.preset])return(0,xc.err)([`Option preset ${o.preset} does not exist.`]);e=ns[o.preset]}else e=o.preset;else e=ns.default;let t=TY(e.presetId,o.override),a=tC.get(t);if(a)return(0,xc.valid)(a);let i=NY(e,o.override);return tC.set(t,i),(0,xc.valid)(i)}catch(e){return(0,xc.err)(e.errors)}};wo.validateOptions=OY});var Ua=f(Tl=>{"use strict";var cs=Tl&&Tl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Tl,"__esModule",{value:!0});var ss=xa(),UY=cs(dj()),MY=cs(gj()),LY=cs(pj()),PY=cs(hj()),FY=cs(fj()),$Y=cs(bj()),HY=cs(yj()),GY=iC();za();var VY=(o,e)=>{let t=o.trim().split(" ");if(e.useSeconds&&e.useYears&&t.length!==7)return(0,ss.err)(`Expected 7 values, but got ${t.length}.`);if((e.useSeconds&&!e.useYears||e.useYears&&!e.useSeconds)&&t.length!==6)return(0,ss.err)(`Expected 6 values, but got ${t.length}.`);if(!e.useSeconds&&!e.useYears&&t.length!==5)return(0,ss.err)(`Expected 5 values, but got ${t.length}.`);let a={seconds:e.useSeconds?t[0]:void 0,minutes:t[e.useSeconds?1:0],hours:t[e.useSeconds?2:1],daysOfMonth:t[e.useSeconds?3:2],months:t[e.useSeconds?4:3],daysOfWeek:t[e.useSeconds?5:4],years:e.useYears?t[e.useSeconds?6:5]:void 0};return(0,ss.valid)(a)},YY=(o,e={})=>{let t=(0,GY.validateOptions)(e);if(t.isError())return t;let a=t.getValue(),i=VY(o,a);if(i.isError())return(0,ss.err)([`${i.getError()} (Input cron: '${o}')`]);let r=i.getValue(),n=[];if(a.useSeconds&&n.push((0,UY.default)(r,a)),n.push((0,MY.default)(r,a)),n.push((0,LY.default)(r,a)),n.push((0,PY.default)(r,a)),n.push((0,FY.default)(r,a)),n.push((0,$Y.default)(r,a)),a.useYears&&n.push((0,HY.default)(r,a)),n.every(c=>c.isValid()))return(0,ss.valid)(r);let s=[];return n.forEach(c=>{c.isError()&&c.getError().forEach(m=>{s.push(m)})}),s.forEach((c,m)=>{s[m]=`${c} (Input cron: '${o}')`}),(0,ss.err)(s)};Tl.default=YY});var zc=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.parseUTCDate=Mg;Oo.requireUTCDate=rC;Oo.toUTCISOString=nC;Oo.toOptionalUTCISOString=aJ;Oo.utcNow=sC;Oo.utcNowISOString=iJ;Oo.getUTCTimestampMs=cC;Oo.parsePersistedTimestamp=Rl;Oo.getPersistedTimestampMs=rJ;Oo.formatPersistedTimestamp=mC;Oo.formatCompactPersistedTimestamp=nJ;Oo.formatPersistedDate=lC;Oo.formatPersistedTime=sJ;Oo.formatRelativePersistedTimestamp=cJ;var JY=/(Z|[+-]\d{2}(?::?\d{2})?)$/i,WY=/^\d{4}-\d{2}-\d{2}$/,ZY=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}/,KY={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"},XY={month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"},eJ={year:"numeric",month:"short",day:"numeric"},oJ={hour:"2-digit",minute:"2-digit"};function tJ(o){let e=o.trim();return e&&(WY.test(e)?`${e}T00:00:00.000Z`:JY.test(e)?e:ZY.test(e)?`${e.replace(" ","T")}Z`:e)}function Mg(o){if(o==null||o==="")return;let e=typeof o=="string"?tJ(o):o instanceof Date||typeof o=="number"&&Number.isFinite(o)?o:void 0;if(e===void 0)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function rC(o,e="timestamp"){let t=Mg(o);if(!t)throw new Error(`Invalid ${e}`);return t}function nC(o,e="timestamp"){return rC(o,e).toISOString()}function aJ(o,e="timestamp"){if(!(o==null||o===""))return nC(o,e)}function sC(){return new Date}function iJ(){return sC().toISOString()}function cC(o){let e=Mg(o);return e?e.getTime():Number.NEGATIVE_INFINITY}function Rl(o){return Mg(o)}function rJ(o){return cC(o)}function mC(o,e=KY,t="-"){let a=Rl(o);return a?a.toLocaleString(void 0,e):t}function nJ(o,e="-"){return mC(o,XY,e)}function lC(o,e="-"){let t=Rl(o);return t?t.toLocaleDateString(void 0,eJ):e}function sJ(o,e="-"){let t=Rl(o);return t?t.toLocaleTimeString(void 0,oJ):e}function cJ(o,e=""){let t=Rl(o);if(!t)return e;let a=Date.now()-t.getTime(),i=Math.floor(a/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;let r=Math.floor(i/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<30?`${n}d ago`:lC(t,e)}});var dC=f(qc=>{"use strict";var mJ=qc&&qc.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(qc,"__esModule",{value:!0});qc.calculateNextRun=dJ;qc.validateCronExpression=gJ;var lJ=mj(),uJ=mJ(Ua()),uC=zc();function dJ(o,e,t){let a=t||(0,uC.utcNow)(),r=lJ.CronExpressionParser.parse(o,{currentDate:a,tz:e}).next().toDate();return(0,uC.parseUTCDate)(r.toISOString())||r}function gJ(o){try{return(0,uJ.default)(o,{preset:"default",override:{useSeconds:!1,useYears:!1,useAliases:!1,allowStepping:!0,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1}}).isValid()}catch{return!1}}});var Lg=f(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.DEFAULT_TIMEZONE=void 0;ms.isValidTimezone=gC;ms.getRuntimeTimezone=pJ;ms.DEFAULT_TIMEZONE="UTC";function gC(o){try{return new Intl.DateTimeFormat("en-US",{timeZone:o}),!0}catch{return!1}}function pJ(){let o=Intl.DateTimeFormat().resolvedOptions().timeZone;return o&&gC(o)?o:ms.DEFAULT_TIMEZONE}});var hC=f(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.getModelContextLength=hJ;Pg.getConfiguredModelContextLength=fJ;var pC=2e5;function hJ(o){return pC}function fJ(){return pC}});var fC=f(xA=>{"use strict";Object.defineProperty(xA,"__esModule",{value:!0});xA.getModelOutputTokenLimit=yJ;var bJ={"claude-fable-5":128e3,"claude-mythos-5":128e3,"claude-opus-5":128e3,"claude-sonnet-5":128e3,"claude-opus-4-8":128e3,"claude-opus-4-7":128e3,"claude-opus-4-6":128e3,"claude-sonnet-4-6":64e3,"claude-haiku-4-5":64e3,"claude-opus-4-5":64e3,"claude-sonnet-4-5":64e3,"gpt-5":128e3,"gpt-4.1":32768,"gpt-4o":16384,"gemini-2.5-flash":65536,"gemini-2.5-pro":65536};function yJ(o){let e=o.model.toLowerCase();return Object.entries(bJ).find(([a])=>e.includes(a))?.[1]}});var Fa=f(B=>{"use strict";var kJ=B&&B.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),Yg=B&&B.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kJ(e,o,t)},AJ=B&&B.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(B,"__esModule",{value:!0});B.ALLOWED_PATCH_SYSTEM_FIELDS=B.MAX_OBJECT_PREVIEW_KEYS=B.MAX_TRUNCATION_DEPTH=B.MAX_ARRAY_PREVIEW_ITEMS=B.MAX_STRING_PREVIEW_LENGTH=B.MAX_INLINE_RESULT_PREVIEW_BYTES=B.FULLY_MASKED_CREDENTIAL_VALUE=B.maskCredentialValue=B.isSensitiveCredentialKey=B.CREDENTIAL_KEY_VALIDATION_DESCRIPTION=B.CREDENTIAL_KEY_PATTERN=B.ALLOWED_FILE_EXTENSIONS=void 0;B.mapPlaybookToDraftConfig=wJ;B.mapPlaybookDraftToInput=xJ;B.reserveUniqueFileName=zJ;B.inferProtocolFromUrl=qJ;B.isAbortError=EJ;B.getToolInputSchemaSections=CJ;B.buildToolInputSchemaSections=BJ;B.flattenAndNamespaceCredentials=NJ;B.flattenAndNamespaceSystemUrls=OJ;B.slugify=UJ;B.generateUniqueId=MJ;B.inferJsonSchema=LJ;B.resolveOAuthCertAndKey=PJ;B.isArrowFunction=vC;B.assertValidArrowFunction=FJ;B.normalizeCredentialKey=wC;B.isValidCredentialKey=xC;B.getCredentialKeyValidationError=zC;B.getInvalidCredentialKeyNames=HJ;B.hasCredentialValue=qC;B.hasCredentialKeyValue=YJ;B.getCredentialKeyMetadata=JJ;B.getMissingRequiredCredentialKeys=WJ;B.isFullyMaskedCredentialValue=EC;B.maskCredentialSetValues=ZJ;B.restoreMaskedCredentialValues=KJ;B.isMaskedValue=EA;B.mergeCredentials=XJ;B.maskCredentials=IC;B.buildSensitiveCredentialMap=eW;B.redactKnownCredentialValues=IA;B.estimateDataSize=iW;B.truncateValue=Hg;B.sampleResultObject=jC;B.safeStringify=jA;B.coerceDate=Gg;B.normalizeToolCallDates=CA;B.normalizeMessageDates=SA;B.cloneMessagesWithDates=rW;B.applyAgentCompactionToMessages=nW;B.getMessageContent=BA;B.hasAssistantOutput=CC;B.isEmptyAssistantMessage=QA;B.isRenderableAgentMessage=sW;B.pruneEmptyAssistantMessages=cW;B.getMeaningfulMessages=mW;B.truncateForLLM=lW;B.truncateHeadTail=uW;B.getErrorMessage=dW;B.pickReferencedExecutionFiles=gW;B.parseIconString=pW;B.serializeIcon=hW;B.normalizeToolDiff=SC;B.normalizeToolDiffs=fW;B.composeUrl=bW;B.truncateRunResult=AW;B.getToolSystemIds=vW;B.getCredentialPlaceholderKeysForSystem=BC;B.getUnscopedCallPlaceholderError=qW;B.getToolCredentialPlaceholderKeys=EW;var zA=Md(),yC=Ht(),vJ=AJ((vI(),Sy(AI)));Yg(dC(),B);Yg(Lg(),B);Yg(hC(),B);Yg(fC(),B);function wJ(o){return{name:o.name,whenToRun:o.whenToRun,inputs:o.inputs,systemRefs:o.systemRefs.map(({id:e})=>({id:e})),toolRefs:o.toolRefs.map(({id:e})=>({id:e})),credentialRefs:o.credentialRefs.map(({id:e})=>({id:e})),fileRefs:o.fileRefs,instructions:o.instructions,completionCriteria:o.completionCriteria}}function xJ(o){return{name:o.name,whenToRun:o.whenToRun,inputs:o.inputs,systemRefs:o.systemRefs.map(({id:e})=>({id:e})),toolRefs:o.toolRefs.map(({id:e})=>({id:e})),credentialRefs:o.credentialRefs.map(({id:e})=>({id:e})),fileRefs:o.fileRefs.map(({id:e})=>({id:e})),instructions:o.instructions,completionCriteria:o.completionCriteria}}function zJ({fileName:o,usedNames:e,caseInsensitive:t=!1}){let a=m=>t?m.toLowerCase():m,i=o.lastIndexOf("."),r=i>0?o.slice(0,i):o,n=i>0?o.slice(i):"",s=o,c=1;for(;e.has(a(s));)s=`${r} (${c})${n}`,c++;return e.add(a(s)),s}function qJ(o){return o.startsWith("postgres://")||o.startsWith("postgresql://")?"postgres":o.startsWith("mssql://")||o.startsWith("sqlserver://")?"mssql":o.startsWith("redis://")||o.startsWith("rediss://")?"redis":o.startsWith("mongodb://")||o.startsWith("mongodb+srv://")?"mongodb":o.startsWith("ftp://")||o.startsWith("ftps://")||o.startsWith("sftp://")?"sftp":o.startsWith("smb://")?"smb":o.startsWith("odbc://")?"odbc":o.startsWith("script://")?"script":"http"}function EJ(o){return o?typeof o=="string"?o.startsWith("AbortError:"):o instanceof DOMException?o.name==="AbortError":o instanceof Error?o.name==="AbortError"||o.message.startsWith("AbortError:"):!1:!1}B.ALLOWED_FILE_EXTENSIONS=[".json",".csv",".txt",".xml",".xlsx",".xls",".pdf",".docx",".pptx",".zip",".gz",".yaml",".yml",".py",".ts",".tsx",".js",".jsx",".java",".go",".rs",".rb",".php",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".scala",".sh",".bash",".sql",".html",".css",".scss",".md",".rst"];function IJ(o){if(!o)return null;if(typeof o=="string")try{return JSON.parse(o)}catch{return null}return o}function kC(o){return structuredClone(o)}function jJ(o,e){if(!o||typeof o!="object")return o;let t=kC(o),a=t&&typeof t=="object"&&t.properties&&typeof t.properties=="object"?t.properties:void 0;if(!a)return t;let i=!1;for(let s of e)s in a&&(delete a[s],i=!0);if(!i)return t;if(Array.isArray(t.required)){let s=t.required.filter(c=>!e.includes(c));s.length>0?t.required=s:delete t.required}Object.keys(a).length===0&&delete t.properties;let r=t.properties&&typeof t.properties=="object"?Object.keys(t.properties):[],n=Array.isArray(t.allOf)&&t.allOf.length>0||Array.isArray(t.anyOf)&&t.anyOf.length>0||Array.isArray(t.oneOf)&&t.oneOf.length>0||!!t.patternProperties||!!t.additionalProperties;return r.length===0&&!n?null:t}function CJ(o){let e=IJ(o),t=e&&typeof e=="object"&&e.properties?e.properties:void 0,a=t&&typeof t=="object"?Object.keys(t):[],i=!!(t?.payload&&t?.credentials&&a.every(r=>["payload","credentials"].includes(r)));return e?i?{rawSchema:e,payloadSchema:t?.payload||null,filesSchema:null,credentialsSchema:t?.credentials||null,hasNestedSections:!0}:{rawSchema:e,payloadSchema:jJ(e,["__files"]),filesSchema:t?.__files||null,credentialsSchema:null,hasNestedSections:!1}:{rawSchema:null,payloadSchema:null,filesSchema:null,credentialsSchema:null,hasNestedSections:!1}}function SJ(o){return!!(o&&typeof o=="object"&&Array.isArray(o.required)&&o.required.length>0)}function BJ({payloadSchema:o,filesSchema:e}){if(!!!e)return o||void 0;let a=o&&typeof o=="object"?kC(o):{type:"object",properties:{}},i=a.properties&&typeof a.properties=="object"?{...a.properties}:{};i.__files=e,a.type=a.type||"object",a.properties=i;let r=Array.isArray(a.required)?a.required.filter(n=>n!=="__files"):[];return SJ(e)&&r.push("__files"),r.length>0?a.required=Array.from(new Set(r)):delete a.required,a}var QJ=100,_J=50,Fg=15,bC=15,DJ=10,TJ=5,Nl=o=>o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date),RJ=o=>{let e=[];for(let i=0;i<Math.min(Fg,o.length);i++)e.push(o[i]);let t=Math.max(Fg,o.length-bC);for(let i=t;i<o.length;i++)e.push(o[i]);let a=_J-e.length;if(a>0&&o.length>Fg+bC){let i=Fg,r=t,n=[];for(let s=i;s<Math.min(i+a,r);s++)n.push(o[s]);for(let s=i+a;s<r;s++){let c=Math.floor(Math.random()*(s-i+1));c<a&&(n[c]=o[s])}e.push(...n)}return e},$g=(o,e=TJ)=>e===0||!o||typeof o!="object"?o?.type||"unknown":o.type==="object"&&o.properties?`{${Object.keys(o.properties).sort().map(a=>`${a}:${$g(o.properties[a],e-1)}`).join(",")}}`:o.type==="array"&&o.items?`[${$g(o.items,e-1)}]`:o.oneOf?`oneOf(${o.oneOf.map(a=>$g(a,e-1)).join("|")})`:o.type||"unknown";function qA(o){if(!o||o.length===0)return{type:"array",items:{}};let e=o.some(i=>Nl(i)),t=o.length<=QJ?o:RJ(o);if(e){let i=[],r=new Map;for(let n of t){if(!Nl(n))continue;let s=(0,zA.toJsonSchema)(n,{arrays:{mode:"all"},objects:{additionalProperties:!0}}),c=$g(s);if(!r.has(c)&&(r.set(c,s),i.push(s),i.length>=DJ))break}if(i.length>1)return{type:"array",items:{oneOf:i}};if(i.length===1)return{type:"array",items:i[0]}}let a=(0,zA.toJsonSchema)(t,{arrays:{mode:"all"},objects:{additionalProperties:!0}});return a?.type==="array"?a:{type:"array",items:a}}function AC(o,e){if(!e||typeof e!="object")return e;if(Array.isArray(o))return qA(o);if(Nl(o)&&e.type==="object"&&e.properties){let t={...e,properties:{...e.properties}};for(let a of Object.keys(t.properties)){let i=t.properties[a],r=o?.[a];(Array.isArray(r)||Nl(r))&&(t.properties[a]=AC(r,i))}return t}return e.type==="array"&&Array.isArray(o)?qA(o):e}function NJ(o){return o.reduce((e,t)=>(Object.entries(t.credentials||{}).forEach(([a,i])=>{e[`${t.id}_${a}`]=i}),e),{})}function OJ(o){return o.reduce((e,t)=>(t.url&&(e[`${t.id}_url`]=t.url),e),{})}function UJ(o){return o.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"system"}async function MJ({baseId:o,exists:e}){if(!await e(o))return o;let t=1,a=o.match(/(.*)-(\d+)$/),i=o;for(a&&(i=a[1],t=parseInt(a[2],10)+1);;){let r=`${i}-${t}`;if(!await e(r))return r;t++}}function LJ(o){if(!Array.isArray(o)){let e=(0,zA.toJsonSchema)(o,{arrays:{mode:"all"},objects:{additionalProperties:!0}});return AC(o,e)}return o.length===0?{type:"array",items:{}}:qA(o)}function PJ(o,e){let t=null,a=null;try{o&&e&&(t=JSON.parse(o),a=JSON.parse(e))}catch{return{cert:{content:void 0,filename:void 0},key:{content:void 0,filename:void 0}}}return{cert:t,key:a}}function vC(o){let e=(o||"").trim();return e?/^\s*(async\s+)?(\([^)]*\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/.test(e):!1}function FJ(o){let e=(o||"").trim();if(!e)return`(sourceData) => {
|
|
9
|
+
`+(s!==n?`result of cast: ${s}`:""))}return r}_cast(e,t){let a=e===void 0?e:this.transforms.reduce((i,r)=>r.call(this,i,e,this,t),e);return a===void 0&&(a=this.getDefault(t)),a}_validate(e,t={},a,i){let{path:r,originalValue:n=e,strict:s=this.spec.strict}=t,c=e;s||(c=this._cast(c,Object.assign({assert:!1},t)));let m=[];for(let l of Object.values(this.internalTests))l&&m.push(l);this.runTests({path:r,value:c,originalValue:n,options:t,tests:m},a,l=>{if(l.length)return i(l,c);this.runTests({path:r,value:c,originalValue:n,options:t,tests:this.tests},a,i)})}runTests(e,t,a){let i=!1,{tests:r,value:n,originalValue:s,path:c,options:m}=e,l=k=>{i||(i=!0,t(k,n))},u=k=>{i||(i=!0,a(k,n))},d=r.length,g=[];if(!d)return u([]);let h={value:n,originalValue:s,path:c,options:m,schema:this};for(let k=0;k<r.length;k++){let w=r[k];w(h,l,function(E){E&&(Array.isArray(E)?g.push(...E):g.push(E)),--d<=0&&u(g)})}}asNestedTest({key:e,index:t,parent:a,parentPath:i,originalParent:r,options:n}){let s=e??t;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");let c=typeof s=="number",m=a[s],l=Object.assign({},n,{strict:!0,parent:a,value:m,originalValue:r[s],key:void 0,[c?"index":"key"]:s,path:c||s.includes(".")?`${i||""}[${c?s:`"${s}"`}]`:(i?`${i}.`:"")+e});return(u,d,g)=>this.resolve(l)._validate(m,l,d,g)}validate(e,t){var a;let i=this.resolve(Object.assign({},t,{value:e})),r=(a=t?.disableStackTrace)!=null?a:i.spec.disableStackTrace;return new Promise((n,s)=>i._validate(e,t,(c,m)=>{vo.isError(c)&&(c.value=m),s(c)},(c,m)=>{c.length?s(new vo(c,m,void 0,void 0,r)):n(m)}))}validateSync(e,t){var a;let i=this.resolve(Object.assign({},t,{value:e})),r,n=(a=t?.disableStackTrace)!=null?a:i.spec.disableStackTrace;return i._validate(e,Object.assign({},t,{sync:!0}),(s,c)=>{throw vo.isError(s)&&(s.value=c),s},(s,c)=>{if(s.length)throw new vo(s,e,void 0,void 0,n);r=c}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,a=>{if(vo.isError(a))return!1;throw a})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(a){if(vo.isError(a))return!1;throw a}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):vc(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){let a=this.clone({nullable:e});return a.internalTests.nullable=Ac({message:t,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),a}optionality(e,t){let a=this.clone({optional:e});return a.internalTests.optionality=Ac({message:t,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(e=Ma.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Ma.notNull){return this.nullability(!1,e)}required(e=Ma.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Ma.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),i=Ac(t),r=t.exclusive||t.name&&a.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(a.exclusiveTests[t.name]=!!t.exclusive),a.tests=a.tests.filter(n=>!(n.OPTIONS.name===t.name&&(r||n.OPTIONS.test===i.OPTIONS.test))),a.tests.push(i),a}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let a=this.clone(),i=Rj(e).map(r=>new Pa(r));return i.forEach(r=>{r.isSibling&&a.deps.push(r.key)}),a.conditions.push(typeof t=="function"?new Ng(i,t):Ng.fromOptions(i,t)),a}typeError(e){let t=this.clone();return t.internalTests.typeError=Ac({message:e,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Ma.oneOf){let a=this.clone();return e.forEach(i=>{a._whitelist.add(i),a._blacklist.delete(i)}),a.internalTests.whiteList=Ac({message:t,name:"oneOf",skipAbsent:!0,test(i){let r=this.schema._whitelist,n=r.resolveAll(this.resolve);return n.includes(i)?!0:this.createError({params:{values:Array.from(r).join(", "),resolved:n}})}}),a}notOneOf(e,t=Ma.notOneOf){let a=this.clone();return e.forEach(i=>{a._blacklist.add(i),a._whitelist.delete(i)}),a.internalTests.blacklist=Ac({message:t,name:"notOneOf",test(i){let r=this.schema._blacklist,n=r.resolveAll(this.resolve);return n.includes(i)?this.createError({params:{values:Array.from(r).join(", "),resolved:n}}):!0}}),a}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){let t=(e?this.resolve(e):this).clone(),{label:a,meta:i,optional:r,nullable:n}=t.spec;return{meta:i,label:a,optional:r,nullable:n,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((c,m,l)=>l.findIndex(u=>u.OPTIONS.name===c.OPTIONS.name)===m).map(c=>{let m=c.OPTIONS.params&&e?Pj(Object.assign({},c.OPTIONS.params),e):c.OPTIONS.params;return{name:c.OPTIONS.name,params:m}})}}get"~standard"(){let e=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await e.validate(a,{abortEarly:!1})}}catch(i){if(i instanceof vo)return{issues:yA(i)};throw i}}}}};jo.prototype.__isYupSchema__=!0;for(let o of["validate","validateSync"])jo.prototype[`${o}At`]=function(e,t,a={}){let{parent:i,parentPath:r,schema:n}=bA(this,e,t,a.context);return n[o](i&&i[r],Object.assign({},a,{parent:i,path:e}))};for(let o of["equals","is"])jo.prototype[o]=jo.prototype.oneOf;for(let o of["not","nope"])jo.prototype[o]=jo.prototype.notOneOf;sY=()=>!0;jl=class extends jo{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:sY},e))}};$j.prototype=jl.prototype;Cl=class extends jo{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t)=>{if(this.spec.coerce&&!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=hA.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return qa(t)||t===!0}})}isFalse(e=hA.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return qa(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};Hj.prototype=Cl.prototype;cY=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;lY=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uY=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,dY=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gY="^\\d{4}-\\d{2}-\\d{2}",pY="\\d{2}:\\d{2}:\\d{2}",hY="(([+-]\\d{2}(:?\\d{2})?)|Z)",fY=new RegExp(`${gY}T${pY}(\\.\\d+)?${hY}$`),bY=o=>qa(o)||o===o.trim(),yY={}.toString();Sl=class extends jo{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;let a=e!=null&&e.toString?e.toString():e;return a===yY?e:a})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Ma.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=ct.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(a){return a.length===this.resolve(e)}})}min(e,t=ct.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(a){return a.length>=this.resolve(e)}})}max(e,t=ct.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(a){return a.length<=this.resolve(e)}})}matches(e,t){let a=!1,i,r;return t&&(typeof t=="object"?{excludeEmptyString:a=!1,message:i,name:r}=t:i=t),this.test({name:r||"matches",message:i||ct.matches,params:{regex:e},skipAbsent:!0,test:n=>n===""&&a||n.search(e)!==-1})}email(e=ct.email){return this.matches(lY,{name:"email",message:e,excludeEmptyString:!0})}url(e=ct.url){return this.matches(uY,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ct.uuid){return this.matches(dY,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",a,i;return e&&(typeof e=="object"?{message:t="",allowOffset:a=!1,precision:i=void 0}=e:t=e),this.matches(fY,{name:"datetime",message:t||ct.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||ct.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:r=>{if(!r||a)return!0;let n=fA(r);return n?!!n.z:!1}}).test({name:"datetime_precision",message:t||ct.datetime_precision,params:{precision:i},skipAbsent:!0,test:r=>{if(!r||i==null)return!0;let n=fA(r);return n?n.precision===i:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ct.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:bY})}lowercase(e=ct.lowercase){return this.transform(t=>qa(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>qa(t)||t===t.toLowerCase()})}uppercase(e=ct.uppercase){return this.transform(t=>qa(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>qa(t)||t===t.toUpperCase()})}};Gj.prototype=Sl.prototype;kY=o=>o!=+o;Bl=class extends jo{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!kY(e)}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce)return e;let a=e;if(typeof a=="string"){if(a=a.replace(/\s/g,""),a==="")return NaN;a=+a}return this.isType(a)||a===null?a:parseFloat(a)})})}min(e,t=rn.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(a){return a>=this.resolve(e)}})}max(e,t=rn.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(a){return a<=this.resolve(e)}})}lessThan(e,t=rn.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(a){return a<this.resolve(e)}})}moreThan(e,t=rn.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(a){return a>this.resolve(e)}})}positive(e=rn.positive){return this.moreThan(0,e)}negative(e=rn.negative){return this.lessThan(0,e)}integer(e=rn.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>qa(e)?e:e|0)}round(e){var t;let a=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(a.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+a.join(", "));return this.transform(i=>qa(i)?i:Math[e](i))}};Vj.prototype=Bl.prototype;Yj=new Date(""),AY=o=>Object.prototype.toString.call(o)==="[object Date]";wc=class o extends jo{constructor(){super({type:"date",check(e){return AY(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=mY(e),isNaN(e)?o.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let a;if(Pa.isRef(e))a=e;else{let i=this.cast(e);if(!this._typeCheck(i))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);a=i}return a}min(e,t=pA.min){let a=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(a)}})}max(e,t=pA.max){let a=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(a)}})}};wc.INVALID_DATE=Yj;kA.prototype=wc.prototype;kA.INVALID_DATE=Yj;Wj=(o,e,t)=>{if(typeof o!="string")return o;let a=o;try{a=JSON.parse(o)}catch{}return t.isType(a)?a:o};wY=(o,e)=>{let t=[...(0,ea.normalizePath)(e)];if(t.length===1)return t[0]in o;let a=t.pop(),i=(0,ea.getter)((0,ea.join)(t),!0)(o);return!!(i&&a in i)},Qj=o=>Object.prototype.toString.call(o)==="[object Object]";xY=Jj([]);Ql=class extends jo{constructor(e){super({type:"object",check(t){return Qj(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=xY,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var a;let i=super._cast(e,t);if(i===void 0)return this.getDefault(t);if(!this._typeCheck(i))return i;let r=this.fields,n=(a=t.stripUnknown)!=null?a:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),c={},m=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),l=!1;for(let u of s){let d=r[u],g=u in i,h=i[u];if(d){let k;m.path=(t.path?`${t.path}.`:"")+u,d=d.resolve({value:h,context:t.context,parent:c});let w=d instanceof jo?d.spec:void 0,x=w?.strict;if(w!=null&&w.strip){l=l||u in i;continue}k=!t.__validating||!x?d.cast(h,m):h,k!==void 0&&(c[u]=k)}else g&&!n&&(c[u]=h);(g!==u in c||c[u]!==h)&&(l=!0)}return l?c:i}_validate(e,t={},a,i){let{from:r=[],originalValue:n=e,recursive:s=this.spec.recursive}=t;t.from=[{schema:this,value:n},...r],t.__validating=!0,t.originalValue=n,super._validate(e,t,a,(c,m)=>{if(!s||!Qj(m)){i(c,m);return}n=n||m;let l=[];for(let u of this._nodes){let d=this.fields[u];!d||Pa.isRef(d)||l.push(d.asNestedTest({options:t,key:u,parent:m,parentPath:t.path,originalParent:n}))}this.runTests({tests:l,value:m,originalValue:n,options:t},a,u=>{i(u.sort(this._sortErrors).concat(c),m)})})}clone(e){let t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),a=t.fields;for(let[i,r]of Object.entries(this.fields)){let n=a[i];a[i]=n===void 0?r:n}return t.withMutation(i=>i.setFields(a,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(a=>{var i;let r=this.fields[a],n=e;(i=n)!=null&&i.value&&(n=Object.assign({},n,{parent:n.value,value:n.value[a]})),t[a]=r&&"getDefault"in r?r.getDefault(n):void 0}),t}setFields(e,t){let a=this.clone();return a.fields=e,a._nodes=vY(e,t),a._sortErrors=Jj(Object.keys(e)),t&&(a._excludedEdges=t),a}shape(e,t=[]){return this.clone().withMutation(a=>{let i=a._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),i=[...a._excludedEdges,...t]),a.setFields(Object.assign(a.fields,e),i)})}partial(){let e={};for(let[t,a]of Object.entries(this.fields))e[t]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(e)}deepPartial(){return Tg(this)}pick(e){let t={};for(let a of e)this.fields[a]&&(t[a]=this.fields[a]);return this.setFields(t,this._excludedEdges.filter(([a,i])=>e.includes(a)&&e.includes(i)))}omit(e){let t=[];for(let a of Object.keys(this.fields))e.includes(a)||t.push(a);return this.pick(t)}from(e,t,a){let i=(0,ea.getter)(e,!0);return this.transform(r=>{if(!r)return r;let n=r;return wY(r,e)&&(n=Object.assign({},r),a||delete n[e],n[t]=i(r)),n})}json(){return this.transform(Wj)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||_g.exact,test(t){if(t==null)return!0;let a=_j(this.schema,t);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=_g.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:t,test(i){if(i==null)return!0;let r=_j(this.schema,i);return!e||r.length===0||this.createError({params:{unknown:r.join(", ")}})}});return a.spec.noUnknown=e,a}unknown(e=!0,t=_g.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;let a={};for(let i of Object.keys(t))a[e(i)]=t[i];return a})}camelCase(){return this.transformKeys(Il.camelCase)}snakeCase(){return this.transformKeys(Il.snakeCase)}constantCase(){return this.transformKeys(e=>(0,Il.snakeCase)(e).toUpperCase())}describe(e){let t=(e?this.resolve(e):this).clone(),a=super.describe(e);a.fields={};for(let[r,n]of Object.entries(t.fields)){var i;let s=e;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),a.fields[r]=n.describe(s)}return a}};Zj.prototype=Ql.prototype;_l=class extends jo{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){let a=super._cast(e,t);if(!this._typeCheck(a)||!this.innerType)return a;let i=!1,r=a.map((n,s)=>{let c=this.innerType.cast(n,Object.assign({},t,{path:`${t.path||""}[${s}]`,parent:a,originalValue:n,value:n,index:s}));return c!==n&&(i=!0),c});return i?r:a}_validate(e,t={},a,i){var r;let n=this.innerType,s=(r=t.recursive)!=null?r:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,a,(c,m)=>{var l;if(!s||!n||!this._typeCheck(m)){i(c,m);return}let u=new Array(m.length);for(let g=0;g<m.length;g++){var d;u[g]=n.asNestedTest({options:t,index:g,parent:m,parentPath:t.path,originalParent:(d=t.originalValue)!=null?d:e})}this.runTests({value:m,tests:u,originalValue:(l=t.originalValue)!=null?l:e,options:t},a,g=>i(g.concat(c),m))})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(Wj)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!rs(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+La(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Dg.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(a){return a.length===this.resolve(e)}})}min(e,t){return t=t||Dg.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(a){return a.length>=this.resolve(e)}})}max(e,t){return t=t||Dg.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(a){return a.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(a,i,r)=>!e(a,i,r):a=>!!a;return this.transform(a=>a!=null?a.filter(t):a)}describe(e){let t=(e?this.resolve(e):this).clone(),a=super.describe(e);if(t.innerType){var i;let r=e;(i=r)!=null&&i.value&&(r=Object.assign({},r,{parent:r.value,value:r.value[0]})),a.innerType=t.innerType.describe(r)}return a}};Kj.prototype=_l.prototype;Dl=class extends jo{constructor(e){super({type:"tuple",spec:{types:e},check(t){let a=this.spec.types;return Array.isArray(t)&&t.length===a.length}}),this.withMutation(()=>{this.typeError(Mj.notType)})}_cast(e,t){let{types:a}=this.spec,i=super._cast(e,t);if(!this._typeCheck(i))return i;let r=!1,n=a.map((s,c)=>{let m=s.cast(i[c],Object.assign({},t,{path:`${t.path||""}[${c}]`,parent:i,originalValue:i[c],value:i[c],index:c}));return m!==i[c]&&(r=!0),m});return r?n:i}_validate(e,t={},a,i){let r=this.spec.types;super._validate(e,t,a,(n,s)=>{var c;if(!this._typeCheck(s)){i(n,s);return}let m=[];for(let[u,d]of r.entries()){var l;m[u]=d.asNestedTest({options:t,index:u,parent:s,parentPath:t.path,originalParent:(l=t.originalValue)!=null?l:e})}this.runTests({value:s,tests:m,originalValue:(c=t.originalValue)!=null?c:e,options:t},a,u=>i(u.concat(n),s))})}describe(e){let t=(e?this.resolve(e):this).clone(),a=super.describe(e);return a.innerType=t.spec.types.map((i,r)=>{var n;let s=e;return(n=s)!=null&&n.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),i.describe(s)}),a}};Xj.prototype=Dl.prototype;Ug=class o{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(t,a={})=>{let i=this.builder(t,a);if(!rs(i))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(i=i.optional()),i.resolve(a)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){let t=new o(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:a,parent:i,options:r}=e,n=i[a??t];return this._resolve(n,Object.assign({},r,{value:n,parent:i})).asNestedTest(e)}validate(e,t){return Dj(()=>this._resolve(e,t).validate(e,t))}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,a){return Dj(()=>this._resolve(t,a).validateAt(e,t,a))}validateSyncAt(e,t,a){return this._resolve(t,a).validateSyncAt(e,t,a)}isValid(e,t){try{return this._resolve(e,t).isValid(e,t)}catch(a){if(vo.isError(a))return Promise.resolve(!1);throw a}}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}get"~standard"(){let e=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await e.validate(a,{abortEarly:!1})}}catch(i){if(vo.isError(i))return{issues:yA(i)};throw i}}}}}});var eC=f(wA=>{"use strict";Object.defineProperty(wA,"__esModule",{value:!0});wA.default=[{name:"npm-node-cron",preset:{presetId:"npm-node-cron",useSeconds:!0,useYears:!1,useAliases:!0,useBlankDay:!1,allowOnlyOneBlankDayField:!1,mustHaveBlankDayField:!1,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1,useNthWeekdayOfMonth:!1,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:1,maxValue:31},months:{minValue:0,maxValue:11},daysOfWeek:{minValue:0,maxValue:6},years:{minValue:1970,maxValue:2099}}},{name:"aws-cloud-watch",preset:{presetId:"aws-cloud-watch",useSeconds:!1,useYears:!0,useAliases:!0,useBlankDay:!0,allowOnlyOneBlankDayField:!0,mustHaveBlankDayField:!0,useLastDayOfMonth:!0,useLastDayOfWeek:!0,useNearestWeekday:!0,useNthWeekdayOfMonth:!0,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:1,maxValue:31},months:{minValue:1,maxValue:12},daysOfWeek:{minValue:1,maxValue:7},years:{minValue:1970,maxValue:2199}}},{name:"npm-cron-schedule",preset:{presetId:"npm-cron-schedule",useSeconds:!0,useYears:!1,useAliases:!0,useBlankDay:!1,allowOnlyOneBlankDayField:!1,mustHaveBlankDayField:!1,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1,useNthWeekdayOfMonth:!1,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:1,maxValue:31},months:{minValue:1,maxValue:12},daysOfWeek:{minValue:0,maxValue:7},years:{minValue:1970,maxValue:2099}}}]});var iC=f(wo=>{"use strict";var IY=wo&&wo.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),jY=wo&&wo.__setModuleDefault||(Object.create?(function(o,e){Object.defineProperty(o,"default",{enumerable:!0,value:e})}):function(o,e){o.default=e}),CY=wo&&wo.__importStar||function(o){if(o&&o.__esModule)return o;var e={};if(o!=null)for(var t in o)t!=="default"&&Object.prototype.hasOwnProperty.call(o,t)&&IY(e,o,t);return jY(e,o),e},SY=wo&&wo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(wo,"__esModule",{value:!0});wo.validateOptions=wo.registerOptionPreset=wo.getOptionPresets=wo.getOptionPreset=void 0;var U=CY((vA(),Sy(AA)));vA();var xc=xa(),oC=SY(eC());za();var ns={default:{presetId:"default",useSeconds:!1,useYears:!1,useAliases:!1,useBlankDay:!1,allowOnlyOneBlankDayField:!1,allowStepping:!0,mustHaveBlankDayField:!1,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1,useNthWeekdayOfMonth:!1,seconds:{minValue:0,maxValue:59},minutes:{minValue:0,maxValue:59},hours:{minValue:0,maxValue:23},daysOfMonth:{minValue:0,maxValue:31},months:{minValue:0,maxValue:12},daysOfWeek:{minValue:0,maxValue:7},years:{minValue:1970,maxValue:2099}}},aC=U.object({presetId:U.string().required(),useSeconds:U.boolean().required(),useYears:U.boolean().required(),useAliases:U.boolean(),useBlankDay:U.boolean().required(),allowOnlyOneBlankDayField:U.boolean().required(),allowStepping:U.boolean(),mustHaveBlankDayField:U.boolean(),useLastDayOfMonth:U.boolean(),useLastDayOfWeek:U.boolean(),useNearestWeekday:U.boolean(),useNthWeekdayOfMonth:U.boolean(),seconds:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),minutes:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),hours:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),daysOfMonth:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),months:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),daysOfWeek:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required(),years:U.object({minValue:U.number().min(0).required(),maxValue:U.number().min(0).required(),lowerLimit:U.number().min(0),upperLimit:U.number().min(0)}).required()}).required(),BY=o=>ns[o]?(0,xc.valid)(ns[o]):(0,xc.err)(`Option preset '${o}' not found.`);wo.getOptionPreset=BY;var QY=()=>ns;wo.getOptionPresets=QY;var _Y=(o,e)=>{ns[o]=aC.validateSync(e,{strict:!1,abortEarly:!1,stripUnknown:!0,recursive:!0})};wo.registerOptionPreset=_Y;function DY(){for(let o=0;o<oC.default.length;o+=1){let{name:e,preset:t}=oC.default[o];(0,wo.registerOptionPreset)(e,t)}}DY();var tC=new Map;function TY(o,e){var t;return o+((t=JSON.stringify(e))!==null&&t!==void 0?t:"")}function RY(o){return U.object({presetId:U.string().required(),preset:aC.required(),useSeconds:U.boolean().required(),useYears:U.boolean().required(),useAliases:U.boolean(),useBlankDay:U.boolean().required(),allowOnlyOneBlankDayField:U.boolean().required(),allowStepping:U.boolean(),mustHaveBlankDayField:U.boolean(),useLastDayOfMonth:U.boolean(),useLastDayOfWeek:U.boolean(),useNearestWeekday:U.boolean(),useNthWeekdayOfMonth:U.boolean(),seconds:U.object({lowerLimit:U.number().min(o.seconds.minValue).max(o.seconds.maxValue),upperLimit:U.number().min(o.seconds.minValue).max(o.seconds.maxValue)}).required(),minutes:U.object({lowerLimit:U.number().min(o.minutes.minValue).max(o.minutes.maxValue),upperLimit:U.number().min(o.minutes.minValue).max(o.minutes.maxValue)}).required(),hours:U.object({lowerLimit:U.number().min(o.hours.minValue).max(o.hours.maxValue),upperLimit:U.number().min(o.hours.minValue).max(o.hours.maxValue)}).required(),daysOfMonth:U.object({lowerLimit:U.number().min(o.daysOfMonth.minValue).max(o.daysOfMonth.maxValue),upperLimit:U.number().min(o.daysOfMonth.minValue).max(o.daysOfMonth.maxValue)}).required(),months:U.object({lowerLimit:U.number().min(o.months.minValue).max(o.months.maxValue),upperLimit:U.number().min(o.months.minValue).max(o.months.maxValue)}).required(),daysOfWeek:U.object({lowerLimit:U.number().min(o.daysOfWeek.minValue).max(o.daysOfWeek.maxValue),upperLimit:U.number().min(o.daysOfWeek.minValue).max(o.daysOfWeek.maxValue)}).required(),years:U.object({lowerLimit:U.number().min(o.years.minValue).max(o.years.maxValue),upperLimit:U.number().min(o.years.minValue).max(o.years.maxValue)}).required()}).required()}function NY(o,e){var t,a,i,r,n,s,c,m,l,u,d,g,h,k,w,x,E,q,_,D,H;let J=Object.assign(Object.assign({presetId:o.presetId,preset:o},{useSeconds:o.useSeconds,useYears:o.useYears,useAliases:(t=o.useAliases)!==null&&t!==void 0?t:!1,useBlankDay:o.useBlankDay,allowOnlyOneBlankDayField:o.allowOnlyOneBlankDayField,allowStepping:(a=o.allowStepping)!==null&&a!==void 0?a:!0,mustHaveBlankDayField:(i=o.mustHaveBlankDayField)!==null&&i!==void 0?i:!1,useLastDayOfMonth:(r=o.useLastDayOfMonth)!==null&&r!==void 0?r:!1,useLastDayOfWeek:(n=o.useLastDayOfWeek)!==null&&n!==void 0?n:!1,useNearestWeekday:(s=o.useNearestWeekday)!==null&&s!==void 0?s:!1,useNthWeekdayOfMonth:(c=o.useNthWeekdayOfMonth)!==null&&c!==void 0?c:!1,seconds:{lowerLimit:(m=o.seconds.lowerLimit)!==null&&m!==void 0?m:o.seconds.minValue,upperLimit:(l=o.seconds.upperLimit)!==null&&l!==void 0?l:o.seconds.maxValue},minutes:{lowerLimit:(u=o.minutes.lowerLimit)!==null&&u!==void 0?u:o.minutes.minValue,upperLimit:(d=o.minutes.upperLimit)!==null&&d!==void 0?d:o.minutes.maxValue},hours:{lowerLimit:(g=o.hours.lowerLimit)!==null&&g!==void 0?g:o.hours.minValue,upperLimit:(h=o.hours.upperLimit)!==null&&h!==void 0?h:o.hours.maxValue},daysOfMonth:{lowerLimit:(k=o.daysOfMonth.lowerLimit)!==null&&k!==void 0?k:o.daysOfMonth.minValue,upperLimit:(w=o.daysOfMonth.upperLimit)!==null&&w!==void 0?w:o.daysOfMonth.maxValue},months:{lowerLimit:(x=o.months.lowerLimit)!==null&&x!==void 0?x:o.months.minValue,upperLimit:(E=o.months.upperLimit)!==null&&E!==void 0?E:o.months.maxValue},daysOfWeek:{lowerLimit:(q=o.daysOfWeek.lowerLimit)!==null&&q!==void 0?q:o.daysOfWeek.minValue,upperLimit:(_=o.daysOfWeek.upperLimit)!==null&&_!==void 0?_:o.daysOfWeek.maxValue},years:{lowerLimit:(D=o.years.lowerLimit)!==null&&D!==void 0?D:o.years.minValue,upperLimit:(H=o.years.upperLimit)!==null&&H!==void 0?H:o.years.maxValue}}),e);return RY(o).validateSync(J,{strict:!1,abortEarly:!1,stripUnknown:!0,recursive:!0})}var OY=o=>{try{let e;if(o.preset)if(typeof o.preset=="string"){if(!ns[o.preset])return(0,xc.err)([`Option preset ${o.preset} does not exist.`]);e=ns[o.preset]}else e=o.preset;else e=ns.default;let t=TY(e.presetId,o.override),a=tC.get(t);if(a)return(0,xc.valid)(a);let i=NY(e,o.override);return tC.set(t,i),(0,xc.valid)(i)}catch(e){return(0,xc.err)(e.errors)}};wo.validateOptions=OY});var Ua=f(Tl=>{"use strict";var cs=Tl&&Tl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Tl,"__esModule",{value:!0});var ss=xa(),UY=cs(dj()),MY=cs(gj()),LY=cs(pj()),PY=cs(hj()),FY=cs(fj()),$Y=cs(bj()),HY=cs(yj()),GY=iC();za();var VY=(o,e)=>{let t=o.trim().split(" ");if(e.useSeconds&&e.useYears&&t.length!==7)return(0,ss.err)(`Expected 7 values, but got ${t.length}.`);if((e.useSeconds&&!e.useYears||e.useYears&&!e.useSeconds)&&t.length!==6)return(0,ss.err)(`Expected 6 values, but got ${t.length}.`);if(!e.useSeconds&&!e.useYears&&t.length!==5)return(0,ss.err)(`Expected 5 values, but got ${t.length}.`);let a={seconds:e.useSeconds?t[0]:void 0,minutes:t[e.useSeconds?1:0],hours:t[e.useSeconds?2:1],daysOfMonth:t[e.useSeconds?3:2],months:t[e.useSeconds?4:3],daysOfWeek:t[e.useSeconds?5:4],years:e.useYears?t[e.useSeconds?6:5]:void 0};return(0,ss.valid)(a)},YY=(o,e={})=>{let t=(0,GY.validateOptions)(e);if(t.isError())return t;let a=t.getValue(),i=VY(o,a);if(i.isError())return(0,ss.err)([`${i.getError()} (Input cron: '${o}')`]);let r=i.getValue(),n=[];if(a.useSeconds&&n.push((0,UY.default)(r,a)),n.push((0,MY.default)(r,a)),n.push((0,LY.default)(r,a)),n.push((0,PY.default)(r,a)),n.push((0,FY.default)(r,a)),n.push((0,$Y.default)(r,a)),a.useYears&&n.push((0,HY.default)(r,a)),n.every(c=>c.isValid()))return(0,ss.valid)(r);let s=[];return n.forEach(c=>{c.isError()&&c.getError().forEach(m=>{s.push(m)})}),s.forEach((c,m)=>{s[m]=`${c} (Input cron: '${o}')`}),(0,ss.err)(s)};Tl.default=YY});var zc=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.parseUTCDate=Mg;Oo.requireUTCDate=rC;Oo.toUTCISOString=nC;Oo.toOptionalUTCISOString=aJ;Oo.utcNow=sC;Oo.utcNowISOString=iJ;Oo.getUTCTimestampMs=cC;Oo.parsePersistedTimestamp=Rl;Oo.getPersistedTimestampMs=rJ;Oo.formatPersistedTimestamp=mC;Oo.formatCompactPersistedTimestamp=nJ;Oo.formatPersistedDate=lC;Oo.formatPersistedTime=sJ;Oo.formatRelativePersistedTimestamp=cJ;var JY=/(Z|[+-]\d{2}(?::?\d{2})?)$/i,WY=/^\d{4}-\d{2}-\d{2}$/,ZY=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}/,KY={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"},XY={month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"},eJ={year:"numeric",month:"short",day:"numeric"},oJ={hour:"2-digit",minute:"2-digit"};function tJ(o){let e=o.trim();return e&&(WY.test(e)?`${e}T00:00:00.000Z`:JY.test(e)?e:ZY.test(e)?`${e.replace(" ","T")}Z`:e)}function Mg(o){if(o==null||o==="")return;let e=typeof o=="string"?tJ(o):o instanceof Date||typeof o=="number"&&Number.isFinite(o)?o:void 0;if(e===void 0)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function rC(o,e="timestamp"){let t=Mg(o);if(!t)throw new Error(`Invalid ${e}`);return t}function nC(o,e="timestamp"){return rC(o,e).toISOString()}function aJ(o,e="timestamp"){if(!(o==null||o===""))return nC(o,e)}function sC(){return new Date}function iJ(){return sC().toISOString()}function cC(o){let e=Mg(o);return e?e.getTime():Number.NEGATIVE_INFINITY}function Rl(o){return Mg(o)}function rJ(o){return cC(o)}function mC(o,e=KY,t="-"){let a=Rl(o);return a?a.toLocaleString(void 0,e):t}function nJ(o,e="-"){return mC(o,XY,e)}function lC(o,e="-"){let t=Rl(o);return t?t.toLocaleDateString(void 0,eJ):e}function sJ(o,e="-"){let t=Rl(o);return t?t.toLocaleTimeString(void 0,oJ):e}function cJ(o,e=""){let t=Rl(o);if(!t)return e;let a=Date.now()-t.getTime(),i=Math.floor(a/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;let r=Math.floor(i/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<30?`${n}d ago`:lC(t,e)}});var dC=f(qc=>{"use strict";var mJ=qc&&qc.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(qc,"__esModule",{value:!0});qc.calculateNextRun=dJ;qc.validateCronExpression=gJ;var lJ=mj(),uJ=mJ(Ua()),uC=zc();function dJ(o,e,t){let a=t||(0,uC.utcNow)(),r=lJ.CronExpressionParser.parse(o,{currentDate:a,tz:e}).next().toDate();return(0,uC.parseUTCDate)(r.toISOString())||r}function gJ(o){try{return(0,uJ.default)(o,{preset:"default",override:{useSeconds:!1,useYears:!1,useAliases:!1,allowStepping:!0,useLastDayOfMonth:!1,useLastDayOfWeek:!1,useNearestWeekday:!1}}).isValid()}catch{return!1}}});var Lg=f(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.DEFAULT_TIMEZONE=void 0;ms.isValidTimezone=gC;ms.getRuntimeTimezone=pJ;ms.DEFAULT_TIMEZONE="UTC";function gC(o){try{return new Intl.DateTimeFormat("en-US",{timeZone:o}),!0}catch{return!1}}function pJ(){let o=Intl.DateTimeFormat().resolvedOptions().timeZone;return o&&gC(o)?o:ms.DEFAULT_TIMEZONE}});var hC=f(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.getModelContextLength=hJ;Pg.getConfiguredModelContextLength=fJ;var pC=2e5;function hJ(o){return pC}function fJ(){return pC}});var fC=f(xA=>{"use strict";Object.defineProperty(xA,"__esModule",{value:!0});xA.getModelOutputTokenLimit=yJ;var bJ={"claude-fable-5":128e3,"claude-mythos-5":128e3,"claude-opus-5":128e3,"claude-sonnet-5":128e3,"claude-opus-4-8":128e3,"claude-opus-4-7":128e3,"claude-opus-4-6":128e3,"claude-sonnet-4-6":64e3,"claude-haiku-4-5":64e3,"claude-opus-4-5":64e3,"claude-sonnet-4-5":64e3,"gpt-5":128e3,"gpt-4.1":32768,"gpt-4o":16384,"gemini-2.5-flash":65536,"gemini-2.5-pro":65536};function yJ(o){let e=o.model.toLowerCase();return Object.entries(bJ).find(([a])=>e.includes(a))?.[1]}});var Fa=f(B=>{"use strict";var kJ=B&&B.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),Yg=B&&B.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kJ(e,o,t)},AJ=B&&B.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(B,"__esModule",{value:!0});B.ALLOWED_PATCH_SYSTEM_FIELDS=B.MAX_OBJECT_PREVIEW_KEYS=B.MAX_TRUNCATION_DEPTH=B.MAX_ARRAY_PREVIEW_ITEMS=B.MAX_STRING_PREVIEW_LENGTH=B.MAX_INLINE_RESULT_PREVIEW_BYTES=B.FULLY_MASKED_CREDENTIAL_VALUE=B.maskCredentialValue=B.isSensitiveCredentialKey=B.CREDENTIAL_KEY_VALIDATION_DESCRIPTION=B.CREDENTIAL_KEY_PATTERN=B.ALLOWED_FILE_EXTENSIONS=void 0;B.mapPlaybookToDraftConfig=wJ;B.mapPlaybookDraftToInput=xJ;B.reserveUniqueFileName=zJ;B.inferProtocolFromUrl=qJ;B.isAbortError=EJ;B.getToolInputSchemaSections=CJ;B.buildToolInputSchemaSections=BJ;B.flattenAndNamespaceCredentials=NJ;B.flattenAndNamespaceSystemUrls=OJ;B.slugify=UJ;B.generateUniqueId=MJ;B.inferJsonSchema=LJ;B.resolveOAuthCertAndKey=PJ;B.isArrowFunction=vC;B.assertValidArrowFunction=FJ;B.normalizeCredentialKey=wC;B.isValidCredentialKey=xC;B.getCredentialKeyValidationError=zC;B.getInvalidCredentialKeyNames=HJ;B.hasCredentialValue=qC;B.hasCredentialKeyValue=YJ;B.getCredentialKeyMetadata=JJ;B.getMissingRequiredCredentialKeys=WJ;B.isFullyMaskedCredentialValue=EC;B.maskCredentialSetValues=ZJ;B.restoreMaskedCredentialValues=KJ;B.isMaskedValue=EA;B.mergeCredentials=XJ;B.maskCredentials=IC;B.buildSensitiveCredentialMap=eW;B.redactKnownCredentialValues=IA;B.estimateDataSize=iW;B.truncateValue=Hg;B.sampleResultObject=jC;B.safeStringify=jA;B.coerceDate=Gg;B.normalizeToolCallDates=CA;B.normalizeMessageDates=SA;B.cloneMessagesWithDates=rW;B.applyAgentCompactionToMessages=nW;B.getMessageContent=BA;B.hasAssistantOutput=CC;B.isEmptyAssistantMessage=QA;B.isRenderableAgentMessage=sW;B.pruneEmptyAssistantMessages=cW;B.getMeaningfulMessages=mW;B.truncateForLLM=lW;B.truncateHeadTail=uW;B.getErrorMessage=dW;B.pickReferencedExecutionFiles=gW;B.parseIconString=pW;B.serializeIcon=hW;B.normalizeToolDiff=SC;B.normalizeToolDiffs=fW;B.composeUrl=bW;B.truncateRunResult=AW;B.getToolSystemIds=vW;B.getCredentialPlaceholderKeysForSystem=BC;B.getUnscopedCallPlaceholderError=qW;B.getToolCredentialPlaceholderKeys=EW;var zA=Md(),yC=Ht(),vJ=AJ((vI(),Sy(AI)));Yg(dC(),B);Yg(Lg(),B);Yg(hC(),B);Yg(fC(),B);function wJ(o){return{name:o.name,whenToRun:o.whenToRun,inputs:o.inputs,systemRefs:o.systemRefs.map(({id:e})=>({id:e})),toolRefs:o.toolRefs.map(({id:e})=>({id:e})),credentialRefs:o.credentialRefs.map(({id:e})=>({id:e})),fileRefs:o.fileRefs,instructions:o.instructions,completionCriteria:o.completionCriteria}}function xJ(o){return{name:o.name,whenToRun:o.whenToRun,inputs:o.inputs,systemRefs:o.systemRefs.map(({id:e})=>({id:e})),toolRefs:o.toolRefs.map(({id:e})=>({id:e})),credentialRefs:o.credentialRefs.map(({id:e})=>({id:e})),fileRefs:o.fileRefs.map(({id:e})=>({id:e})),instructions:o.instructions,completionCriteria:o.completionCriteria}}function zJ({fileName:o,usedNames:e,caseInsensitive:t=!1}){let a=m=>t?m.toLowerCase():m,i=o.lastIndexOf("."),r=i>0?o.slice(0,i):o,n=i>0?o.slice(i):"",s=o,c=1;for(;e.has(a(s));)s=`${r} (${c})${n}`,c++;return e.add(a(s)),s}function qJ(o){return o.startsWith("postgres://")||o.startsWith("postgresql://")?"postgres":o.startsWith("mssql://")||o.startsWith("sqlserver://")?"mssql":o.startsWith("redis://")||o.startsWith("rediss://")?"redis":o.startsWith("mongodb://")||o.startsWith("mongodb+srv://")?"mongodb":o.startsWith("ftp://")||o.startsWith("ftps://")||o.startsWith("sftp://")?"sftp":o.startsWith("smb://")?"smb":o.startsWith("odbc://")?"odbc":o.startsWith("script://")?"script":o.startsWith("suitecloud://")?"suitecloud":"http"}function EJ(o){return o?typeof o=="string"?o.startsWith("AbortError:"):o instanceof DOMException?o.name==="AbortError":o instanceof Error?o.name==="AbortError"||o.message.startsWith("AbortError:"):!1:!1}B.ALLOWED_FILE_EXTENSIONS=[".json",".csv",".txt",".xml",".xlsx",".xls",".pdf",".docx",".pptx",".zip",".gz",".yaml",".yml",".py",".ts",".tsx",".js",".jsx",".java",".go",".rs",".rb",".php",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".scala",".sh",".bash",".sql",".html",".css",".scss",".md",".rst"];function IJ(o){if(!o)return null;if(typeof o=="string")try{return JSON.parse(o)}catch{return null}return o}function kC(o){return structuredClone(o)}function jJ(o,e){if(!o||typeof o!="object")return o;let t=kC(o),a=t&&typeof t=="object"&&t.properties&&typeof t.properties=="object"?t.properties:void 0;if(!a)return t;let i=!1;for(let s of e)s in a&&(delete a[s],i=!0);if(!i)return t;if(Array.isArray(t.required)){let s=t.required.filter(c=>!e.includes(c));s.length>0?t.required=s:delete t.required}Object.keys(a).length===0&&delete t.properties;let r=t.properties&&typeof t.properties=="object"?Object.keys(t.properties):[],n=Array.isArray(t.allOf)&&t.allOf.length>0||Array.isArray(t.anyOf)&&t.anyOf.length>0||Array.isArray(t.oneOf)&&t.oneOf.length>0||!!t.patternProperties||!!t.additionalProperties;return r.length===0&&!n?null:t}function CJ(o){let e=IJ(o),t=e&&typeof e=="object"&&e.properties?e.properties:void 0,a=t&&typeof t=="object"?Object.keys(t):[],i=!!(t?.payload&&t?.credentials&&a.every(r=>["payload","credentials"].includes(r)));return e?i?{rawSchema:e,payloadSchema:t?.payload||null,filesSchema:null,credentialsSchema:t?.credentials||null,hasNestedSections:!0}:{rawSchema:e,payloadSchema:jJ(e,["__files"]),filesSchema:t?.__files||null,credentialsSchema:null,hasNestedSections:!1}:{rawSchema:null,payloadSchema:null,filesSchema:null,credentialsSchema:null,hasNestedSections:!1}}function SJ(o){return!!(o&&typeof o=="object"&&Array.isArray(o.required)&&o.required.length>0)}function BJ({payloadSchema:o,filesSchema:e}){if(!!!e)return o||void 0;let a=o&&typeof o=="object"?kC(o):{type:"object",properties:{}},i=a.properties&&typeof a.properties=="object"?{...a.properties}:{};i.__files=e,a.type=a.type||"object",a.properties=i;let r=Array.isArray(a.required)?a.required.filter(n=>n!=="__files"):[];return SJ(e)&&r.push("__files"),r.length>0?a.required=Array.from(new Set(r)):delete a.required,a}var QJ=100,_J=50,Fg=15,bC=15,DJ=10,TJ=5,Nl=o=>o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date),RJ=o=>{let e=[];for(let i=0;i<Math.min(Fg,o.length);i++)e.push(o[i]);let t=Math.max(Fg,o.length-bC);for(let i=t;i<o.length;i++)e.push(o[i]);let a=_J-e.length;if(a>0&&o.length>Fg+bC){let i=Fg,r=t,n=[];for(let s=i;s<Math.min(i+a,r);s++)n.push(o[s]);for(let s=i+a;s<r;s++){let c=Math.floor(Math.random()*(s-i+1));c<a&&(n[c]=o[s])}e.push(...n)}return e},$g=(o,e=TJ)=>e===0||!o||typeof o!="object"?o?.type||"unknown":o.type==="object"&&o.properties?`{${Object.keys(o.properties).sort().map(a=>`${a}:${$g(o.properties[a],e-1)}`).join(",")}}`:o.type==="array"&&o.items?`[${$g(o.items,e-1)}]`:o.oneOf?`oneOf(${o.oneOf.map(a=>$g(a,e-1)).join("|")})`:o.type||"unknown";function qA(o){if(!o||o.length===0)return{type:"array",items:{}};let e=o.some(i=>Nl(i)),t=o.length<=QJ?o:RJ(o);if(e){let i=[],r=new Map;for(let n of t){if(!Nl(n))continue;let s=(0,zA.toJsonSchema)(n,{arrays:{mode:"all"},objects:{additionalProperties:!0}}),c=$g(s);if(!r.has(c)&&(r.set(c,s),i.push(s),i.length>=DJ))break}if(i.length>1)return{type:"array",items:{oneOf:i}};if(i.length===1)return{type:"array",items:i[0]}}let a=(0,zA.toJsonSchema)(t,{arrays:{mode:"all"},objects:{additionalProperties:!0}});return a?.type==="array"?a:{type:"array",items:a}}function AC(o,e){if(!e||typeof e!="object")return e;if(Array.isArray(o))return qA(o);if(Nl(o)&&e.type==="object"&&e.properties){let t={...e,properties:{...e.properties}};for(let a of Object.keys(t.properties)){let i=t.properties[a],r=o?.[a];(Array.isArray(r)||Nl(r))&&(t.properties[a]=AC(r,i))}return t}return e.type==="array"&&Array.isArray(o)?qA(o):e}function NJ(o){return o.reduce((e,t)=>(Object.entries(t.credentials||{}).forEach(([a,i])=>{e[`${t.id}_${a}`]=i}),e),{})}function OJ(o){return o.reduce((e,t)=>(t.url&&(e[`${t.id}_url`]=t.url),e),{})}function UJ(o){return o.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"system"}async function MJ({baseId:o,exists:e}){if(!await e(o))return o;let t=1,a=o.match(/(.*)-(\d+)$/),i=o;for(a&&(i=a[1],t=parseInt(a[2],10)+1);;){let r=`${i}-${t}`;if(!await e(r))return r;t++}}function LJ(o){if(!Array.isArray(o)){let e=(0,zA.toJsonSchema)(o,{arrays:{mode:"all"},objects:{additionalProperties:!0}});return AC(o,e)}return o.length===0?{type:"array",items:{}}:qA(o)}function PJ(o,e){let t=null,a=null;try{o&&e&&(t=JSON.parse(o),a=JSON.parse(e))}catch{return{cert:{content:void 0,filename:void 0},key:{content:void 0,filename:void 0}}}return{cert:t,key:a}}function vC(o){let e=(o||"").trim();return e?/^\s*(async\s+)?(\([^)]*\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/.test(e):!1}function FJ(o){let e=(o||"").trim();if(!e)return`(sourceData) => {
|
|
10
10
|
return {};
|
|
11
11
|
}`;if(e==="$")return`(sourceData) => {
|
|
12
12
|
return sourceData;
|
|
@@ -1068,9 +1068,13 @@ Record bodies (both reads and writes) wrap every business field as {"FieldName":
|
|
|
1068
1068
|
|
|
1069
1069
|
CRITICAL \u2014 the concurrent API user limit is the most common Acumatica integration failure and it presents as an authentication error when it is not one. The instance licence caps concurrent web-services sessions via "Maximum Number of Web Services API Users" on the License Monitoring Console (SM604000), frequently as low as 3 to 6. Two behaviours exhaust it: any request that does not carry the existing session cookie opens a NEW session and consumes another slot, so a client that re-authenticates per request burns the entire licence within a handful of calls; and a session never closed with POST /entity/auth/logout stays open until it times out on its own (roughly 20 minutes), so a crashed run leaves orphaned sessions holding slots. The failure surfaces as "API login limit exceeded". Do NOT treat it as bad credentials and do NOT retry the login \u2014 retrying consumes more slots and deepens the outage. Diagnose it as seat exhaustion, reuse one session for the whole run, and always log out. The concurrent_access scope permits multiple simultaneous sessions on one token but still requires closing them.
|
|
1070
1070
|
|
|
1071
|
-
Two further cautions. Client secrets on a Connected Application can carry expiry dates, so a previously working integration can fail on an expired secret rather than a revoked grant \u2014 check the secret expiry before re-registering. And contract-based writes use PUT with upsert semantics matched on the entity's natural keys rather than a separate create endpoint, so an incomplete payload can silently create a second record instead of updating the intended one; confirm the key fields before writing, and get explicit user approval before any write or action call.`},netsuite:{name:"netsuite",apiUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest",regex:"^.*(netsuite|suitetalk\\.api\\.netsuite\\.com|app\\.netsuite\\.com).*$",icon:"/logos/netsuite.svg",docsUrl:"https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html",preferredAuthType:"oauth2",oauth:{authUrl:"https://{accountId}.app.netsuite.com/app/login/oauth2/authorize.nl",tokenUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token",scopes:"rest_webservices",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!
|
|
1071
|
+
Two further cautions. Client secrets on a Connected Application can carry expiry dates, so a previously working integration can fail on an expired secret rather than a revoked grant \u2014 check the secret expiry before re-registering. And contract-based writes use PUT with upsert semantics matched on the entity's natural keys rather than a separate create endpoint, so an incomplete payload can silently create a second record instead of updating the intended one; confirm the key fields before writing, and get explicit user approval before any write or action call.`},netsuite:{name:"netsuite",apiUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest",regex:"^.*(netsuite|suitetalk\\.api\\.netsuite\\.com|app\\.netsuite\\.com).*$",icon:"/logos/netsuite.svg",docsUrl:"https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html",preferredAuthType:"oauth2",oauth:{authUrl:"https://{accountId}.app.netsuite.com/app/login/oauth2/authorize.nl",tokenUrl:"https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token",scopes:"rest_webservices restlets",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!0},keywords:["records","customers","sales orders","invoices","items","vendors","purchase orders","employees","accounts","journal entries","payments","suiteql","datasets","metadata catalog","custom records"],systemSpecificInstructions:`NetSuite REST Web Services are account-specific: replace {accountId} in apiUrl, authUrl, and tokenUrl with the account ID from Setup > Company > Company Information > Company URLs. Every REST request needs the full URL: <<systemId_url>>/record/v1/<recordType> for records and <<systemId_url>>/query/v1/suiteql for SuiteQL; a relative path such as /record/v1/customer fails with Invalid URL. Do not copy the demo123 examples from Oracle docs.
|
|
1072
1072
|
|
|
1073
|
-
Before OAuth works, enable REST Web Services and OAuth 2.0 in NetSuite, then create an integration record with Authorization Code Grant
|
|
1073
|
+
Before OAuth works, enable REST Web Services and OAuth 2.0 in NetSuite, then create an integration record with Authorization Code Grant, REST Web Services, and RESTlets enabled. The redirect URI must exactly match the superglue OAuth callback, and NetSuite only shows the client ID/secret on first save. Request scopes rest_webservices and restlets and send client credentials as HTTP Basic to the form-encoded token endpoint. Metadata/OpenAPI is account-specific at /record/v1/metadata-catalog with Accept: application/swagger+json, so no public openApiUrl is configured. The sign-in lasts seven days; when a step gets 401 INVALID_LOGIN, the user reconnects NetSuite in superglue.
|
|
1074
|
+
|
|
1075
|
+
SuiteQL runs as POST /query/v1/suiteql with the header Prefer: transient and a body like {"q": "SELECT id, companyname FROM customer WHERE isinactive = 'F'"}; page with ?limit=1000&offset=N and read hasMore in the response (100,000 rows per query at most). Record list endpoints return 100 items by default and up to 1,000 with ?limit=1000. Send X-NetSuite-idempotency-key with a fresh UUID on write requests so a retry is safe. The account allows 15 concurrent requests by default, shared by REST and RESTlets, and answers 429 CONCURRENCY_LIMIT_EXCEEDED instead of queuing: run NetSuite steps in sequence and retry after a short wait.
|
|
1076
|
+
|
|
1077
|
+
The REST API reads and writes records only. It cannot create or change account structure: custom fields, custom record types, custom lists, forms, workflows, saved searches, roles, or scripts. Use the suitecloud protocol on this same system for structure. Step URL: suitecloud://{accountId}.app.netsuite.com, with the same {accountId} host prefix as apiUrl. The body is a JSON object with an operation (validate, preview, deploy, listObjects, importObjects, callRestlet); see the suitecloud reference for the project file format. It uses the same OAuth sign-in as the REST steps, so it runs as the connected user and role. The role needs the SuiteCloud Development Framework permissions; the standard Developer role has them. Setup guide: https://superglue.ai/docs/guides/netsuite-suitecloud/. Always run validate and preview and show the planned changes before deploy. A deploy step must set modify to true. Tell the user before the deploy when a change cannot be undone, such as enabling a feature.`},spotify:{name:"spotify",apiUrl:"https://api.spotify.com/v1",regex:"^.*(spotify|api\\.spotify\\.com).*$",icon:"spotify",docsUrl:"https://developer.spotify.com/documentation/web-api",openApiUrl:"https://developer.spotify.com/reference/web-api/open-api-schema.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.spotify.com/authorize",tokenUrl:"https://accounts.spotify.com/api/token",scopes:"user-read-private user-read-email",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form",usePKCE:!1},keywords:["albums","artists","tracks","playlists","users","shows","episodes","audiobooks","player","playback","search","recommendations","library","markets"],systemSpecificInstructions:`Register your app at https://developer.spotify.com/dashboard to obtain client_id and client_secret. The redirect URI must be added exactly in the dashboard \u2014 any mismatch causes an auth error.
|
|
1074
1078
|
|
|
1075
1079
|
Token endpoint uses form-encoded body (not JSON) with client credentials in the Authorization: Basic base64(client_id:client_secret) header. Client Credentials flow (no user context) does not issue refresh tokens. PKCE is supported for public clients (no client_secret) \u2014 use usePKCE: true for SPA/mobile flows.`},spaceship:{name:"spaceship",apiUrl:"https://spaceship.dev/api/v1",regex:"^.*(spaceship\\.dev|\\bspaceship\\b).*$",icon:"spaceship",docsUrl:"https://docs.spaceship.dev",preferredAuthType:"api_key",keywords:["domains","dns","records","nameservers","contacts","registrar","whois","transfers","registration"],systemSpecificInstructions:"Authentication requires two headers on every request: X-Api-Key (your API key) and X-Api-Secret (your API secret). Generate both at https://spaceship.com/application/api-manager/."},promptwatch:{name:"promptwatch",apiUrl:"https://server.promptwatch.com/api/v2",regex:"^.*(promptwatch).*$",icon:"promptwatch",docsUrl:"https://promptwatch.com/docs",openApiUrl:"https://promptwatch.com/docs/v2/openapi.json",preferredAuthType:"api_key",keywords:["monitors","prompts","projects","responses","citations","brands","rank analysis","content gaps","sitemap","brand mentions","visibility","analytics","ai visibility"],systemSpecificInstructions:`Promptwatch API authentication:
|
|
1076
1080
|
|
|
@@ -1574,7 +1578,7 @@ ${m.toString(16)}\r
|
|
|
1574
1578
|
|
|
1575
1579
|
${e.format(t)}`.trim():`${t.length} interceptors are pending:
|
|
1576
1580
|
|
|
1577
|
-
${e.format(t)}`.trim())}};FD.exports=k0});var v0=f((EBe,VD)=>{"use strict";var{InvalidArgumentError:wwe}=ge(),{runtimeFeatures:xwe}=Ir();function zwe(o={}){let{ignoreHeaders:e=[],excludeHeaders:t=[],matchHeaders:a=[],caseSensitive:i=!1}=o;return{ignore:new Set(e.map(r=>i?r:r.toLowerCase())),exclude:new Set(t.map(r=>i?r:r.toLowerCase())),match:new Set(a.map(r=>i?r:r.toLowerCase()))}}var $D=xwe.has("crypto")?require("crypto"):null,qwe=$D?.hash?o=>$D.hash("sha256",o,"base64url"):o=>Buffer.from(o).toString("base64url");function GD(o){return Array.isArray(o)&&(o.length&1)===0}function Ewe(o=[]){return o.length===0?()=>!1:function(t){let a;for(let i of o)if(typeof i=="string"){if(a||(a=t.toLowerCase()),a.includes(i.toLowerCase()))return!0}else if(i instanceof RegExp&&i.test(t))return!0;return!1}}function Iwe(o){let e={};if(!o)return e;if(GD(o)){for(let t=0;t<o.length;t+=2){let a=o[t],i=o[t+1];if(a&&i!==void 0){let r=Buffer.isBuffer(a)?a.toString():a,n=Buffer.isBuffer(i)?i.toString():i;e[r.toLowerCase()]=n}}return e}if(o&&typeof o=="object")for(let[t,a]of Object.entries(o))t&&typeof t=="string"&&(e[t.toLowerCase()]=Array.isArray(a)?a.join(", "):String(a));return e}var HD=["record","playback","update"];function jwe(o){if(!HD.includes(o))throw new wwe(`Invalid snapshot mode: ${o}. Must be one of: ${HD.join(", ")}`)}VD.exports={createHeaderFilters:zwe,hashId:qwe,isUndiciHeaders:GD,normalizeHeaders:Iwe,isUrlExcludedFactory:Ewe,validateSnapshotMode:jwe}});var t7=f((IBe,o7)=>{"use strict";var{writeFile:Cwe,readFile:Swe,mkdir:Bwe}=require("fs/promises"),{dirname:Qwe,resolve:YD}=require("path"),{setTimeout:_we,clearTimeout:JD}=require("timers"),{InvalidArgumentError:WD,UndiciError:Dwe}=ge(),{hashId:Twe,isUrlExcludedFactory:Rwe,normalizeHeaders:ZD,createHeaderFilters:KD}=v0();function Ku(o,e,t={}){let a=new URL(o.path,o.origin),i=o._normalizedHeaders||ZD(o.headers);return o._normalizedHeaders||(o._normalizedHeaders=i),{method:o.method||"GET",url:t.matchQuery!==!1?a.toString():`${a.origin}${a.pathname}`,headers:XD(i,e,t),body:t.matchBody!==!1&&o.body?String(o.body):""}}function XD(o,e,t={}){if(!o||typeof o!="object")return{};let{caseSensitive:a=!1}=t,i={},{ignore:r,exclude:n,match:s}=e;for(let[c,m]of Object.entries(o)){let l=a?c:c.toLowerCase();n.has(l)||r.has(l)||s.size!==0&&!s.has(l)||(i[l]=m)}return i}function e7(o,e,t={}){if(!o||typeof o!="object")return{};let{caseSensitive:a=!1}=t,i={},{exclude:r}=e;for(let[n,s]of Object.entries(o)){let c=a?n:n.toLowerCase();r.has(c)||(i[c]=s)}return i}function Xu(o){let e=[o.method,o.url];if(o.headers&&typeof o.headers=="object"){let a=Object.keys(o.headers).sort();for(let i of a){let r=Array.isArray(o.headers[i])?o.headers[i]:[o.headers[i]];e.push(i);for(let n of r.sort())e.push(String(n))}}e.push(o.body);let t=e.join("|");return Twe(t)}var w0=class{#e;#o;#a=new Map;#i;#r=1/0;#t=!1;#c;constructor(e={}){this.#i=e.snapshotPath,this.#r=e.maxSnapshots||1/0,this.#t=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#c=KD(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#o=Rwe(e.excludeUrls),this.#t&&this.#i&&this.#n()}async record(e,t){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let a=Ku(e,this.#c,this.matchOptions),i=Xu(a),r=ZD(t.headers),n={statusCode:t.statusCode,headers:e7(r,this.#c,this.matchOptions),body:Buffer.isBuffer(t.body)?t.body.toString("base64"):Buffer.from(String(t.body||"")).toString("base64"),trailers:t.trailers};if(this.#a.size>=this.#r&&!this.#a.has(i)){let c=this.#a.keys().next().value;this.#a.delete(c)}let s=this.#a.get(i);s&&s.responses?(s.responses.push(n),s.timestamp=new Date().toISOString()):this.#a.set(i,{request:a,responses:[n],callCount:0,timestamp:new Date().toISOString()}),this.#t&&this.#i&&this.#m()}isUrlExcluded(e){let t=new URL(e.path,e.origin).toString();return this.#o(t)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let t=Ku(e,this.#c,this.matchOptions),a=Xu(t),i=this.#a.get(a);if(!i)return;let r=i.callCount||0,n=Math.min(r,i.responses.length-1);return i.callCount=r+1,{...i,response:i.responses[n]}}async loadSnapshots(e){let t=e||this.#i;if(!t)throw new WD("Snapshot path is required");try{let a=await Swe(YD(t),"utf8"),i=JSON.parse(a);if(Array.isArray(i)){this.#a.clear();for(let{hash:r,snapshot:n}of i)this.#a.set(r,n)}else this.#a=new Map(Object.entries(i))}catch(a){if(a.code==="ENOENT")this.#a.clear();else throw new Dwe(`Failed to load snapshots from ${t}`,{cause:a})}}async saveSnapshots(e){let t=e||this.#i;if(!t)throw new WD("Snapshot path is required");let a=YD(t);await Bwe(Qwe(a),{recursive:!0});let i=Array.from(this.#a.entries()).map(([r,n])=>({hash:r,snapshot:n}));await Cwe(a,JSON.stringify(i,null,2),{flush:!0})}clear(){this.#a.clear()}getSnapshots(){return Array.from(this.#a.values())}size(){return this.#a.size}resetCallCounts(){for(let e of this.#a.values())e.callCount=0}deleteSnapshot(e){let t=Ku(e,this.#c,this.matchOptions),a=Xu(t);return this.#a.delete(a)}getSnapshotInfo(e){let t=Ku(e,this.#c,this.matchOptions),a=Xu(t),i=this.#a.get(a);return i?{hash:a,request:i.request,responseCount:i.responses?i.responses.length:i.response?1:0,callCount:i.callCount||0,timestamp:i.timestamp}:null}replaceSnapshots(e){if(this.#a.clear(),Array.isArray(e))for(let{hash:t,snapshot:a}of e)this.#a.set(t,a);else e&&typeof e=="object"&&(this.#a=new Map(Object.entries(e)))}#n(){return this.#m()}#s(){this.#e&&(JD(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#m(){this.#e=_we(()=>{this.saveSnapshots().catch(()=>{}),this.#t?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#s(),this.#e&&(JD(this.#e),this.#e=null)}async close(){this.#i&&this.#a.size!==0&&await this.saveSnapshots(),this.destroy()}};o7.exports={SnapshotRecorder:w0,formatRequestKey:Ku,createRequestHash:Xu,filterHeadersForMatching:XD,filterHeadersForStorage:e7,createHeaderFilters:KD}});var r7=f((jBe,i7)=>{"use strict";var Nwe=Qs(),Owe=A0(),{SnapshotRecorder:Uwe}=t7(),Mwe=fu(),{InvalidArgumentError:Lwe,UndiciError:Pwe}=ge(),{validateSnapshotMode:Fwe}=v0(),pt=Symbol("kSnapshotRecorder"),er=Symbol("kSnapshotMode"),ed=Symbol("kSnapshotPath"),x0=Symbol("kSnapshotLoaded"),Wf=Symbol("kRealAgent"),a7=!1,z0=class extends Owe{constructor(e={}){a7||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),a7=!0);let{mode:t="record",snapshotPath:a=null,...i}=e;if(super(i),Fwe(t),(t==="playback"||t==="update")&&!a)throw new Lwe(`snapshotPath is required when mode is '${t}'`);this[er]=t,this[ed]=a,this[pt]=new Uwe({snapshotPath:this[ed],mode:this[er],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[x0]=!1,(this[er]==="record"||this[er]==="update"||this[er]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Wf]=new Nwe(e)),(this[er]==="playback"||this[er]==="update")&&this[ed]&&this.loadSnapshots().catch(()=>{})}dispatch(e,t){t=Mwe.wrap(t);let a=this[er];if(this[pt].isUrlExcluded(e))return this[Wf].dispatch(e,t);if(a==="playback"||a==="update"){if(!this[x0])return this.#e(e,t);let i=this[pt].findSnapshot(e);if(i)return this.#a(i,t);if(a==="update")return this.#o(e,t);{let r=new Pwe(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(t.onError){t.onError(r);return}throw r}}else if(a==="record")return this.#o(e,t)}async#e(e,t){return await this.loadSnapshots(),this.dispatch(e,t)}#o(e,t){let a={statusCode:null,headers:{},trailers:{},body:[]},i=this,r={onRequestStart(s,c){return t.onRequestStart(s,{...c,history:this.history})},onRequestUpgrade(s,c,m,l){return t.onRequestUpgrade(s,c,m,l)},onResponseStart(s,c,m,l){return a.statusCode=c,a.headers=m,t.onResponseStart(s,c,m,l)},onResponseData(s,c){return a.body.push(c),t.onResponseData(s,c)},onResponseEnd(s,c){a.trailers=c;let m=Buffer.concat(a.body);i[pt].record(e,{statusCode:a.statusCode,headers:a.headers,body:m,trailers:a.trailers}).then(()=>t.onResponseEnd(s,c)).catch(l=>t.onResponseError(s,l))}};return this[Wf].dispatch(e,r)}#a(e,t){try{let{response:a}=e,i={pause(){},resume(){},abort(n){this.aborted=!0,this.reason=n},aborted:!1,paused:!1};t.onRequestStart(i),t.onResponseStart(i,a.statusCode,a.headers);let r=Buffer.from(a.body,"base64");t.onResponseData(i,r),t.onResponseEnd(i,a.trailers)}catch(a){t.onError?.(a)}}async loadSnapshots(e){await this[pt].loadSnapshots(e||this[ed]),this[x0]=!0,this[er]==="playback"&&this.#i()}async saveSnapshots(e){return this[pt].saveSnapshots(e||this[ed])}#i(){for(let e of this[pt].getSnapshots()){let{request:t,responses:a,response:i}=e,r=new URL(t.url),n=this.get(r.origin),s=a?a[0]:i;s&&n.intercept({path:r.pathname+r.search,method:t.method,headers:t.headers,body:t.body}).reply(s.statusCode,s.body,{headers:s.headers,trailers:s.trailers}).persist()}}getRecorder(){return this[pt]}getMode(){return this[er]}clearSnapshots(){this[pt].clear()}resetCallCounts(){this[pt].resetCallCounts()}deleteSnapshot(e){return this[pt].deleteSnapshot(e)}getSnapshotInfo(e){return this[pt].getSnapshotInfo(e)}replaceSnapshots(e){this[pt].replaceSnapshots(e)}async close(){await this[pt].close(),await this[Wf]?.close(),await super.close()}};i7.exports=z0});var Zf=f((CBe,m7)=>{"use strict";var $we=Symbol.for("undici.globalDispatcher.2"),n7=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Hwe}=ge(),Gwe=Qs();c7()===void 0&&s7(new Gwe);function s7(o){if(!o||typeof o.dispatch!="function")throw new Hwe("Argument agent must implement Agent");Object.defineProperty(globalThis,$we,{value:o,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,n7,{value:o,writable:!0,enumerable:!1,configurable:!1})}function c7(){return globalThis[n7]}var Vwe=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];m7.exports={setGlobalDispatcher:s7,getGlobalDispatcher:c7,installedExports:Vwe}});var bm=f((BBe,l7)=>{"use strict";var Nr=require("assert"),Ywe=fu();l7.exports=class{#e;#o=!1;#a=!1;#i=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=Ywe.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return Nr(!this.#o),Nr(!this.#a),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return Nr(!this.#o),Nr(!this.#a),Nr(!this.#i),this.#i=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return Nr(!this.#o),Nr(!this.#a),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return Nr(!this.#o),Nr(!this.#a),this.#o=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#a=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var j0=f((QBe,p7)=>{"use strict";var ht=be(),{kBodyUsed:od}=Ue(),I0=require("assert"),{InvalidArgumentError:q0}=ge(),Jwe=require("events"),Wwe=[300,301,302,303,307,308],u7=Symbol("body"),d7=()=>{},Kf=class{constructor(e){this[u7]=e,this[od]=!1}async*[Symbol.asyncIterator](){I0(!this[od],"disturbed"),this[od]=!0,yield*this[u7]}},E0=class o{static buildDispatch(e,t){if(t!=null&&(!Number.isInteger(t)||t<0))throw new q0("maxRedirections must be a positive number");let a=e.dispatch.bind(e);return(i,r)=>a(i,new o(a,t,i,r))}constructor(e,t,a,i){if(t!=null&&(!Number.isInteger(t)||t<0))throw new q0("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:r,...n}=a;this.opts=n,this.maxRedirections=t,this.handler=i,this.history=[],ht.isStream(this.opts.body)?(ht.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){I0(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[od]=!1,Jwe.prototype.on.call(this.opts.body,"data",function(){this[od]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Kf(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&ht.isIterable(this.opts.body)&&!ht.isFormDataLike(this.opts.body)&&(this.opts.body=new Kf(this.opts.body))}onRequestStart(e,t){this.handler.onRequestStart?.(e,{...t,history:this.history})}onRequestUpgrade(e,t,a,i){this.handler.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((t===301||t===302)&&this.opts.method==="POST"&&(this.opts.method="GET",ht.isStream(this.opts.body)&&ht.destroy(this.opts.body.on("error",d7)),this.opts.body=null),t===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",ht.isStream(this.opts.body)&&ht.destroy(this.opts.body.on("error",d7)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||ht.isDisturbed(this.opts.body)||Wwe.indexOf(t)===-1?null:a.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,t,a,i);return}let{origin:r,pathname:n,search:s}=ht.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),c=s?`${n}${s}`:n,m=`${r}${c}`;for(let l of this.history)if(l.toString()===m)throw new q0(`Redirect loop detected. Cannot redirect to ${r}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=Zwe(this.opts.headers,t===303,this.opts.origin!==r),this.opts.path=c,this.opts.origin=r,this.opts.query=null}onResponseData(e,t){this.location||this.handler.onResponseData?.(e,t)}onResponseEnd(e,t){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,t)}onResponseError(e,t){this.handler.onResponseError?.(e,t)}};function g7(o,e,t){if(o.length===4)return ht.headerNameToString(o)==="host";if(e&&ht.headerNameToString(o).startsWith("content-"))return!0;if(t&&(o.length===13||o.length===6||o.length===19)){let a=ht.headerNameToString(o);return a==="authorization"||a==="cookie"||a==="proxy-authorization"}return!1}function Zwe(o,e,t){let a=[];if(Array.isArray(o))for(let i=0;i<o.length;i+=2)g7(o[i],e,t)||a.push(o[i],o[i+1]);else if(o&&typeof o=="object"){let i=ht.hasSafeIterator(o)?o:Object.entries(o);for(let[r,n]of i)g7(r,e,t)||a.push(r,n)}else I0(o==null,"headers must be an object or an array");return a}p7.exports=E0});var f7=f((_Be,h7)=>{"use strict";var Kwe=j0();function Xwe({maxRedirections:o}={}){return e=>function(a,i){let{maxRedirections:r=o,...n}=a;if(r==null||r===0)return e(a,i);let s={...n},c=new Kwe(e,r,s,i);return e(s,c)}}h7.exports=Xwe});var y7=f((DBe,b7)=>{"use strict";var exe=bm(),{ResponseError:oxe}=ge(),C0=class extends exe{#e;#o;#a;#i;#r;constructor(e,{handler:t}){super(t)}#t(e){return(this.#o??"").indexOf(e)===0}onRequestStart(e,t){return this.#e=0,this.#o=null,this.#a=null,this.#i=null,this.#r="",super.onRequestStart(e,t)}onResponseStart(e,t,a,i){if(this.#e=t,this.#i=a,this.#o=a["content-type"],this.#e<400)return super.onResponseStart(e,t,a,i);(this.#t("application/json")||this.#t("text/plain"))&&(this.#a=new TextDecoder("utf-8"))}onResponseData(e,t){if(this.#e<400)return super.onResponseData(e,t);this.#r+=this.#a?.decode(t,{stream:!0})??""}onResponseEnd(e,t){if(this.#e>=400){if(this.#r+=this.#a?.decode(void 0,{stream:!1})??"",this.#t("application/json"))try{this.#r=JSON.parse(this.#r)}catch{}let a,i=Error.stackTraceLimit;Error.stackTraceLimit=0;try{a=new oxe("Response Error",this.#e,{body:this.#r,headers:this.#i})}finally{Error.stackTraceLimit=i}super.onResponseError(e,a)}else super.onResponseEnd(e,t)}onResponseError(e,t){super.onResponseError(e,t)}};b7.exports=()=>o=>function(t,a){return o(t,new C0(t,{handler:a}))}});var A7=f((TBe,k7)=>{"use strict";var txe=Rf();k7.exports=o=>e=>function(a,i){return e(a,new txe({...a,retryOptions:{...o,...a.retryOptions}},{handler:i,dispatch:e}))}});var w7=f((RBe,v7)=>{"use strict";var{InvalidArgumentError:axe,RequestAbortedError:ixe}=ge(),rxe=bm(),S0=class extends rxe{#e=1024*1024;#o=!1;#a=0;#i=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:t},a){if(e!=null&&(!Number.isFinite(e)||e<1))throw new axe("maxSize must be a number greater than 0");super(a),this.#e=e??this.#e}#r(e){this.aborted=!0,this.reason=e}onRequestStart(e,t){return e.abort=this.#r.bind(this),this.#i=e,super.onRequestStart(e,t)}onResponseStart(e,t,a,i){let r=a["content-length"];if(r!=null&&r>this.#e)throw new ixe(`Response size (${r}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,t,a,i)}onResponseError(e,t){this.#o||(t=this.#i?.reason??t,super.onResponseError(e,t))}onResponseData(e,t){return this.#a=this.#a+t.length,this.#a>=this.#e&&(this.#o=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,t){if(!this.#o){if(this.#i.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,t)}}};function nxe({maxSize:o}={maxSize:1024*1024}){return e=>function(a,i){let{dumpMaxSize:r=o}=a,n=new S0({maxSize:r,signal:a.signal},i);return e(a,n)}}v7.exports=nxe});var E7=f((NBe,q7)=>{"use strict";var{isIP:sxe}=require("net"),{lookup:cxe}=require("dns"),mxe=bm(),{InvalidArgumentError:Fs,InformationalError:lxe}=ge(),B0=Math.pow(2,31)-1;function uxe(o){let e=Object.getPrototypeOf(o);return Object.prototype.hasOwnProperty.call(o,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof o[Symbol.iterator]=="function"}function x7(o){return typeof o=="string"&&o.toLowerCase()==="host"}function dxe(o){if(o==null)return null;if(Array.isArray(o)){if(o.length===0||!Array.isArray(o[0]))return o;let e=[];for(let t of o)Array.isArray(t)&&t.length===2?e.push(t[0],t[1]):e.push(t);return e}if(typeof o=="object"&&uxe(o)){let e=[];for(let t of o)Array.isArray(t)&&t.length===2?e.push(t[0],t[1]):e.push(t);return e}return o}function gxe(o){if(o==null)return!1;if(Array.isArray(o)){if(o.length===0)return!1;for(let e=0;e<o.length;e+=2)if(x7(o[e]))return!0;return!1}if(typeof o=="object"){for(let e in o)if(x7(e))return!0}return!1}function z7(o,e){let t=dxe(e);return gxe(t)?t:Array.isArray(t)?["host",o,...t]:t&&typeof t=="object"?{host:o,...t}:{host:o}}var Q0=class{#e=0;#o=new Map;constructor(e){this.#e=e.maxItems}get size(){return this.#o.size}get(e){return this.#o.get(e)??null}set(e,t){this.#o.set(e,t)}delete(e){this.#o.delete(e)}full(){return this.size>=this.#e}},_0=class{#e=0;#o=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#o=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#a,this.pick=e.pick??this.#i,this.storage=e.storage??new Q0(e)}runLookup(e,t,a){let i=this.storage.get(e.hostname);if(i==null&&this.storage.full()){a(null,e);return}let r={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#o};if(i==null)this.lookup(e,r,(n,s)=>{if(n||s==null||s.length===0){a(n??new lxe("No DNS entries found"));return}this.setRecords(e,s);let c=this.storage.get(e.hostname),m=this.pick(e,c,r.affinity),l;typeof m.port=="number"?l=`:${m.port}`:e.port!==""?l=`:${e.port}`:l="",a(null,new URL(`${e.protocol}//${m.family===6?`[${m.address}]`:m.address}${l}`))});else{let n=this.pick(e,i,r.affinity);if(n==null){this.storage.delete(e.hostname),this.runLookup(e,t,a);return}let s;typeof n.port=="number"?s=`:${n.port}`:e.port!==""?s=`:${e.port}`:s="",a(null,new URL(`${e.protocol}//${n.family===6?`[${n.address}]`:n.address}${s}`))}}#a(e,t,a){cxe(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(i,r)=>{if(i)return a(i);let n=new Map;for(let s of r)n.set(`${s.address}:${s.family}`,s);a(null,n.values())})}#i(e,t,a){let i=null,{records:r,offset:n}=t,s;if(this.dualStack?(a==null&&(n==null||n===B0?(t.offset=0,a=4):(t.offset++,a=(t.offset&1)===1?6:4)),r[a]!=null&&r[a].ips.length>0?s=r[a]:s=r[a===4?6:4]):s=r[a],s==null||s.ips.length===0)return i;s.offset==null||s.offset===B0?s.offset=0:s.offset++;let c=s.offset%s.ips.length;return i=s.ips[c]??null,i==null?i:Date.now()-i.timestamp>i.ttl?(s.ips.splice(c,1),this.pick(e,t,a)):i}pickFamily(e,t){let a=this.storage.get(e.hostname)?.records;if(!a)return null;let i=a[t];if(!i)return null;i.offset==null||i.offset===B0?i.offset=0:i.offset++;let r=i.offset%i.ips.length,n=i.ips[r]??null;return n==null||Date.now()-n.timestamp>n.ttl&&i.ips.splice(r,1),n}setRecords(e,t){let a=Date.now(),i={records:{4:null,6:null}},r=this.#e;for(let n of t){n.timestamp=a,typeof n.ttl=="number"?(n.ttl=Math.min(n.ttl,this.#e),r=Math.min(r,n.ttl)):n.ttl=this.#e;let s=i.records[n.family]??{ips:[]};s.ips.push(n),i.records[n.family]=s}this.storage.set(e.hostname,i,{ttl:r})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,t){return new D0(this,e,t)}},D0=class extends mxe{#e=null;#o=null;#a=null;#i=null;#r=null;#t=null;#c=!0;constructor(e,{origin:t,handler:a,dispatch:i,newOrigin:r},n){super(a),this.#i=t,this.#t=r,this.#o={...n},this.#e=e,this.#a=i}onResponseError(e,t){switch(t.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#c){super.onResponseError(e,t);return}this.#c=!1;let a=this.#t.hostname[0]==="["?4:6,i=this.#e.pickFamily(this.#i,a);if(i==null){super.onResponseError(e,t);return}let r;typeof i.port=="number"?r=`:${i.port}`:this.#i.port!==""?r=`:${this.#i.port}`:r="";let n={...this.#o,origin:`${this.#i.protocol}//${i.family===6?`[${i.address}]`:i.address}${r}`,headers:z7(this.#i.host,this.#o.headers)};this.#a(n,this);return}super.onResponseError(e,t);break}case"ENOTFOUND":this.#e.deleteRecords(this.#i),super.onResponseError(e,t);break;default:super.onResponseError(e,t);break}}};q7.exports=o=>{if(o?.maxTTL!=null&&(typeof o?.maxTTL!="number"||o?.maxTTL<0))throw new Fs("Invalid maxTTL. Must be a positive number");if(o?.maxItems!=null&&(typeof o?.maxItems!="number"||o?.maxItems<1))throw new Fs("Invalid maxItems. Must be a positive number and greater than zero");if(o?.affinity!=null&&o?.affinity!==4&&o?.affinity!==6)throw new Fs("Invalid affinity. Must be either 4 or 6");if(o?.dualStack!=null&&typeof o?.dualStack!="boolean")throw new Fs("Invalid dualStack. Must be a boolean");if(o?.lookup!=null&&typeof o?.lookup!="function")throw new Fs("Invalid lookup. Must be a function");if(o?.pick!=null&&typeof o?.pick!="function")throw new Fs("Invalid pick. Must be a function");if(o?.storage!=null&&(typeof o?.storage?.get!="function"||typeof o?.storage?.set!="function"||typeof o?.storage?.full!="function"||typeof o?.storage?.delete!="function"))throw new Fs("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=o?.dualStack??!0,t;e?t=o?.affinity??null:t=o?.affinity??4;let a={maxTTL:o?.maxTTL??1e4,lookup:o?.lookup??null,pick:o?.pick??null,dualStack:e,affinity:t,maxItems:o?.maxItems??1/0,storage:o?.storage},i=new _0(a);return r=>function(s,c){let m=s.origin.constructor===URL?s.origin:new URL(s.origin);return sxe(m.hostname)!==0?r(s,c):(i.runLookup(m,s,(l,u)=>{if(l)return c.onResponseError(null,l);let d={...s,servername:m.hostname,origin:u.origin,headers:z7(m.host,s.headers)};r(d,i.getHandler({origin:m,dispatch:r,handler:c,newOrigin:u},s))}),!0)}}});var ym=f((OBe,N7)=>{"use strict";var{safeHTTPMethods:I7,pathHasQueryOrFragment:pxe,hasSafeIterator:hxe,isValidHTTPToken:td}=be(),{serializePathWithQuery:fxe}=be(),bxe=2147483647,j7=["no-store","private","no-cache"],T0=Symbol("invalid cache-control directives");function $s(o){return o.replace(/^[\t ]+|[\t ]+$/g,"")}function D7(o,e){for(let t=0;t<o.length;t++)if(o[t]===e)return!0;return!1}function C7(o){return o.replace(/^[\t ]+/,"")}function S7(o){return o.replace(/[\t ]+$/,"")}function B7(o,e){let t=!1;for(let a=e;a<o.length;a++)if(t)t=!1;else if(o[a]==="\\")t=!0;else if(o[a]==='"')return a;return-1}function yxe(o){let e=[],t=0,a=-1,i=!1,r=!1;for(let m=0;m<o.length;m++)i?r?r=!1:o[m]==="\\"?r=!0:o[m]==='"'&&(i=!1,a=-1):o[m]==='"'?(i=!0,a=m):o[m]===","&&(e.push({value:o.substring(t,m),fromMalformedQuote:!1}),t=m+1);if(!i)return e.push({value:o.substring(t),fromMalformedQuote:!1}),e;let n=o.substring(t),s=a-t,c=0;for(let m=0;m<n.length;m++)n[m]===","&&(e.push({value:n.substring(c,m),fromMalformedQuote:c>s}),c=m+1);return e.push({value:n.substring(c),fromMalformedQuote:c>s}),e}function Q7(o,e){let t=o[T0];t===void 0&&(t=new Set,Object.defineProperty(o,T0,{value:t})),t.add(e)}function kxe(o,e){return o[T0]?.has(e)===!0}function Axe(o){for(let a of j7)if(o.startsWith(a)&&o.length>a.length&&!td(o[a.length]))return a;let e="",t=!1;for(let a=0;a<o.length;a++)td(o[a])?e+=o[a]:t=!0;if(t&&D7(j7,e))return e}function vxe(o){if(!o.origin)throw new Error("opts.origin is undefined");let e=o.path||"/";return o.query&&!pxe(e)&&(e=fxe(e,o.query)),{origin:o.origin.toString(),method:o.method,path:e,headers:o.headers}}function _7(o,e,t){let a=e.toLowerCase(),i=o[a],r=Array.isArray(t)?t:[t];i===void 0?o[a]=Array.isArray(t)?t.slice():t:Array.isArray(i)?i.push(...r):o[a]=[i,...r]}function wxe(o){let e;if(o.headers==null)e={};else if(typeof o.headers=="object")if(e={},hxe(o.headers))for(let t of o.headers){if(!Array.isArray(t))throw new Error("opts.headers is not a valid header map");let[a,i]=t;if(typeof a!="string"||typeof i!="string")throw new Error("opts.headers is not a valid header map");_7(e,a,i)}else for(let t of Object.keys(o.headers))_7(e,t,o.headers[t]);else throw new Error("opts.headers is not an object");return e}function xxe(o){if(typeof o!="object")throw new TypeError(`expected key to be object, got ${typeof o}`);for(let e of["origin","method","path"])if(typeof o[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof o[e]}`);if(o.headers!==void 0&&typeof o.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof o}`)}function zxe(o){if(typeof o!="object")throw new TypeError(`expected value to be object, got ${typeof o}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof o[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof o[e]}`);if(typeof o.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof o.statusMessage}`);if(o.headers!=null&&typeof o.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof o.headers}`);if(o.vary!==void 0&&typeof o.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof o.vary}`);if(o.etag!==void 0&&typeof o.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof o.etag}`)}function qxe(o){let e={},t=new Set,a=new Set,i=yxe(Array.isArray(o)?o.join(","):o);for(let r=0;r<i.length;r++){let n=i[r],s=n.value.toLowerCase(),c=n.fromMalformedQuote,m=s.indexOf("="),l,u,d=!1,g=!1;if(m!==-1){let k=s.substring(0,m),w=s.substring(m+1);d=S7(k)!==k,g=C7(w)!==w,l=$s(k),u=C7(w)}else l=$s(s);let h=Axe(l);if(h!==void 0){e[h]=!0;continue}switch(l){case"min-fresh":case"max-stale":case"max-age":case"s-maxage":case"stale-while-revalidate":case"stale-if-error":{if(c||t.has(l))continue;if(u===void 0||d||g){delete e[l],t.add(l),Q7(e,l);continue}if(u.length>=2&&u[0]==='"'&&u[u.length-1]==='"'&&(u=u.substring(1,u.length-1)),!/^[0-9]+$/.test(u)){delete e[l],t.add(l),Q7(e,l);continue}let k=Math.min(parseInt(u,10),bxe);l==="min-fresh"?(!(l in e)||e[l]<k)&&(e[l]=k):(!(l in e)||e[l]>k)&&(e[l]=k);break}case"private":case"no-cache":{if(c){e[l]=!0;break}if(u!==void 0&&u.length===0){e[l]=!0;break}if(u){if(u[0]==='"'){u=S7(u);let k="",w=r,x=!1,E=B7(u,1);if(E!==-1)k=u.substring(1,E),x=!0;else{let D=[u.substring(1)];for(let H=r+1;H<i.length;H++){let J=$s(i[H].value),X=B7(J,0);if(w=H,X!==-1){D.push(J.substring(0,X)),x=!0;break}D.push(J)}k=D.join(",")}if(!x){e[l]=!0;break}r=w;let q=k.split(","),_=!0;for(let D=0;D<q.length;D++)q[D]=$s(q[D]),td(q[D])||(_=!1);_?e[l]!==!0&&(l in e?e[l]=e[l].concat(q):e[l]=q):e[l]=!0}else{let k=$s(u);td(k)?e[l]!==!0&&(l in e?e[l]=e[l].concat(k):e[l]=[k]):e[l]=!0}break}}case"public":case"must-revalidate":case"proxy-revalidate":case"immutable":case"no-transform":case"must-understand":case"only-if-cached":if(c||a.has(l))continue;if(u!==void 0){delete e[l],a.add(l);continue}e[l]=!0;break;case"no-store":e[l]=!0;break;default:continue}}return e}function T7(o){let e=Array.isArray(o)?o:[o],t=[];for(let a=0;a<e.length;a++){let i=e[a].split(",");for(let r=0;r<i.length;r++)t.push(i[r])}return t}function R0(o){let e=T7(o);for(let t=0;t<e.length;t++)if($s(e[t]).indexOf("*")!==-1)return!0;return!1}function R7(o,e){if(R0(o))return e;let t={},a=T7(o);for(let i of a){let r=$s(i).toLowerCase();if(r.length===0)continue;if(!td(r))return;let n=e[r];t[r]=Array.isArray(n)?n.slice():n??null}return t}function Exe(o){return R0(o)||R7(o,{})===void 0}function Ixe(o){return o.length<=2?!1:o[0]==='"'&&o[o.length-1]==='"'?!(o[1]==='"'||o.startsWith('"W/')):o.startsWith('W/"')&&o[o.length-1]==='"'?o.length!==4:!1}function jxe(o,e="CacheStore"){if(typeof o!="object"||o===null)throw new TypeError(`expected type of ${e} to be a CacheStore, got ${o===null?"null":typeof o}`);for(let t of["get","createWriteStream","delete"])if(typeof o[t]!="function")throw new TypeError(`${e} needs to have a \`${t}()\` function`)}function Cxe(o,e="CacheMethods"){if(!Array.isArray(o))throw new TypeError(`expected type of ${e} needs to be an array, got ${o===null?"null":typeof o}`);if(o.length===0)throw new TypeError(`${e} needs to have at least one method`);for(let t of o)if(!D7(I7,t))throw new TypeError(`element of ${e}-array needs to be one of following values: ${I7.join(", ")}, got ${t}`)}function Sxe(o,e){let t={};if(o.headers){let a=Object.keys(o.headers).sort();for(let i of a)e?.has(i.toLowerCase())||(t[i]=o.headers[i])}return JSON.stringify([o.origin,o.method,o.path,t])}N7.exports={makeCacheKey:vxe,normalizeHeaders:wxe,assertCacheKey:xxe,assertCacheValue:zxe,parseCacheControlHeader:qxe,hasInvalidCacheControlDirective:kxe,parseVaryHeader:R7,hasVaryStar:R0,isInvalidOrWildcardVaryHeader:Exe,isEtagUsable:Ixe,assertCacheMethods:Cxe,assertCacheStore:jxe,makeDeduplicationKey:Sxe}});var O0=f((UBe,O7)=>{"use strict";function Bxe(o){switch(o[3]){case",":return Qxe(o);case" ":return _xe(o);default:return Dxe(o)}}function N0(o,e,t,a,i,r,n){let s=new Date(Date.UTC(o,e,t,a,i,r));return o>=0&&o<=99&&s.setUTCFullYear(o),s.getUTCFullYear()===o&&s.getUTCMonth()===e&&s.getUTCDate()===t&&s.getUTCHours()===a&&s.getUTCMinutes()===i&&s.getUTCSeconds()===r&&s.getUTCDay()===n?s:void 0}function Qxe(o){if(o.length!==29||o[4]!==" "||o[7]!==" "||o[11]!==" "||o[16]!==" "||o[19]!==":"||o[22]!==":"||o[25]!==" "||o[26]!=="G"||o[27]!=="M"||o[28]!=="T")return;let e=-1;if(o[0]==="S"&&o[1]==="u"&&o[2]==="n")e=0;else if(o[0]==="M"&&o[1]==="o"&&o[2]==="n")e=1;else if(o[0]==="T"&&o[1]==="u"&&o[2]==="e")e=2;else if(o[0]==="W"&&o[1]==="e"&&o[2]==="d")e=3;else if(o[0]==="T"&&o[1]==="h"&&o[2]==="u")e=4;else if(o[0]==="F"&&o[1]==="r"&&o[2]==="i")e=5;else if(o[0]==="S"&&o[1]==="a"&&o[2]==="t")e=6;else return;let t=0;if(o[5]==="0"){let d=o.charCodeAt(6);if(d<49||d>57)return;t=d-48}else{let d=o.charCodeAt(5);if(d<49||d>51)return;let g=o.charCodeAt(6);if(g<48||g>57)return;t=(d-48)*10+(g-48)}let a=-1;if(o[8]==="J"&&o[9]==="a"&&o[10]==="n")a=0;else if(o[8]==="F"&&o[9]==="e"&&o[10]==="b")a=1;else if(o[8]==="M"&&o[9]==="a")if(o[10]==="r")a=2;else if(o[10]==="y")a=4;else return;else if(o[8]==="J")if(o[9]==="a"&&o[10]==="n")a=0;else if(o[9]==="u")if(o[10]==="n")a=5;else if(o[10]==="l")a=6;else return;else return;else if(o[8]==="A")if(o[9]==="p"&&o[10]==="r")a=3;else if(o[9]==="u"&&o[10]==="g")a=7;else return;else if(o[8]==="S"&&o[9]==="e"&&o[10]==="p")a=8;else if(o[8]==="O"&&o[9]==="c"&&o[10]==="t")a=9;else if(o[8]==="N"&&o[9]==="o"&&o[10]==="v")a=10;else if(o[8]==="D"&&o[9]==="e"&&o[10]==="c")a=11;else return;let i=o.charCodeAt(12);if(i<48||i>57)return;let r=o.charCodeAt(13);if(r<48||r>57)return;let n=o.charCodeAt(14);if(n<48||n>57)return;let s=o.charCodeAt(15);if(s<48||s>57)return;let c=(i-48)*1e3+(r-48)*100+(n-48)*10+(s-48),m=0;if(o[17]==="0"){let d=o.charCodeAt(18);if(d<48||d>57)return;m=d-48}else{let d=o.charCodeAt(17);if(d<48||d>50)return;let g=o.charCodeAt(18);if(g<48||g>57||d===50&&g>51)return;m=(d-48)*10+(g-48)}let l=0;if(o[20]==="0"){let d=o.charCodeAt(21);if(d<48||d>57)return;l=d-48}else{let d=o.charCodeAt(20);if(d<48||d>53)return;let g=o.charCodeAt(21);if(g<48||g>57)return;l=(d-48)*10+(g-48)}let u=0;if(o[23]==="0"){let d=o.charCodeAt(24);if(d<48||d>57)return;u=d-48}else{let d=o.charCodeAt(23);if(d<48||d>53)return;let g=o.charCodeAt(24);if(g<48||g>57)return;u=(d-48)*10+(g-48)}return N0(c,a,t,m,l,u,e)}function _xe(o){if(o.length!==24||o[7]!==" "||o[10]!==" "||o[19]!==" ")return;let e=-1;if(o[0]==="S"&&o[1]==="u"&&o[2]==="n")e=0;else if(o[0]==="M"&&o[1]==="o"&&o[2]==="n")e=1;else if(o[0]==="T"&&o[1]==="u"&&o[2]==="e")e=2;else if(o[0]==="W"&&o[1]==="e"&&o[2]==="d")e=3;else if(o[0]==="T"&&o[1]==="h"&&o[2]==="u")e=4;else if(o[0]==="F"&&o[1]==="r"&&o[2]==="i")e=5;else if(o[0]==="S"&&o[1]==="a"&&o[2]==="t")e=6;else return;let t=-1;if(o[4]==="J"&&o[5]==="a"&&o[6]==="n")t=0;else if(o[4]==="F"&&o[5]==="e"&&o[6]==="b")t=1;else if(o[4]==="M"&&o[5]==="a")if(o[6]==="r")t=2;else if(o[6]==="y")t=4;else return;else if(o[4]==="J")if(o[5]==="a"&&o[6]==="n")t=0;else if(o[5]==="u")if(o[6]==="n")t=5;else if(o[6]==="l")t=6;else return;else return;else if(o[4]==="A")if(o[5]==="p"&&o[6]==="r")t=3;else if(o[5]==="u"&&o[6]==="g")t=7;else return;else if(o[4]==="S"&&o[5]==="e"&&o[6]==="p")t=8;else if(o[4]==="O"&&o[5]==="c"&&o[6]==="t")t=9;else if(o[4]==="N"&&o[5]==="o"&&o[6]==="v")t=10;else if(o[4]==="D"&&o[5]==="e"&&o[6]==="c")t=11;else return;let a=0;if(o[8]===" "){let d=o.charCodeAt(9);if(d<49||d>57)return;a=d-48}else{let d=o.charCodeAt(8);if(d<49||d>51)return;let g=o.charCodeAt(9);if(g<48||g>57)return;a=(d-48)*10+(g-48)}let i=0;if(o[11]==="0"){let d=o.charCodeAt(12);if(d<48||d>57)return;i=d-48}else{let d=o.charCodeAt(11);if(d<48||d>50)return;let g=o.charCodeAt(12);if(g<48||g>57||d===50&&g>51)return;i=(d-48)*10+(g-48)}let r=0;if(o[14]==="0"){let d=o.charCodeAt(15);if(d<48||d>57)return;r=d-48}else{let d=o.charCodeAt(14);if(d<48||d>53)return;let g=o.charCodeAt(15);if(g<48||g>57)return;r=(d-48)*10+(g-48)}let n=0;if(o[17]==="0"){let d=o.charCodeAt(18);if(d<48||d>57)return;n=d-48}else{let d=o.charCodeAt(17);if(d<48||d>53)return;let g=o.charCodeAt(18);if(g<48||g>57)return;n=(d-48)*10+(g-48)}let s=o.charCodeAt(20);if(s<48||s>57)return;let c=o.charCodeAt(21);if(c<48||c>57)return;let m=o.charCodeAt(22);if(m<48||m>57)return;let l=o.charCodeAt(23);if(l<48||l>57)return;let u=(s-48)*1e3+(c-48)*100+(m-48)*10+(l-48);return N0(u,t,a,i,r,n,e)}function Dxe(o){let e=-1,t=-1;if(o[0]==="S")o[1]==="u"&&o[2]==="n"&&o[3]==="d"&&o[4]==="a"&&o[5]==="y"?(t=0,e=6):o[1]==="a"&&o[2]==="t"&&o[3]==="u"&&o[4]==="r"&&o[5]==="d"&&o[6]==="a"&&o[7]==="y"&&(t=6,e=8);else if(o[0]==="M"&&o[1]==="o"&&o[2]==="n"&&o[3]==="d"&&o[4]==="a"&&o[5]==="y")t=1,e=6;else if(o[0]==="T")o[1]==="u"&&o[2]==="e"&&o[3]==="s"&&o[4]==="d"&&o[5]==="a"&&o[6]==="y"?(t=2,e=7):o[1]==="h"&&o[2]==="u"&&o[3]==="r"&&o[4]==="s"&&o[5]==="d"&&o[6]==="a"&&o[7]==="y"&&(t=4,e=8);else if(o[0]==="W"&&o[1]==="e"&&o[2]==="d"&&o[3]==="n"&&o[4]==="e"&&o[5]==="s"&&o[6]==="d"&&o[7]==="a"&&o[8]==="y")t=3,e=9;else if(o[0]==="F"&&o[1]==="r"&&o[2]==="i"&&o[3]==="d"&&o[4]==="a"&&o[5]==="y")t=5,e=6;else return;if(o[e]!==","||o.length-e-1!==23||o[e+1]!==" "||o[e+4]!=="-"||o[e+8]!=="-"||o[e+11]!==" "||o[e+14]!==":"||o[e+17]!==":"||o[e+20]!==" "||o[e+21]!=="G"||o[e+22]!=="M"||o[e+23]!=="T")return;let a=0;if(o[e+2]==="0"){let u=o.charCodeAt(e+3);if(u<49||u>57)return;a=u-48}else{let u=o.charCodeAt(e+2);if(u<49||u>51)return;let d=o.charCodeAt(e+3);if(d<48||d>57)return;a=(u-48)*10+(d-48)}let i=-1;if(o[e+5]==="J"&&o[e+6]==="a"&&o[e+7]==="n")i=0;else if(o[e+5]==="F"&&o[e+6]==="e"&&o[e+7]==="b")i=1;else if(o[e+5]==="M"&&o[e+6]==="a"&&o[e+7]==="r")i=2;else if(o[e+5]==="A"&&o[e+6]==="p"&&o[e+7]==="r")i=3;else if(o[e+5]==="M"&&o[e+6]==="a"&&o[e+7]==="y")i=4;else if(o[e+5]==="J"&&o[e+6]==="u"&&o[e+7]==="n")i=5;else if(o[e+5]==="J"&&o[e+6]==="u"&&o[e+7]==="l")i=6;else if(o[e+5]==="A"&&o[e+6]==="u"&&o[e+7]==="g")i=7;else if(o[e+5]==="S"&&o[e+6]==="e"&&o[e+7]==="p")i=8;else if(o[e+5]==="O"&&o[e+6]==="c"&&o[e+7]==="t")i=9;else if(o[e+5]==="N"&&o[e+6]==="o"&&o[e+7]==="v")i=10;else if(o[e+5]==="D"&&o[e+6]==="e"&&o[e+7]==="c")i=11;else return;let r=o.charCodeAt(e+9);if(r<48||r>57)return;let n=o.charCodeAt(e+10);if(n<48||n>57)return;let s=(r-48)*10+(n-48);s+=s<70?2e3:1900;let c=0;if(o[e+12]==="0"){let u=o.charCodeAt(e+13);if(u<48||u>57)return;c=u-48}else{let u=o.charCodeAt(e+12);if(u<48||u>50)return;let d=o.charCodeAt(e+13);if(d<48||d>57||u===50&&d>51)return;c=(u-48)*10+(d-48)}let m=0;if(o[e+15]==="0"){let u=o.charCodeAt(e+16);if(u<48||u>57)return;m=u-48}else{let u=o.charCodeAt(e+15);if(u<48||u>53)return;let d=o.charCodeAt(e+16);if(d<48||d>57)return;m=(u-48)*10+(d-48)}let l=0;if(o[e+18]==="0"){let u=o.charCodeAt(e+19);if(u<48||u>57)return;l=u-48}else{let u=o.charCodeAt(e+18);if(u<48||u>53)return;let d=o.charCodeAt(e+19);if(d<48||d>57)return;l=(u-48)*10+(d-48)}return N0(s,i,a,c,m,l,t)}O7.exports={parseHttpDate:Bxe}});var H7=f((MBe,$7)=>{"use strict";var U0=be(),{parseCacheControlHeader:Txe,hasInvalidCacheControlDirective:U7,parseVaryHeader:Rxe,hasVaryStar:Nxe,isInvalidOrWildcardVaryHeader:L7,isEtagUsable:Oxe}=ym(),{parseHttpDate:M0}=O0();function Uxe(){}var P7=[200,203,204,206,300,301,308,404,405,410,414,501],Mxe=[206],ad=2147483647e3;function Lxe(o){return o.replace(/^[\t ]+|[\t ]+$/g,"")}function km(o,e){for(let t=0;t<o.length;t++)if(o[t]===e)return!0;return!1}function Pxe(o,e){let t=Array.isArray(e)?e:[e];for(let a=0;a<t.length;a++){let i=t[a].split(",");for(let r=0;r<i.length;r++)o.push(Lxe(i[r]).toLowerCase())}}function Fxe(o,e){if(typeof e!="string")return;let t,a,i;try{t=new URL(o.origin),a=new URL(o.path,t),i=new URL(e,a)}catch{return}if(i.origin===t.origin)return i.pathname+i.search}function F7(o,e,t){id(o,{...e,path:t});for(let a=0;a<U0.safeHTTPMethods.length;a++){let i=U0.safeHTTPMethods[a];i!==e.method&&id(o,{...e,method:i,path:t})}}function M7(o,e,t){if(t===void 0)return;let a=Array.isArray(t)?t:[t];for(let i=0;i<a.length;i++){let r=Fxe(e,a[i]);r!==void 0&&F7(o,e,r)}}function $xe(o,e,t){F7(o,e,e.path),M7(o,e,t.location),M7(o,e,t["content-location"])}var L0=class{#e;#o;#a;#i;#r;#t;constructor({store:e,type:t,cacheByDefault:a},i,r){this.#i=e,this.#o=t,this.#a=a,this.#e=i,this.#r=r}onRequestStart(e,t){this.#t?.destroy(),this.#t=void 0,this.#r.onRequestStart?.(e,t)}onRequestUpgrade(e,t,a,i){this.#r.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){let r=()=>this.#r.onResponseStart?.(e,t,a,i),n=this;if(!km(U0.safeHTTPMethods,this.#e.method)&&t>=200&&t<=399)return $xe(this.#i,this.#e,a),r();let s=a["cache-control"],c=a["last-modified"]&&km(P7,t);if(!s&&!a.expires&&!c&&!this.#a)return t===304&&a.vary&&L7(a.vary)&&id(this.#i,this.#e),r();let m=s?Txe(s):{};if(!Gxe(this.#o,t,a,m,this.#e.headers))return t===304&&(s||Hxe(this.#o,a,m))&&id(this.#i,this.#e),r();let l=Date.now(),u=Object.hasOwn(a,"age")?Yxe(a.age):void 0;if(u!==void 0&&u>=ad)return Xf(t,this.#i,this.#e),r();let d=Object.hasOwn(a,"date")?Vxe(a.date):void 0;if(d===null)return Xf(t,this.#i,this.#e),r();let g=d?Math.max(0,l-d.getTime()):0,h=Math.max(g,u??0),k=Jxe(this.#o,l,u,a,d,m)??this.#a;if(k===void 0||h>=k)return(s||k!==void 0)&&Xf(t,this.#i,this.#e),r();let w=l-h,x=k+w;if(l>=x)return Xf(t,this.#i,this.#e),r();let E;if(this.#e.headers&&a.vary&&(E=Rxe(a.vary,this.#e.headers),!E))return r();let q=w,_=Wxe(w,l,m,x),D=Zxe(a,m),H={statusCode:t,statusMessage:i,headers:D,vary:E,cacheControlDirectives:m,cachedAt:q,staleAt:x,deleteAt:_};if(t===304){let J=Y=>{if(!Y)return r();if(H.statusCode=Y.statusCode,H.statusMessage=Y.statusMessage,H.etag=Y.etag,H.vary=E??Y.vary,H.headers={...Y.headers,...D},r(),this.#t=this.#i.createWriteStream(this.#e,H),!(!this.#t||!Y?.body))if(typeof Y.body.values=="function"){let ve=Y.body.values(),xe=()=>{for(let He of ve){let Jo=this.#t.write(He)===!1;if(this.#r.onResponseData?.(e,He),Jo)break}};this.#t.on("error",function(){n.#t=void 0,n.#i.delete(n.#e)}).on("drain",()=>{xe()}).on("close",function(){n.#t===this&&(n.#t=void 0)}),xe()}else typeof Y.body.on=="function"&&(Y.body.on("data",ve=>{this.#t.write(ve),this.#r.onResponseData?.(e,ve)}).on("end",()=>{this.#t.end()}).on("error",()=>{this.#t=void 0,this.#i.delete(this.#e)}),this.#t.on("error",function(){n.#t=void 0,n.#i.delete(n.#e)}).on("close",function(){n.#t===this&&(n.#t=void 0)}))},X=this.#i.get(this.#e);X&&typeof X.then=="function"?X.then(J):J(X)}else{if(typeof a.etag=="string"&&Oxe(a.etag)&&(H.etag=a.etag),this.#t=this.#i.createWriteStream(this.#e,H),!this.#t)return r();this.#t.on("drain",()=>e.resume()).on("error",function(){n.#t=void 0,n.#i.delete(n.#e)}).on("close",function(){n.#t===this&&(n.#t=void 0),e.resume()}),r()}}onResponseData(e,t){this.#t?.write(t)===!1&&e.pause(),this.#r.onResponseData?.(e,t)}onResponseEnd(e,t){this.#t?.end(),this.#r.onResponseEnd?.(e,t)}onResponseError(e,t){this.#t?.destroy(t),this.#t=void 0,this.#r.onResponseError?.(e,t)}};function id(o,e){try{o.delete(e)?.catch?.(Uxe)}catch{}}function Xf(o,e,t){o===304&&id(e,t)}function Hxe(o,e,t){return t["no-store"]===!0||o==="shared"&&t.private===!0||(e.vary?L7(e.vary):!1)}function Gxe(o,e,t,a,i){return!(e<200||km(Mxe,e)||!km(P7,e)&&!t.expires&&!a.public&&a["max-age"]===void 0&&!(a.private&&o==="private")&&!(a["s-maxage"]!==void 0&&o==="shared")||a["no-store"]||o==="shared"&&a.private===!0||t.vary&&Nxe(t.vary)||i!=null&&Object.hasOwn(i,"authorization")&&(!a.public&&!a["s-maxage"]&&!a["must-revalidate"]||typeof i.authorization!="string"||Array.isArray(a["no-cache"])&&km(a["no-cache"],"authorization")||Array.isArray(a.private)&&km(a.private,"authorization")))}function Vxe(o){let e=o;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}return typeof e!="string"?null:M0(e)}function Yxe(o){let e=o;if(Array.isArray(e)){if(e.length!==1)return ad;e=e[0]}if(typeof e!="string"||!/^[\t ]*[0-9]+[\t ]*$/.test(e))return ad;let t=BigInt(e.replace(/^[\t ]+|[\t ]+$/g,""));return t>=BigInt(ad/1e3)?ad:Number(t)*1e3}function Jxe(o,e,t,a,i,r){if(o==="shared"){if(U7(r,"s-maxage"))return 0;let s=r["s-maxage"];if(s!==void 0)return s*1e3}if(U7(r,"max-age"))return 0;let n=r["max-age"];if(n!==void 0)return n*1e3;if(Object.hasOwn(a,"expires")){if(typeof a.expires!="string")return 0;let s=M0(a.expires);if(!s||e>=s.getTime())return 0;if(i){if(i>=s)return 0;let c=s.getTime()-i.getTime();return t!==void 0&&t>=c?0:c}return s.getTime()-e}if(typeof a["last-modified"]=="string"){let s=M0(a["last-modified"]);if(s)return s.getTime()>=e?void 0:(e-s.getTime())*.1}if(r.immutable)return 31536e6}function Wxe(o,e,t,a){let i=-1/0,r=-1/0,n=-1/0;if(t["stale-while-revalidate"]&&(i=a+t["stale-while-revalidate"]*1e3),t["stale-if-error"]&&(r=a+t["stale-if-error"]*1e3),t.immutable&&i===-1/0&&r===-1/0&&(n=e+31536e6),i===-1/0&&r===-1/0&&n===-1/0){let s=a-o,c=Math.min(Math.max(e-o,0),1e3);return a+s+c}return Math.max(a,i,r,n)}function Zxe(o,e){let t=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];o.connection&&Pxe(t,o.connection),Array.isArray(e["no-cache"])&&t.push(...e["no-cache"]),Array.isArray(e.private)&&t.push(...e.private);let a;for(let i of t)Object.hasOwn(o,i)&&(a??={...o},delete a[i]);return a??o}$7.exports=L0});var F0=f((LBe,Y7)=>{"use strict";var{Writable:Kxe}=require("stream"),{EventEmitter:Xxe}=require("events"),{assertCacheKey:G7,assertCacheValue:eze}=ym(),P0=class extends Xxe{#e=1024;#o=104857600;#a=5242880;#i=0;#r=0;#t=new Map;#c=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#o=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#a=e.maxEntrySize}}}get size(){return this.#i}isFull(){return this.#i>=this.#o||this.#r>=this.#e}get(e){G7(e);let t=`${e.origin}:${e.path}`,a=Date.now(),i=this.#t.get(t),r=i?V7(e,i,a):null;return r==null?void 0:{statusMessage:r.statusMessage,statusCode:r.statusCode,headers:r.headers,body:r.body,vary:r.vary?r.vary:void 0,etag:r.etag,cacheControlDirectives:r.cacheControlDirectives,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}}createWriteStream(e,t){G7(e),eze(t);let a=`${e.origin}:${e.path}`,i=this,r={...e,...t,body:[],size:0};return new Kxe({write(n,s,c){typeof n=="string"&&(n=Buffer.from(n,s)),r.size+=n.byteLength,r.size>=i.#a?this.destroy():r.body.push(n),c(null)},final(n){let s=i.#t.get(a);s||(s=[],i.#t.set(a,s));let c=V7(e,s,Date.now());if(c){let m=s.indexOf(c);s.splice(m,1,r),i.#i-=c.size}else s.push(r),i.#r+=1;if(i.#i+=r.size,i.#i>i.#o||i.#r>i.#e){i.#c||(i.emit("maxSizeExceeded",{size:i.#i,maxSize:i.#o,count:i.#r,maxCount:i.#e}),i.#c=!0);for(let[m,l]of i.#t){for(let u of l.splice(0,l.length/2))i.#i-=u.size,i.#r-=1;l.length===0&&i.#t.delete(m)}i.#i<i.#o&&i.#r<i.#e&&(i.#c=!1)}n(null)}})}delete(e){if(typeof e!="object")throw new TypeError(`expected key to be object, got ${typeof e}`);let t=`${e.origin}:${e.path}`;for(let a of this.#t.get(t)??[])this.#i-=a.size,this.#r-=1;this.#t.delete(t)}};function V7(o,e,t){for(let a=0;a<e.length;a++){let i=e[a];if(i.deleteAt>t&&i.method===o.method&&oze(o,i))return i}}function oze(o,e){if(e.vary==null)return!0;for(let t in e.vary)if(Object.hasOwn(e.vary,t)&&!tze(o.headers?.[t],e.vary[t]))return!1;return!0}function tze(o,e){if(o==null&&e==null)return!0;if(o==null&&e!=null||o!=null&&e==null)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}return o===e}Y7.exports=P0});var W7=f((PBe,J7)=>{"use strict";var aze=require("assert"),$0=class{#e=!1;#o;#a;#i;#r;constructor(e,t,a){if(typeof e!="function")throw new TypeError("callback must be a function");this.#o=e,this.#a=t,this.#r=a}onRequestStart(e,t){this.#e=!1,this.#i=t}onRequestUpgrade(e,t,a,i){this.#a.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){if(aze(this.#o!=null),this.#e=t===304||this.#r&&t>=500&&t<=504,this.#o(this.#e,this.#i,t,a),this.#o=null,this.#e)return!0;this.#a.onRequestStart?.(e,this.#i),this.#a.onResponseStart?.(e,t,a,i)}onResponseData(e,t){if(!this.#e)return this.#a.onResponseData?.(e,t)}onResponseEnd(e,t){this.#e||this.#a.onResponseEnd?.(e,t)}onResponseError(e,t){if(!this.#e)if(this.#o&&(this.#o(!1),this.#o=null),typeof this.#a.onResponseError=="function")this.#a.onResponseError(e,t);else throw t}};J7.exports=$0});var iT=f((FBe,aT)=>{"use strict";var Z7=require("assert"),{Readable:ize}=require("stream"),Dn=be(),Am=H7(),rze=F0(),nze=W7(),{assertCacheStore:sze,assertCacheMethods:cze,makeCacheKey:mze,normalizeHeaders:lze,parseCacheControlHeader:tT,isInvalidOrWildcardVaryHeader:uze}=ym(),{AbortError:dze}=ge(),{parseHttpDate:gze}=O0();function pze(o,e){if(o!==void 0){if(!Array.isArray(o))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof o}`);for(let t=0;t<o.length;t++){let a=o[t];if(typeof a!="string"&&!(a instanceof RegExp))throw new TypeError(`expected ${e}[${t}] to be a string or RegExp, got ${typeof a}`)}}}var rd=()=>{};function hze(o){return o.replace(/^[\t ]+|[\t ]+$/g,"")}function K7(o,e){for(let t=0;t<o.length;t++)if(o[t]===e)return!0;return!1}function fze(o){let e=o?.pragma;if(!e)return!1;let t=Array.isArray(e)?e:[e];for(let a=0;a<t.length;a++){let i=t[a];if(typeof i!="string")continue;let r=i.split(",");for(let n=0;n<r.length;n++)if(hze(r[n]).toLowerCase()==="no-cache")return!0}return!1}function bze(o,e,{headers:t={}}){return!!(e?.["no-cache"]||o.cacheControlDirectives?.["no-cache"]&&!Array.isArray(o.cacheControlDirectives["no-cache"])||t["if-modified-since"]||t["if-none-match"])}function G0(o,e){return o.cacheControlDirectives?.["must-revalidate"]===!0||e==="shared"&&(o.cacheControlDirectives?.["proxy-revalidate"]===!0||o.cacheControlDirectives?.["s-maxage"]!==void 0)}function yze(o,e){if(e.vary&&uze(e.vary))return!0;let t=e["cache-control"];if(!t)return!1;let a=tT(t);return a["no-store"]===!0||o==="shared"&&a.private===!0}function kze(o){return o["cache-control"]!==void 0}function X7(o,e){try{o.delete(e)?.catch?.(rd)}catch{}}function Aze(o){let e=o?.["last-modified"];if(typeof e=="string"&&gze(e))return e}function eT(o,e){let t={...o.headers,"if-modified-since":Aze(e.headers)??new Date(e.cachedAt).toUTCString()};if(e.etag&&(t["if-none-match"]=e.etag),e.vary)for(let a in e.vary)e.vary[a]!=null&&(t[a]=e.vary[a]);return t}function vze(o,e,t){let a=Date.now();if(a>o.staleAt){if(!G0(o,t)&&e?.["max-stale"]){let i=o.staleAt+e["max-stale"]*1e3;return a>i}return!0}if(e?.["min-fresh"]){let i=o.staleAt-a,r=e["min-fresh"]*1e3;return i<=r}return!1}function wze(o,e){let t=o.cacheControlDirectives?.["stale-while-revalidate"];if(!t||G0(o,e))return!1;let a=Date.now(),i=o.staleAt+t*1e3;return a<=i}function xze(o,e,t,a,i,r){if(r?.["only-if-cached"]){let n=!1;try{if(typeof a.onConnect=="function"&&(a.onConnect(()=>{n=!0}),n)||typeof a.onHeaders=="function"&&(a.onHeaders(504,[],rd,"Gateway Timeout"),n))return;typeof a.onComplete=="function"&&a.onComplete([])}catch(s){typeof a.onError=="function"&&a.onError(s)}return!0}return o(i,new Am(e,t,a))}function H0(o,e,t,a,i,r){let n=Dn.isStream(t.body)?t.body:ize.from(t.body??[]);Z7(!n.destroyed,"stream should not be destroyed"),Z7(!n.readableDidRead,"stream should not be readableDidRead");let s={resume(){n.resume()},pause(){n.pause()},get paused(){return n.isPaused()},get aborted(){return n.destroyed},get reason(){return n.errored},abort(m){n.destroy(m??new dze)}};if(n.on("error",function(m){if(!this.readableEnded)if(typeof o.onResponseError=="function")o.onResponseError(s,m);else throw m}).on("close",function(){this.errored||o.onResponseEnd?.(s,{})}),o.onRequestStart?.(s,i),n.destroyed)return;let c={...t.headers,age:String(a)};r&&(c.warning='110 - "response is stale"'),o.onResponseStart?.(s,t.statusCode,c,t.statusMessage),e.method==="HEAD"?n.destroy():n.on("data",function(m){o.onResponseData?.(s,m)})}function oT(o,e,t,a,i,r,n){if(!n)return xze(o,e,t,a,i,r);let s=Date.now();if(s>n.deleteAt)return o(i,new Am(e,t,a));let c=Math.round((s-n.cachedAt)/1e3),m=r?.["max-age"]!==void 0&&c>=r["max-age"],l=m||vze(n,r,e.type),u=m||bze(n,r,i);if(l||u){if(Dn.isStream(i.body)&&Dn.bodyLength(i.body)!==0)return o(i,new Am(e,t,a));if(!u&&wze(n,e.type))return H0(a,i,n,c,null,!0),queueMicrotask(()=>{let h=eT(i,n);o({...i,headers:h},new Am(e,t,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let d=!1;if(!G0(n,e.type)){let h=n.cacheControlDirectives["stale-if-error"]??r?.["stale-if-error"];h&&(d=s<n.staleAt+h*1e3)}let g=eT(i,n);return o({...i,headers:g},new nze((h,k,w,x)=>{if(h){if(w===304){if(yze(e.type,x))return Dn.isStream(n.body)&&n.body.on("error",rd).destroy(),X7(e.store,t),o(i,new Am(e,t,a));kze(x)&&X7(e.store,t)}H0(a,i,n,c,k,l)}else Dn.isStream(n.body)&&n.body.on("error",rd).destroy()},new Am(e,t,a),d))}Dn.isStream(i.body)&&i.body.on("error",rd).destroy(),H0(a,i,n,c,null,!1)}aT.exports=(o={})=>{let{store:e=new rze,methods:t=["GET"],cacheByDefault:a=void 0,type:i="shared",origins:r=void 0}=o;if(typeof o!="object"||o===null)throw new TypeError(`expected type of opts to be an Object, got ${o===null?"null":typeof o}`);if(sze(e,"opts.store"),cze(t,"opts.methods"),pze(r,"opts.origins"),typeof a<"u"&&typeof a!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof a}`);if(typeof i<"u"&&i!=="shared"&&i!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`);let n={store:e,methods:t,cacheByDefault:a,type:i},s=[];for(let c=0;c<Dn.safeHTTPMethods.length;c++){let m=Dn.safeHTTPMethods[c];K7(t,m)||s.push(m)}return c=>(m,l)=>{if(!m.origin||K7(s,m.method))return c(m,l);if(r!==void 0){let h=m.origin.toString().toLowerCase(),k=!1;for(let w=0;w<r.length;w++){let x=r[w];if(typeof x=="string"){if(x.toLowerCase()===h){k=!0;break}}else if(x.test(h)){k=!0;break}}if(!k)return c(m,l)}m={...m,headers:lze(m)};let u=m.headers?.["cache-control"]?tT(m.headers["cache-control"]):fze(m.headers)?{"no-cache":!0}:void 0;if(u?.["no-store"])return c(m,l);let d=mze(m),g=e.get(d);return g&&typeof g.then=="function"?g.then(h=>oT(c,n,d,l,m,u,h)):oT(c,n,d,l,m,u,g)}}});var mT=f(($Be,cT)=>{"use strict";var{createInflate:V0,createGunzip:rT,createBrotliDecompress:zze,createZstdDecompress:qze}=require("zlib"),{pipeline:Eze}=require("stream"),Ize=bm(),{runtimeFeatures:jze}=Ir(),nT={gzip:rT,"x-gzip":rT,br:zze,deflate:V0,compress:V0,"x-compress":V0,...jze.has("zstd")?{zstd:qze}:{}},Cze=[204,304],sT=!1,Y0=class extends Ize{#e=[];#o;#a;constructor(e,{skipStatusCodes:t=Cze,skipErrorResponses:a=!0}={}){super(e),this.#o=t,this.#a=a}#i(e,t){return!!(!e||t<200||this.#o.includes(t)||this.#a&&t>=400)}#r(e){let t=e.split(","),a=5;if(t.length>a)throw new Error(`too many content-encodings in response: ${t.length}, maximum allowed is ${a}`);let i=[];for(let r=t.length-1;r>=0;r--){let n=t[r].trim();if(n){if(!nT[n])return i.length=0,i;i.push(nT[n]())}}return i}#t(e,t){e.on("readable",()=>{let a;for(;(a=e.read())!==null&&super.onResponseData(t,a)!==!1;);}),e.on("error",a=>{super.onResponseError(t,a)})}#c(e){let t=this.#e[0];this.#t(t,e),t.on("end",()=>{super.onResponseEnd(e,{})})}#n(e){let t=this.#e[this.#e.length-1];this.#t(t,e),Eze(this.#e,a=>{if(a){super.onResponseError(e,a);return}super.onResponseEnd(e,{})})}#s(){this.#e.length=0}onResponseStart(e,t,a,i){let r=a["content-encoding"];if(this.#i(r,t))return super.onResponseStart(e,t,a,i);let n=this.#r(r.toLowerCase());if(n.length===0)return this.#s(),super.onResponseStart(e,t,a,i);this.#e=n;let{"content-encoding":s,"content-length":c,...m}=a;return this.#e.length===1?this.#c(e):this.#n(e),super.onResponseStart(e,t,m,i)}onResponseData(e,t){if(this.#e.length>0){this.#e[0].write(t);return}super.onResponseData(e,t)}onResponseEnd(e,t){if(this.#e.length>0){this.#e[0].end(),this.#s();return}super.onResponseEnd(e,t)}onResponseError(e,t){if(this.#e.length>0){for(let a of this.#e)a.destroy(t);this.#s()}super.onResponseError(e,t)}};function Sze(o={}){return sT||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),sT=!0),e=>(t,a)=>{let i=new Y0(a,o);return e(t,i)}}cT.exports=Sze});var dT=f((HBe,uT)=>{"use strict";var{RequestAbortedError:Bze}=ge(),lT=5*1024*1024,J0=class{#e;#o=[];#a=lT;#i=0;#r={};#t="";#c=!1;#n=!1;#s=!1;#m=!1;#u=null;#l=null;constructor(e,t,a=lT){this.#e=e,this.#l=t,this.#a=a}addWaitingHandler(e){if(this.#m||this.#s)return!1;let t=this.#d(e),a=t.controller;try{if(e.onRequestStart?.(a,null),a.aborted)return t.done=!0,!0;this.#n&&e.onResponseStart?.(a,this.#i,this.#r,this.#t)}catch{return t.done=!0,!0}return a.aborted||this.#o.push(t),!0}onRequestStart(e,t){this.#u=e,this.#e.onRequestStart?.(e,t)}onRequestUpgrade(e,t,a,i){this.#e.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){this.#n=!0,this.#i=t,this.#r=a,this.#t=i,this.#e.onResponseStart?.(e,t,a,i);for(let r of this.#o){let{handler:n,controller:s}=r;if(r.done||s.aborted){r.done=!0;continue}try{n.onResponseStart?.(s,t,a,i)}catch{}s.aborted&&(r.done=!0)}this.#h()}onResponseData(e,t){if(!(this.#c||this.#m)){this.#s=!0,this.#e.onResponseData?.(e,t);for(let a of this.#o){let{handler:i,controller:r}=a;if(a.done||r.aborted){a.done=!0;continue}if(r.paused){this.#p(a,t);continue}try{i.onResponseData?.(r,t)}catch{}r.aborted&&(a.done=!0,a.bufferedChunks=[],a.bufferedBytes=0)}this.#h()}}onResponseEnd(e,t){if(!(this.#c||this.#m)){this.#m=!0,this.#e.onResponseEnd?.(e,t);for(let a of this.#o){if(a.done||a.controller.aborted){a.done=!0;continue}if(this.#g(a),a.done||a.controller.aborted){a.done=!0;continue}if(a.controller.paused&&a.bufferedChunks.length>0){a.pendingTrailers=t;continue}try{a.handler.onResponseEnd?.(a.controller,t)}catch{}a.done=!0}this.#h(),this.#l?.()}}onResponseError(e,t){if(!this.#m){this.#c=!0,this.#m=!0,this.#e.onResponseError?.(e,t);for(let a of this.#o)this.#b(a,t);this.#o=[],this.#l?.()}}#d(e){let t={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},a={aborted:!1,paused:!1,reason:null};return t.controller={resume:()=>{if(!a.aborted){if(a.paused=!1,this.#g(t),this.#m&&t.pendingTrailers&&t.bufferedChunks.length===0&&!a.paused&&!a.aborted){try{t.handler.onResponseEnd?.(t.controller,t.pendingTrailers)}catch{}t.pendingTrailers=null,t.done=!0}this.#h()}},pause:()=>{a.aborted||(a.paused=!0)},get paused(){return a.paused},get aborted(){return a.aborted},get reason(){return a.reason},abort:i=>{a.aborted=!0,a.reason=i??null,t.done=!0,t.pendingTrailers=null,t.bufferedChunks=[],t.bufferedBytes=0}},t}#p(e,t){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let a=Buffer.from(t);if(e.bufferedChunks.push(a),e.bufferedBytes+=a.length,e.bufferedBytes>this.#a){let i=new Bze(`Deduplicated waiting handler exceeded maxBufferSize (${this.#a} bytes) while paused`);this.#b(e,i)}}#g(e){let{handler:t,controller:a}=e;for(;!e.done&&!a.aborted&&!a.paused&&e.bufferedChunks.length>0;){let i=e.bufferedChunks.shift();e.bufferedBytes-=i.length;try{t.onResponseData?.(a,i)}catch{}if(a.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#b(e,t){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(t),e.handler.onResponseError?.(e.controller,t)}catch{}}}#h(){this.#o=this.#o.filter(e=>e.done===!1)}};uT.exports=J0});var pT=f((GBe,gT)=>{"use strict";var Qze=require("diagnostics_channel"),_ze=be(),Dze=dT(),{normalizeHeaders:Tze,makeCacheKey:Rze,makeDeduplicationKey:Nze}=ym(),eb=Qze.channel("undici:request:pending-requests");gT.exports=(o={})=>{let{methods:e=["GET"],skipHeaderNames:t=[],excludeHeaderNames:a=[],maxBufferSize:i=5*1024*1024}=o;if(typeof o!="object"||o===null)throw new TypeError(`expected type of opts to be an Object, got ${o===null?"null":typeof o}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let c of e)if(!_ze.safeHTTPMethods.includes(c))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${c}`);if(!Array.isArray(t))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof t}`);if(!Array.isArray(a))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof a}`);if(!Number.isFinite(i)||i<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${i}`);let r=new Set(t.map(c=>c.toLowerCase())),n=new Set(a.map(c=>c.toLowerCase())),s=new Map;return c=>(m,l)=>{if(!m.origin||e.includes(m.method)===!1)return c(m,l);if(m={...m,headers:Tze(m)},r.size>0){for(let k of Object.keys(m.headers))if(r.has(k.toLowerCase()))return c(m,l)}let u=Rze(m),d=Nze(u,n),g=s.get(d);if(g)return g.addWaitingHandler(l)?!0:c(m,l);let h=new Dze(l,()=>{s.delete(d),eb.hasSubscribers&&eb.publish({size:s.size,key:d,type:"removed"})},i);return s.set(d,h),eb.hasSubscribers&&eb.publish({size:s.size,key:d,type:"added"}),c(m,h)}}});var bT=f((YBe,fT)=>{"use strict";var{Writable:Oze}=require("stream"),{assertCacheKey:W0,assertCacheValue:Uze}=ym(),Z0,Ot=3,hT=2*1e3*1e3*1e3;fT.exports=class{#e=hT;#o=1/0;#a;#i;#r;#t;#c;#n;#s;#m;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>hT)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#o=e.maxCount}}Z0||(Z0=require("sqlite").DatabaseSync),this.#a=new Z0(e?.location??":memory:"),this.#a.exec(`
|
|
1581
|
+
${e.format(t)}`.trim())}};FD.exports=k0});var v0=f((EBe,VD)=>{"use strict";var{InvalidArgumentError:wwe}=ge(),{runtimeFeatures:xwe}=Ir();function zwe(o={}){let{ignoreHeaders:e=[],excludeHeaders:t=[],matchHeaders:a=[],caseSensitive:i=!1}=o;return{ignore:new Set(e.map(r=>i?r:r.toLowerCase())),exclude:new Set(t.map(r=>i?r:r.toLowerCase())),match:new Set(a.map(r=>i?r:r.toLowerCase()))}}var $D=xwe.has("crypto")?require("crypto"):null,qwe=$D?.hash?o=>$D.hash("sha256",o,"base64url"):o=>Buffer.from(o).toString("base64url");function GD(o){return Array.isArray(o)&&(o.length&1)===0}function Ewe(o=[]){return o.length===0?()=>!1:function(t){let a;for(let i of o)if(typeof i=="string"){if(a||(a=t.toLowerCase()),a.includes(i.toLowerCase()))return!0}else if(i instanceof RegExp&&i.test(t))return!0;return!1}}function Iwe(o){let e={};if(!o)return e;if(GD(o)){for(let t=0;t<o.length;t+=2){let a=o[t],i=o[t+1];if(a&&i!==void 0){let r=Buffer.isBuffer(a)?a.toString():a,n=Buffer.isBuffer(i)?i.toString():i;e[r.toLowerCase()]=n}}return e}if(o&&typeof o=="object")for(let[t,a]of Object.entries(o))t&&typeof t=="string"&&(e[t.toLowerCase()]=Array.isArray(a)?a.join(", "):String(a));return e}var HD=["record","playback","update"];function jwe(o){if(!HD.includes(o))throw new wwe(`Invalid snapshot mode: ${o}. Must be one of: ${HD.join(", ")}`)}VD.exports={createHeaderFilters:zwe,hashId:qwe,isUndiciHeaders:GD,normalizeHeaders:Iwe,isUrlExcludedFactory:Ewe,validateSnapshotMode:jwe}});var tT=f((IBe,oT)=>{"use strict";var{writeFile:Cwe,readFile:Swe,mkdir:Bwe}=require("fs/promises"),{dirname:Qwe,resolve:YD}=require("path"),{setTimeout:_we,clearTimeout:JD}=require("timers"),{InvalidArgumentError:WD,UndiciError:Dwe}=ge(),{hashId:Twe,isUrlExcludedFactory:Rwe,normalizeHeaders:ZD,createHeaderFilters:KD}=v0();function Ku(o,e,t={}){let a=new URL(o.path,o.origin),i=o._normalizedHeaders||ZD(o.headers);return o._normalizedHeaders||(o._normalizedHeaders=i),{method:o.method||"GET",url:t.matchQuery!==!1?a.toString():`${a.origin}${a.pathname}`,headers:XD(i,e,t),body:t.matchBody!==!1&&o.body?String(o.body):""}}function XD(o,e,t={}){if(!o||typeof o!="object")return{};let{caseSensitive:a=!1}=t,i={},{ignore:r,exclude:n,match:s}=e;for(let[c,m]of Object.entries(o)){let l=a?c:c.toLowerCase();n.has(l)||r.has(l)||s.size!==0&&!s.has(l)||(i[l]=m)}return i}function eT(o,e,t={}){if(!o||typeof o!="object")return{};let{caseSensitive:a=!1}=t,i={},{exclude:r}=e;for(let[n,s]of Object.entries(o)){let c=a?n:n.toLowerCase();r.has(c)||(i[c]=s)}return i}function Xu(o){let e=[o.method,o.url];if(o.headers&&typeof o.headers=="object"){let a=Object.keys(o.headers).sort();for(let i of a){let r=Array.isArray(o.headers[i])?o.headers[i]:[o.headers[i]];e.push(i);for(let n of r.sort())e.push(String(n))}}e.push(o.body);let t=e.join("|");return Twe(t)}var w0=class{#e;#o;#a=new Map;#i;#r=1/0;#t=!1;#c;constructor(e={}){this.#i=e.snapshotPath,this.#r=e.maxSnapshots||1/0,this.#t=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#c=KD(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#o=Rwe(e.excludeUrls),this.#t&&this.#i&&this.#n()}async record(e,t){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let a=Ku(e,this.#c,this.matchOptions),i=Xu(a),r=ZD(t.headers),n={statusCode:t.statusCode,headers:eT(r,this.#c,this.matchOptions),body:Buffer.isBuffer(t.body)?t.body.toString("base64"):Buffer.from(String(t.body||"")).toString("base64"),trailers:t.trailers};if(this.#a.size>=this.#r&&!this.#a.has(i)){let c=this.#a.keys().next().value;this.#a.delete(c)}let s=this.#a.get(i);s&&s.responses?(s.responses.push(n),s.timestamp=new Date().toISOString()):this.#a.set(i,{request:a,responses:[n],callCount:0,timestamp:new Date().toISOString()}),this.#t&&this.#i&&this.#m()}isUrlExcluded(e){let t=new URL(e.path,e.origin).toString();return this.#o(t)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let t=Ku(e,this.#c,this.matchOptions),a=Xu(t),i=this.#a.get(a);if(!i)return;let r=i.callCount||0,n=Math.min(r,i.responses.length-1);return i.callCount=r+1,{...i,response:i.responses[n]}}async loadSnapshots(e){let t=e||this.#i;if(!t)throw new WD("Snapshot path is required");try{let a=await Swe(YD(t),"utf8"),i=JSON.parse(a);if(Array.isArray(i)){this.#a.clear();for(let{hash:r,snapshot:n}of i)this.#a.set(r,n)}else this.#a=new Map(Object.entries(i))}catch(a){if(a.code==="ENOENT")this.#a.clear();else throw new Dwe(`Failed to load snapshots from ${t}`,{cause:a})}}async saveSnapshots(e){let t=e||this.#i;if(!t)throw new WD("Snapshot path is required");let a=YD(t);await Bwe(Qwe(a),{recursive:!0});let i=Array.from(this.#a.entries()).map(([r,n])=>({hash:r,snapshot:n}));await Cwe(a,JSON.stringify(i,null,2),{flush:!0})}clear(){this.#a.clear()}getSnapshots(){return Array.from(this.#a.values())}size(){return this.#a.size}resetCallCounts(){for(let e of this.#a.values())e.callCount=0}deleteSnapshot(e){let t=Ku(e,this.#c,this.matchOptions),a=Xu(t);return this.#a.delete(a)}getSnapshotInfo(e){let t=Ku(e,this.#c,this.matchOptions),a=Xu(t),i=this.#a.get(a);return i?{hash:a,request:i.request,responseCount:i.responses?i.responses.length:i.response?1:0,callCount:i.callCount||0,timestamp:i.timestamp}:null}replaceSnapshots(e){if(this.#a.clear(),Array.isArray(e))for(let{hash:t,snapshot:a}of e)this.#a.set(t,a);else e&&typeof e=="object"&&(this.#a=new Map(Object.entries(e)))}#n(){return this.#m()}#s(){this.#e&&(JD(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#m(){this.#e=_we(()=>{this.saveSnapshots().catch(()=>{}),this.#t?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#s(),this.#e&&(JD(this.#e),this.#e=null)}async close(){this.#i&&this.#a.size!==0&&await this.saveSnapshots(),this.destroy()}};oT.exports={SnapshotRecorder:w0,formatRequestKey:Ku,createRequestHash:Xu,filterHeadersForMatching:XD,filterHeadersForStorage:eT,createHeaderFilters:KD}});var rT=f((jBe,iT)=>{"use strict";var Nwe=Qs(),Owe=A0(),{SnapshotRecorder:Uwe}=tT(),Mwe=fu(),{InvalidArgumentError:Lwe,UndiciError:Pwe}=ge(),{validateSnapshotMode:Fwe}=v0(),pt=Symbol("kSnapshotRecorder"),er=Symbol("kSnapshotMode"),ed=Symbol("kSnapshotPath"),x0=Symbol("kSnapshotLoaded"),Wf=Symbol("kRealAgent"),aT=!1,z0=class extends Owe{constructor(e={}){aT||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),aT=!0);let{mode:t="record",snapshotPath:a=null,...i}=e;if(super(i),Fwe(t),(t==="playback"||t==="update")&&!a)throw new Lwe(`snapshotPath is required when mode is '${t}'`);this[er]=t,this[ed]=a,this[pt]=new Uwe({snapshotPath:this[ed],mode:this[er],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[x0]=!1,(this[er]==="record"||this[er]==="update"||this[er]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Wf]=new Nwe(e)),(this[er]==="playback"||this[er]==="update")&&this[ed]&&this.loadSnapshots().catch(()=>{})}dispatch(e,t){t=Mwe.wrap(t);let a=this[er];if(this[pt].isUrlExcluded(e))return this[Wf].dispatch(e,t);if(a==="playback"||a==="update"){if(!this[x0])return this.#e(e,t);let i=this[pt].findSnapshot(e);if(i)return this.#a(i,t);if(a==="update")return this.#o(e,t);{let r=new Pwe(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(t.onError){t.onError(r);return}throw r}}else if(a==="record")return this.#o(e,t)}async#e(e,t){return await this.loadSnapshots(),this.dispatch(e,t)}#o(e,t){let a={statusCode:null,headers:{},trailers:{},body:[]},i=this,r={onRequestStart(s,c){return t.onRequestStart(s,{...c,history:this.history})},onRequestUpgrade(s,c,m,l){return t.onRequestUpgrade(s,c,m,l)},onResponseStart(s,c,m,l){return a.statusCode=c,a.headers=m,t.onResponseStart(s,c,m,l)},onResponseData(s,c){return a.body.push(c),t.onResponseData(s,c)},onResponseEnd(s,c){a.trailers=c;let m=Buffer.concat(a.body);i[pt].record(e,{statusCode:a.statusCode,headers:a.headers,body:m,trailers:a.trailers}).then(()=>t.onResponseEnd(s,c)).catch(l=>t.onResponseError(s,l))}};return this[Wf].dispatch(e,r)}#a(e,t){try{let{response:a}=e,i={pause(){},resume(){},abort(n){this.aborted=!0,this.reason=n},aborted:!1,paused:!1};t.onRequestStart(i),t.onResponseStart(i,a.statusCode,a.headers);let r=Buffer.from(a.body,"base64");t.onResponseData(i,r),t.onResponseEnd(i,a.trailers)}catch(a){t.onError?.(a)}}async loadSnapshots(e){await this[pt].loadSnapshots(e||this[ed]),this[x0]=!0,this[er]==="playback"&&this.#i()}async saveSnapshots(e){return this[pt].saveSnapshots(e||this[ed])}#i(){for(let e of this[pt].getSnapshots()){let{request:t,responses:a,response:i}=e,r=new URL(t.url),n=this.get(r.origin),s=a?a[0]:i;s&&n.intercept({path:r.pathname+r.search,method:t.method,headers:t.headers,body:t.body}).reply(s.statusCode,s.body,{headers:s.headers,trailers:s.trailers}).persist()}}getRecorder(){return this[pt]}getMode(){return this[er]}clearSnapshots(){this[pt].clear()}resetCallCounts(){this[pt].resetCallCounts()}deleteSnapshot(e){return this[pt].deleteSnapshot(e)}getSnapshotInfo(e){return this[pt].getSnapshotInfo(e)}replaceSnapshots(e){this[pt].replaceSnapshots(e)}async close(){await this[pt].close(),await this[Wf]?.close(),await super.close()}};iT.exports=z0});var Zf=f((CBe,mT)=>{"use strict";var $we=Symbol.for("undici.globalDispatcher.2"),nT=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Hwe}=ge(),Gwe=Qs();cT()===void 0&&sT(new Gwe);function sT(o){if(!o||typeof o.dispatch!="function")throw new Hwe("Argument agent must implement Agent");Object.defineProperty(globalThis,$we,{value:o,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,nT,{value:o,writable:!0,enumerable:!1,configurable:!1})}function cT(){return globalThis[nT]}var Vwe=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];mT.exports={setGlobalDispatcher:sT,getGlobalDispatcher:cT,installedExports:Vwe}});var bm=f((BBe,lT)=>{"use strict";var Nr=require("assert"),Ywe=fu();lT.exports=class{#e;#o=!1;#a=!1;#i=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=Ywe.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return Nr(!this.#o),Nr(!this.#a),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return Nr(!this.#o),Nr(!this.#a),Nr(!this.#i),this.#i=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return Nr(!this.#o),Nr(!this.#a),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return Nr(!this.#o),Nr(!this.#a),this.#o=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#a=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var j0=f((QBe,pT)=>{"use strict";var ht=be(),{kBodyUsed:od}=Ue(),I0=require("assert"),{InvalidArgumentError:q0}=ge(),Jwe=require("events"),Wwe=[300,301,302,303,307,308],uT=Symbol("body"),dT=()=>{},Kf=class{constructor(e){this[uT]=e,this[od]=!1}async*[Symbol.asyncIterator](){I0(!this[od],"disturbed"),this[od]=!0,yield*this[uT]}},E0=class o{static buildDispatch(e,t){if(t!=null&&(!Number.isInteger(t)||t<0))throw new q0("maxRedirections must be a positive number");let a=e.dispatch.bind(e);return(i,r)=>a(i,new o(a,t,i,r))}constructor(e,t,a,i){if(t!=null&&(!Number.isInteger(t)||t<0))throw new q0("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:r,...n}=a;this.opts=n,this.maxRedirections=t,this.handler=i,this.history=[],ht.isStream(this.opts.body)?(ht.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){I0(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[od]=!1,Jwe.prototype.on.call(this.opts.body,"data",function(){this[od]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Kf(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&ht.isIterable(this.opts.body)&&!ht.isFormDataLike(this.opts.body)&&(this.opts.body=new Kf(this.opts.body))}onRequestStart(e,t){this.handler.onRequestStart?.(e,{...t,history:this.history})}onRequestUpgrade(e,t,a,i){this.handler.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((t===301||t===302)&&this.opts.method==="POST"&&(this.opts.method="GET",ht.isStream(this.opts.body)&&ht.destroy(this.opts.body.on("error",dT)),this.opts.body=null),t===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",ht.isStream(this.opts.body)&&ht.destroy(this.opts.body.on("error",dT)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||ht.isDisturbed(this.opts.body)||Wwe.indexOf(t)===-1?null:a.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,t,a,i);return}let{origin:r,pathname:n,search:s}=ht.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),c=s?`${n}${s}`:n,m=`${r}${c}`;for(let l of this.history)if(l.toString()===m)throw new q0(`Redirect loop detected. Cannot redirect to ${r}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=Zwe(this.opts.headers,t===303,this.opts.origin!==r),this.opts.path=c,this.opts.origin=r,this.opts.query=null}onResponseData(e,t){this.location||this.handler.onResponseData?.(e,t)}onResponseEnd(e,t){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,t)}onResponseError(e,t){this.handler.onResponseError?.(e,t)}};function gT(o,e,t){if(o.length===4)return ht.headerNameToString(o)==="host";if(e&&ht.headerNameToString(o).startsWith("content-"))return!0;if(t&&(o.length===13||o.length===6||o.length===19)){let a=ht.headerNameToString(o);return a==="authorization"||a==="cookie"||a==="proxy-authorization"}return!1}function Zwe(o,e,t){let a=[];if(Array.isArray(o))for(let i=0;i<o.length;i+=2)gT(o[i],e,t)||a.push(o[i],o[i+1]);else if(o&&typeof o=="object"){let i=ht.hasSafeIterator(o)?o:Object.entries(o);for(let[r,n]of i)gT(r,e,t)||a.push(r,n)}else I0(o==null,"headers must be an object or an array");return a}pT.exports=E0});var fT=f((_Be,hT)=>{"use strict";var Kwe=j0();function Xwe({maxRedirections:o}={}){return e=>function(a,i){let{maxRedirections:r=o,...n}=a;if(r==null||r===0)return e(a,i);let s={...n},c=new Kwe(e,r,s,i);return e(s,c)}}hT.exports=Xwe});var yT=f((DBe,bT)=>{"use strict";var exe=bm(),{ResponseError:oxe}=ge(),C0=class extends exe{#e;#o;#a;#i;#r;constructor(e,{handler:t}){super(t)}#t(e){return(this.#o??"").indexOf(e)===0}onRequestStart(e,t){return this.#e=0,this.#o=null,this.#a=null,this.#i=null,this.#r="",super.onRequestStart(e,t)}onResponseStart(e,t,a,i){if(this.#e=t,this.#i=a,this.#o=a["content-type"],this.#e<400)return super.onResponseStart(e,t,a,i);(this.#t("application/json")||this.#t("text/plain"))&&(this.#a=new TextDecoder("utf-8"))}onResponseData(e,t){if(this.#e<400)return super.onResponseData(e,t);this.#r+=this.#a?.decode(t,{stream:!0})??""}onResponseEnd(e,t){if(this.#e>=400){if(this.#r+=this.#a?.decode(void 0,{stream:!1})??"",this.#t("application/json"))try{this.#r=JSON.parse(this.#r)}catch{}let a,i=Error.stackTraceLimit;Error.stackTraceLimit=0;try{a=new oxe("Response Error",this.#e,{body:this.#r,headers:this.#i})}finally{Error.stackTraceLimit=i}super.onResponseError(e,a)}else super.onResponseEnd(e,t)}onResponseError(e,t){super.onResponseError(e,t)}};bT.exports=()=>o=>function(t,a){return o(t,new C0(t,{handler:a}))}});var AT=f((TBe,kT)=>{"use strict";var txe=Rf();kT.exports=o=>e=>function(a,i){return e(a,new txe({...a,retryOptions:{...o,...a.retryOptions}},{handler:i,dispatch:e}))}});var wT=f((RBe,vT)=>{"use strict";var{InvalidArgumentError:axe,RequestAbortedError:ixe}=ge(),rxe=bm(),S0=class extends rxe{#e=1024*1024;#o=!1;#a=0;#i=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:t},a){if(e!=null&&(!Number.isFinite(e)||e<1))throw new axe("maxSize must be a number greater than 0");super(a),this.#e=e??this.#e}#r(e){this.aborted=!0,this.reason=e}onRequestStart(e,t){return e.abort=this.#r.bind(this),this.#i=e,super.onRequestStart(e,t)}onResponseStart(e,t,a,i){let r=a["content-length"];if(r!=null&&r>this.#e)throw new ixe(`Response size (${r}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,t,a,i)}onResponseError(e,t){this.#o||(t=this.#i?.reason??t,super.onResponseError(e,t))}onResponseData(e,t){return this.#a=this.#a+t.length,this.#a>=this.#e&&(this.#o=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,t){if(!this.#o){if(this.#i.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,t)}}};function nxe({maxSize:o}={maxSize:1024*1024}){return e=>function(a,i){let{dumpMaxSize:r=o}=a,n=new S0({maxSize:r,signal:a.signal},i);return e(a,n)}}vT.exports=nxe});var ET=f((NBe,qT)=>{"use strict";var{isIP:sxe}=require("net"),{lookup:cxe}=require("dns"),mxe=bm(),{InvalidArgumentError:Fs,InformationalError:lxe}=ge(),B0=Math.pow(2,31)-1;function uxe(o){let e=Object.getPrototypeOf(o);return Object.prototype.hasOwnProperty.call(o,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof o[Symbol.iterator]=="function"}function xT(o){return typeof o=="string"&&o.toLowerCase()==="host"}function dxe(o){if(o==null)return null;if(Array.isArray(o)){if(o.length===0||!Array.isArray(o[0]))return o;let e=[];for(let t of o)Array.isArray(t)&&t.length===2?e.push(t[0],t[1]):e.push(t);return e}if(typeof o=="object"&&uxe(o)){let e=[];for(let t of o)Array.isArray(t)&&t.length===2?e.push(t[0],t[1]):e.push(t);return e}return o}function gxe(o){if(o==null)return!1;if(Array.isArray(o)){if(o.length===0)return!1;for(let e=0;e<o.length;e+=2)if(xT(o[e]))return!0;return!1}if(typeof o=="object"){for(let e in o)if(xT(e))return!0}return!1}function zT(o,e){let t=dxe(e);return gxe(t)?t:Array.isArray(t)?["host",o,...t]:t&&typeof t=="object"?{host:o,...t}:{host:o}}var Q0=class{#e=0;#o=new Map;constructor(e){this.#e=e.maxItems}get size(){return this.#o.size}get(e){return this.#o.get(e)??null}set(e,t){this.#o.set(e,t)}delete(e){this.#o.delete(e)}full(){return this.size>=this.#e}},_0=class{#e=0;#o=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#o=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#a,this.pick=e.pick??this.#i,this.storage=e.storage??new Q0(e)}runLookup(e,t,a){let i=this.storage.get(e.hostname);if(i==null&&this.storage.full()){a(null,e);return}let r={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#o};if(i==null)this.lookup(e,r,(n,s)=>{if(n||s==null||s.length===0){a(n??new lxe("No DNS entries found"));return}this.setRecords(e,s);let c=this.storage.get(e.hostname),m=this.pick(e,c,r.affinity),l;typeof m.port=="number"?l=`:${m.port}`:e.port!==""?l=`:${e.port}`:l="",a(null,new URL(`${e.protocol}//${m.family===6?`[${m.address}]`:m.address}${l}`))});else{let n=this.pick(e,i,r.affinity);if(n==null){this.storage.delete(e.hostname),this.runLookup(e,t,a);return}let s;typeof n.port=="number"?s=`:${n.port}`:e.port!==""?s=`:${e.port}`:s="",a(null,new URL(`${e.protocol}//${n.family===6?`[${n.address}]`:n.address}${s}`))}}#a(e,t,a){cxe(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(i,r)=>{if(i)return a(i);let n=new Map;for(let s of r)n.set(`${s.address}:${s.family}`,s);a(null,n.values())})}#i(e,t,a){let i=null,{records:r,offset:n}=t,s;if(this.dualStack?(a==null&&(n==null||n===B0?(t.offset=0,a=4):(t.offset++,a=(t.offset&1)===1?6:4)),r[a]!=null&&r[a].ips.length>0?s=r[a]:s=r[a===4?6:4]):s=r[a],s==null||s.ips.length===0)return i;s.offset==null||s.offset===B0?s.offset=0:s.offset++;let c=s.offset%s.ips.length;return i=s.ips[c]??null,i==null?i:Date.now()-i.timestamp>i.ttl?(s.ips.splice(c,1),this.pick(e,t,a)):i}pickFamily(e,t){let a=this.storage.get(e.hostname)?.records;if(!a)return null;let i=a[t];if(!i)return null;i.offset==null||i.offset===B0?i.offset=0:i.offset++;let r=i.offset%i.ips.length,n=i.ips[r]??null;return n==null||Date.now()-n.timestamp>n.ttl&&i.ips.splice(r,1),n}setRecords(e,t){let a=Date.now(),i={records:{4:null,6:null}},r=this.#e;for(let n of t){n.timestamp=a,typeof n.ttl=="number"?(n.ttl=Math.min(n.ttl,this.#e),r=Math.min(r,n.ttl)):n.ttl=this.#e;let s=i.records[n.family]??{ips:[]};s.ips.push(n),i.records[n.family]=s}this.storage.set(e.hostname,i,{ttl:r})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,t){return new D0(this,e,t)}},D0=class extends mxe{#e=null;#o=null;#a=null;#i=null;#r=null;#t=null;#c=!0;constructor(e,{origin:t,handler:a,dispatch:i,newOrigin:r},n){super(a),this.#i=t,this.#t=r,this.#o={...n},this.#e=e,this.#a=i}onResponseError(e,t){switch(t.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#c){super.onResponseError(e,t);return}this.#c=!1;let a=this.#t.hostname[0]==="["?4:6,i=this.#e.pickFamily(this.#i,a);if(i==null){super.onResponseError(e,t);return}let r;typeof i.port=="number"?r=`:${i.port}`:this.#i.port!==""?r=`:${this.#i.port}`:r="";let n={...this.#o,origin:`${this.#i.protocol}//${i.family===6?`[${i.address}]`:i.address}${r}`,headers:zT(this.#i.host,this.#o.headers)};this.#a(n,this);return}super.onResponseError(e,t);break}case"ENOTFOUND":this.#e.deleteRecords(this.#i),super.onResponseError(e,t);break;default:super.onResponseError(e,t);break}}};qT.exports=o=>{if(o?.maxTTL!=null&&(typeof o?.maxTTL!="number"||o?.maxTTL<0))throw new Fs("Invalid maxTTL. Must be a positive number");if(o?.maxItems!=null&&(typeof o?.maxItems!="number"||o?.maxItems<1))throw new Fs("Invalid maxItems. Must be a positive number and greater than zero");if(o?.affinity!=null&&o?.affinity!==4&&o?.affinity!==6)throw new Fs("Invalid affinity. Must be either 4 or 6");if(o?.dualStack!=null&&typeof o?.dualStack!="boolean")throw new Fs("Invalid dualStack. Must be a boolean");if(o?.lookup!=null&&typeof o?.lookup!="function")throw new Fs("Invalid lookup. Must be a function");if(o?.pick!=null&&typeof o?.pick!="function")throw new Fs("Invalid pick. Must be a function");if(o?.storage!=null&&(typeof o?.storage?.get!="function"||typeof o?.storage?.set!="function"||typeof o?.storage?.full!="function"||typeof o?.storage?.delete!="function"))throw new Fs("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=o?.dualStack??!0,t;e?t=o?.affinity??null:t=o?.affinity??4;let a={maxTTL:o?.maxTTL??1e4,lookup:o?.lookup??null,pick:o?.pick??null,dualStack:e,affinity:t,maxItems:o?.maxItems??1/0,storage:o?.storage},i=new _0(a);return r=>function(s,c){let m=s.origin.constructor===URL?s.origin:new URL(s.origin);return sxe(m.hostname)!==0?r(s,c):(i.runLookup(m,s,(l,u)=>{if(l)return c.onResponseError(null,l);let d={...s,servername:m.hostname,origin:u.origin,headers:zT(m.host,s.headers)};r(d,i.getHandler({origin:m,dispatch:r,handler:c,newOrigin:u},s))}),!0)}}});var ym=f((OBe,NT)=>{"use strict";var{safeHTTPMethods:IT,pathHasQueryOrFragment:pxe,hasSafeIterator:hxe,isValidHTTPToken:td}=be(),{serializePathWithQuery:fxe}=be(),bxe=2147483647,jT=["no-store","private","no-cache"],T0=Symbol("invalid cache-control directives");function $s(o){return o.replace(/^[\t ]+|[\t ]+$/g,"")}function DT(o,e){for(let t=0;t<o.length;t++)if(o[t]===e)return!0;return!1}function CT(o){return o.replace(/^[\t ]+/,"")}function ST(o){return o.replace(/[\t ]+$/,"")}function BT(o,e){let t=!1;for(let a=e;a<o.length;a++)if(t)t=!1;else if(o[a]==="\\")t=!0;else if(o[a]==='"')return a;return-1}function yxe(o){let e=[],t=0,a=-1,i=!1,r=!1;for(let m=0;m<o.length;m++)i?r?r=!1:o[m]==="\\"?r=!0:o[m]==='"'&&(i=!1,a=-1):o[m]==='"'?(i=!0,a=m):o[m]===","&&(e.push({value:o.substring(t,m),fromMalformedQuote:!1}),t=m+1);if(!i)return e.push({value:o.substring(t),fromMalformedQuote:!1}),e;let n=o.substring(t),s=a-t,c=0;for(let m=0;m<n.length;m++)n[m]===","&&(e.push({value:n.substring(c,m),fromMalformedQuote:c>s}),c=m+1);return e.push({value:n.substring(c),fromMalformedQuote:c>s}),e}function QT(o,e){let t=o[T0];t===void 0&&(t=new Set,Object.defineProperty(o,T0,{value:t})),t.add(e)}function kxe(o,e){return o[T0]?.has(e)===!0}function Axe(o){for(let a of jT)if(o.startsWith(a)&&o.length>a.length&&!td(o[a.length]))return a;let e="",t=!1;for(let a=0;a<o.length;a++)td(o[a])?e+=o[a]:t=!0;if(t&&DT(jT,e))return e}function vxe(o){if(!o.origin)throw new Error("opts.origin is undefined");let e=o.path||"/";return o.query&&!pxe(e)&&(e=fxe(e,o.query)),{origin:o.origin.toString(),method:o.method,path:e,headers:o.headers}}function _T(o,e,t){let a=e.toLowerCase(),i=o[a],r=Array.isArray(t)?t:[t];i===void 0?o[a]=Array.isArray(t)?t.slice():t:Array.isArray(i)?i.push(...r):o[a]=[i,...r]}function wxe(o){let e;if(o.headers==null)e={};else if(typeof o.headers=="object")if(e={},hxe(o.headers))for(let t of o.headers){if(!Array.isArray(t))throw new Error("opts.headers is not a valid header map");let[a,i]=t;if(typeof a!="string"||typeof i!="string")throw new Error("opts.headers is not a valid header map");_T(e,a,i)}else for(let t of Object.keys(o.headers))_T(e,t,o.headers[t]);else throw new Error("opts.headers is not an object");return e}function xxe(o){if(typeof o!="object")throw new TypeError(`expected key to be object, got ${typeof o}`);for(let e of["origin","method","path"])if(typeof o[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof o[e]}`);if(o.headers!==void 0&&typeof o.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof o}`)}function zxe(o){if(typeof o!="object")throw new TypeError(`expected value to be object, got ${typeof o}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof o[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof o[e]}`);if(typeof o.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof o.statusMessage}`);if(o.headers!=null&&typeof o.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof o.headers}`);if(o.vary!==void 0&&typeof o.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof o.vary}`);if(o.etag!==void 0&&typeof o.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof o.etag}`)}function qxe(o){let e={},t=new Set,a=new Set,i=yxe(Array.isArray(o)?o.join(","):o);for(let r=0;r<i.length;r++){let n=i[r],s=n.value.toLowerCase(),c=n.fromMalformedQuote,m=s.indexOf("="),l,u,d=!1,g=!1;if(m!==-1){let k=s.substring(0,m),w=s.substring(m+1);d=ST(k)!==k,g=CT(w)!==w,l=$s(k),u=CT(w)}else l=$s(s);let h=Axe(l);if(h!==void 0){e[h]=!0;continue}switch(l){case"min-fresh":case"max-stale":case"max-age":case"s-maxage":case"stale-while-revalidate":case"stale-if-error":{if(c||t.has(l))continue;if(u===void 0||d||g){delete e[l],t.add(l),QT(e,l);continue}if(u.length>=2&&u[0]==='"'&&u[u.length-1]==='"'&&(u=u.substring(1,u.length-1)),!/^[0-9]+$/.test(u)){delete e[l],t.add(l),QT(e,l);continue}let k=Math.min(parseInt(u,10),bxe);l==="min-fresh"?(!(l in e)||e[l]<k)&&(e[l]=k):(!(l in e)||e[l]>k)&&(e[l]=k);break}case"private":case"no-cache":{if(c){e[l]=!0;break}if(u!==void 0&&u.length===0){e[l]=!0;break}if(u){if(u[0]==='"'){u=ST(u);let k="",w=r,x=!1,E=BT(u,1);if(E!==-1)k=u.substring(1,E),x=!0;else{let D=[u.substring(1)];for(let H=r+1;H<i.length;H++){let J=$s(i[H].value),X=BT(J,0);if(w=H,X!==-1){D.push(J.substring(0,X)),x=!0;break}D.push(J)}k=D.join(",")}if(!x){e[l]=!0;break}r=w;let q=k.split(","),_=!0;for(let D=0;D<q.length;D++)q[D]=$s(q[D]),td(q[D])||(_=!1);_?e[l]!==!0&&(l in e?e[l]=e[l].concat(q):e[l]=q):e[l]=!0}else{let k=$s(u);td(k)?e[l]!==!0&&(l in e?e[l]=e[l].concat(k):e[l]=[k]):e[l]=!0}break}}case"public":case"must-revalidate":case"proxy-revalidate":case"immutable":case"no-transform":case"must-understand":case"only-if-cached":if(c||a.has(l))continue;if(u!==void 0){delete e[l],a.add(l);continue}e[l]=!0;break;case"no-store":e[l]=!0;break;default:continue}}return e}function TT(o){let e=Array.isArray(o)?o:[o],t=[];for(let a=0;a<e.length;a++){let i=e[a].split(",");for(let r=0;r<i.length;r++)t.push(i[r])}return t}function R0(o){let e=TT(o);for(let t=0;t<e.length;t++)if($s(e[t]).indexOf("*")!==-1)return!0;return!1}function RT(o,e){if(R0(o))return e;let t={},a=TT(o);for(let i of a){let r=$s(i).toLowerCase();if(r.length===0)continue;if(!td(r))return;let n=e[r];t[r]=Array.isArray(n)?n.slice():n??null}return t}function Exe(o){return R0(o)||RT(o,{})===void 0}function Ixe(o){return o.length<=2?!1:o[0]==='"'&&o[o.length-1]==='"'?!(o[1]==='"'||o.startsWith('"W/')):o.startsWith('W/"')&&o[o.length-1]==='"'?o.length!==4:!1}function jxe(o,e="CacheStore"){if(typeof o!="object"||o===null)throw new TypeError(`expected type of ${e} to be a CacheStore, got ${o===null?"null":typeof o}`);for(let t of["get","createWriteStream","delete"])if(typeof o[t]!="function")throw new TypeError(`${e} needs to have a \`${t}()\` function`)}function Cxe(o,e="CacheMethods"){if(!Array.isArray(o))throw new TypeError(`expected type of ${e} needs to be an array, got ${o===null?"null":typeof o}`);if(o.length===0)throw new TypeError(`${e} needs to have at least one method`);for(let t of o)if(!DT(IT,t))throw new TypeError(`element of ${e}-array needs to be one of following values: ${IT.join(", ")}, got ${t}`)}function Sxe(o,e){let t={};if(o.headers){let a=Object.keys(o.headers).sort();for(let i of a)e?.has(i.toLowerCase())||(t[i]=o.headers[i])}return JSON.stringify([o.origin,o.method,o.path,t])}NT.exports={makeCacheKey:vxe,normalizeHeaders:wxe,assertCacheKey:xxe,assertCacheValue:zxe,parseCacheControlHeader:qxe,hasInvalidCacheControlDirective:kxe,parseVaryHeader:RT,hasVaryStar:R0,isInvalidOrWildcardVaryHeader:Exe,isEtagUsable:Ixe,assertCacheMethods:Cxe,assertCacheStore:jxe,makeDeduplicationKey:Sxe}});var O0=f((UBe,OT)=>{"use strict";function Bxe(o){switch(o[3]){case",":return Qxe(o);case" ":return _xe(o);default:return Dxe(o)}}function N0(o,e,t,a,i,r,n){let s=new Date(Date.UTC(o,e,t,a,i,r));return o>=0&&o<=99&&s.setUTCFullYear(o),s.getUTCFullYear()===o&&s.getUTCMonth()===e&&s.getUTCDate()===t&&s.getUTCHours()===a&&s.getUTCMinutes()===i&&s.getUTCSeconds()===r&&s.getUTCDay()===n?s:void 0}function Qxe(o){if(o.length!==29||o[4]!==" "||o[7]!==" "||o[11]!==" "||o[16]!==" "||o[19]!==":"||o[22]!==":"||o[25]!==" "||o[26]!=="G"||o[27]!=="M"||o[28]!=="T")return;let e=-1;if(o[0]==="S"&&o[1]==="u"&&o[2]==="n")e=0;else if(o[0]==="M"&&o[1]==="o"&&o[2]==="n")e=1;else if(o[0]==="T"&&o[1]==="u"&&o[2]==="e")e=2;else if(o[0]==="W"&&o[1]==="e"&&o[2]==="d")e=3;else if(o[0]==="T"&&o[1]==="h"&&o[2]==="u")e=4;else if(o[0]==="F"&&o[1]==="r"&&o[2]==="i")e=5;else if(o[0]==="S"&&o[1]==="a"&&o[2]==="t")e=6;else return;let t=0;if(o[5]==="0"){let d=o.charCodeAt(6);if(d<49||d>57)return;t=d-48}else{let d=o.charCodeAt(5);if(d<49||d>51)return;let g=o.charCodeAt(6);if(g<48||g>57)return;t=(d-48)*10+(g-48)}let a=-1;if(o[8]==="J"&&o[9]==="a"&&o[10]==="n")a=0;else if(o[8]==="F"&&o[9]==="e"&&o[10]==="b")a=1;else if(o[8]==="M"&&o[9]==="a")if(o[10]==="r")a=2;else if(o[10]==="y")a=4;else return;else if(o[8]==="J")if(o[9]==="a"&&o[10]==="n")a=0;else if(o[9]==="u")if(o[10]==="n")a=5;else if(o[10]==="l")a=6;else return;else return;else if(o[8]==="A")if(o[9]==="p"&&o[10]==="r")a=3;else if(o[9]==="u"&&o[10]==="g")a=7;else return;else if(o[8]==="S"&&o[9]==="e"&&o[10]==="p")a=8;else if(o[8]==="O"&&o[9]==="c"&&o[10]==="t")a=9;else if(o[8]==="N"&&o[9]==="o"&&o[10]==="v")a=10;else if(o[8]==="D"&&o[9]==="e"&&o[10]==="c")a=11;else return;let i=o.charCodeAt(12);if(i<48||i>57)return;let r=o.charCodeAt(13);if(r<48||r>57)return;let n=o.charCodeAt(14);if(n<48||n>57)return;let s=o.charCodeAt(15);if(s<48||s>57)return;let c=(i-48)*1e3+(r-48)*100+(n-48)*10+(s-48),m=0;if(o[17]==="0"){let d=o.charCodeAt(18);if(d<48||d>57)return;m=d-48}else{let d=o.charCodeAt(17);if(d<48||d>50)return;let g=o.charCodeAt(18);if(g<48||g>57||d===50&&g>51)return;m=(d-48)*10+(g-48)}let l=0;if(o[20]==="0"){let d=o.charCodeAt(21);if(d<48||d>57)return;l=d-48}else{let d=o.charCodeAt(20);if(d<48||d>53)return;let g=o.charCodeAt(21);if(g<48||g>57)return;l=(d-48)*10+(g-48)}let u=0;if(o[23]==="0"){let d=o.charCodeAt(24);if(d<48||d>57)return;u=d-48}else{let d=o.charCodeAt(23);if(d<48||d>53)return;let g=o.charCodeAt(24);if(g<48||g>57)return;u=(d-48)*10+(g-48)}return N0(c,a,t,m,l,u,e)}function _xe(o){if(o.length!==24||o[7]!==" "||o[10]!==" "||o[19]!==" ")return;let e=-1;if(o[0]==="S"&&o[1]==="u"&&o[2]==="n")e=0;else if(o[0]==="M"&&o[1]==="o"&&o[2]==="n")e=1;else if(o[0]==="T"&&o[1]==="u"&&o[2]==="e")e=2;else if(o[0]==="W"&&o[1]==="e"&&o[2]==="d")e=3;else if(o[0]==="T"&&o[1]==="h"&&o[2]==="u")e=4;else if(o[0]==="F"&&o[1]==="r"&&o[2]==="i")e=5;else if(o[0]==="S"&&o[1]==="a"&&o[2]==="t")e=6;else return;let t=-1;if(o[4]==="J"&&o[5]==="a"&&o[6]==="n")t=0;else if(o[4]==="F"&&o[5]==="e"&&o[6]==="b")t=1;else if(o[4]==="M"&&o[5]==="a")if(o[6]==="r")t=2;else if(o[6]==="y")t=4;else return;else if(o[4]==="J")if(o[5]==="a"&&o[6]==="n")t=0;else if(o[5]==="u")if(o[6]==="n")t=5;else if(o[6]==="l")t=6;else return;else return;else if(o[4]==="A")if(o[5]==="p"&&o[6]==="r")t=3;else if(o[5]==="u"&&o[6]==="g")t=7;else return;else if(o[4]==="S"&&o[5]==="e"&&o[6]==="p")t=8;else if(o[4]==="O"&&o[5]==="c"&&o[6]==="t")t=9;else if(o[4]==="N"&&o[5]==="o"&&o[6]==="v")t=10;else if(o[4]==="D"&&o[5]==="e"&&o[6]==="c")t=11;else return;let a=0;if(o[8]===" "){let d=o.charCodeAt(9);if(d<49||d>57)return;a=d-48}else{let d=o.charCodeAt(8);if(d<49||d>51)return;let g=o.charCodeAt(9);if(g<48||g>57)return;a=(d-48)*10+(g-48)}let i=0;if(o[11]==="0"){let d=o.charCodeAt(12);if(d<48||d>57)return;i=d-48}else{let d=o.charCodeAt(11);if(d<48||d>50)return;let g=o.charCodeAt(12);if(g<48||g>57||d===50&&g>51)return;i=(d-48)*10+(g-48)}let r=0;if(o[14]==="0"){let d=o.charCodeAt(15);if(d<48||d>57)return;r=d-48}else{let d=o.charCodeAt(14);if(d<48||d>53)return;let g=o.charCodeAt(15);if(g<48||g>57)return;r=(d-48)*10+(g-48)}let n=0;if(o[17]==="0"){let d=o.charCodeAt(18);if(d<48||d>57)return;n=d-48}else{let d=o.charCodeAt(17);if(d<48||d>53)return;let g=o.charCodeAt(18);if(g<48||g>57)return;n=(d-48)*10+(g-48)}let s=o.charCodeAt(20);if(s<48||s>57)return;let c=o.charCodeAt(21);if(c<48||c>57)return;let m=o.charCodeAt(22);if(m<48||m>57)return;let l=o.charCodeAt(23);if(l<48||l>57)return;let u=(s-48)*1e3+(c-48)*100+(m-48)*10+(l-48);return N0(u,t,a,i,r,n,e)}function Dxe(o){let e=-1,t=-1;if(o[0]==="S")o[1]==="u"&&o[2]==="n"&&o[3]==="d"&&o[4]==="a"&&o[5]==="y"?(t=0,e=6):o[1]==="a"&&o[2]==="t"&&o[3]==="u"&&o[4]==="r"&&o[5]==="d"&&o[6]==="a"&&o[7]==="y"&&(t=6,e=8);else if(o[0]==="M"&&o[1]==="o"&&o[2]==="n"&&o[3]==="d"&&o[4]==="a"&&o[5]==="y")t=1,e=6;else if(o[0]==="T")o[1]==="u"&&o[2]==="e"&&o[3]==="s"&&o[4]==="d"&&o[5]==="a"&&o[6]==="y"?(t=2,e=7):o[1]==="h"&&o[2]==="u"&&o[3]==="r"&&o[4]==="s"&&o[5]==="d"&&o[6]==="a"&&o[7]==="y"&&(t=4,e=8);else if(o[0]==="W"&&o[1]==="e"&&o[2]==="d"&&o[3]==="n"&&o[4]==="e"&&o[5]==="s"&&o[6]==="d"&&o[7]==="a"&&o[8]==="y")t=3,e=9;else if(o[0]==="F"&&o[1]==="r"&&o[2]==="i"&&o[3]==="d"&&o[4]==="a"&&o[5]==="y")t=5,e=6;else return;if(o[e]!==","||o.length-e-1!==23||o[e+1]!==" "||o[e+4]!=="-"||o[e+8]!=="-"||o[e+11]!==" "||o[e+14]!==":"||o[e+17]!==":"||o[e+20]!==" "||o[e+21]!=="G"||o[e+22]!=="M"||o[e+23]!=="T")return;let a=0;if(o[e+2]==="0"){let u=o.charCodeAt(e+3);if(u<49||u>57)return;a=u-48}else{let u=o.charCodeAt(e+2);if(u<49||u>51)return;let d=o.charCodeAt(e+3);if(d<48||d>57)return;a=(u-48)*10+(d-48)}let i=-1;if(o[e+5]==="J"&&o[e+6]==="a"&&o[e+7]==="n")i=0;else if(o[e+5]==="F"&&o[e+6]==="e"&&o[e+7]==="b")i=1;else if(o[e+5]==="M"&&o[e+6]==="a"&&o[e+7]==="r")i=2;else if(o[e+5]==="A"&&o[e+6]==="p"&&o[e+7]==="r")i=3;else if(o[e+5]==="M"&&o[e+6]==="a"&&o[e+7]==="y")i=4;else if(o[e+5]==="J"&&o[e+6]==="u"&&o[e+7]==="n")i=5;else if(o[e+5]==="J"&&o[e+6]==="u"&&o[e+7]==="l")i=6;else if(o[e+5]==="A"&&o[e+6]==="u"&&o[e+7]==="g")i=7;else if(o[e+5]==="S"&&o[e+6]==="e"&&o[e+7]==="p")i=8;else if(o[e+5]==="O"&&o[e+6]==="c"&&o[e+7]==="t")i=9;else if(o[e+5]==="N"&&o[e+6]==="o"&&o[e+7]==="v")i=10;else if(o[e+5]==="D"&&o[e+6]==="e"&&o[e+7]==="c")i=11;else return;let r=o.charCodeAt(e+9);if(r<48||r>57)return;let n=o.charCodeAt(e+10);if(n<48||n>57)return;let s=(r-48)*10+(n-48);s+=s<70?2e3:1900;let c=0;if(o[e+12]==="0"){let u=o.charCodeAt(e+13);if(u<48||u>57)return;c=u-48}else{let u=o.charCodeAt(e+12);if(u<48||u>50)return;let d=o.charCodeAt(e+13);if(d<48||d>57||u===50&&d>51)return;c=(u-48)*10+(d-48)}let m=0;if(o[e+15]==="0"){let u=o.charCodeAt(e+16);if(u<48||u>57)return;m=u-48}else{let u=o.charCodeAt(e+15);if(u<48||u>53)return;let d=o.charCodeAt(e+16);if(d<48||d>57)return;m=(u-48)*10+(d-48)}let l=0;if(o[e+18]==="0"){let u=o.charCodeAt(e+19);if(u<48||u>57)return;l=u-48}else{let u=o.charCodeAt(e+18);if(u<48||u>53)return;let d=o.charCodeAt(e+19);if(d<48||d>57)return;l=(u-48)*10+(d-48)}return N0(s,i,a,c,m,l,t)}OT.exports={parseHttpDate:Bxe}});var HT=f((MBe,$T)=>{"use strict";var U0=be(),{parseCacheControlHeader:Txe,hasInvalidCacheControlDirective:UT,parseVaryHeader:Rxe,hasVaryStar:Nxe,isInvalidOrWildcardVaryHeader:LT,isEtagUsable:Oxe}=ym(),{parseHttpDate:M0}=O0();function Uxe(){}var PT=[200,203,204,206,300,301,308,404,405,410,414,501],Mxe=[206],ad=2147483647e3;function Lxe(o){return o.replace(/^[\t ]+|[\t ]+$/g,"")}function km(o,e){for(let t=0;t<o.length;t++)if(o[t]===e)return!0;return!1}function Pxe(o,e){let t=Array.isArray(e)?e:[e];for(let a=0;a<t.length;a++){let i=t[a].split(",");for(let r=0;r<i.length;r++)o.push(Lxe(i[r]).toLowerCase())}}function Fxe(o,e){if(typeof e!="string")return;let t,a,i;try{t=new URL(o.origin),a=new URL(o.path,t),i=new URL(e,a)}catch{return}if(i.origin===t.origin)return i.pathname+i.search}function FT(o,e,t){id(o,{...e,path:t});for(let a=0;a<U0.safeHTTPMethods.length;a++){let i=U0.safeHTTPMethods[a];i!==e.method&&id(o,{...e,method:i,path:t})}}function MT(o,e,t){if(t===void 0)return;let a=Array.isArray(t)?t:[t];for(let i=0;i<a.length;i++){let r=Fxe(e,a[i]);r!==void 0&&FT(o,e,r)}}function $xe(o,e,t){FT(o,e,e.path),MT(o,e,t.location),MT(o,e,t["content-location"])}var L0=class{#e;#o;#a;#i;#r;#t;constructor({store:e,type:t,cacheByDefault:a},i,r){this.#i=e,this.#o=t,this.#a=a,this.#e=i,this.#r=r}onRequestStart(e,t){this.#t?.destroy(),this.#t=void 0,this.#r.onRequestStart?.(e,t)}onRequestUpgrade(e,t,a,i){this.#r.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){let r=()=>this.#r.onResponseStart?.(e,t,a,i),n=this;if(!km(U0.safeHTTPMethods,this.#e.method)&&t>=200&&t<=399)return $xe(this.#i,this.#e,a),r();let s=a["cache-control"],c=a["last-modified"]&&km(PT,t);if(!s&&!a.expires&&!c&&!this.#a)return t===304&&a.vary&<(a.vary)&&id(this.#i,this.#e),r();let m=s?Txe(s):{};if(!Gxe(this.#o,t,a,m,this.#e.headers))return t===304&&(s||Hxe(this.#o,a,m))&&id(this.#i,this.#e),r();let l=Date.now(),u=Object.hasOwn(a,"age")?Yxe(a.age):void 0;if(u!==void 0&&u>=ad)return Xf(t,this.#i,this.#e),r();let d=Object.hasOwn(a,"date")?Vxe(a.date):void 0;if(d===null)return Xf(t,this.#i,this.#e),r();let g=d?Math.max(0,l-d.getTime()):0,h=Math.max(g,u??0),k=Jxe(this.#o,l,u,a,d,m)??this.#a;if(k===void 0||h>=k)return(s||k!==void 0)&&Xf(t,this.#i,this.#e),r();let w=l-h,x=k+w;if(l>=x)return Xf(t,this.#i,this.#e),r();let E;if(this.#e.headers&&a.vary&&(E=Rxe(a.vary,this.#e.headers),!E))return r();let q=w,_=Wxe(w,l,m,x),D=Zxe(a,m),H={statusCode:t,statusMessage:i,headers:D,vary:E,cacheControlDirectives:m,cachedAt:q,staleAt:x,deleteAt:_};if(t===304){let J=Y=>{if(!Y)return r();if(H.statusCode=Y.statusCode,H.statusMessage=Y.statusMessage,H.etag=Y.etag,H.vary=E??Y.vary,H.headers={...Y.headers,...D},r(),this.#t=this.#i.createWriteStream(this.#e,H),!(!this.#t||!Y?.body))if(typeof Y.body.values=="function"){let ve=Y.body.values(),xe=()=>{for(let He of ve){let Jo=this.#t.write(He)===!1;if(this.#r.onResponseData?.(e,He),Jo)break}};this.#t.on("error",function(){n.#t=void 0,n.#i.delete(n.#e)}).on("drain",()=>{xe()}).on("close",function(){n.#t===this&&(n.#t=void 0)}),xe()}else typeof Y.body.on=="function"&&(Y.body.on("data",ve=>{this.#t.write(ve),this.#r.onResponseData?.(e,ve)}).on("end",()=>{this.#t.end()}).on("error",()=>{this.#t=void 0,this.#i.delete(this.#e)}),this.#t.on("error",function(){n.#t=void 0,n.#i.delete(n.#e)}).on("close",function(){n.#t===this&&(n.#t=void 0)}))},X=this.#i.get(this.#e);X&&typeof X.then=="function"?X.then(J):J(X)}else{if(typeof a.etag=="string"&&Oxe(a.etag)&&(H.etag=a.etag),this.#t=this.#i.createWriteStream(this.#e,H),!this.#t)return r();this.#t.on("drain",()=>e.resume()).on("error",function(){n.#t=void 0,n.#i.delete(n.#e)}).on("close",function(){n.#t===this&&(n.#t=void 0),e.resume()}),r()}}onResponseData(e,t){this.#t?.write(t)===!1&&e.pause(),this.#r.onResponseData?.(e,t)}onResponseEnd(e,t){this.#t?.end(),this.#r.onResponseEnd?.(e,t)}onResponseError(e,t){this.#t?.destroy(t),this.#t=void 0,this.#r.onResponseError?.(e,t)}};function id(o,e){try{o.delete(e)?.catch?.(Uxe)}catch{}}function Xf(o,e,t){o===304&&id(e,t)}function Hxe(o,e,t){return t["no-store"]===!0||o==="shared"&&t.private===!0||(e.vary?LT(e.vary):!1)}function Gxe(o,e,t,a,i){return!(e<200||km(Mxe,e)||!km(PT,e)&&!t.expires&&!a.public&&a["max-age"]===void 0&&!(a.private&&o==="private")&&!(a["s-maxage"]!==void 0&&o==="shared")||a["no-store"]||o==="shared"&&a.private===!0||t.vary&&Nxe(t.vary)||i!=null&&Object.hasOwn(i,"authorization")&&(!a.public&&!a["s-maxage"]&&!a["must-revalidate"]||typeof i.authorization!="string"||Array.isArray(a["no-cache"])&&km(a["no-cache"],"authorization")||Array.isArray(a.private)&&km(a.private,"authorization")))}function Vxe(o){let e=o;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}return typeof e!="string"?null:M0(e)}function Yxe(o){let e=o;if(Array.isArray(e)){if(e.length!==1)return ad;e=e[0]}if(typeof e!="string"||!/^[\t ]*[0-9]+[\t ]*$/.test(e))return ad;let t=BigInt(e.replace(/^[\t ]+|[\t ]+$/g,""));return t>=BigInt(ad/1e3)?ad:Number(t)*1e3}function Jxe(o,e,t,a,i,r){if(o==="shared"){if(UT(r,"s-maxage"))return 0;let s=r["s-maxage"];if(s!==void 0)return s*1e3}if(UT(r,"max-age"))return 0;let n=r["max-age"];if(n!==void 0)return n*1e3;if(Object.hasOwn(a,"expires")){if(typeof a.expires!="string")return 0;let s=M0(a.expires);if(!s||e>=s.getTime())return 0;if(i){if(i>=s)return 0;let c=s.getTime()-i.getTime();return t!==void 0&&t>=c?0:c}return s.getTime()-e}if(typeof a["last-modified"]=="string"){let s=M0(a["last-modified"]);if(s)return s.getTime()>=e?void 0:(e-s.getTime())*.1}if(r.immutable)return 31536e6}function Wxe(o,e,t,a){let i=-1/0,r=-1/0,n=-1/0;if(t["stale-while-revalidate"]&&(i=a+t["stale-while-revalidate"]*1e3),t["stale-if-error"]&&(r=a+t["stale-if-error"]*1e3),t.immutable&&i===-1/0&&r===-1/0&&(n=e+31536e6),i===-1/0&&r===-1/0&&n===-1/0){let s=a-o,c=Math.min(Math.max(e-o,0),1e3);return a+s+c}return Math.max(a,i,r,n)}function Zxe(o,e){let t=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];o.connection&&Pxe(t,o.connection),Array.isArray(e["no-cache"])&&t.push(...e["no-cache"]),Array.isArray(e.private)&&t.push(...e.private);let a;for(let i of t)Object.hasOwn(o,i)&&(a??={...o},delete a[i]);return a??o}$T.exports=L0});var F0=f((LBe,YT)=>{"use strict";var{Writable:Kxe}=require("stream"),{EventEmitter:Xxe}=require("events"),{assertCacheKey:GT,assertCacheValue:eze}=ym(),P0=class extends Xxe{#e=1024;#o=104857600;#a=5242880;#i=0;#r=0;#t=new Map;#c=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#o=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#a=e.maxEntrySize}}}get size(){return this.#i}isFull(){return this.#i>=this.#o||this.#r>=this.#e}get(e){GT(e);let t=`${e.origin}:${e.path}`,a=Date.now(),i=this.#t.get(t),r=i?VT(e,i,a):null;return r==null?void 0:{statusMessage:r.statusMessage,statusCode:r.statusCode,headers:r.headers,body:r.body,vary:r.vary?r.vary:void 0,etag:r.etag,cacheControlDirectives:r.cacheControlDirectives,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}}createWriteStream(e,t){GT(e),eze(t);let a=`${e.origin}:${e.path}`,i=this,r={...e,...t,body:[],size:0};return new Kxe({write(n,s,c){typeof n=="string"&&(n=Buffer.from(n,s)),r.size+=n.byteLength,r.size>=i.#a?this.destroy():r.body.push(n),c(null)},final(n){let s=i.#t.get(a);s||(s=[],i.#t.set(a,s));let c=VT(e,s,Date.now());if(c){let m=s.indexOf(c);s.splice(m,1,r),i.#i-=c.size}else s.push(r),i.#r+=1;if(i.#i+=r.size,i.#i>i.#o||i.#r>i.#e){i.#c||(i.emit("maxSizeExceeded",{size:i.#i,maxSize:i.#o,count:i.#r,maxCount:i.#e}),i.#c=!0);for(let[m,l]of i.#t){for(let u of l.splice(0,l.length/2))i.#i-=u.size,i.#r-=1;l.length===0&&i.#t.delete(m)}i.#i<i.#o&&i.#r<i.#e&&(i.#c=!1)}n(null)}})}delete(e){if(typeof e!="object")throw new TypeError(`expected key to be object, got ${typeof e}`);let t=`${e.origin}:${e.path}`;for(let a of this.#t.get(t)??[])this.#i-=a.size,this.#r-=1;this.#t.delete(t)}};function VT(o,e,t){for(let a=0;a<e.length;a++){let i=e[a];if(i.deleteAt>t&&i.method===o.method&&oze(o,i))return i}}function oze(o,e){if(e.vary==null)return!0;for(let t in e.vary)if(Object.hasOwn(e.vary,t)&&!tze(o.headers?.[t],e.vary[t]))return!1;return!0}function tze(o,e){if(o==null&&e==null)return!0;if(o==null&&e!=null||o!=null&&e==null)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}return o===e}YT.exports=P0});var WT=f((PBe,JT)=>{"use strict";var aze=require("assert"),$0=class{#e=!1;#o;#a;#i;#r;constructor(e,t,a){if(typeof e!="function")throw new TypeError("callback must be a function");this.#o=e,this.#a=t,this.#r=a}onRequestStart(e,t){this.#e=!1,this.#i=t}onRequestUpgrade(e,t,a,i){this.#a.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){if(aze(this.#o!=null),this.#e=t===304||this.#r&&t>=500&&t<=504,this.#o(this.#e,this.#i,t,a),this.#o=null,this.#e)return!0;this.#a.onRequestStart?.(e,this.#i),this.#a.onResponseStart?.(e,t,a,i)}onResponseData(e,t){if(!this.#e)return this.#a.onResponseData?.(e,t)}onResponseEnd(e,t){this.#e||this.#a.onResponseEnd?.(e,t)}onResponseError(e,t){if(!this.#e)if(this.#o&&(this.#o(!1),this.#o=null),typeof this.#a.onResponseError=="function")this.#a.onResponseError(e,t);else throw t}};JT.exports=$0});var i7=f((FBe,a7)=>{"use strict";var ZT=require("assert"),{Readable:ize}=require("stream"),Dn=be(),Am=HT(),rze=F0(),nze=WT(),{assertCacheStore:sze,assertCacheMethods:cze,makeCacheKey:mze,normalizeHeaders:lze,parseCacheControlHeader:t7,isInvalidOrWildcardVaryHeader:uze}=ym(),{AbortError:dze}=ge(),{parseHttpDate:gze}=O0();function pze(o,e){if(o!==void 0){if(!Array.isArray(o))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof o}`);for(let t=0;t<o.length;t++){let a=o[t];if(typeof a!="string"&&!(a instanceof RegExp))throw new TypeError(`expected ${e}[${t}] to be a string or RegExp, got ${typeof a}`)}}}var rd=()=>{};function hze(o){return o.replace(/^[\t ]+|[\t ]+$/g,"")}function KT(o,e){for(let t=0;t<o.length;t++)if(o[t]===e)return!0;return!1}function fze(o){let e=o?.pragma;if(!e)return!1;let t=Array.isArray(e)?e:[e];for(let a=0;a<t.length;a++){let i=t[a];if(typeof i!="string")continue;let r=i.split(",");for(let n=0;n<r.length;n++)if(hze(r[n]).toLowerCase()==="no-cache")return!0}return!1}function bze(o,e,{headers:t={}}){return!!(e?.["no-cache"]||o.cacheControlDirectives?.["no-cache"]&&!Array.isArray(o.cacheControlDirectives["no-cache"])||t["if-modified-since"]||t["if-none-match"])}function G0(o,e){return o.cacheControlDirectives?.["must-revalidate"]===!0||e==="shared"&&(o.cacheControlDirectives?.["proxy-revalidate"]===!0||o.cacheControlDirectives?.["s-maxage"]!==void 0)}function yze(o,e){if(e.vary&&uze(e.vary))return!0;let t=e["cache-control"];if(!t)return!1;let a=t7(t);return a["no-store"]===!0||o==="shared"&&a.private===!0}function kze(o){return o["cache-control"]!==void 0}function XT(o,e){try{o.delete(e)?.catch?.(rd)}catch{}}function Aze(o){let e=o?.["last-modified"];if(typeof e=="string"&&gze(e))return e}function e7(o,e){let t={...o.headers,"if-modified-since":Aze(e.headers)??new Date(e.cachedAt).toUTCString()};if(e.etag&&(t["if-none-match"]=e.etag),e.vary)for(let a in e.vary)e.vary[a]!=null&&(t[a]=e.vary[a]);return t}function vze(o,e,t){let a=Date.now();if(a>o.staleAt){if(!G0(o,t)&&e?.["max-stale"]){let i=o.staleAt+e["max-stale"]*1e3;return a>i}return!0}if(e?.["min-fresh"]){let i=o.staleAt-a,r=e["min-fresh"]*1e3;return i<=r}return!1}function wze(o,e){let t=o.cacheControlDirectives?.["stale-while-revalidate"];if(!t||G0(o,e))return!1;let a=Date.now(),i=o.staleAt+t*1e3;return a<=i}function xze(o,e,t,a,i,r){if(r?.["only-if-cached"]){let n=!1;try{if(typeof a.onConnect=="function"&&(a.onConnect(()=>{n=!0}),n)||typeof a.onHeaders=="function"&&(a.onHeaders(504,[],rd,"Gateway Timeout"),n))return;typeof a.onComplete=="function"&&a.onComplete([])}catch(s){typeof a.onError=="function"&&a.onError(s)}return!0}return o(i,new Am(e,t,a))}function H0(o,e,t,a,i,r){let n=Dn.isStream(t.body)?t.body:ize.from(t.body??[]);ZT(!n.destroyed,"stream should not be destroyed"),ZT(!n.readableDidRead,"stream should not be readableDidRead");let s={resume(){n.resume()},pause(){n.pause()},get paused(){return n.isPaused()},get aborted(){return n.destroyed},get reason(){return n.errored},abort(m){n.destroy(m??new dze)}};if(n.on("error",function(m){if(!this.readableEnded)if(typeof o.onResponseError=="function")o.onResponseError(s,m);else throw m}).on("close",function(){this.errored||o.onResponseEnd?.(s,{})}),o.onRequestStart?.(s,i),n.destroyed)return;let c={...t.headers,age:String(a)};r&&(c.warning='110 - "response is stale"'),o.onResponseStart?.(s,t.statusCode,c,t.statusMessage),e.method==="HEAD"?n.destroy():n.on("data",function(m){o.onResponseData?.(s,m)})}function o7(o,e,t,a,i,r,n){if(!n)return xze(o,e,t,a,i,r);let s=Date.now();if(s>n.deleteAt)return o(i,new Am(e,t,a));let c=Math.round((s-n.cachedAt)/1e3),m=r?.["max-age"]!==void 0&&c>=r["max-age"],l=m||vze(n,r,e.type),u=m||bze(n,r,i);if(l||u){if(Dn.isStream(i.body)&&Dn.bodyLength(i.body)!==0)return o(i,new Am(e,t,a));if(!u&&wze(n,e.type))return H0(a,i,n,c,null,!0),queueMicrotask(()=>{let h=e7(i,n);o({...i,headers:h},new Am(e,t,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let d=!1;if(!G0(n,e.type)){let h=n.cacheControlDirectives["stale-if-error"]??r?.["stale-if-error"];h&&(d=s<n.staleAt+h*1e3)}let g=e7(i,n);return o({...i,headers:g},new nze((h,k,w,x)=>{if(h){if(w===304){if(yze(e.type,x))return Dn.isStream(n.body)&&n.body.on("error",rd).destroy(),XT(e.store,t),o(i,new Am(e,t,a));kze(x)&&XT(e.store,t)}H0(a,i,n,c,k,l)}else Dn.isStream(n.body)&&n.body.on("error",rd).destroy()},new Am(e,t,a),d))}Dn.isStream(i.body)&&i.body.on("error",rd).destroy(),H0(a,i,n,c,null,!1)}a7.exports=(o={})=>{let{store:e=new rze,methods:t=["GET"],cacheByDefault:a=void 0,type:i="shared",origins:r=void 0}=o;if(typeof o!="object"||o===null)throw new TypeError(`expected type of opts to be an Object, got ${o===null?"null":typeof o}`);if(sze(e,"opts.store"),cze(t,"opts.methods"),pze(r,"opts.origins"),typeof a<"u"&&typeof a!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof a}`);if(typeof i<"u"&&i!=="shared"&&i!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`);let n={store:e,methods:t,cacheByDefault:a,type:i},s=[];for(let c=0;c<Dn.safeHTTPMethods.length;c++){let m=Dn.safeHTTPMethods[c];KT(t,m)||s.push(m)}return c=>(m,l)=>{if(!m.origin||KT(s,m.method))return c(m,l);if(r!==void 0){let h=m.origin.toString().toLowerCase(),k=!1;for(let w=0;w<r.length;w++){let x=r[w];if(typeof x=="string"){if(x.toLowerCase()===h){k=!0;break}}else if(x.test(h)){k=!0;break}}if(!k)return c(m,l)}m={...m,headers:lze(m)};let u=m.headers?.["cache-control"]?t7(m.headers["cache-control"]):fze(m.headers)?{"no-cache":!0}:void 0;if(u?.["no-store"])return c(m,l);let d=mze(m),g=e.get(d);return g&&typeof g.then=="function"?g.then(h=>o7(c,n,d,l,m,u,h)):o7(c,n,d,l,m,u,g)}}});var m7=f(($Be,c7)=>{"use strict";var{createInflate:V0,createGunzip:r7,createBrotliDecompress:zze,createZstdDecompress:qze}=require("zlib"),{pipeline:Eze}=require("stream"),Ize=bm(),{runtimeFeatures:jze}=Ir(),n7={gzip:r7,"x-gzip":r7,br:zze,deflate:V0,compress:V0,"x-compress":V0,...jze.has("zstd")?{zstd:qze}:{}},Cze=[204,304],s7=!1,Y0=class extends Ize{#e=[];#o;#a;constructor(e,{skipStatusCodes:t=Cze,skipErrorResponses:a=!0}={}){super(e),this.#o=t,this.#a=a}#i(e,t){return!!(!e||t<200||this.#o.includes(t)||this.#a&&t>=400)}#r(e){let t=e.split(","),a=5;if(t.length>a)throw new Error(`too many content-encodings in response: ${t.length}, maximum allowed is ${a}`);let i=[];for(let r=t.length-1;r>=0;r--){let n=t[r].trim();if(n){if(!n7[n])return i.length=0,i;i.push(n7[n]())}}return i}#t(e,t){e.on("readable",()=>{let a;for(;(a=e.read())!==null&&super.onResponseData(t,a)!==!1;);}),e.on("error",a=>{super.onResponseError(t,a)})}#c(e){let t=this.#e[0];this.#t(t,e),t.on("end",()=>{super.onResponseEnd(e,{})})}#n(e){let t=this.#e[this.#e.length-1];this.#t(t,e),Eze(this.#e,a=>{if(a){super.onResponseError(e,a);return}super.onResponseEnd(e,{})})}#s(){this.#e.length=0}onResponseStart(e,t,a,i){let r=a["content-encoding"];if(this.#i(r,t))return super.onResponseStart(e,t,a,i);let n=this.#r(r.toLowerCase());if(n.length===0)return this.#s(),super.onResponseStart(e,t,a,i);this.#e=n;let{"content-encoding":s,"content-length":c,...m}=a;return this.#e.length===1?this.#c(e):this.#n(e),super.onResponseStart(e,t,m,i)}onResponseData(e,t){if(this.#e.length>0){this.#e[0].write(t);return}super.onResponseData(e,t)}onResponseEnd(e,t){if(this.#e.length>0){this.#e[0].end(),this.#s();return}super.onResponseEnd(e,t)}onResponseError(e,t){if(this.#e.length>0){for(let a of this.#e)a.destroy(t);this.#s()}super.onResponseError(e,t)}};function Sze(o={}){return s7||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),s7=!0),e=>(t,a)=>{let i=new Y0(a,o);return e(t,i)}}c7.exports=Sze});var d7=f((HBe,u7)=>{"use strict";var{RequestAbortedError:Bze}=ge(),l7=5*1024*1024,J0=class{#e;#o=[];#a=l7;#i=0;#r={};#t="";#c=!1;#n=!1;#s=!1;#m=!1;#u=null;#l=null;constructor(e,t,a=l7){this.#e=e,this.#l=t,this.#a=a}addWaitingHandler(e){if(this.#m||this.#s)return!1;let t=this.#d(e),a=t.controller;try{if(e.onRequestStart?.(a,null),a.aborted)return t.done=!0,!0;this.#n&&e.onResponseStart?.(a,this.#i,this.#r,this.#t)}catch{return t.done=!0,!0}return a.aborted||this.#o.push(t),!0}onRequestStart(e,t){this.#u=e,this.#e.onRequestStart?.(e,t)}onRequestUpgrade(e,t,a,i){this.#e.onRequestUpgrade?.(e,t,a,i)}onResponseStart(e,t,a,i){this.#n=!0,this.#i=t,this.#r=a,this.#t=i,this.#e.onResponseStart?.(e,t,a,i);for(let r of this.#o){let{handler:n,controller:s}=r;if(r.done||s.aborted){r.done=!0;continue}try{n.onResponseStart?.(s,t,a,i)}catch{}s.aborted&&(r.done=!0)}this.#h()}onResponseData(e,t){if(!(this.#c||this.#m)){this.#s=!0,this.#e.onResponseData?.(e,t);for(let a of this.#o){let{handler:i,controller:r}=a;if(a.done||r.aborted){a.done=!0;continue}if(r.paused){this.#p(a,t);continue}try{i.onResponseData?.(r,t)}catch{}r.aborted&&(a.done=!0,a.bufferedChunks=[],a.bufferedBytes=0)}this.#h()}}onResponseEnd(e,t){if(!(this.#c||this.#m)){this.#m=!0,this.#e.onResponseEnd?.(e,t);for(let a of this.#o){if(a.done||a.controller.aborted){a.done=!0;continue}if(this.#g(a),a.done||a.controller.aborted){a.done=!0;continue}if(a.controller.paused&&a.bufferedChunks.length>0){a.pendingTrailers=t;continue}try{a.handler.onResponseEnd?.(a.controller,t)}catch{}a.done=!0}this.#h(),this.#l?.()}}onResponseError(e,t){if(!this.#m){this.#c=!0,this.#m=!0,this.#e.onResponseError?.(e,t);for(let a of this.#o)this.#b(a,t);this.#o=[],this.#l?.()}}#d(e){let t={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},a={aborted:!1,paused:!1,reason:null};return t.controller={resume:()=>{if(!a.aborted){if(a.paused=!1,this.#g(t),this.#m&&t.pendingTrailers&&t.bufferedChunks.length===0&&!a.paused&&!a.aborted){try{t.handler.onResponseEnd?.(t.controller,t.pendingTrailers)}catch{}t.pendingTrailers=null,t.done=!0}this.#h()}},pause:()=>{a.aborted||(a.paused=!0)},get paused(){return a.paused},get aborted(){return a.aborted},get reason(){return a.reason},abort:i=>{a.aborted=!0,a.reason=i??null,t.done=!0,t.pendingTrailers=null,t.bufferedChunks=[],t.bufferedBytes=0}},t}#p(e,t){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let a=Buffer.from(t);if(e.bufferedChunks.push(a),e.bufferedBytes+=a.length,e.bufferedBytes>this.#a){let i=new Bze(`Deduplicated waiting handler exceeded maxBufferSize (${this.#a} bytes) while paused`);this.#b(e,i)}}#g(e){let{handler:t,controller:a}=e;for(;!e.done&&!a.aborted&&!a.paused&&e.bufferedChunks.length>0;){let i=e.bufferedChunks.shift();e.bufferedBytes-=i.length;try{t.onResponseData?.(a,i)}catch{}if(a.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#b(e,t){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(t),e.handler.onResponseError?.(e.controller,t)}catch{}}}#h(){this.#o=this.#o.filter(e=>e.done===!1)}};u7.exports=J0});var p7=f((GBe,g7)=>{"use strict";var Qze=require("diagnostics_channel"),_ze=be(),Dze=d7(),{normalizeHeaders:Tze,makeCacheKey:Rze,makeDeduplicationKey:Nze}=ym(),eb=Qze.channel("undici:request:pending-requests");g7.exports=(o={})=>{let{methods:e=["GET"],skipHeaderNames:t=[],excludeHeaderNames:a=[],maxBufferSize:i=5*1024*1024}=o;if(typeof o!="object"||o===null)throw new TypeError(`expected type of opts to be an Object, got ${o===null?"null":typeof o}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let c of e)if(!_ze.safeHTTPMethods.includes(c))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${c}`);if(!Array.isArray(t))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof t}`);if(!Array.isArray(a))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof a}`);if(!Number.isFinite(i)||i<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${i}`);let r=new Set(t.map(c=>c.toLowerCase())),n=new Set(a.map(c=>c.toLowerCase())),s=new Map;return c=>(m,l)=>{if(!m.origin||e.includes(m.method)===!1)return c(m,l);if(m={...m,headers:Tze(m)},r.size>0){for(let k of Object.keys(m.headers))if(r.has(k.toLowerCase()))return c(m,l)}let u=Rze(m),d=Nze(u,n),g=s.get(d);if(g)return g.addWaitingHandler(l)?!0:c(m,l);let h=new Dze(l,()=>{s.delete(d),eb.hasSubscribers&&eb.publish({size:s.size,key:d,type:"removed"})},i);return s.set(d,h),eb.hasSubscribers&&eb.publish({size:s.size,key:d,type:"added"}),c(m,h)}}});var b7=f((YBe,f7)=>{"use strict";var{Writable:Oze}=require("stream"),{assertCacheKey:W0,assertCacheValue:Uze}=ym(),Z0,Ot=3,h7=2*1e3*1e3*1e3;f7.exports=class{#e=h7;#o=1/0;#a;#i;#r;#t;#c;#n;#s;#m;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>h7)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#o=e.maxCount}}Z0||(Z0=require("sqlite").DatabaseSync),this.#a=new Z0(e?.location??":memory:"),this.#a.exec(`
|
|
1578
1582
|
PRAGMA journal_mode = WAL;
|
|
1579
1583
|
PRAGMA synchronous = NORMAL;
|
|
1580
1584
|
PRAGMA temp_store = memory;
|
|
@@ -1657,13 +1661,13 @@ ${e.format(t)}`.trim())}};FD.exports=k0});var v0=f((EBe,VD)=>{"use strict";var{I
|
|
|
1657
1661
|
ORDER BY cachedAt ASC
|
|
1658
1662
|
LIMIT ?
|
|
1659
1663
|
)
|
|
1660
|
-
`)}close(){this.#a.close()}get(e){W0(e);let t=this.#d(e);return t?{body:t.body?Buffer.from(t.body.buffer,t.body.byteOffset,t.body.byteLength):void 0,statusCode:t.statusCode,statusMessage:t.statusMessage,headers:t.headers?JSON.parse(t.headers):void 0,etag:t.etag?t.etag:void 0,vary:t.vary?JSON.parse(t.vary):void 0,cacheControlDirectives:t.cacheControlDirectives?JSON.parse(t.cacheControlDirectives):void 0,cachedAt:t.cachedAt,staleAt:t.staleAt,deleteAt:t.deleteAt}:void 0}set(e,t){W0(e);let a=this.#l(e),i=Array.isArray(t.body)?Buffer.concat(t.body):t.body,r=i?.byteLength;if(r&&r>this.#e)return;let n=this.#d(e,!0);n?this.#r.run(i,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.cachedAt,t.staleAt,n.id):(this.#t.run(a,e.method,i,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.vary?JSON.stringify(t.vary):null,t.cachedAt,t.staleAt),this.#u())}createWriteStream(e,t){W0(e),Uze(t);let a=0,i=[],r=this;return new Oze({decodeStrings:!0,write(n,s,c){a+=n.byteLength,a<r.#e?i.push(n):this.destroy(),c()},final(n){r.set(e,{...t,body:i}),n()}})}delete(e){if(typeof e!="object")throw new TypeError(`expected key to be object, got ${typeof e}`);this.#n.run(this.#l(e))}#u(){if(Number.isFinite(this.#o)&&this.size<=this.#o)return 0;{let e=this.#c.run(Date.now()).changes;if(e)return e}{let e=this.#m?.run(Math.max(Math.floor(this.#o*.1),1)).changes;if(e)return e}return 0}get size(){let{total:e}=this.#s.get();return e}#l(e){return`${e.origin}/${e.path}`}#d(e,t=!1){let a=this.#l(e),{headers:i,method:r}=e,n=this.#i.all(a,r);if(n.length===0)return;let s=Date.now();for(let c of n){if(s>=c.deleteAt&&!t)continue;let m=!0;if(c.vary){let l=JSON.parse(c.vary);for(let u in l)if(!Mze(i[u],l[u])){m=!1;break}}if(m)return c}}};function Mze(o,e){if(o==null&&e==null)return!0;if(o==null&&e!=null||o!=null&&e==null)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}return o===e}});var Hs=f((JBe,zT)=>{"use strict";var{kConstruct:Lze}=Ue(),{kEnumerableProperty:vm}=be(),{iteratorMixin:Pze,isValidHeaderName:nd,isValidHeaderValue:kT}=_t(),{webidl:Ie}=To(),K0=require("assert"),ob=require("util");function yT(o){return o===10||o===13||o===9||o===32}function AT(o){let e=0,t=o.length;for(;t>e&&yT(o.charCodeAt(t-1));)--t;for(;t>e&&yT(o.charCodeAt(e));)++e;return e===0&&t===o.length?o:o.substring(e,t)}function vT(o,e){if(Array.isArray(e))for(let t=0;t<e.length;++t){let a=e[t];if(a.length!==2)throw Ie.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${a.length}.`});X0(o,a[0],a[1])}else if(typeof e=="object"&&e!==null){let t=Object.keys(e);for(let a=0;a<t.length;++a)X0(o,t[a],e[t[a]])}else throw Ie.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function X0(o,e,t){if(t=AT(t),nd(e)){if(!kT(t))throw Ie.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header value"})}else throw Ie.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(xT(o)==="immutable")throw new TypeError("immutable");return ab(o).append(e,t,!1)}function Fze(o){let e=ab(o);if(!e)return[];if(e.sortedMap)return e.sortedMap;let t=[],a=e.toSortedArray(),i=e.cookies;if(i===null||i.length===1)return e.sortedMap=a;for(let r=0;r<a.length;++r){let{0:n,1:s}=a[r];if(n==="set-cookie")for(let c=0;c<i.length;++c)t.push([n,i[c]]);else t.push([n,s])}return e.sortedMap=t}function wT(o,e){return o[0]<e[0]?-1:1}var tb=class o{cookies=null;sortedMap;headersMap;constructor(e){e instanceof o?(this.headersMap=new Map(e.headersMap),this.sortedMap=e.sortedMap,this.cookies=e.cookies===null?null:[...e.cookies]):(this.headersMap=new Map(e),this.sortedMap=null)}contains(e,t){return this.headersMap.has(t?e:e.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(e,t,a){this.sortedMap=null;let i=a?e:e.toLowerCase(),r=this.headersMap.get(i);if(r){let n=i==="cookie"?"; ":", ";this.headersMap.set(i,{name:r.name,value:`${r.value}${n}${t}`})}else this.headersMap.set(i,{name:e,value:t});i==="set-cookie"&&(this.cookies??=[]).push(t)}set(e,t,a){this.sortedMap=null;let i=a?e:e.toLowerCase();i==="set-cookie"&&(this.cookies=[t]),this.headersMap.set(i,{name:e,value:t})}delete(e,t){this.sortedMap=null,t||(e=e.toLowerCase()),e==="set-cookie"&&(this.cookies=null),this.headersMap.delete(e)}get(e,t){return this.headersMap.get(t?e:e.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:e,1:{value:t}}of this.headersMap)yield[e,t]}get entries(){let e={};if(this.headersMap.size!==0)for(let{name:t,value:a}of this.headersMap.values())e[t]=a;return e}rawValues(){return this.headersMap.values()}get entriesList(){let e=[];if(this.headersMap.size!==0)for(let{0:t,1:{name:a,value:i}}of this.headersMap)if(t==="set-cookie")for(let r of this.cookies)e.push([a,r]);else e.push([a,i]);return e}toSortedArray(){let e=this.headersMap.size,t=new Array(e);if(e<=32){if(e===0)return t;let a=this.headersMap[Symbol.iterator](),i=a.next().value;t[0]=[i[0],i[1].value],K0(i[1].value!==null);for(let r=1,n=0,s=0,c=0,m=0,l,u;r<e;++r){for(u=a.next().value,l=t[r]=[u[0],u[1].value],K0(l[1]!==null),c=0,s=r;c<s;)m=c+(s-c>>1),t[m][0]<=l[0]?c=m+1:s=m;if(r!==m){for(n=r;n>c;)t[n]=t[--n];t[c]=l}}if(!a.next().done)throw new TypeError("Unreachable");return t}else{let a=0;for(let{0:i,1:{value:r}}of this.headersMap)t[a++]=[i,r],K0(r!==null);return t.sort(wT)}}},Da=class o{#e;#o;constructor(e=void 0){Ie.util.markAsUncloneable(this),e!==Lze&&(this.#o=new tb,this.#e="none",e!==void 0&&(e=Ie.converters.HeadersInit(e,"Headers constructor","init"),vT(this,e)))}append(e,t){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,2,"Headers.append");let a="Headers.append";return e=Ie.converters.ByteString(e,a,"name"),t=Ie.converters.ByteString(t,a,"value"),X0(this,e,t)}delete(e){if(Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ie.converters.ByteString(e,"Headers.delete","name"),!nd(e))throw Ie.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#o.contains(e,!1)&&this.#o.delete(e,!1)}get(e){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,1,"Headers.get");let t="Headers.get";if(e=Ie.converters.ByteString(e,t,"name"),!nd(e))throw Ie.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#o.get(e,!1)}has(e){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,1,"Headers.has");let t="Headers.has";if(e=Ie.converters.ByteString(e,t,"name"),!nd(e))throw Ie.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#o.contains(e,!1)}set(e,t){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,2,"Headers.set");let a="Headers.set";if(e=Ie.converters.ByteString(e,a,"name"),t=Ie.converters.ByteString(t,a,"value"),t=AT(t),nd(e)){if(!kT(t))throw Ie.errors.invalidArgument({prefix:a,value:t,type:"header value"})}else throw Ie.errors.invalidArgument({prefix:a,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#o.set(e,t,!1)}getSetCookie(){Ie.brandCheck(this,o);let e=this.#o.cookies;return e?[...e]:[]}[ob.inspect.custom](e,t){return t.depth??=e,`Headers ${ob.formatWithOptions(t,this.#o.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,t){e.#e=t}static getHeadersList(e){return e.#o}static setHeadersList(e,t){e.#o=t}},{getHeadersGuard:xT,setHeadersGuard:$ze,getHeadersList:ab,setHeadersList:Hze}=Da;Reflect.deleteProperty(Da,"getHeadersGuard");Reflect.deleteProperty(Da,"setHeadersGuard");Reflect.deleteProperty(Da,"getHeadersList");Reflect.deleteProperty(Da,"setHeadersList");Pze("Headers",Da,Fze,0,1);Object.defineProperties(Da.prototype,{append:vm,delete:vm,get:vm,has:vm,set:vm,getSetCookie:vm,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[ob.inspect.custom]:{enumerable:!1}});Ie.converters.HeadersInit=function(o,e,t){if(Ie.util.Type(o)===Ie.util.Types.OBJECT){let a=Reflect.get(o,Symbol.iterator);if(!ob.types.isProxy(o)&&a===Da.prototype.entries)try{return ab(o).entriesList}catch{}return typeof a=="function"?Ie.converters["sequence<sequence<ByteString>>"](o,e,t,a.bind(o)):Ie.converters["record<ByteString, ByteString>"](o,e,t)}throw Ie.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})};zT.exports={fill:vT,compareHeaderName:wT,Headers:Da,HeadersList:tb,getHeadersGuard:xT,setHeadersGuard:$ze,setHeadersList:Hze,getHeadersList:ab}});var cd=f((WBe,RT)=>{"use strict";var{Headers:ST,HeadersList:qT,fill:Gze,getHeadersGuard:Vze,setHeadersGuard:BT,setHeadersList:QT}=Hs(),{extractBody:ET,cloneBody:Yze,mixinBody:Jze,streamRegistry:_T,bodyUnusable:Wze}=Kc(),DT=be(),IT=require("util"),{kEnumerableProperty:Ut}=DT,{isValidReasonPhrase:Zze,isCancelled:Kze,isAborted:Xze,isErrorLike:e0e,environmentSettingsObject:o0e}=_t(),{redirectStatusSet:t0e,nullBodyStatus:a0e}=ku(),{webidl:ze}=To(),{URLSerializer:jT}=ma(),{kConstruct:rb}=Ue(),eq=require("assert"),{isomorphicEncode:i0e,serializeJavascriptValueToJSONString:r0e}=Er(),n0e=new TextEncoder("utf-8"),Mt=class o{#e;#o;static error(){return sd(nb(),"immutable")}static json(e,t=void 0){ze.argumentLengthCheck(arguments,1,"Response.json"),t!==null&&(t=ze.converters.ResponseInit(t));let a=n0e.encode(r0e(e)),i=ET(a),r=sd(wm({}),"response");return CT(r,t,{body:i[0],type:"application/json"}),r}static redirect(e,t=302){ze.argumentLengthCheck(arguments,1,"Response.redirect"),e=ze.converters.USVString(e),t=ze.converters["unsigned short"](t);let a;try{a=new URL(e,o0e.settingsObject.baseUrl)}catch(n){throw new TypeError(`Failed to parse URL from ${e}`,{cause:n})}if(!t0e.has(t))throw new RangeError(`Invalid status code ${t}`);let i=sd(wm({}),"immutable");i.#o.status=t;let r=i0e(jT(a));return i.#o.headersList.append("location",r,!0),i}constructor(e=null,t=void 0){if(ze.util.markAsUncloneable(this),e===rb)return;e!==null&&(e=ze.converters.BodyInit(e,"Response","body")),t=ze.converters.ResponseInit(t),this.#o=wm({}),this.#e=new ST(rb),BT(this.#e,"response"),QT(this.#e,this.#o.headersList);let a=null;if(e!=null){let[i,r]=ET(e);a={body:i,type:r}}CT(this,t,a)}get type(){return ze.brandCheck(this,o),this.#o.type}get url(){ze.brandCheck(this,o);let e=this.#o.urlList,t=e[e.length-1]??null;return t===null?"":jT(t,!0)}get redirected(){return ze.brandCheck(this,o),this.#o.urlList.length>1}get status(){return ze.brandCheck(this,o),this.#o.status}get ok(){return ze.brandCheck(this,o),this.#o.status>=200&&this.#o.status<=299}get statusText(){return ze.brandCheck(this,o),this.#o.statusText}get headers(){return ze.brandCheck(this,o),this.#e}get body(){return ze.brandCheck(this,o),this.#o.body?this.#o.body.stream:null}get bodyUsed(){return ze.brandCheck(this,o),!!this.#o.body&&DT.isDisturbed(this.#o.body.stream)}clone(){if(ze.brandCheck(this,o),Wze(this.#o))throw ze.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=oq(this.#o);return this.#o.urlList.length!==0&&this.#o.body?.stream&&_T.register(this,new WeakRef(this.#o.body.stream)),sd(e,Vze(this.#e))}[IT.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let a={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${IT.formatWithOptions(t,a)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,t){e.#e=t}static getResponseState(e){return e.#o}static setResponseState(e,t){e.#o=t}},{getResponseHeaders:s0e,setResponseHeaders:c0e,getResponseState:Gs,setResponseState:m0e}=Mt;Reflect.deleteProperty(Mt,"getResponseHeaders");Reflect.deleteProperty(Mt,"setResponseHeaders");Reflect.deleteProperty(Mt,"getResponseState");Reflect.deleteProperty(Mt,"setResponseState");Jze(Mt,Gs);Object.defineProperties(Mt.prototype,{type:Ut,url:Ut,status:Ut,ok:Ut,redirected:Ut,statusText:Ut,headers:Ut,clone:Ut,body:Ut,bodyUsed:Ut,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Mt,{json:Ut,redirect:Ut,error:Ut});function oq(o){if(o.internalResponse)return TT(oq(o.internalResponse),o.type);let e=wm({...o,body:null});return o.body!=null&&(e.body=Yze(o.body)),e}function wm(o){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...o,headersList:o?.headersList?new qT(o?.headersList):new qT,urlList:o?.urlList?[...o.urlList]:[]}}function nb(o){let e=e0e(o);return wm({type:"error",status:0,error:e?o:new Error(o&&String(o)),aborted:o&&o.name==="AbortError"})}function l0e(o){return o.type==="error"&&o.status===0}function ib(o,e){return e={internalResponse:o,...e},new Proxy(o,{get(t,a){return a in e?e[a]:t[a]},set(t,a,i){return eq(!(a in e)),t[a]=i,!0}})}function TT(o,e){if(e==="basic")return ib(o,{type:"basic",headersList:o.headersList});if(e==="cors")return ib(o,{type:"cors",headersList:o.headersList});if(e==="opaque")return ib(o,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return ib(o,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});eq(!1)}function u0e(o,e=null){return eq(Kze(o)),Xze(o)?nb(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):nb(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}function CT(o,e,t){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Zze(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(Gs(o).status=e.status),"statusText"in e&&e.statusText!=null&&(Gs(o).statusText=e.statusText),"headers"in e&&e.headers!=null&&Gze(s0e(o),e.headers),t){if(a0e.includes(o.status))throw ze.errors.exception({header:"Response constructor",message:`Invalid response status code ${o.status}`});Gs(o).body=t.body,t.type!=null&&!Gs(o).headersList.contains("content-type",!0)&&Gs(o).headersList.append("content-type",t.type,!0)}}function sd(o,e){let t=new Mt(rb);m0e(t,o);let a=new ST(rb);return c0e(t,a),QT(a,o.headersList),BT(a,e),o.urlList.length!==0&&o.body?.stream&&_T.register(t,new WeakRef(o.body.stream)),t}ze.converters.XMLHttpRequestBodyInit=function(o,e,t){return typeof o=="string"?ze.converters.USVString(o,e,t):ze.is.Blob(o)||ze.is.BufferSource(o)||ze.is.FormData(o)||ze.is.URLSearchParams(o)?o:ze.converters.DOMString(o,e,t)};ze.converters.BodyInit=function(o,e,t){return ze.is.ReadableStream(o)||o?.[Symbol.asyncIterator]?o:ze.converters.XMLHttpRequestBodyInit(o,e,t)};ze.converters.ResponseInit=ze.dictionaryConverter([{key:"status",converter:ze.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:ze.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:ze.converters.HeadersInit}]);ze.is.Response=ze.util.MakeTypeAssertion(Mt);RT.exports={isNetworkError:l0e,makeNetworkError:nb,makeResponse:wm,makeAppropriateNetworkError:u0e,filterResponse:TT,Response:Mt,cloneResponse:oq,fromInnerResponse:sd,getResponseState:Gs}});var xm=f((ZBe,WT)=>{"use strict";var{extractBody:d0e,mixinBody:g0e,cloneBody:p0e,bodyUnusable:NT}=Kc(),{Headers:FT,fill:h0e,HeadersList:mb,setHeadersGuard:tq,getHeadersGuard:f0e,setHeadersList:$T,getHeadersList:OT}=Hs(),cb=be(),UT=require("util"),{isValidHTTPToken:b0e,sameOrigin:MT,environmentSettingsObject:sb}=_t(),{forbiddenMethodsSet:y0e,corsSafeListedMethodsSet:k0e,referrerPolicy:A0e,requestRedirect:v0e,requestMode:w0e,requestCredentials:x0e,requestCache:z0e,requestDuplex:q0e}=ku(),{kEnumerableProperty:ko,normalizedMethodRecordsBase:E0e,normalizedMethodRecords:I0e}=cb,{webidl:ce}=To(),{URLSerializer:j0e}=ma(),{kConstruct:lb}=Ue(),C0e=require("assert"),{getMaxListeners:HT,setMaxListeners:S0e,defaultMaxListeners:B0e}=require("events"),Q0e=Symbol("abortController"),GT=new FinalizationRegistry(({signal:o,abort:e})=>{o.removeEventListener("abort",e)}),ub=new WeakMap,aq;try{aq=HT(new AbortController().signal)>0}catch{aq=!1}function LT(o){return e;function e(){let t=o.deref();if(t!==void 0){GT.unregister(e),this.removeEventListener("abort",e),t.abort(this.reason);let a=ub.get(t.signal);if(a!==void 0){if(a.size!==0){for(let i of a){let r=i.deref();r!==void 0&&r.abort(this.reason)}a.clear()}ub.delete(t.signal)}}}}var PT=!1,ft=class o{#e;#o;#a;#i;constructor(e,t=void 0){if(ce.util.markAsUncloneable(this),e===lb)return;ce.argumentLengthCheck(arguments,1,"Request constructor"),e=ce.converters.RequestInfo(e),t=ce.converters.RequestInit(t);let i=null,r=null,n=sb.settingsObject.baseUrl,s=null;if(typeof e=="string"){this.#o=t.dispatcher;let x;try{x=new URL(e,n)}catch(E){throw new TypeError("Failed to parse URL from "+e,{cause:E})}if(x.username||x.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);i=db({urlList:[x]}),r="cors"}else C0e(ce.is.Request(e)),i=e.#i,s=e.#e,this.#o=t.dispatcher||e.#o;let c=sb.settingsObject.origin,m="client";if(i.window?.constructor?.name==="EnvironmentSettingsObject"&&MT(i.window,c)&&(m=i.window),t.window!=null)throw new TypeError(`'window' option '${m}' must be null`);"window"in t&&(m="no-window"),i=db({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:sb.settingsObject,window:m,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let l=Object.keys(t).length!==0;if(l&&(i.mode==="navigate"&&(i.mode="same-origin"),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin="client",i.referrer="client",i.referrerPolicy="",i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),t.referrer!==void 0){let x=t.referrer;if(x==="")i.referrer="no-referrer";else{let E;try{E=new URL(x,n)}catch(q){throw new TypeError(`Referrer "${x}" is not a valid URL.`,{cause:q})}E.protocol==="about:"&&E.hostname==="client"||c&&!MT(E,sb.settingsObject.baseUrl)?i.referrer="client":i.referrer=E}}t.referrerPolicy!==void 0&&(i.referrerPolicy=t.referrerPolicy);let u;if(t.mode!==void 0?u=t.mode:u=r,u==="navigate")throw ce.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(u!=null&&(i.mode=u),t.credentials!==void 0&&(i.credentials=t.credentials),t.cache!==void 0&&(i.cache=t.cache),i.cache==="only-if-cached"&&i.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(t.redirect!==void 0&&(i.redirect=t.redirect),t.integrity!=null&&(i.integrity=String(t.integrity)),t.keepalive!==void 0&&(i.keepalive=!!t.keepalive),t.method!==void 0){let x=t.method,E=I0e[x];if(E!==void 0)i.method=E;else{if(!b0e(x))throw new TypeError(`'${x}' is not a valid HTTP method.`);let q=x.toUpperCase();if(y0e.has(q))throw new TypeError(`'${x}' HTTP method is unsupported.`);x=E0e[q]??x,i.method=x}!PT&&i.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),PT=!0)}t.signal!==void 0&&(s=t.signal),this.#i=i;let d=new AbortController;if(this.#e=d.signal,s!=null)if(s.aborted)d.abort(s.reason);else{this[Q0e]=d;let x=new WeakRef(d),E=LT(x);aq&&HT(s)===B0e&&S0e(1500,s),cb.addAbortListener(s,E),GT.register(d,{signal:s,abort:E},E)}if(this.#a=new FT(lb),$T(this.#a,i.headersList),tq(this.#a,"request"),u==="no-cors"){if(!k0e.has(i.method))throw new TypeError(`'${i.method} is unsupported in no-cors mode.`);tq(this.#a,"request-no-cors")}if(l){let x=OT(this.#a),E=t.headers!==void 0?t.headers:new mb(x);if(x.clear(),E instanceof mb){for(let{name:q,value:_}of E.rawValues())x.append(q,_,!1);x.cookies=E.cookies}else h0e(this.#a,E)}let g=ce.is.Request(e)?e.#i.body:null;if((t.body!=null||g!=null)&&(i.method==="GET"||i.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let h=null;if(t.body!=null){let[x,E]=d0e(t.body,i.keepalive);h=x,E&&!OT(this.#a).contains("content-type",!0)&&this.#a.append("content-type",E,!0)}let k=h??g;if(k!=null&&k.source==null){if(h!=null&&t.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(i.mode!=="same-origin"&&i.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');i.useCORSPreflightFlag=!0}let w=k;if(h==null&&g!=null){if(NT(e.#i))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let x=new TransformStream;g.stream.pipeThrough(x),w={source:g.source,length:g.length,stream:x.readable}}this.#i.body=w}get method(){return ce.brandCheck(this,o),this.#i.method}get url(){return ce.brandCheck(this,o),j0e(this.#i.url)}get headers(){return ce.brandCheck(this,o),this.#a}get destination(){return ce.brandCheck(this,o),this.#i.destination}get referrer(){return ce.brandCheck(this,o),this.#i.referrer==="no-referrer"?"":this.#i.referrer==="client"?"about:client":this.#i.referrer.toString()}get referrerPolicy(){return ce.brandCheck(this,o),this.#i.referrerPolicy}get mode(){return ce.brandCheck(this,o),this.#i.mode}get credentials(){return ce.brandCheck(this,o),this.#i.credentials}get cache(){return ce.brandCheck(this,o),this.#i.cache}get redirect(){return ce.brandCheck(this,o),this.#i.redirect}get integrity(){return ce.brandCheck(this,o),this.#i.integrity}get keepalive(){return ce.brandCheck(this,o),this.#i.keepalive}get isReloadNavigation(){return ce.brandCheck(this,o),this.#i.reloadNavigation}get isHistoryNavigation(){return ce.brandCheck(this,o),this.#i.historyNavigation}get signal(){return ce.brandCheck(this,o),this.#e}get body(){return ce.brandCheck(this,o),this.#i.body?this.#i.body.stream:null}get bodyUsed(){return ce.brandCheck(this,o),!!this.#i.body&&cb.isDisturbed(this.#i.body.stream)}get duplex(){return ce.brandCheck(this,o),"half"}clone(){if(ce.brandCheck(this,o),NT(this.#i))throw new TypeError("unusable");let e=YT(this.#i),t=new AbortController;if(this.signal.aborted)t.abort(this.signal.reason);else{let a=ub.get(this.signal);a===void 0&&(a=new Set,ub.set(this.signal,a));let i=new WeakRef(t);a.add(i),cb.addAbortListener(t.signal,LT(i))}return JT(e,this.#o,t.signal,f0e(this.#a))}[UT.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let a={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${UT.formatWithOptions(t,a)}`}static setRequestSignal(e,t){return e.#e=t,e}static getRequestDispatcher(e){return e.#o}static setRequestDispatcher(e,t){e.#o=t}static setRequestHeaders(e,t){e.#a=t}static getRequestState(e){return e.#i}static setRequestState(e,t){e.#i=t}},{setRequestSignal:_0e,getRequestDispatcher:D0e,setRequestDispatcher:T0e,setRequestHeaders:R0e,getRequestState:VT,setRequestState:N0e}=ft;Reflect.deleteProperty(ft,"setRequestSignal");Reflect.deleteProperty(ft,"getRequestDispatcher");Reflect.deleteProperty(ft,"setRequestDispatcher");Reflect.deleteProperty(ft,"setRequestHeaders");Reflect.deleteProperty(ft,"getRequestState");Reflect.deleteProperty(ft,"setRequestState");g0e(ft,VT);function db(o){return{method:o.method??"GET",localURLsOnly:o.localURLsOnly??!1,unsafeRequest:o.unsafeRequest??!1,body:o.body??null,client:o.client??null,reservedClient:o.reservedClient??null,replacesClientId:o.replacesClientId??"",window:o.window??"client",keepalive:o.keepalive??!1,serviceWorkers:o.serviceWorkers??"all",initiator:o.initiator??"",destination:o.destination??"",priority:o.priority??null,origin:o.origin??"client",policyContainer:o.policyContainer??"client",referrer:o.referrer??"client",referrerPolicy:o.referrerPolicy??"",mode:o.mode??"no-cors",useCORSPreflightFlag:o.useCORSPreflightFlag??!1,credentials:o.credentials??"same-origin",useCredentials:o.useCredentials??!1,cache:o.cache??"default",redirect:o.redirect??"follow",integrity:o.integrity??"",cryptoGraphicsNonceMetadata:o.cryptoGraphicsNonceMetadata??"",parserMetadata:o.parserMetadata??"",reloadNavigation:o.reloadNavigation??!1,historyNavigation:o.historyNavigation??!1,userActivation:o.userActivation??!1,taintedOrigin:o.taintedOrigin??!1,redirectCount:o.redirectCount??0,responseTainting:o.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:o.preventNoCacheCacheControlHeaderModification??!1,done:o.done??!1,timingAllowFailed:o.timingAllowFailed??!1,useURLCredentials:o.useURLCredentials??void 0,traversableForUserPrompts:o.traversableForUserPrompts??"client",urlList:o.urlList,url:o.urlList[0],headersList:o.headersList?new mb(o.headersList):new mb}}function YT(o){let e=db({...o,body:null});return o.body!=null&&(e.body=p0e(o.body)),e}function JT(o,e,t,a){let i=new ft(lb);N0e(i,o),T0e(i,e),_0e(i,t);let r=new FT(lb);return R0e(i,r),$T(r,o.headersList),tq(r,a),i}Object.defineProperties(ft.prototype,{method:ko,url:ko,headers:ko,redirect:ko,clone:ko,signal:ko,duplex:ko,destination:ko,body:ko,bodyUsed:ko,isHistoryNavigation:ko,isReloadNavigation:ko,keepalive:ko,integrity:ko,cache:ko,credentials:ko,attribute:ko,referrerPolicy:ko,referrer:ko,mode:ko,[Symbol.toStringTag]:{value:"Request",configurable:!0}});ce.is.Request=ce.util.MakeTypeAssertion(ft);ce.converters.RequestInfo=function(o){return typeof o=="string"?ce.converters.USVString(o):ce.is.Request(o)?o:ce.converters.USVString(o)};ce.converters.RequestInit=ce.dictionaryConverter([{key:"method",converter:ce.converters.ByteString},{key:"headers",converter:ce.converters.HeadersInit},{key:"body",converter:ce.nullableConverter(ce.converters.BodyInit)},{key:"referrer",converter:ce.converters.USVString},{key:"referrerPolicy",converter:ce.converters.DOMString,allowedValues:A0e},{key:"mode",converter:ce.converters.DOMString,allowedValues:w0e},{key:"credentials",converter:ce.converters.DOMString,allowedValues:x0e},{key:"cache",converter:ce.converters.DOMString,allowedValues:z0e},{key:"redirect",converter:ce.converters.DOMString,allowedValues:v0e},{key:"integrity",converter:ce.converters.DOMString},{key:"keepalive",converter:ce.converters.boolean},{key:"signal",converter:ce.nullableConverter(o=>ce.converters.AbortSignal(o,"RequestInit","signal"))},{key:"window",converter:ce.converters.any},{key:"duplex",converter:ce.converters.DOMString,allowedValues:q0e},{key:"dispatcher",converter:ce.converters.any},{key:"priority",converter:ce.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:()=>"auto"}]);WT.exports={Request:ft,makeRequest:db,fromInnerRequest:JT,cloneRequest:YT,getRequestDispatcher:D0e,getRequestState:VT}});var iR=f((KBe,aR)=>{"use strict";var O0e=require("assert"),{runtimeFeatures:KT}=Ir(),Vs=new Map([["sha256",0],["sha384",1],["sha512",2]]),iq;if(KT.has("crypto")){iq=require("crypto");let o=iq.getHashes();o.length===0&&Vs.clear();for(let e of Vs.keys())o.includes(e)===!1&&Vs.delete(e)}else Vs.clear();var ZT=Map.prototype.get.bind(Vs),rq=Map.prototype.has.bind(Vs),U0e=KT.has("crypto")===!1||Vs.size===0?()=>!0:(o,e)=>{let t=eR(e);if(t.length===0)return!0;let a=XT(t);for(let i of a){let r=i.alg,n=i.val,s=oR(r,o);if(tR(s,n))return!0}return!1};function XT(o){let e=[],t=null;for(let a of o){if(O0e(rq(a.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(a),t=a;continue}let i=t.alg,r=ZT(i),n=a.alg,s=ZT(n);s<r||(s>r?(t=a,e[0]=a,e.length=1):e.push(a))}return e}function eR(o){let e=[];for(let t of o.split(" ")){let i=t.split("?",1)[0],r="",n=[i.slice(0,6),i.slice(7)],s=n[0];if(!rq(s))continue;n[1]&&(r=n[1]);let c={alg:s,val:r};e.push(c)}return e}var oR=(o,e)=>iq.hash(o,e,"base64");function tR(o,e){let t=o.length;t!==0&&o[t-1]==="="&&(t-=1),t!==0&&o[t-1]==="="&&(t-=1);let a=e.length;if(a!==0&&e[a-1]==="="&&(a-=1),a!==0&&e[a-1]==="="&&(a-=1),t!==a)return!1;for(let i=0;i<t;++i)if(!(o[i]===e[i]||o[i]==="+"&&e[i]==="-"||o[i]==="/"&&e[i]==="_"))return!1;return!0}aR.exports={applyAlgorithmToBytes:oR,bytesMatch:U0e,caseSensitiveMatch:tR,isValidSRIHashAlgorithm:rq,getStrongestMetadata:XT,parseMetadata:eR}});var ud=f((XBe,yR)=>{"use strict";var{makeNetworkError:Le,makeAppropriateNetworkError:md,filterResponse:nq,makeResponse:gb,fromInnerResponse:M0e,getResponseState:L0e}=cd(),{HeadersList:sq}=Hs(),{Request:P0e,cloneRequest:F0e,getRequestDispatcher:$0e,getRequestState:H0e}=xm(),Ta=require("zlib"),{makePolicyContainer:G0e,clonePolicyContainer:V0e,requestBadPort:Y0e,TAOCheck:J0e,appendRequestOriginHeader:W0e,responseLocationURL:Z0e,requestCurrentURL:Lt,setRequestReferrerPolicyOnRedirect:K0e,tryUpgradeRequestToAPotentiallyTrustworthyURL:X0e,createOpaqueTimingInfo:gq,appendFetchMetadata:eqe,corsCheck:oqe,crossOriginResourcePolicyCheck:tqe,determineRequestsReferrer:aqe,coarsenedSharedCurrentTime:ld,sameOrigin:uq,isCancelled:Tn,isAborted:rR,isErrorLike:iqe,fullyReadBody:rqe,readableStreamClose:nqe,urlIsLocal:sqe,urlIsHttpHttpsScheme:bb,urlHasHttpsScheme:cqe,clampAndCoarsenConnectionTimingInfo:mqe,simpleRangeHeaderValue:lqe,buildContentRange:uqe,createInflate:dqe,extractMimeType:gqe,hasAuthenticationEntry:pqe,includesCredentials:nR,isTraversableNavigable:hqe}=_t(),Ys=require("assert"),{safelyExtractBody:yb,extractBody:sR}=Kc(),{redirectStatusSet:uR,nullBodyStatus:dR,safeMethodsSet:fqe,requestBodyHeader:bqe,subresourceSet:yqe}=ku(),kqe=require("events"),{Readable:Aqe,pipeline:vqe,finished:wqe,isErrored:xqe,isReadable:pb}=require("stream"),{addAbortListener:zqe,bufferToLowerCasedHeaderName:cR}=be(),{dataURLProcessor:qqe,serializeAMimeType:Eqe,minimizeSupportedMimeType:Iqe}=ma(),{getGlobalDispatcher:jqe}=Zf(),{webidl:pq}=To(),{STATUS_CODES:mR}=require("http"),{bytesMatch:Cqe}=iR(),{createDeferredPromise:Sqe}=zu(),{isomorphicEncode:hb}=Er(),{runtimeFeatures:Bqe}=Ir(),Qqe=Bqe.has("zstd"),_qe=["GET","HEAD"],Dqe=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",cq,fb=class extends kqe{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function Tqe(o){gR(o,"fetch")}function Rqe(o,e=void 0){pq.argumentLengthCheck(arguments,1,"globalThis.fetch");let t=Sqe(),a;try{a=new P0e(o,e)}catch(l){return t.reject(l),t.promise}let i=H0e(a);if(a.signal.aborted)return mq(t,i,null,a.signal.reason,null),t.promise;i.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(i.serviceWorkers="none");let n=null,s=!1,c=null;return zqe(a.signal,()=>{s=!0,Ys(c!=null),c.abort(a.signal.reason);let l=n?.deref();mq(t,i,l,a.signal.reason,c.controller)}),c=hR({request:i,processResponseEndOfBody:Tqe,processResponse:l=>{if(!s){if(l.aborted){mq(t,i,n,c.serializedAbortReason,c.controller);return}if(l.type==="error"){t.reject(new TypeError("fetch failed",{cause:l.error}));return}n=new WeakRef(M0e(l,"immutable")),t.resolve(n.deref()),t=null}},dispatcher:$0e(a),requestObject:a}),t.promise}function gR(o,e="other"){if(o.type==="error"&&o.aborted||!o.urlList?.length)return;let t=o.urlList[0],a=o.timingInfo,i=o.cacheState;bb(t)&&a!==null&&(o.timingAllowPassed||(a=gq({startTime:a.startTime}),i=""),a.endTime=ld(),o.timingInfo=a,pR(a,t.href,e,globalThis,i,"",o.status))}var pR=performance.markResourceTiming;function mq(o,e,t,a,i){if(o&&o.reject(a),e.body?.stream!=null&&pb(e.body.stream)&&e.body.stream.cancel(a).catch(n=>{if(n.code!=="ERR_INVALID_STATE")throw n}),t==null)return;let r=L0e(t);r.body?.stream!=null&&pb(r.body.stream)&&i.error(a)}function hR({request:o,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:a,processResponseEndOfBody:i,processResponseConsumeBody:r,useParallelQueue:n=!1,dispatcher:s=jqe(),requestObject:c=null}){Ys(s);let m=null,l=!1;o.client!=null&&(m=o.client.globalObject,l=o.client.crossOriginIsolatedCapability);let u=ld(l),d=gq({startTime:u}),g={controller:new fb(s),request:o,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:a,processResponseConsumeBody:r,processResponseEndOfBody:i,taskDestination:m,crossOriginIsolatedCapability:l,requestObject:c};return Ys(!o.body||o.body.stream),o.window==="client"&&(o.window=o.client?.globalObject?.constructor?.name==="Window"?o.client:"no-window"),o.origin==="client"&&(o.origin=o.client.origin),o.policyContainer==="client"&&(o.client!=null?o.policyContainer=V0e(o.client.policyContainer):o.policyContainer=G0e()),o.headersList.contains("accept",!0)||o.headersList.append("accept","*/*",!0),o.headersList.contains("accept-language",!0)||o.headersList.append("accept-language","*",!0),o.priority,yqe.has(o.destination),fR(g,!1),g.controller}async function fR(o,e){try{let t=o.request,a=null;if(t.localURLsOnly&&!sqe(Lt(t))&&(a=Le("local URLs only")),X0e(t),Y0e(t)==="blocked"&&(a=Le("bad port")),t.referrerPolicy===""&&(t.referrerPolicy=t.policyContainer.referrerPolicy),t.referrer!=="no-referrer"&&(t.referrer=aqe(t)),a===null){let r=Lt(t);uq(r,t.url)&&t.responseTainting==="basic"||r.protocol==="data:"||t.mode==="navigate"||t.mode==="websocket"?(t.responseTainting="basic",a=await lR(o)):t.mode==="same-origin"?a=Le('request mode cannot be "same-origin"'):t.mode==="no-cors"?t.redirect!=="follow"?a=Le('redirect mode cannot be "follow" for "no-cors" request'):(t.responseTainting="opaque",a=await lR(o)):bb(Lt(t))?(t.responseTainting="cors",a=await bR(o)):a=Le("URL scheme must be a HTTP(S) scheme")}if(e)return a;a.status!==0&&!a.internalResponse&&(t.responseTainting,t.responseTainting==="basic"?a=nq(a,"basic"):t.responseTainting==="cors"?a=nq(a,"cors"):t.responseTainting==="opaque"?a=nq(a,"opaque"):Ys(!1));let i=a.status===0?a:a.internalResponse;if(i.urlList.length===0&&i.urlList.push(...t.urlList),t.timingAllowFailed||(a.timingAllowPassed=!0),a.type==="opaque"&&i.status===206&&i.rangeRequested&&!t.headers.contains("range",!0)&&(a=i=Le()),a.status!==0&&(t.method==="HEAD"||t.method==="CONNECT"||dR.includes(i.status))&&(i.body=null,o.controller.dump=!0),t.integrity){let r=s=>lq(o,Le(s));if(t.responseTainting==="opaque"||a.body==null){r(a.error);return}let n=s=>{if(!Cqe(s,t.integrity)){r("integrity mismatch");return}a.body=yb(s)[0],lq(o,a)};rqe(a.body,n,r)}else lq(o,a)}catch(t){o.controller.terminate(t)}}function lR(o){if(Tn(o)&&o.request.redirectCount===0)return Promise.resolve(md(o));let{request:e}=o,{protocol:t}=Lt(e);switch(t){case"about:":return Promise.resolve(Le("about scheme is not supported"));case"blob:":{cq||(cq=require("buffer").resolveObjectURL);let a=Lt(e);if(a.search.length!==0)return Promise.resolve(Le("NetworkError when attempting to fetch resource."));let i=cq(a.toString());if(e.method!=="GET"||!pq.is.Blob(i))return Promise.resolve(Le("invalid method"));let r=gb(),n=i.size,s=hb(`${n}`),c=i.type;if(e.headersList.contains("range",!0)){r.rangeRequested=!0;let m=e.headersList.get("range",!0),l=lqe(m,!0);if(l==="failure")return Promise.resolve(Le("failed to fetch the data URL"));let{rangeStartValue:u,rangeEndValue:d}=l;if(u===null)u=n-d,d=u+d-1;else{if(u>=n)return Promise.resolve(Le("Range start is greater than the blob's size."));(d===null||d>=n)&&(d=n-1)}let g=i.slice(u,d+1,c),h=sR(g);r.body=h[0];let k=hb(`${g.size}`),w=uqe(u,d,n);r.status=206,r.statusText="Partial Content",r.headersList.set("content-length",k,!0),r.headersList.set("content-type",c,!0),r.headersList.set("content-range",w,!0)}else{let m=sR(i);r.statusText="OK",r.body=m[0],r.headersList.set("content-length",s,!0),r.headersList.set("content-type",c,!0)}return Promise.resolve(r)}case"data:":{let a=Lt(e),i=qqe(a);if(i==="failure")return Promise.resolve(Le("failed to fetch the data URL"));let r=Eqe(i.mimeType);return Promise.resolve(gb({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:r}]],body:yb(i.body)[0]}))}case"file:":return Promise.resolve(Le("not implemented... yet..."));case"http:":case"https:":return bR(o).catch(a=>Le(a));default:return Promise.resolve(Le("unknown scheme"))}}function Nqe(o,e){o.request.done=!0,o.processResponseDone!=null&&queueMicrotask(()=>o.processResponseDone(e))}function lq(o,e){let t=o.timingInfo,a=()=>{let r=Date.now();o.request.destination==="document"&&(o.controller.fullTimingInfo=t),o.controller.reportTimingSteps=()=>{if(!bb(o.request.url))return;t.endTime=r;let s=e.cacheState,c=e.bodyInfo;e.timingAllowPassed||(t=gq(t),s="");let m=0;if(o.request.mode!=="navigate"||!e.hasCrossOriginRedirects){m=e.status;let l=gqe(e.headersList);l!=="failure"&&(c.contentType=Iqe(l))}o.request.initiatorType!=null&&pR(t,o.request.url.href,o.request.initiatorType,globalThis,s,c,m)};let n=()=>{o.request.done=!0,o.processResponseEndOfBody!=null&&queueMicrotask(()=>o.processResponseEndOfBody(e)),o.request.initiatorType!=null&&o.controller.reportTimingSteps()};queueMicrotask(()=>n())};o.processResponse!=null&&queueMicrotask(()=>{o.processResponse(e),o.processResponse=null});let i=e.type==="error"?e:e.internalResponse??e;i.body==null?a():wqe(i.body.stream,()=>{a()})}async function bR(o){let e=o.request,t=null,a=null,i=o.timingInfo;if(e.serviceWorkers,t===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),a=t=await dq(o),e.responseTainting==="cors"&&oqe(e,t)==="failure")return Le("cors failure");J0e(e,t)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||t.type==="opaque")&&tqe(e.origin,e.client,e.destination,a)==="blocked"?Le("blocked"):(uR.has(a.status)&&(e.redirect!=="manual"&&o.controller.connection.destroy(void 0,!1),e.redirect==="error"?t=Le("unexpected redirect"):e.redirect==="manual"?t=a:e.redirect==="follow"?t=await Oqe(o,t):Ys(!1)),t.timingInfo=i,t)}function Oqe(o,e){let t=o.request,a=e.internalResponse?e.internalResponse:e,i;try{if(i=Z0e(a,Lt(t).hash),i==null)return e}catch(n){return Promise.resolve(Le(n))}if(!bb(i))return Promise.resolve(Le("URL scheme must be a HTTP(S) scheme"));if(t.redirectCount===20)return Promise.resolve(Le("redirect count exceeded"));if(t.redirectCount+=1,t.mode==="cors"&&(i.username||i.password)&&!uq(t,i))return Promise.resolve(Le('cross origin not allowed for request mode "cors"'));if(t.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(Le('URL cannot contain credentials for request mode "cors"'));if(a.status!==303&&t.body!=null&&t.body.source==null)return Promise.resolve(Le());if([301,302].includes(a.status)&&t.method==="POST"||a.status===303&&!_qe.includes(t.method)){t.method="GET",t.body=null;for(let n of bqe)t.headersList.delete(n)}uq(Lt(t),i)||(t.headersList.delete("authorization",!0),t.headersList.delete("proxy-authorization",!0),t.headersList.delete("cookie",!0),t.headersList.delete("host",!0)),t.body!=null&&(Ys(t.body.source!=null),t.body=yb(t.body.source)[0]);let r=o.timingInfo;return r.redirectEndTime=r.postRedirectStartTime=ld(o.crossOriginIsolatedCapability),r.redirectStartTime===0&&(r.redirectStartTime=r.startTime),t.urlList.push(i),K0e(t,a),fR(o,!0)}async function dq(o,e=!1,t=!1){let a=o.request,i=null,r=null,n=null,s=null,c=!1;a.window==="no-window"&&a.redirect==="error"?(i=o,r=a):(r=F0e(a),i={...o},i.request=r);let m=a.credentials==="include"||a.credentials==="same-origin"&&a.responseTainting==="basic",l=r.body?r.body.length:null,u=null;if(r.body==null&&["POST","PUT"].includes(r.method)&&(u="0"),l!=null&&(u=hb(`${l}`)),u!=null&&!r.headersList.contains("content-length",!0)&&r.headersList.append("content-length",u,!0),l!=null&&r.keepalive,pq.is.URL(r.referrer)&&r.headersList.append("referer",hb(r.referrer.href),!0),W0e(r),eqe(r),r.headersList.contains("user-agent",!0)||r.headersList.append("user-agent",Dqe,!0),r.cache==="default"&&(r.headersList.contains("if-modified-since",!0)||r.headersList.contains("if-none-match",!0)||r.headersList.contains("if-unmodified-since",!0)||r.headersList.contains("if-match",!0)||r.headersList.contains("if-range",!0))&&(r.cache="no-store"),r.cache==="no-cache"&&!r.preventNoCacheCacheControlHeaderModification&&!r.headersList.contains("cache-control",!0)&&r.headersList.append("cache-control","max-age=0",!0),(r.cache==="no-store"||r.cache==="reload")&&(r.headersList.contains("pragma",!0)||r.headersList.append("pragma","no-cache",!0),r.headersList.contains("cache-control",!0)||r.headersList.append("cache-control","no-cache",!0)),r.headersList.contains("range",!0)&&r.headersList.append("accept-encoding","identity",!0),r.headersList.contains("accept-encoding",!0)||(cqe(Lt(r))?r.headersList.append("accept-encoding","br, gzip, deflate",!0):r.headersList.append("accept-encoding","gzip, deflate",!0)),r.headersList.delete("host",!0),m&&!r.headersList.contains("authorization",!0)){let d=null;if(!(pqe(r)&&(r.useURLCredentials===void 0||!nR(Lt(r))))){if(nR(Lt(r))&&e){let{username:g,password:h}=Lt(r);d=`Basic ${Buffer.from(`${g}:${h}`).toString("base64")}`}}d!==null&&r.headersList.append("Authorization",d,!1)}if(s==null&&(r.cache="no-store"),r.cache!=="no-store"&&r.cache,n==null){if(r.cache==="only-if-cached")return Le("only if cached");let d=await Uqe(i,m,t);!fqe.has(r.method)&&d.status>=200&&d.status<=399,c&&d.status,n==null&&(n=d)}if(n.urlList=[...r.urlList],r.headersList.contains("range",!0)&&(n.rangeRequested=!0),n.requestIncludesCredentials=m,n.status===401&&r.responseTainting!=="cors"&&m&&(a.useURLCredentials!==void 0||hqe(a.traversableForUserPrompts))){if(a.body!=null){if(a.body.source==null)return n;a.body=yb(a.body.source)[0]}if(a.useURLCredentials===void 0||e)return Tn(o)?md(o):n;o.controller.connection.destroy(),n=await dq(o,!0)}if(n.status===407)return a.window==="no-window"?Le():Tn(o)?md(o):Le("proxy authentication required");if(n.status===421&&!t&&(a.body==null||a.body.source!=null)){if(Tn(o))return md(o);o.controller.connection.destroy(),n=await dq(o,e,!0)}return n}async function Uqe(o,e=!1,t=!1){Ys(!o.controller.connection||o.controller.connection.destroyed),o.controller.connection={abort:null,destroyed:!1,destroy(h,k=!0){this.destroyed||(this.destroyed=!0,k&&this.abort?.(h??new DOMException("The operation was aborted.","AbortError")))}};let a=o.request,i=null,r=o.timingInfo;null==null&&(a.cache="no-store");let s=t?"yes":"no";a.mode;let c=null;if(a.body==null&&o.processRequestEndOfBody)queueMicrotask(()=>o.processRequestEndOfBody());else if(a.body!=null){let h=async function*(x){Tn(o)||(yield x,o.processRequestBodyChunkLength?.(x.byteLength))},k=()=>{Tn(o)||o.processRequestEndOfBody&&o.processRequestEndOfBody()},w=x=>{Tn(o)||(x.name==="AbortError"?o.controller.abort():o.controller.terminate(x))};c=(async function*(){try{for await(let x of a.body.stream)yield*h(x);k()}catch(x){w(x)}})()}try{let{body:h,status:k,statusText:w,headersList:x,socket:E}=await g({body:c});if(E)i=gb({status:k,statusText:w,headersList:x,socket:E});else{let q=h[Symbol.asyncIterator]();o.controller.next=()=>q.next(),i=gb({status:k,statusText:w,headersList:x})}}catch(h){return h.name==="AbortError"?(o.controller.connection.destroy(),md(o,h)):Le(h)}let m=()=>o.controller.resume(),l=h=>{Tn(o)||o.controller.abort(h)},u=new ReadableStream({start(h){o.controller.controller=h},pull:m,cancel:l,type:"bytes"});i.body={stream:u,source:null,length:null},o.controller.resume||o.controller.on("terminated",d),o.controller.resume=async()=>{for(;;){let h,k;try{let{done:x,value:E}=await o.controller.next();if(rR(o))break;h=x?void 0:E}catch(x){o.controller.ended&&!r.encodedBodySize?h=void 0:(h=x,k=!0)}if(h===void 0){nqe(o.controller.controller),Nqe(o,i);return}if(r.decodedBodySize+=h?.byteLength??0,k){o.controller.terminate(h);return}let w=new Uint8Array(h);if(w.byteLength&&o.controller.controller.enqueue(w),xqe(u)){o.controller.terminate();return}if(o.controller.controller.desiredSize<=0)return}};function d(h){rR(o)?(i.aborted=!0,pb(u)&&o.controller.controller.error(o.controller.serializedAbortReason)):pb(u)&&o.controller.controller.error(new TypeError("terminated",{cause:iqe(h)?h:void 0})),o.controller.connection.destroy()}return i;function g({body:h}){let k=Lt(a),w=o.controller.dispatcher,x=k.pathname+k.search,E=k.search.length===0&&k.href[k.href.length-k.hash.length-1]==="?";return new Promise((q,_)=>w.dispatch({path:E?`${x}?`:x,origin:k.origin,method:a.method,body:w.isMockActive?a.body&&(a.body.source||a.body.stream):h,headers:a.headersList.entries,maxRedirections:0,upgrade:a.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(D){let{connection:H}=o.controller;r.finalConnectionTimingInfo=mqe(void 0,r.postRedirectStartTime,o.crossOriginIsolatedCapability),H.destroyed?D(new DOMException("The operation was aborted.","AbortError")):(o.controller.on("terminated",D),this.abort=H.abort=D),r.finalNetworkRequestStartTime=ld(o.crossOriginIsolatedCapability)},onResponseStarted(){r.finalNetworkResponseStartTime=ld(o.crossOriginIsolatedCapability)},onHeaders(D,H,J,X){if(D<200)return!1;let Y=new sq;for(let qo=0;qo<H.length;qo+=2){let cr=cR(H[qo]),$t=H[qo+1];if(Array.isArray($t)&&!Buffer.isBuffer(H[qo+1]))for(let Gn of $t)Y.append(cr,Gn.toString("latin1"),!0);else Y.append(cr,$t.toString("latin1"),!0)}let ve=Y.get("location",!0);this.body=new Aqe({read:J});let xe=ve&&a.redirect==="follow"&&uR.has(D),He=[];if(a.method!=="HEAD"&&a.method!=="CONNECT"&&!dR.includes(D)&&!xe){let qo=Y.get("content-encoding",!0),cr=qo?qo.toLowerCase().split(","):[],$t=5;if(cr.length>$t)return _(new Error(`too many content-encodings in response: ${cr.length}, maximum allowed is ${$t}`)),!0;for(let Gn=cr.length-1;Gn>=0;--Gn){let Vn=cr[Gn].trim();if(Vn==="x-gzip"||Vn==="gzip")He.push(Ta.createGunzip({flush:Ta.constants.Z_SYNC_FLUSH,finishFlush:Ta.constants.Z_SYNC_FLUSH}));else if(Vn==="deflate")He.push(dqe({flush:Ta.constants.Z_SYNC_FLUSH,finishFlush:Ta.constants.Z_SYNC_FLUSH}));else if(Vn==="br")He.push(Ta.createBrotliDecompress({flush:Ta.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ta.constants.BROTLI_OPERATION_FLUSH}));else if(Vn==="zstd"&&Qqe)He.push(Ta.createZstdDecompress({flush:Ta.constants.ZSTD_e_continue,finishFlush:Ta.constants.ZSTD_e_end}));else{He.length=0;break}}}let Jo=this.onError.bind(this);return q({status:D,statusText:X,headersList:Y,body:He.length?vqe(this.body,...He,qo=>{qo&&this.onError(qo)}).on("error",Jo):this.body.on("error",Jo)}),!0},onData(D){if(o.controller.dump)return;let H=D;return r.encodedBodySize+=H.byteLength,this.body.push(H)},onComplete(){this.abort&&o.controller.off("terminated",this.abort),o.controller.ended=!0,this.body.push(null)},onError(D){this.abort&&o.controller.off("terminated",this.abort),this.body?.destroy(D),o.controller.terminate(D),_(D)},onRequestUpgrade(D,H,J,X){if(X.session!=null&&H!==200||X.session==null&&H!==101)return!1;let Y=new sq;for(let[ve,xe]of Object.entries(J)){if(xe==null)continue;let He=ve.toLowerCase();if(Array.isArray(xe))for(let Jo of xe)Y.append(He,String(Jo),!0);else Y.append(He,String(xe),!0)}return q({status:H,statusText:mR[H],headersList:Y,socket:X}),!0},onUpgrade(D,H,J){if(J.session!=null&&D!==200||J.session==null&&D!==101)return!1;let X=new sq;for(let Y=0;Y<H.length;Y+=2){let ve=cR(H[Y]),xe=H[Y+1];if(Array.isArray(xe)&&!Buffer.isBuffer(H[Y+1]))for(let He of xe)X.append(ve,He.toString("latin1"),!0);else X.append(ve,xe.toString("latin1"),!0)}return q({status:D,statusText:mR[D],headersList:X,socket:J}),!0}}))}}yR.exports={fetch:Rqe,Fetch:fb,fetching:hR,finalizeAndReportTiming:gR}});var vR=f((e8e,AR)=>{"use strict";var Mqe=require("assert"),{URLSerializer:kR}=ma(),{isValidHeaderName:Lqe}=_t();function Pqe(o,e,t=!1){let a=kR(o,t),i=kR(e,t);return a===i}function Fqe(o){Mqe(o!==null);let e=[];for(let t of o.split(","))t=t.trim(),Lqe(t)&&e.push(t);return e}AR.exports={urlEquals:Pqe,getFieldValues:Fqe}});var qR=f((o8e,zR)=>{"use strict";var hq=require("assert"),{kConstruct:$qe}=Ue(),{urlEquals:Hqe,getFieldValues:fq}=vR(),{kEnumerableProperty:Js,isDisturbed:Gqe}=be(),{webidl:K}=To(),{cloneResponse:wR,fromInnerResponse:Vqe,getResponseState:Yqe}=cd(),{Request:dd,fromInnerRequest:Jqe,getRequestState:or}=xm(),{fetching:Wqe}=ud(),{urlIsHttpHttpsScheme:kb,readAllBytes:Zqe}=_t(),{createDeferredPromise:zm}=zu(),Ab=class o{#e;constructor(){arguments[0]!==$qe&&K.illegalConstructor(),K.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,t={}){K.brandCheck(this,o);let a="Cache.match";K.argumentLengthCheck(arguments,1,a),e=K.converters.RequestInfo(e),t=K.converters.CacheQueryOptions(t,a,"options");let i=this.#r(e,t,1);if(i.length!==0)return i[0]}async matchAll(e=void 0,t={}){K.brandCheck(this,o);let a="Cache.matchAll";return e!==void 0&&(e=K.converters.RequestInfo(e)),t=K.converters.CacheQueryOptions(t,a,"options"),this.#r(e,t)}async add(e){K.brandCheck(this,o),K.argumentLengthCheck(arguments,1,"Cache.add"),e=K.converters.RequestInfo(e);let a=[e];return await this.addAll(a)}async addAll(e){K.brandCheck(this,o);let t="Cache.addAll";K.argumentLengthCheck(arguments,1,t);let a=[],i=[];for(let d of e){if(d===void 0)throw K.errors.conversionFailed({prefix:t,argument:"Argument 1",types:["undefined is not allowed"]});if(d=K.converters.RequestInfo(d),typeof d=="string")continue;let g=or(d);if(!kb(g.url)||g.method!=="GET")throw K.errors.exception({header:t,message:"Expected http/s scheme when method is not GET."})}let r=[];for(let d of e){let g=or(new dd(d));if(!kb(g.url))throw K.errors.exception({header:t,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",i.push(g);let h=zm();r.push(Wqe({request:g,processResponse(k){if(k.type==="error"||k.status===206||k.status<200||k.status>299)h.reject(K.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(k.headersList.contains("vary")){let w=fq(k.headersList.get("vary"));for(let x of w)if(x==="*"){h.reject(K.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let E of r)E.abort();return}}},processResponseEndOfBody(k){if(k.aborted){h.reject(new DOMException("aborted","AbortError"));return}h.resolve(k)}})),a.push(h.promise)}let s=await Promise.all(a),c=[],m=0;for(let d of s){let g={type:"put",request:i[m],response:d};c.push(g),m++}let l=zm(),u=null;try{this.#o(c)}catch(d){u=d}return queueMicrotask(()=>{u===null?l.resolve(void 0):l.reject(u)}),l.promise}async put(e,t){K.brandCheck(this,o);let a="Cache.put";K.argumentLengthCheck(arguments,2,a),e=K.converters.RequestInfo(e),t=K.converters.Response(t,a,"response");let i=null;if(K.is.Request(e)?i=or(e):i=or(new dd(e)),!kb(i.url)||i.method!=="GET")throw K.errors.exception({header:a,message:"Expected an http/s scheme when method is not GET"});let r=Yqe(t);if(r.status===206)throw K.errors.exception({header:a,message:"Got 206 status"});if(r.headersList.contains("vary")){let g=fq(r.headersList.get("vary"));for(let h of g)if(h==="*")throw K.errors.exception({header:a,message:"Got * vary field value"})}if(r.body&&(Gqe(r.body.stream)||r.body.stream.locked))throw K.errors.exception({header:a,message:"Response body is locked or disturbed"});let n=wR(r),s=zm();if(r.body!=null){let h=r.body.stream.getReader();Zqe(h,s.resolve,s.reject)}else s.resolve(void 0);let c=[],m={type:"put",request:i,response:n};c.push(m);let l=await s.promise;n.body!=null&&(n.body.source=l);let u=zm(),d=null;try{this.#o(c)}catch(g){d=g}return queueMicrotask(()=>{d===null?u.resolve():u.reject(d)}),u.promise}async delete(e,t={}){K.brandCheck(this,o);let a="Cache.delete";K.argumentLengthCheck(arguments,1,a),e=K.converters.RequestInfo(e),t=K.converters.CacheQueryOptions(t,a,"options");let i=null;if(K.is.Request(e)){if(i=or(e),i.method!=="GET"&&!t.ignoreMethod)return!1}else hq(typeof e=="string"),i=or(new dd(e));let r=[],n={type:"delete",request:i,options:t};r.push(n);let s=zm(),c=null,m;try{m=this.#o(r)}catch(l){c=l}return queueMicrotask(()=>{c===null?s.resolve(!!m?.length):s.reject(c)}),s.promise}async keys(e=void 0,t={}){K.brandCheck(this,o);let a="Cache.keys";e!==void 0&&(e=K.converters.RequestInfo(e)),t=K.converters.CacheQueryOptions(t,a,"options");let i=null;if(e!==void 0)if(K.is.Request(e)){if(i=or(e),i.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(i=or(new dd(e)));let r=zm(),n=[];if(e===void 0)for(let s of this.#e)n.push(s[0]);else{let s=this.#a(i,t);for(let c of s)n.push(c[0])}return queueMicrotask(()=>{let s=[];for(let c of n){let m=Jqe(c,void 0,new AbortController().signal,"immutable");s.push(m)}r.resolve(Object.freeze(s))}),r.promise}#o(e){let t=this.#e,a=[...t],i=[],r=[];try{for(let n of e){if(n.type!=="delete"&&n.type!=="put")throw K.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(n.type==="delete"&&n.response!=null)throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#a(n.request,n.options,i).length)throw new DOMException("???","InvalidStateError");let s;if(n.type==="delete"){if(s=this.#a(n.request,n.options),s.length===0)return[];for(let c of s){let m=t.indexOf(c);hq(m!==-1),t.splice(m,1)}}else if(n.type==="put"){if(n.response==null)throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let c=n.request;if(!kb(c.url))throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(c.method!=="GET")throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(n.options!=null)throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});s=this.#a(n.request);for(let m of s){let l=t.indexOf(m);hq(l!==-1),t.splice(l,1)}t.push([n.request,n.response]),i.push([n.request,n.response])}r.push([n.request,n.response])}return r}catch(n){throw this.#e.length=0,this.#e=a,n}}#a(e,t,a){let i=[],r=a??this.#e;for(let n of r){let[s,c]=n;this.#i(e,s,c,t)&&i.push(n)}return i}#i(e,t,a=null,i){let r=new URL(e.url),n=new URL(t.url);if(i?.ignoreSearch&&(n.search="",r.search=""),!Hqe(r,n,!0))return!1;if(a==null||i?.ignoreVary||!a.headersList.contains("vary"))return!0;let s=fq(a.headersList.get("vary"));for(let c of s){if(c==="*")return!1;let m=t.headersList.get(c),l=e.headersList.get(c);if(m!==l)return!1}return!0}#r(e,t,a=1/0){let i=null;if(e!==void 0)if(K.is.Request(e)){if(i=or(e),i.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(i=or(new dd(e)));let r=[];if(e===void 0)for(let s of this.#e)r.push(s[1]);else{let s=this.#a(i,t);for(let c of s)r.push(c[1])}let n=[];for(let s of r){let c=Vqe(wR(s),"immutable");if(n.push(c),n.length>=a)break}return Object.freeze(n)}};Object.defineProperties(Ab.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:Js,matchAll:Js,add:Js,addAll:Js,put:Js,delete:Js,keys:Js});var xR=[{key:"ignoreSearch",converter:K.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:K.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:K.converters.boolean,defaultValue:()=>!1}];K.converters.CacheQueryOptions=K.dictionaryConverter(xR);K.converters.MultiCacheQueryOptions=K.dictionaryConverter([...xR,{key:"cacheName",converter:K.converters.DOMString}]);K.converters.Response=K.interfaceConverter(K.is.Response,"Response");K.converters["sequence<RequestInfo>"]=K.sequenceConverter(K.converters.RequestInfo);zR.exports={Cache:Ab}});var IR=f((t8e,ER)=>{"use strict";var{Cache:vb}=qR(),{webidl:Go}=To(),{kEnumerableProperty:gd}=be(),{kConstruct:pd}=Ue(),wb=class o{#e=new Map;constructor(){arguments[0]!==pd&&Go.illegalConstructor(),Go.util.markAsUncloneable(this)}async match(e,t={}){if(Go.brandCheck(this,o),Go.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=Go.converters.RequestInfo(e),t=Go.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let a=this.#e.get(t.cacheName);return await new vb(pd,a).match(e,t)}}else for(let a of this.#e.values()){let r=await new vb(pd,a).match(e,t);if(r!==void 0)return r}}async has(e){Go.brandCheck(this,o);let t="CacheStorage.has";return Go.argumentLengthCheck(arguments,1,t),e=Go.converters.DOMString(e,t,"cacheName"),this.#e.has(e)}async open(e){Go.brandCheck(this,o);let t="CacheStorage.open";if(Go.argumentLengthCheck(arguments,1,t),e=Go.converters.DOMString(e,t,"cacheName"),this.#e.has(e)){let i=this.#e.get(e);return new vb(pd,i)}let a=[];return this.#e.set(e,a),new vb(pd,a)}async delete(e){Go.brandCheck(this,o);let t="CacheStorage.delete";return Go.argumentLengthCheck(arguments,1,t),e=Go.converters.DOMString(e,t,"cacheName"),this.#e.delete(e)}async keys(){return Go.brandCheck(this,o),[...this.#e.keys()]}};Object.defineProperties(wb.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:gd,has:gd,open:gd,delete:gd,keys:gd});ER.exports={CacheStorage:wb}});var CR=f((a8e,jR)=>{"use strict";jR.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var kq=f((i8e,_R)=>{"use strict";function Kqe(o){for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t>=0&&t<=8||t>=10&&t<=31||t===127)return!0}return!1}function bq(o){for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t<33||t>126||t===34||t===40||t===41||t===60||t===62||t===64||t===44||t===59||t===58||t===92||t===47||t===91||t===93||t===63||t===61||t===123||t===125)throw new Error("Invalid cookie name")}}function yq(o){let e=o.length,t=0;if(o[0]==='"'){if(e===1||o[e-1]!=='"')throw new Error("Invalid cookie value");--e,++t}for(;t<e;){let a=o.charCodeAt(t++);if(a<33||a>126||a===34||a===44||a===59||a===92)throw new Error("Invalid cookie value")}}function BR(o){for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t<32||t>126||t===59)throw new Error("Invalid cookie path")}}function SR(o){return o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122}function Xqe(o){if(o===" ")return;if(o.length>255)throw new Error("Invalid cookie domain");let e=0;for(let t=0;t<o.length;++t){let a=o.charCodeAt(t);if(a===46){if(e===0)throw new Error("Invalid cookie domain");if(o.charCodeAt(t-1)===45)throw new Error("Invalid cookie domain");e=0;continue}if(e===0&&!SR(a))throw new Error("Invalid cookie domain");if(!SR(a)&&a!==45)throw new Error("Invalid cookie domain");if(++e>63)throw new Error("Invalid cookie domain")}if(e===0||o.charCodeAt(o.length-1)===45)throw new Error("Invalid cookie domain")}var eEe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],oEe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xb=Array(61).fill(0).map((o,e)=>e.toString().padStart(2,"0"));function QR(o){return typeof o=="number"&&(o=new Date(o)),`${eEe[o.getUTCDay()]}, ${xb[o.getUTCDate()]} ${oEe[o.getUTCMonth()]} ${o.getUTCFullYear()} ${xb[o.getUTCHours()]}:${xb[o.getUTCMinutes()]}:${xb[o.getUTCSeconds()]} GMT`}function tEe(o){if(o<0)throw new Error("Invalid cookie max-age")}function aEe(o){if(o.name.length===0)return null;bq(o.name),yq(o.value);let e=[`${o.name}=${o.value}`];o.name.startsWith("__Secure-")&&(o.secure=!0),o.name.startsWith("__Host-")&&(o.secure=!0,o.domain=null,o.path="/"),o.secure&&e.push("Secure"),o.httpOnly&&e.push("HttpOnly"),typeof o.maxAge=="number"&&(tEe(o.maxAge),e.push(`Max-Age=${o.maxAge}`)),o.domain&&(Xqe(o.domain),e.push(`Domain=${o.domain}`)),o.path&&(BR(o.path),e.push(`Path=${o.path}`)),o.expires&&o.expires.toString()!=="Invalid Date"&&e.push(`Expires=${QR(o.expires)}`),o.sameSite&&e.push(`SameSite=${o.sameSite}`);for(let t of o.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");let[a,...i]=t.split("="),r=a.trim(),n=i.join("=");bq(r),yq(n),e.push(`${r}=${n}`)}return e.join("; ")}_R.exports={isCTLExcludingHtab:Kqe,validateCookieName:bq,validateCookiePath:BR,validateCookieValue:yq,toIMFDate:QR,stringify:aEe}});var TR=f((r8e,DR)=>{"use strict";var{collectASequenceOfCodePointsFast:zb}=Er(),{maxNameValuePairSize:iEe,maxAttributeValueSize:rEe}=CR(),{isCTLExcludingHtab:nEe}=kq(),sEe=require("assert");function cEe(o){if(nEe(o))return null;let e="",t="",a="",i="";if(o.includes(";")){let r={position:0};e=zb(";",o,r),t=o.slice(r.position)}else e=o;if(!e.includes("="))i=e;else{let r={position:0};a=zb("=",e,r),i=e.slice(r.position+1)}return a=a.trim(),i=i.trim(),a.length+i.length>iEe?null:{name:a,value:i,...qm(t)}}function qm(o,e={}){if(o.length===0)return e;sEe(o[0]===";"),o=o.slice(1);let t="";o.includes(";")?(t=zb(";",o,{position:0}),o=o.slice(t.length)):(t=o,o="");let a="",i="";if(t.includes("=")){let n={position:0};a=zb("=",t,n),i=t.slice(n.position+1)}else a=t;if(a=a.trim(),i=i.trim(),i.length>rEe)return qm(o,e);let r=a.toLowerCase();if(r==="expires"){let n=new Date(i);e.expires=n}else if(r==="max-age"){let n=i.charCodeAt(0);if((n<48||n>57)&&i[0]!=="-"||!/^\d+$/.test(i))return qm(o,e);let s=Number(i);e.maxAge=s}else if(r==="domain"){let n=i;n[0]==="."&&(n=n.slice(1)),n=n.toLowerCase(),e.domain=n}else if(r==="path"){let n="";i.length===0||i[0]!=="/"?n="/":n=i,e.path=n}else if(r==="secure")e.secure=!0;else if(r==="httponly")e.httpOnly=!0;else if(r==="samesite"){let n=i.toLowerCase();n==="none"?e.sameSite="None":n==="strict"?e.sameSite="Strict":n==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${a}=${i}`);return qm(o,e)}DR.exports={parseSetCookie:cEe,parseUnparsedAttributes:qm}});var UR=f((n8e,OR)=>{"use strict";var{parseSetCookie:RR}=TR(),{stringify:mEe}=kq(),{webidl:je}=To(),{Headers:lEe}=Hs(),qb=je.brandCheckMultiple([lEe,globalThis.Headers].filter(Boolean));function uEe(o){je.argumentLengthCheck(arguments,1,"getCookies"),qb(o);let e=o.get("cookie"),t={};if(!e)return t;for(let a of e.split(";")){let[i,...r]=a.split("=");t[i.trim()]=r.join("=")}return t}function dEe(o,e,t){qb(o);let a="deleteCookie";je.argumentLengthCheck(arguments,2,a),e=je.converters.DOMString(e,a,"name"),t=je.converters.DeleteCookieAttributes(t),NR(o,{name:e,value:"",expires:new Date(0),...t})}function gEe(o){je.argumentLengthCheck(arguments,1,"getSetCookies"),qb(o);let e=o.getSetCookie();return e?e.map(t=>RR(t)):[]}function pEe(o){return o=je.converters.DOMString(o),RR(o)}function NR(o,e){je.argumentLengthCheck(arguments,2,"setCookie"),qb(o),e=je.converters.Cookie(e);let t=mEe(e);t&&o.append("set-cookie",t,!0)}je.converters.DeleteCookieAttributes=je.dictionaryConverter([{converter:je.nullableConverter(je.converters.DOMString),key:"path",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.DOMString),key:"domain",defaultValue:()=>null}]);je.converters.Cookie=je.dictionaryConverter([{converter:je.converters.DOMString,key:"name"},{converter:je.converters.DOMString,key:"value"},{converter:je.nullableConverter(o=>typeof o=="number"?je.converters["unsigned long long"](o):new Date(o)),key:"expires",defaultValue:()=>null},{converter:je.nullableConverter(je.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.DOMString),key:"path",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.boolean),key:"secure",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:je.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:je.sequenceConverter(je.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]);OR.exports={getCookies:uEe,deleteCookie:dEe,getSetCookies:gEe,setCookie:NR,parseCookie:pEe}});var jb=f((s8e,LR)=>{"use strict";var{webidl:ee}=To(),{kEnumerableProperty:bt}=be(),{kConstruct:MR}=Ue(),Em=class o extends Event{#e;constructor(e,t={}){if(e===MR){super(arguments[1],arguments[2]),ee.util.markAsUncloneable(this);return}let a="MessageEvent constructor";ee.argumentLengthCheck(arguments,1,a),e=ee.converters.DOMString(e,a,"type"),t=ee.converters.MessageEventInit(t,a,"eventInitDict"),super(e,t),this.#e=t,ee.util.markAsUncloneable(this)}get data(){return ee.brandCheck(this,o),this.#e.data}get origin(){return ee.brandCheck(this,o),this.#e.origin}get lastEventId(){return ee.brandCheck(this,o),this.#e.lastEventId}get source(){return ee.brandCheck(this,o),this.#e.source}get ports(){return ee.brandCheck(this,o),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,a=!1,i=null,r="",n="",s=null,c=[]){return ee.brandCheck(this,o),ee.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new o(e,{bubbles:t,cancelable:a,data:i,origin:r,lastEventId:n,source:s,ports:c})}static createFastMessageEvent(e,t){let a=new o(MR,e,t);return a.#e=t,a.#e.data??=null,a.#e.origin??="",a.#e.lastEventId??="",a.#e.source??=null,a.#e.ports??=[],a}},{createFastMessageEvent:hEe}=Em;delete Em.createFastMessageEvent;var Eb=class o extends Event{#e;constructor(e,t={}){let a="CloseEvent constructor";ee.argumentLengthCheck(arguments,1,a),e=ee.converters.DOMString(e,a,"type"),t=ee.converters.CloseEventInit(t),super(e,t),this.#e=t,ee.util.markAsUncloneable(this)}get wasClean(){return ee.brandCheck(this,o),this.#e.wasClean}get code(){return ee.brandCheck(this,o),this.#e.code}get reason(){return ee.brandCheck(this,o),this.#e.reason}},Ib=class o extends Event{#e;constructor(e,t){let a="ErrorEvent constructor";ee.argumentLengthCheck(arguments,1,a),super(e,t),ee.util.markAsUncloneable(this),e=ee.converters.DOMString(e,a,"type"),t=ee.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return ee.brandCheck(this,o),this.#e.message}get filename(){return ee.brandCheck(this,o),this.#e.filename}get lineno(){return ee.brandCheck(this,o),this.#e.lineno}get colno(){return ee.brandCheck(this,o),this.#e.colno}get error(){return ee.brandCheck(this,o),this.#e.error}};Object.defineProperties(Em.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:bt,origin:bt,lastEventId:bt,source:bt,ports:bt,initMessageEvent:bt});Object.defineProperties(Eb.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:bt,code:bt,wasClean:bt});Object.defineProperties(Ib.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:bt,filename:bt,lineno:bt,colno:bt,error:bt});ee.converters.MessagePort=ee.interfaceConverter(ee.is.MessagePort,"MessagePort");ee.converters["sequence<MessagePort>"]=ee.sequenceConverter(ee.converters.MessagePort);var Aq=[{key:"bubbles",converter:ee.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:ee.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:ee.converters.boolean,defaultValue:()=>!1}];ee.converters.MessageEventInit=ee.dictionaryConverter([...Aq,{key:"data",converter:ee.converters.any,defaultValue:()=>null},{key:"origin",converter:ee.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:ee.converters.DOMString,defaultValue:()=>""},{key:"source",converter:ee.nullableConverter(ee.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:ee.converters["sequence<MessagePort>"],defaultValue:()=>[]}]);ee.converters.CloseEventInit=ee.dictionaryConverter([...Aq,{key:"wasClean",converter:ee.converters.boolean,defaultValue:()=>!1},{key:"code",converter:ee.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:ee.converters.USVString,defaultValue:()=>""}]);ee.converters.ErrorEventInit=ee.dictionaryConverter([...Aq,{key:"message",converter:ee.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:ee.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:ee.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:ee.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:ee.converters.any}]);LR.exports={MessageEvent:Em,CloseEvent:Eb,ErrorEvent:Ib,createFastMessageEvent:hEe}});var Rn=f((c8e,PR)=>{"use strict";var fEe="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",bEe={enumerable:!0,writable:!1,configurable:!1},yEe={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},kEe={SENT:1,RECEIVED:2},AEe={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},vEe=65535,wEe={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},xEe=Buffer.allocUnsafe(0),zEe={text:1,typedArray:2,arrayBuffer:3,blob:4};PR.exports={uid:fEe,sentCloseFrameState:kEe,staticPropertyDescriptors:bEe,states:yEe,opcodes:AEe,maxUnsigned16Bit:vEe,parserStates:wEe,emptyBuffer:xEe,sendHints:zEe}});var Ws=f((m8e,VR)=>{"use strict";var{states:Cb,opcodes:Im}=Rn(),{isUtf8:qEe}=require("buffer"),{removeHTTPWhitespace:FR}=ma(),{collectASequenceOfCodePointsFast:EEe}=Er();function IEe(o){return o===Cb.CONNECTING}function jEe(o){return o===Cb.OPEN}function CEe(o){return o===Cb.CLOSING}function SEe(o){return o===Cb.CLOSED}function BEe(o,e,t=(i,r)=>new Event(i,r),a={}){let i=t(o,a);e.dispatchEvent(i)}function QEe(o,e,t){o.onMessage(e,t)}function _Ee(o){return o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer}function DEe(o){if(o.length===0)return!1;for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t<33||t>126||t===34||t===40||t===41||t===44||t===47||t===58||t===59||t===60||t===61||t===62||t===63||t===64||t===91||t===92||t===93||t===123||t===125)return!1}return!0}function TEe(o){return o>=1e3&&o<1015?o!==1004&&o!==1005&&o!==1006:o>=3e3&&o<=4999}function $R(o){return o===Im.CLOSE||o===Im.PING||o===Im.PONG}function HR(o){return o===Im.CONTINUATION}function GR(o){return o===Im.TEXT||o===Im.BINARY}function REe(o){return GR(o)||HR(o)||$R(o)}function NEe(o){let e={position:0},t=new Map;for(;e.position<o.length;){let a=EEe(";",o,e),[i,r=""]=a.split("=",2);t.set(FR(i,!0,!1),FR(r,!1,!0)),e.position++}return t}function OEe(o){if(o.length===0)return!1;for(let t=0;t<o.length;t++){let a=o.charCodeAt(t);if(a<48||a>57)return!1}let e=Number.parseInt(o,10);return e>=8&&e<=15}function UEe(o,e){let t;try{t=new URL(o,e)}catch(a){throw new DOMException(a,"SyntaxError")}if(t.protocol==="http:"?t.protocol="ws:":t.protocol==="https:"&&(t.protocol="wss:"),t.protocol!=="ws:"&&t.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(t.hash.length||t.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return t}function MEe(o,e){if(o!==null&&o!==1e3&&(o<3e3||o>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let t=Buffer.byteLength(e);if(t>123)throw new DOMException(`Reason must be less than 123 bytes; received ${t}`,"SyntaxError")}}var LEe=(()=>{if(typeof process.versions.icu=="string"){let o=new TextDecoder("utf-8",{fatal:!0});return o.decode.bind(o)}return function(o){if(qEe(o))return o.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();VR.exports={isConnecting:IEe,isEstablished:jEe,isClosing:CEe,isClosed:SEe,fireEvent:BEe,isValidSubprotocol:DEe,isValidStatusCode:TEe,websocketMessageReceived:QEe,utf8Decode:LEe,isControlFrame:$R,isContinuationFrame:HR,isTextBinaryFrame:GR,isValidOpcode:REe,parseExtensions:NEe,isValidClientWindowBits:OEe,toArrayBuffer:_Ee,getURLRecord:UEe,validateCloseCodeAndReason:MEe}});var Cm=f((l8e,JR)=>{"use strict";var{runtimeFeatures:PEe}=Ir(),{maxUnsigned16Bit:YR,opcodes:FEe}=Rn(),Sb=8*1024,hd=null,jm=Sb,$Ee=PEe.has("crypto")?require("crypto").randomFillSync:function(e,t,a){for(let i=0;i<e.length;++i)e[i]=Math.random()*255|0;return e};function vq(){return jm===Sb&&(jm=0,$Ee(hd??=Buffer.allocUnsafeSlow(Sb),0,Sb)),[hd[jm++],hd[jm++],hd[jm++],hd[jm++]]}var wq=class{constructor(e){this.frameData=e}createFrame(e){let t=this.frameData,a=vq(),i=t?.byteLength??0,r=i,n=6;i>YR?(n+=8,r=127):i>125&&(n+=2,r=126);let s=Buffer.allocUnsafe(i+n);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e;s[n-4]=a[0],s[n-3]=a[1],s[n-2]=a[2],s[n-1]=a[3],s[1]=r,r===126?s.writeUInt16BE(i,2):r===127&&(s[2]=s[3]=0,s.writeUIntBE(i,4,6)),s[1]|=128;for(let c=0;c<i;++c)s[n+c]=t[c]^a[c&3];return s}static createFastTextFrame(e){let t=vq(),a=e.length;for(let s=0;s<a;++s)e[s]^=t[s&3];let i=a,r=6;a>YR?(r+=8,i=127):a>125&&(r+=2,i=126);let n=Buffer.allocUnsafeSlow(r);return n[0]=128|FEe.TEXT,n[1]=i|128,n[r-4]=t[0],n[r-3]=t[1],n[r-2]=t[2],n[r-1]=t[3],i===126?n.writeUInt16BE(a,2):i===127&&(n[2]=n[3]=0,n.writeUIntBE(a,4,6)),[n,e]}};JR.exports={WebsocketFrameSend:wq,generateMask:vq}});var Bb=f((u8e,oN)=>{"use strict";var{uid:HEe,states:xq,sentCloseFrameState:zq,emptyBuffer:WR,opcodes:GEe}=Rn(),{parseExtensions:VEe,isClosed:YEe,isClosing:JEe,isEstablished:XR,isConnecting:WEe,validateCloseCodeAndReason:ZEe}=Ws(),{makeRequest:KEe}=xm(),{fetching:XEe}=ud(),{Headers:e1e,getHeadersList:o1e}=Hs(),{getDecodeSplit:t1e}=_t(),{WebsocketFrameSend:a1e}=Cm(),i1e=require("assert"),{runtimeFeatures:r1e}=Ir(),ZR=r1e.has("crypto")?require("crypto"):null,KR=!1;function n1e(o,e,t,a,i){let r=o;r.protocol=o.protocol==="ws:"?"http:":"https:";let n=KEe({urlList:[r],client:t,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(i.headers){let l=o1e(new e1e(i.headers));n.headersList=l}let s=ZR.randomBytes(16).toString("base64");n.headersList.append("sec-websocket-key",s,!0),n.headersList.append("sec-websocket-version","13",!0);for(let l of e)n.headersList.append("sec-websocket-protocol",l,!0);return n.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),XEe({request:n,useParallelQueue:!0,dispatcher:i.dispatcher,processResponse(l){if(l.type==="error"||l.status!==101){if(l.socket?.session==null){tr(a,1002,"Received network error or non-101 status code.",l.error);return}if(l.status!==200){tr(a,1002,"Received network error or non-200 status code.",l.error);return}}if(KR===!1&&l.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),KR=!0),e.length!==0&&!l.headersList.get("Sec-WebSocket-Protocol")){tr(a,1002,"Server did not respond with sent protocols.");return}if(l.socket.session==null&&l.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){tr(a,1002,'Server did not set Upgrade header to "websocket".');return}if(l.socket.session==null&&l.headersList.get("Connection")?.toLowerCase()!=="upgrade"){tr(a,1002,'Server did not set Connection header to "upgrade".');return}let u=l.headersList.get("Sec-WebSocket-Accept"),d=ZR.hash("sha1",s+HEe,"base64");if(u!==d){tr(a,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=l.headersList.get("Sec-WebSocket-Extensions"),h;if(g!==null&&(h=VEe(g),!h.has("permessage-deflate"))){tr(a,1002,"Sec-WebSocket-Extensions header does not match.");return}let k=l.headersList.get("Sec-WebSocket-Protocol");if(k!==null&&!t1e("sec-websocket-protocol",n.headersList).includes(k)){tr(a,1002,"Protocol was not set in the opening handshake.");return}l.socket.on("data",a.onSocketData),l.socket.on("close",a.onSocketClose),l.socket.on("error",a.onSocketError),a.wasEverConnected=!0,a.onConnectionEstablished(l,h)}})}function eN(o,e,t,a=!1){if(e??=null,t??="",a&&ZEe(e,t),!(YEe(o.readyState)||JEe(o.readyState)))if(!XR(o.readyState))tr(o),o.readyState=xq.CLOSING;else if(!o.closeState.has(zq.SENT)&&!o.closeState.has(zq.RECEIVED)){let i=new a1e;t.length!==0&&e===null&&(e=1e3),i1e(e===null||Number.isInteger(e)),e===null&&t.length===0?i.frameData=WR:e!==null&&t===null?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==null&&t!==null?(i.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(t)),i.frameData.writeUInt16BE(e,0),i.frameData.write(t,2,"utf-8")):i.frameData=WR,o.socket.write(i.createFrame(GEe.CLOSE)),o.closeState.add(zq.SENT),o.readyState=xq.CLOSING}else o.readyState=xq.CLOSING}function tr(o,e,t,a){XR(o.readyState)&&eN(o,e,t,!1),o.controller.abort(),WEe(o.readyState)?o.onSocketClose():o.socket?.destroyed===!1&&o.socket.destroy()}oN.exports={establishWebSocketConnection:n1e,failWebsocketConnection:tr,closeWebSocketConnection:eN}});var aN=f((d8e,tN)=>{"use strict";var{createInflateRaw:s1e,Z_DEFAULT_WINDOWBITS:c1e}=require("zlib"),{isValidClientWindowBits:m1e}=Ws(),{MessageSizeExceededError:l1e}=ge(),u1e=Buffer.from([0,0,255,255]),Qb=Symbol("kBuffer"),fd=Symbol("kLength"),qq=class{#e;#o={};#a=0;constructor(e,t){this.#o.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#o.serverMaxWindowBits=e.get("server_max_window_bits"),this.#a=t.maxPayloadSize}decompress(e,t,a){if(!this.#e){let i=c1e;if(this.#o.serverMaxWindowBits){if(!m1e(this.#o.serverMaxWindowBits)){a(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#o.serverMaxWindowBits)}try{this.#e=s1e({windowBits:i})}catch(r){a(r);return}this.#e[Qb]=[],this.#e[fd]=0,this.#e.on("data",r=>{if(this.#e[fd]+=r.length,this.#a>0&&this.#e[fd]>this.#a){a(new l1e),this.#e.removeAllListeners(),this.#e=null;return}this.#e[Qb].push(r)}),this.#e.on("error",r=>{this.#e=null,a(r)})}this.#e.write(e),t&&this.#e.write(u1e),this.#e.flush(()=>{if(!this.#e)return;let i=Buffer.concat(this.#e[Qb],this.#e[fd]);this.#e[Qb].length=0,this.#e[fd]=0,a(null,i)})}};tN.exports={PerMessageDeflate:qq}});var Cq=f((g8e,cN)=>{"use strict";var{Writable:d1e}=require("stream"),g1e=require("assert"),{parserStates:yt,opcodes:Sm,states:p1e,emptyBuffer:iN,sentCloseFrameState:bd}=Rn(),{isValidStatusCode:h1e,isValidOpcode:f1e,websocketMessageReceived:rN,utf8Decode:b1e,isControlFrame:Eq,isTextBinaryFrame:Iq,isContinuationFrame:y1e}=Ws(),{failWebsocketConnection:Vo}=Bb(),{WebsocketFrameSend:nN}=Cm(),{PerMessageDeflate:k1e}=aN(),{MessageSizeExceededError:sN}=ge(),jq=class extends d1e{#e=[];#o=0;#a=0;#i=!1;#r=yt.INFO;#t={};#c=[];#n;#s;#m;#u;constructor(e,t,a={}){super(),this.#s=e,this.#n=t??new Map,this.#m=a.maxFragments??0,this.#u=a.maxPayloadSize??0,this.#n.has("permessage-deflate")&&this.#n.set("permessage-deflate",new k1e(t,a))}_write(e,t,a){this.#e.push(e),this.#a+=e.length,this.#i=!0,this.run(a)}#l(){return this.#u>0&&!Eq(this.#t.opcode)&&this.#t.payloadLength+this.#o>this.#u?(Vo(this.#s,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#i;)if(this.#r===yt.INFO){if(this.#a<2)return e();let t=this.consume(2),a=(t[0]&128)!==0,i=t[0]&15,r=(t[1]&128)===128,n=!a&&i!==Sm.CONTINUATION,s=t[1]&127,c=t[0]&64,m=t[0]&32,l=t[0]&16;if(!f1e(i))return Vo(this.#s,1002,"Invalid opcode received"),e();if(r)return Vo(this.#s,1002,"Frame cannot be masked"),e();if(c!==0&&!this.#n.has("permessage-deflate")){Vo(this.#s,1002,"Expected RSV1 to be clear.");return}if(m!==0||l!==0){Vo(this.#s,1002,"RSV1, RSV2, RSV3 must be clear");return}if(n&&!Iq(i)){Vo(this.#s,1002,"Invalid frame type was fragmented.");return}if(Iq(i)&&this.#c.length>0){Vo(this.#s,1002,"Expected continuation frame");return}if(this.#t.fragmented&&n){Vo(this.#s,1002,"Fragmented frame exceeded 125 bytes.");return}if((s>125||n)&&Eq(i)){Vo(this.#s,1002,"Control frame either too large or fragmented");return}if(y1e(i)&&this.#c.length===0&&!this.#t.compressed){Vo(this.#s,1002,"Unexpected continuation frame");return}if(s<=125){if(this.#t.payloadLength=s,this.#r=yt.READ_DATA,!this.#l())return}else s===126?this.#r=yt.PAYLOADLENGTH_16:s===127&&(this.#r=yt.PAYLOADLENGTH_64);Iq(i)&&(this.#t.binaryType=i,this.#t.compressed=c!==0),this.#t.opcode=i,this.#t.masked=r,this.#t.fin=a,this.#t.fragmented=n}else if(this.#r===yt.PAYLOADLENGTH_16){if(this.#a<2)return e();let t=this.consume(2);if(this.#t.payloadLength=t.readUInt16BE(0),this.#r=yt.READ_DATA,!this.#l())return}else if(this.#r===yt.PAYLOADLENGTH_64){if(this.#a<8)return e();let t=this.consume(8),a=t.readUInt32BE(0),i=t.readUInt32BE(4);if(a!==0||i>2**31-1){Vo(this.#s,1009,"Received payload length > 2^31 bytes.");return}if(this.#t.payloadLength=i,this.#r=yt.READ_DATA,!this.#l())return}else if(this.#r===yt.READ_DATA){if(this.#a<this.#t.payloadLength)return e();let t=this.consume(this.#t.payloadLength);if(Eq(this.#t.opcode))this.#i=this.parseControlFrame(t),this.#r=yt.INFO;else if(this.#t.compressed){this.#n.get("permessage-deflate").decompress(t,this.#t.fin,(a,i)=>{if(a){let r=a instanceof sN?1009:1007;Vo(this.#s,r,a.message);return}if(this.writeFragments(i)){if(this.#u>0&&this.#o>this.#u){Vo(this.#s,1009,new sN().message);return}if(!this.#t.fin){this.#r=yt.INFO,this.#i=!0,this.run(e);return}rN(this.#s,this.#t.binaryType,this.consumeFragments()),this.#i=!0,this.#r=yt.INFO,this.run(e)}},this.#o),this.#i=!1;break}else{if(!this.writeFragments(t))return;!this.#t.fragmented&&this.#t.fin&&rN(this.#s,this.#t.binaryType,this.consumeFragments()),this.#r=yt.INFO}}}consume(e){if(e>this.#a)throw new Error("Called consume() before buffers satiated.");if(e===0)return iN;this.#a-=e;let t=this.#e[0];if(t.length>e)return this.#e[0]=t.subarray(e,t.length),t.subarray(0,e);if(t.length===e)return this.#e.shift();{let a=0,i=Buffer.allocUnsafeSlow(e);for(;a!==e;){let r=this.#e[0],n=r.length;if(n+a===e){i.set(this.#e.shift(),a);break}else if(n+a>e){i.set(r.subarray(0,e-a),a),this.#e[0]=r.subarray(e-a);break}else i.set(this.#e.shift(),a),a+=n}return i}}writeFragments(e){return this.#m>0&&this.#c.length===this.#m?(Vo(this.#s,1008,"Too many message fragments"),!1):(this.#o+=e.length,this.#c.push(e),!0)}consumeFragments(){let e=this.#c;if(e.length===1)return this.#o=0,e.shift();let t=0,a=Buffer.allocUnsafeSlow(this.#o);for(let i=0;i<e.length;++i){let r=e[i];a.set(r,t),t+=r.length}return this.#c=[],this.#o=0,a}parseCloseBody(e){g1e(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!h1e(t))return{code:1002,reason:"Invalid status code",error:!0};let a=e.subarray(2);a[0]===239&&a[1]===187&&a[2]===191&&(a=a.subarray(3));try{a=b1e(a)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:t,reason:a,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:a}=this.#t;if(t===Sm.CLOSE){if(a===1)return Vo(this.#s,1002,"Received close frame with a 1-byte body."),!1;if(this.#t.closeInfo=this.parseCloseBody(e),this.#t.closeInfo.error){let{code:i,reason:r}=this.#t.closeInfo;return Vo(this.#s,i,r),!1}if(!this.#s.closeState.has(bd.SENT)&&!this.#s.closeState.has(bd.RECEIVED)){let i=iN;this.#t.closeInfo.code&&(i=Buffer.allocUnsafe(2),i.writeUInt16BE(this.#t.closeInfo.code,0));let r=new nN(i);this.#s.socket.write(r.createFrame(Sm.CLOSE)),this.#s.closeState.add(bd.SENT)}return this.#s.readyState=p1e.CLOSING,this.#s.closeState.add(bd.RECEIVED),!1}else if(t===Sm.PING){if(!this.#s.closeState.has(bd.RECEIVED)){let i=new nN(e);this.#s.socket.write(i.createFrame(Sm.PONG)),this.#s.onPing(e)}}else t===Sm.PONG&&this.#s.onPong(e);return!0}get closingInfo(){return this.#t.closeInfo}};cN.exports={ByteParser:jq}});var dN=f((p8e,uN)=>{"use strict";var{WebsocketFrameSend:lN}=Cm(),{opcodes:mN,sendHints:Zs}=Rn(),A1e=Wx(),Bq=class{#e=new A1e;#o=!1;#a;constructor(e){this.#a=e}add(e,t,a){if(a!==Zs.blob){if(this.#o){let r={promise:null,callback:t,frame:Sq(e,a)};this.#e.push(r)}else if(a===Zs.text){let{0:r,1:n}=lN.createFastTextFrame(e);this.#a.cork(),this.#a.write(r),this.#a.write(n,t),this.#a.uncork()}else this.#a.write(Sq(e,a),t);return}let i={promise:e.arrayBuffer().then(r=>{i.promise=null,i.frame=Sq(r,a)}),callback:t,frame:null};this.#e.push(i),this.#o||this.#i()}async#i(){this.#o=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#a.write(t.frame,t.callback),t.callback=t.frame=null}this.#o=!1}};function Sq(o,e){return new lN(v1e(o,e)).createFrame(e===Zs.text?mN.TEXT:mN.BINARY)}function v1e(o,e){switch(e){case Zs.text:case Zs.typedArray:return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);case Zs.arrayBuffer:case Zs.blob:return new Uint8Array(o)}}uN.exports={SendQueue:Bq}});var yN=f((h8e,bN)=>{"use strict";var{isArrayBuffer:w1e}=require("util/types"),{webidl:ie}=To(),{URLSerializer:x1e}=ma(),{environmentSettingsObject:gN}=_t(),{staticPropertyDescriptors:Nn,states:Or,sentCloseFrameState:Qq,sendHints:_b,opcodes:_q}=Rn(),{isConnecting:z1e,isEstablished:pN,isClosing:hN,isClosed:q1e,isValidSubprotocol:E1e,fireEvent:Db,utf8Decode:I1e,toArrayBuffer:j1e,getURLRecord:C1e}=Ws(),{establishWebSocketConnection:S1e,closeWebSocketConnection:B1e,failWebsocketConnection:fN}=Bb(),{ByteParser:Q1e}=Cq(),{kEnumerableProperty:ba}=be(),{getGlobalDispatcher:_1e}=Zf(),{ErrorEvent:D1e,CloseEvent:T1e,createFastMessageEvent:R1e}=jb(),{SendQueue:N1e}=dN(),{WebsocketFrameSend:O1e}=Cm(),{channels:ar}=hn();function U1e(o){return typeof o?.address=="function"?o.address():typeof o?.session?.socket?.address=="function"?o.session.socket.address():null}var at=class o extends EventTarget{#e={open:null,error:null,close:null,message:null};#o=0;#a="";#i="";#r;#t={onConnectionEstablished:(e,t)=>this.#m(e,t),onMessage:(e,t)=>this.#u(e,t),onParserError:e=>fN(this.#t,null,e.message),onParserDrain:()=>this.#l(),onSocketData:e=>{this.#s.write(e)||this.#t.socket.pause()},onSocketError:e=>{this.#t.readyState=Or.CLOSING,ar.socketError.hasSubscribers&&ar.socketError.publish(e),this.#t.socket.destroy()},onSocketClose:()=>this.#d(),onPing:e=>{ar.ping.hasSubscribers&&ar.ping.publish({payload:e,websocket:this})},onPong:e=>{ar.pong.hasSubscribers&&ar.pong.publish({payload:e,websocket:this})},readyState:Or.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;#n;#s;constructor(e,t=[]){super(),ie.util.markAsUncloneable(this);let a="WebSocket constructor";ie.argumentLengthCheck(arguments,1,a);let i=ie.converters["DOMString or sequence<DOMString> or WebSocketInit"](t,a,"options");e=ie.converters.USVString(e),t=i.protocols;let r=gN.settingsObject.baseUrl,n=C1e(e,r);if(typeof t=="string"&&(t=[t]),t.length!==new Set(t.map(c=>c.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every(c=>E1e(c)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#c=new URL(n.href);let s=gN.settingsObject;this.#t.controller=S1e(n,t,s,this.#t,i),this.#t.readyState=o.CONNECTING,this.#n="blob"}close(e=void 0,t=void 0){ie.brandCheck(this,o),e!==void 0&&(e=ie.converters["unsigned short"](e,"WebSocket.close","code",ie.attributes.Clamp)),t!==void 0&&(t=ie.converters.USVString(t)),e??=null,t??="",B1e(this.#t,e,t,!0)}send(e){ie.brandCheck(this,o);let t="WebSocket.send";if(ie.argumentLengthCheck(arguments,1,t),e=ie.converters.WebSocketSendData(e,t,"data"),z1e(this.#t.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!pN(this.#t.readyState)||hN(this.#t.readyState)))if(typeof e=="string"){let a=Buffer.from(e);this.#o+=a.byteLength,this.#r.add(a,()=>{this.#o-=a.byteLength},_b.text)}else w1e(e)?(this.#o+=e.byteLength,this.#r.add(e,()=>{this.#o-=e.byteLength},_b.arrayBuffer)):ArrayBuffer.isView(e)?(this.#o+=e.byteLength,this.#r.add(e,()=>{this.#o-=e.byteLength},_b.typedArray)):ie.is.Blob(e)&&(this.#o+=e.size,this.#r.add(e,()=>{this.#o-=e.size},_b.blob))}get readyState(){return ie.brandCheck(this,o),this.#t.readyState}get bufferedAmount(){return ie.brandCheck(this,o),this.#o}get url(){return ie.brandCheck(this,o),x1e(this.#c)}get extensions(){return ie.brandCheck(this,o),this.#i}get protocol(){return ie.brandCheck(this,o),this.#a}get onopen(){return ie.brandCheck(this,o),this.#e.open}set onopen(e){ie.brandCheck(this,o),this.#e.open&&this.removeEventListener("open",this.#e.open);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("open",t),this.#e.open=e):this.#e.open=null}get onerror(){return ie.brandCheck(this,o),this.#e.error}set onerror(e){ie.brandCheck(this,o),this.#e.error&&this.removeEventListener("error",this.#e.error);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("error",t),this.#e.error=e):this.#e.error=null}get onclose(){return ie.brandCheck(this,o),this.#e.close}set onclose(e){ie.brandCheck(this,o),this.#e.close&&this.removeEventListener("close",this.#e.close);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("close",t),this.#e.close=e):this.#e.close=null}get onmessage(){return ie.brandCheck(this,o),this.#e.message}set onmessage(e){ie.brandCheck(this,o),this.#e.message&&this.removeEventListener("message",this.#e.message);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("message",t),this.#e.message=e):this.#e.message=null}get binaryType(){return ie.brandCheck(this,o),this.#n}set binaryType(e){ie.brandCheck(this,o),e!=="blob"&&e!=="arraybuffer"?this.#n="blob":this.#n=e}#m(e,t){this.#t.socket=e.socket;let a=this.#t.controller.dispatcher?.webSocketOptions,i=a?.maxFragments,r=a?.maxPayloadSize,n=new Q1e(this.#t,t,{maxFragments:i,maxPayloadSize:r});n.on("drain",()=>this.#t.onParserDrain()),n.on("error",m=>this.#t.onParserError(m)),this.#s=n,this.#r=new N1e(e.socket),this.#t.readyState=Or.OPEN;let s=e.headersList.get("sec-websocket-extensions");s!==null&&(this.#i=s);let c=e.headersList.get("sec-websocket-protocol");if(c!==null&&(this.#a=c),Db("open",this),ar.open.hasSubscribers){let m=e.headersList.entries;ar.open.publish({address:U1e(e.socket),protocol:this.#a,extensions:this.#i,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:m}})}}#u(e,t){if(this.#t.readyState!==Or.OPEN)return;let a;if(e===_q.TEXT)try{a=I1e(t)}catch{fN(this.#t,1007,"Received invalid UTF-8 in text frame.");return}else e===_q.BINARY&&(this.#n==="blob"?a=new Blob([t]):a=j1e(t));Db("message",this,R1e,{origin:this.#c.origin,data:a})}#l(){this.#t.socket.resume()}#d(){let e=this.#t.closeState.has(Qq.SENT)&&this.#t.closeState.has(Qq.RECEIVED),t=1005,a="",i=this.#s?.closingInfo;i&&!i.error&&(t=i.code??1005,a=i.reason),this.#t.readyState=Or.CLOSED,this.#t.closeState.has(Qq.RECEIVED)||(t=1006,Db("error",this,(r,n)=>new D1e(r,n),{error:new TypeError(a)})),Db("close",this,(r,n)=>new T1e(r,n),{wasClean:e,code:t,reason:a}),ar.close.hasSubscribers&&ar.close.publish({websocket:this,code:t,reason:a})}static ping(e,t){if(Buffer.isBuffer(t)){if(t.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(t!==void 0)throw new TypeError("Expected buffer payload");let a=e.#t.readyState;if(pN(a)&&!hN(a)&&!q1e(a)){let i=new O1e(t);e.#t.socket.write(i.createFrame(_q.PING))}}},{ping:M1e}=at;Reflect.deleteProperty(at,"ping");at.CONNECTING=at.prototype.CONNECTING=Or.CONNECTING;at.OPEN=at.prototype.OPEN=Or.OPEN;at.CLOSING=at.prototype.CLOSING=Or.CLOSING;at.CLOSED=at.prototype.CLOSED=Or.CLOSED;Object.defineProperties(at.prototype,{CONNECTING:Nn,OPEN:Nn,CLOSING:Nn,CLOSED:Nn,url:ba,readyState:ba,bufferedAmount:ba,onopen:ba,onerror:ba,onclose:ba,close:ba,onmessage:ba,binaryType:ba,send:ba,extensions:ba,protocol:ba,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(at,{CONNECTING:Nn,OPEN:Nn,CLOSING:Nn,CLOSED:Nn});ie.converters["sequence<DOMString>"]=ie.sequenceConverter(ie.converters.DOMString);ie.converters["DOMString or sequence<DOMString>"]=function(o,e,t){return ie.util.Type(o)===ie.util.Types.OBJECT&&Symbol.iterator in o?ie.converters["sequence<DOMString>"](o):ie.converters.DOMString(o,e,t)};ie.converters.WebSocketInit=ie.dictionaryConverter([{key:"protocols",converter:ie.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:ie.converters.any,defaultValue:()=>_1e()},{key:"headers",converter:ie.nullableConverter(ie.converters.HeadersInit)}]);ie.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(o){return ie.util.Type(o)===ie.util.Types.OBJECT&&!(Symbol.iterator in o)?ie.converters.WebSocketInit(o):{protocols:ie.converters["DOMString or sequence<DOMString>"](o)}};ie.converters.WebSocketSendData=function(o){return ie.util.Type(o)===ie.util.Types.OBJECT&&(ie.is.Blob(o)||ie.is.BufferSource(o))?o:ie.converters.USVString(o)};bN.exports={WebSocket:at,ping:M1e}});var Dq=f((f8e,vN)=>{"use strict";var{webidl:Tb}=To(),{validateCloseCodeAndReason:L1e}=Ws(),{kConstruct:kN}=Ue(),{kEnumerableProperty:AN}=be();function P1e(){class o extends DOMException{get reason(){return""}}return new o().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,t,a){let i=Reflect.construct(e,t,e);return Object.setPrototypeOf(i,a.prototype),i}})}var Ks=class o extends P1e(){#e;#o;constructor(e="",t=void 0){if(e=Tb.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),t===kN)return;t!==null&&(t=Tb.converters.WebSocketCloseInfo(t));let a=t.closeCode??null,i=t.reason??"";L1e(a,i),i.length!==0&&a===null&&(a=1e3),this.#e=a,this.#o=i}get closeCode(){return this.#e}get reason(){return this.#o}static createUnvalidatedWebSocketError(e,t,a){let i=new o(e,kN);return i.#e=t,i.#o=a,i}},{createUnvalidatedWebSocketError:F1e}=Ks;delete Ks.createUnvalidatedWebSocketError;Object.defineProperties(Ks.prototype,{closeCode:AN,reason:AN,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Tb.is.WebSocketError=Tb.util.MakeTypeAssertion(Ks);vN.exports={WebSocketError:Ks,createUnvalidatedWebSocketError:F1e}});var EN=f((b8e,qN)=>{"use strict";var{createDeferredPromise:Tq}=zu(),{environmentSettingsObject:wN}=_t(),{states:Bm,opcodes:Rb,sentCloseFrameState:Qm}=Rn(),{webidl:go}=To(),{getURLRecord:$1e,isValidSubprotocol:H1e,isEstablished:G1e,utf8Decode:V1e}=Ws(),{establishWebSocketConnection:Y1e,failWebsocketConnection:Rq,closeWebSocketConnection:Nq}=Bb(),{channels:xN}=hn(),{WebsocketFrameSend:J1e}=Cm(),{ByteParser:W1e}=Cq(),{WebSocketError:Z1e,createUnvalidatedWebSocketError:K1e}=Dq(),{kEnumerableProperty:Nb}=be(),{utf8DecodeBytes:X1e}=tf(),zN=!1,Ob=class{#e;#o;#a;#i;#r;#t;#c=!1;#n={onConnectionEstablished:(e,t)=>this.#u(e,t),onMessage:(e,t)=>this.#l(e,t),onParserError:e=>Rq(this.#n,null,e.message),onParserDrain:()=>this.#n.socket.resume(),onSocketData:e=>{this.#s.write(e)||this.#n.socket.pause()},onSocketError:e=>{this.#n.readyState=Bm.CLOSING,xN.socketError.hasSubscribers&&xN.socketError.publish(e),this.#n.socket.destroy()},onSocketClose:()=>this.#d(),onPing:()=>{},onPong:()=>{},readyState:Bm.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;constructor(e,t=void 0){zN||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),zN=!0),go.argumentLengthCheck(arguments,1,"WebSocket"),e=go.converters.USVString(e),t!==null&&(t=go.converters.WebSocketStreamOptions(t));let a=wN.settingsObject.baseUrl,i=$1e(e,a),r=t.protocols;if(r.length!==new Set(r.map(s=>s.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(s=>H1e(s)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=i.toString(),this.#o=Tq(),this.#a=Tq(),t.signal!=null){let s=t.signal;if(s.aborted){this.#o.reject(s.reason),this.#a.reject(s.reason);return}s.addEventListener("abort",()=>{G1e(this.#n.readyState)||(Rq(this.#n),this.#n.readyState=Bm.CLOSING,this.#o.reject(s.reason),this.#a.reject(s.reason),this.#c=!0)},{once:!0})}let n=wN.settingsObject;this.#n.controller=Y1e(i,r,n,this.#n,t)}get url(){return this.#e.toString()}get opened(){return this.#o.promise}get closed(){return this.#a.promise}close(e=void 0){e!==null&&(e=go.converters.WebSocketCloseInfo(e));let t=e.closeCode??null,a=e.reason;Nq(this.#n,t,a,!0)}#m(e){e=go.converters.WebSocketStreamWrite(e);let t=Tq(),a=null,i=null;if(go.is.BufferSource(e))a=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),i=Rb.BINARY;else{let r;try{r=go.converters.DOMString(e)}catch(n){return t.reject(n),t.promise}a=new TextEncoder().encode(r),i=Rb.TEXT}if(!this.#n.closeState.has(Qm.SENT)&&!this.#n.closeState.has(Qm.RECEIVED)){let r=new J1e(a);this.#n.socket.write(r.createFrame(i),()=>{t.resolve(void 0)})}return t.promise}#u(e,t){this.#n.socket=e.socket;let a=this.#n.controller.dispatcher?.webSocketOptions?.maxFragments,i=this.#n.controller.dispatcher?.webSocketOptions?.maxPayloadSize,r=new W1e(this.#n,t,{maxFragments:a,maxPayloadSize:i});r.on("drain",()=>this.#n.onParserDrain()),r.on("error",l=>this.#n.onParserError(l)),this.#s=r,this.#n.readyState=Bm.OPEN;let n=t??"",s=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:l=>{this.#r=l},cancel:l=>this.#g(l)}),m=new WritableStream({write:l=>this.#m(l),close:()=>Nq(this.#n,null,null),abort:l=>this.#p(l)});this.#i=c,this.#t=m,this.#o.resolve({extensions:n,protocol:s,readable:c,writable:m})}#l(e,t){if(this.#n.readyState!==Bm.OPEN)return;let a;if(e===Rb.TEXT)try{a=V1e(t)}catch{Rq(this.#n,1007,"Received invalid UTF-8 in text frame.");return}else e===Rb.BINARY&&(a=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));this.#r.enqueue(a)}#d(){let e=this.#n.closeState.has(Qm.SENT)&&this.#n.closeState.has(Qm.RECEIVED);if(this.#n.readyState=Bm.CLOSED,this.#c)return;this.#n.wasEverConnected||this.#o.reject(new Z1e("Socket never opened"));let t=this.#s?.closingInfo,a=t?.code??1005;!this.#n.closeState.has(Qm.SENT)&&!this.#n.closeState.has(Qm.RECEIVED)&&(a=1006);let i=t?.reason==null?"":X1e(Buffer.from(t.reason));if(e)this.#r.close(),this.#t.locked||this.#t.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#a.resolve({closeCode:a,reason:i});else{let r=K1e("unclean close",a,i);this.#r?.error(r),this.#t?.abort(r),this.#a.reject(r)}}#p(e){let t=null,a="";go.is.WebSocketError(e)&&(t=e.closeCode,a=e.reason),Nq(this.#n,t,a)}#g(e){this.#p(e)}};Object.defineProperties(Ob.prototype,{url:Nb,opened:Nb,closed:Nb,close:Nb,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});go.converters.WebSocketStreamOptions=go.dictionaryConverter([{key:"protocols",converter:go.sequenceConverter(go.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:go.nullableConverter(go.converters.AbortSignal),defaultValue:()=>null}]);go.converters.WebSocketCloseInfo=go.dictionaryConverter([{key:"closeCode",converter:o=>go.converters["unsigned short"](o,go.attributes.EnforceRange)},{key:"reason",converter:go.converters.USVString,defaultValue:()=>""}]);go.converters.WebSocketStreamWrite=function(o){return typeof o=="string"?go.converters.USVString(o):go.converters.BufferSource(o)};qN.exports={WebSocketStream:Ob}});var jN=f((y8e,IN)=>{"use strict";function eIe(o){return o.indexOf("\0")===-1}function oIe(o){if(o.length===0)return!1;for(let e=0;e<o.length;e++)if(o.charCodeAt(e)<48||o.charCodeAt(e)>57)return!1;return!0}IN.exports={isValidLastEventId:eIe,isASCIINumber:oIe}});var QN=f((k8e,BN)=>{"use strict";var{Transform:tIe}=require("stream"),{isASCIINumber:CN,isValidLastEventId:SN}=jN(),Ur=[239,187,191],Oq=10,Ub=13,aIe=58,iIe=32,Uq=class extends tIe{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,a){if(e.length===0){a();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===Ur[0]){a();return}this.checkBOM=!1,a();return;case 2:if(this.buffer[0]===Ur[0]&&this.buffer[1]===Ur[1]){a();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===Ur[0]&&this.buffer[1]===Ur[1]&&this.buffer[2]===Ur[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,a();return}this.checkBOM=!1;break;default:this.buffer[0]===Ur[0]&&this.buffer[1]===Ur[1]&&this.buffer[2]===Ur[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos<this.buffer.length;){if(this.eventEndCheck){if(this.crlfCheck){if(this.buffer[this.pos]===Oq){this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.crlfCheck=!1;continue}this.crlfCheck=!1}if(this.buffer[this.pos]===Oq||this.buffer[this.pos]===Ub){this.buffer[this.pos]===Ub&&(this.crlfCheck=!0),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,(this.event.data!==void 0||this.event.event||this.event.id!==void 0||this.event.retry)&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(this.buffer[this.pos]===Oq||this.buffer[this.pos]===Ub){this.buffer[this.pos]===Ub&&(this.crlfCheck=!0),this.parseLine(this.buffer.subarray(0,this.pos),this.event),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.eventEndCheck=!0;continue}this.pos++}a()}parseLine(e,t){if(e.length===0)return;let a=e.indexOf(aIe);if(a===0)return;let i="",r="";if(a!==-1){i=e.subarray(0,a).toString("utf8");let n=a+1;e[n]===iIe&&++n,r=e.subarray(n).toString("utf8")}else i=e.toString("utf8"),r="";switch(i){case"data":t[i]===void 0?t[i]=r:t[i]+=`
|
|
1661
|
-
${r}`;break;case"retry":CN(r)&&(t[i]=r);break;case"id":SN(r)&&(t[i]=r);break;case"event":r.length>0&&(t[i]=r);break}}processEvent(e){e.retry&&CN(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&SN(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};BN.exports={EventSourceStream:Uq}});var MN=f((A8e,UN)=>{"use strict";var{pipeline:rIe}=require("stream"),{fetching:nIe}=ud(),{makeRequest:sIe}=xm(),{webidl:it}=To(),{EventSourceStream:cIe}=QN(),{parseMIMEType:mIe}=ma(),{createFastMessageEvent:lIe}=jb(),{isNetworkError:_N}=cd(),{kEnumerableProperty:Xs}=be(),{environmentSettingsObject:DN}=_t(),TN=!1,RN=3e3,yd=0,NN=1,kd=2,uIe="anonymous",dIe="use-credentials",_m=class o extends EventTarget{#e={open:null,error:null,message:null};#o;#a=!1;#i=yd;#r=null;#t=null;#c;#n;constructor(e,t={}){super(),it.util.markAsUncloneable(this);let a="EventSource constructor";it.argumentLengthCheck(arguments,1,a),TN||(TN=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=it.converters.USVString(e),t=it.converters.EventSourceInitDict(t,a,"eventSourceInitDict"),this.#c=t.node.dispatcher||t.dispatcher,this.#n={lastEventId:"",reconnectionTime:t.node.reconnectionTime};let i=DN,r;try{r=new URL(e,i.settingsObject.baseUrl),this.#n.origin=r.origin}catch(c){throw new DOMException(c,"SyntaxError")}this.#o=r.href;let n=uIe;t.withCredentials===!0&&(n=dIe,this.#a=!0);let s={redirect:"follow",keepalive:!0,mode:"cors",credentials:n==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};s.client=DN.settingsObject,s.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],s.cache="no-store",s.initiator="other",s.urlList=[new URL(this.#o)],this.#r=sIe(s),this.#s()}get readyState(){return this.#i}get url(){return this.#o}get withCredentials(){return this.#a}#s(){if(this.#i===kd)return;this.#i=yd;let e={request:this.#r,dispatcher:this.#c},t=a=>{if(!_N(a))return this.#m()};e.processResponseEndOfBody=t,e.processResponse=a=>{if(_N(a))if(a.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#m();return}let i=a.headersList.get("content-type",!0),r=i!==null?mIe(i):"failure",n=r!=="failure"&&r.essence==="text/event-stream";if(a.status!==200||n===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=NN,this.dispatchEvent(new Event("open")),this.#n.origin=a.urlList[a.urlList.length-1].origin;let s=new cIe({eventSourceSettings:this.#n,push:c=>{this.dispatchEvent(lIe(c.type,c.options))}});rIe(a.body.stream,s,c=>{c?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#t=nIe(e)}#m(){this.#i!==kd&&(this.#i=yd,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#i===yd&&(this.#n.lastEventId.length&&this.#r.headersList.set("last-event-id",this.#n.lastEventId,!0),this.#s())},this.#n.reconnectionTime)?.unref())}close(){it.brandCheck(this,o),this.#i!==kd&&(this.#i=kd,this.#t.abort(),this.#r=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let t=it.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("open",t),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let t=it.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("message",t),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let t=it.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("error",t),this.#e.error=e):this.#e.error=null}},ON={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:yd,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:NN,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:kd,writable:!1}};Object.defineProperties(_m,ON);Object.defineProperties(_m.prototype,ON);Object.defineProperties(_m.prototype,{close:Xs,onerror:Xs,onmessage:Xs,onopen:Xs,readyState:Xs,url:Xs,withCredentials:Xs});it.converters.EventSourceInitDict=it.dictionaryConverter([{key:"withCredentials",converter:it.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:it.converters.any},{key:"node",converter:it.dictionaryConverter([{key:"reconnectionTime",converter:it.converters["unsigned long"],defaultValue:()=>RN},{key:"dispatcher",converter:it.converters.any}]),defaultValue:()=>({})}]);UN.exports={EventSource:_m,defaultReconnectionTime:RN}});var GN=f((v8e,G)=>{"use strict";var gIe=zn(),PN=bu(),pIe=Cs(),hIe=E5(),fIe=S5(),bIe=Qs(),yIe=xz(),kIe=kz(),AIe=h_(),vIe=w_(),wIe=q_(),FN=ge(),Lb=be(),{InvalidArgumentError:Mb}=FN,Dm=nD(),xIe=ys(),zIe=c0(),{MockCallHistory:qIe,MockCallHistoryLog:EIe}=u0(),IIe=A0(),jIe=h0(),CIe=
|
|
1664
|
+
`)}close(){this.#a.close()}get(e){W0(e);let t=this.#d(e);return t?{body:t.body?Buffer.from(t.body.buffer,t.body.byteOffset,t.body.byteLength):void 0,statusCode:t.statusCode,statusMessage:t.statusMessage,headers:t.headers?JSON.parse(t.headers):void 0,etag:t.etag?t.etag:void 0,vary:t.vary?JSON.parse(t.vary):void 0,cacheControlDirectives:t.cacheControlDirectives?JSON.parse(t.cacheControlDirectives):void 0,cachedAt:t.cachedAt,staleAt:t.staleAt,deleteAt:t.deleteAt}:void 0}set(e,t){W0(e);let a=this.#l(e),i=Array.isArray(t.body)?Buffer.concat(t.body):t.body,r=i?.byteLength;if(r&&r>this.#e)return;let n=this.#d(e,!0);n?this.#r.run(i,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.cachedAt,t.staleAt,n.id):(this.#t.run(a,e.method,i,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.vary?JSON.stringify(t.vary):null,t.cachedAt,t.staleAt),this.#u())}createWriteStream(e,t){W0(e),Uze(t);let a=0,i=[],r=this;return new Oze({decodeStrings:!0,write(n,s,c){a+=n.byteLength,a<r.#e?i.push(n):this.destroy(),c()},final(n){r.set(e,{...t,body:i}),n()}})}delete(e){if(typeof e!="object")throw new TypeError(`expected key to be object, got ${typeof e}`);this.#n.run(this.#l(e))}#u(){if(Number.isFinite(this.#o)&&this.size<=this.#o)return 0;{let e=this.#c.run(Date.now()).changes;if(e)return e}{let e=this.#m?.run(Math.max(Math.floor(this.#o*.1),1)).changes;if(e)return e}return 0}get size(){let{total:e}=this.#s.get();return e}#l(e){return`${e.origin}/${e.path}`}#d(e,t=!1){let a=this.#l(e),{headers:i,method:r}=e,n=this.#i.all(a,r);if(n.length===0)return;let s=Date.now();for(let c of n){if(s>=c.deleteAt&&!t)continue;let m=!0;if(c.vary){let l=JSON.parse(c.vary);for(let u in l)if(!Mze(i[u],l[u])){m=!1;break}}if(m)return c}}};function Mze(o,e){if(o==null&&e==null)return!0;if(o==null&&e!=null||o!=null&&e==null)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}return o===e}});var Hs=f((JBe,z7)=>{"use strict";var{kConstruct:Lze}=Ue(),{kEnumerableProperty:vm}=be(),{iteratorMixin:Pze,isValidHeaderName:nd,isValidHeaderValue:k7}=_t(),{webidl:Ie}=To(),K0=require("assert"),ob=require("util");function y7(o){return o===10||o===13||o===9||o===32}function A7(o){let e=0,t=o.length;for(;t>e&&y7(o.charCodeAt(t-1));)--t;for(;t>e&&y7(o.charCodeAt(e));)++e;return e===0&&t===o.length?o:o.substring(e,t)}function v7(o,e){if(Array.isArray(e))for(let t=0;t<e.length;++t){let a=e[t];if(a.length!==2)throw Ie.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${a.length}.`});X0(o,a[0],a[1])}else if(typeof e=="object"&&e!==null){let t=Object.keys(e);for(let a=0;a<t.length;++a)X0(o,t[a],e[t[a]])}else throw Ie.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function X0(o,e,t){if(t=A7(t),nd(e)){if(!k7(t))throw Ie.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header value"})}else throw Ie.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(x7(o)==="immutable")throw new TypeError("immutable");return ab(o).append(e,t,!1)}function Fze(o){let e=ab(o);if(!e)return[];if(e.sortedMap)return e.sortedMap;let t=[],a=e.toSortedArray(),i=e.cookies;if(i===null||i.length===1)return e.sortedMap=a;for(let r=0;r<a.length;++r){let{0:n,1:s}=a[r];if(n==="set-cookie")for(let c=0;c<i.length;++c)t.push([n,i[c]]);else t.push([n,s])}return e.sortedMap=t}function w7(o,e){return o[0]<e[0]?-1:1}var tb=class o{cookies=null;sortedMap;headersMap;constructor(e){e instanceof o?(this.headersMap=new Map(e.headersMap),this.sortedMap=e.sortedMap,this.cookies=e.cookies===null?null:[...e.cookies]):(this.headersMap=new Map(e),this.sortedMap=null)}contains(e,t){return this.headersMap.has(t?e:e.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(e,t,a){this.sortedMap=null;let i=a?e:e.toLowerCase(),r=this.headersMap.get(i);if(r){let n=i==="cookie"?"; ":", ";this.headersMap.set(i,{name:r.name,value:`${r.value}${n}${t}`})}else this.headersMap.set(i,{name:e,value:t});i==="set-cookie"&&(this.cookies??=[]).push(t)}set(e,t,a){this.sortedMap=null;let i=a?e:e.toLowerCase();i==="set-cookie"&&(this.cookies=[t]),this.headersMap.set(i,{name:e,value:t})}delete(e,t){this.sortedMap=null,t||(e=e.toLowerCase()),e==="set-cookie"&&(this.cookies=null),this.headersMap.delete(e)}get(e,t){return this.headersMap.get(t?e:e.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:e,1:{value:t}}of this.headersMap)yield[e,t]}get entries(){let e={};if(this.headersMap.size!==0)for(let{name:t,value:a}of this.headersMap.values())e[t]=a;return e}rawValues(){return this.headersMap.values()}get entriesList(){let e=[];if(this.headersMap.size!==0)for(let{0:t,1:{name:a,value:i}}of this.headersMap)if(t==="set-cookie")for(let r of this.cookies)e.push([a,r]);else e.push([a,i]);return e}toSortedArray(){let e=this.headersMap.size,t=new Array(e);if(e<=32){if(e===0)return t;let a=this.headersMap[Symbol.iterator](),i=a.next().value;t[0]=[i[0],i[1].value],K0(i[1].value!==null);for(let r=1,n=0,s=0,c=0,m=0,l,u;r<e;++r){for(u=a.next().value,l=t[r]=[u[0],u[1].value],K0(l[1]!==null),c=0,s=r;c<s;)m=c+(s-c>>1),t[m][0]<=l[0]?c=m+1:s=m;if(r!==m){for(n=r;n>c;)t[n]=t[--n];t[c]=l}}if(!a.next().done)throw new TypeError("Unreachable");return t}else{let a=0;for(let{0:i,1:{value:r}}of this.headersMap)t[a++]=[i,r],K0(r!==null);return t.sort(w7)}}},Da=class o{#e;#o;constructor(e=void 0){Ie.util.markAsUncloneable(this),e!==Lze&&(this.#o=new tb,this.#e="none",e!==void 0&&(e=Ie.converters.HeadersInit(e,"Headers constructor","init"),v7(this,e)))}append(e,t){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,2,"Headers.append");let a="Headers.append";return e=Ie.converters.ByteString(e,a,"name"),t=Ie.converters.ByteString(t,a,"value"),X0(this,e,t)}delete(e){if(Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ie.converters.ByteString(e,"Headers.delete","name"),!nd(e))throw Ie.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#o.contains(e,!1)&&this.#o.delete(e,!1)}get(e){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,1,"Headers.get");let t="Headers.get";if(e=Ie.converters.ByteString(e,t,"name"),!nd(e))throw Ie.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#o.get(e,!1)}has(e){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,1,"Headers.has");let t="Headers.has";if(e=Ie.converters.ByteString(e,t,"name"),!nd(e))throw Ie.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#o.contains(e,!1)}set(e,t){Ie.brandCheck(this,o),Ie.argumentLengthCheck(arguments,2,"Headers.set");let a="Headers.set";if(e=Ie.converters.ByteString(e,a,"name"),t=Ie.converters.ByteString(t,a,"value"),t=A7(t),nd(e)){if(!k7(t))throw Ie.errors.invalidArgument({prefix:a,value:t,type:"header value"})}else throw Ie.errors.invalidArgument({prefix:a,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#o.set(e,t,!1)}getSetCookie(){Ie.brandCheck(this,o);let e=this.#o.cookies;return e?[...e]:[]}[ob.inspect.custom](e,t){return t.depth??=e,`Headers ${ob.formatWithOptions(t,this.#o.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,t){e.#e=t}static getHeadersList(e){return e.#o}static setHeadersList(e,t){e.#o=t}},{getHeadersGuard:x7,setHeadersGuard:$ze,getHeadersList:ab,setHeadersList:Hze}=Da;Reflect.deleteProperty(Da,"getHeadersGuard");Reflect.deleteProperty(Da,"setHeadersGuard");Reflect.deleteProperty(Da,"getHeadersList");Reflect.deleteProperty(Da,"setHeadersList");Pze("Headers",Da,Fze,0,1);Object.defineProperties(Da.prototype,{append:vm,delete:vm,get:vm,has:vm,set:vm,getSetCookie:vm,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[ob.inspect.custom]:{enumerable:!1}});Ie.converters.HeadersInit=function(o,e,t){if(Ie.util.Type(o)===Ie.util.Types.OBJECT){let a=Reflect.get(o,Symbol.iterator);if(!ob.types.isProxy(o)&&a===Da.prototype.entries)try{return ab(o).entriesList}catch{}return typeof a=="function"?Ie.converters["sequence<sequence<ByteString>>"](o,e,t,a.bind(o)):Ie.converters["record<ByteString, ByteString>"](o,e,t)}throw Ie.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})};z7.exports={fill:v7,compareHeaderName:w7,Headers:Da,HeadersList:tb,getHeadersGuard:x7,setHeadersGuard:$ze,setHeadersList:Hze,getHeadersList:ab}});var cd=f((WBe,R7)=>{"use strict";var{Headers:S7,HeadersList:q7,fill:Gze,getHeadersGuard:Vze,setHeadersGuard:B7,setHeadersList:Q7}=Hs(),{extractBody:E7,cloneBody:Yze,mixinBody:Jze,streamRegistry:_7,bodyUnusable:Wze}=Kc(),D7=be(),I7=require("util"),{kEnumerableProperty:Ut}=D7,{isValidReasonPhrase:Zze,isCancelled:Kze,isAborted:Xze,isErrorLike:e0e,environmentSettingsObject:o0e}=_t(),{redirectStatusSet:t0e,nullBodyStatus:a0e}=ku(),{webidl:ze}=To(),{URLSerializer:j7}=ma(),{kConstruct:rb}=Ue(),eq=require("assert"),{isomorphicEncode:i0e,serializeJavascriptValueToJSONString:r0e}=Er(),n0e=new TextEncoder("utf-8"),Mt=class o{#e;#o;static error(){return sd(nb(),"immutable")}static json(e,t=void 0){ze.argumentLengthCheck(arguments,1,"Response.json"),t!==null&&(t=ze.converters.ResponseInit(t));let a=n0e.encode(r0e(e)),i=E7(a),r=sd(wm({}),"response");return C7(r,t,{body:i[0],type:"application/json"}),r}static redirect(e,t=302){ze.argumentLengthCheck(arguments,1,"Response.redirect"),e=ze.converters.USVString(e),t=ze.converters["unsigned short"](t);let a;try{a=new URL(e,o0e.settingsObject.baseUrl)}catch(n){throw new TypeError(`Failed to parse URL from ${e}`,{cause:n})}if(!t0e.has(t))throw new RangeError(`Invalid status code ${t}`);let i=sd(wm({}),"immutable");i.#o.status=t;let r=i0e(j7(a));return i.#o.headersList.append("location",r,!0),i}constructor(e=null,t=void 0){if(ze.util.markAsUncloneable(this),e===rb)return;e!==null&&(e=ze.converters.BodyInit(e,"Response","body")),t=ze.converters.ResponseInit(t),this.#o=wm({}),this.#e=new S7(rb),B7(this.#e,"response"),Q7(this.#e,this.#o.headersList);let a=null;if(e!=null){let[i,r]=E7(e);a={body:i,type:r}}C7(this,t,a)}get type(){return ze.brandCheck(this,o),this.#o.type}get url(){ze.brandCheck(this,o);let e=this.#o.urlList,t=e[e.length-1]??null;return t===null?"":j7(t,!0)}get redirected(){return ze.brandCheck(this,o),this.#o.urlList.length>1}get status(){return ze.brandCheck(this,o),this.#o.status}get ok(){return ze.brandCheck(this,o),this.#o.status>=200&&this.#o.status<=299}get statusText(){return ze.brandCheck(this,o),this.#o.statusText}get headers(){return ze.brandCheck(this,o),this.#e}get body(){return ze.brandCheck(this,o),this.#o.body?this.#o.body.stream:null}get bodyUsed(){return ze.brandCheck(this,o),!!this.#o.body&&D7.isDisturbed(this.#o.body.stream)}clone(){if(ze.brandCheck(this,o),Wze(this.#o))throw ze.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=oq(this.#o);return this.#o.urlList.length!==0&&this.#o.body?.stream&&_7.register(this,new WeakRef(this.#o.body.stream)),sd(e,Vze(this.#e))}[I7.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let a={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${I7.formatWithOptions(t,a)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,t){e.#e=t}static getResponseState(e){return e.#o}static setResponseState(e,t){e.#o=t}},{getResponseHeaders:s0e,setResponseHeaders:c0e,getResponseState:Gs,setResponseState:m0e}=Mt;Reflect.deleteProperty(Mt,"getResponseHeaders");Reflect.deleteProperty(Mt,"setResponseHeaders");Reflect.deleteProperty(Mt,"getResponseState");Reflect.deleteProperty(Mt,"setResponseState");Jze(Mt,Gs);Object.defineProperties(Mt.prototype,{type:Ut,url:Ut,status:Ut,ok:Ut,redirected:Ut,statusText:Ut,headers:Ut,clone:Ut,body:Ut,bodyUsed:Ut,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Mt,{json:Ut,redirect:Ut,error:Ut});function oq(o){if(o.internalResponse)return T7(oq(o.internalResponse),o.type);let e=wm({...o,body:null});return o.body!=null&&(e.body=Yze(o.body)),e}function wm(o){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...o,headersList:o?.headersList?new q7(o?.headersList):new q7,urlList:o?.urlList?[...o.urlList]:[]}}function nb(o){let e=e0e(o);return wm({type:"error",status:0,error:e?o:new Error(o&&String(o)),aborted:o&&o.name==="AbortError"})}function l0e(o){return o.type==="error"&&o.status===0}function ib(o,e){return e={internalResponse:o,...e},new Proxy(o,{get(t,a){return a in e?e[a]:t[a]},set(t,a,i){return eq(!(a in e)),t[a]=i,!0}})}function T7(o,e){if(e==="basic")return ib(o,{type:"basic",headersList:o.headersList});if(e==="cors")return ib(o,{type:"cors",headersList:o.headersList});if(e==="opaque")return ib(o,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return ib(o,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});eq(!1)}function u0e(o,e=null){return eq(Kze(o)),Xze(o)?nb(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):nb(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}function C7(o,e,t){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Zze(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(Gs(o).status=e.status),"statusText"in e&&e.statusText!=null&&(Gs(o).statusText=e.statusText),"headers"in e&&e.headers!=null&&Gze(s0e(o),e.headers),t){if(a0e.includes(o.status))throw ze.errors.exception({header:"Response constructor",message:`Invalid response status code ${o.status}`});Gs(o).body=t.body,t.type!=null&&!Gs(o).headersList.contains("content-type",!0)&&Gs(o).headersList.append("content-type",t.type,!0)}}function sd(o,e){let t=new Mt(rb);m0e(t,o);let a=new S7(rb);return c0e(t,a),Q7(a,o.headersList),B7(a,e),o.urlList.length!==0&&o.body?.stream&&_7.register(t,new WeakRef(o.body.stream)),t}ze.converters.XMLHttpRequestBodyInit=function(o,e,t){return typeof o=="string"?ze.converters.USVString(o,e,t):ze.is.Blob(o)||ze.is.BufferSource(o)||ze.is.FormData(o)||ze.is.URLSearchParams(o)?o:ze.converters.DOMString(o,e,t)};ze.converters.BodyInit=function(o,e,t){return ze.is.ReadableStream(o)||o?.[Symbol.asyncIterator]?o:ze.converters.XMLHttpRequestBodyInit(o,e,t)};ze.converters.ResponseInit=ze.dictionaryConverter([{key:"status",converter:ze.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:ze.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:ze.converters.HeadersInit}]);ze.is.Response=ze.util.MakeTypeAssertion(Mt);R7.exports={isNetworkError:l0e,makeNetworkError:nb,makeResponse:wm,makeAppropriateNetworkError:u0e,filterResponse:T7,Response:Mt,cloneResponse:oq,fromInnerResponse:sd,getResponseState:Gs}});var xm=f((ZBe,W7)=>{"use strict";var{extractBody:d0e,mixinBody:g0e,cloneBody:p0e,bodyUnusable:N7}=Kc(),{Headers:F7,fill:h0e,HeadersList:mb,setHeadersGuard:tq,getHeadersGuard:f0e,setHeadersList:$7,getHeadersList:O7}=Hs(),cb=be(),U7=require("util"),{isValidHTTPToken:b0e,sameOrigin:M7,environmentSettingsObject:sb}=_t(),{forbiddenMethodsSet:y0e,corsSafeListedMethodsSet:k0e,referrerPolicy:A0e,requestRedirect:v0e,requestMode:w0e,requestCredentials:x0e,requestCache:z0e,requestDuplex:q0e}=ku(),{kEnumerableProperty:ko,normalizedMethodRecordsBase:E0e,normalizedMethodRecords:I0e}=cb,{webidl:ce}=To(),{URLSerializer:j0e}=ma(),{kConstruct:lb}=Ue(),C0e=require("assert"),{getMaxListeners:H7,setMaxListeners:S0e,defaultMaxListeners:B0e}=require("events"),Q0e=Symbol("abortController"),G7=new FinalizationRegistry(({signal:o,abort:e})=>{o.removeEventListener("abort",e)}),ub=new WeakMap,aq;try{aq=H7(new AbortController().signal)>0}catch{aq=!1}function L7(o){return e;function e(){let t=o.deref();if(t!==void 0){G7.unregister(e),this.removeEventListener("abort",e),t.abort(this.reason);let a=ub.get(t.signal);if(a!==void 0){if(a.size!==0){for(let i of a){let r=i.deref();r!==void 0&&r.abort(this.reason)}a.clear()}ub.delete(t.signal)}}}}var P7=!1,ft=class o{#e;#o;#a;#i;constructor(e,t=void 0){if(ce.util.markAsUncloneable(this),e===lb)return;ce.argumentLengthCheck(arguments,1,"Request constructor"),e=ce.converters.RequestInfo(e),t=ce.converters.RequestInit(t);let i=null,r=null,n=sb.settingsObject.baseUrl,s=null;if(typeof e=="string"){this.#o=t.dispatcher;let x;try{x=new URL(e,n)}catch(E){throw new TypeError("Failed to parse URL from "+e,{cause:E})}if(x.username||x.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);i=db({urlList:[x]}),r="cors"}else C0e(ce.is.Request(e)),i=e.#i,s=e.#e,this.#o=t.dispatcher||e.#o;let c=sb.settingsObject.origin,m="client";if(i.window?.constructor?.name==="EnvironmentSettingsObject"&&M7(i.window,c)&&(m=i.window),t.window!=null)throw new TypeError(`'window' option '${m}' must be null`);"window"in t&&(m="no-window"),i=db({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:sb.settingsObject,window:m,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let l=Object.keys(t).length!==0;if(l&&(i.mode==="navigate"&&(i.mode="same-origin"),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin="client",i.referrer="client",i.referrerPolicy="",i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),t.referrer!==void 0){let x=t.referrer;if(x==="")i.referrer="no-referrer";else{let E;try{E=new URL(x,n)}catch(q){throw new TypeError(`Referrer "${x}" is not a valid URL.`,{cause:q})}E.protocol==="about:"&&E.hostname==="client"||c&&!M7(E,sb.settingsObject.baseUrl)?i.referrer="client":i.referrer=E}}t.referrerPolicy!==void 0&&(i.referrerPolicy=t.referrerPolicy);let u;if(t.mode!==void 0?u=t.mode:u=r,u==="navigate")throw ce.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(u!=null&&(i.mode=u),t.credentials!==void 0&&(i.credentials=t.credentials),t.cache!==void 0&&(i.cache=t.cache),i.cache==="only-if-cached"&&i.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(t.redirect!==void 0&&(i.redirect=t.redirect),t.integrity!=null&&(i.integrity=String(t.integrity)),t.keepalive!==void 0&&(i.keepalive=!!t.keepalive),t.method!==void 0){let x=t.method,E=I0e[x];if(E!==void 0)i.method=E;else{if(!b0e(x))throw new TypeError(`'${x}' is not a valid HTTP method.`);let q=x.toUpperCase();if(y0e.has(q))throw new TypeError(`'${x}' HTTP method is unsupported.`);x=E0e[q]??x,i.method=x}!P7&&i.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),P7=!0)}t.signal!==void 0&&(s=t.signal),this.#i=i;let d=new AbortController;if(this.#e=d.signal,s!=null)if(s.aborted)d.abort(s.reason);else{this[Q0e]=d;let x=new WeakRef(d),E=L7(x);aq&&H7(s)===B0e&&S0e(1500,s),cb.addAbortListener(s,E),G7.register(d,{signal:s,abort:E},E)}if(this.#a=new F7(lb),$7(this.#a,i.headersList),tq(this.#a,"request"),u==="no-cors"){if(!k0e.has(i.method))throw new TypeError(`'${i.method} is unsupported in no-cors mode.`);tq(this.#a,"request-no-cors")}if(l){let x=O7(this.#a),E=t.headers!==void 0?t.headers:new mb(x);if(x.clear(),E instanceof mb){for(let{name:q,value:_}of E.rawValues())x.append(q,_,!1);x.cookies=E.cookies}else h0e(this.#a,E)}let g=ce.is.Request(e)?e.#i.body:null;if((t.body!=null||g!=null)&&(i.method==="GET"||i.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let h=null;if(t.body!=null){let[x,E]=d0e(t.body,i.keepalive);h=x,E&&!O7(this.#a).contains("content-type",!0)&&this.#a.append("content-type",E,!0)}let k=h??g;if(k!=null&&k.source==null){if(h!=null&&t.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(i.mode!=="same-origin"&&i.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');i.useCORSPreflightFlag=!0}let w=k;if(h==null&&g!=null){if(N7(e.#i))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let x=new TransformStream;g.stream.pipeThrough(x),w={source:g.source,length:g.length,stream:x.readable}}this.#i.body=w}get method(){return ce.brandCheck(this,o),this.#i.method}get url(){return ce.brandCheck(this,o),j0e(this.#i.url)}get headers(){return ce.brandCheck(this,o),this.#a}get destination(){return ce.brandCheck(this,o),this.#i.destination}get referrer(){return ce.brandCheck(this,o),this.#i.referrer==="no-referrer"?"":this.#i.referrer==="client"?"about:client":this.#i.referrer.toString()}get referrerPolicy(){return ce.brandCheck(this,o),this.#i.referrerPolicy}get mode(){return ce.brandCheck(this,o),this.#i.mode}get credentials(){return ce.brandCheck(this,o),this.#i.credentials}get cache(){return ce.brandCheck(this,o),this.#i.cache}get redirect(){return ce.brandCheck(this,o),this.#i.redirect}get integrity(){return ce.brandCheck(this,o),this.#i.integrity}get keepalive(){return ce.brandCheck(this,o),this.#i.keepalive}get isReloadNavigation(){return ce.brandCheck(this,o),this.#i.reloadNavigation}get isHistoryNavigation(){return ce.brandCheck(this,o),this.#i.historyNavigation}get signal(){return ce.brandCheck(this,o),this.#e}get body(){return ce.brandCheck(this,o),this.#i.body?this.#i.body.stream:null}get bodyUsed(){return ce.brandCheck(this,o),!!this.#i.body&&cb.isDisturbed(this.#i.body.stream)}get duplex(){return ce.brandCheck(this,o),"half"}clone(){if(ce.brandCheck(this,o),N7(this.#i))throw new TypeError("unusable");let e=Y7(this.#i),t=new AbortController;if(this.signal.aborted)t.abort(this.signal.reason);else{let a=ub.get(this.signal);a===void 0&&(a=new Set,ub.set(this.signal,a));let i=new WeakRef(t);a.add(i),cb.addAbortListener(t.signal,L7(i))}return J7(e,this.#o,t.signal,f0e(this.#a))}[U7.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let a={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${U7.formatWithOptions(t,a)}`}static setRequestSignal(e,t){return e.#e=t,e}static getRequestDispatcher(e){return e.#o}static setRequestDispatcher(e,t){e.#o=t}static setRequestHeaders(e,t){e.#a=t}static getRequestState(e){return e.#i}static setRequestState(e,t){e.#i=t}},{setRequestSignal:_0e,getRequestDispatcher:D0e,setRequestDispatcher:T0e,setRequestHeaders:R0e,getRequestState:V7,setRequestState:N0e}=ft;Reflect.deleteProperty(ft,"setRequestSignal");Reflect.deleteProperty(ft,"getRequestDispatcher");Reflect.deleteProperty(ft,"setRequestDispatcher");Reflect.deleteProperty(ft,"setRequestHeaders");Reflect.deleteProperty(ft,"getRequestState");Reflect.deleteProperty(ft,"setRequestState");g0e(ft,V7);function db(o){return{method:o.method??"GET",localURLsOnly:o.localURLsOnly??!1,unsafeRequest:o.unsafeRequest??!1,body:o.body??null,client:o.client??null,reservedClient:o.reservedClient??null,replacesClientId:o.replacesClientId??"",window:o.window??"client",keepalive:o.keepalive??!1,serviceWorkers:o.serviceWorkers??"all",initiator:o.initiator??"",destination:o.destination??"",priority:o.priority??null,origin:o.origin??"client",policyContainer:o.policyContainer??"client",referrer:o.referrer??"client",referrerPolicy:o.referrerPolicy??"",mode:o.mode??"no-cors",useCORSPreflightFlag:o.useCORSPreflightFlag??!1,credentials:o.credentials??"same-origin",useCredentials:o.useCredentials??!1,cache:o.cache??"default",redirect:o.redirect??"follow",integrity:o.integrity??"",cryptoGraphicsNonceMetadata:o.cryptoGraphicsNonceMetadata??"",parserMetadata:o.parserMetadata??"",reloadNavigation:o.reloadNavigation??!1,historyNavigation:o.historyNavigation??!1,userActivation:o.userActivation??!1,taintedOrigin:o.taintedOrigin??!1,redirectCount:o.redirectCount??0,responseTainting:o.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:o.preventNoCacheCacheControlHeaderModification??!1,done:o.done??!1,timingAllowFailed:o.timingAllowFailed??!1,useURLCredentials:o.useURLCredentials??void 0,traversableForUserPrompts:o.traversableForUserPrompts??"client",urlList:o.urlList,url:o.urlList[0],headersList:o.headersList?new mb(o.headersList):new mb}}function Y7(o){let e=db({...o,body:null});return o.body!=null&&(e.body=p0e(o.body)),e}function J7(o,e,t,a){let i=new ft(lb);N0e(i,o),T0e(i,e),_0e(i,t);let r=new F7(lb);return R0e(i,r),$7(r,o.headersList),tq(r,a),i}Object.defineProperties(ft.prototype,{method:ko,url:ko,headers:ko,redirect:ko,clone:ko,signal:ko,duplex:ko,destination:ko,body:ko,bodyUsed:ko,isHistoryNavigation:ko,isReloadNavigation:ko,keepalive:ko,integrity:ko,cache:ko,credentials:ko,attribute:ko,referrerPolicy:ko,referrer:ko,mode:ko,[Symbol.toStringTag]:{value:"Request",configurable:!0}});ce.is.Request=ce.util.MakeTypeAssertion(ft);ce.converters.RequestInfo=function(o){return typeof o=="string"?ce.converters.USVString(o):ce.is.Request(o)?o:ce.converters.USVString(o)};ce.converters.RequestInit=ce.dictionaryConverter([{key:"method",converter:ce.converters.ByteString},{key:"headers",converter:ce.converters.HeadersInit},{key:"body",converter:ce.nullableConverter(ce.converters.BodyInit)},{key:"referrer",converter:ce.converters.USVString},{key:"referrerPolicy",converter:ce.converters.DOMString,allowedValues:A0e},{key:"mode",converter:ce.converters.DOMString,allowedValues:w0e},{key:"credentials",converter:ce.converters.DOMString,allowedValues:x0e},{key:"cache",converter:ce.converters.DOMString,allowedValues:z0e},{key:"redirect",converter:ce.converters.DOMString,allowedValues:v0e},{key:"integrity",converter:ce.converters.DOMString},{key:"keepalive",converter:ce.converters.boolean},{key:"signal",converter:ce.nullableConverter(o=>ce.converters.AbortSignal(o,"RequestInit","signal"))},{key:"window",converter:ce.converters.any},{key:"duplex",converter:ce.converters.DOMString,allowedValues:q0e},{key:"dispatcher",converter:ce.converters.any},{key:"priority",converter:ce.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:()=>"auto"}]);W7.exports={Request:ft,makeRequest:db,fromInnerRequest:J7,cloneRequest:Y7,getRequestDispatcher:D0e,getRequestState:V7}});var iR=f((KBe,aR)=>{"use strict";var O0e=require("assert"),{runtimeFeatures:K7}=Ir(),Vs=new Map([["sha256",0],["sha384",1],["sha512",2]]),iq;if(K7.has("crypto")){iq=require("crypto");let o=iq.getHashes();o.length===0&&Vs.clear();for(let e of Vs.keys())o.includes(e)===!1&&Vs.delete(e)}else Vs.clear();var Z7=Map.prototype.get.bind(Vs),rq=Map.prototype.has.bind(Vs),U0e=K7.has("crypto")===!1||Vs.size===0?()=>!0:(o,e)=>{let t=eR(e);if(t.length===0)return!0;let a=X7(t);for(let i of a){let r=i.alg,n=i.val,s=oR(r,o);if(tR(s,n))return!0}return!1};function X7(o){let e=[],t=null;for(let a of o){if(O0e(rq(a.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(a),t=a;continue}let i=t.alg,r=Z7(i),n=a.alg,s=Z7(n);s<r||(s>r?(t=a,e[0]=a,e.length=1):e.push(a))}return e}function eR(o){let e=[];for(let t of o.split(" ")){let i=t.split("?",1)[0],r="",n=[i.slice(0,6),i.slice(7)],s=n[0];if(!rq(s))continue;n[1]&&(r=n[1]);let c={alg:s,val:r};e.push(c)}return e}var oR=(o,e)=>iq.hash(o,e,"base64");function tR(o,e){let t=o.length;t!==0&&o[t-1]==="="&&(t-=1),t!==0&&o[t-1]==="="&&(t-=1);let a=e.length;if(a!==0&&e[a-1]==="="&&(a-=1),a!==0&&e[a-1]==="="&&(a-=1),t!==a)return!1;for(let i=0;i<t;++i)if(!(o[i]===e[i]||o[i]==="+"&&e[i]==="-"||o[i]==="/"&&e[i]==="_"))return!1;return!0}aR.exports={applyAlgorithmToBytes:oR,bytesMatch:U0e,caseSensitiveMatch:tR,isValidSRIHashAlgorithm:rq,getStrongestMetadata:X7,parseMetadata:eR}});var ud=f((XBe,yR)=>{"use strict";var{makeNetworkError:Le,makeAppropriateNetworkError:md,filterResponse:nq,makeResponse:gb,fromInnerResponse:M0e,getResponseState:L0e}=cd(),{HeadersList:sq}=Hs(),{Request:P0e,cloneRequest:F0e,getRequestDispatcher:$0e,getRequestState:H0e}=xm(),Ta=require("zlib"),{makePolicyContainer:G0e,clonePolicyContainer:V0e,requestBadPort:Y0e,TAOCheck:J0e,appendRequestOriginHeader:W0e,responseLocationURL:Z0e,requestCurrentURL:Lt,setRequestReferrerPolicyOnRedirect:K0e,tryUpgradeRequestToAPotentiallyTrustworthyURL:X0e,createOpaqueTimingInfo:gq,appendFetchMetadata:eqe,corsCheck:oqe,crossOriginResourcePolicyCheck:tqe,determineRequestsReferrer:aqe,coarsenedSharedCurrentTime:ld,sameOrigin:uq,isCancelled:Tn,isAborted:rR,isErrorLike:iqe,fullyReadBody:rqe,readableStreamClose:nqe,urlIsLocal:sqe,urlIsHttpHttpsScheme:bb,urlHasHttpsScheme:cqe,clampAndCoarsenConnectionTimingInfo:mqe,simpleRangeHeaderValue:lqe,buildContentRange:uqe,createInflate:dqe,extractMimeType:gqe,hasAuthenticationEntry:pqe,includesCredentials:nR,isTraversableNavigable:hqe}=_t(),Ys=require("assert"),{safelyExtractBody:yb,extractBody:sR}=Kc(),{redirectStatusSet:uR,nullBodyStatus:dR,safeMethodsSet:fqe,requestBodyHeader:bqe,subresourceSet:yqe}=ku(),kqe=require("events"),{Readable:Aqe,pipeline:vqe,finished:wqe,isErrored:xqe,isReadable:pb}=require("stream"),{addAbortListener:zqe,bufferToLowerCasedHeaderName:cR}=be(),{dataURLProcessor:qqe,serializeAMimeType:Eqe,minimizeSupportedMimeType:Iqe}=ma(),{getGlobalDispatcher:jqe}=Zf(),{webidl:pq}=To(),{STATUS_CODES:mR}=require("http"),{bytesMatch:Cqe}=iR(),{createDeferredPromise:Sqe}=zu(),{isomorphicEncode:hb}=Er(),{runtimeFeatures:Bqe}=Ir(),Qqe=Bqe.has("zstd"),_qe=["GET","HEAD"],Dqe=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",cq,fb=class extends kqe{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function Tqe(o){gR(o,"fetch")}function Rqe(o,e=void 0){pq.argumentLengthCheck(arguments,1,"globalThis.fetch");let t=Sqe(),a;try{a=new P0e(o,e)}catch(l){return t.reject(l),t.promise}let i=H0e(a);if(a.signal.aborted)return mq(t,i,null,a.signal.reason,null),t.promise;i.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(i.serviceWorkers="none");let n=null,s=!1,c=null;return zqe(a.signal,()=>{s=!0,Ys(c!=null),c.abort(a.signal.reason);let l=n?.deref();mq(t,i,l,a.signal.reason,c.controller)}),c=hR({request:i,processResponseEndOfBody:Tqe,processResponse:l=>{if(!s){if(l.aborted){mq(t,i,n,c.serializedAbortReason,c.controller);return}if(l.type==="error"){t.reject(new TypeError("fetch failed",{cause:l.error}));return}n=new WeakRef(M0e(l,"immutable")),t.resolve(n.deref()),t=null}},dispatcher:$0e(a),requestObject:a}),t.promise}function gR(o,e="other"){if(o.type==="error"&&o.aborted||!o.urlList?.length)return;let t=o.urlList[0],a=o.timingInfo,i=o.cacheState;bb(t)&&a!==null&&(o.timingAllowPassed||(a=gq({startTime:a.startTime}),i=""),a.endTime=ld(),o.timingInfo=a,pR(a,t.href,e,globalThis,i,"",o.status))}var pR=performance.markResourceTiming;function mq(o,e,t,a,i){if(o&&o.reject(a),e.body?.stream!=null&&pb(e.body.stream)&&e.body.stream.cancel(a).catch(n=>{if(n.code!=="ERR_INVALID_STATE")throw n}),t==null)return;let r=L0e(t);r.body?.stream!=null&&pb(r.body.stream)&&i.error(a)}function hR({request:o,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:a,processResponseEndOfBody:i,processResponseConsumeBody:r,useParallelQueue:n=!1,dispatcher:s=jqe(),requestObject:c=null}){Ys(s);let m=null,l=!1;o.client!=null&&(m=o.client.globalObject,l=o.client.crossOriginIsolatedCapability);let u=ld(l),d=gq({startTime:u}),g={controller:new fb(s),request:o,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:a,processResponseConsumeBody:r,processResponseEndOfBody:i,taskDestination:m,crossOriginIsolatedCapability:l,requestObject:c};return Ys(!o.body||o.body.stream),o.window==="client"&&(o.window=o.client?.globalObject?.constructor?.name==="Window"?o.client:"no-window"),o.origin==="client"&&(o.origin=o.client.origin),o.policyContainer==="client"&&(o.client!=null?o.policyContainer=V0e(o.client.policyContainer):o.policyContainer=G0e()),o.headersList.contains("accept",!0)||o.headersList.append("accept","*/*",!0),o.headersList.contains("accept-language",!0)||o.headersList.append("accept-language","*",!0),o.priority,yqe.has(o.destination),fR(g,!1),g.controller}async function fR(o,e){try{let t=o.request,a=null;if(t.localURLsOnly&&!sqe(Lt(t))&&(a=Le("local URLs only")),X0e(t),Y0e(t)==="blocked"&&(a=Le("bad port")),t.referrerPolicy===""&&(t.referrerPolicy=t.policyContainer.referrerPolicy),t.referrer!=="no-referrer"&&(t.referrer=aqe(t)),a===null){let r=Lt(t);uq(r,t.url)&&t.responseTainting==="basic"||r.protocol==="data:"||t.mode==="navigate"||t.mode==="websocket"?(t.responseTainting="basic",a=await lR(o)):t.mode==="same-origin"?a=Le('request mode cannot be "same-origin"'):t.mode==="no-cors"?t.redirect!=="follow"?a=Le('redirect mode cannot be "follow" for "no-cors" request'):(t.responseTainting="opaque",a=await lR(o)):bb(Lt(t))?(t.responseTainting="cors",a=await bR(o)):a=Le("URL scheme must be a HTTP(S) scheme")}if(e)return a;a.status!==0&&!a.internalResponse&&(t.responseTainting,t.responseTainting==="basic"?a=nq(a,"basic"):t.responseTainting==="cors"?a=nq(a,"cors"):t.responseTainting==="opaque"?a=nq(a,"opaque"):Ys(!1));let i=a.status===0?a:a.internalResponse;if(i.urlList.length===0&&i.urlList.push(...t.urlList),t.timingAllowFailed||(a.timingAllowPassed=!0),a.type==="opaque"&&i.status===206&&i.rangeRequested&&!t.headers.contains("range",!0)&&(a=i=Le()),a.status!==0&&(t.method==="HEAD"||t.method==="CONNECT"||dR.includes(i.status))&&(i.body=null,o.controller.dump=!0),t.integrity){let r=s=>lq(o,Le(s));if(t.responseTainting==="opaque"||a.body==null){r(a.error);return}let n=s=>{if(!Cqe(s,t.integrity)){r("integrity mismatch");return}a.body=yb(s)[0],lq(o,a)};rqe(a.body,n,r)}else lq(o,a)}catch(t){o.controller.terminate(t)}}function lR(o){if(Tn(o)&&o.request.redirectCount===0)return Promise.resolve(md(o));let{request:e}=o,{protocol:t}=Lt(e);switch(t){case"about:":return Promise.resolve(Le("about scheme is not supported"));case"blob:":{cq||(cq=require("buffer").resolveObjectURL);let a=Lt(e);if(a.search.length!==0)return Promise.resolve(Le("NetworkError when attempting to fetch resource."));let i=cq(a.toString());if(e.method!=="GET"||!pq.is.Blob(i))return Promise.resolve(Le("invalid method"));let r=gb(),n=i.size,s=hb(`${n}`),c=i.type;if(e.headersList.contains("range",!0)){r.rangeRequested=!0;let m=e.headersList.get("range",!0),l=lqe(m,!0);if(l==="failure")return Promise.resolve(Le("failed to fetch the data URL"));let{rangeStartValue:u,rangeEndValue:d}=l;if(u===null)u=n-d,d=u+d-1;else{if(u>=n)return Promise.resolve(Le("Range start is greater than the blob's size."));(d===null||d>=n)&&(d=n-1)}let g=i.slice(u,d+1,c),h=sR(g);r.body=h[0];let k=hb(`${g.size}`),w=uqe(u,d,n);r.status=206,r.statusText="Partial Content",r.headersList.set("content-length",k,!0),r.headersList.set("content-type",c,!0),r.headersList.set("content-range",w,!0)}else{let m=sR(i);r.statusText="OK",r.body=m[0],r.headersList.set("content-length",s,!0),r.headersList.set("content-type",c,!0)}return Promise.resolve(r)}case"data:":{let a=Lt(e),i=qqe(a);if(i==="failure")return Promise.resolve(Le("failed to fetch the data URL"));let r=Eqe(i.mimeType);return Promise.resolve(gb({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:r}]],body:yb(i.body)[0]}))}case"file:":return Promise.resolve(Le("not implemented... yet..."));case"http:":case"https:":return bR(o).catch(a=>Le(a));default:return Promise.resolve(Le("unknown scheme"))}}function Nqe(o,e){o.request.done=!0,o.processResponseDone!=null&&queueMicrotask(()=>o.processResponseDone(e))}function lq(o,e){let t=o.timingInfo,a=()=>{let r=Date.now();o.request.destination==="document"&&(o.controller.fullTimingInfo=t),o.controller.reportTimingSteps=()=>{if(!bb(o.request.url))return;t.endTime=r;let s=e.cacheState,c=e.bodyInfo;e.timingAllowPassed||(t=gq(t),s="");let m=0;if(o.request.mode!=="navigate"||!e.hasCrossOriginRedirects){m=e.status;let l=gqe(e.headersList);l!=="failure"&&(c.contentType=Iqe(l))}o.request.initiatorType!=null&&pR(t,o.request.url.href,o.request.initiatorType,globalThis,s,c,m)};let n=()=>{o.request.done=!0,o.processResponseEndOfBody!=null&&queueMicrotask(()=>o.processResponseEndOfBody(e)),o.request.initiatorType!=null&&o.controller.reportTimingSteps()};queueMicrotask(()=>n())};o.processResponse!=null&&queueMicrotask(()=>{o.processResponse(e),o.processResponse=null});let i=e.type==="error"?e:e.internalResponse??e;i.body==null?a():wqe(i.body.stream,()=>{a()})}async function bR(o){let e=o.request,t=null,a=null,i=o.timingInfo;if(e.serviceWorkers,t===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),a=t=await dq(o),e.responseTainting==="cors"&&oqe(e,t)==="failure")return Le("cors failure");J0e(e,t)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||t.type==="opaque")&&tqe(e.origin,e.client,e.destination,a)==="blocked"?Le("blocked"):(uR.has(a.status)&&(e.redirect!=="manual"&&o.controller.connection.destroy(void 0,!1),e.redirect==="error"?t=Le("unexpected redirect"):e.redirect==="manual"?t=a:e.redirect==="follow"?t=await Oqe(o,t):Ys(!1)),t.timingInfo=i,t)}function Oqe(o,e){let t=o.request,a=e.internalResponse?e.internalResponse:e,i;try{if(i=Z0e(a,Lt(t).hash),i==null)return e}catch(n){return Promise.resolve(Le(n))}if(!bb(i))return Promise.resolve(Le("URL scheme must be a HTTP(S) scheme"));if(t.redirectCount===20)return Promise.resolve(Le("redirect count exceeded"));if(t.redirectCount+=1,t.mode==="cors"&&(i.username||i.password)&&!uq(t,i))return Promise.resolve(Le('cross origin not allowed for request mode "cors"'));if(t.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(Le('URL cannot contain credentials for request mode "cors"'));if(a.status!==303&&t.body!=null&&t.body.source==null)return Promise.resolve(Le());if([301,302].includes(a.status)&&t.method==="POST"||a.status===303&&!_qe.includes(t.method)){t.method="GET",t.body=null;for(let n of bqe)t.headersList.delete(n)}uq(Lt(t),i)||(t.headersList.delete("authorization",!0),t.headersList.delete("proxy-authorization",!0),t.headersList.delete("cookie",!0),t.headersList.delete("host",!0)),t.body!=null&&(Ys(t.body.source!=null),t.body=yb(t.body.source)[0]);let r=o.timingInfo;return r.redirectEndTime=r.postRedirectStartTime=ld(o.crossOriginIsolatedCapability),r.redirectStartTime===0&&(r.redirectStartTime=r.startTime),t.urlList.push(i),K0e(t,a),fR(o,!0)}async function dq(o,e=!1,t=!1){let a=o.request,i=null,r=null,n=null,s=null,c=!1;a.window==="no-window"&&a.redirect==="error"?(i=o,r=a):(r=F0e(a),i={...o},i.request=r);let m=a.credentials==="include"||a.credentials==="same-origin"&&a.responseTainting==="basic",l=r.body?r.body.length:null,u=null;if(r.body==null&&["POST","PUT"].includes(r.method)&&(u="0"),l!=null&&(u=hb(`${l}`)),u!=null&&!r.headersList.contains("content-length",!0)&&r.headersList.append("content-length",u,!0),l!=null&&r.keepalive,pq.is.URL(r.referrer)&&r.headersList.append("referer",hb(r.referrer.href),!0),W0e(r),eqe(r),r.headersList.contains("user-agent",!0)||r.headersList.append("user-agent",Dqe,!0),r.cache==="default"&&(r.headersList.contains("if-modified-since",!0)||r.headersList.contains("if-none-match",!0)||r.headersList.contains("if-unmodified-since",!0)||r.headersList.contains("if-match",!0)||r.headersList.contains("if-range",!0))&&(r.cache="no-store"),r.cache==="no-cache"&&!r.preventNoCacheCacheControlHeaderModification&&!r.headersList.contains("cache-control",!0)&&r.headersList.append("cache-control","max-age=0",!0),(r.cache==="no-store"||r.cache==="reload")&&(r.headersList.contains("pragma",!0)||r.headersList.append("pragma","no-cache",!0),r.headersList.contains("cache-control",!0)||r.headersList.append("cache-control","no-cache",!0)),r.headersList.contains("range",!0)&&r.headersList.append("accept-encoding","identity",!0),r.headersList.contains("accept-encoding",!0)||(cqe(Lt(r))?r.headersList.append("accept-encoding","br, gzip, deflate",!0):r.headersList.append("accept-encoding","gzip, deflate",!0)),r.headersList.delete("host",!0),m&&!r.headersList.contains("authorization",!0)){let d=null;if(!(pqe(r)&&(r.useURLCredentials===void 0||!nR(Lt(r))))){if(nR(Lt(r))&&e){let{username:g,password:h}=Lt(r);d=`Basic ${Buffer.from(`${g}:${h}`).toString("base64")}`}}d!==null&&r.headersList.append("Authorization",d,!1)}if(s==null&&(r.cache="no-store"),r.cache!=="no-store"&&r.cache,n==null){if(r.cache==="only-if-cached")return Le("only if cached");let d=await Uqe(i,m,t);!fqe.has(r.method)&&d.status>=200&&d.status<=399,c&&d.status,n==null&&(n=d)}if(n.urlList=[...r.urlList],r.headersList.contains("range",!0)&&(n.rangeRequested=!0),n.requestIncludesCredentials=m,n.status===401&&r.responseTainting!=="cors"&&m&&(a.useURLCredentials!==void 0||hqe(a.traversableForUserPrompts))){if(a.body!=null){if(a.body.source==null)return n;a.body=yb(a.body.source)[0]}if(a.useURLCredentials===void 0||e)return Tn(o)?md(o):n;o.controller.connection.destroy(),n=await dq(o,!0)}if(n.status===407)return a.window==="no-window"?Le():Tn(o)?md(o):Le("proxy authentication required");if(n.status===421&&!t&&(a.body==null||a.body.source!=null)){if(Tn(o))return md(o);o.controller.connection.destroy(),n=await dq(o,e,!0)}return n}async function Uqe(o,e=!1,t=!1){Ys(!o.controller.connection||o.controller.connection.destroyed),o.controller.connection={abort:null,destroyed:!1,destroy(h,k=!0){this.destroyed||(this.destroyed=!0,k&&this.abort?.(h??new DOMException("The operation was aborted.","AbortError")))}};let a=o.request,i=null,r=o.timingInfo;null==null&&(a.cache="no-store");let s=t?"yes":"no";a.mode;let c=null;if(a.body==null&&o.processRequestEndOfBody)queueMicrotask(()=>o.processRequestEndOfBody());else if(a.body!=null){let h=async function*(x){Tn(o)||(yield x,o.processRequestBodyChunkLength?.(x.byteLength))},k=()=>{Tn(o)||o.processRequestEndOfBody&&o.processRequestEndOfBody()},w=x=>{Tn(o)||(x.name==="AbortError"?o.controller.abort():o.controller.terminate(x))};c=(async function*(){try{for await(let x of a.body.stream)yield*h(x);k()}catch(x){w(x)}})()}try{let{body:h,status:k,statusText:w,headersList:x,socket:E}=await g({body:c});if(E)i=gb({status:k,statusText:w,headersList:x,socket:E});else{let q=h[Symbol.asyncIterator]();o.controller.next=()=>q.next(),i=gb({status:k,statusText:w,headersList:x})}}catch(h){return h.name==="AbortError"?(o.controller.connection.destroy(),md(o,h)):Le(h)}let m=()=>o.controller.resume(),l=h=>{Tn(o)||o.controller.abort(h)},u=new ReadableStream({start(h){o.controller.controller=h},pull:m,cancel:l,type:"bytes"});i.body={stream:u,source:null,length:null},o.controller.resume||o.controller.on("terminated",d),o.controller.resume=async()=>{for(;;){let h,k;try{let{done:x,value:E}=await o.controller.next();if(rR(o))break;h=x?void 0:E}catch(x){o.controller.ended&&!r.encodedBodySize?h=void 0:(h=x,k=!0)}if(h===void 0){nqe(o.controller.controller),Nqe(o,i);return}if(r.decodedBodySize+=h?.byteLength??0,k){o.controller.terminate(h);return}let w=new Uint8Array(h);if(w.byteLength&&o.controller.controller.enqueue(w),xqe(u)){o.controller.terminate();return}if(o.controller.controller.desiredSize<=0)return}};function d(h){rR(o)?(i.aborted=!0,pb(u)&&o.controller.controller.error(o.controller.serializedAbortReason)):pb(u)&&o.controller.controller.error(new TypeError("terminated",{cause:iqe(h)?h:void 0})),o.controller.connection.destroy()}return i;function g({body:h}){let k=Lt(a),w=o.controller.dispatcher,x=k.pathname+k.search,E=k.search.length===0&&k.href[k.href.length-k.hash.length-1]==="?";return new Promise((q,_)=>w.dispatch({path:E?`${x}?`:x,origin:k.origin,method:a.method,body:w.isMockActive?a.body&&(a.body.source||a.body.stream):h,headers:a.headersList.entries,maxRedirections:0,upgrade:a.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(D){let{connection:H}=o.controller;r.finalConnectionTimingInfo=mqe(void 0,r.postRedirectStartTime,o.crossOriginIsolatedCapability),H.destroyed?D(new DOMException("The operation was aborted.","AbortError")):(o.controller.on("terminated",D),this.abort=H.abort=D),r.finalNetworkRequestStartTime=ld(o.crossOriginIsolatedCapability)},onResponseStarted(){r.finalNetworkResponseStartTime=ld(o.crossOriginIsolatedCapability)},onHeaders(D,H,J,X){if(D<200)return!1;let Y=new sq;for(let qo=0;qo<H.length;qo+=2){let cr=cR(H[qo]),$t=H[qo+1];if(Array.isArray($t)&&!Buffer.isBuffer(H[qo+1]))for(let Gn of $t)Y.append(cr,Gn.toString("latin1"),!0);else Y.append(cr,$t.toString("latin1"),!0)}let ve=Y.get("location",!0);this.body=new Aqe({read:J});let xe=ve&&a.redirect==="follow"&&uR.has(D),He=[];if(a.method!=="HEAD"&&a.method!=="CONNECT"&&!dR.includes(D)&&!xe){let qo=Y.get("content-encoding",!0),cr=qo?qo.toLowerCase().split(","):[],$t=5;if(cr.length>$t)return _(new Error(`too many content-encodings in response: ${cr.length}, maximum allowed is ${$t}`)),!0;for(let Gn=cr.length-1;Gn>=0;--Gn){let Vn=cr[Gn].trim();if(Vn==="x-gzip"||Vn==="gzip")He.push(Ta.createGunzip({flush:Ta.constants.Z_SYNC_FLUSH,finishFlush:Ta.constants.Z_SYNC_FLUSH}));else if(Vn==="deflate")He.push(dqe({flush:Ta.constants.Z_SYNC_FLUSH,finishFlush:Ta.constants.Z_SYNC_FLUSH}));else if(Vn==="br")He.push(Ta.createBrotliDecompress({flush:Ta.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ta.constants.BROTLI_OPERATION_FLUSH}));else if(Vn==="zstd"&&Qqe)He.push(Ta.createZstdDecompress({flush:Ta.constants.ZSTD_e_continue,finishFlush:Ta.constants.ZSTD_e_end}));else{He.length=0;break}}}let Jo=this.onError.bind(this);return q({status:D,statusText:X,headersList:Y,body:He.length?vqe(this.body,...He,qo=>{qo&&this.onError(qo)}).on("error",Jo):this.body.on("error",Jo)}),!0},onData(D){if(o.controller.dump)return;let H=D;return r.encodedBodySize+=H.byteLength,this.body.push(H)},onComplete(){this.abort&&o.controller.off("terminated",this.abort),o.controller.ended=!0,this.body.push(null)},onError(D){this.abort&&o.controller.off("terminated",this.abort),this.body?.destroy(D),o.controller.terminate(D),_(D)},onRequestUpgrade(D,H,J,X){if(X.session!=null&&H!==200||X.session==null&&H!==101)return!1;let Y=new sq;for(let[ve,xe]of Object.entries(J)){if(xe==null)continue;let He=ve.toLowerCase();if(Array.isArray(xe))for(let Jo of xe)Y.append(He,String(Jo),!0);else Y.append(He,String(xe),!0)}return q({status:H,statusText:mR[H],headersList:Y,socket:X}),!0},onUpgrade(D,H,J){if(J.session!=null&&D!==200||J.session==null&&D!==101)return!1;let X=new sq;for(let Y=0;Y<H.length;Y+=2){let ve=cR(H[Y]),xe=H[Y+1];if(Array.isArray(xe)&&!Buffer.isBuffer(H[Y+1]))for(let He of xe)X.append(ve,He.toString("latin1"),!0);else X.append(ve,xe.toString("latin1"),!0)}return q({status:D,statusText:mR[D],headersList:X,socket:J}),!0}}))}}yR.exports={fetch:Rqe,Fetch:fb,fetching:hR,finalizeAndReportTiming:gR}});var vR=f((e8e,AR)=>{"use strict";var Mqe=require("assert"),{URLSerializer:kR}=ma(),{isValidHeaderName:Lqe}=_t();function Pqe(o,e,t=!1){let a=kR(o,t),i=kR(e,t);return a===i}function Fqe(o){Mqe(o!==null);let e=[];for(let t of o.split(","))t=t.trim(),Lqe(t)&&e.push(t);return e}AR.exports={urlEquals:Pqe,getFieldValues:Fqe}});var qR=f((o8e,zR)=>{"use strict";var hq=require("assert"),{kConstruct:$qe}=Ue(),{urlEquals:Hqe,getFieldValues:fq}=vR(),{kEnumerableProperty:Js,isDisturbed:Gqe}=be(),{webidl:K}=To(),{cloneResponse:wR,fromInnerResponse:Vqe,getResponseState:Yqe}=cd(),{Request:dd,fromInnerRequest:Jqe,getRequestState:or}=xm(),{fetching:Wqe}=ud(),{urlIsHttpHttpsScheme:kb,readAllBytes:Zqe}=_t(),{createDeferredPromise:zm}=zu(),Ab=class o{#e;constructor(){arguments[0]!==$qe&&K.illegalConstructor(),K.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,t={}){K.brandCheck(this,o);let a="Cache.match";K.argumentLengthCheck(arguments,1,a),e=K.converters.RequestInfo(e),t=K.converters.CacheQueryOptions(t,a,"options");let i=this.#r(e,t,1);if(i.length!==0)return i[0]}async matchAll(e=void 0,t={}){K.brandCheck(this,o);let a="Cache.matchAll";return e!==void 0&&(e=K.converters.RequestInfo(e)),t=K.converters.CacheQueryOptions(t,a,"options"),this.#r(e,t)}async add(e){K.brandCheck(this,o),K.argumentLengthCheck(arguments,1,"Cache.add"),e=K.converters.RequestInfo(e);let a=[e];return await this.addAll(a)}async addAll(e){K.brandCheck(this,o);let t="Cache.addAll";K.argumentLengthCheck(arguments,1,t);let a=[],i=[];for(let d of e){if(d===void 0)throw K.errors.conversionFailed({prefix:t,argument:"Argument 1",types:["undefined is not allowed"]});if(d=K.converters.RequestInfo(d),typeof d=="string")continue;let g=or(d);if(!kb(g.url)||g.method!=="GET")throw K.errors.exception({header:t,message:"Expected http/s scheme when method is not GET."})}let r=[];for(let d of e){let g=or(new dd(d));if(!kb(g.url))throw K.errors.exception({header:t,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",i.push(g);let h=zm();r.push(Wqe({request:g,processResponse(k){if(k.type==="error"||k.status===206||k.status<200||k.status>299)h.reject(K.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(k.headersList.contains("vary")){let w=fq(k.headersList.get("vary"));for(let x of w)if(x==="*"){h.reject(K.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let E of r)E.abort();return}}},processResponseEndOfBody(k){if(k.aborted){h.reject(new DOMException("aborted","AbortError"));return}h.resolve(k)}})),a.push(h.promise)}let s=await Promise.all(a),c=[],m=0;for(let d of s){let g={type:"put",request:i[m],response:d};c.push(g),m++}let l=zm(),u=null;try{this.#o(c)}catch(d){u=d}return queueMicrotask(()=>{u===null?l.resolve(void 0):l.reject(u)}),l.promise}async put(e,t){K.brandCheck(this,o);let a="Cache.put";K.argumentLengthCheck(arguments,2,a),e=K.converters.RequestInfo(e),t=K.converters.Response(t,a,"response");let i=null;if(K.is.Request(e)?i=or(e):i=or(new dd(e)),!kb(i.url)||i.method!=="GET")throw K.errors.exception({header:a,message:"Expected an http/s scheme when method is not GET"});let r=Yqe(t);if(r.status===206)throw K.errors.exception({header:a,message:"Got 206 status"});if(r.headersList.contains("vary")){let g=fq(r.headersList.get("vary"));for(let h of g)if(h==="*")throw K.errors.exception({header:a,message:"Got * vary field value"})}if(r.body&&(Gqe(r.body.stream)||r.body.stream.locked))throw K.errors.exception({header:a,message:"Response body is locked or disturbed"});let n=wR(r),s=zm();if(r.body!=null){let h=r.body.stream.getReader();Zqe(h,s.resolve,s.reject)}else s.resolve(void 0);let c=[],m={type:"put",request:i,response:n};c.push(m);let l=await s.promise;n.body!=null&&(n.body.source=l);let u=zm(),d=null;try{this.#o(c)}catch(g){d=g}return queueMicrotask(()=>{d===null?u.resolve():u.reject(d)}),u.promise}async delete(e,t={}){K.brandCheck(this,o);let a="Cache.delete";K.argumentLengthCheck(arguments,1,a),e=K.converters.RequestInfo(e),t=K.converters.CacheQueryOptions(t,a,"options");let i=null;if(K.is.Request(e)){if(i=or(e),i.method!=="GET"&&!t.ignoreMethod)return!1}else hq(typeof e=="string"),i=or(new dd(e));let r=[],n={type:"delete",request:i,options:t};r.push(n);let s=zm(),c=null,m;try{m=this.#o(r)}catch(l){c=l}return queueMicrotask(()=>{c===null?s.resolve(!!m?.length):s.reject(c)}),s.promise}async keys(e=void 0,t={}){K.brandCheck(this,o);let a="Cache.keys";e!==void 0&&(e=K.converters.RequestInfo(e)),t=K.converters.CacheQueryOptions(t,a,"options");let i=null;if(e!==void 0)if(K.is.Request(e)){if(i=or(e),i.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(i=or(new dd(e)));let r=zm(),n=[];if(e===void 0)for(let s of this.#e)n.push(s[0]);else{let s=this.#a(i,t);for(let c of s)n.push(c[0])}return queueMicrotask(()=>{let s=[];for(let c of n){let m=Jqe(c,void 0,new AbortController().signal,"immutable");s.push(m)}r.resolve(Object.freeze(s))}),r.promise}#o(e){let t=this.#e,a=[...t],i=[],r=[];try{for(let n of e){if(n.type!=="delete"&&n.type!=="put")throw K.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(n.type==="delete"&&n.response!=null)throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#a(n.request,n.options,i).length)throw new DOMException("???","InvalidStateError");let s;if(n.type==="delete"){if(s=this.#a(n.request,n.options),s.length===0)return[];for(let c of s){let m=t.indexOf(c);hq(m!==-1),t.splice(m,1)}}else if(n.type==="put"){if(n.response==null)throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let c=n.request;if(!kb(c.url))throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(c.method!=="GET")throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(n.options!=null)throw K.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});s=this.#a(n.request);for(let m of s){let l=t.indexOf(m);hq(l!==-1),t.splice(l,1)}t.push([n.request,n.response]),i.push([n.request,n.response])}r.push([n.request,n.response])}return r}catch(n){throw this.#e.length=0,this.#e=a,n}}#a(e,t,a){let i=[],r=a??this.#e;for(let n of r){let[s,c]=n;this.#i(e,s,c,t)&&i.push(n)}return i}#i(e,t,a=null,i){let r=new URL(e.url),n=new URL(t.url);if(i?.ignoreSearch&&(n.search="",r.search=""),!Hqe(r,n,!0))return!1;if(a==null||i?.ignoreVary||!a.headersList.contains("vary"))return!0;let s=fq(a.headersList.get("vary"));for(let c of s){if(c==="*")return!1;let m=t.headersList.get(c),l=e.headersList.get(c);if(m!==l)return!1}return!0}#r(e,t,a=1/0){let i=null;if(e!==void 0)if(K.is.Request(e)){if(i=or(e),i.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(i=or(new dd(e)));let r=[];if(e===void 0)for(let s of this.#e)r.push(s[1]);else{let s=this.#a(i,t);for(let c of s)r.push(c[1])}let n=[];for(let s of r){let c=Vqe(wR(s),"immutable");if(n.push(c),n.length>=a)break}return Object.freeze(n)}};Object.defineProperties(Ab.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:Js,matchAll:Js,add:Js,addAll:Js,put:Js,delete:Js,keys:Js});var xR=[{key:"ignoreSearch",converter:K.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:K.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:K.converters.boolean,defaultValue:()=>!1}];K.converters.CacheQueryOptions=K.dictionaryConverter(xR);K.converters.MultiCacheQueryOptions=K.dictionaryConverter([...xR,{key:"cacheName",converter:K.converters.DOMString}]);K.converters.Response=K.interfaceConverter(K.is.Response,"Response");K.converters["sequence<RequestInfo>"]=K.sequenceConverter(K.converters.RequestInfo);zR.exports={Cache:Ab}});var IR=f((t8e,ER)=>{"use strict";var{Cache:vb}=qR(),{webidl:Go}=To(),{kEnumerableProperty:gd}=be(),{kConstruct:pd}=Ue(),wb=class o{#e=new Map;constructor(){arguments[0]!==pd&&Go.illegalConstructor(),Go.util.markAsUncloneable(this)}async match(e,t={}){if(Go.brandCheck(this,o),Go.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=Go.converters.RequestInfo(e),t=Go.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let a=this.#e.get(t.cacheName);return await new vb(pd,a).match(e,t)}}else for(let a of this.#e.values()){let r=await new vb(pd,a).match(e,t);if(r!==void 0)return r}}async has(e){Go.brandCheck(this,o);let t="CacheStorage.has";return Go.argumentLengthCheck(arguments,1,t),e=Go.converters.DOMString(e,t,"cacheName"),this.#e.has(e)}async open(e){Go.brandCheck(this,o);let t="CacheStorage.open";if(Go.argumentLengthCheck(arguments,1,t),e=Go.converters.DOMString(e,t,"cacheName"),this.#e.has(e)){let i=this.#e.get(e);return new vb(pd,i)}let a=[];return this.#e.set(e,a),new vb(pd,a)}async delete(e){Go.brandCheck(this,o);let t="CacheStorage.delete";return Go.argumentLengthCheck(arguments,1,t),e=Go.converters.DOMString(e,t,"cacheName"),this.#e.delete(e)}async keys(){return Go.brandCheck(this,o),[...this.#e.keys()]}};Object.defineProperties(wb.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:gd,has:gd,open:gd,delete:gd,keys:gd});ER.exports={CacheStorage:wb}});var CR=f((a8e,jR)=>{"use strict";jR.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var kq=f((i8e,_R)=>{"use strict";function Kqe(o){for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t>=0&&t<=8||t>=10&&t<=31||t===127)return!0}return!1}function bq(o){for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t<33||t>126||t===34||t===40||t===41||t===60||t===62||t===64||t===44||t===59||t===58||t===92||t===47||t===91||t===93||t===63||t===61||t===123||t===125)throw new Error("Invalid cookie name")}}function yq(o){let e=o.length,t=0;if(o[0]==='"'){if(e===1||o[e-1]!=='"')throw new Error("Invalid cookie value");--e,++t}for(;t<e;){let a=o.charCodeAt(t++);if(a<33||a>126||a===34||a===44||a===59||a===92)throw new Error("Invalid cookie value")}}function BR(o){for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t<32||t>126||t===59)throw new Error("Invalid cookie path")}}function SR(o){return o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122}function Xqe(o){if(o===" ")return;if(o.length>255)throw new Error("Invalid cookie domain");let e=0;for(let t=0;t<o.length;++t){let a=o.charCodeAt(t);if(a===46){if(e===0)throw new Error("Invalid cookie domain");if(o.charCodeAt(t-1)===45)throw new Error("Invalid cookie domain");e=0;continue}if(e===0&&!SR(a))throw new Error("Invalid cookie domain");if(!SR(a)&&a!==45)throw new Error("Invalid cookie domain");if(++e>63)throw new Error("Invalid cookie domain")}if(e===0||o.charCodeAt(o.length-1)===45)throw new Error("Invalid cookie domain")}var eEe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],oEe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xb=Array(61).fill(0).map((o,e)=>e.toString().padStart(2,"0"));function QR(o){return typeof o=="number"&&(o=new Date(o)),`${eEe[o.getUTCDay()]}, ${xb[o.getUTCDate()]} ${oEe[o.getUTCMonth()]} ${o.getUTCFullYear()} ${xb[o.getUTCHours()]}:${xb[o.getUTCMinutes()]}:${xb[o.getUTCSeconds()]} GMT`}function tEe(o){if(o<0)throw new Error("Invalid cookie max-age")}function aEe(o){if(o.name.length===0)return null;bq(o.name),yq(o.value);let e=[`${o.name}=${o.value}`];o.name.startsWith("__Secure-")&&(o.secure=!0),o.name.startsWith("__Host-")&&(o.secure=!0,o.domain=null,o.path="/"),o.secure&&e.push("Secure"),o.httpOnly&&e.push("HttpOnly"),typeof o.maxAge=="number"&&(tEe(o.maxAge),e.push(`Max-Age=${o.maxAge}`)),o.domain&&(Xqe(o.domain),e.push(`Domain=${o.domain}`)),o.path&&(BR(o.path),e.push(`Path=${o.path}`)),o.expires&&o.expires.toString()!=="Invalid Date"&&e.push(`Expires=${QR(o.expires)}`),o.sameSite&&e.push(`SameSite=${o.sameSite}`);for(let t of o.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");let[a,...i]=t.split("="),r=a.trim(),n=i.join("=");bq(r),yq(n),e.push(`${r}=${n}`)}return e.join("; ")}_R.exports={isCTLExcludingHtab:Kqe,validateCookieName:bq,validateCookiePath:BR,validateCookieValue:yq,toIMFDate:QR,stringify:aEe}});var TR=f((r8e,DR)=>{"use strict";var{collectASequenceOfCodePointsFast:zb}=Er(),{maxNameValuePairSize:iEe,maxAttributeValueSize:rEe}=CR(),{isCTLExcludingHtab:nEe}=kq(),sEe=require("assert");function cEe(o){if(nEe(o))return null;let e="",t="",a="",i="";if(o.includes(";")){let r={position:0};e=zb(";",o,r),t=o.slice(r.position)}else e=o;if(!e.includes("="))i=e;else{let r={position:0};a=zb("=",e,r),i=e.slice(r.position+1)}return a=a.trim(),i=i.trim(),a.length+i.length>iEe?null:{name:a,value:i,...qm(t)}}function qm(o,e={}){if(o.length===0)return e;sEe(o[0]===";"),o=o.slice(1);let t="";o.includes(";")?(t=zb(";",o,{position:0}),o=o.slice(t.length)):(t=o,o="");let a="",i="";if(t.includes("=")){let n={position:0};a=zb("=",t,n),i=t.slice(n.position+1)}else a=t;if(a=a.trim(),i=i.trim(),i.length>rEe)return qm(o,e);let r=a.toLowerCase();if(r==="expires"){let n=new Date(i);e.expires=n}else if(r==="max-age"){let n=i.charCodeAt(0);if((n<48||n>57)&&i[0]!=="-"||!/^\d+$/.test(i))return qm(o,e);let s=Number(i);e.maxAge=s}else if(r==="domain"){let n=i;n[0]==="."&&(n=n.slice(1)),n=n.toLowerCase(),e.domain=n}else if(r==="path"){let n="";i.length===0||i[0]!=="/"?n="/":n=i,e.path=n}else if(r==="secure")e.secure=!0;else if(r==="httponly")e.httpOnly=!0;else if(r==="samesite"){let n=i.toLowerCase();n==="none"?e.sameSite="None":n==="strict"?e.sameSite="Strict":n==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${a}=${i}`);return qm(o,e)}DR.exports={parseSetCookie:cEe,parseUnparsedAttributes:qm}});var UR=f((n8e,OR)=>{"use strict";var{parseSetCookie:RR}=TR(),{stringify:mEe}=kq(),{webidl:je}=To(),{Headers:lEe}=Hs(),qb=je.brandCheckMultiple([lEe,globalThis.Headers].filter(Boolean));function uEe(o){je.argumentLengthCheck(arguments,1,"getCookies"),qb(o);let e=o.get("cookie"),t={};if(!e)return t;for(let a of e.split(";")){let[i,...r]=a.split("=");t[i.trim()]=r.join("=")}return t}function dEe(o,e,t){qb(o);let a="deleteCookie";je.argumentLengthCheck(arguments,2,a),e=je.converters.DOMString(e,a,"name"),t=je.converters.DeleteCookieAttributes(t),NR(o,{name:e,value:"",expires:new Date(0),...t})}function gEe(o){je.argumentLengthCheck(arguments,1,"getSetCookies"),qb(o);let e=o.getSetCookie();return e?e.map(t=>RR(t)):[]}function pEe(o){return o=je.converters.DOMString(o),RR(o)}function NR(o,e){je.argumentLengthCheck(arguments,2,"setCookie"),qb(o),e=je.converters.Cookie(e);let t=mEe(e);t&&o.append("set-cookie",t,!0)}je.converters.DeleteCookieAttributes=je.dictionaryConverter([{converter:je.nullableConverter(je.converters.DOMString),key:"path",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.DOMString),key:"domain",defaultValue:()=>null}]);je.converters.Cookie=je.dictionaryConverter([{converter:je.converters.DOMString,key:"name"},{converter:je.converters.DOMString,key:"value"},{converter:je.nullableConverter(o=>typeof o=="number"?je.converters["unsigned long long"](o):new Date(o)),key:"expires",defaultValue:()=>null},{converter:je.nullableConverter(je.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.DOMString),key:"path",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.boolean),key:"secure",defaultValue:()=>null},{converter:je.nullableConverter(je.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:je.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:je.sequenceConverter(je.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]);OR.exports={getCookies:uEe,deleteCookie:dEe,getSetCookies:gEe,setCookie:NR,parseCookie:pEe}});var jb=f((s8e,LR)=>{"use strict";var{webidl:ee}=To(),{kEnumerableProperty:bt}=be(),{kConstruct:MR}=Ue(),Em=class o extends Event{#e;constructor(e,t={}){if(e===MR){super(arguments[1],arguments[2]),ee.util.markAsUncloneable(this);return}let a="MessageEvent constructor";ee.argumentLengthCheck(arguments,1,a),e=ee.converters.DOMString(e,a,"type"),t=ee.converters.MessageEventInit(t,a,"eventInitDict"),super(e,t),this.#e=t,ee.util.markAsUncloneable(this)}get data(){return ee.brandCheck(this,o),this.#e.data}get origin(){return ee.brandCheck(this,o),this.#e.origin}get lastEventId(){return ee.brandCheck(this,o),this.#e.lastEventId}get source(){return ee.brandCheck(this,o),this.#e.source}get ports(){return ee.brandCheck(this,o),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,a=!1,i=null,r="",n="",s=null,c=[]){return ee.brandCheck(this,o),ee.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new o(e,{bubbles:t,cancelable:a,data:i,origin:r,lastEventId:n,source:s,ports:c})}static createFastMessageEvent(e,t){let a=new o(MR,e,t);return a.#e=t,a.#e.data??=null,a.#e.origin??="",a.#e.lastEventId??="",a.#e.source??=null,a.#e.ports??=[],a}},{createFastMessageEvent:hEe}=Em;delete Em.createFastMessageEvent;var Eb=class o extends Event{#e;constructor(e,t={}){let a="CloseEvent constructor";ee.argumentLengthCheck(arguments,1,a),e=ee.converters.DOMString(e,a,"type"),t=ee.converters.CloseEventInit(t),super(e,t),this.#e=t,ee.util.markAsUncloneable(this)}get wasClean(){return ee.brandCheck(this,o),this.#e.wasClean}get code(){return ee.brandCheck(this,o),this.#e.code}get reason(){return ee.brandCheck(this,o),this.#e.reason}},Ib=class o extends Event{#e;constructor(e,t){let a="ErrorEvent constructor";ee.argumentLengthCheck(arguments,1,a),super(e,t),ee.util.markAsUncloneable(this),e=ee.converters.DOMString(e,a,"type"),t=ee.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return ee.brandCheck(this,o),this.#e.message}get filename(){return ee.brandCheck(this,o),this.#e.filename}get lineno(){return ee.brandCheck(this,o),this.#e.lineno}get colno(){return ee.brandCheck(this,o),this.#e.colno}get error(){return ee.brandCheck(this,o),this.#e.error}};Object.defineProperties(Em.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:bt,origin:bt,lastEventId:bt,source:bt,ports:bt,initMessageEvent:bt});Object.defineProperties(Eb.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:bt,code:bt,wasClean:bt});Object.defineProperties(Ib.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:bt,filename:bt,lineno:bt,colno:bt,error:bt});ee.converters.MessagePort=ee.interfaceConverter(ee.is.MessagePort,"MessagePort");ee.converters["sequence<MessagePort>"]=ee.sequenceConverter(ee.converters.MessagePort);var Aq=[{key:"bubbles",converter:ee.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:ee.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:ee.converters.boolean,defaultValue:()=>!1}];ee.converters.MessageEventInit=ee.dictionaryConverter([...Aq,{key:"data",converter:ee.converters.any,defaultValue:()=>null},{key:"origin",converter:ee.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:ee.converters.DOMString,defaultValue:()=>""},{key:"source",converter:ee.nullableConverter(ee.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:ee.converters["sequence<MessagePort>"],defaultValue:()=>[]}]);ee.converters.CloseEventInit=ee.dictionaryConverter([...Aq,{key:"wasClean",converter:ee.converters.boolean,defaultValue:()=>!1},{key:"code",converter:ee.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:ee.converters.USVString,defaultValue:()=>""}]);ee.converters.ErrorEventInit=ee.dictionaryConverter([...Aq,{key:"message",converter:ee.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:ee.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:ee.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:ee.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:ee.converters.any}]);LR.exports={MessageEvent:Em,CloseEvent:Eb,ErrorEvent:Ib,createFastMessageEvent:hEe}});var Rn=f((c8e,PR)=>{"use strict";var fEe="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",bEe={enumerable:!0,writable:!1,configurable:!1},yEe={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},kEe={SENT:1,RECEIVED:2},AEe={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},vEe=65535,wEe={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},xEe=Buffer.allocUnsafe(0),zEe={text:1,typedArray:2,arrayBuffer:3,blob:4};PR.exports={uid:fEe,sentCloseFrameState:kEe,staticPropertyDescriptors:bEe,states:yEe,opcodes:AEe,maxUnsigned16Bit:vEe,parserStates:wEe,emptyBuffer:xEe,sendHints:zEe}});var Ws=f((m8e,VR)=>{"use strict";var{states:Cb,opcodes:Im}=Rn(),{isUtf8:qEe}=require("buffer"),{removeHTTPWhitespace:FR}=ma(),{collectASequenceOfCodePointsFast:EEe}=Er();function IEe(o){return o===Cb.CONNECTING}function jEe(o){return o===Cb.OPEN}function CEe(o){return o===Cb.CLOSING}function SEe(o){return o===Cb.CLOSED}function BEe(o,e,t=(i,r)=>new Event(i,r),a={}){let i=t(o,a);e.dispatchEvent(i)}function QEe(o,e,t){o.onMessage(e,t)}function _Ee(o){return o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer}function DEe(o){if(o.length===0)return!1;for(let e=0;e<o.length;++e){let t=o.charCodeAt(e);if(t<33||t>126||t===34||t===40||t===41||t===44||t===47||t===58||t===59||t===60||t===61||t===62||t===63||t===64||t===91||t===92||t===93||t===123||t===125)return!1}return!0}function TEe(o){return o>=1e3&&o<1015?o!==1004&&o!==1005&&o!==1006:o>=3e3&&o<=4999}function $R(o){return o===Im.CLOSE||o===Im.PING||o===Im.PONG}function HR(o){return o===Im.CONTINUATION}function GR(o){return o===Im.TEXT||o===Im.BINARY}function REe(o){return GR(o)||HR(o)||$R(o)}function NEe(o){let e={position:0},t=new Map;for(;e.position<o.length;){let a=EEe(";",o,e),[i,r=""]=a.split("=",2);t.set(FR(i,!0,!1),FR(r,!1,!0)),e.position++}return t}function OEe(o){if(o.length===0)return!1;for(let t=0;t<o.length;t++){let a=o.charCodeAt(t);if(a<48||a>57)return!1}let e=Number.parseInt(o,10);return e>=8&&e<=15}function UEe(o,e){let t;try{t=new URL(o,e)}catch(a){throw new DOMException(a,"SyntaxError")}if(t.protocol==="http:"?t.protocol="ws:":t.protocol==="https:"&&(t.protocol="wss:"),t.protocol!=="ws:"&&t.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(t.hash.length||t.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return t}function MEe(o,e){if(o!==null&&o!==1e3&&(o<3e3||o>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let t=Buffer.byteLength(e);if(t>123)throw new DOMException(`Reason must be less than 123 bytes; received ${t}`,"SyntaxError")}}var LEe=(()=>{if(typeof process.versions.icu=="string"){let o=new TextDecoder("utf-8",{fatal:!0});return o.decode.bind(o)}return function(o){if(qEe(o))return o.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();VR.exports={isConnecting:IEe,isEstablished:jEe,isClosing:CEe,isClosed:SEe,fireEvent:BEe,isValidSubprotocol:DEe,isValidStatusCode:TEe,websocketMessageReceived:QEe,utf8Decode:LEe,isControlFrame:$R,isContinuationFrame:HR,isTextBinaryFrame:GR,isValidOpcode:REe,parseExtensions:NEe,isValidClientWindowBits:OEe,toArrayBuffer:_Ee,getURLRecord:UEe,validateCloseCodeAndReason:MEe}});var Cm=f((l8e,JR)=>{"use strict";var{runtimeFeatures:PEe}=Ir(),{maxUnsigned16Bit:YR,opcodes:FEe}=Rn(),Sb=8*1024,hd=null,jm=Sb,$Ee=PEe.has("crypto")?require("crypto").randomFillSync:function(e,t,a){for(let i=0;i<e.length;++i)e[i]=Math.random()*255|0;return e};function vq(){return jm===Sb&&(jm=0,$Ee(hd??=Buffer.allocUnsafeSlow(Sb),0,Sb)),[hd[jm++],hd[jm++],hd[jm++],hd[jm++]]}var wq=class{constructor(e){this.frameData=e}createFrame(e){let t=this.frameData,a=vq(),i=t?.byteLength??0,r=i,n=6;i>YR?(n+=8,r=127):i>125&&(n+=2,r=126);let s=Buffer.allocUnsafe(i+n);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e;s[n-4]=a[0],s[n-3]=a[1],s[n-2]=a[2],s[n-1]=a[3],s[1]=r,r===126?s.writeUInt16BE(i,2):r===127&&(s[2]=s[3]=0,s.writeUIntBE(i,4,6)),s[1]|=128;for(let c=0;c<i;++c)s[n+c]=t[c]^a[c&3];return s}static createFastTextFrame(e){let t=vq(),a=e.length;for(let s=0;s<a;++s)e[s]^=t[s&3];let i=a,r=6;a>YR?(r+=8,i=127):a>125&&(r+=2,i=126);let n=Buffer.allocUnsafeSlow(r);return n[0]=128|FEe.TEXT,n[1]=i|128,n[r-4]=t[0],n[r-3]=t[1],n[r-2]=t[2],n[r-1]=t[3],i===126?n.writeUInt16BE(a,2):i===127&&(n[2]=n[3]=0,n.writeUIntBE(a,4,6)),[n,e]}};JR.exports={WebsocketFrameSend:wq,generateMask:vq}});var Bb=f((u8e,oN)=>{"use strict";var{uid:HEe,states:xq,sentCloseFrameState:zq,emptyBuffer:WR,opcodes:GEe}=Rn(),{parseExtensions:VEe,isClosed:YEe,isClosing:JEe,isEstablished:XR,isConnecting:WEe,validateCloseCodeAndReason:ZEe}=Ws(),{makeRequest:KEe}=xm(),{fetching:XEe}=ud(),{Headers:e1e,getHeadersList:o1e}=Hs(),{getDecodeSplit:t1e}=_t(),{WebsocketFrameSend:a1e}=Cm(),i1e=require("assert"),{runtimeFeatures:r1e}=Ir(),ZR=r1e.has("crypto")?require("crypto"):null,KR=!1;function n1e(o,e,t,a,i){let r=o;r.protocol=o.protocol==="ws:"?"http:":"https:";let n=KEe({urlList:[r],client:t,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(i.headers){let l=o1e(new e1e(i.headers));n.headersList=l}let s=ZR.randomBytes(16).toString("base64");n.headersList.append("sec-websocket-key",s,!0),n.headersList.append("sec-websocket-version","13",!0);for(let l of e)n.headersList.append("sec-websocket-protocol",l,!0);return n.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),XEe({request:n,useParallelQueue:!0,dispatcher:i.dispatcher,processResponse(l){if(l.type==="error"||l.status!==101){if(l.socket?.session==null){tr(a,1002,"Received network error or non-101 status code.",l.error);return}if(l.status!==200){tr(a,1002,"Received network error or non-200 status code.",l.error);return}}if(KR===!1&&l.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),KR=!0),e.length!==0&&!l.headersList.get("Sec-WebSocket-Protocol")){tr(a,1002,"Server did not respond with sent protocols.");return}if(l.socket.session==null&&l.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){tr(a,1002,'Server did not set Upgrade header to "websocket".');return}if(l.socket.session==null&&l.headersList.get("Connection")?.toLowerCase()!=="upgrade"){tr(a,1002,'Server did not set Connection header to "upgrade".');return}let u=l.headersList.get("Sec-WebSocket-Accept"),d=ZR.hash("sha1",s+HEe,"base64");if(u!==d){tr(a,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=l.headersList.get("Sec-WebSocket-Extensions"),h;if(g!==null&&(h=VEe(g),!h.has("permessage-deflate"))){tr(a,1002,"Sec-WebSocket-Extensions header does not match.");return}let k=l.headersList.get("Sec-WebSocket-Protocol");if(k!==null&&!t1e("sec-websocket-protocol",n.headersList).includes(k)){tr(a,1002,"Protocol was not set in the opening handshake.");return}l.socket.on("data",a.onSocketData),l.socket.on("close",a.onSocketClose),l.socket.on("error",a.onSocketError),a.wasEverConnected=!0,a.onConnectionEstablished(l,h)}})}function eN(o,e,t,a=!1){if(e??=null,t??="",a&&ZEe(e,t),!(YEe(o.readyState)||JEe(o.readyState)))if(!XR(o.readyState))tr(o),o.readyState=xq.CLOSING;else if(!o.closeState.has(zq.SENT)&&!o.closeState.has(zq.RECEIVED)){let i=new a1e;t.length!==0&&e===null&&(e=1e3),i1e(e===null||Number.isInteger(e)),e===null&&t.length===0?i.frameData=WR:e!==null&&t===null?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==null&&t!==null?(i.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(t)),i.frameData.writeUInt16BE(e,0),i.frameData.write(t,2,"utf-8")):i.frameData=WR,o.socket.write(i.createFrame(GEe.CLOSE)),o.closeState.add(zq.SENT),o.readyState=xq.CLOSING}else o.readyState=xq.CLOSING}function tr(o,e,t,a){XR(o.readyState)&&eN(o,e,t,!1),o.controller.abort(),WEe(o.readyState)?o.onSocketClose():o.socket?.destroyed===!1&&o.socket.destroy()}oN.exports={establishWebSocketConnection:n1e,failWebsocketConnection:tr,closeWebSocketConnection:eN}});var aN=f((d8e,tN)=>{"use strict";var{createInflateRaw:s1e,Z_DEFAULT_WINDOWBITS:c1e}=require("zlib"),{isValidClientWindowBits:m1e}=Ws(),{MessageSizeExceededError:l1e}=ge(),u1e=Buffer.from([0,0,255,255]),Qb=Symbol("kBuffer"),fd=Symbol("kLength"),qq=class{#e;#o={};#a=0;constructor(e,t){this.#o.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#o.serverMaxWindowBits=e.get("server_max_window_bits"),this.#a=t.maxPayloadSize}decompress(e,t,a){if(!this.#e){let i=c1e;if(this.#o.serverMaxWindowBits){if(!m1e(this.#o.serverMaxWindowBits)){a(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#o.serverMaxWindowBits)}try{this.#e=s1e({windowBits:i})}catch(r){a(r);return}this.#e[Qb]=[],this.#e[fd]=0,this.#e.on("data",r=>{if(this.#e[fd]+=r.length,this.#a>0&&this.#e[fd]>this.#a){a(new l1e),this.#e.removeAllListeners(),this.#e=null;return}this.#e[Qb].push(r)}),this.#e.on("error",r=>{this.#e=null,a(r)})}this.#e.write(e),t&&this.#e.write(u1e),this.#e.flush(()=>{if(!this.#e)return;let i=Buffer.concat(this.#e[Qb],this.#e[fd]);this.#e[Qb].length=0,this.#e[fd]=0,a(null,i)})}};tN.exports={PerMessageDeflate:qq}});var Cq=f((g8e,cN)=>{"use strict";var{Writable:d1e}=require("stream"),g1e=require("assert"),{parserStates:yt,opcodes:Sm,states:p1e,emptyBuffer:iN,sentCloseFrameState:bd}=Rn(),{isValidStatusCode:h1e,isValidOpcode:f1e,websocketMessageReceived:rN,utf8Decode:b1e,isControlFrame:Eq,isTextBinaryFrame:Iq,isContinuationFrame:y1e}=Ws(),{failWebsocketConnection:Vo}=Bb(),{WebsocketFrameSend:nN}=Cm(),{PerMessageDeflate:k1e}=aN(),{MessageSizeExceededError:sN}=ge(),jq=class extends d1e{#e=[];#o=0;#a=0;#i=!1;#r=yt.INFO;#t={};#c=[];#n;#s;#m;#u;constructor(e,t,a={}){super(),this.#s=e,this.#n=t??new Map,this.#m=a.maxFragments??0,this.#u=a.maxPayloadSize??0,this.#n.has("permessage-deflate")&&this.#n.set("permessage-deflate",new k1e(t,a))}_write(e,t,a){this.#e.push(e),this.#a+=e.length,this.#i=!0,this.run(a)}#l(){return this.#u>0&&!Eq(this.#t.opcode)&&this.#t.payloadLength+this.#o>this.#u?(Vo(this.#s,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#i;)if(this.#r===yt.INFO){if(this.#a<2)return e();let t=this.consume(2),a=(t[0]&128)!==0,i=t[0]&15,r=(t[1]&128)===128,n=!a&&i!==Sm.CONTINUATION,s=t[1]&127,c=t[0]&64,m=t[0]&32,l=t[0]&16;if(!f1e(i))return Vo(this.#s,1002,"Invalid opcode received"),e();if(r)return Vo(this.#s,1002,"Frame cannot be masked"),e();if(c!==0&&!this.#n.has("permessage-deflate")){Vo(this.#s,1002,"Expected RSV1 to be clear.");return}if(m!==0||l!==0){Vo(this.#s,1002,"RSV1, RSV2, RSV3 must be clear");return}if(n&&!Iq(i)){Vo(this.#s,1002,"Invalid frame type was fragmented.");return}if(Iq(i)&&this.#c.length>0){Vo(this.#s,1002,"Expected continuation frame");return}if(this.#t.fragmented&&n){Vo(this.#s,1002,"Fragmented frame exceeded 125 bytes.");return}if((s>125||n)&&Eq(i)){Vo(this.#s,1002,"Control frame either too large or fragmented");return}if(y1e(i)&&this.#c.length===0&&!this.#t.compressed){Vo(this.#s,1002,"Unexpected continuation frame");return}if(s<=125){if(this.#t.payloadLength=s,this.#r=yt.READ_DATA,!this.#l())return}else s===126?this.#r=yt.PAYLOADLENGTH_16:s===127&&(this.#r=yt.PAYLOADLENGTH_64);Iq(i)&&(this.#t.binaryType=i,this.#t.compressed=c!==0),this.#t.opcode=i,this.#t.masked=r,this.#t.fin=a,this.#t.fragmented=n}else if(this.#r===yt.PAYLOADLENGTH_16){if(this.#a<2)return e();let t=this.consume(2);if(this.#t.payloadLength=t.readUInt16BE(0),this.#r=yt.READ_DATA,!this.#l())return}else if(this.#r===yt.PAYLOADLENGTH_64){if(this.#a<8)return e();let t=this.consume(8),a=t.readUInt32BE(0),i=t.readUInt32BE(4);if(a!==0||i>2**31-1){Vo(this.#s,1009,"Received payload length > 2^31 bytes.");return}if(this.#t.payloadLength=i,this.#r=yt.READ_DATA,!this.#l())return}else if(this.#r===yt.READ_DATA){if(this.#a<this.#t.payloadLength)return e();let t=this.consume(this.#t.payloadLength);if(Eq(this.#t.opcode))this.#i=this.parseControlFrame(t),this.#r=yt.INFO;else if(this.#t.compressed){this.#n.get("permessage-deflate").decompress(t,this.#t.fin,(a,i)=>{if(a){let r=a instanceof sN?1009:1007;Vo(this.#s,r,a.message);return}if(this.writeFragments(i)){if(this.#u>0&&this.#o>this.#u){Vo(this.#s,1009,new sN().message);return}if(!this.#t.fin){this.#r=yt.INFO,this.#i=!0,this.run(e);return}rN(this.#s,this.#t.binaryType,this.consumeFragments()),this.#i=!0,this.#r=yt.INFO,this.run(e)}},this.#o),this.#i=!1;break}else{if(!this.writeFragments(t))return;!this.#t.fragmented&&this.#t.fin&&rN(this.#s,this.#t.binaryType,this.consumeFragments()),this.#r=yt.INFO}}}consume(e){if(e>this.#a)throw new Error("Called consume() before buffers satiated.");if(e===0)return iN;this.#a-=e;let t=this.#e[0];if(t.length>e)return this.#e[0]=t.subarray(e,t.length),t.subarray(0,e);if(t.length===e)return this.#e.shift();{let a=0,i=Buffer.allocUnsafeSlow(e);for(;a!==e;){let r=this.#e[0],n=r.length;if(n+a===e){i.set(this.#e.shift(),a);break}else if(n+a>e){i.set(r.subarray(0,e-a),a),this.#e[0]=r.subarray(e-a);break}else i.set(this.#e.shift(),a),a+=n}return i}}writeFragments(e){return this.#m>0&&this.#c.length===this.#m?(Vo(this.#s,1008,"Too many message fragments"),!1):(this.#o+=e.length,this.#c.push(e),!0)}consumeFragments(){let e=this.#c;if(e.length===1)return this.#o=0,e.shift();let t=0,a=Buffer.allocUnsafeSlow(this.#o);for(let i=0;i<e.length;++i){let r=e[i];a.set(r,t),t+=r.length}return this.#c=[],this.#o=0,a}parseCloseBody(e){g1e(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!h1e(t))return{code:1002,reason:"Invalid status code",error:!0};let a=e.subarray(2);a[0]===239&&a[1]===187&&a[2]===191&&(a=a.subarray(3));try{a=b1e(a)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:t,reason:a,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:a}=this.#t;if(t===Sm.CLOSE){if(a===1)return Vo(this.#s,1002,"Received close frame with a 1-byte body."),!1;if(this.#t.closeInfo=this.parseCloseBody(e),this.#t.closeInfo.error){let{code:i,reason:r}=this.#t.closeInfo;return Vo(this.#s,i,r),!1}if(!this.#s.closeState.has(bd.SENT)&&!this.#s.closeState.has(bd.RECEIVED)){let i=iN;this.#t.closeInfo.code&&(i=Buffer.allocUnsafe(2),i.writeUInt16BE(this.#t.closeInfo.code,0));let r=new nN(i);this.#s.socket.write(r.createFrame(Sm.CLOSE)),this.#s.closeState.add(bd.SENT)}return this.#s.readyState=p1e.CLOSING,this.#s.closeState.add(bd.RECEIVED),!1}else if(t===Sm.PING){if(!this.#s.closeState.has(bd.RECEIVED)){let i=new nN(e);this.#s.socket.write(i.createFrame(Sm.PONG)),this.#s.onPing(e)}}else t===Sm.PONG&&this.#s.onPong(e);return!0}get closingInfo(){return this.#t.closeInfo}};cN.exports={ByteParser:jq}});var dN=f((p8e,uN)=>{"use strict";var{WebsocketFrameSend:lN}=Cm(),{opcodes:mN,sendHints:Zs}=Rn(),A1e=Wx(),Bq=class{#e=new A1e;#o=!1;#a;constructor(e){this.#a=e}add(e,t,a){if(a!==Zs.blob){if(this.#o){let r={promise:null,callback:t,frame:Sq(e,a)};this.#e.push(r)}else if(a===Zs.text){let{0:r,1:n}=lN.createFastTextFrame(e);this.#a.cork(),this.#a.write(r),this.#a.write(n,t),this.#a.uncork()}else this.#a.write(Sq(e,a),t);return}let i={promise:e.arrayBuffer().then(r=>{i.promise=null,i.frame=Sq(r,a)}),callback:t,frame:null};this.#e.push(i),this.#o||this.#i()}async#i(){this.#o=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#a.write(t.frame,t.callback),t.callback=t.frame=null}this.#o=!1}};function Sq(o,e){return new lN(v1e(o,e)).createFrame(e===Zs.text?mN.TEXT:mN.BINARY)}function v1e(o,e){switch(e){case Zs.text:case Zs.typedArray:return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);case Zs.arrayBuffer:case Zs.blob:return new Uint8Array(o)}}uN.exports={SendQueue:Bq}});var yN=f((h8e,bN)=>{"use strict";var{isArrayBuffer:w1e}=require("util/types"),{webidl:ie}=To(),{URLSerializer:x1e}=ma(),{environmentSettingsObject:gN}=_t(),{staticPropertyDescriptors:Nn,states:Or,sentCloseFrameState:Qq,sendHints:_b,opcodes:_q}=Rn(),{isConnecting:z1e,isEstablished:pN,isClosing:hN,isClosed:q1e,isValidSubprotocol:E1e,fireEvent:Db,utf8Decode:I1e,toArrayBuffer:j1e,getURLRecord:C1e}=Ws(),{establishWebSocketConnection:S1e,closeWebSocketConnection:B1e,failWebsocketConnection:fN}=Bb(),{ByteParser:Q1e}=Cq(),{kEnumerableProperty:ba}=be(),{getGlobalDispatcher:_1e}=Zf(),{ErrorEvent:D1e,CloseEvent:T1e,createFastMessageEvent:R1e}=jb(),{SendQueue:N1e}=dN(),{WebsocketFrameSend:O1e}=Cm(),{channels:ar}=hn();function U1e(o){return typeof o?.address=="function"?o.address():typeof o?.session?.socket?.address=="function"?o.session.socket.address():null}var at=class o extends EventTarget{#e={open:null,error:null,close:null,message:null};#o=0;#a="";#i="";#r;#t={onConnectionEstablished:(e,t)=>this.#m(e,t),onMessage:(e,t)=>this.#u(e,t),onParserError:e=>fN(this.#t,null,e.message),onParserDrain:()=>this.#l(),onSocketData:e=>{this.#s.write(e)||this.#t.socket.pause()},onSocketError:e=>{this.#t.readyState=Or.CLOSING,ar.socketError.hasSubscribers&&ar.socketError.publish(e),this.#t.socket.destroy()},onSocketClose:()=>this.#d(),onPing:e=>{ar.ping.hasSubscribers&&ar.ping.publish({payload:e,websocket:this})},onPong:e=>{ar.pong.hasSubscribers&&ar.pong.publish({payload:e,websocket:this})},readyState:Or.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;#n;#s;constructor(e,t=[]){super(),ie.util.markAsUncloneable(this);let a="WebSocket constructor";ie.argumentLengthCheck(arguments,1,a);let i=ie.converters["DOMString or sequence<DOMString> or WebSocketInit"](t,a,"options");e=ie.converters.USVString(e),t=i.protocols;let r=gN.settingsObject.baseUrl,n=C1e(e,r);if(typeof t=="string"&&(t=[t]),t.length!==new Set(t.map(c=>c.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every(c=>E1e(c)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#c=new URL(n.href);let s=gN.settingsObject;this.#t.controller=S1e(n,t,s,this.#t,i),this.#t.readyState=o.CONNECTING,this.#n="blob"}close(e=void 0,t=void 0){ie.brandCheck(this,o),e!==void 0&&(e=ie.converters["unsigned short"](e,"WebSocket.close","code",ie.attributes.Clamp)),t!==void 0&&(t=ie.converters.USVString(t)),e??=null,t??="",B1e(this.#t,e,t,!0)}send(e){ie.brandCheck(this,o);let t="WebSocket.send";if(ie.argumentLengthCheck(arguments,1,t),e=ie.converters.WebSocketSendData(e,t,"data"),z1e(this.#t.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!pN(this.#t.readyState)||hN(this.#t.readyState)))if(typeof e=="string"){let a=Buffer.from(e);this.#o+=a.byteLength,this.#r.add(a,()=>{this.#o-=a.byteLength},_b.text)}else w1e(e)?(this.#o+=e.byteLength,this.#r.add(e,()=>{this.#o-=e.byteLength},_b.arrayBuffer)):ArrayBuffer.isView(e)?(this.#o+=e.byteLength,this.#r.add(e,()=>{this.#o-=e.byteLength},_b.typedArray)):ie.is.Blob(e)&&(this.#o+=e.size,this.#r.add(e,()=>{this.#o-=e.size},_b.blob))}get readyState(){return ie.brandCheck(this,o),this.#t.readyState}get bufferedAmount(){return ie.brandCheck(this,o),this.#o}get url(){return ie.brandCheck(this,o),x1e(this.#c)}get extensions(){return ie.brandCheck(this,o),this.#i}get protocol(){return ie.brandCheck(this,o),this.#a}get onopen(){return ie.brandCheck(this,o),this.#e.open}set onopen(e){ie.brandCheck(this,o),this.#e.open&&this.removeEventListener("open",this.#e.open);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("open",t),this.#e.open=e):this.#e.open=null}get onerror(){return ie.brandCheck(this,o),this.#e.error}set onerror(e){ie.brandCheck(this,o),this.#e.error&&this.removeEventListener("error",this.#e.error);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("error",t),this.#e.error=e):this.#e.error=null}get onclose(){return ie.brandCheck(this,o),this.#e.close}set onclose(e){ie.brandCheck(this,o),this.#e.close&&this.removeEventListener("close",this.#e.close);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("close",t),this.#e.close=e):this.#e.close=null}get onmessage(){return ie.brandCheck(this,o),this.#e.message}set onmessage(e){ie.brandCheck(this,o),this.#e.message&&this.removeEventListener("message",this.#e.message);let t=ie.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("message",t),this.#e.message=e):this.#e.message=null}get binaryType(){return ie.brandCheck(this,o),this.#n}set binaryType(e){ie.brandCheck(this,o),e!=="blob"&&e!=="arraybuffer"?this.#n="blob":this.#n=e}#m(e,t){this.#t.socket=e.socket;let a=this.#t.controller.dispatcher?.webSocketOptions,i=a?.maxFragments,r=a?.maxPayloadSize,n=new Q1e(this.#t,t,{maxFragments:i,maxPayloadSize:r});n.on("drain",()=>this.#t.onParserDrain()),n.on("error",m=>this.#t.onParserError(m)),this.#s=n,this.#r=new N1e(e.socket),this.#t.readyState=Or.OPEN;let s=e.headersList.get("sec-websocket-extensions");s!==null&&(this.#i=s);let c=e.headersList.get("sec-websocket-protocol");if(c!==null&&(this.#a=c),Db("open",this),ar.open.hasSubscribers){let m=e.headersList.entries;ar.open.publish({address:U1e(e.socket),protocol:this.#a,extensions:this.#i,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:m}})}}#u(e,t){if(this.#t.readyState!==Or.OPEN)return;let a;if(e===_q.TEXT)try{a=I1e(t)}catch{fN(this.#t,1007,"Received invalid UTF-8 in text frame.");return}else e===_q.BINARY&&(this.#n==="blob"?a=new Blob([t]):a=j1e(t));Db("message",this,R1e,{origin:this.#c.origin,data:a})}#l(){this.#t.socket.resume()}#d(){let e=this.#t.closeState.has(Qq.SENT)&&this.#t.closeState.has(Qq.RECEIVED),t=1005,a="",i=this.#s?.closingInfo;i&&!i.error&&(t=i.code??1005,a=i.reason),this.#t.readyState=Or.CLOSED,this.#t.closeState.has(Qq.RECEIVED)||(t=1006,Db("error",this,(r,n)=>new D1e(r,n),{error:new TypeError(a)})),Db("close",this,(r,n)=>new T1e(r,n),{wasClean:e,code:t,reason:a}),ar.close.hasSubscribers&&ar.close.publish({websocket:this,code:t,reason:a})}static ping(e,t){if(Buffer.isBuffer(t)){if(t.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(t!==void 0)throw new TypeError("Expected buffer payload");let a=e.#t.readyState;if(pN(a)&&!hN(a)&&!q1e(a)){let i=new O1e(t);e.#t.socket.write(i.createFrame(_q.PING))}}},{ping:M1e}=at;Reflect.deleteProperty(at,"ping");at.CONNECTING=at.prototype.CONNECTING=Or.CONNECTING;at.OPEN=at.prototype.OPEN=Or.OPEN;at.CLOSING=at.prototype.CLOSING=Or.CLOSING;at.CLOSED=at.prototype.CLOSED=Or.CLOSED;Object.defineProperties(at.prototype,{CONNECTING:Nn,OPEN:Nn,CLOSING:Nn,CLOSED:Nn,url:ba,readyState:ba,bufferedAmount:ba,onopen:ba,onerror:ba,onclose:ba,close:ba,onmessage:ba,binaryType:ba,send:ba,extensions:ba,protocol:ba,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(at,{CONNECTING:Nn,OPEN:Nn,CLOSING:Nn,CLOSED:Nn});ie.converters["sequence<DOMString>"]=ie.sequenceConverter(ie.converters.DOMString);ie.converters["DOMString or sequence<DOMString>"]=function(o,e,t){return ie.util.Type(o)===ie.util.Types.OBJECT&&Symbol.iterator in o?ie.converters["sequence<DOMString>"](o):ie.converters.DOMString(o,e,t)};ie.converters.WebSocketInit=ie.dictionaryConverter([{key:"protocols",converter:ie.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:ie.converters.any,defaultValue:()=>_1e()},{key:"headers",converter:ie.nullableConverter(ie.converters.HeadersInit)}]);ie.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(o){return ie.util.Type(o)===ie.util.Types.OBJECT&&!(Symbol.iterator in o)?ie.converters.WebSocketInit(o):{protocols:ie.converters["DOMString or sequence<DOMString>"](o)}};ie.converters.WebSocketSendData=function(o){return ie.util.Type(o)===ie.util.Types.OBJECT&&(ie.is.Blob(o)||ie.is.BufferSource(o))?o:ie.converters.USVString(o)};bN.exports={WebSocket:at,ping:M1e}});var Dq=f((f8e,vN)=>{"use strict";var{webidl:Tb}=To(),{validateCloseCodeAndReason:L1e}=Ws(),{kConstruct:kN}=Ue(),{kEnumerableProperty:AN}=be();function P1e(){class o extends DOMException{get reason(){return""}}return new o().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,t,a){let i=Reflect.construct(e,t,e);return Object.setPrototypeOf(i,a.prototype),i}})}var Ks=class o extends P1e(){#e;#o;constructor(e="",t=void 0){if(e=Tb.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),t===kN)return;t!==null&&(t=Tb.converters.WebSocketCloseInfo(t));let a=t.closeCode??null,i=t.reason??"";L1e(a,i),i.length!==0&&a===null&&(a=1e3),this.#e=a,this.#o=i}get closeCode(){return this.#e}get reason(){return this.#o}static createUnvalidatedWebSocketError(e,t,a){let i=new o(e,kN);return i.#e=t,i.#o=a,i}},{createUnvalidatedWebSocketError:F1e}=Ks;delete Ks.createUnvalidatedWebSocketError;Object.defineProperties(Ks.prototype,{closeCode:AN,reason:AN,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Tb.is.WebSocketError=Tb.util.MakeTypeAssertion(Ks);vN.exports={WebSocketError:Ks,createUnvalidatedWebSocketError:F1e}});var EN=f((b8e,qN)=>{"use strict";var{createDeferredPromise:Tq}=zu(),{environmentSettingsObject:wN}=_t(),{states:Bm,opcodes:Rb,sentCloseFrameState:Qm}=Rn(),{webidl:go}=To(),{getURLRecord:$1e,isValidSubprotocol:H1e,isEstablished:G1e,utf8Decode:V1e}=Ws(),{establishWebSocketConnection:Y1e,failWebsocketConnection:Rq,closeWebSocketConnection:Nq}=Bb(),{channels:xN}=hn(),{WebsocketFrameSend:J1e}=Cm(),{ByteParser:W1e}=Cq(),{WebSocketError:Z1e,createUnvalidatedWebSocketError:K1e}=Dq(),{kEnumerableProperty:Nb}=be(),{utf8DecodeBytes:X1e}=tf(),zN=!1,Ob=class{#e;#o;#a;#i;#r;#t;#c=!1;#n={onConnectionEstablished:(e,t)=>this.#u(e,t),onMessage:(e,t)=>this.#l(e,t),onParserError:e=>Rq(this.#n,null,e.message),onParserDrain:()=>this.#n.socket.resume(),onSocketData:e=>{this.#s.write(e)||this.#n.socket.pause()},onSocketError:e=>{this.#n.readyState=Bm.CLOSING,xN.socketError.hasSubscribers&&xN.socketError.publish(e),this.#n.socket.destroy()},onSocketClose:()=>this.#d(),onPing:()=>{},onPong:()=>{},readyState:Bm.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;constructor(e,t=void 0){zN||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),zN=!0),go.argumentLengthCheck(arguments,1,"WebSocket"),e=go.converters.USVString(e),t!==null&&(t=go.converters.WebSocketStreamOptions(t));let a=wN.settingsObject.baseUrl,i=$1e(e,a),r=t.protocols;if(r.length!==new Set(r.map(s=>s.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(s=>H1e(s)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=i.toString(),this.#o=Tq(),this.#a=Tq(),t.signal!=null){let s=t.signal;if(s.aborted){this.#o.reject(s.reason),this.#a.reject(s.reason);return}s.addEventListener("abort",()=>{G1e(this.#n.readyState)||(Rq(this.#n),this.#n.readyState=Bm.CLOSING,this.#o.reject(s.reason),this.#a.reject(s.reason),this.#c=!0)},{once:!0})}let n=wN.settingsObject;this.#n.controller=Y1e(i,r,n,this.#n,t)}get url(){return this.#e.toString()}get opened(){return this.#o.promise}get closed(){return this.#a.promise}close(e=void 0){e!==null&&(e=go.converters.WebSocketCloseInfo(e));let t=e.closeCode??null,a=e.reason;Nq(this.#n,t,a,!0)}#m(e){e=go.converters.WebSocketStreamWrite(e);let t=Tq(),a=null,i=null;if(go.is.BufferSource(e))a=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),i=Rb.BINARY;else{let r;try{r=go.converters.DOMString(e)}catch(n){return t.reject(n),t.promise}a=new TextEncoder().encode(r),i=Rb.TEXT}if(!this.#n.closeState.has(Qm.SENT)&&!this.#n.closeState.has(Qm.RECEIVED)){let r=new J1e(a);this.#n.socket.write(r.createFrame(i),()=>{t.resolve(void 0)})}return t.promise}#u(e,t){this.#n.socket=e.socket;let a=this.#n.controller.dispatcher?.webSocketOptions?.maxFragments,i=this.#n.controller.dispatcher?.webSocketOptions?.maxPayloadSize,r=new W1e(this.#n,t,{maxFragments:a,maxPayloadSize:i});r.on("drain",()=>this.#n.onParserDrain()),r.on("error",l=>this.#n.onParserError(l)),this.#s=r,this.#n.readyState=Bm.OPEN;let n=t??"",s=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:l=>{this.#r=l},cancel:l=>this.#g(l)}),m=new WritableStream({write:l=>this.#m(l),close:()=>Nq(this.#n,null,null),abort:l=>this.#p(l)});this.#i=c,this.#t=m,this.#o.resolve({extensions:n,protocol:s,readable:c,writable:m})}#l(e,t){if(this.#n.readyState!==Bm.OPEN)return;let a;if(e===Rb.TEXT)try{a=V1e(t)}catch{Rq(this.#n,1007,"Received invalid UTF-8 in text frame.");return}else e===Rb.BINARY&&(a=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));this.#r.enqueue(a)}#d(){let e=this.#n.closeState.has(Qm.SENT)&&this.#n.closeState.has(Qm.RECEIVED);if(this.#n.readyState=Bm.CLOSED,this.#c)return;this.#n.wasEverConnected||this.#o.reject(new Z1e("Socket never opened"));let t=this.#s?.closingInfo,a=t?.code??1005;!this.#n.closeState.has(Qm.SENT)&&!this.#n.closeState.has(Qm.RECEIVED)&&(a=1006);let i=t?.reason==null?"":X1e(Buffer.from(t.reason));if(e)this.#r.close(),this.#t.locked||this.#t.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#a.resolve({closeCode:a,reason:i});else{let r=K1e("unclean close",a,i);this.#r?.error(r),this.#t?.abort(r),this.#a.reject(r)}}#p(e){let t=null,a="";go.is.WebSocketError(e)&&(t=e.closeCode,a=e.reason),Nq(this.#n,t,a)}#g(e){this.#p(e)}};Object.defineProperties(Ob.prototype,{url:Nb,opened:Nb,closed:Nb,close:Nb,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});go.converters.WebSocketStreamOptions=go.dictionaryConverter([{key:"protocols",converter:go.sequenceConverter(go.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:go.nullableConverter(go.converters.AbortSignal),defaultValue:()=>null}]);go.converters.WebSocketCloseInfo=go.dictionaryConverter([{key:"closeCode",converter:o=>go.converters["unsigned short"](o,go.attributes.EnforceRange)},{key:"reason",converter:go.converters.USVString,defaultValue:()=>""}]);go.converters.WebSocketStreamWrite=function(o){return typeof o=="string"?go.converters.USVString(o):go.converters.BufferSource(o)};qN.exports={WebSocketStream:Ob}});var jN=f((y8e,IN)=>{"use strict";function eIe(o){return o.indexOf("\0")===-1}function oIe(o){if(o.length===0)return!1;for(let e=0;e<o.length;e++)if(o.charCodeAt(e)<48||o.charCodeAt(e)>57)return!1;return!0}IN.exports={isValidLastEventId:eIe,isASCIINumber:oIe}});var QN=f((k8e,BN)=>{"use strict";var{Transform:tIe}=require("stream"),{isASCIINumber:CN,isValidLastEventId:SN}=jN(),Ur=[239,187,191],Oq=10,Ub=13,aIe=58,iIe=32,Uq=class extends tIe{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,a){if(e.length===0){a();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===Ur[0]){a();return}this.checkBOM=!1,a();return;case 2:if(this.buffer[0]===Ur[0]&&this.buffer[1]===Ur[1]){a();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===Ur[0]&&this.buffer[1]===Ur[1]&&this.buffer[2]===Ur[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,a();return}this.checkBOM=!1;break;default:this.buffer[0]===Ur[0]&&this.buffer[1]===Ur[1]&&this.buffer[2]===Ur[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos<this.buffer.length;){if(this.eventEndCheck){if(this.crlfCheck){if(this.buffer[this.pos]===Oq){this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.crlfCheck=!1;continue}this.crlfCheck=!1}if(this.buffer[this.pos]===Oq||this.buffer[this.pos]===Ub){this.buffer[this.pos]===Ub&&(this.crlfCheck=!0),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,(this.event.data!==void 0||this.event.event||this.event.id!==void 0||this.event.retry)&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(this.buffer[this.pos]===Oq||this.buffer[this.pos]===Ub){this.buffer[this.pos]===Ub&&(this.crlfCheck=!0),this.parseLine(this.buffer.subarray(0,this.pos),this.event),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.eventEndCheck=!0;continue}this.pos++}a()}parseLine(e,t){if(e.length===0)return;let a=e.indexOf(aIe);if(a===0)return;let i="",r="";if(a!==-1){i=e.subarray(0,a).toString("utf8");let n=a+1;e[n]===iIe&&++n,r=e.subarray(n).toString("utf8")}else i=e.toString("utf8"),r="";switch(i){case"data":t[i]===void 0?t[i]=r:t[i]+=`
|
|
1665
|
+
${r}`;break;case"retry":CN(r)&&(t[i]=r);break;case"id":SN(r)&&(t[i]=r);break;case"event":r.length>0&&(t[i]=r);break}}processEvent(e){e.retry&&CN(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&SN(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};BN.exports={EventSourceStream:Uq}});var MN=f((A8e,UN)=>{"use strict";var{pipeline:rIe}=require("stream"),{fetching:nIe}=ud(),{makeRequest:sIe}=xm(),{webidl:it}=To(),{EventSourceStream:cIe}=QN(),{parseMIMEType:mIe}=ma(),{createFastMessageEvent:lIe}=jb(),{isNetworkError:_N}=cd(),{kEnumerableProperty:Xs}=be(),{environmentSettingsObject:DN}=_t(),TN=!1,RN=3e3,yd=0,NN=1,kd=2,uIe="anonymous",dIe="use-credentials",_m=class o extends EventTarget{#e={open:null,error:null,message:null};#o;#a=!1;#i=yd;#r=null;#t=null;#c;#n;constructor(e,t={}){super(),it.util.markAsUncloneable(this);let a="EventSource constructor";it.argumentLengthCheck(arguments,1,a),TN||(TN=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=it.converters.USVString(e),t=it.converters.EventSourceInitDict(t,a,"eventSourceInitDict"),this.#c=t.node.dispatcher||t.dispatcher,this.#n={lastEventId:"",reconnectionTime:t.node.reconnectionTime};let i=DN,r;try{r=new URL(e,i.settingsObject.baseUrl),this.#n.origin=r.origin}catch(c){throw new DOMException(c,"SyntaxError")}this.#o=r.href;let n=uIe;t.withCredentials===!0&&(n=dIe,this.#a=!0);let s={redirect:"follow",keepalive:!0,mode:"cors",credentials:n==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};s.client=DN.settingsObject,s.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],s.cache="no-store",s.initiator="other",s.urlList=[new URL(this.#o)],this.#r=sIe(s),this.#s()}get readyState(){return this.#i}get url(){return this.#o}get withCredentials(){return this.#a}#s(){if(this.#i===kd)return;this.#i=yd;let e={request:this.#r,dispatcher:this.#c},t=a=>{if(!_N(a))return this.#m()};e.processResponseEndOfBody=t,e.processResponse=a=>{if(_N(a))if(a.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#m();return}let i=a.headersList.get("content-type",!0),r=i!==null?mIe(i):"failure",n=r!=="failure"&&r.essence==="text/event-stream";if(a.status!==200||n===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=NN,this.dispatchEvent(new Event("open")),this.#n.origin=a.urlList[a.urlList.length-1].origin;let s=new cIe({eventSourceSettings:this.#n,push:c=>{this.dispatchEvent(lIe(c.type,c.options))}});rIe(a.body.stream,s,c=>{c?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#t=nIe(e)}#m(){this.#i!==kd&&(this.#i=yd,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#i===yd&&(this.#n.lastEventId.length&&this.#r.headersList.set("last-event-id",this.#n.lastEventId,!0),this.#s())},this.#n.reconnectionTime)?.unref())}close(){it.brandCheck(this,o),this.#i!==kd&&(this.#i=kd,this.#t.abort(),this.#r=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let t=it.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("open",t),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let t=it.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("message",t),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let t=it.converters.EventHandlerNonNull(e);t!==null?(this.addEventListener("error",t),this.#e.error=e):this.#e.error=null}},ON={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:yd,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:NN,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:kd,writable:!1}};Object.defineProperties(_m,ON);Object.defineProperties(_m.prototype,ON);Object.defineProperties(_m.prototype,{close:Xs,onerror:Xs,onmessage:Xs,onopen:Xs,readyState:Xs,url:Xs,withCredentials:Xs});it.converters.EventSourceInitDict=it.dictionaryConverter([{key:"withCredentials",converter:it.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:it.converters.any},{key:"node",converter:it.dictionaryConverter([{key:"reconnectionTime",converter:it.converters["unsigned long"],defaultValue:()=>RN},{key:"dispatcher",converter:it.converters.any}]),defaultValue:()=>({})}]);UN.exports={EventSource:_m,defaultReconnectionTime:RN}});var GN=f((v8e,G)=>{"use strict";var gIe=zn(),PN=bu(),pIe=Cs(),hIe=E5(),fIe=S5(),bIe=Qs(),yIe=xz(),kIe=kz(),AIe=h_(),vIe=w_(),wIe=q_(),FN=ge(),Lb=be(),{InvalidArgumentError:Mb}=FN,Dm=nD(),xIe=ys(),zIe=c0(),{MockCallHistory:qIe,MockCallHistoryLog:EIe}=u0(),IIe=A0(),jIe=h0(),CIe=rT(),SIe=Hz(),BIe=Rf(),{getGlobalDispatcher:$N,setGlobalDispatcher:QIe}=Zf(),_Ie=bm(),DIe=j0();Object.assign(PN.prototype,Dm);G.exports.Dispatcher=PN;G.exports.Client=gIe;G.exports.Pool=pIe;G.exports.BalancedPool=hIe;G.exports.RoundRobinPool=fIe;G.exports.Agent=bIe;G.exports.ProxyAgent=yIe;G.exports.Socks5ProxyAgent=kIe;G.exports.EnvHttpProxyAgent=AIe;G.exports.RetryAgent=vIe;G.exports.H2CClient=wIe;G.exports.RetryHandler=BIe;G.exports.DecoratorHandler=_Ie;G.exports.RedirectHandler=DIe;G.exports.interceptors={redirect:fT(),responseError:yT(),retry:AT(),dump:wT(),dns:ET(),cache:i7(),decompress:m7(),deduplicate:p7()};G.exports.cacheStores={MemoryCacheStore:F0()};var TIe=b7();G.exports.cacheStores.SqliteCacheStore=TIe;G.exports.buildConnector=xIe;G.exports.errors=FN;G.exports.util={parseHeaders:Lb.parseHeaders,headerNameToString:Lb.headerNameToString};function Ad(o){return(e,t,a)=>{if(typeof t=="function"&&(a=t,t=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Mb("invalid url");if(t!=null&&typeof t!="object")throw new Mb("invalid opts");if(t&&t.path!=null){if(typeof t.path!="string")throw new Mb("invalid opts.path");let n=t.path;t.path.startsWith("/")||(n=`/${n}`),e=new URL(Lb.parseOrigin(e).origin+n)}else t||(t=typeof e=="object"?e:{}),e=Lb.parseURL(e);let{agent:i,dispatcher:r=$N()}=t;if(i)throw new Mb("unsupported opts.agent. Did you mean opts.client?");return o.call(r,{...t,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:t.method||(t.body?"PUT":"GET")},a)}}G.exports.setGlobalDispatcher=QIe;G.exports.getGlobalDispatcher=$N;var RIe=ud().fetch,LN=typeof __filename<"u"?__filename:void 0;function HN(o,e){if(!o||typeof o!="object")return;let t=typeof o.stack=="string"?o.stack:"",a=e.replace(/\\/g,"/");if(t&&(t.includes(e)||t.includes(a)))return;let i={};if(Error.captureStackTrace(i,HN),!i.stack)return;let r=i.stack.split(`
|
|
1662
1666
|
`).slice(1).join(`
|
|
1663
1667
|
`);o.stack=t?`${t}
|
|
1664
1668
|
${r}`:i.stack}G.exports.fetch=function(e,t=void 0){return RIe(e,t).catch(a=>{throw LN?HN(a,LN):a&&typeof a=="object"&&Error.captureStackTrace(a,G.exports.fetch),a})};G.exports.Headers=Hs().Headers;G.exports.Response=cd().Response;G.exports.Request=xm().Request;G.exports.FormData=mf().FormData;var{setGlobalOrigin:NIe,getGlobalOrigin:OIe}=ix();G.exports.setGlobalOrigin=NIe;G.exports.getGlobalOrigin=OIe;var{CacheStorage:UIe}=IR(),{kConstruct:MIe}=Ue();G.exports.caches=new UIe(MIe);var{deleteCookie:LIe,getCookies:PIe,getSetCookies:FIe,setCookie:$Ie,parseCookie:HIe}=UR();G.exports.deleteCookie=LIe;G.exports.getCookies=PIe;G.exports.getSetCookies=FIe;G.exports.setCookie=$Ie;G.exports.parseCookie=HIe;var{parseMIMEType:GIe,serializeAMimeType:VIe}=ma();G.exports.parseMIMEType=GIe;G.exports.serializeAMimeType=VIe;var{CloseEvent:YIe,ErrorEvent:JIe,MessageEvent:WIe}=jb(),{WebSocket:ZIe,ping:KIe}=yN();G.exports.WebSocket=ZIe;G.exports.CloseEvent=YIe;G.exports.ErrorEvent=JIe;G.exports.MessageEvent=WIe;G.exports.ping=KIe;G.exports.WebSocketStream=EN().WebSocketStream;G.exports.WebSocketError=Dq().WebSocketError;G.exports.request=Ad(Dm.request);G.exports.stream=Ad(Dm.stream);G.exports.pipeline=Ad(Dm.pipeline);G.exports.connect=Ad(Dm.connect);G.exports.upgrade=Ad(Dm.upgrade);G.exports.MockClient=zIe;G.exports.MockCallHistory=qIe;G.exports.MockCallHistoryLog=EIe;G.exports.MockPool=jIe;G.exports.MockAgent=IIe;G.exports.SnapshotAgent=CIe;G.exports.mockErrors=SIe;var{EventSource:XIe}=MN();G.exports.EventSource=XIe;function e2e(){globalThis.fetch=G.exports.fetch,globalThis.Headers=G.exports.Headers,globalThis.Response=G.exports.Response,globalThis.Request=G.exports.Request,globalThis.FormData=G.exports.FormData,globalThis.WebSocket=G.exports.WebSocket,globalThis.CloseEvent=G.exports.CloseEvent,globalThis.ErrorEvent=G.exports.ErrorEvent,globalThis.MessageEvent=G.exports.MessageEvent,globalThis.EventSource=G.exports.EventSource}G.exports.install=e2e});var YN=f(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.SuperglueClient=Rm.SuperglueHttpError=void 0;var Tm=Ht(),Mr=xv(),o2e=ew(),t2e=rQ(),a2e=Fa(),Lr=zc(),i2e=Lg(),wd=14400*1e3,vd;if(typeof globalThis.process<"u"&&globalThis.process.versions?.node)try{let{Agent:o}=GN();vd=new o({headersTimeout:wd,bodyTimeout:wd})}catch{}function VN(o){if(o?.aborted)throw o.reason??new DOMException("Aborted","AbortError")}var Pb=class extends Error{constructor(e,t,a,i){super(e),this.status=t,this.code=a,this.details=i,this.name="SuperglueHttpError"}};Rm.SuperglueHttpError=Pb;var Mq=class{constructor({apiKey:e,apiEndpoint:t,onInfrastructureError:a,refreshToken:i,sseTokenProvider:r,tokenProvider:n}){if(!e&&!n)throw new Error("SuperglueClient requires either apiKey or tokenProvider");this.tokenProvider=n??(async()=>e),this.apiEndpoint=t??"https://api.superglue.cloud",this.sseManager=new o2e.SSELogSubscriptionManager(this.apiEndpoint,r??this.tokenProvider,i),this.onInfrastructureError=a,this.refreshToken=i}async getApiKey(){return this.tokenProvider()}async fetchWithAuthRetry(e,t){let a=await this.getApiKey(),i=await e(a);if(i.status!==401||!this.refreshToken)return i;VN(t);let r=await this.refreshToken();return VN(t),!r||r===a?i:(i.body?.cancel(),e(r))}isInfrastructureError(e){return(0,a2e.isAbortError)(e)?!1:!!(e instanceof TypeError&&e.message.toLowerCase().includes("fetch")||e instanceof Error&&e.name==="TimeoutError")}async restRequest(e,t,a,i,r){let s=await(await this.restResponse({method:e,path:t,body:a,extraHeaders:i,requestInit:r})).text();if(s)return JSON.parse(s)}async restResponse({method:e,path:t,body:a,extraHeaders:i,requestInit:r}){let n=`${this.apiEndpoint.replace(/\/$/,"")}${t}`,s=a!=null,c=typeof FormData<"u"&&a instanceof FormData,m=u=>{let d={Authorization:`Bearer ${u}`,...i};return s&&!c&&e!=="GET"&&(d["Content-Type"]="application/json"),fetch(n,{...r,method:e,headers:d,body:s?c?a:JSON.stringify(a):void 0,signal:r?.signal??AbortSignal.timeout(wd),...vd?{dispatcher:vd}:{}})},l;try{l=await this.fetchWithAuthRetry(m,r?.signal)}catch(u){throw this.isInfrastructureError(u)&&this.onInfrastructureError?.(),u}if(!l.ok)throw await this.buildHttpError(l);return l}async uploadFiles(e,t){if(typeof t?.process!="boolean")throw new Error("process must be a boolean");if(e.length===0)return[];let a=e.map(l=>({...l,contentLength:l.contentLength??this.getUploadContentLength(l.content)})),r=(await this.restRequest("POST","/v1/files/uploads",{process:t.process,files:a.map(({fileName:l,contentType:u,contentLength:d})=>({fileName:l,contentLength:d,...u?{contentType:u}:{}}))})).data.files;if(r.length!==a.length)throw await Promise.all(r.map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),new Error("Upload response did not match the selected files");let n=await Promise.allSettled(r.map(async(l,u)=>{let d=a[u],g=await fetch(l.uploadUrl,{method:"PUT",body:d.content,headers:d.contentType?{"Content-Type":d.contentType}:void 0,signal:AbortSignal.timeout(Math.min(wd,l.expiresIn*1e3))});if(!g.ok)throw new Error(`Upload failed for ${d.fileName}: ${g.status} ${g.statusText}`);return l.id})),s=n.flatMap(l=>l.status==="fulfilled"?[l.value]:[]),c=new Map;if(s.length>0)try{let l=await this.restRequest("POST","/v1/files/uploads/complete",{fileIds:s});c=new Map(l.data.files.map(u=>[u.id,u]))}catch(l){c=new Map(s.map(u=>[u,{id:u,fileName:a[r.findIndex(d=>d.id===u)]?.fileName||u,contentLength:a[r.findIndex(d=>d.id===u)]?.contentLength||0,status:"failed",error:l instanceof Error?l.message:String(l)}]))}let m=r.map((l,u)=>{let d=n[u],g=a[u];return d.status==="rejected"?{id:l.id,fileName:g.fileName,contentLength:g.contentLength,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)}:c.get(l.id)||{id:l.id,fileName:g.fileName,contentLength:g.contentLength,status:"failed",error:"Upload completion returned no result"}});return await Promise.all(m.filter(l=>l.status==="failed").map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),m}async deleteFileUpload(e){await this.restRequest("DELETE",`/v1/files/uploads/${encodeURIComponent(e)}`)}getUploadContentLength(e){return typeof e=="string"?new TextEncoder().encode(e).byteLength:e instanceof Uint8Array?e.byteLength:e.size}async buildHttpError(e){e.status>=500&&this.onInfrastructureError?.();let t=await e.text(),a=`HTTP ${e.status}: ${t}`,i,r;try{let n=JSON.parse(t);n&&typeof n=="object"&&!Array.isArray(n)&&(r=n),typeof n?.code=="string"&&(i=n.code);let s=n.error;typeof s=="string"?a=s:s&&typeof s=="object"&&(a=s.message||JSON.stringify(s))}catch{}return new Pb(a,e.status,i,r)}async streamRequest(e,t,a){let i=e.includes("?")?"&":"?",r=`${this.apiEndpoint.replace(/\/$/,"")}${e}${i}stream=true`,n=m=>fetch(r,{method:"POST",headers:{Authorization:`Bearer ${m}`,Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(t),signal:a??AbortSignal.timeout(wd),...vd?{dispatcher:vd}:{}}),s;try{s=await this.fetchWithAuthRetry(n,a)}catch(m){throw this.isInfrastructureError(m)&&this.onInfrastructureError?.(),m}if(!s.ok)throw await this.buildHttpError(s);if(!(s.headers.get("content-type")||"").includes("text/event-stream")){let m=await s.text();return m?JSON.parse(m):void 0}try{return await(0,t2e.consumeEventStreamResult)(s)}catch(m){throw this.isInfrastructureError(m)&&this.onInfrastructureError?.(),m}}async subscribeToLogsSSE(e={}){return this.sseManager.subscribeToLogs(e)}async disconnect(){await this.sseManager.disconnect()}async getMe(){return this.restRequest("GET","/v1/me")}async completeOnboarding(){return this.restRequest("POST","/v1/me/onboarding/complete")}async runTool(e){let t=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e.toolId)}/run`,{inputs:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture},void 0,e.signal?{signal:e.signal}:void 0);return{success:t.status==="success",data:t.data,error:t.error,tool:t.tool,stepResults:t.stepResults?.map(a=>({...a}))||[],...t.fileArtifacts&&t.fileArtifacts.length>0?{fileArtifacts:t.fileArtifacts}:{},...t.metadata?.warnings?.length?{warnings:t.metadata.warnings}:{}}}async runToolConfig(e){let t=e.createRun?"/v1/tools/run?createRun=true":"/v1/tools/run",a=await this.restRequest("POST",t,{tool:e.tool,payload:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture,executionKind:e.executionKind,parentToolId:e.parentToolId,draftId:e.draftId},e.traceId?{"X-Trace-Id":e.traceId}:void 0,e.signal?{signal:e.signal}:void 0);return{success:a.status?a.status==="success":a.success??!1,data:a.data,error:a.error,tool:a.tool||e.tool,stepResults:a.stepResults?.map(r=>({...r}))||[],...a.fileArtifacts&&a.fileArtifacts.length>0?{fileArtifacts:a.fileArtifacts}:{},...a.metadata?.warnings?.length?{warnings:a.metadata.warnings}:{}}}async abortToolExecution(e){return{success:!0,runId:(await this.restRequest("POST",`/v1/runs/${encodeURIComponent(e)}/cancel`)).runId}}async executeStep({step:e,payload:t,files:a,previousResults:i,credentials:r,options:n,runId:s,systemIds:c,createRun:m,parentToolId:l,stepIndex:u,stepId:d,signal:g,stream:h}){let k={step:e,payload:t,files:a,previousResults:i,credentials:r,options:n,runId:s,systemIds:c,createRun:m,parentToolId:l,stepIndex:u,stepId:d};return h?this.streamRequest("/v1/tools/step/run",k,g):this.restRequest("POST","/v1/tools/step/run",k,void 0,g?{signal:g}:void 0)}async abortStep(e){return this.restRequest("POST","/v1/tools/step/abort",{runId:e})}async executeTransformOnly({outputTransform:e,outputSchema:t,inputSchema:a,payload:i,files:r,stepResults:n,options:s,runId:c,createRun:m,parentToolId:l,stepId:u,signal:d,stream:g}){let h={outputTransform:e,outputSchema:t,inputSchema:a,payload:i,files:r,stepResults:n,options:s,runId:c,createRun:m,parentToolId:l,stepId:u};return g?this.streamRequest("/v1/tools/transform/run",h,d):this.restRequest("POST","/v1/tools/transform/run",h,void 0,d?{signal:d}:void 0)}async createRun({toolId:e,toolConfig:t,toolResult:a,stepResults:i,toolPayload:r,status:n,error:s,startedAt:c,completedAt:m,executionKind:l,parentToolId:u,draftId:d}){return this.restRequest("POST","/v1/runs",{toolId:e,toolConfig:t,toolResult:a,stepResults:i,toolPayload:r,status:n,error:s,startedAt:(0,Lr.toUTCISOString)(c,"run.startedAt"),completedAt:(0,Lr.toUTCISOString)(m,"run.completedAt"),executionKind:l,parentToolId:u,draftId:d})}async checkRunLimit(){return(await this.restRequest("POST","/v1/runs/check-limit")).data}async extract({file:e,envelope:t}){if(!e)throw new Error("File must be provided for extract.");let a=new FormData;a.append("file",e);let i=t?"/v1/extract?envelope=true":"/v1/extract";return this.restRequest("POST",i,a)}mapOpenAPIRunToRun(e){let t={running:Tm.RunStatus.RUNNING,success:Tm.RunStatus.SUCCESS,failed:Tm.RunStatus.FAILED,aborted:Tm.RunStatus.ABORTED};return{runId:e.runId??e.id,toolId:e.toolId,tool:e.tool,systemIds:e.systemIds,status:t[e.status]??Tm.RunStatus.FAILED,toolPayload:e.toolPayload,data:e.data,toolResult:e.data,error:e.error,stepResults:e.stepResults,options:e.options,requestSource:e.requestSource,traceId:e.traceId,resultStorageUri:e.resultStorageUri,userId:e.userId,userEmail:e.userEmail,userName:e.userName,metadata:{...e.metadata,executionKind:e.metadata?.executionKind??Tm.RunExecutionKind.FULL},fileArtifacts:e.fileArtifacts}}mapOpenAPIScheduleToToolSchedule(e){return{...e,lastRunAt:e.lastRunAt?(0,Lr.requireUTCDate)(e.lastRunAt,"schedule.lastRunAt"):void 0,nextRunAt:(0,Lr.requireUTCDate)(e.nextRunAt,"schedule.nextRunAt"),createdAt:(0,Lr.requireUTCDate)(e.createdAt,"schedule.createdAt"),updatedAt:(0,Lr.requireUTCDate)(e.updatedAt,"schedule.updatedAt")}}async listRuns(e={}){let t=(0,Mr.createSearchListQueryParams)(e);e.toolId!==void 0&&t.set("toolId",e.toolId),e.searchUserIds?.length&&t.set("searchUserIds",e.searchUserIds.join(",")),e.includeTotal!==void 0&&t.set("includeTotal",String(e.includeTotal)),e.startedAfter!==void 0&&t.set("startedAfter",e.startedAfter instanceof Date?(0,Lr.toUTCISOString)(e.startedAfter,"run.startedAfter"):e.startedAfter),e.statuses!==void 0?t.set("status",e.statuses.join(",")):e.status!==void 0&&t.set("status",e.status),e.requestSources!==void 0&&t.set("requestSources",e.requestSources.join(",")),e.executionKinds!==void 0&&t.set("executionKinds",e.executionKinds.join(",")),e.userId!==void 0&&t.set("userId",e.userId),e.systemId!==void 0&&t.set("systemId",e.systemId),e.systemIds!==void 0&&t.set("systemIds",e.systemIds.join(","));let a=t.size>0?`?${t.toString()}`:"",i=await this.restRequest("GET",`/v1/runs${a}`,void 0,void 0,{signal:e.signal});return{data:i.data.map(r=>this.mapOpenAPIRunToRun(r)),total:i.total,page:i.page,limit:i.limit,hasMore:i.hasMore}}async getActivityCounts(e){let t=new URLSearchParams;e?.from&&t.set("from",e.from instanceof Date?(0,Lr.toUTCISOString)(e.from,"activity.from"):e.from),e?.to&&t.set("to",e.to instanceof Date?(0,Lr.toUTCISOString)(e.to,"activity.to"):e.to);let a=t.toString();return(await this.restRequest("GET",`/v1/activity/counts${a?`?${a}`:""}`,void 0,void 0,{signal:e?.signal})).counts}async getRun(e){try{let t=await this.restRequest("GET",`/v1/runs/${encodeURIComponent(e)}`);return this.mapOpenAPIRunToRun(t)}catch(t){if(t.message?.includes("404")||t.message?.includes("not found"))return null;throw t}}async getTool(e){try{return await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}`)}catch(t){if(t.message?.includes("404")||t.message?.includes("not found")||t.message?.includes("403")||t.message?.includes("not allowed"))return null;throw t}}async getToolState(e){return(await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/state`)).state}async setToolState(e,t){await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/state`,{state:t})}async deleteToolState(e){return(await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/state`)).deletedKeys}async archiveTool(e,t=!0){return this.updateTool(e,{archived:t})}async bulkArchiveTools(e,t=!0){return this.restRequest("POST","/v1/tools/bulk/archive",{ids:e,archived:t})}async bulkDeleteTools(e){return this.restRequest("POST","/v1/tools/bulk/delete",{ids:e})}async listTools(e={}){let t=(0,Mr.createListQueryParams)(e);e.includeArchived!==void 0&&t.set("includeArchived",String(e.includeArchived));let a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/tools${a}`)}async listAllTools(e={}){return(0,Mr.listAllPages)((t,a)=>this.listTools({...e,page:t,limit:a}))}async createTool(e,t){return this.restRequest("POST","/v1/tools",{...t,id:e})}async updateTool(e,t){return this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}`,t)}async deleteTool(e){try{return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}`),!0}catch(t){if(t.message?.includes("404"))return!1;throw t}}async renameTool(e,t){return this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/rename`,{newId:t})}async getWorkflow(e){return this.getTool(e)}async archiveWorkflow(e,t=!0){return this.upsertWorkflow(e,{archived:t})}async createWorkflow(e,t){return this.createTool(e,t)}async updateWorkflow(e,t){return this.updateTool(e,t)}async upsertWorkflow(e,t){return await this.getTool(e)?this.updateTool(e,t):this.createTool(e,t)}async deleteWorkflow(e){return this.deleteTool(e)}async renameWorkflow(e,t){return this.renameTool(e,t)}async listSchedules(e={}){let t=(0,Mr.createListQueryParams)(e),a=t.size>0?`?${t.toString()}`:"",i=e.toolId?`/v1/tools/${encodeURIComponent(e.toolId)}/schedules${a}`:`/v1/schedules${a}`,r=await this.restRequest("GET",i);return{...r,data:r.data.map(n=>this.mapOpenAPIScheduleToToolSchedule(n))}}async listAllSchedules(e={}){return(0,Mr.listAllPages)((t,a)=>this.listSchedules({...e,page:t,limit:a}))}async getToolSchedule(e,t){try{let a=await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(t)}`);return this.mapOpenAPIScheduleToToolSchedule(a)}catch(a){if(a.message?.includes("404")||a.message?.includes("not found"))return null;throw a}}async createToolSchedule(e,t){let a=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/schedules`,{...t,timezone:t.timezone||(0,i2e.getRuntimeTimezone)()});return this.mapOpenAPIScheduleToToolSchedule(a)}async updateToolSchedule(e,t,a){let i=await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(t)}`,a);return this.mapOpenAPIScheduleToToolSchedule(i)}async deleteToolSchedule(e,t){return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(t)}`),!0}async bulkSetSchedulesEnabled(e,t){return this.restRequest("POST","/v1/schedules/bulk/enable",{ids:e,enabled:t})}async bulkDeleteSchedules(e){return this.restRequest("POST","/v1/schedules/bulk/delete",{ids:e})}async listCredentials(e={}){let t=(0,Mr.createListQueryParams)(e);e.systemId!==void 0&&t.set("systemId",e.systemId);let a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/credentials${a}`)}async listAllCredentials(e={}){return(0,Mr.listAllPages)((t,a)=>this.listCredentials({...e,page:t,limit:a}))}async createCredentials(e){return(await this.restRequest("POST","/v1/credentials",e)).data}async replaceCredentials(e,t){return(await this.restRequest("PUT",`/v1/credentials/${encodeURIComponent(e)}`,{credentials:t})).data}async updateCredentials(e,t){return(await this.restRequest("PATCH",`/v1/credentials/${encodeURIComponent(e)}`,t)).data}async deleteCredentials(e){await this.restRequest("DELETE",`/v1/credentials/${encodeURIComponent(e)}`)}async setDefaultCredentials(e){await this.restRequest("POST",`/v1/credentials/${encodeURIComponent(e)}/default`)}async listSystems(e={}){let t=(0,Mr.createListQueryParams)(e),a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/systems${a}`)}async listAllSystems(e={}){return(0,Mr.listAllPages)((t,a)=>this.listSystems({...e,page:t,limit:a}))}async getSystem(e){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}`)).data}async createSystem(e){return(await this.restRequest("POST","/v1/systems",e)).data}async updateSystem(e,t){return(await this.restRequest("PATCH",`/v1/systems/${encodeURIComponent(e)}`,t)).data}async deleteSystem(e){return await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}`),!0}async bulkDeleteSystems(e){return this.restRequest("POST","/v1/systems/bulk/delete",{ids:e})}async createOAuthExchange(e){return(await this.restRequest("POST","/v1/oauth/exchanges",e)).data}async completeOAuthExchange(e,t){return(await this.restRequest("POST",`/v1/oauth/exchanges/${encodeURIComponent(e)}/complete`,t)).data}async searchSystemDocumentation(e,t){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/search`,{keywords:t})).data}async triggerSystemDocumentationScrapeJob(e,t){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/scrape`,t)).data}async fetchOpenApiSpec(e,t,a){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/openapi`,{url:t,link:a?.link})).data}async uploadSystemDocumentationFiles(e,t,a){let i=await this.uploadFiles(t,{process:!0}),r=i.flatMap(n=>n.status==="uploaded"?[n.id]:[]);if(r.length>0)try{await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/files`,{fileIds:r,link:a?.link!==!1})}catch(n){throw await Promise.all(r.map(s=>this.deleteFileUpload(s).catch(()=>{}))),n}if(!a?.settle){let n=i.filter(s=>s.status==="failed");if(n.length>0)throw new Error(n.map(s=>s.error).join("; "))}return i}async listSystemDocumentationFiles(e,t){let a=new URLSearchParams;t?.length&&a.set("fileIds",t.join(","));let i=a.size>0?`?${a.toString()}`:"";return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files${i}`)).data}async getSystemDocumentationFileContent(e,t,a){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(t)}/content?processed=${a.processed}`)).data}async deleteSystemDocumentationFile(e,t){await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(t)}`)}async generateCredentialsLink(e){try{return{success:!0,credentialsUrl:(await this.restRequest("POST","/v1/authenticate",e||{})).data.credentialsUrl}}catch(t){return{success:!1,error:t.message}}}};Rm.SuperglueClient=Mq});var WN=f(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.UnquotedKeyStrategy=ao.TripleQuoteStrategy=ao.TrailingCommaStrategy=ao.SingleQuoteStrategy=ao.PythonLiteralStrategy=ao.CommentStrategy=ao.ResilientJsonParser=ao.RepairStrategy=void 0;ao.parseJsonResilient=r2e;ao.parseJSON=n2e;ao.isValidJson=s2e;ao.prettyPrintJson=c2e;ao.minifyJson=m2e;var Ra=class{validate(e){try{return JSON.parse(e),!0}catch{return!1}}};ao.RepairStrategy=Ra;var Fb=class extends Ra{constructor(){super(...arguments),this.name="TripleQuoteRepair",this.description="Converts triple-quoted strings to proper JSON, parsing nested JSON content"}canApply(e){return/"""/.test(e)}apply(e){return e.replace(/"""([\s\S]*?)"""/g,(t,a)=>{let i=a.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{let n=JSON.parse(i);return JSON.stringify(n)}catch{return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`})}};ao.TripleQuoteStrategy=Fb;var $b=class extends Ra{constructor(){super(...arguments),this.name="PythonLiteralRepair",this.description="Converts Python literals to JavaScript equivalents"}canApply(e){return/\b(None|True|False)\b/.test(e)}apply(e){return e.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false")}};ao.PythonLiteralStrategy=$b;var Hb=class extends Ra{constructor(){super(...arguments),this.name="TrailingCommaRepair",this.description="Removes trailing commas from objects and arrays"}canApply(e){return/,\s*[}\]]/.test(e)}apply(e){return e.replace(/,(\s*[}\]])/g,"$1")}};ao.TrailingCommaStrategy=Hb;var Gb=class extends Ra{constructor(){super(...arguments),this.name="SingleQuoteRepair",this.description="Converts single quotes to double quotes"}canApply(e){return/[{,]\s*'[^']*'\s*:/.test(e)||/:\s*'[^']*'/.test(e)}apply(e){let t=e.replace(/([{,]\s*)'([^']+)'(\s*:)/g,'$1"$2"$3');return t=t.replace(/(:\s*)'([^']+)'(\s*[,}])/g,'$1"$2"$3'),t}};ao.SingleQuoteStrategy=Gb;var Vb=class extends Ra{constructor(){super(...arguments),this.name="UnquotedKeyRepair",this.description="Adds quotes to unquoted object keys"}canApply(e){return/[{,]\s*[a-zA-Z_$][a-zA-Z0-9_$]*\s*:/.test(e)}apply(e){return e.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*:)/g,'$1"$2"$3')}};ao.UnquotedKeyStrategy=Vb;var Yb=class extends Ra{constructor(){super(...arguments),this.name="CommentRemoval",this.description="Removes JavaScript-style comments"}canApply(e){return/\/\/.*$|\/\*[\s\S]*?\*\//m.test(e)}apply(e){let t=e.replace(/\/\/.*$/gm,"");return t=t.replace(/\/\*[\s\S]*?\*\//g,""),t}};ao.CommentStrategy=Yb;var Lq=class extends Ra{constructor(){super(...arguments),this.name="UnescapedControlCharactersRepair",this.description="Escapes unescaped control characters (newlines, tabs, etc.) in JSON strings"}canApply(e){try{return JSON.parse(e),!1}catch(t){let a=t.message||"";return a.includes("control character")||a.includes("Bad control")||a.includes("Unexpected token")&&/[\n\r\t]/.test(e)}}apply(e){let t="",a=!1,i=!1;for(let r=0;r<e.length;r++){let n=e[r],s=r>0?e[r-1]:"";if(i){t+=n,i=!1;continue}if(n==="\\"&&a){t+=n,i=!0;continue}if(n==='"'&&s!=="\\"){a=!a,t+=n;continue}if(a)switch(n){case`
|
|
1665
1669
|
`:t+="\\n";break;case"\r":t+="\\r";break;case" ":t+="\\t";break;case"\b":t+="\\b";break;case"\f":t+="\\f";break;default:let c=n.charCodeAt(0);c<32?t+="\\u"+("0000"+c.toString(16)).slice(-4):t+=n}else t+=n}return t}},Pq=class extends Ra{constructor(){super(...arguments),this.name="TrailingCharactersRepair",this.description="Removes trailing characters after valid JSON structure"}canApply(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return!1;let a=0,i=0,r=!1,n=!1;for(let s=0;s<t.length;s++){let c=t[s];if(r)n?n=!1:c==="\\"?n=!0:c==='"'&&(r=!1);else if(c==='"')r=!0;else if(c==="{")a++;else if(c==="}"){if(a--,a===0&&i===0&&s>0&&s<t.length-1)return!0}else if(c==="[")i++;else if(c==="]"&&(i--,i===0&&a===0&&s>0&&s<t.length-1))return!0}return!1}apply(e){let t=e.trim(),a=0,i=0,r=!1,n=!1,s=-1;for(let c=0;c<t.length;c++){let m=t[c];if(r)n?n=!1:m==="\\"?n=!0:m==='"'&&(r=!1);else if(m==='"')r=!0;else if(m==="{")a++;else if(m==="}"){if(a--,a===0&&i===0&&c>0){s=c;break}}else if(m==="[")i++;else if(m==="]"&&(i--,i===0&&a===0&&c>0)){s=c;break}}return s>0&&s<t.length-1?t.substring(0,s+1):e}},Nm=class{constructor(e={}){this.strategies=[],this.repairLog=[],this.options={attemptRepair:!0,maxDepth:10,preserveStringsOnFailure:!1,logRepairs:!1,...e},this.initializeDefaultStrategies(),e.customStrategies&&this.strategies.push(...e.customStrategies)}initializeDefaultStrategies(){this.strategies=[new Fb,new Gb,new Lq,new Pq,new $b,new Hb,new Vb,new Yb]}parse(e){let t=Date.now();this.repairLog=[];let a=e instanceof Buffer?e.toString("utf8"):String(e);try{return{success:!0,data:JSON.parse(a),metadata:{parseTime:Date.now()-t,strategiesApplied:[]}}}catch(n){if(!this.options.attemptRepair)return{success:!1,error:`JSON parse error: ${n}`,metadata:{parseTime:Date.now()-t}}}let i=a,r=[];for(let n of this.strategies)if(n.canApply(i)){let s=i;if(i=n.apply(i),s!==i){r.push(n.name),this.repairLog.push(n.description),this.options.logRepairs&&console.log(`Applied ${n.name}: ${n.description}`);try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}catch{}}}try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}catch(n){let s=this.aggressiveFallback(i);return s.success?{...s,repairs:[...this.repairLog,"Applied aggressive fallback"],metadata:{parseTime:Date.now()-t,strategiesApplied:[...r,"AggressiveFallback"]}}:{success:!1,error:`Failed to parse JSON after applying ${r.length} strategies: ${n}`,repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}}aggressiveFallback(e){try{let t=e.indexOf("{"),a=e.indexOf("[");if(t===-1&&a===-1)return{success:!1,error:"No JSON-like structure found"};let i=t===-1?a:a===-1?t:Math.min(t,a),r=e.substring(i);for(let s of this.strategies)s.canApply(r)&&(r=s.apply(r));return{success:!0,data:JSON.parse(r)}}catch(t){return{success:!1,error:`Aggressive fallback failed: ${t}`}}}addStrategy(e){this.strategies.push(e)}removeStrategy(e){this.strategies=this.strategies.filter(t=>t.name!==e)}getStrategies(){return this.strategies.map(e=>e.name)}};ao.ResilientJsonParser=Nm;var JN=new Nm;function r2e(o,e){return(e?new Nm(e):JN).parse(o)}function n2e(o){let e=JN.parse(o);if(e.success)return e.repairs&&e.repairs.length>0&&console.log("JSON parsed with repairs:",e.repairs),e.data;throw new Error(`Failed to parse JSON: ${e.error}`)}function s2e(o){try{return JSON.parse(o),!0}catch{return!1}}function c2e(o,e=2){return JSON.stringify(o,null,e)}function m2e(o){let t=new Nm().parse(o);if(t.success)return JSON.stringify(t.data);throw new Error("Cannot minify invalid JSON")}});var Pt=f(oe=>{"use strict";var l2e=oe&&oe.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),he=oe&&oe.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&l2e(e,o,t)};Object.defineProperty(oe,"__esModule",{value:!0});oe.SSELogSubscriptionManager=oe.SuperglueHttpError=oe.SuperglueClient=void 0;he(NC(),oe);he(VC(),oe);he(u8(),oe);he(f8(),oe);he(A8(),oe);he(iu(),oe);he(M8(),oe);he(L8(),oe);he(P8(),oe);he(F8(),oe);he(xv(),oe);he(H8(),oe);he(G8(),oe);he(V8(),oe);he(Ev(),oe);he(W8(),oe);he(K8(),oe);he(X8(),oe);he(o3(),oe);he(Md(),oe);he(a3(),oe);he(i3(),oe);he(n3(),oe);he(m3(),oe);he(Cv(),oe);he(h3(),oe);he(b3(),oe);he(k3(),oe);he(A3(),oe);he(B3(),oe);he(_3(),oe);he(Fv(),oe);he(G3(),oe);he(Zv(),oe);he(W3(),oe);he(eQ(),oe);he(tQ(),oe);he(Ht(),oe);he(Fa(),oe);he(aQ(),oe);he(iQ(),oe);he(jh(),oe);he(zc(),oe);he(Lg(),oe);var ZN=YN();Object.defineProperty(oe,"SuperglueClient",{enumerable:!0,get:function(){return ZN.SuperglueClient}});Object.defineProperty(oe,"SuperglueHttpError",{enumerable:!0,get:function(){return ZN.SuperglueHttpError}});var u2e=ew();Object.defineProperty(oe,"SSELogSubscriptionManager",{enumerable:!0,get:function(){return u2e.SSELogSubscriptionManager}});he(WN(),oe)});var Cy=require("commander");var kt=pe(require("fs")),eO=pe(require("os")),Pr=pe(require("path")),xd=pe(Pt()),KN=new Set(["runner","builder","admin"]),XN={output:{mode:"stdout",directory:".superglue/output"},preset:"admin"};function Fr(o){let e=Pr.join(process.cwd(),".superglue"),t=eO.homedir();if(!t)return e;let a=Pr.join(t,".superglue");return o===!0?e:o===!1?a:kt.existsSync(Pr.join(e,"config.json"))?e:a}function Fq(o){return Pr.join(Fr(o),"config.json")}function Jb(o){let e=Fq(o);if(!kt.existsSync(e))return{};try{return JSON.parse(kt.readFileSync(e,"utf-8"))}catch{return{}}}function Om(o){let e=Jb(),t=o.apiKey||(0,xd.readProcessEnvironmentValue)("SUPERGLUE_API_KEY")||e.apiKey||"",a=o.endpoint||(0,xd.readProcessEnvironmentValue)("SUPERGLUE_API_ENDPOINT")||e.endpoint||"https://api.superglue.cloud",i=(0,xd.readProcessEnvironmentValue)("SUPERGLUE_WEB_ENDPOINT")||e.webEndpoint||a.replace(/:3002\b/,":3001").replace(/api\.superglue/,"app.superglue"),r=(0,xd.readProcessEnvironmentValue)("SUPERGLUE_CLI_PRESET"),n=r&&KN.has(r)?r:e.preset&&KN.has(e.preset)?e.preset:"admin";return{...XN,...e,apiKey:t,endpoint:a,webEndpoint:i,preset:n,output:{...XN.output,...e.output}}}function Wb(o,e){let t=Fr(e);kt.existsSync(t)||kt.mkdirSync(t,{recursive:!0}),kt.writeFileSync(Pr.join(t,"config.json"),JSON.stringify(o,null,2)+`
|
|
1666
|
-
`,{mode:384})}function Zb(o,e){let t=Pr.join(Fr(e),"drafts");if(kt.existsSync(t)||kt.mkdirSync(t,{recursive:!0}),o.output.mode==="stdout+file"){let a=Pr.resolve(o.output.directory);kt.existsSync(a)||kt.mkdirSync(a,{recursive:!0})}}var Wq=pe(Pt());var $q=pe(require("readline"));var aO=require("child_process"),iO=require("util");var oO={name:"@superglue/cli",version:"1.1.
|
|
1670
|
+
`,{mode:384})}function Zb(o,e){let t=Pr.join(Fr(e),"drafts");if(kt.existsSync(t)||kt.mkdirSync(t,{recursive:!0}),o.output.mode==="stdout+file"){let a=Pr.resolve(o.output.directory);kt.existsSync(a)||kt.mkdirSync(a,{recursive:!0})}}var Wq=pe(Pt());var $q=pe(require("readline"));var aO=require("child_process"),iO=require("util");var oO={name:"@superglue/cli",version:"1.1.108",bin:{sg:"./dist/cli.js"},files:[".claude-plugin/","dist/","skills/","LICENSE"],dependencies:{commander:"15.0.0-0","fast-json-patch":"3.1.1"},devDependencies:{"@superglue/shared":"file:../shared","@types/node":"25.5.0",tsup:"8.5.1",typescript:"5.8.3"},scripts:{build:"tsup && (cp -r skills dist/ 2>/dev/null || true)",dev:"tsup --watch","type-check":"tsc --noEmit",prepublishOnly:"npm run build"},publishConfig:{access:"public"}};var g2e=(0,iO.promisify)(aO.exec),rt=oO.version;function tO(o){let e=o.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:o}}function Xb(o,e){let t=o.split("."),a=e.split("."),i=Math.max(t.length,a.length);for(let r=0;r<i;r++){let n=tO(t[r]||"0"),s=tO(a[r]||"0");if(n.numeric<s.numeric)return-1;if(n.numeric>s.numeric||n.prerelease===null&&s.prerelease!==null)return 1;if(n.prerelease!==null&&s.prerelease===null)return-1;if(n.prerelease!==null&&s.prerelease!==null){if(n.prerelease<s.prerelease)return-1;if(n.prerelease>s.prerelease)return 1}}return 0}async function ey(){try{let o=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return o.ok&&(await o.json()).version||null}catch{return null}}var Kb=null;function rO(){me()&&(Kb=ey())}async function nO(){if(!(!me()||!Kb)){try{let o=new Promise(t=>{setTimeout(()=>t(null),2e3).unref()}),e=await Promise.race([Kb,o]);e&&Xb(rt,e)<0&&(console.error(""),console.error(`${b.cyan}${b.bold} Update available: ${rt} \u2192 ${e}${b.reset}`),console.error(`${b.cyan} Run ${b.bold}sg update${b.reset}${b.cyan} to upgrade${b.reset}`),console.error(""))}catch{}Kb=null}}async function sO(){let o=await ey();if(!o)return{success:!1,message:"Could not fetch latest version from npm"};if(Xb(rt,o)>=0)return{success:!0,message:`Already on latest version (${rt})`};try{return await g2e("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${rt} to ${o}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var me=()=>process.argv.includes("--table")&&process.stdout.isTTY,ya=()=>process.argv.includes("--full"),b={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m"};function cO(o,e){let t=e||o;return`\x1B]8;;${o}\x07${b.underline}${b.cyan}${t}${b.reset}\x1B]8;;\x07`}function mO(){if(!me())return;let o=b.reset,e=b.dim,t="\x1B[47;30m",a=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),a.forEach(i=>{let r=i.search(/\S/),n=i.length-[...i].reverse().join("").search(/\S/)-1;if(r===-1)return console.log(" "+i);let s=i.slice(0,r),c=i.slice(r,n+1).split("").map(l=>l===" "?" ":"\u2588").join(""),m=i.slice(n+1);console.log(` ${s}${t}${c}${o}${m}`)}),console.log(` ${e} CLI v${rt}${o}`),console.log("")}function eo(o){if(!me())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],t=0,a=o,i=()=>process.stdout.write("\r\x1B[2K"),r=()=>{process.stdout.write(`\r ${b.cyan}${e[t++%e.length]}${b.reset} ${a}`)},n=setInterval(r,80);return{update:s=>{a=s},log:s=>{i(),console.log(` ${b.dim}\u2502${b.reset} ${s}`),r()},stop:s=>{clearInterval(n),i(),s&&console.log(` ${s}`)}}}function te(o){me()?oy(o):console.log(JSON.stringify(o,null,2))}function qe(o,e){me()?(console.log(` ${b.green}\u2713${b.reset} ${o}`),e&&oy(e,4)):console.log(JSON.stringify({success:!0,message:o,...e&&typeof e=="object"?e:{data:e}}))}function I(o,e){me()?(console.error(` ${b.red}\u2717${b.reset} ${o}`),e&&oy(e,4)):console.error(JSON.stringify({success:!1,error:o,details:e}))}function lO(o){me()&&console.log(` ${b.yellow}\u26A0${b.reset} ${o}`)}function Yo(o){me()&&console.log(` ${b.dim}${o}${b.reset}`)}function $r(o){me()&&(console.log(`
|
|
1667
1671
|
${b.bold}${b.cyan}${o}${b.reset}`),console.log(` ${b.dim}${"\u2500".repeat(o.length)}${b.reset}`))}function ir(o,e,t){if(!me()){console.log(JSON.stringify({success:!0,total:t?.total??o.length,items:o}));return}if(o.length===0){console.log(`
|
|
1668
1672
|
${b.dim}0 results${b.reset}
|
|
1669
1673
|
`);return}let a=e||Object.keys(o[0]),i=ya()?1/0:60,r=a.map(l=>Math.min(i,Math.max(l.length,...o.map(u=>String(u[l]??"").replace(/[\n\r]+/g," ").trim().length))));console.log("");let n=a.map((l,u)=>`${b.bold}${b.cyan}${l.toUpperCase().padEnd(r[u])}${b.reset}`).join(" ");console.log(` ${n}`);let s=r.map(l=>`${b.dim}${"\u2500".repeat(l)}${b.reset}`).join(`${b.dim}\u2500\u2500${b.reset}`);console.log(` ${s}`);for(let l of o){let u=a.map((d,g)=>{let h=String(l[d]??"").replace(/[\n\r]+/g," ").trim();if(h.length>i){let w=`\u2026 (${h.length})`;h=h.slice(0,Math.max(0,i-w.length))+`${b.dim}${w}${b.reset}`}return d==="status"?`${{success:b.green,running:b.yellow,failed:b.red,aborted:b.red,error:b.red,pending:b.dim}[h.toLowerCase()]||""}${h.padEnd(r[g])}${b.reset}`:h.padEnd(r[g])}).join(" ");console.log(` ${u}`)}let c=t?.total??o.length,m=c===o.length?`${o.length} result${o.length===1?"":"s"}`:`${o.length} of ${c} result${c===1?"":"s"}`;console.log(`
|
|
@@ -1792,6 +1796,7 @@ Skill References:
|
|
|
1792
1796
|
sg skill mssql MSSQL / Azure SQL connection patterns
|
|
1793
1797
|
sg skill redis Redis commands and connection patterns
|
|
1794
1798
|
sg skill sftp-smb SFTP, FTP, SMB patterns
|
|
1799
|
+
sg skill suitecloud NetSuite SuiteCloud validate, preview, deploy
|
|
1795
1800
|
sg skill http HTTP API patterns and authentication
|
|
1796
1801
|
sg skill graphql GraphQL schema introspection and step config
|
|
1797
1802
|
|
|
@@ -1890,6 +1895,7 @@ IMPORTANT FOR AI AGENTS:
|
|
|
1890
1895
|
sg skill mssql MSSQL / Azure SQL step configuration
|
|
1891
1896
|
sg skill redis Redis commands and connection patterns
|
|
1892
1897
|
sg skill sftp-smb SFTP, FTP, and SMB step configuration
|
|
1898
|
+
sg skill suitecloud NetSuite SuiteCloud validate, preview, deploy
|
|
1893
1899
|
sg skill file-handling File detection, parsing, references, uploads
|
|
1894
1900
|
sg skill access-rules RBAC roles, tool/system permissions (enterprise)
|
|
1895
1901
|
|