@bool-ts/guard-sdk 1.1.0-beta.13 → 1.1.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -18
- package/dist/index.js.map +3 -3
- package/dist/types/roles.d.ts +1 -1
- package/package.json +5 -5
- package/src/types/roles.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var m5=Object.defineProperty;var _5=(w)=>w;function l5(w,K){this[w]=_5.bind(null,K)}var eK=(w,K)=>{for(var W in K)m5(w,W,{get:K[W],enumerable:!0,configurable:!0,set:l5.bind(K,W)})};var iK=function(w,K,W,J){var P=arguments.length,b=P<3?K:J===null?J=Object.getOwnPropertyDescriptor(K,W):J,I;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")b=Reflect.decorate(w,K,W,J);else for(var M=w.length-1;M>=0;M--)if(I=w[M])b=(P<3?I(b):P>3?I(K,W,b):I(K,W))||b;return P>3&&b&&Object.defineProperty(K,W,b),b},c2=(w,K)=>(W,J)=>K(W,J,w);var C2={};eK(C2,{ETokenAudiences:()=>B4});var B4;((K)=>K.SYSTEM="https://api-guard.booljs.com")(B4||={});var Fw={};eK(Fw,{service:()=>f5,guardMetadata:()=>p5,guardClient:()=>e5,authState:()=>T5});var T5=Symbol.for("__boolGuard::authState"),p5=Symbol.for("__boolGuard::guardMetadata"),f5=Symbol.for("__boolGuard::authService"),e5=Symbol.for("__boolGuard::guardClient");var i5=(w)=>(K,W)=>{Reflect.defineMetadata(Fw.guardMetadata,w,K.constructor,W)};var n5=Object.create,{getPrototypeOf:d5,defineProperty:nK,getOwnPropertyNames:t5}=Object,a5=Object.prototype.hasOwnProperty;function s5(w){return this[w]}var w0,K0,NK=(w,K,W)=>{var J=w!=null&&typeof w==="object";if(J){var P=K?w0??=new WeakMap:K0??=new WeakMap,b=P.get(w);if(b)return b}W=w!=null?n5(d5(w)):{};let I=K||!w||!w.__esModule?nK(W,"default",{value:w,enumerable:!0}):W;for(let M of t5(w))if(!a5.call(I,M))nK(I,M,{get:s5.bind(w,M),enumerable:!0});if(J)P.set(w,I);return I},T=(w,K)=>()=>(K||w((K={exports:{}}).exports,K),K.exports),W0=(w)=>w;function J0(w,K){this[w]=W0.bind(null,K)}var S4=(w,K)=>{for(var W in K)nK(w,W,{get:K[W],enumerable:!0,configurable:!0,set:J0.bind(K,W)})},P0=import.meta.require,w1=T(()=>{/*! *****************************************************************************
|
|
3
3
|
Copyright (C) Microsoft. All rights reserved.
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
5
|
this file except in compliance with the License. You may obtain a copy of the
|
|
@@ -12,47 +12,47 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
12
12
|
|
|
13
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
14
|
and limitations under the License.
|
|
15
|
-
***************************************************************************** */var w;(function(K){(function(W){var J=typeof globalThis==="object"?globalThis:typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:A(),P=I(K);if(typeof J.Reflect<"u")P=I(J.Reflect,P);if(W(P,J),typeof J.Reflect>"u")J.Reflect=K;function I(M,N){return function(Q,B){if(Object.defineProperty(M,Q,{configurable:!0,writable:!0,value:B}),N)N(Q,B)}}function b(){try{return Function("return this;")()}catch(M){}}function D(){try{return(0,eval)("(function() { return this; })()")}catch(M){}}function A(){return b()||D()}})(function(W,J){var P=Object.prototype.hasOwnProperty,I=typeof Symbol==="function",b=I&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",D=I&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",A=typeof Object.create==="function",M={__proto__:[]}instanceof Array,N=!A&&!M,Q={create:A?function(){return lw(Object.create(null))}:M?function(){return lw({__proto__:null})}:function(){return lw({})},has:N?function(Y,V){return P.call(Y,V)}:function(Y,V){return V in Y},get:N?function(Y,V){return P.call(Y,V)?Y[V]:void 0}:function(Y,V){return Y[V]}},B=Object.getPrototypeOf(Function),L=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:_K(),g=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:WK(),O=typeof WeakMap==="function"?WeakMap:uK(),v=I?Symbol.for("@reflect-metadata:registry"):void 0,G=dw(),u=tw(G);function o(Y,V,H,C){if(!y(H)){if(!Pw(Y))throw TypeError();if(!Jw(V))throw TypeError();if(!Jw(C)&&!y(C)&&!qw(C))throw TypeError();if(qw(C))C=void 0;return H=i(H),Ww(Y,V,H,C)}else{if(!Pw(Y))throw TypeError();if(!Aw(V))throw TypeError();return T(Y,V)}}W("decorate",o);function F(Y,V){function H(C,_){if(!Jw(C))throw TypeError();if(!y(_)&&!Qw(_))throw TypeError();m(Y,V,C,_)}return H}W("metadata",F);function Z(Y,V,H,C){if(!Jw(H))throw TypeError();if(!y(C))C=i(C);return m(Y,V,H,C)}W("defineMetadata",Z);function x(Y,V,H){if(!Jw(V))throw TypeError();if(!y(H))H=i(H);return ww(Y,V,H)}W("hasMetadata",x);function c(Y,V,H){if(!Jw(V))throw TypeError();if(!y(H))H=i(H);return a(Y,V,H)}W("hasOwnMetadata",c);function E(Y,V,H){if(!Jw(V))throw TypeError();if(!y(H))H=i(H);return n(Y,V,H)}W("getMetadata",E);function X(Y,V,H){if(!Jw(V))throw TypeError();if(!y(H))H=i(H);return Kw(Y,V,H)}W("getOwnMetadata",X);function U(Y,V){if(!Jw(Y))throw TypeError();if(!y(V))V=i(V);return l(Y,V)}W("getMetadataKeys",U);function q(Y,V){if(!Jw(Y))throw TypeError();if(!y(V))V=i(V);return Vw(Y,V)}W("getOwnMetadataKeys",q);function r(Y,V,H){if(!Jw(V))throw TypeError();if(!y(H))H=i(H);if(!Jw(V))throw TypeError();if(!y(H))H=i(H);var C=b2(V,H,!1);if(y(C))return!1;return C.OrdinaryDeleteMetadata(Y,V,H)}W("deleteMetadata",r);function T(Y,V){for(var H=Y.length-1;H>=0;--H){var C=Y[H],_=C(V);if(!y(_)&&!qw(_)){if(!Aw(_))throw TypeError();V=_}}return V}function Ww(Y,V,H,C){for(var _=Y.length-1;_>=0;--_){var Dw=Y[_],$=Dw(V,H,C);if(!y($)&&!qw($)){if(!Jw($))throw TypeError();C=$}}return C}function ww(Y,V,H){var C=a(Y,V,H);if(C)return!0;var _=Hw(V);if(!qw(_))return ww(Y,_,H);return!1}function a(Y,V,H){var C=b2(V,H,!1);if(y(C))return!1;return xw(C.OrdinaryHasOwnMetadata(Y,V,H))}function n(Y,V,H){var C=a(Y,V,H);if(C)return Kw(Y,V,H);var _=Hw(V);if(!qw(_))return n(Y,_,H);return}function Kw(Y,V,H){var C=b2(V,H,!1);if(y(C))return;return C.OrdinaryGetOwnMetadata(Y,V,H)}function m(Y,V,H,C){var _=b2(H,C,!0);_.OrdinaryDefineOwnMetadata(Y,V,H,C)}function l(Y,V){var H=Vw(Y,V),C=Hw(Y);if(C===null)return H;var _=l(C,V);if(_.length<=0)return H;if(H.length<=0)return _;var Dw=new g,$=[];for(var S=0,z=H;S<z.length;S++){var j=z[S],k=Dw.has(j);if(!k)Dw.add(j),$.push(j)}for(var R=0,e=_;R<e.length;R++){var j=e[R],k=Dw.has(j);if(!k)Dw.add(j),$.push(j)}return $}function Vw(Y,V){var H=b2(Y,V,!1);if(!H)return[];return H.OrdinaryOwnMetadataKeys(Y,V)}function kw(Y){if(Y===null)return 1;switch(typeof Y){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return Y===null?1:6;default:return 6}}function y(Y){return Y===void 0}function qw(Y){return Y===null}function _w(Y){return typeof Y==="symbol"}function Jw(Y){return typeof Y==="object"?Y!==null:typeof Y==="function"}function ow(Y,V){switch(kw(Y)){case 0:return Y;case 1:return Y;case 2:return Y;case 3:return Y;case 4:return Y;case 5:return Y}var H=V===3?"string":V===5?"number":"default",C=Ow(Y,b);if(C!==void 0){var _=C.call(Y,H);if(Jw(_))throw TypeError();return _}return Fw(Y,H==="default"?"number":H)}function Fw(Y,V){if(V==="string"){var H=Y.toString;if(d(H)){var C=H.call(Y);if(!Jw(C))return C}var _=Y.valueOf;if(d(_)){var C=_.call(Y);if(!Jw(C))return C}}else{var _=Y.valueOf;if(d(_)){var C=_.call(Y);if(!Jw(C))return C}var Dw=Y.toString;if(d(Dw)){var C=Dw.call(Y);if(!Jw(C))return C}}throw TypeError()}function xw(Y){return!!Y}function uw(Y){return""+Y}function i(Y){var V=ow(Y,3);if(_w(V))return V;return uw(V)}function Pw(Y){return Array.isArray?Array.isArray(Y):Y instanceof Object?Y instanceof Array:Object.prototype.toString.call(Y)==="[object Array]"}function d(Y){return typeof Y==="function"}function Aw(Y){return typeof Y==="function"}function Qw(Y){switch(kw(Y)){case 3:return!0;case 4:return!0;default:return!1}}function Lw(Y,V){return Y===V||Y!==Y&&V!==V}function Ow(Y,V){var H=Y[V];if(H===void 0||H===null)return;if(!d(H))throw TypeError();return H}function Tw(Y){var V=Ow(Y,D);if(!d(V))throw TypeError();var H=V.call(Y);if(!Jw(H))throw TypeError();return H}function Ew(Y){return Y.value}function Uw(Y){var V=Y.next();return V.done?!1:V}function yw(Y){var V=Y.return;if(V)V.call(Y)}function Hw(Y){var V=Object.getPrototypeOf(Y);if(typeof Y!=="function"||Y===B)return V;if(V!==B)return V;var H=Y.prototype,C=H&&Object.getPrototypeOf(H);if(C==null||C===Object.prototype)return V;var _=C.constructor;if(typeof _!=="function")return V;if(_===Y)return V;return _}function nw(){var Y;if(!y(v)&&typeof J.Reflect<"u"&&!(v in J.Reflect)&&typeof J.Reflect.defineMetadata==="function")Y=cK(J.Reflect);var V,H,C,_=new O,Dw={registerProvider:$,getProvider:z,setProvider:k};return Dw;function $(R){if(!Object.isExtensible(Dw))throw Error("Cannot add provider to a frozen registry.");switch(!0){case Y===R:break;case y(V):V=R;break;case V===R:break;case y(H):H=R;break;case H===R:break;default:if(C===void 0)C=new g;C.add(R);break}}function S(R,e){if(!y(V)){if(V.isProviderFor(R,e))return V;if(!y(H)){if(H.isProviderFor(R,e))return V;if(!y(C)){var s=Tw(C);while(!0){var t=Uw(s);if(!t)return;var Bw=Ew(t);if(Bw.isProviderFor(R,e))return yw(s),Bw}}}}if(!y(Y)&&Y.isProviderFor(R,e))return Y;return}function z(R,e){var s=_.get(R),t;if(!y(s))t=s.get(e);if(!y(t))return t;if(t=S(R,e),!y(t)){if(y(s))s=new L,_.set(R,s);s.set(e,t)}return t}function j(R){if(y(R))throw TypeError();return V===R||H===R||!y(C)&&C.has(R)}function k(R,e,s){if(!j(s))throw Error("Metadata provider not registered.");var t=z(R,e);if(t!==s){if(!y(t))return!1;var Bw=_.get(R);if(y(Bw))Bw=new L,_.set(R,Bw);Bw.set(e,s)}return!0}}function dw(){var Y;if(!y(v)&&Jw(J.Reflect)&&Object.isExtensible(J.Reflect))Y=J.Reflect[v];if(y(Y))Y=nw();if(!y(v)&&Jw(J.Reflect)&&Object.isExtensible(J.Reflect))Object.defineProperty(J.Reflect,v,{enumerable:!1,configurable:!1,writable:!1,value:Y});return Y}function tw(Y){var V=new O,H={isProviderFor:function(j,k){var R=V.get(j);if(y(R))return!1;return R.has(k)},OrdinaryDefineOwnMetadata:$,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:Dw,OrdinaryOwnMetadataKeys:S,OrdinaryDeleteMetadata:z};return G.registerProvider(H),H;function C(j,k,R){var e=V.get(j),s=!1;if(y(e)){if(!R)return;e=new L,V.set(j,e),s=!0}var t=e.get(k);if(y(t)){if(!R)return;if(t=new L,e.set(k,t),!Y.setProvider(j,k,H)){if(e.delete(k),s)V.delete(j);throw Error("Wrong provider for target.")}}return t}function _(j,k,R){var e=C(k,R,!1);if(y(e))return!1;return xw(e.has(j))}function Dw(j,k,R){var e=C(k,R,!1);if(y(e))return;return e.get(j)}function $(j,k,R,e){var s=C(R,e,!0);s.set(j,k)}function S(j,k){var R=[],e=C(j,k,!1);if(y(e))return R;var s=e.keys(),t=Tw(s),Bw=0;while(!0){var Y2=Uw(t);if(!Y2)return R.length=Bw,R;var aw=Ew(Y2);try{R[Bw]=aw}catch(vw){try{yw(t)}finally{throw vw}}Bw++}}function z(j,k,R){var e=C(k,R,!1);if(y(e))return!1;if(!e.delete(j))return!1;if(e.size===0){var s=V.get(k);if(!y(s)){if(s.delete(R),s.size===0)V.delete(s)}}return!0}}function cK(Y){var{defineMetadata:V,hasOwnMetadata:H,getOwnMetadata:C,getOwnMetadataKeys:_,deleteMetadata:Dw}=Y,$=new O,S={isProviderFor:function(z,j){var k=$.get(z);if(!y(k)&&k.has(j))return!0;if(_(z,j).length){if(y(k))k=new g,$.set(z,k);return k.add(j),!0}return!1},OrdinaryDefineOwnMetadata:V,OrdinaryHasOwnMetadata:H,OrdinaryGetOwnMetadata:C,OrdinaryOwnMetadataKeys:_,OrdinaryDeleteMetadata:Dw};return S}function b2(Y,V,H){var C=G.getProvider(Y,V);if(!y(C))return C;if(H){if(G.setProvider(Y,V,u))return u;throw Error("Illegal state.")}return}function _K(){var Y={},V=[],H=function(){function S(z,j,k){this._index=0,this._keys=z,this._values=j,this._selector=k}return S.prototype["@@iterator"]=function(){return this},S.prototype[D]=function(){return this},S.prototype.next=function(){var z=this._index;if(z>=0&&z<this._keys.length){var j=this._selector(this._keys[z],this._values[z]);if(z+1>=this._keys.length)this._index=-1,this._keys=V,this._values=V;else this._index++;return{value:j,done:!1}}return{value:void 0,done:!0}},S.prototype.throw=function(z){if(this._index>=0)this._index=-1,this._keys=V,this._values=V;throw z},S.prototype.return=function(z){if(this._index>=0)this._index=-1,this._keys=V,this._values=V;return{value:z,done:!0}},S}(),C=function(){function S(){this._keys=[],this._values=[],this._cacheKey=Y,this._cacheIndex=-2}return Object.defineProperty(S.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),S.prototype.has=function(z){return this._find(z,!1)>=0},S.prototype.get=function(z){var j=this._find(z,!1);return j>=0?this._values[j]:void 0},S.prototype.set=function(z,j){var k=this._find(z,!0);return this._values[k]=j,this},S.prototype.delete=function(z){var j=this._find(z,!1);if(j>=0){var k=this._keys.length;for(var R=j+1;R<k;R++)this._keys[R-1]=this._keys[R],this._values[R-1]=this._values[R];if(this._keys.length--,this._values.length--,Lw(z,this._cacheKey))this._cacheKey=Y,this._cacheIndex=-2;return!0}return!1},S.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=Y,this._cacheIndex=-2},S.prototype.keys=function(){return new H(this._keys,this._values,_)},S.prototype.values=function(){return new H(this._keys,this._values,Dw)},S.prototype.entries=function(){return new H(this._keys,this._values,$)},S.prototype["@@iterator"]=function(){return this.entries()},S.prototype[D]=function(){return this.entries()},S.prototype._find=function(z,j){if(!Lw(this._cacheKey,z)){this._cacheIndex=-1;for(var k=0;k<this._keys.length;k++)if(Lw(this._keys[k],z)){this._cacheIndex=k;break}}if(this._cacheIndex<0&&j)this._cacheIndex=this._keys.length,this._keys.push(z),this._values.push(void 0);return this._cacheIndex},S}();return C;function _(S,z){return S}function Dw(S,z){return z}function $(S,z){return[S,z]}}function WK(){var Y=function(){function V(){this._map=new L}return Object.defineProperty(V.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),V.prototype.has=function(H){return this._map.has(H)},V.prototype.add=function(H){return this._map.set(H,H),this},V.prototype.delete=function(H){return this._map.delete(H)},V.prototype.clear=function(){this._map.clear()},V.prototype.keys=function(){return this._map.keys()},V.prototype.values=function(){return this._map.keys()},V.prototype.entries=function(){return this._map.entries()},V.prototype["@@iterator"]=function(){return this.keys()},V.prototype[D]=function(){return this.keys()},V}();return Y}function uK(){var Y=16,V=Q.create(),H=C();return function(){function z(){this._key=C()}return z.prototype.has=function(j){var k=_(j,!1);return k!==void 0?Q.has(k,this._key):!1},z.prototype.get=function(j){var k=_(j,!1);return k!==void 0?Q.get(k,this._key):void 0},z.prototype.set=function(j,k){var R=_(j,!0);return R[this._key]=k,this},z.prototype.delete=function(j){var k=_(j,!1);return k!==void 0?delete k[this._key]:!1},z.prototype.clear=function(){this._key=C()},z}();function C(){var z;do z="@@WeakMap@@"+S();while(Q.has(V,z));return V[z]=!0,z}function _(z,j){if(!P.call(z,H)){if(!j)return;Object.defineProperty(z,H,{value:Q.create()})}return z[H]}function Dw(z,j){for(var k=0;k<j;++k)z[k]=Math.random()*255|0;return z}function $(z){if(typeof Uint8Array==="function"){var j=new Uint8Array(z);if(typeof crypto<"u")crypto.getRandomValues(j);else if(typeof msCrypto<"u")msCrypto.getRandomValues(j);else Dw(j,z);return j}return Dw(Array(z),z)}function S(){var z=$(Y);z[6]=z[6]&79|64,z[8]=z[8]&191|128;var j="";for(var k=0;k<Y;++k){var R=z[k];if(k===4||k===6||k===8)j+="-";if(R<16)j+="0";j+=R.toString(16).toLowerCase()}return j}}function lw(Y){return Y.__=void 0,delete Y.__,Y}})})(w||(w={}))}),H2=p((w,K)=>{K.exports=TypeError}),w0=p((w,K)=>{K.exports=s5("util").inspect}),NK=p((w,K)=>{var W=typeof Map==="function"&&Map.prototype,J=Object.getOwnPropertyDescriptor&&W?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,P=W&&J&&typeof J.get==="function"?J.get:null,I=W&&Map.prototype.forEach,b=typeof Set==="function"&&Set.prototype,D=Object.getOwnPropertyDescriptor&&b?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,A=b&&D&&typeof D.get==="function"?D.get:null,M=b&&Set.prototype.forEach,N=typeof WeakMap==="function"&&WeakMap.prototype,Q=N?WeakMap.prototype.has:null,B=typeof WeakSet==="function"&&WeakSet.prototype,L=B?WeakSet.prototype.has:null,g=typeof WeakRef==="function"&&WeakRef.prototype,O=g?WeakRef.prototype.deref:null,v=Boolean.prototype.valueOf,G=Object.prototype.toString,u=Function.prototype.toString,o=String.prototype.match,F=String.prototype.slice,Z=String.prototype.replace,x=String.prototype.toUpperCase,c=String.prototype.toLowerCase,E=RegExp.prototype.test,X=Array.prototype.concat,U=Array.prototype.join,q=Array.prototype.slice,r=Math.floor,T=typeof BigInt==="function"?BigInt.prototype.valueOf:null,Ww=Object.getOwnPropertySymbols,ww=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null,a=typeof Symbol==="function"&&typeof Symbol.iterator==="object",n=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===a?"object":"symbol")?Symbol.toStringTag:null,Kw=Object.prototype.propertyIsEnumerable,m=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function l($,S){if($===1/0||$===-1/0||$!==$||$&&$>-1000&&$<1000||E.call(/e/,S))return S;var z=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $==="number"){var j=$<0?-r(-$):r($);if(j!==$){var k=String(j),R=F.call(S,k.length+1);return Z.call(k,z,"$&_")+"."+Z.call(Z.call(R,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Z.call(S,z,"$&_")}var Vw=w0(),kw=Vw.custom,y=Lw(kw)?kw:null,qw={__proto__:null,double:'"',single:"'"},_w={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};K.exports=function $(S,z,j,k){var R=z||{};if(Ew(R,"quoteStyle")&&!Ew(qw,R.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(Ew(R,"maxStringLength")&&(typeof R.maxStringLength==="number"?R.maxStringLength<0&&R.maxStringLength!==1/0:R.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var e=Ew(R,"customInspect")?R.customInspect:!0;if(typeof e!=="boolean"&&e!=="symbol")throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ew(R,"indent")&&R.indent!==null&&R.indent!=="\t"&&!(parseInt(R.indent,10)===R.indent&&R.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ew(R,"numericSeparator")&&typeof R.numericSeparator!=="boolean")throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=R.numericSeparator;if(typeof S>"u")return"undefined";if(S===null)return"null";if(typeof S==="boolean")return S?"true":"false";if(typeof S==="string")return WK(S,R);if(typeof S==="number"){if(S===0)return 1/0/S>0?"0":"-0";var t=String(S);return s?l(S,t):t}if(typeof S==="bigint"){var Bw=String(S)+"n";return s?l(S,Bw):Bw}var Y2=typeof R.depth>"u"?5:R.depth;if(typeof j>"u")j=0;if(j>=Y2&&Y2>0&&typeof S==="object")return xw(S)?"[Array]":"[Object]";var aw=C(R,j);if(typeof k>"u")k=[];else if(Hw(k,S)>=0)return"[Circular]";function vw(X2,PK,u5){if(PK)k=q.call(k),k.push(PK);if(u5){var M4={depth:R.depth};if(Ew(R,"quoteStyle"))M4.quoteStyle=R.quoteStyle;return $(X2,M4,j+1,k)}return $(X2,R,j+1,k)}if(typeof S==="function"&&!i(S)){var J4=yw(S),P4=Dw(S,vw);return"[Function"+(J4?": "+J4:" (anonymous)")+"]"+(P4.length>0?" { "+U.call(P4,", ")+" }":"")}if(Lw(S)){var I4=a?Z.call(String(S),/^(Symbol\(.*\))_[^)]*$/,"$1"):ww.call(S);return typeof S==="object"&&!a?lw(I4):I4}if(_K(S)){var g2="<"+c.call(String(S.nodeName)),yK=S.attributes||[];for(var JK=0;JK<yK.length;JK++)g2+=" "+yK[JK].name+"="+Jw(ow(yK[JK].value),"double",R);if(g2+=">",S.childNodes&&S.childNodes.length)g2+="...";return g2+="</"+c.call(String(S.nodeName))+">",g2}if(xw(S)){if(S.length===0)return"[]";var mK=Dw(S,vw);if(aw&&!H(mK))return"["+_(mK,aw)+"]";return"[ "+U.call(mK,", ")+" ]"}if(Pw(S)){var TK=Dw(S,vw);if(!("cause"in Error.prototype)&&"cause"in S&&!Kw.call(S,"cause"))return"{ ["+String(S)+"] "+U.call(X.call("[cause]: "+vw(S.cause),TK),", ")+" }";if(TK.length===0)return"["+String(S)+"]";return"{ ["+String(S)+"] "+U.call(TK,", ")+" }"}if(typeof S==="object"&&e){if(y&&typeof S[y]==="function"&&Vw)return Vw(S,{depth:Y2-j});else if(e!=="symbol"&&typeof S.inspect==="function")return S.inspect()}if(nw(S)){var b4=[];if(I)I.call(S,function(X2,PK){b4.push(vw(PK,S,!0)+" => "+vw(X2,S))});return V("Map",P.call(S),b4,aw)}if(cK(S)){var D4=[];if(M)M.call(S,function(X2){D4.push(vw(X2,S))});return V("Set",A.call(S),D4,aw)}if(dw(S))return Y("WeakMap");if(b2(S))return Y("WeakSet");if(tw(S))return Y("WeakRef");if(Aw(S))return lw(vw(Number(S)));if(Ow(S))return lw(vw(T.call(S)));if(Qw(S))return lw(v.call(S));if(d(S))return lw(vw(String(S)));if(typeof window<"u"&&S===window)return"{ [object Window] }";if(typeof globalThis<"u"&&S===globalThis||typeof global<"u"&&S===global)return"{ [object globalThis] }";if(!uw(S)&&!i(S)){var lK=Dw(S,vw),G4=m?m(S)===Object.prototype:S instanceof Object||S.constructor===Object,pK=S instanceof Object?"":"null prototype",A4=!G4&&n&&Object(S)===S&&n in S?F.call(Uw(S),8,-1):pK?"Object":"",_5=G4||typeof S.constructor!=="function"?"":S.constructor.name?S.constructor.name+" ":"",eK=_5+(A4||pK?"["+U.call(X.call([],A4||[],pK||[]),": ")+"] ":"");if(lK.length===0)return eK+"{}";if(aw)return eK+"{"+_(lK,aw)+"}";return eK+"{ "+U.call(lK,", ")+" }"}return String(S)};function Jw($,S,z){var j=z.quoteStyle||S,k=qw[j];return k+$+k}function ow($){return Z.call(String($),/"/g,""")}function Fw($){return!n||!(typeof $==="object"&&((n in $)||typeof $[n]<"u"))}function xw($){return Uw($)==="[object Array]"&&Fw($)}function uw($){return Uw($)==="[object Date]"&&Fw($)}function i($){return Uw($)==="[object RegExp]"&&Fw($)}function Pw($){return Uw($)==="[object Error]"&&Fw($)}function d($){return Uw($)==="[object String]"&&Fw($)}function Aw($){return Uw($)==="[object Number]"&&Fw($)}function Qw($){return Uw($)==="[object Boolean]"&&Fw($)}function Lw($){if(a)return $&&typeof $==="object"&&$ instanceof Symbol;if(typeof $==="symbol")return!0;if(!$||typeof $!=="object"||!ww)return!1;try{return ww.call($),!0}catch(S){}return!1}function Ow($){if(!$||typeof $!=="object"||!T)return!1;try{return T.call($),!0}catch(S){}return!1}var Tw=Object.prototype.hasOwnProperty||function($){return $ in this};function Ew($,S){return Tw.call($,S)}function Uw($){return G.call($)}function yw($){if($.name)return $.name;var S=o.call(u.call($),/^function\s*([\w$]+)/);if(S)return S[1];return null}function Hw($,S){if($.indexOf)return $.indexOf(S);for(var z=0,j=$.length;z<j;z++)if($[z]===S)return z;return-1}function nw($){if(!P||!$||typeof $!=="object")return!1;try{P.call($);try{A.call($)}catch(S){return!0}return $ instanceof Map}catch(S){}return!1}function dw($){if(!Q||!$||typeof $!=="object")return!1;try{Q.call($,Q);try{L.call($,L)}catch(S){return!0}return $ instanceof WeakMap}catch(S){}return!1}function tw($){if(!O||!$||typeof $!=="object")return!1;try{return O.call($),!0}catch(S){}return!1}function cK($){if(!A||!$||typeof $!=="object")return!1;try{A.call($);try{P.call($)}catch(S){return!0}return $ instanceof Set}catch(S){}return!1}function b2($){if(!L||!$||typeof $!=="object")return!1;try{L.call($,L);try{Q.call($,Q)}catch(S){return!0}return $ instanceof WeakSet}catch(S){}return!1}function _K($){if(!$||typeof $!=="object")return!1;if(typeof HTMLElement<"u"&&$ instanceof HTMLElement)return!0;return typeof $.nodeName==="string"&&typeof $.getAttribute==="function"}function WK($,S){if($.length>S.maxStringLength){var z=$.length-S.maxStringLength,j="... "+z+" more character"+(z>1?"s":"");return WK(F.call($,0,S.maxStringLength),S)+j}var k=_w[S.quoteStyle||"single"];k.lastIndex=0;var R=Z.call(Z.call($,k,"\\$1"),/[\x00-\x1f]/g,uK);return Jw(R,"single",S)}function uK($){var S=$.charCodeAt(0),z={8:"b",9:"t",10:"n",12:"f",13:"r"}[S];if(z)return"\\"+z;return"\\x"+(S<16?"0":"")+x.call(S.toString(16))}function lw($){return"Object("+$+")"}function Y($){return $+" { ? }"}function V($,S,z,j){var k=j?_(z,j):U.call(z,", ");return $+" ("+S+") {"+k+"}"}function H($){for(var S=0;S<$.length;S++)if(Hw($[S],`
|
|
16
|
-
`)>=0)return!1;return!0}function
|
|
17
|
-
|
|
18
|
-
`+S.prev}function Dw($,S){var z=xw($),j=[];if(z){j.length=$.length;for(var k=0;k<$.length;k++)j[k]=Ew($,k)?S($[k],$):""}var R=typeof Ww==="function"?Ww($):[],e;if(a){e={};for(var s=0;s<R.length;s++)e["$"+R[s]]=R[s]}for(var t in $){if(!Ew($,t))continue;if(z&&String(Number(t))===t&&t<$.length)continue;if(a&&e["$"+t]instanceof Symbol)continue;else if(E.call(/[^\w$]/,t))j.push(S(t,$)+": "+S($[t],$));else j.push(t+": "+S($[t],$))}if(typeof Ww==="function"){for(var Bw=0;Bw<R.length;Bw++)if(Kw.call($,R[Bw]))j.push("["+S(R[Bw])+"]: "+S($[R[Bw]],$))}return j}}),K0=p((w,K)=>{var W=NK(),J=H2(),P=function(M,N,Q){var B=M,L;for(;(L=B.next)!=null;B=L)if(L.key===N){if(B.next=L.next,!Q)L.next=M.next,M.next=L;return L}},I=function(M,N){if(!M)return;var Q=P(M,N);return Q&&Q.value},b=function(M,N,Q){var B=P(M,N);if(B)B.value=Q;else M.next={key:N,next:M.next,value:Q}},D=function(M,N){if(!M)return!1;return!!P(M,N)},A=function(M,N){if(M)return P(M,N,!0)};K.exports=function(){var M,N={assert:function(Q){if(!N.has(Q))throw new J("Side channel does not contain "+W(Q))},delete:function(Q){var B=M&&M.next,L=A(M,Q);if(L&&B&&B===L)M=void 0;return!!L},get:function(Q){return I(M,Q)},has:function(Q){return D(M,Q)},set:function(Q,B){if(!M)M={next:void 0};b(M,Q,B)}};return N}}),S4=p((w,K)=>{K.exports=Object}),W0=p((w,K)=>{K.exports=Error}),J0=p((w,K)=>{K.exports=EvalError}),P0=p((w,K)=>{K.exports=RangeError}),I0=p((w,K)=>{K.exports=ReferenceError}),b0=p((w,K)=>{K.exports=SyntaxError}),D0=p((w,K)=>{K.exports=URIError}),G0=p((w,K)=>{K.exports=Math.abs}),A0=p((w,K)=>{K.exports=Math.floor}),M0=p((w,K)=>{K.exports=Math.max}),O0=p((w,K)=>{K.exports=Math.min}),B0=p((w,K)=>{K.exports=Math.pow}),N0=p((w,K)=>{K.exports=Math.round}),Q0=p((w,K)=>{K.exports=Number.isNaN||function(W){return W!==W}}),S0=p((w,K)=>{var W=Q0();K.exports=function(J){if(W(J)||J===0)return J;return J<0?-1:1}}),$0=p((w,K)=>{K.exports=Object.getOwnPropertyDescriptor}),$4=p((w,K)=>{var W=$0();if(W)try{W([],"length")}catch(J){W=null}K.exports=W}),Y0=p((w,K)=>{var W=Object.defineProperty||!1;if(W)try{W({},"a",{value:1})}catch(J){W=!1}K.exports=W}),X0=p((w,K)=>{K.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var W={},J=Symbol("test"),P=Object(J);if(typeof J==="string")return!1;if(Object.prototype.toString.call(J)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;var I=42;W[J]=I;for(var b in W)return!1;if(typeof Object.keys==="function"&&Object.keys(W).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(W).length!==0)return!1;var D=Object.getOwnPropertySymbols(W);if(D.length!==1||D[0]!==J)return!1;if(!Object.prototype.propertyIsEnumerable.call(W,J))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var A=Object.getOwnPropertyDescriptor(W,J);if(A.value!==I||A.enumerable!==!0)return!1}return!0}}),V0=p((w,K)=>{var W=typeof Symbol<"u"&&Symbol,J=X0();K.exports=function(){if(typeof W!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof W("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return J()}}),Y4=p((w,K)=>{K.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),X4=p((w,K)=>{var W=S4();K.exports=W.getPrototypeOf||null}),L0=p((w,K)=>{var W="Function.prototype.bind called on incompatible ",J=Object.prototype.toString,P=Math.max,I="[object Function]",b=function(M,N){var Q=[];for(var B=0;B<M.length;B+=1)Q[B]=M[B];for(var L=0;L<N.length;L+=1)Q[L+M.length]=N[L];return Q},D=function(M,N){var Q=[];for(var B=N||0,L=0;B<M.length;B+=1,L+=1)Q[L]=M[B];return Q},A=function(M,N){var Q="";for(var B=0;B<M.length;B+=1)if(Q+=M[B],B+1<M.length)Q+=N;return Q};K.exports=function(M){var N=this;if(typeof N!=="function"||J.apply(N)!==I)throw TypeError(W+N);var Q=D(arguments,1),B,L=function(){if(this instanceof B){var u=N.apply(this,b(Q,arguments));if(Object(u)===u)return u;return this}return N.apply(M,b(Q,arguments))},g=P(0,N.length-Q.length),O=[];for(var v=0;v<g;v++)O[v]="$"+v;if(B=Function("binder","return function ("+A(O,",")+"){ return binder.apply(this,arguments); }")(L),N.prototype){var G=function(){};G.prototype=N.prototype,B.prototype=new G,G.prototype=null}return B}}),QK=p((w,K)=>{var W=L0();K.exports=Function.prototype.bind||W}),K1=p((w,K)=>{K.exports=Function.prototype.call}),V4=p((w,K)=>{K.exports=Function.prototype.apply}),E0=p((w,K)=>{K.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),U0=p((w,K)=>{var W=QK(),J=V4(),P=K1(),I=E0();K.exports=I||W.call(P,J)}),L4=p((w,K)=>{var W=QK(),J=H2(),P=K1(),I=U0();K.exports=function(b){if(b.length<1||typeof b[0]!=="function")throw new J("a function is required");return I(W,P,b)}}),H0=p((w,K)=>{var W=L4(),J=$4(),P;try{P=[].__proto__===Array.prototype}catch(A){if(!A||typeof A!=="object"||!("code"in A)||A.code!=="ERR_PROTO_ACCESS")throw A}var I=!!P&&J&&J(Object.prototype,"__proto__"),b=Object,D=b.getPrototypeOf;K.exports=I&&typeof I.get==="function"?W([I.get]):typeof D==="function"?function(A){return D(A==null?A:b(A))}:!1}),q0=p((w,K)=>{var W=Y4(),J=X4(),P=H0();K.exports=W?function(I){return W(I)}:J?function(I){if(!I||typeof I!=="object"&&typeof I!=="function")throw TypeError("getProto: not an object");return J(I)}:P?function(I){return P(I)}:null}),h0=p((w,K)=>{var W=Function.prototype.call,J=Object.prototype.hasOwnProperty,P=QK();K.exports=P.call(W,J)}),W1=p((w,K)=>{var W,J=S4(),P=W0(),I=J0(),b=P0(),D=I0(),A=b0(),M=H2(),N=D0(),Q=G0(),B=A0(),L=M0(),g=O0(),O=B0(),v=N0(),G=S0(),u=Function,o=function(i){try{return u('"use strict"; return ('+i+").constructor;")()}catch(Pw){}},F=$4(),Z=Y0(),x=function(){throw new M},c=F?function(){try{return arguments.callee,x}catch(i){try{return F(arguments,"callee").get}catch(Pw){return x}}}():x,E=V0()(),X=q0(),U=X4(),q=Y4(),r=V4(),T=K1(),Ww={},ww=typeof Uint8Array>"u"||!X?W:X(Uint8Array),a={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":E&&X?X([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":Ww,"%AsyncGenerator%":Ww,"%AsyncGeneratorFunction%":Ww,"%AsyncIteratorPrototype%":Ww,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":P,"%eval%":eval,"%EvalError%":I,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":Ww,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&X?X(X([][Symbol.iterator]())):W,"%JSON%":typeof JSON==="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!X?W:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":J,"%Object.getOwnPropertyDescriptor%":F,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":b,"%ReferenceError%":D,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!X?W:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&X?X(""[Symbol.iterator]()):W,"%Symbol%":E?Symbol:W,"%SyntaxError%":A,"%ThrowTypeError%":c,"%TypedArray%":ww,"%TypeError%":M,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":N,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":r,"%Object.defineProperty%":Z,"%Object.getPrototypeOf%":U,"%Math.abs%":Q,"%Math.floor%":B,"%Math.max%":L,"%Math.min%":g,"%Math.pow%":O,"%Math.round%":v,"%Math.sign%":G,"%Reflect.getPrototypeOf%":q};if(X)try{null.error}catch(i){n=X(X(i)),a["%Error.prototype%"]=n}var n,Kw=function i(Pw){var d;if(Pw==="%AsyncFunction%")d=o("async function () {}");else if(Pw==="%GeneratorFunction%")d=o("function* () {}");else if(Pw==="%AsyncGeneratorFunction%")d=o("async function* () {}");else if(Pw==="%AsyncGenerator%"){var Aw=i("%AsyncGeneratorFunction%");if(Aw)d=Aw.prototype}else if(Pw==="%AsyncIteratorPrototype%"){var Qw=i("%AsyncGenerator%");if(Qw&&X)d=X(Qw.prototype)}return a[Pw]=d,d},m={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},l=QK(),Vw=h0(),kw=l.call(T,Array.prototype.concat),y=l.call(r,Array.prototype.splice),qw=l.call(T,String.prototype.replace),_w=l.call(T,String.prototype.slice),Jw=l.call(T,RegExp.prototype.exec),ow=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Fw=/\\(\\)?/g,xw=function(i){var Pw=_w(i,0,1),d=_w(i,-1);if(Pw==="%"&&d!=="%")throw new A("invalid intrinsic syntax, expected closing `%`");else if(d==="%"&&Pw!=="%")throw new A("invalid intrinsic syntax, expected opening `%`");var Aw=[];return qw(i,ow,function(Qw,Lw,Ow,Tw){Aw[Aw.length]=Ow?qw(Tw,Fw,"$1"):Lw||Qw}),Aw},uw=function(i,Pw){var d=i,Aw;if(Vw(m,d))Aw=m[d],d="%"+Aw[0]+"%";if(Vw(a,d)){var Qw=a[d];if(Qw===Ww)Qw=Kw(d);if(typeof Qw>"u"&&!Pw)throw new M("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:Aw,name:d,value:Qw}}throw new A("intrinsic "+i+" does not exist!")};K.exports=function(i,Pw){if(typeof i!=="string"||i.length===0)throw new M("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Pw!=="boolean")throw new M('"allowMissing" argument must be a boolean');if(Jw(/^%?[^%]*%?$/,i)===null)throw new A("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var d=xw(i),Aw=d.length>0?d[0]:"",Qw=uw("%"+Aw+"%",Pw),Lw=Qw.name,Ow=Qw.value,Tw=!1,Ew=Qw.alias;if(Ew)Aw=Ew[0],y(d,kw([0,1],Ew));for(var Uw=1,yw=!0;Uw<d.length;Uw+=1){var Hw=d[Uw],nw=_w(Hw,0,1),dw=_w(Hw,-1);if((nw==='"'||nw==="'"||nw==="`"||(dw==='"'||dw==="'"||dw==="`"))&&nw!==dw)throw new A("property names with quotes must have matching quotes");if(Hw==="constructor"||!yw)Tw=!0;if(Aw+="."+Hw,Lw="%"+Aw+"%",Vw(a,Lw))Ow=a[Lw];else if(Ow!=null){if(!(Hw in Ow)){if(!Pw)throw new M("base intrinsic for "+i+" exists, but the property is not available.");return}if(F&&Uw+1>=d.length){var tw=F(Ow,Hw);if(yw=!!tw,yw&&"get"in tw&&!("originalValue"in tw.get))Ow=tw.get;else Ow=Ow[Hw]}else yw=Vw(Ow,Hw),Ow=Ow[Hw];if(yw&&!Tw)a[Lw]=Ow}}return Ow}}),E4=p((w,K)=>{var W=W1(),J=L4(),P=J([W("%String.prototype.indexOf%")]);K.exports=function(I,b){var D=W(I,!!b);if(typeof D==="function"&&P(I,".prototype.")>-1)return J([D]);return D}}),U4=p((w,K)=>{var W=W1(),J=E4(),P=NK(),I=H2(),b=W("%Map%",!0),D=J("Map.prototype.get",!0),A=J("Map.prototype.set",!0),M=J("Map.prototype.has",!0),N=J("Map.prototype.delete",!0),Q=J("Map.prototype.size",!0);K.exports=!!b&&function(){var B,L={assert:function(g){if(!L.has(g))throw new I("Side channel does not contain "+P(g))},delete:function(g){if(B){var O=N(B,g);if(Q(B)===0)B=void 0;return O}return!1},get:function(g){if(B)return D(B,g)},has:function(g){if(B)return M(B,g);return!1},set:function(g,O){if(!B)B=new b;A(B,g,O)}};return L}}),z0=p((w,K)=>{var W=W1(),J=E4(),P=NK(),I=U4(),b=H2(),D=W("%WeakMap%",!0),A=J("WeakMap.prototype.get",!0),M=J("WeakMap.prototype.set",!0),N=J("WeakMap.prototype.has",!0),Q=J("WeakMap.prototype.delete",!0);K.exports=D?function(){var B,L,g={assert:function(O){if(!g.has(O))throw new b("Side channel does not contain "+P(O))},delete:function(O){if(D&&O&&(typeof O==="object"||typeof O==="function")){if(B)return Q(B,O)}else if(I){if(L)return L.delete(O)}return!1},get:function(O){if(D&&O&&(typeof O==="object"||typeof O==="function")){if(B)return A(B,O)}return L&&L.get(O)},has:function(O){if(D&&O&&(typeof O==="object"||typeof O==="function")){if(B)return N(B,O)}return!!L&&L.has(O)},set:function(O,v){if(D&&O&&(typeof O==="object"||typeof O==="function")){if(!B)B=new D;M(B,O,v)}else if(I){if(!L)L=I();L.set(O,v)}}};return g}:I}),H4=p((w,K)=>{var W=H2(),J=NK(),P=K0(),I=U4(),b=z0(),D=b||I||P;K.exports=function(){var A,M={assert:function(N){if(!M.has(N))throw new W("Side channel does not contain "+J(N))},delete:function(N){return!!A&&A.delete(N)},get:function(N){return A&&A.get(N)},has:function(N){return!!A&&A.has(N)},set:function(N,Q){if(!A)A=D();A.set(N,Q)}};return M}}),J1=p((w,K)=>{var W=String.prototype.replace,J=/%20/g,P={RFC1738:"RFC1738",RFC3986:"RFC3986"};K.exports={default:P.RFC3986,formatters:{RFC1738:function(I){return W.call(I,J,"+")},RFC3986:function(I){return String(I)}},RFC1738:P.RFC1738,RFC3986:P.RFC3986}}),q4=p((w,K)=>{var W=J1(),J=H4(),P=Object.prototype.hasOwnProperty,I=Array.isArray,b=J(),D=function(E,X){return b.set(E,X),E},A=function(E){return b.has(E)},M=function(E){return b.get(E)},N=function(E,X){b.set(E,X)},Q=function(){var E=[];for(var X=0;X<256;++X)E.push("%"+((X<16?"0":"")+X.toString(16)).toUpperCase());return E}(),B=function(E){while(E.length>1){var X=E.pop(),U=X.obj[X.prop];if(I(U)){var q=[];for(var r=0;r<U.length;++r)if(typeof U[r]<"u")q.push(U[r]);X.obj[X.prop]=q}}},L=function(E,X){var U=X&&X.plainObjects?{__proto__:null}:{};for(var q=0;q<E.length;++q)if(typeof E[q]<"u")U[q]=E[q];return U},g=function E(X,U,q){if(!U)return X;if(typeof U!=="object"&&typeof U!=="function"){if(I(X))X.push(U);else if(X&&typeof X==="object"){if(A(X)){var r=M(X)+1;X[r]=U,N(X,r)}else if(q&&(q.plainObjects||q.allowPrototypes)||!P.call(Object.prototype,U))X[U]=!0}else return[X,U];return X}if(!X||typeof X!=="object"){if(A(U)){var T=Object.keys(U),Ww=q&&q.plainObjects?{__proto__:null,0:X}:{0:X};for(var ww=0;ww<T.length;ww++){var a=parseInt(T[ww],10);Ww[a+1]=U[T[ww]]}return D(Ww,M(U)+1)}return[X].concat(U)}var n=X;if(I(X)&&!I(U))n=L(X,q);if(I(X)&&I(U))return U.forEach(function(Kw,m){if(P.call(X,m)){var l=X[m];if(l&&typeof l==="object"&&Kw&&typeof Kw==="object")X[m]=E(l,Kw,q);else X.push(Kw)}else X[m]=Kw}),X;return Object.keys(U).reduce(function(Kw,m){var l=U[m];if(P.call(Kw,m))Kw[m]=E(Kw[m],l,q);else Kw[m]=l;return Kw},n)},O=function(E,X){return Object.keys(X).reduce(function(U,q){return U[q]=X[q],U},E)},v=function(E,X,U){var q=E.replace(/\+/g," ");if(U==="iso-8859-1")return q.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(q)}catch(r){return q}},G=1024,u=function(E,X,U,q,r){if(E.length===0)return E;var T=E;if(typeof E==="symbol")T=Symbol.prototype.toString.call(E);else if(typeof E!=="string")T=String(E);if(U==="iso-8859-1")return escape(T).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});var Ww="";for(var ww=0;ww<T.length;ww+=G){var a=T.length>=G?T.slice(ww,ww+G):T,n=[];for(var Kw=0;Kw<a.length;++Kw){var m=a.charCodeAt(Kw);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||r===W.RFC1738&&(m===40||m===41)){n[n.length]=a.charAt(Kw);continue}if(m<128){n[n.length]=Q[m];continue}if(m<2048){n[n.length]=Q[192|m>>6]+Q[128|m&63];continue}if(m<55296||m>=57344){n[n.length]=Q[224|m>>12]+Q[128|m>>6&63]+Q[128|m&63];continue}Kw+=1,m=65536+((m&1023)<<10|a.charCodeAt(Kw)&1023),n[n.length]=Q[240|m>>18]+Q[128|m>>12&63]+Q[128|m>>6&63]+Q[128|m&63]}Ww+=n.join("")}return Ww},o=function(E){var X=[{obj:{o:E},prop:"o"}],U=[];for(var q=0;q<X.length;++q){var r=X[q],T=r.obj[r.prop],Ww=Object.keys(T);for(var ww=0;ww<Ww.length;++ww){var a=Ww[ww],n=T[a];if(typeof n==="object"&&n!==null&&U.indexOf(n)===-1)X.push({obj:T,prop:a}),U.push(n)}}return B(X),E},F=function(E){return Object.prototype.toString.call(E)==="[object RegExp]"},Z=function(E){if(!E||typeof E!=="object")return!1;return!!(E.constructor&&E.constructor.isBuffer&&E.constructor.isBuffer(E))},x=function(E,X,U,q){if(A(E)){var r=M(E)+1;return E[r]=X,N(E,r),E}var T=[].concat(E,X);if(T.length>U)return D(L(T,{plainObjects:q}),T.length-1);return T},c=function(E,X){if(I(E)){var U=[];for(var q=0;q<E.length;q+=1)U.push(X(E[q]));return U}return X(E)};K.exports={arrayToObject:L,assign:O,combine:x,compact:o,decode:v,encode:u,isBuffer:Z,isOverflow:A,isRegExp:F,maybeMap:c,merge:g}}),F0=p((w,K)=>{var W=H4(),J=q4(),P=J1(),I=Object.prototype.hasOwnProperty,b={brackets:function(G){return G+"[]"},comma:"comma",indices:function(G,u){return G+"["+u+"]"},repeat:function(G){return G}},D=Array.isArray,A=Array.prototype.push,M=function(G,u){A.apply(G,D(u)?u:[u])},N=Date.prototype.toISOString,Q=P.default,B={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:J.encode,encodeValuesOnly:!1,filter:void 0,format:Q,formatter:P.formatters[Q],indices:!1,serializeDate:function(G){return N.call(G)},skipNulls:!1,strictNullHandling:!1},L=function(G){return typeof G==="string"||typeof G==="number"||typeof G==="boolean"||typeof G==="symbol"||typeof G==="bigint"},g={},O=function G(u,o,F,Z,x,c,E,X,U,q,r,T,Ww,ww,a,n,Kw,m){var l=u,Vw=m,kw=0,y=!1;while((Vw=Vw.get(g))!==void 0&&!y){var qw=Vw.get(u);if(kw+=1,typeof qw<"u")if(qw===kw)throw RangeError("Cyclic object value");else y=!0;if(typeof Vw.get(g)>"u")kw=0}if(typeof q==="function")l=q(o,l);else if(l instanceof Date)l=Ww(l);else if(F==="comma"&&D(l))l=J.maybeMap(l,function(Ow){if(Ow instanceof Date)return Ww(Ow);return Ow});if(l===null){if(c)return U&&!n?U(o,B.encoder,Kw,"key",ww):o;l=""}if(L(l)||J.isBuffer(l)){if(U){var _w=n?o:U(o,B.encoder,Kw,"key",ww);return[a(_w)+"="+a(U(l,B.encoder,Kw,"value",ww))]}return[a(o)+"="+a(String(l))]}var Jw=[];if(typeof l>"u")return Jw;var ow;if(F==="comma"&&D(l)){if(n&&U)l=J.maybeMap(l,U);ow=[{value:l.length>0?l.join(",")||null:void 0}]}else if(D(q))ow=q;else{var Fw=Object.keys(l);ow=r?Fw.sort(r):Fw}var xw=X?String(o).replace(/\./g,"%2E"):String(o),uw=Z&&D(l)&&l.length===1?xw+"[]":xw;if(x&&D(l)&&l.length===0)return uw+"[]";for(var i=0;i<ow.length;++i){var Pw=ow[i],d=typeof Pw==="object"&&Pw&&typeof Pw.value<"u"?Pw.value:l[Pw];if(E&&d===null)continue;var Aw=T&&X?String(Pw).replace(/\./g,"%2E"):String(Pw),Qw=D(l)?typeof F==="function"?F(uw,Aw):uw:uw+(T?"."+Aw:"["+Aw+"]");m.set(u,kw);var Lw=W();Lw.set(g,m),M(Jw,G(d,Qw,F,Z,x,c,E,X,F==="comma"&&n&&D(l)?null:U,q,r,T,Ww,ww,a,n,Kw,Lw))}return Jw},v=function(G){if(!G)return B;if(typeof G.allowEmptyArrays<"u"&&typeof G.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof G.encodeDotInKeys<"u"&&typeof G.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(G.encoder!==null&&typeof G.encoder<"u"&&typeof G.encoder!=="function")throw TypeError("Encoder has to be a function.");var u=G.charset||B.charset;if(typeof G.charset<"u"&&G.charset!=="utf-8"&&G.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var o=P.default;if(typeof G.format<"u"){if(!I.call(P.formatters,G.format))throw TypeError("Unknown format option provided.");o=G.format}var F=P.formatters[o],Z=B.filter;if(typeof G.filter==="function"||D(G.filter))Z=G.filter;var x;if(G.arrayFormat in b)x=G.arrayFormat;else if("indices"in G)x=G.indices?"indices":"repeat";else x=B.arrayFormat;if("commaRoundTrip"in G&&typeof G.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");var c=typeof G.allowDots>"u"?G.encodeDotInKeys===!0?!0:B.allowDots:!!G.allowDots;return{addQueryPrefix:typeof G.addQueryPrefix==="boolean"?G.addQueryPrefix:B.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof G.allowEmptyArrays==="boolean"?!!G.allowEmptyArrays:B.allowEmptyArrays,arrayFormat:x,charset:u,charsetSentinel:typeof G.charsetSentinel==="boolean"?G.charsetSentinel:B.charsetSentinel,commaRoundTrip:!!G.commaRoundTrip,delimiter:typeof G.delimiter>"u"?B.delimiter:G.delimiter,encode:typeof G.encode==="boolean"?G.encode:B.encode,encodeDotInKeys:typeof G.encodeDotInKeys==="boolean"?G.encodeDotInKeys:B.encodeDotInKeys,encoder:typeof G.encoder==="function"?G.encoder:B.encoder,encodeValuesOnly:typeof G.encodeValuesOnly==="boolean"?G.encodeValuesOnly:B.encodeValuesOnly,filter:Z,format:o,formatter:F,serializeDate:typeof G.serializeDate==="function"?G.serializeDate:B.serializeDate,skipNulls:typeof G.skipNulls==="boolean"?G.skipNulls:B.skipNulls,sort:typeof G.sort==="function"?G.sort:null,strictNullHandling:typeof G.strictNullHandling==="boolean"?G.strictNullHandling:B.strictNullHandling}};K.exports=function(G,u){var o=G,F=v(u),Z,x;if(typeof F.filter==="function")x=F.filter,o=x("",o);else if(D(F.filter))x=F.filter,Z=x;var c=[];if(typeof o!=="object"||o===null)return"";var E=b[F.arrayFormat],X=E==="comma"&&F.commaRoundTrip;if(!Z)Z=Object.keys(o);if(F.sort)Z.sort(F.sort);var U=W();for(var q=0;q<Z.length;++q){var r=Z[q],T=o[r];if(F.skipNulls&&T===null)continue;M(c,O(T,r,E,X,F.allowEmptyArrays,F.strictNullHandling,F.skipNulls,F.encodeDotInKeys,F.encode?F.encoder:null,F.filter,F.sort,F.allowDots,F.serializeDate,F.format,F.formatter,F.encodeValuesOnly,F.charset,U))}var Ww=c.join(F.delimiter),ww=F.addQueryPrefix===!0?"?":"";if(F.charsetSentinel)if(F.charset==="iso-8859-1")ww+="utf8=%26%2310003%3B&";else ww+="utf8=%E2%9C%93&";return Ww.length>0?ww+Ww:""}}),R0=p((w,K)=>{var W=q4(),J=Object.prototype.hasOwnProperty,P=Array.isArray,I={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:W.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1000,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},b=function(O){return O.replace(/&#(\d+);/g,function(v,G){return String.fromCharCode(parseInt(G,10))})},D=function(O,v,G){if(O&&typeof O==="string"&&v.comma&&O.indexOf(",")>-1)return O.split(",");if(v.throwOnLimitExceeded&&G>=v.arrayLimit)throw RangeError("Array limit exceeded. Only "+v.arrayLimit+" element"+(v.arrayLimit===1?"":"s")+" allowed in an array.");return O},A="utf8=%26%2310003%3B",M="utf8=%E2%9C%93",N=function(O,v){var G={__proto__:null},u=v.ignoreQueryPrefix?O.replace(/^\?/,""):O;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=v.parameterLimit===1/0?void 0:v.parameterLimit,F=u.split(v.delimiter,v.throwOnLimitExceeded?o+1:o);if(v.throwOnLimitExceeded&&F.length>o)throw RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var Z=-1,x,c=v.charset;if(v.charsetSentinel){for(x=0;x<F.length;++x)if(F[x].indexOf("utf8=")===0){if(F[x]===M)c="utf-8";else if(F[x]===A)c="iso-8859-1";Z=x,x=F.length}}for(x=0;x<F.length;++x){if(x===Z)continue;var E=F[x],X=E.indexOf("]="),U=X===-1?E.indexOf("="):X+1,q,r;if(U===-1)q=v.decoder(E,I.decoder,c,"key"),r=v.strictNullHandling?null:"";else if(q=v.decoder(E.slice(0,U),I.decoder,c,"key"),q!==null)r=W.maybeMap(D(E.slice(U+1),v,P(G[q])?G[q].length:0),function(Ww){return v.decoder(Ww,I.decoder,c,"value")});if(r&&v.interpretNumericEntities&&c==="iso-8859-1")r=b(String(r));if(E.indexOf("[]=")>-1)r=P(r)?[r]:r;if(q!==null){var T=J.call(G,q);if(T&&v.duplicates==="combine")G[q]=W.combine(G[q],r,v.arrayLimit,v.plainObjects);else if(!T||v.duplicates==="last")G[q]=r}}return G},Q=function(O,v,G,u){var o=0;if(O.length>0&&O[O.length-1]==="[]"){var F=O.slice(0,-1).join("");o=Array.isArray(v)&&v[F]?v[F].length:0}var Z=u?v:D(v,G,o);for(var x=O.length-1;x>=0;--x){var c,E=O[x];if(E==="[]"&&G.parseArrays)if(W.isOverflow(Z))c=Z;else c=G.allowEmptyArrays&&(Z===""||G.strictNullHandling&&Z===null)?[]:W.combine([],Z,G.arrayLimit,G.plainObjects);else{c=G.plainObjects?{__proto__:null}:{};var X=E.charAt(0)==="["&&E.charAt(E.length-1)==="]"?E.slice(1,-1):E,U=G.decodeDotInKeys?X.replace(/%2E/g,"."):X,q=parseInt(U,10);if(!G.parseArrays&&U==="")c={0:Z};else if(!isNaN(q)&&E!==U&&String(q)===U&&q>=0&&(G.parseArrays&&q<=G.arrayLimit))c=[],c[q]=Z;else if(U!=="__proto__")c[U]=Z}Z=c}return Z},B=function(O,v){var G=v.allowDots?O.replace(/\.([^.[]+)/g,"[$1]"):O;if(v.depth<=0){if(!v.plainObjects&&J.call(Object.prototype,G)){if(!v.allowPrototypes)return}return[G]}var u=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,F=u.exec(G),Z=F?G.slice(0,F.index):G,x=[];if(Z){if(!v.plainObjects&&J.call(Object.prototype,Z)){if(!v.allowPrototypes)return}x.push(Z)}var c=0;while((F=o.exec(G))!==null&&c<v.depth){c+=1;var E=F[1].slice(1,-1);if(!v.plainObjects&&J.call(Object.prototype,E)){if(!v.allowPrototypes)return}x.push(F[1])}if(F){if(v.strictDepth===!0)throw RangeError("Input depth exceeded depth option of "+v.depth+" and strictDepth is true");x.push("["+G.slice(F.index)+"]")}return x},L=function(O,v,G,u){if(!O)return;var o=B(O,G);if(!o)return;return Q(o,v,G,u)},g=function(O){if(!O)return I;if(typeof O.allowEmptyArrays<"u"&&typeof O.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof O.decodeDotInKeys<"u"&&typeof O.decodeDotInKeys!=="boolean")throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(O.decoder!==null&&typeof O.decoder<"u"&&typeof O.decoder!=="function")throw TypeError("Decoder has to be a function.");if(typeof O.charset<"u"&&O.charset!=="utf-8"&&O.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof O.throwOnLimitExceeded<"u"&&typeof O.throwOnLimitExceeded!=="boolean")throw TypeError("`throwOnLimitExceeded` option must be a boolean");var v=typeof O.charset>"u"?I.charset:O.charset,G=typeof O.duplicates>"u"?I.duplicates:O.duplicates;if(G!=="combine"&&G!=="first"&&G!=="last")throw TypeError("The duplicates option must be either combine, first, or last");var u=typeof O.allowDots>"u"?O.decodeDotInKeys===!0?!0:I.allowDots:!!O.allowDots;return{allowDots:u,allowEmptyArrays:typeof O.allowEmptyArrays==="boolean"?!!O.allowEmptyArrays:I.allowEmptyArrays,allowPrototypes:typeof O.allowPrototypes==="boolean"?O.allowPrototypes:I.allowPrototypes,allowSparse:typeof O.allowSparse==="boolean"?O.allowSparse:I.allowSparse,arrayLimit:typeof O.arrayLimit==="number"?O.arrayLimit:I.arrayLimit,charset:v,charsetSentinel:typeof O.charsetSentinel==="boolean"?O.charsetSentinel:I.charsetSentinel,comma:typeof O.comma==="boolean"?O.comma:I.comma,decodeDotInKeys:typeof O.decodeDotInKeys==="boolean"?O.decodeDotInKeys:I.decodeDotInKeys,decoder:typeof O.decoder==="function"?O.decoder:I.decoder,delimiter:typeof O.delimiter==="string"||W.isRegExp(O.delimiter)?O.delimiter:I.delimiter,depth:typeof O.depth==="number"||O.depth===!1?+O.depth:I.depth,duplicates:G,ignoreQueryPrefix:O.ignoreQueryPrefix===!0,interpretNumericEntities:typeof O.interpretNumericEntities==="boolean"?O.interpretNumericEntities:I.interpretNumericEntities,parameterLimit:typeof O.parameterLimit==="number"?O.parameterLimit:I.parameterLimit,parseArrays:O.parseArrays!==!1,plainObjects:typeof O.plainObjects==="boolean"?O.plainObjects:I.plainObjects,strictDepth:typeof O.strictDepth==="boolean"?!!O.strictDepth:I.strictDepth,strictNullHandling:typeof O.strictNullHandling==="boolean"?O.strictNullHandling:I.strictNullHandling,throwOnLimitExceeded:typeof O.throwOnLimitExceeded==="boolean"?O.throwOnLimitExceeded:!1}};K.exports=function(O,v){var G=g(v);if(O===""||O===null||typeof O>"u")return G.plainObjects?{__proto__:null}:{};var u=typeof O==="string"?N(O,G):O,o=G.plainObjects?{__proto__:null}:{},F=Object.keys(u);for(var Z=0;Z<F.length;++Z){var x=F[Z],c=L(x,u[x],G,typeof O==="string");o=W.merge(o,c,G)}if(G.allowSparse===!0)return o;return W.compact(o)}}),v0=p((w,K)=>{var W=F0(),J=R0(),P=J1();K.exports={formats:P,parse:J,stringify:W}}),WJ=BK(w1(),1),j0={};Q4(j0,{zodSchemaKey:()=>g0,webSocketServerArgsKey:()=>Rw,webSocketMessageArgsKey:()=>bK,webSocketKey:()=>AK,webSocketEventKey:()=>C0,webSocketEventArgumentsKey:()=>Z0,webSocketConnectionArgsKey:()=>D2,webSocketCloseReasonArgsKey:()=>v4,webSocketCloseCodeArgsKey:()=>R4,routeModelArgsKey:()=>ew,responseStatusTextArgsKey:()=>u2,responseStatusArgsKey:()=>V2,responseHeadersArgsKey:()=>sw,responseBodyArgsKey:()=>_2,requestHeadersArgsKey:()=>L2,requestHeaderArgsKey:()=>A2,requestBodyArgsKey:()=>r2,requestArgsKey:()=>M2,queryArgsKey:()=>j4,paramsArgsKey:()=>tK,paramArgsKey:()=>c2,moduleKey:()=>IK,middlewareKey:()=>F4,interceptorKey:()=>h4,injectableKey:()=>z4,injectKey:()=>GK,httpServerArgsKey:()=>G2,guardKey:()=>P1,controllerKey:()=>DK,controllerHttpKey:()=>k0,contextArgsKey:()=>E2,containerKey:()=>x2,configKey:()=>dK,argumentsKey:()=>Xw});var Xw=Symbol.for("____boolTypescriptCore:arguments__"),Z0=Symbol.for("____boolTypescriptCore:webSocketEventArguments__"),dK=Symbol.for("____boolTypescriptCore:config__"),DK=Symbol.for("____boolTypescriptCore:controller__"),h4=Symbol.for("____boolTypescriptCore:interceptor__"),P1=Symbol.for("____boolTypescriptCore:guard__"),k0=Symbol.for("____boolTypescriptCore:controller.http__"),GK=Symbol.for("____boolTypescriptCore:inject__"),z4=Symbol.for("____boolTypescriptCore:injectable__"),F4=Symbol.for("____boolTypescriptCore:middleware__"),IK=Symbol.for("____boolTypescriptCore:module__"),x2=Symbol.for("____boolTypescriptCore:container__"),g0=Symbol.for("____boolTypescriptCore:zodSchema__"),AK=Symbol.for("____boolTypescriptCore:webSocket__"),C0=Symbol.for("____boolTypescriptCore:webSocket:event__"),Rw=Symbol.for("____boolTypescriptCore:webSocketArguments:server__"),D2=Symbol.for("____boolTypescriptCore:webSocketArguments:connection__"),bK=Symbol.for("____boolTypescriptCore:webSocketArguments:message__"),R4=Symbol.for("____boolTypescriptCore:webSocketArguments:closeCode__"),v4=Symbol.for("____boolTypescriptCore:webSocketArguments:closeReason__"),G2=Symbol.for("____boolTypescriptCore:httpArguments:server__"),L2=Symbol.for("____boolTypescriptCore:httpArguments:requestHeaders__"),A2=Symbol.for("____boolTypescriptCore:httpArguments:requestHeader__"),r2=Symbol.for("____boolTypescriptCore:httpArguments:requestBody__"),tK=Symbol.for("____boolTypescriptCore:httpArguments:params__"),c2=Symbol.for("____boolTypescriptCore:httpArguments:param__"),j4=Symbol.for("____boolTypescriptCore:httpArguments:query__"),M2=Symbol.for("____boolTypescriptCore:httpArguments:request__"),sw=Symbol.for("____boolTypescriptCore:httpArguments:responseHeaders__"),E2=Symbol.for("____boolTypescriptCore:httpArguments:context__"),ew=Symbol.for("____boolTypescriptCore:httpArguments:routeModel__"),_2=Symbol.for("____boolTypescriptCore:httpArguments:responseBody__"),V2=Symbol.for("____boolTypescriptCore:httpArguments:responseStatus__"),u2=Symbol.for("____boolTypescriptCore:httpArguments:responseStatusText__"),Yw={};Q4(Yw,{successfulStatuses:()=>k4,serverErrorStatuses:()=>o4,redirectionStatuses:()=>g4,informationalStatuses:()=>Z4,httpStatuses:()=>o0,clientErrorStatuses:()=>C4});var Z4=Object.freeze({CONTINUE:Object.freeze({status:100,statusText:"Continue"}),SWITCHING_PROTOCOLS:Object.freeze({status:101,statusText:"Switching Protocols"}),EARLY_HINTS:Object.freeze({status:103,statusText:"Early Hints"})}),k4=Object.freeze({OK:Object.freeze({status:200,statusText:"OK"}),CREATED:Object.freeze({status:201,statusText:"Created"}),ACCEPTED:Object.freeze({status:202,statusText:"Accepted"}),NON_AUTHORITATIVE_INFORMATION:Object.freeze({status:203,statusText:"Non-Authoritative Information"}),NO_CONTENT:Object.freeze({status:204,statusText:"No Content"}),RESET_CONTENT:Object.freeze({status:205,statusText:"Reset Content"}),PARTIAL_CONTENT:Object.freeze({status:206,statusText:"Partial Content"}),MULTI_STATUS:Object.freeze({status:207,statusText:"Multi-Status"}),ALREADY_REPORTED:Object.freeze({status:208,statusText:"Already Reported"}),IM_USED:Object.freeze({status:226,statusText:"IM Used"})}),g4=Object.freeze({MULTIPLE_CHOICES:Object.freeze({status:300,statusText:"Multiple Choices"}),MOVED_PERMANENTLY:Object.freeze({status:301,statusText:"Moved Permanently"}),FOUND:Object.freeze({status:302,statusText:"Found"}),SEE_OTHER:Object.freeze({status:303,statusText:"See Other"}),NOT_MODIFIED:Object.freeze({status:304,statusText:"Not Modified"}),UNUSED:Object.freeze({status:306,statusText:"Unused"}),TEMPORARY_REDIRECT:Object.freeze({status:307,statusText:"Temporary Redirect"}),PERMANENT_REDIRECT:Object.freeze({status:308,statusText:"Permanent Redirect"})}),C4=Object.freeze({BAD_REQUEST:Object.freeze({status:400,statusText:"Bad Request"}),UNAUTHORIZED:Object.freeze({status:401,statusText:"Unauthorized"}),PAYMENT_REQUIRED:Object.freeze({status:402,statusText:"Payment Required"}),FORBIDDEN:Object.freeze({status:403,statusText:"Forbidden"}),NOT_FOUND:Object.freeze({status:404,statusText:"Not Found"}),METHOD_NOT_ALLOWED:Object.freeze({status:405,statusText:"Method Not Allowed"}),NOT_ACCEPTABLE:Object.freeze({status:406,statusText:"Not Acceptable"}),PROXY_AUTHENTICATION_REQUIRED:Object.freeze({status:407,statusText:"Proxy Authentication Required"}),REQUEST_TIMEOUT:Object.freeze({status:408,statusText:"Request Timeout"}),CONFLICT:Object.freeze({status:409,statusText:"Conflict"}),GONE:Object.freeze({status:410,statusText:"Gone"}),LENGTH_REQUIRED:Object.freeze({status:411,statusText:"Length Required"}),PRECONDITION_FAILED:Object.freeze({status:412,statusText:"Precondition Failed"}),CONTENT_TOO_LARGE:Object.freeze({status:413,statusText:"Content Too Large"}),URI_TOO_LONG:Object.freeze({status:414,statusText:"URI Too Long"}),UNSUPPORTED_MEDIA_TYPE:Object.freeze({status:415,statusText:"Unsupported Media Type"}),RANGE_NOT_SATISFIABLE:Object.freeze({status:416,statusText:"Range Not Satisfiable"}),EXPECTATION_FAILED:Object.freeze({status:417,statusText:"Expectation Failed"}),I_AM_A_TEAPOT:Object.freeze({status:418,statusText:"I'm a teapot"}),MISDIRECTED_REQUEST:Object.freeze({status:421,statusText:"Misdirected Request"}),UNPROCESSABLE_CONTENT:Object.freeze({status:422,statusText:"Unprocessable Content"}),LOCKED:Object.freeze({status:423,statusText:"Locked"}),FAILED_DEPENDENCY:Object.freeze({status:424,statusText:"Failed Dependency"}),TOO_EARLY:Object.freeze({status:425,statusText:"Too Early"}),UPGRADE_REQUIRED:Object.freeze({status:426,statusText:"Upgrade Required"}),PRECONDITION_REQUIRED:Object.freeze({status:428,statusText:"Precondition Required"}),TOO_MANY_REQUESTS:Object.freeze({status:429,statusText:"Too Many Requests"}),REQUEST_HEADER_FIELDS_TOO_LARGE:Object.freeze({status:431,statusText:"Request Header Fields Too Large"}),UNAVAILABLE_FOR_LEGAL_REASONS:Object.freeze({status:451,statusText:"Unavailable For Legal Reasons"})}),o4=Object.freeze({INTERNAL_SERVER_ERROR:Object.freeze({status:500,statusText:"Internal Server Error"}),NOT_IMPLEMENTED:Object.freeze({status:501,statusText:"Not Implemented"}),BAD_GATEWAY:Object.freeze({status:502,statusText:"Bad Gateway"}),SERVICE_UNAVAILABLE:Object.freeze({status:503,statusText:"Service Unavailable"}),GATEWAY_TIMEOUT:Object.freeze({status:504,statusText:"Gateway Timeout"}),HTTP_VERSION_NOT_SUPPORTED:Object.freeze({status:505,statusText:"HTTP Version Not Supported"}),VARIANT_ALSO_NEGOTIATES:Object.freeze({status:506,statusText:"Variant Also Negotiates"}),INSUFFICIENT_STORAGE:Object.freeze({status:507,statusText:"Insufficient Storage"}),LOOP_DETECTED:Object.freeze({status:508,statusText:"Loop Detected"}),NOT_EXTENDED:Object.freeze({status:510,statusText:"Not Extended"}),NETWORK_AUTHENTICATION_REQUIRED:Object.freeze({status:511,statusText:"Network Authentication Required"})}),o0=Object.freeze({...Z4,...k4,...g4,...C4,...o4}),x4=(w)=>(K,W,J)=>{if(!W)return;let P=Reflect.getOwnMetadata(Xw,K.constructor,W)||{};P[`argumentIndexes.${J}`]={index:J,type:L2,validationSchema:w},Reflect.defineMetadata(Xw,P,K.constructor,W)};var SK=(w)=>(K,W,J)=>{if(!W)return;let P=Reflect.getOwnMetadata(Xw,K.constructor,W)||{};P[`argumentIndexes.${J}`]={index:J,type:E2,key:w},Reflect.defineMetadata(Xw,P,K.constructor,W)},r4=()=>(w,K,W)=>{if(!K)return;let J=Reflect.getOwnMetadata(Xw,w.constructor,K)||{};J[`argumentIndexes.${W}`]={index:W,type:ew},Reflect.defineMetadata(Xw,J,w.constructor,K)};var c4=()=>(w)=>{if(!("enforce"in w.prototype)||typeof w.prototype.enforce!=="function")return;let K=void 0;return Reflect.defineMetadata(P1,K,w),w};var _4=(w)=>(K,W,J)=>{let P=Reflect.getMetadata(GK,K)||[];P[J]=w,Reflect.defineMetadata(GK,P,K)};var JJ=Symbol("__bool:webSocket.upgrade__");var rw;(function(w){w.year="year",w.month="month",w.day="day",w.hours="hours",w.minutes="minutes",w.seconds="seconds",w.miliseconds="miliseconds"})(rw||(rw={}));var x0=(w,K,W=rw.day)=>{let J=w instanceof Date?w:new Date(w);switch(W){case rw.year:J.setFullYear(J.getFullYear()+K);break;case rw.month:J.setMonth(J.getMonth()+K);break;case rw.day:J.setDate(J.getDate()+K);break;case rw.hours:J.setHours(J.getHours()+K);break;case rw.minutes:J.setMinutes(J.getMinutes()+K);break;case rw.seconds:J.setSeconds(J.getSeconds()+K);break;case rw.miliseconds:J.setMilliseconds(J.getMilliseconds()+K);break}return J},r0=BK(v0(),1),{serve:c0}=globalThis.Bun,PJ=async function(){}.constructor,B4=Object.freeze({black:"38;5;16",red:"38;5;196",green:"38;5;46",yellow:"38;5;226",blue:"38;5;21",magenta:"38;5;201",cyan:"38;5;51",white:"38;5;231",gray:"38;5;244"}),N4=Object.freeze({black:"48;5;16",red:"48;5;196",green:"48;5;46",yellow:"48;5;226",blue:"48;5;21",magenta:"48;5;201",cyan:"48;5;51",white:"48;5;231",gray:"48;5;244"}),pw=(w,K={})=>{let{color:W,backgroundColor:J,bold:P,underline:I}=K,b=[];if(P)b.push("1");if(I)b.push("4");if(W&&B4[W])b.push(B4[W]);if(J&&N4[J])b.push(N4[J]);if(b.length===0)return w;return`\x1B[${b.join(";")}m${w}\x1B[0m`},MK=(w)=>{for(let[K,W]of Object.entries(Yw.httpStatuses)){if(W.status!==w)continue;return W.statusText}return"Unknown error"},_0=(w)=>{let{headers:K,method:W}=w,J=K.get("upgrade")?.toLowerCase()||"",P=K.get("connection")?.toLowerCase()||"";return W==="GET"&&J?.toLowerCase()==="websocket"&&P?.toLowerCase().includes("upgrade")};class OK extends Error{httpCode;message;data;constructor({httpCode:w,data:K,message:W}){super();this.httpCode=w,this.message=!W?.trim()?MK(w):W.trim(),this.data=K}}class I1 extends Error{httpCode;message;data;constructor({httpCode:w,data:K,message:W}){super();this.httpCode=w,this.message=!W?.trim()?MK(w):W.trim(),this.data=K}}var u4=["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"],u0=(w)=>!!u4.find((K)=>K===w),y0=(w,K=new Headers)=>{if(K.set("Content-Type","application/json"),w instanceof OK||w instanceof I1)return new Response(JSON.stringify(w),{status:w.httpCode,statusText:w.message,headers:K});return new Response(JSON.stringify((()=>{switch(typeof w){case"object":return!(w instanceof Error)?w:{message:w.message,code:w.name,cause:w.cause};case"string":return{message:w};case"number":return{code:w};default:return}})()),{status:500,statusText:"INTERNAL SERVER ERROR",headers:K})};class aK{_staticMap=new Map;_dynamicMap=new Map;_options=void 0;constructor(...w){w.forEach((K)=>{K.staticEntries.forEach(([W,J])=>this.set(W,J,{isStatic:!0,isPassthrough:!0})),K.dynamicEntries.forEach(([W,J])=>this.set(W,J,{isStatic:!1}))})}get(w,K){return!{...this._options,...K}.isStatic?this._dynamicMap.get(w):this._staticMap.get(w)}has(w,K){return!{...this._options,...K}.isStatic?this._dynamicMap.has(w):this._staticMap.has(w)}set(w,K,W){let J={...this._options,...W};if(!J?.isStatic)this._dynamicMap.set(w,K);else if(!this._staticMap.has(w))this._staticMap.set(w,K);else if(!J.isPassthrough)throw Error(`${String(w)} already exists in context static collection.`);return this}setOptions(w){return this._options=w,this}get staticEntries(){return[...this._staticMap.entries()]}get dynamicEntries(){return[...this._dynamicMap.entries()]}}class y4{alias;#w=new Map;#K;constructor({alias:w}){let K=this._thinAlias(w);this.alias=K,this.#K=new URLPattern({pathname:K,baseURL:"https://www.booljs.com"})}test({pathname:w}){try{return this.#K.test({pathname:this._thinAlias(w),baseURL:"https://www.booljs.com"})}catch(K){return console.error(K),!1}}exec({pathname:w,method:K}){try{let W=this.#w.get(K);if(!W)return null;let J=this.#K.exec({pathname:this._thinAlias(w),baseURL:"https://www.booljs.com"});if(!J)return null;let P=J.pathname.groups;return Object.freeze({parameters:P,model:W})}catch(W){return console.error(W),null}}get({model:w}){if(!this.#w.get("GET"))this.#w.set("GET",w);return this}post({model:w}){if(!this.#w.get("POST"))this.#w.set("POST",w);return this}put({model:w}){if(!this.#w.get("PUT"))this.#w.set("PUT",w);return this}delete({model:w}){if(!this.#w.get("DELETE"))this.#w.set("DELETE",w);return this}connect({model:w}){if(!this.#w.get("CONNECT"))return this.#w.set("CONNECT",w);return this}options({model:w}){if(!this.#w.get("OPTIONS"))return this.#w.set("OPTIONS",w);return this}trace({model:w}){if(!this.#w.get("TRACE"))return this.#w.set("TRACE",w);return this}patch({model:w}){if(!this.#w.get("PATCH"))return this.#w.set("PATCH",w);return this}_thinAlias(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get _fullPath(){return this.alias.split("/").map((w,K)=>{let W=new RegExp(":([a-z0-9A-Z_.-]{1,})(\\(.*?\\))","g");if(!W.test(w)){if(W=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!W.test(w))return w;return w.replace(W,(J,P)=>`${J}(.*?)`)}return w}).join("/")}get _filteredPath(){return this.alias.split("/").map((w,K)=>{let W=new RegExp(":([a-z0-9A-Z_.-]{1,})((.*?))","g");if(!W.test(w)){if(W=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!W.test(w))return w;return w.replace(W,(J,P)=>"(.*?)")}return w.replace(W,(J,P,I)=>I)}).join("/")}}var m0=y4;class sK{alias;#w=new Map;#K;#J;#I;constructor({alias:w,guardHandlers:K=[],openInterceptorHandlers:W=[],closeInterceptorHandlers:J=[]}){this.alias=this._thinAlias(w),this.#K=K,this.#J=W,this.#I=J}route({alias:w}){let K=this._thinAlias(`${this.alias}/${w}`),W=this.#w.get(K),J=!W?new m0({alias:`${this.alias}/${w}`}):W;if(!W)this.#w.set(K,J);return J}_thinAlias(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get routes(){return this.#w}get pipes(){return Object.freeze({guardHandlers:[...this.#K],openInterceptorHandlers:[...this.#J],closeInterceptorHandlers:[...this.#I]})}}class O2{#w=new Map;add(...w){for(let K of w){if(this.#w.has(K.alias))continue;this.#w.set(K.alias,K)}return this}find({pathname:w,method:K}){for(let W of this.#w.values())for(let J of W.routes.values()){if(!J.test({pathname:w}))continue;let P=J.exec({pathname:w,method:K});if(!P)continue;return Object.freeze({...P,...W.pipes})}return null}}var IJ=BK(w1(),1);class B2{_mapper=new Map;constructor(...w){w.forEach((K)=>{K.entries.forEach(([W,J])=>{this._mapper.set(W,J)})})}get(w){if(this._mapper.has(w))return this._mapper.get(w);if(typeof w!=="function")return;let K=Reflect.getMetadataKeys(w);if(![z4,DK,F4,P1,h4,AK].some((P)=>K.includes(P)))throw Error("Missing dependency declaration, please check @Injectable() used on dependency(ies).");let W=(Reflect.getOwnMetadata(GK,w)||[]).map((P)=>this.get(P)),J=new w(...W);return this._mapper.set(w,J),J}set(w,K){if(this._mapper.has(w))throw Error(`${String(w)} already exists in injector collection.`);this._mapper.set(w,K)}get entries(){return[...this._mapper.entries()]}}class m4{error;constructor(w){this.error=w}}class T4{eventName;metadata;_context=void 0;constructor({eventName:w,metadata:K}){this.eventName=w,this.metadata=K}bind(w){return this._context=w,this}execute(){if(this._context&&typeof this.metadata.descriptor.value==="function")this.metadata.descriptor.value=this.metadata.descriptor.value.bind(this._context);return Object.freeze({methodName:this.metadata.methodName,descriptor:this.metadata.descriptor,arguments:this.metadata.arguments})}}class b1{rawAlias;alias;routes=[];constructor(w="/"){this.rawAlias=w,this.alias=b1.thinAlias(w)}addRoutes(...w){for(let K of w)if(!this.routes.includes(K))this.routes.push(K);return this}bind(w){for(let K of this.routes)K.bind(w);return this}execute(){let w=new Map;for(let K of this.routes)w.set(`${this.alias}:::${K.eventName}`,K.execute());return w}static thinAlias(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class U2{rawPrefix;prefix;routers=[];constructor(w="/"){this.rawPrefix=w,this.prefix=U2.thinPrefix(w)}addRouters(...w){for(let K=0;K<w.length;K++)if(!this.routers.includes(w[K]))this.routers.push(w[K]);for(let K of w)if(!this.routers.includes(K))this.routers.push(K);return this}execute(){let w=new Map;for(let K of this.routers){let W=K.execute();for(let[J,P]of W.entries())w.set(`/${U2.thinPrefix(`${this.prefix}/${J}`)}`,P)}return w}static thinPrefix(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class l4{classConstructor;options;#w;#K;#J=new Map;#I;#G=900;#D;#b=new aK;constructor(w,K){this.classConstructor=w,this.options=K;let W=Reflect.getOwnMetadataKeys(w);if(!W.includes(x2)&&!W.includes(IK))throw Error(`Can not detect! ${w.name} class is not a container or module.`);this.#K=!W.includes(x2)?"MODULE":"CONTAINER",this.#G=typeof K.static?.cacheTimeInSeconds!=="number"?900:K.static.cacheTimeInSeconds,this.#I=Object.freeze({allowLogsMethods:this.options?.log?.methods||[],staticOption:this.options.static,allowOrigins:!this.options.cors?.origins?["*"]:typeof this.options.cors.origins!=="string"?this.options.cors.origins.includes("*")||this.options.cors.origins.length<1?["*"]:this.options.cors.origins:[this.options.cors.origins!=="*"?this.options.cors.origins:"*"],allowMethods:this.options.cors?.methods||u4,allowCredentials:!this.options.cors?.credentials?!1:!0,allowHeaders:!this.options.cors?.headers||this.options.cors.headers.includes("*")?["*"]:this.options.cors.headers,pipelineStrategy:(()=>{switch(K.pipelineStrategy?.type){case"SIMPLE":return Object.freeze({startMiddlewares:"FIFO",endMiddlewares:K.pipelineStrategy.targets?.middlewares||"FIFO",openInterceptors:"FIFO",closeInterceptors:K.pipelineStrategy.targets?.interceptors||"FIFO"});default:return Object.freeze({startMiddlewares:"FIFO",endMiddlewares:"FIFO",openInterceptors:"FIFO",closeInterceptors:"FIFO"})}})()})}static async create(w,K){let W=new l4(w,K);return await W.preLaunch(),W}useValidator(w){this.#D=w}async preLaunch(){if(this.#w)return this.#w;let{startMiddlewareHandlers:w,endMiddlewareHandlers:K,controllerRouterGroup:W,webSocketHttpRouterGroup:J,webSocketRouterGroup:P}=this.#K!=="MODULE"?await this.#S({containerClass:this.classConstructor,prefix:this.options.prefix,options:this.options}):await this.#A({moduleClass:this.classConstructor,prefix:this.options.prefix,options:this.options}),I=new Map,b=P.execute();for(let[D,A]of b.entries())I.set(D,A);return this.#w=Object.freeze({startMiddlewareHandlers:w,endMiddlewareHandlers:K,controllerRouterGroup:W,webSocketHttpRouterGroup:J,webSocketRouterGroup:P,webSocketsMap:I}),this.#w}async listen(){let w=c0({port:this.options.port,idleTimeout:typeof this.options.idleTimeoutInSeconds!=="number"||this.options.idleTimeoutInSeconds<=0?void 0:this.options.idleTimeoutInSeconds,fetch:this.#M.bind(this),websocket:await this.#O.bind(this)()});this.#b.set(Rw,w)}async#M(w,K){let{allowLogsMethods:W,allowOrigins:J,allowMethods:P,allowHeaders:I,allowCredentials:b,staticOption:D}=this.#I,{startMiddlewareHandlers:A,endMiddlewareHandlers:M,controllerRouterGroup:N,webSocketHttpRouterGroup:Q}=await this.preLaunch(),B=performance.now(),L=new URL(w.url),g=r0.parse(L.searchParams.toString(),this.options.queryParser),O=w.headers.get("origin")||"*",v=w.method.toUpperCase(),G=new Headers,u=new aK().setOptions({isStatic:!0}).set(G2,K).set(M2,w).set(A2,w.headers).set(sw,G).set(j4,g);try{if([...!b?[]:[{key:"Access-Control-Allow-Credentials",value:"true"}],{key:"Access-Control-Allow-Origin",value:J.includes("*")?"*":!J.includes(O)?J[0]:O},{key:"Access-Control-Allow-Methods",value:P.join(", ")},{key:"Access-Control-Allow-Headers",value:I.join(", ")}].forEach(({key:o,value:F})=>G.set(o,F)),!u0(v)||!P.includes(v))return this.finalizeResponse(new Response(void 0,{...Yw.clientErrorStatuses.METHOD_NOT_ALLOWED,headers:G}));if(_0(w))return await this.#B({request:w,server:K,context:u,url:L,query:g,method:v,responseHeaders:G,httpRouterGroup:Q,startMiddlewareHandlers:A,endMiddlewareHandlers:M});if(w.method.toUpperCase()==="OPTIONS")return this.finalizeResponse(J.includes("*")||J.includes(O)?new Response(void 0,{...Yw.successfulStatuses.NO_CONTENT,headers:G}):new Response(void 0,{...Yw.clientErrorStatuses.EXPECTATION_FAILED,headers:G}));if(D){let o=await this.#N({url:L,responseHeaders:G,path:D.path,headers:D.headers,cacheTimeInSeconds:D.cacheTimeInSeconds});if(o instanceof Response)return o}return await this.#Q({url:L,method:v,context:u,httpRouterGroup:N,startMiddlewareHandlers:A,endMiddlewareHandlers:M})}catch(o){return this.options.debug&&console.error(o),this.finalizeResponse(y0(o,G))}finally{if(W){let o=performance.now(),F=u.get(V2,{isStatic:!1}),Z=typeof F!=="number"||!F?0:F,x=pw(L.pathname,{color:"blue"}),c=`${Bun.color("yellow","ansi")}${process.pid}`,E=pw(` ${w.method} `,{color:"yellow",backgroundColor:"blue"}),X=pw(`${w.headers.get("x-forwarded-for")||w.headers.get("x-real-ip")||K.requestIP(w)?.address||"<Unknown>"}`,{color:"yellow"}),U=pw(` ${Math.round((o-B+Number.EPSILON)*100)/100}ms `,{color:"yellow",backgroundColor:"blue"}),q=pw(` ${Z} (${MK(Z)}) `,(()=>{if(Z>=100&&Z<200)return{color:"white",backgroundColor:"cyan"};else if(Z>=200&&Z<300)return{color:"white",backgroundColor:"blue"};else if(Z>=300&&Z<400)return{color:"black",backgroundColor:"magenta"};else if(Z>=400&&Z<500)return{color:"black",backgroundColor:"yellow"};else if(Z>=500&&Z<600)return{color:"white",backgroundColor:"red"};else return{color:"black",backgroundColor:"gray"}})());W.includes(w.method.toUpperCase())&&console.info([`PID: ${c}`,`Method: ${E}`,`IP: ${X}`,x,`Time: ${U}`,typeof F!=="number"||!F?void 0:q].filter((r)=>!!r?.trim()).join(" - "))}}}async#O(){let{webSocketsMap:w}=await this.preLaunch();return{open:(K)=>{let W=`${K.data.pathname}:::open`,J=w.get(W);if(!J)return;let P=J.arguments||{},I=[];for(let[,b]of Object.entries(P))switch(b.type){case D2:I[b.index]=K;break;case Rw:I[b.index]=this.#b.get(Rw);break}J.descriptor.value(...I)},close:(K,W,J)=>{let P=`${K.data.pathname}:::close`,I=w.get(P);if(!I)return;let b=I.arguments||{},D=[];for(let[,A]of Object.entries(b))switch(A.type){case D2:D[A.index]=K;break;case R4:D[A.index]=W;break;case v4:D[A.index]=J;break;case Rw:D[A.index]=this.#b.get(Rw);break}I.descriptor.value(...D)},message:(K,W)=>{let J=`${K.data.pathname}:::message`,P=w.get(J);if(!P)return;let I=P.arguments||{},b=[];for(let[,D]of Object.entries(I))switch(D.type){case D2:b[D.index]=K;break;case bK:b[D.index]=W;break;case Rw:b[D.index]=this.#b.get(Rw);break}P.descriptor.value(...b)},drain:(K)=>{let W=`${K.data.pathname}:::drain`,J=w.get(W);if(!J)return;let P=J.arguments||{},I=[];for(let[,b]of Object.entries(P))switch(b.type){case D2:I[b.index]=K;break;case Rw:I[b.index]=this.#b.get(Rw);break}J.descriptor.value(...I)},ping:(K,W)=>{let J=`${K.data.pathname}:::ping`,P=w.get(J);if(!P)return;let I=P.arguments||{},b=[];for(let[,D]of Object.entries(I))switch(D.type){case D2:b[D.index]=K;break;case bK:b[D.index]=W;break;case Rw:b[D.index]=this.#b.get(Rw);break}P.descriptor.value(...b)},pong:(K,W)=>{let J=`${K.data.pathname}:::pong`,P=w.get(J);if(!P)return;let I=P.arguments||{},b=[];for(let[,D]of Object.entries(I))switch(D.type){case D2:b[D.index]=K;break;case bK:b[D.index]=W;break;case Rw:b[D.index]=this.#b.get(Rw);break}P.descriptor.value(...b)}}}async#B({request:w,server:K,context:W,url:J,query:P,method:I,responseHeaders:b,httpRouterGroup:D,startMiddlewareHandlers:A,endMiddlewareHandlers:M}){try{await this.#P({type:"START_MIDDLEWARES",handlers:A,context:W});let N=D.find({pathname:J.pathname,method:I}),Q=this.finalizeResponse(new Response(void 0,{...Yw.serverErrorStatuses.INTERNAL_SERVER_ERROR,headers:b}));if(N){let B=await this.#P({type:"GUARDS",handlers:N.guardHandlers,context:W});if(B!==!0)Q=this.finalizeResponse(new Response(void 0,{...!B||B==="UNAUTHORIZATION"?Yw.clientErrorStatuses.UNAUTHORIZED:Yw.clientErrorStatuses.FORBIDDEN,headers:b}));else{W.set(ew,N.model),await this.#P({type:"OPEN_INTERCEPTORS",handlers:N.openInterceptorHandlers,context:W});let L=await N.model.func(...[K,w,P]);if(await this.#P({type:"CLOSE_INTERCEPTORS",handlers:N.closeInterceptorHandlers,context:W}),typeof L!=="boolean"||!L)Q=this.finalizeResponse(new Response(void 0,{...Yw.serverErrorStatuses.INTERNAL_SERVER_ERROR,headers:b}));else Q=void 0}}return await this.#P({type:"END_MIDDLEWARES",handlers:M,context:W}),Q}catch(N){throw console.error(N),N}}async#N({url:w,path:K,headers:W,cacheTimeInSeconds:J,responseHeaders:P}){let I=`${K}/${w.pathname}`,b=this.#J.get(I);if(!b){let D=Bun.file(I);if(await D.exists()){if(W)for(let[A,M]of Object.entries(W))P.set(A,M);return P.set("Content-Type",D.type),this.finalizeResponse(new Response(await D.arrayBuffer(),{...Yw.successfulStatuses.OK,headers:P}))}}else{let D=new Date>b.expiredAt;if(D)this.#J.delete(I);let A=!D?b.file:Bun.file(I);if(await A.exists()){if(this.#J.set(I,Object.freeze({expiredAt:x0(new Date,this.#G,rw.seconds),file:A})),W)for(let[M,N]of Object.entries(W))P.set(M,N);return P.set("Content-Type",A.type),this.finalizeResponse(new Response(await A.arrayBuffer(),{...Yw.successfulStatuses.OK,headers:P}))}}}async#Q({context:w,url:K,method:W,httpRouterGroup:J,startMiddlewareHandlers:P=[],endMiddlewareHandlers:I=[]}){let b={isStatic:!0};w.setOptions(b),await this.#P({type:"START_MIDDLEWARES",handlers:P,context:w});let D=J.find({pathname:K.pathname,method:W});if(!D)w.setOptions({isStatic:!1}).set(V2,Yw.clientErrorStatuses.NOT_FOUND.status).set(u2,Yw.clientErrorStatuses.NOT_FOUND.statusText).set(_2,void 0);else{w.set(ew,D.model),w.set(tK,D.parameters);let B=await this.#P({type:"GUARDS",handlers:D.guardHandlers,context:w});if(B!==!0)w.setOptions({isStatic:!1}).set(V2,!B||B==="UNAUTHORIZATION"?Yw.clientErrorStatuses.UNAUTHORIZED.status:Yw.clientErrorStatuses.FORBIDDEN.status).set(u2,!B||B==="UNAUTHORIZATION"?Yw.clientErrorStatuses.UNAUTHORIZED.statusText:Yw.clientErrorStatuses.FORBIDDEN.statusText).set(_2,void 0);else await this.#P({type:"OPEN_INTERCEPTORS",handlers:D.openInterceptorHandlers,context:w}),await this.#P({type:"CONTROLLER",context:w}),await this.#P({type:"CLOSE_INTERCEPTORS",handlers:D.closeInterceptorHandlers,context:w})}await this.#P({type:"END_MIDDLEWARES",handlers:I,context:w});let A=w.get(sw,{isStatic:!0})||new Headers,M=w.get(_2,{isStatic:!1})||void 0,N=w.get(V2,{isStatic:!1}),Q=w.get(u2,{isStatic:!1});return this.serializeResponse({status:typeof N!=="number"?W==="POST"?201:void 0:N,statusText:typeof Q!=="string"?void 0:Q,headers:A,data:M})}async#S({prefix:w="",startMiddlewareHandlers:K=[],endMiddlewareHandlers:W=[],guardHandlers:J=[],openInterceptorHandlers:P=[],closeInterceptorHandlers:I=[],controllerRouterGroup:b=new O2,webSocketHttpRouterGroup:D=new O2,webSocketRouterGroup:A=new U2,containerClass:M,options:N,extendInjector:Q}){if(!Reflect.getOwnMetadataKeys(M).includes(x2))throw Error(`[${M.name}] is not a container.`);let B=!Q?new B2:new B2(Q),L=Reflect.getOwnMetadata(x2,M),{loaders:g,middlewares:O,dependencies:v,modules:G,guards:u,interceptors:o,prefix:F,config:Z}=L||{},{config:x}=Object.freeze({config:{...typeof N.config!=="function"?N.config:await N.config(),...typeof Z!=="function"?typeof Z!=="object"?void 0:("key"in Z)&&("value"in Z)&&typeof Z.key==="symbol"?typeof Z.value!=="function"?Z.value:await Z.value():Z:await Z()}});if(B.set(Z&&"key"in Z&&"value"in Z&&typeof Z.key==="symbol"?Z.key:dK,x),g){let c=[];for(let[X,U]of Object.entries(g))c.push(async()=>{try{let q=await U({config:x});return console.info(`${pw(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${X}] initialized successfully.`),q}catch(q){throw console.error(`${pw(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${X}] initialization failed.`),N.debug&&console.error(q),q}});let E=await Promise.all(c.map((X)=>X()));for(let[X,U]of E)B.set(X,U)}if(v){for(let c of v)if(!B.get(c))throw Error(`Can not collect dependency [${c.name}].`)}if(O){let c=(E,X)=>!!E;for(let E of O){let X=B.get(E);if(!X||!c(X,E))throw Error(`Can not collect middleware [${E.name}].`);if(X.start&&typeof X.start==="function"){let U=Reflect.getOwnMetadata(Xw,E,"start")||{};K.push(Object.freeze({class:E,funcName:"start",func:X.start.bind(X),argumentsMetadata:U}))}if(X.end&&typeof X.end==="function"){let U=Reflect.getOwnMetadata(Xw,E,"end")||{};W.push(Object.freeze({class:E,funcName:"end",func:X.end.bind(X),argumentsMetadata:U}))}}}if(u){let c=(E,X)=>!!E;for(let E of u){let X=B.get(E);if(!X||!c(X,E))throw Error(`Can not collect guard [${E.name}].`);let U=Reflect.getOwnMetadata(Xw,E,"enforce")||{};J.push(Object.freeze({class:E,funcName:"enforce",func:X.enforce.bind(X),argumentsMetadata:U}))}}if(o){let c=(E,X)=>!!E;for(let E of o){let X=B.get(E);if(!X||!c(X,E))throw Error(`Can not collect interceptor [${E.name}].`);if(X){if(X.open&&typeof X.open==="function"){let U=Reflect.getOwnMetadata(Xw,E,"open")||{};P.push(Object.freeze({class:E,funcName:"open",func:X.open.bind(X),argumentsMetadata:U}))}if(X.close&&typeof X.close==="function"){let U=Reflect.getOwnMetadata(Xw,E,"close")||{};I.push(Object.freeze({class:E,funcName:"close",func:X.close.bind(X),argumentsMetadata:U}))}}}}if(G){let c=[w.trim(),F?.trim()||""].filter((E)=>E.length>0).join("/");for(let E of G)try{await this.#A({prefix:c,moduleClass:E,extendInjector:B,options:N,startMiddlewareHandlers:K,endMiddlewareHandlers:W,guardHandlers:[...J],openInterceptorHandlers:[...P],closeInterceptorHandlers:[...I],controllerRouterGroup:b,webSocketHttpRouterGroup:D,webSocketRouterGroup:A})}catch(X){throw console.group(`Can not resolve module: [${E.name}].`),console.error(X),console.groupEnd(),X}}return Object.freeze({startMiddlewareHandlers:K,endMiddlewareHandlers:W,controllerRouterGroup:b,webSocketHttpRouterGroup:D,webSocketRouterGroup:A})}async#A({prefix:w="",startMiddlewareHandlers:K=[],endMiddlewareHandlers:W=[],guardHandlers:J=[],openInterceptorHandlers:P=[],closeInterceptorHandlers:I=[],controllerRouterGroup:b=new O2,webSocketHttpRouterGroup:D=new O2,webSocketRouterGroup:A=new U2,moduleClass:M,options:N,extendInjector:Q}){if(!Reflect.getOwnMetadataKeys(M).includes(IK))throw Error(`[${M.name}] is not a module.`);let B=!Q?new B2:new B2(Q),L=Reflect.getOwnMetadata(IK,M),{loaders:g,middlewares:O,guards:v,interceptors:G,controllers:u,dependencies:o,webSockets:F,prefix:Z,config:x}=L||{},c=[w.trim(),Z?.trim()||""].filter((X)=>X.length>0).join("/"),{config:E}=Object.freeze({config:!x?void 0:{...typeof N.config!=="function"?N.config:await N.config(),...typeof x!=="function"?typeof x!=="object"?void 0:("key"in x)&&("value"in x)&&typeof x.key==="symbol"?typeof x.value!=="function"?x.value:await x.value():x:await x()}});if(E&&B.set(x&&"key"in x&&"value"in x&&typeof x.key==="symbol"?x.key:dK,E),g){let X=[];for(let[q,r]of Object.entries(g))X.push(async()=>{try{let T=await r({config:E});return console.info(`${pw(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${q}] initialized successfully.`),T}catch(T){throw console.error(`${pw(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${q}] initialization failed.`),N.debug&&console.error(T),T}});let U=await Promise.all(X.map((q)=>q()));for(let q=0;q<U.length;q++){let[r,T]=U[q];B.set(r,T)}}if(o){for(let X of o)if(!B.get(X))throw Error(`Can not collect dependency [${X.name}].`)}if(O){let X=(U,q)=>!!U;for(let U of O){let q=B.get(U);if(!q||!X(q,U))throw Error(`Can not collect middleware [${U.name}].`);if(q.start&&typeof q.start==="function"){let r=Reflect.getOwnMetadata(Xw,U,"start")||{};K.push(Object.freeze({class:U,funcName:"start",func:q.start.bind(q),argumentsMetadata:r}))}if(q.end&&typeof q.end==="function"){let r=Reflect.getOwnMetadata(Xw,U,"end")||{};W.push(Object.freeze({class:U,funcName:"end",func:q.end.bind(q),argumentsMetadata:r}))}}}if(v){let X=(U,q)=>!!U;for(let U of v){let q=B.get(U);if(!q||!X(q,U))throw Error(`Can not collect guard [${U.name}].`);let r=Reflect.getOwnMetadata(Xw,U,"enforce")||{};J.push(Object.freeze({class:U,funcName:"enforce",func:q.enforce.bind(q),argumentsMetadata:r}))}}if(G){let X=(U,q)=>!!U;for(let U of G){let q=B.get(U);if(!q||!X(q,U))throw Error(`Can not collect interceptor [${U.name}].`);if(q){if(q.open&&typeof q.open==="function"){let r=Reflect.getOwnMetadata(Xw,U,"open")||{};P.push(Object.freeze({class:U,funcName:"open",func:q.open.bind(q),argumentsMetadata:r}))}if(q.close&&typeof q.close==="function"){let r=Reflect.getOwnMetadata(Xw,U,"close")||{};I.push(Object.freeze({class:U,funcName:"close",func:q.close.bind(q),argumentsMetadata:r}))}}}}if(u)for(let X of u)this.#$({controllerConstructor:X,prefix:c,injector:B,httpRouterGroup:b,guardHandlers:[...J],openInterceptorHandlers:[...P],closeInterceptorHandlers:[...I]});if(F)for(let X of F)this.#Y({webSocketConstructor:X,injector:B,prefix:c,webSocketHttpRouterGroup:D,webSocketRouterGroup:A});return Object.freeze({startMiddlewareHandlers:K,endMiddlewareHandlers:W,controllerRouterGroup:b,webSocketHttpRouterGroup:D,webSocketRouterGroup:A})}#$({controllerConstructor:w,prefix:K="",injector:W=new B2,httpRouterGroup:J=new O2,guardHandlers:P=[],openInterceptorHandlers:I=[],closeInterceptorHandlers:b=[]}){if(!Reflect.getOwnMetadataKeys(w).includes(DK))throw Error(`[${w.name}] is not a controller.`);let D=W.get(w);if(!D)throw Error("Can not initialize controller.");let A=Reflect.getOwnMetadata(DK,w)||{prefix:"/",httpMetadata:[]},M=[K.trim(),A.prefix.trim()].filter((Q)=>Q.length>0).join("/"),N=new sK({alias:M,guardHandlers:P,openInterceptorHandlers:I,closeInterceptorHandlers:b});for(let Q of A.httpMetadata){if(typeof Q.descriptor.value!=="function")continue;let B=N.route({alias:Q.path}),L=Q.descriptor.value.bind(D),g=Object.freeze({class:w,funcName:Q.methodName,func:L,argumentsMetadata:Q.argumentsMetadata});switch(Q.httpMethod){case"GET":B.get({model:g});break;case"POST":B.post({model:g});break;case"PUT":B.put({model:g});break;case"PATCH":B.patch({model:g});break;case"DELETE":B.delete({model:g});break;case"OPTIONS":B.options({model:g});break}}return J.add(N)}async#W({data:w,validationSchema:K,argumentIndex:W,funcName:J}){if(!this.#D)return w;try{let P=await this.#D.validate(w,K,W,J);if(!(P instanceof m4))return P;throw new OK({httpCode:400,message:`Validation at the [${J.toString()}] method fails at positional argument [${W}].`,data:P.error})}catch(P){if(P instanceof OK)throw P;throw new I1({httpCode:500,message:`Validation at the [${J.toString()}] method error at positional argument [${W}].`,data:!(P instanceof Error)?P:[{message:P.message,code:P.name,cause:P.cause}]})}}#Y({webSocketConstructor:w,prefix:K="",injector:W=new B2,webSocketHttpRouterGroup:J=new O2,webSocketRouterGroup:P=new U2,guardHandlers:I=[],openInterceptorHandlers:b=[],closeInterceptorHandlers:D=[]}){if(!Reflect.getOwnMetadataKeys(w).includes(AK))throw Error(`[${w.name}] is not a websocket route.`);let A=W.get(w);if(!A)throw Error("Can not initialize webSocket.");let M=Reflect.getOwnMetadata(AK,w)||{prefix:"/",events:[],http:[]},N=`/${K}/${M.prefix}`,Q=new sK({alias:N,guardHandlers:I,openInterceptorHandlers:b,closeInterceptorHandlers:D});for(let[L,g]of Object.entries(M.http)){if(typeof g.descriptor?.value!=="function")continue;let O=Q.route({alias:g.path}),v=g.descriptor.value.bind(A),G=Object.freeze({class:w,funcName:g.methodName,func:v,argumentsMetadata:g.argumentsMetadata});switch(g.httpMethod){case"GET":O.get({model:G});break;case"POST":O.post({model:G});break}}J.add(Q);let B=new b1(N);for(let[L,g]of Object.entries(M.events)){let O=new T4({eventName:L,metadata:g});B.addRoutes(O)}return B.bind(A),P.addRouters(B),Object.freeze({webSocketHttpRouterGroup:J,webSocketRouterGroup:P})}async#P({type:w,handlers:K,context:W}){let J={isStatic:!0};W.setOptions(J);let P=W.get(G2,J)||void 0,I=W.get(M2,J)||void 0,b=W.get(A2,J)||void 0,D=W.get(sw,J)||void 0,A=W.get(tK,J)||void 0,M=W.get(ew,J)||void 0;if(w==="START_MIDDLEWARES"||w==="END_MIDDLEWARES"){let N=w==="START_MIDDLEWARES"?this.#I.pipelineStrategy.startMiddlewares:this.#I.pipelineStrategy.endMiddlewares;for(let Q=N==="FIFO"?0:K.length-1;N==="FIFO"?Q<K.length:Q>-1;N==="FIFO"?Q++:Q--){let B=[],{func:L,funcName:g,argumentsMetadata:O}=K[Q];for(let[v,G]of Object.entries(O))switch(G.type){case E2:B[G.index]=!G.key?W:W.get(G.key,J);break;case M2:B[G.index]=I;break;case r2:B[G.index]=!G.validationSchema?await I?.[G.parser||"json"]():await this.#W({data:await I?.[G.parser||"json"](),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case L2:B[G.index]=!G.validationSchema?b:await this.#W({data:b?.toJSON(),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case A2:B[G.index]=!G.validationSchema?b?.get(G.key)||void 0:await this.#W({data:b?.get(G.key)||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case c2:B[G.index]=!G.validationSchema?A?.[G.key]||void 0:await this.#W({data:A?.[G.key]||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case ew:B[G.index]=void 0;break;case sw:B[G.index]=D;break;case G2:B[G.index]=P;break;default:B[G.index]=!G.validationSchema?W.get(G.type,J):await this.#W({data:W.get(G.type,J),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break}await L(...B)}}else if(w==="GUARDS"){if(!M||K.length===0)return!0;for(let N=0;N<K.length;N++){let Q=[],{func:B,funcName:L,argumentsMetadata:g}=K[N];for(let[v,G]of Object.entries(g))switch(G.type){case M2:Q[G.index]=I;break;case r2:Q[G.index]=!G.validationSchema?await I?.[G.parser||"json"]():await this.#W({data:await I?.[G.parser||"json"](),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case E2:Q[G.index]=!G.key?W:W.get(G.key);break;case L2:Q[G.index]=!G.validationSchema?b:await this.#W({data:b?.toJSON(),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case sw:Q[G.index]=D;break;case A2:Q[G.index]=!G.validationSchema?b?.get(G.key)||void 0:await this.#W({data:b?.get(G.key)||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case c2:Q[G.index]=!G.validationSchema?A?.[G.key]||void 0:await this.#W({data:A?.[G.key],validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case ew:Q[G.index]=M;break;case G2:Q[G.index]=P;break;default:Q[G.index]=!G.validationSchema?W.get(G.type):await this.#W({data:W.get(G.type),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break}let O=await B(...Q);if(O!==!0)return O}return!0}else if(w==="OPEN_INTERCEPTORS"||w==="CLOSE_INTERCEPTORS"){if(!M)return;let N=w==="OPEN_INTERCEPTORS"?this.#I.pipelineStrategy.openInterceptors:this.#I.pipelineStrategy.closeInterceptors;for(let Q=N==="FIFO"?0:K.length-1;N==="FIFO"?Q<K.length:Q>-1;N==="FIFO"?Q++:Q--){let B=[],{func:L,funcName:g,argumentsMetadata:O}=K[Q];for(let[v,G]of Object.entries(O))switch(G.type){case M2:B[G.index]=I;break;case r2:B[G.index]=!G.validationSchema?await I?.[G.parser||"json"]():await this.#W({data:await I?.[G.parser||"json"](),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case E2:B[G.index]=!G.key?W:W.get(G.key);break;case L2:B[G.index]=!G.validationSchema?b:await this.#W({data:b?.toJSON(),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case A2:B[G.index]=!G.validationSchema?b?.get(G.key)||void 0:await this.#W({data:b?.get(G.key)||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case sw:B[G.index]=D;break;case c2:B[G.index]=!G.validationSchema?A?.[G.key]||void 0:await this.#W({data:A?.[G.key]||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case ew:B[G.index]=M;break;case G2:B[G.index]=P;break;default:B[G.index]=!G.validationSchema?W.get(G.type):await this.#W({data:W.get(G.type),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break}await L(...B)}}else if(w==="CONTROLLER"){if(!M){W.setOptions({isStatic:!1}).set(V2,404).set(u2,"Not found.");return}let N=[],{func:Q,funcName:B,argumentsMetadata:L}=M;for(let[g,O]of Object.entries(L))switch(O.type){case M2:N[O.index]=I;break;case r2:N[O.index]=!O.validationSchema?await I?.[O.parser||"json"]():await this.#W({data:await I?.[O.parser||"json"](),validationSchema:O.validationSchema,argumentIndex:O.index,funcName:B});break;case E2:N[O.index]=!O.key?W:W.get(O.key);break;case L2:N[O.index]=!O.validationSchema?b:await this.#W({data:b?.toJSON(),validationSchema:O.validationSchema,argumentIndex:O.index,funcName:B});break;case A2:N[O.index]=!O.validationSchema?b?.get(O.key)||void 0:await this.#W({data:b?.get(O.key)||void 0,validationSchema:O.validationSchema,argumentIndex:O.index,funcName:B});break;case sw:N[O.index]=D;break;case c2:N[O.index]=!O.validationSchema?A?.[O.key]||void 0:await this.#W({data:A?.[O.key]||void 0,validationSchema:O.validationSchema,argumentIndex:O.index,funcName:B});break;case ew:N[O.index]=M;break;case G2:N[O.index]=P;break;default:N[O.index]=!O.validationSchema?W.get(O.type):await this.#W({data:W.get(O.type),validationSchema:O.validationSchema,argumentIndex:O.index,funcName:B});break}W.set(_2,await Q(...N),{isStatic:!1})}return}serializeResponse({status:w,statusText:K,headers:W,data:J}){let P=W.get("Content-Type")||"text/plain",I=!w?!J?204:200:w,b=MK(I);if(P.includes("application/json"))return this.finalizeResponse(new Response(!J?void 0:J instanceof ReadableStream?J:JSON.stringify(J),{status:I,statusText:b,headers:W}));if(P.includes("text/plain")||P.includes("text/html"))return this.finalizeResponse(new Response(!J?void 0:J instanceof ReadableStream?J:String(J),{status:I,statusText:b,headers:W}));if(P.includes("application/octet-stream")){if(J instanceof Uint8Array||J instanceof ArrayBuffer||J instanceof Blob||J instanceof ReadableStream)return this.finalizeResponse(new Response(J,{status:I,statusText:b,headers:W}));throw Error("Invalid data type for application/octet-stream")}if(P.includes("multipart/form-data")){if(J instanceof FormData)return this.finalizeResponse(new Response(J,{status:I,statusText:b,headers:W}));throw Error("multipart/form-data requires FormData object")}return this.finalizeResponse(new Response(!J?void 0:String(J),{status:I,statusText:b,headers:W}))}finalizeResponse(w){return w.headers.set("X-Powered-By","Bool Typescript"),w}}var bJ=BK(w1(),1);var T0=()=>SK(hw.authState);var l0=()=>(w)=>{Reflect.defineMetadata(hw.guardMetadata,void 0,w)};var D1=Object.freeze({status:"aborted"});function h(w,K,W){function J(D,A){if(!D._zod)Object.defineProperty(D,"_zod",{value:{def:A,constr:b,traits:new Set},enumerable:!1});if(D._zod.traits.has(w))return;D._zod.traits.add(w),K(D,A);let M=b.prototype,N=Object.keys(M);for(let Q=0;Q<N.length;Q++){let B=N[Q];if(!(B in D))D[B]=M[B].bind(D)}}let P=W?.Parent??Object;class I extends P{}Object.defineProperty(I,"name",{value:w});function b(D){var A;let M=W?.Parent?new I:this;J(M,D),(A=M._zod).deferred??(A.deferred=[]);for(let N of M._zod.deferred)N();return M}return Object.defineProperty(b,"init",{value:J}),Object.defineProperty(b,Symbol.hasInstance,{value:(D)=>{if(W?.Parent&&D instanceof W.Parent)return!0;return D?._zod?.traits?.has(w)}}),Object.defineProperty(b,"name",{value:w}),b}var p0=Symbol("zod_brand");class fw extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class y2 extends Error{constructor(w){super(`Encountered unidirectional transform during encode: ${w}`);this.name="ZodEncodeError"}}var $K={};function gw(w){if(w)Object.assign($K,w);return $K}var bw={};fK(bw,{unwrapMessage:()=>m2,uint8ArrayToHex:()=>$9,uint8ArrayToBase64url:()=>Q9,uint8ArrayToBase64:()=>s4,stringifyPrimitive:()=>LK,slugify:()=>A1,shallowClone:()=>f4,safeExtend:()=>G9,required:()=>O9,randomString:()=>K9,propertyKeyTypes:()=>O1,promiseAllObject:()=>w9,primitiveTypes:()=>i4,prefixIssues:()=>f2,pick:()=>I9,partial:()=>M9,parsedType:()=>N1,optionalKeys:()=>B1,omit:()=>b9,objectClone:()=>t0,numKeys:()=>W9,nullish:()=>p2,normalizeParams:()=>f,mergeDefs:()=>iw,merge:()=>A9,jsonStringifyReplacer:()=>h2,joinValues:()=>YK,issue:()=>z2,isPlainObject:()=>N2,isObject:()=>q2,hexToUint8Array:()=>S9,getSizableOrigin:()=>t4,getParsedType:()=>J9,getLengthableOrigin:()=>i2,getEnumValues:()=>T2,getElementAtPath:()=>s0,floatSafeRemainder:()=>e4,finalizeIssue:()=>mw,extend:()=>D9,escapeRegex:()=>Q2,esc:()=>XK,defineLazy:()=>Iw,createTransparentProxy:()=>P9,cloneDef:()=>a0,clone:()=>Cw,cleanRegex:()=>e2,cleanEnum:()=>B9,captureStackTrace:()=>VK,cached:()=>l2,base64urlToUint8Array:()=>N9,base64ToUint8Array:()=>a4,assignProp:()=>w2,assertNotEqual:()=>f0,assertNever:()=>n0,assertIs:()=>i0,assertEqual:()=>e0,assert:()=>d0,allowsEval:()=>M1,aborted:()=>K2,NUMBER_FORMAT_RANGES:()=>n4,Class:()=>w6,BIGINT_FORMAT_RANGES:()=>d4});function e0(w){return w}function f0(w){return w}function i0(w){}function n0(w){throw Error("Unexpected value in exhaustive check")}function d0(w){}function T2(w){let K=Object.values(w).filter((J)=>typeof J==="number");return Object.entries(w).filter(([J,P])=>K.indexOf(+J)===-1).map(([J,P])=>P)}function YK(w,K="|"){return w.map((W)=>LK(W)).join(K)}function h2(w,K){if(typeof K==="bigint")return K.toString();return K}function l2(w){return{get value(){{let W=w();return Object.defineProperty(this,"value",{value:W}),W}throw Error("cached value already set")}}}function p2(w){return w===null||w===void 0}function e2(w){let K=w.startsWith("^")?1:0,W=w.endsWith("$")?w.length-1:w.length;return w.slice(K,W)}function e4(w,K){let W=(w.toString().split(".")[1]||"").length,J=K.toString(),P=(J.split(".")[1]||"").length;if(P===0&&/\d?e-\d?/.test(J)){let A=J.match(/\d?e-(\d?)/);if(A?.[1])P=Number.parseInt(A[1])}let I=W>P?W:P,b=Number.parseInt(w.toFixed(I).replace(".","")),D=Number.parseInt(K.toFixed(I).replace(".",""));return b%D/10**I}var p4=Symbol("evaluating");function Iw(w,K,W){let J=void 0;Object.defineProperty(w,K,{get(){if(J===p4)return;if(J===void 0)J=p4,J=W();return J},set(P){Object.defineProperty(w,K,{value:P})},configurable:!0})}function t0(w){return Object.create(Object.getPrototypeOf(w),Object.getOwnPropertyDescriptors(w))}function w2(w,K,W){Object.defineProperty(w,K,{value:W,writable:!0,enumerable:!0,configurable:!0})}function iw(...w){let K={};for(let W of w){let J=Object.getOwnPropertyDescriptors(W);Object.assign(K,J)}return Object.defineProperties({},K)}function a0(w){return iw(w._zod.def)}function s0(w,K){if(!K)return w;return K.reduce((W,J)=>W?.[J],w)}function w9(w){let K=Object.keys(w),W=K.map((J)=>w[J]);return Promise.all(W).then((J)=>{let P={};for(let I=0;I<K.length;I++)P[K[I]]=J[I];return P})}function K9(w=10){let W="";for(let J=0;J<w;J++)W+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return W}function XK(w){return JSON.stringify(w)}function A1(w){return w.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var VK="captureStackTrace"in Error?Error.captureStackTrace:(...w)=>{};function q2(w){return typeof w==="object"&&w!==null&&!Array.isArray(w)}var M1=l2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(w){return!1}});function N2(w){if(q2(w)===!1)return!1;let K=w.constructor;if(K===void 0)return!0;if(typeof K!=="function")return!0;let W=K.prototype;if(q2(W)===!1)return!1;if(Object.prototype.hasOwnProperty.call(W,"isPrototypeOf")===!1)return!1;return!0}function f4(w){if(N2(w))return{...w};if(Array.isArray(w))return[...w];return w}function W9(w){let K=0;for(let W in w)if(Object.prototype.hasOwnProperty.call(w,W))K++;return K}var J9=(w)=>{let K=typeof w;switch(K){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(w)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(w))return"array";if(w===null)return"null";if(w.then&&typeof w.then==="function"&&w.catch&&typeof w.catch==="function")return"promise";if(typeof Map<"u"&&w instanceof Map)return"map";if(typeof Set<"u"&&w instanceof Set)return"set";if(typeof Date<"u"&&w instanceof Date)return"date";if(typeof File<"u"&&w instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${K}`)}},O1=new Set(["string","number","symbol"]),i4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Q2(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cw(w,K,W){let J=new w._zod.constr(K??w._zod.def);if(!K||W?.parent)J._zod.parent=w;return J}function f(w){let K=w;if(!K)return{};if(typeof K==="string")return{error:()=>K};if(K?.message!==void 0){if(K?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");K.error=K.message}if(delete K.message,typeof K.error==="string")return{...K,error:()=>K.error};return K}function P9(w){let K;return new Proxy({},{get(W,J,P){return K??(K=w()),Reflect.get(K,J,P)},set(W,J,P,I){return K??(K=w()),Reflect.set(K,J,P,I)},has(W,J){return K??(K=w()),Reflect.has(K,J)},deleteProperty(W,J){return K??(K=w()),Reflect.deleteProperty(K,J)},ownKeys(W){return K??(K=w()),Reflect.ownKeys(K)},getOwnPropertyDescriptor(W,J){return K??(K=w()),Reflect.getOwnPropertyDescriptor(K,J)},defineProperty(W,J,P){return K??(K=w()),Reflect.defineProperty(K,J,P)}})}function LK(w){if(typeof w==="bigint")return w.toString()+"n";if(typeof w==="string")return`"${w}"`;return`${w}`}function B1(w){return Object.keys(w).filter((K)=>{return w[K]._zod.optin==="optional"&&w[K]._zod.optout==="optional"})}var n4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},d4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function I9(w,K){let W=w._zod.def,J=W.checks;if(J&&J.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let I=iw(w._zod.def,{get shape(){let b={};for(let D in K){if(!(D in W.shape))throw Error(`Unrecognized key: "${D}"`);if(!K[D])continue;b[D]=W.shape[D]}return w2(this,"shape",b),b},checks:[]});return Cw(w,I)}function b9(w,K){let W=w._zod.def,J=W.checks;if(J&&J.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let I=iw(w._zod.def,{get shape(){let b={...w._zod.def.shape};for(let D in K){if(!(D in W.shape))throw Error(`Unrecognized key: "${D}"`);if(!K[D])continue;delete b[D]}return w2(this,"shape",b),b},checks:[]});return Cw(w,I)}function D9(w,K){if(!N2(K))throw Error("Invalid input to extend: expected a plain object");let W=w._zod.def.checks;if(W&&W.length>0){let I=w._zod.def.shape;for(let b in K)if(Object.getOwnPropertyDescriptor(I,b)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let P=iw(w._zod.def,{get shape(){let I={...w._zod.def.shape,...K};return w2(this,"shape",I),I}});return Cw(w,P)}function G9(w,K){if(!N2(K))throw Error("Invalid input to safeExtend: expected a plain object");let W=iw(w._zod.def,{get shape(){let J={...w._zod.def.shape,...K};return w2(this,"shape",J),J}});return Cw(w,W)}function A9(w,K){let W=iw(w._zod.def,{get shape(){let J={...w._zod.def.shape,...K._zod.def.shape};return w2(this,"shape",J),J},get catchall(){return K._zod.def.catchall},checks:[]});return Cw(w,W)}function M9(w,K,W){let P=K._zod.def.checks;if(P&&P.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let b=iw(K._zod.def,{get shape(){let D=K._zod.def.shape,A={...D};if(W)for(let M in W){if(!(M in D))throw Error(`Unrecognized key: "${M}"`);if(!W[M])continue;A[M]=w?new w({type:"optional",innerType:D[M]}):D[M]}else for(let M in D)A[M]=w?new w({type:"optional",innerType:D[M]}):D[M];return w2(this,"shape",A),A},checks:[]});return Cw(K,b)}function O9(w,K,W){let J=iw(K._zod.def,{get shape(){let P=K._zod.def.shape,I={...P};if(W)for(let b in W){if(!(b in I))throw Error(`Unrecognized key: "${b}"`);if(!W[b])continue;I[b]=new w({type:"nonoptional",innerType:P[b]})}else for(let b in P)I[b]=new w({type:"nonoptional",innerType:P[b]});return w2(this,"shape",I),I}});return Cw(K,J)}function K2(w,K=0){if(w.aborted===!0)return!0;for(let W=K;W<w.issues.length;W++)if(w.issues[W]?.continue!==!0)return!0;return!1}function f2(w,K){return K.map((W)=>{var J;return(J=W).path??(J.path=[]),W.path.unshift(w),W})}function m2(w){return typeof w==="string"?w:w?.message}function mw(w,K,W){let J={...w,path:w.path??[]};if(!w.message){let P=m2(w.inst?._zod.def?.error?.(w))??m2(K?.error?.(w))??m2(W.customError?.(w))??m2(W.localeError?.(w))??"Invalid input";J.message=P}if(delete J.inst,delete J.continue,!K?.reportInput)delete J.input;return J}function t4(w){if(w instanceof Set)return"set";if(w instanceof Map)return"map";if(w instanceof File)return"file";return"unknown"}function i2(w){if(Array.isArray(w))return"array";if(typeof w==="string")return"string";return"unknown"}function N1(w){let K=typeof w;switch(K){case"number":return Number.isNaN(w)?"nan":"number";case"object":{if(w===null)return"null";if(Array.isArray(w))return"array";let W=w;if(W&&Object.getPrototypeOf(W)!==Object.prototype&&"constructor"in W&&W.constructor)return W.constructor.name}}return K}function z2(...w){let[K,W,J]=w;if(typeof K==="string")return{message:K,code:"custom",input:W,inst:J};return{...K}}function B9(w){return Object.entries(w).filter(([K,W])=>{return Number.isNaN(Number.parseInt(K,10))}).map((K)=>K[1])}function a4(w){let K=atob(w),W=new Uint8Array(K.length);for(let J=0;J<K.length;J++)W[J]=K.charCodeAt(J);return W}function s4(w){let K="";for(let W=0;W<w.length;W++)K+=String.fromCharCode(w[W]);return btoa(K)}function N9(w){let K=w.replace(/-/g,"+").replace(/_/g,"/"),W="=".repeat((4-K.length%4)%4);return a4(K+W)}function Q9(w){return s4(w).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function S9(w){let K=w.replace(/^0x/,"");if(K.length%2!==0)throw Error("Invalid hex string length");let W=new Uint8Array(K.length/2);for(let J=0;J<K.length;J+=2)W[J/2]=Number.parseInt(K.slice(J,J+2),16);return W}function $9(w){return Array.from(w).map((K)=>K.toString(16).padStart(2,"0")).join("")}class w6{constructor(...w){}}var K6=(w,K)=>{w.name="$ZodError",Object.defineProperty(w,"_zod",{value:w._zod,enumerable:!1}),Object.defineProperty(w,"issues",{value:K,enumerable:!1}),w.message=JSON.stringify(K,h2,2),Object.defineProperty(w,"toString",{value:()=>w.message,enumerable:!1})},EK=h("$ZodError",K6),Q1=h("$ZodError",K6,{Parent:Error});function S1(w,K=(W)=>W.message){let W={},J=[];for(let P of w.issues)if(P.path.length>0)W[P.path[0]]=W[P.path[0]]||[],W[P.path[0]].push(K(P));else J.push(K(P));return{formErrors:J,fieldErrors:W}}function $1(w,K=(W)=>W.message){let W={_errors:[]},J=(P)=>{for(let I of P.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((b)=>J({issues:b}));else if(I.code==="invalid_key")J({issues:I.issues});else if(I.code==="invalid_element")J({issues:I.issues});else if(I.path.length===0)W._errors.push(K(I));else{let b=W,D=0;while(D<I.path.length){let A=I.path[D];if(D!==I.path.length-1)b[A]=b[A]||{_errors:[]};else b[A]=b[A]||{_errors:[]},b[A]._errors.push(K(I));b=b[A],D++}}};return J(w),W}var UK=(w)=>(K,W,J,P)=>{let I=J?Object.assign(J,{async:!1}):{async:!1},b=K._zod.run({value:W,issues:[]},I);if(b instanceof Promise)throw new fw;if(b.issues.length){let D=new(P?.Err??w)(b.issues.map((A)=>mw(A,I,gw())));throw VK(D,P?.callee),D}return b.value};var HK=(w)=>async(K,W,J,P)=>{let I=J?Object.assign(J,{async:!0}):{async:!0},b=K._zod.run({value:W,issues:[]},I);if(b instanceof Promise)b=await b;if(b.issues.length){let D=new(P?.Err??w)(b.issues.map((A)=>mw(A,I,gw())));throw VK(D,P?.callee),D}return b.value};var n2=(w)=>(K,W,J)=>{let P=J?{...J,async:!1}:{async:!1},I=K._zod.run({value:W,issues:[]},P);if(I instanceof Promise)throw new fw;return I.issues.length?{success:!1,error:new(w??EK)(I.issues.map((b)=>mw(b,P,gw())))}:{success:!0,data:I.value}},W6=n2(Q1),d2=(w)=>async(K,W,J)=>{let P=J?Object.assign(J,{async:!0}):{async:!0},I=K._zod.run({value:W,issues:[]},P);if(I instanceof Promise)I=await I;return I.issues.length?{success:!1,error:new w(I.issues.map((b)=>mw(b,P,gw())))}:{success:!0,data:I.value}},J6=d2(Q1),P6=(w)=>(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return UK(w)(K,W,P)};var I6=(w)=>(K,W,J)=>{return UK(w)(K,W,J)};var b6=(w)=>async(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return HK(w)(K,W,P)};var D6=(w)=>async(K,W,J)=>{return HK(w)(K,W,J)};var G6=(w)=>(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return n2(w)(K,W,P)};var A6=(w)=>(K,W,J)=>{return n2(w)(K,W,J)};var M6=(w)=>async(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return d2(w)(K,W,P)};var O6=(w)=>async(K,W,J)=>{return d2(w)(K,W,J)};var B6=/^[cC][^\s-]{8,}$/,N6=/^[0-9a-z]+$/,Q6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,S6=/^[0-9a-vA-V]{20}$/,$6=/^[A-Za-z0-9]{27}$/,Y6=/^[a-zA-Z0-9_-]{21}$/,X6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var V6=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Y1=(w)=>{if(!w)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${w}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var L6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var X9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function E6(){return new RegExp(X9,"u")}var U6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var q6=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,h6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,z6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X1=/^[A-Za-z0-9_-]*$/;var F6=/^\+[1-9]\d{6,14}$/,R6="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",v6=new RegExp(`^${R6}$`);function j6(w){return typeof w.precision==="number"?w.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":w.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${w.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Z6(w){return new RegExp(`^${j6(w)}$`)}function k6(w){let K=j6({precision:w.precision}),W=["Z"];if(w.local)W.push("");if(w.offset)W.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let J=`${K}(?:${W.join("|")})`;return new RegExp(`^${R6}T(?:${J})$`)}var g6=(w)=>{let K=w?`[\\s\\S]{${w?.minimum??0},${w?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${K}$`)};var C6=/^[^A-Z]*$/,o6=/^[^a-z]*$/;var jw=h("$ZodCheck",(w,K)=>{var W;w._zod??(w._zod={}),w._zod.def=K,(W=w._zod).onattach??(W.onattach=[])});var x6=h("$ZodCheckMaxLength",(w,K)=>{var W;jw.init(w,K),(W=w._zod.def).when??(W.when=(J)=>{let P=J.value;return!p2(P)&&P.length!==void 0}),w._zod.onattach.push((J)=>{let P=J._zod.bag.maximum??Number.POSITIVE_INFINITY;if(K.maximum<P)J._zod.bag.maximum=K.maximum}),w._zod.check=(J)=>{let P=J.value;if(P.length<=K.maximum)return;let b=i2(P);J.issues.push({origin:b,code:"too_big",maximum:K.maximum,inclusive:!0,input:P,inst:w,continue:!K.abort})}}),r6=h("$ZodCheckMinLength",(w,K)=>{var W;jw.init(w,K),(W=w._zod.def).when??(W.when=(J)=>{let P=J.value;return!p2(P)&&P.length!==void 0}),w._zod.onattach.push((J)=>{let P=J._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(K.minimum>P)J._zod.bag.minimum=K.minimum}),w._zod.check=(J)=>{let P=J.value;if(P.length>=K.minimum)return;let b=i2(P);J.issues.push({origin:b,code:"too_small",minimum:K.minimum,inclusive:!0,input:P,inst:w,continue:!K.abort})}}),c6=h("$ZodCheckLengthEquals",(w,K)=>{var W;jw.init(w,K),(W=w._zod.def).when??(W.when=(J)=>{let P=J.value;return!p2(P)&&P.length!==void 0}),w._zod.onattach.push((J)=>{let P=J._zod.bag;P.minimum=K.length,P.maximum=K.length,P.length=K.length}),w._zod.check=(J)=>{let P=J.value,I=P.length;if(I===K.length)return;let b=i2(P),D=I>K.length;J.issues.push({origin:b,...D?{code:"too_big",maximum:K.length}:{code:"too_small",minimum:K.length},inclusive:!0,exact:!0,input:J.value,inst:w,continue:!K.abort})}}),a2=h("$ZodCheckStringFormat",(w,K)=>{var W,J;if(jw.init(w,K),w._zod.onattach.push((P)=>{let I=P._zod.bag;if(I.format=K.format,K.pattern)I.patterns??(I.patterns=new Set),I.patterns.add(K.pattern)}),K.pattern)(W=w._zod).check??(W.check=(P)=>{if(K.pattern.lastIndex=0,K.pattern.test(P.value))return;P.issues.push({origin:"string",code:"invalid_format",format:K.format,input:P.value,...K.pattern?{pattern:K.pattern.toString()}:{},inst:w,continue:!K.abort})});else(J=w._zod).check??(J.check=()=>{})}),_6=h("$ZodCheckRegex",(w,K)=>{a2.init(w,K),w._zod.check=(W)=>{if(K.pattern.lastIndex=0,K.pattern.test(W.value))return;W.issues.push({origin:"string",code:"invalid_format",format:"regex",input:W.value,pattern:K.pattern.toString(),inst:w,continue:!K.abort})}}),u6=h("$ZodCheckLowerCase",(w,K)=>{K.pattern??(K.pattern=C6),a2.init(w,K)}),y6=h("$ZodCheckUpperCase",(w,K)=>{K.pattern??(K.pattern=o6),a2.init(w,K)}),m6=h("$ZodCheckIncludes",(w,K)=>{jw.init(w,K);let W=Q2(K.includes),J=new RegExp(typeof K.position==="number"?`^.{${K.position}}${W}`:W);K.pattern=J,w._zod.onattach.push((P)=>{let I=P._zod.bag;I.patterns??(I.patterns=new Set),I.patterns.add(J)}),w._zod.check=(P)=>{if(P.value.includes(K.includes,K.position))return;P.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:K.includes,input:P.value,inst:w,continue:!K.abort})}}),T6=h("$ZodCheckStartsWith",(w,K)=>{jw.init(w,K);let W=new RegExp(`^${Q2(K.prefix)}.*`);K.pattern??(K.pattern=W),w._zod.onattach.push((J)=>{let P=J._zod.bag;P.patterns??(P.patterns=new Set),P.patterns.add(W)}),w._zod.check=(J)=>{if(J.value.startsWith(K.prefix))return;J.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:K.prefix,input:J.value,inst:w,continue:!K.abort})}}),l6=h("$ZodCheckEndsWith",(w,K)=>{jw.init(w,K);let W=new RegExp(`.*${Q2(K.suffix)}$`);K.pattern??(K.pattern=W),w._zod.onattach.push((J)=>{let P=J._zod.bag;P.patterns??(P.patterns=new Set),P.patterns.add(W)}),w._zod.check=(J)=>{if(J.value.endsWith(K.suffix))return;J.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:K.suffix,input:J.value,inst:w,continue:!K.abort})}});var p6=h("$ZodCheckOverwrite",(w,K)=>{jw.init(w,K),w._zod.check=(W)=>{W.value=K.tx(W.value)}});class V1{constructor(w=[]){if(this.content=[],this.indent=0,this)this.args=w}indented(w){this.indent+=1,w(this),this.indent-=1}write(w){if(typeof w==="function"){w(this,{execution:"sync"}),w(this,{execution:"async"});return}let W=w.split(`
|
|
19
|
-
`).filter((
|
|
20
|
-
`))}}var
|
|
21
|
-
if (${
|
|
15
|
+
***************************************************************************** */var w;(function(K){(function(W){var J=typeof globalThis==="object"?globalThis:typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:O(),P=b(K);if(typeof J.Reflect<"u")P=b(J.Reflect,P);if(W(P,J),typeof J.Reflect>"u")J.Reflect=K;function b(D,X){return function(S,N){if(Object.defineProperty(D,S,{configurable:!0,writable:!0,value:N}),X)X(S,N)}}function I(){try{return Function("return this;")()}catch(D){}}function M(){try{return(0,eval)("(function() { return this; })()")}catch(D){}}function O(){return I()||M()}})(function(W,J){var P=Object.prototype.hasOwnProperty,b=typeof Symbol==="function",I=b&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",M=b&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",O=typeof Object.create==="function",D={__proto__:[]}instanceof Array,X=!O&&!D,S={create:O?function(){return Tw(Object.create(null))}:D?function(){return Tw({__proto__:null})}:function(){return Tw({})},has:X?function(Y,V){return P.call(Y,V)}:function(Y,V){return V in Y},get:X?function(Y,V){return P.call(Y,V)?Y[V]:void 0}:function(Y,V){return Y[V]}},N=Object.getPrototypeOf(Function),L=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:uK(),g=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:WK(),B=typeof WeakMap==="function"?WeakMap:yK(),E=b?Symbol.for("@reflect-metadata:registry"):void 0,G=dw(),_=tw(G);function C(Y,V,z,c){if(!y(z)){if(!Ww(Y))throw TypeError();if(!Kw(V))throw TypeError();if(!Kw(c)&&!y(c)&&!hw(c))throw TypeError();if(hw(c))c=void 0;return z=i(z),ww(Y,V,z,c)}else{if(!Ww(Y))throw TypeError();if(!Dw(V))throw TypeError();return l(Y,V)}}W("decorate",C);function R(Y,V){function z(c,m){if(!Kw(c))throw TypeError();if(!y(m)&&!Aw(m))throw TypeError();f(Y,V,c,m)}return z}W("metadata",R);function Z(Y,V,z,c){if(!Kw(z))throw TypeError();if(!y(c))c=i(c);return f(Y,V,z,c)}W("defineMetadata",Z);function o(Y,V,z){if(!Kw(V))throw TypeError();if(!y(z))z=i(z);return bw(Y,V,z)}W("hasMetadata",o);function r(Y,V,z){if(!Kw(V))throw TypeError();if(!y(z))z=i(z);return n(Y,V,z)}W("hasOwnMetadata",r);function U(Y,V,z){if(!Kw(V))throw TypeError();if(!y(z))z=i(z);return t(Y,V,z)}W("getMetadata",U);function Q(Y,V,z){if(!Kw(V))throw TypeError();if(!y(z))z=i(z);return Ow(Y,V,z)}W("getOwnMetadata",Q);function q(Y,V){if(!Kw(Y))throw TypeError();if(!y(V))V=i(V);return u(Y,V)}W("getMetadataKeys",q);function H(Y,V){if(!Kw(Y))throw TypeError();if(!y(V))V=i(V);return Iw(Y,V)}W("getOwnMetadataKeys",H);function x(Y,V,z){if(!Kw(V))throw TypeError();if(!y(z))z=i(z);if(!Kw(V))throw TypeError();if(!y(z))z=i(z);var c=I2(V,z,!1);if(y(c))return!1;return c.OrdinaryDeleteMetadata(Y,V,z)}W("deleteMetadata",x);function l(Y,V){for(var z=Y.length-1;z>=0;--z){var c=Y[z],m=c(V);if(!y(m)&&!hw(m)){if(!Dw(m))throw TypeError();V=m}}return V}function ww(Y,V,z,c){for(var m=Y.length-1;m>=0;--m){var Mw=Y[m],A=Mw(V,z,c);if(!y(A)&&!hw(A)){if(!Kw(A))throw TypeError();c=A}}return c}function bw(Y,V,z){var c=n(Y,V,z);if(c)return!0;var m=zw(V);if(!hw(m))return bw(Y,m,z);return!1}function n(Y,V,z){var c=I2(V,z,!1);if(y(c))return!1;return ow(c.OrdinaryHasOwnMetadata(Y,V,z))}function t(Y,V,z){var c=n(Y,V,z);if(c)return Ow(Y,V,z);var m=zw(V);if(!hw(m))return t(Y,m,z);return}function Ow(Y,V,z){var c=I2(V,z,!1);if(y(c))return;return c.OrdinaryGetOwnMetadata(Y,V,z)}function f(Y,V,z,c){var m=I2(z,c,!0);m.OrdinaryDefineOwnMetadata(Y,V,z,c)}function u(Y,V){var z=Iw(Y,V),c=zw(Y);if(c===null)return z;var m=u(c,V);if(m.length<=0)return z;if(z.length<=0)return m;var Mw=new g,A=[];for(var $=0,F=z;$<F.length;$++){var j=F[$],k=Mw.has(j);if(!k)Mw.add(j),A.push(j)}for(var v=0,p=m;v<p.length;v++){var j=p[v],k=Mw.has(j);if(!k)Mw.add(j),A.push(j)}return A}function Iw(Y,V){var z=I2(Y,V,!1);if(!z)return[];return z.OrdinaryOwnMetadataKeys(Y,V)}function $w(Y){if(Y===null)return 1;switch(typeof Y){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return Y===null?1:6;default:return 6}}function y(Y){return Y===void 0}function hw(Y){return Y===null}function uw(Y){return typeof Y==="symbol"}function Kw(Y){return typeof Y==="object"?Y!==null:typeof Y==="function"}function Cw(Y,V){switch($w(Y)){case 0:return Y;case 1:return Y;case 2:return Y;case 3:return Y;case 4:return Y;case 5:return Y}var z=V===3?"string":V===5?"number":"default",c=Nw(Y,I);if(c!==void 0){var m=c.call(Y,z);if(Kw(m))throw TypeError();return m}return Ew(Y,z==="default"?"number":z)}function Ew(Y,V){if(V==="string"){var z=Y.toString;if(d(z)){var c=z.call(Y);if(!Kw(c))return c}var m=Y.valueOf;if(d(m)){var c=m.call(Y);if(!Kw(c))return c}}else{var m=Y.valueOf;if(d(m)){var c=m.call(Y);if(!Kw(c))return c}var Mw=Y.toString;if(d(Mw)){var c=Mw.call(Y);if(!Kw(c))return c}}throw TypeError()}function ow(Y){return!!Y}function yw(Y){return""+Y}function i(Y){var V=Cw(Y,3);if(uw(V))return V;return yw(V)}function Ww(Y){return Array.isArray?Array.isArray(Y):Y instanceof Object?Y instanceof Array:Object.prototype.toString.call(Y)==="[object Array]"}function d(Y){return typeof Y==="function"}function Dw(Y){return typeof Y==="function"}function Aw(Y){switch($w(Y)){case 3:return!0;case 4:return!0;default:return!1}}function Uw(Y,V){return Y===V||Y!==Y&&V!==V}function Nw(Y,V){var z=Y[V];if(z===void 0||z===null)return;if(!d(z))throw TypeError();return z}function lw(Y){var V=Nw(Y,M);if(!d(V))throw TypeError();var z=V.call(Y);if(!Kw(z))throw TypeError();return z}function qw(Y){return Y.value}function Hw(Y){var V=Y.next();return V.done?!1:V}function mw(Y){var V=Y.return;if(V)V.call(Y)}function zw(Y){var V=Object.getPrototypeOf(Y);if(typeof Y!=="function"||Y===N)return V;if(V!==N)return V;var z=Y.prototype,c=z&&Object.getPrototypeOf(z);if(c==null||c===Object.prototype)return V;var m=c.constructor;if(typeof m!=="function")return V;if(m===Y)return V;return m}function nw(){var Y;if(!y(E)&&typeof J.Reflect<"u"&&!(E in J.Reflect)&&typeof J.Reflect.defineMetadata==="function")Y=rK(J.Reflect);var V,z,c,m=new B,Mw={registerProvider:A,getProvider:F,setProvider:k};return Mw;function A(v){if(!Object.isExtensible(Mw))throw Error("Cannot add provider to a frozen registry.");switch(!0){case Y===v:break;case y(V):V=v;break;case V===v:break;case y(z):z=v;break;case z===v:break;default:if(c===void 0)c=new g;c.add(v);break}}function $(v,p){if(!y(V)){if(V.isProviderFor(v,p))return V;if(!y(z)){if(z.isProviderFor(v,p))return V;if(!y(c)){var s=lw(c);while(!0){var a=Hw(s);if(!a)return;var Xw=qw(a);if(Xw.isProviderFor(v,p))return mw(s),Xw}}}}if(!y(Y)&&Y.isProviderFor(v,p))return Y;return}function F(v,p){var s=m.get(v),a;if(!y(s))a=s.get(p);if(!y(a))return a;if(a=$(v,p),!y(a)){if(y(s))s=new L,m.set(v,s);s.set(p,a)}return a}function j(v){if(y(v))throw TypeError();return V===v||z===v||!y(c)&&c.has(v)}function k(v,p,s){if(!j(s))throw Error("Metadata provider not registered.");var a=F(v,p);if(a!==s){if(!y(a))return!1;var Xw=m.get(v);if(y(Xw))Xw=new L,m.set(v,Xw);Xw.set(p,s)}return!0}}function dw(){var Y;if(!y(E)&&Kw(J.Reflect)&&Object.isExtensible(J.Reflect))Y=J.Reflect[E];if(y(Y))Y=nw();if(!y(E)&&Kw(J.Reflect)&&Object.isExtensible(J.Reflect))Object.defineProperty(J.Reflect,E,{enumerable:!1,configurable:!1,writable:!1,value:Y});return Y}function tw(Y){var V=new B,z={isProviderFor:function(j,k){var v=V.get(j);if(y(v))return!1;return v.has(k)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:m,OrdinaryGetOwnMetadata:Mw,OrdinaryOwnMetadataKeys:$,OrdinaryDeleteMetadata:F};return G.registerProvider(z),z;function c(j,k,v){var p=V.get(j),s=!1;if(y(p)){if(!v)return;p=new L,V.set(j,p),s=!0}var a=p.get(k);if(y(a)){if(!v)return;if(a=new L,p.set(k,a),!Y.setProvider(j,k,z)){if(p.delete(k),s)V.delete(j);throw Error("Wrong provider for target.")}}return a}function m(j,k,v){var p=c(k,v,!1);if(y(p))return!1;return ow(p.has(j))}function Mw(j,k,v){var p=c(k,v,!1);if(y(p))return;return p.get(j)}function A(j,k,v,p){var s=c(v,p,!0);s.set(j,k)}function $(j,k){var v=[],p=c(j,k,!1);if(y(p))return v;var s=p.keys(),a=lw(s),Xw=0;while(!0){var Y2=Hw(a);if(!Y2)return v.length=Xw,v;var aw=qw(Y2);try{v[Xw]=aw}catch(Zw){try{mw(a)}finally{throw Zw}}Xw++}}function F(j,k,v){var p=c(k,v,!1);if(y(p))return!1;if(!p.delete(j))return!1;if(p.size===0){var s=V.get(k);if(!y(s)){if(s.delete(v),s.size===0)V.delete(s)}}return!0}}function rK(Y){var{defineMetadata:V,hasOwnMetadata:z,getOwnMetadata:c,getOwnMetadataKeys:m,deleteMetadata:Mw}=Y,A=new B,$={isProviderFor:function(F,j){var k=A.get(F);if(!y(k)&&k.has(j))return!0;if(m(F,j).length){if(y(k))k=new g,A.set(F,k);return k.add(j),!0}return!1},OrdinaryDefineOwnMetadata:V,OrdinaryHasOwnMetadata:z,OrdinaryGetOwnMetadata:c,OrdinaryOwnMetadataKeys:m,OrdinaryDeleteMetadata:Mw};return $}function I2(Y,V,z){var c=G.getProvider(Y,V);if(!y(c))return c;if(z){if(G.setProvider(Y,V,_))return _;throw Error("Illegal state.")}return}function uK(){var Y={},V=[],z=function(){function $(F,j,k){this._index=0,this._keys=F,this._values=j,this._selector=k}return $.prototype["@@iterator"]=function(){return this},$.prototype[M]=function(){return this},$.prototype.next=function(){var F=this._index;if(F>=0&&F<this._keys.length){var j=this._selector(this._keys[F],this._values[F]);if(F+1>=this._keys.length)this._index=-1,this._keys=V,this._values=V;else this._index++;return{value:j,done:!1}}return{value:void 0,done:!0}},$.prototype.throw=function(F){if(this._index>=0)this._index=-1,this._keys=V,this._values=V;throw F},$.prototype.return=function(F){if(this._index>=0)this._index=-1,this._keys=V,this._values=V;return{value:F,done:!0}},$}(),c=function(){function $(){this._keys=[],this._values=[],this._cacheKey=Y,this._cacheIndex=-2}return Object.defineProperty($.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),$.prototype.has=function(F){return this._find(F,!1)>=0},$.prototype.get=function(F){var j=this._find(F,!1);return j>=0?this._values[j]:void 0},$.prototype.set=function(F,j){var k=this._find(F,!0);return this._values[k]=j,this},$.prototype.delete=function(F){var j=this._find(F,!1);if(j>=0){var k=this._keys.length;for(var v=j+1;v<k;v++)this._keys[v-1]=this._keys[v],this._values[v-1]=this._values[v];if(this._keys.length--,this._values.length--,Uw(F,this._cacheKey))this._cacheKey=Y,this._cacheIndex=-2;return!0}return!1},$.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=Y,this._cacheIndex=-2},$.prototype.keys=function(){return new z(this._keys,this._values,m)},$.prototype.values=function(){return new z(this._keys,this._values,Mw)},$.prototype.entries=function(){return new z(this._keys,this._values,A)},$.prototype["@@iterator"]=function(){return this.entries()},$.prototype[M]=function(){return this.entries()},$.prototype._find=function(F,j){if(!Uw(this._cacheKey,F)){this._cacheIndex=-1;for(var k=0;k<this._keys.length;k++)if(Uw(this._keys[k],F)){this._cacheIndex=k;break}}if(this._cacheIndex<0&&j)this._cacheIndex=this._keys.length,this._keys.push(F),this._values.push(void 0);return this._cacheIndex},$}();return c;function m($,F){return $}function Mw($,F){return F}function A($,F){return[$,F]}}function WK(){var Y=function(){function V(){this._map=new L}return Object.defineProperty(V.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),V.prototype.has=function(z){return this._map.has(z)},V.prototype.add=function(z){return this._map.set(z,z),this},V.prototype.delete=function(z){return this._map.delete(z)},V.prototype.clear=function(){this._map.clear()},V.prototype.keys=function(){return this._map.keys()},V.prototype.values=function(){return this._map.keys()},V.prototype.entries=function(){return this._map.entries()},V.prototype["@@iterator"]=function(){return this.keys()},V.prototype[M]=function(){return this.keys()},V}();return Y}function yK(){var Y=16,V=S.create(),z=c();return function(){function F(){this._key=c()}return F.prototype.has=function(j){var k=m(j,!1);return k!==void 0?S.has(k,this._key):!1},F.prototype.get=function(j){var k=m(j,!1);return k!==void 0?S.get(k,this._key):void 0},F.prototype.set=function(j,k){var v=m(j,!0);return v[this._key]=k,this},F.prototype.delete=function(j){var k=m(j,!1);return k!==void 0?delete k[this._key]:!1},F.prototype.clear=function(){this._key=c()},F}();function c(){var F;do F="@@WeakMap@@"+$();while(S.has(V,F));return V[F]=!0,F}function m(F,j){if(!P.call(F,z)){if(!j)return;Object.defineProperty(F,z,{value:S.create()})}return F[z]}function Mw(F,j){for(var k=0;k<j;++k)F[k]=Math.random()*255|0;return F}function A(F){if(typeof Uint8Array==="function"){var j=new Uint8Array(F);if(typeof crypto<"u")crypto.getRandomValues(j);else if(typeof msCrypto<"u")msCrypto.getRandomValues(j);else Mw(j,F);return j}return Mw(Array(F),F)}function $(){var F=A(Y);F[6]=F[6]&79|64,F[8]=F[8]&191|128;var j="";for(var k=0;k<Y;++k){var v=F[k];if(k===4||k===6||k===8)j+="-";if(v<16)j+="0";j+=v.toString(16).toLowerCase()}return j}}function Tw(Y){return Y.__=void 0,delete Y.__,Y}})})(w||(w={}))}),H2=T((w,K)=>{K.exports=TypeError}),b0=T((w,K)=>{K.exports=P0("util").inspect}),XK=T((w,K)=>{var W=typeof Map==="function"&&Map.prototype,J=Object.getOwnPropertyDescriptor&&W?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,P=W&&J&&typeof J.get==="function"?J.get:null,b=W&&Map.prototype.forEach,I=typeof Set==="function"&&Set.prototype,M=Object.getOwnPropertyDescriptor&&I?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,O=I&&M&&typeof M.get==="function"?M.get:null,D=I&&Set.prototype.forEach,X=typeof WeakMap==="function"&&WeakMap.prototype,S=X?WeakMap.prototype.has:null,N=typeof WeakSet==="function"&&WeakSet.prototype,L=N?WeakSet.prototype.has:null,g=typeof WeakRef==="function"&&WeakRef.prototype,B=g?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,G=Object.prototype.toString,_=Function.prototype.toString,C=String.prototype.match,R=String.prototype.slice,Z=String.prototype.replace,o=String.prototype.toUpperCase,r=String.prototype.toLowerCase,U=RegExp.prototype.test,Q=Array.prototype.concat,q=Array.prototype.join,H=Array.prototype.slice,x=Math.floor,l=typeof BigInt==="function"?BigInt.prototype.valueOf:null,ww=Object.getOwnPropertySymbols,bw=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null,n=typeof Symbol==="function"&&typeof Symbol.iterator==="object",t=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===n?"object":"symbol")?Symbol.toStringTag:null,Ow=Object.prototype.propertyIsEnumerable,f=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(A){return A.__proto__}:null);function u(A,$){if(A===1/0||A===-1/0||A!==A||A&&A>-1000&&A<1000||U.call(/e/,$))return $;var F=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof A==="number"){var j=A<0?-x(-A):x(A);if(j!==A){var k=String(j),v=R.call($,k.length+1);return Z.call(k,F,"$&_")+"."+Z.call(Z.call(v,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Z.call($,F,"$&_")}var Iw=b0(),$w=Iw.custom,y=Uw($w)?$w:null,hw={__proto__:null,double:'"',single:"'"},uw={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};K.exports=function A($,F,j,k){var v=F||{};if(qw(v,"quoteStyle")&&!qw(hw,v.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(qw(v,"maxStringLength")&&(typeof v.maxStringLength==="number"?v.maxStringLength<0&&v.maxStringLength!==1/0:v.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=qw(v,"customInspect")?v.customInspect:!0;if(typeof p!=="boolean"&&p!=="symbol")throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(qw(v,"indent")&&v.indent!==null&&v.indent!=="\t"&&!(parseInt(v.indent,10)===v.indent&&v.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(qw(v,"numericSeparator")&&typeof v.numericSeparator!=="boolean")throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=v.numericSeparator;if(typeof $>"u")return"undefined";if($===null)return"null";if(typeof $==="boolean")return $?"true":"false";if(typeof $==="string")return WK($,v);if(typeof $==="number"){if($===0)return 1/0/$>0?"0":"-0";var a=String($);return s?u($,a):a}if(typeof $==="bigint"){var Xw=String($)+"n";return s?u($,Xw):Xw}var Y2=typeof v.depth>"u"?5:v.depth;if(typeof j>"u")j=0;if(j>=Y2&&Y2>0&&typeof $==="object")return ow($)?"[Array]":"[Object]";var aw=c(v,j);if(typeof k>"u")k=[];else if(zw(k,$)>=0)return"[Circular]";function Zw(Q2,PK,y5){if(PK)k=H.call(k),k.push(PK);if(y5){var D4={depth:v.depth};if(qw(v,"quoteStyle"))D4.quoteStyle=v.quoteStyle;return A(Q2,D4,j+1,k)}return A(Q2,v,j+1,k)}if(typeof $==="function"&&!i($)){var J4=mw($),P4=Mw($,Zw);return"[Function"+(J4?": "+J4:" (anonymous)")+"]"+(P4.length>0?" { "+q.call(P4,", ")+" }":"")}if(Uw($)){var b4=n?Z.call(String($),/^(Symbol\(.*\))_[^)]*$/,"$1"):bw.call($);return typeof $==="object"&&!n?Tw(b4):b4}if(uK($)){var g2="<"+r.call(String($.nodeName)),mK=$.attributes||[];for(var JK=0;JK<mK.length;JK++)g2+=" "+mK[JK].name+"="+Kw(Cw(mK[JK].value),"double",v);if(g2+=">",$.childNodes&&$.childNodes.length)g2+="...";return g2+="</"+r.call(String($.nodeName))+">",g2}if(ow($)){if($.length===0)return"[]";var _K=Mw($,Zw);if(aw&&!z(_K))return"["+m(_K,aw)+"]";return"[ "+q.call(_K,", ")+" ]"}if(Ww($)){var lK=Mw($,Zw);if(!("cause"in Error.prototype)&&"cause"in $&&!Ow.call($,"cause"))return"{ ["+String($)+"] "+q.call(Q.call("[cause]: "+Zw($.cause),lK),", ")+" }";if(lK.length===0)return"["+String($)+"]";return"{ ["+String($)+"] "+q.call(lK,", ")+" }"}if(typeof $==="object"&&p){if(y&&typeof $[y]==="function"&&Iw)return Iw($,{depth:Y2-j});else if(p!=="symbol"&&typeof $.inspect==="function")return $.inspect()}if(nw($)){var I4=[];if(b)b.call($,function(Q2,PK){I4.push(Zw(PK,$,!0)+" => "+Zw(Q2,$))});return V("Map",P.call($),I4,aw)}if(rK($)){var M4=[];if(D)D.call($,function(Q2){M4.push(Zw(Q2,$))});return V("Set",O.call($),M4,aw)}if(dw($))return Y("WeakMap");if(I2($))return Y("WeakSet");if(tw($))return Y("WeakRef");if(Dw($))return Tw(Zw(Number($)));if(Nw($))return Tw(Zw(l.call($)));if(Aw($))return Tw(E.call($));if(d($))return Tw(Zw(String($)));if(typeof window<"u"&&$===window)return"{ [object Window] }";if(typeof globalThis<"u"&&$===globalThis||typeof global<"u"&&$===global)return"{ [object globalThis] }";if(!yw($)&&!i($)){var TK=Mw($,Zw),G4=f?f($)===Object.prototype:$ instanceof Object||$.constructor===Object,pK=$ instanceof Object?"":"null prototype",O4=!G4&&t&&Object($)===$&&t in $?R.call(Hw($),8,-1):pK?"Object":"",u5=G4||typeof $.constructor!=="function"?"":$.constructor.name?$.constructor.name+" ":"",fK=u5+(O4||pK?"["+q.call(Q.call([],O4||[],pK||[]),": ")+"] ":"");if(TK.length===0)return fK+"{}";if(aw)return fK+"{"+m(TK,aw)+"}";return fK+"{ "+q.call(TK,", ")+" }"}return String($)};function Kw(A,$,F){var j=F.quoteStyle||$,k=hw[j];return k+A+k}function Cw(A){return Z.call(String(A),/"/g,""")}function Ew(A){return!t||!(typeof A==="object"&&((t in A)||typeof A[t]<"u"))}function ow(A){return Hw(A)==="[object Array]"&&Ew(A)}function yw(A){return Hw(A)==="[object Date]"&&Ew(A)}function i(A){return Hw(A)==="[object RegExp]"&&Ew(A)}function Ww(A){return Hw(A)==="[object Error]"&&Ew(A)}function d(A){return Hw(A)==="[object String]"&&Ew(A)}function Dw(A){return Hw(A)==="[object Number]"&&Ew(A)}function Aw(A){return Hw(A)==="[object Boolean]"&&Ew(A)}function Uw(A){if(n)return A&&typeof A==="object"&&A instanceof Symbol;if(typeof A==="symbol")return!0;if(!A||typeof A!=="object"||!bw)return!1;try{return bw.call(A),!0}catch($){}return!1}function Nw(A){if(!A||typeof A!=="object"||!l)return!1;try{return l.call(A),!0}catch($){}return!1}var lw=Object.prototype.hasOwnProperty||function(A){return A in this};function qw(A,$){return lw.call(A,$)}function Hw(A){return G.call(A)}function mw(A){if(A.name)return A.name;var $=C.call(_.call(A),/^function\s*([\w$]+)/);if($)return $[1];return null}function zw(A,$){if(A.indexOf)return A.indexOf($);for(var F=0,j=A.length;F<j;F++)if(A[F]===$)return F;return-1}function nw(A){if(!P||!A||typeof A!=="object")return!1;try{P.call(A);try{O.call(A)}catch($){return!0}return A instanceof Map}catch($){}return!1}function dw(A){if(!S||!A||typeof A!=="object")return!1;try{S.call(A,S);try{L.call(A,L)}catch($){return!0}return A instanceof WeakMap}catch($){}return!1}function tw(A){if(!B||!A||typeof A!=="object")return!1;try{return B.call(A),!0}catch($){}return!1}function rK(A){if(!O||!A||typeof A!=="object")return!1;try{O.call(A);try{P.call(A)}catch($){return!0}return A instanceof Set}catch($){}return!1}function I2(A){if(!L||!A||typeof A!=="object")return!1;try{L.call(A,L);try{S.call(A,S)}catch($){return!0}return A instanceof WeakSet}catch($){}return!1}function uK(A){if(!A||typeof A!=="object")return!1;if(typeof HTMLElement<"u"&&A instanceof HTMLElement)return!0;return typeof A.nodeName==="string"&&typeof A.getAttribute==="function"}function WK(A,$){if(A.length>$.maxStringLength){var F=A.length-$.maxStringLength,j="... "+F+" more character"+(F>1?"s":"");return WK(R.call(A,0,$.maxStringLength),$)+j}var k=uw[$.quoteStyle||"single"];k.lastIndex=0;var v=Z.call(Z.call(A,k,"\\$1"),/[\x00-\x1f]/g,yK);return Kw(v,"single",$)}function yK(A){var $=A.charCodeAt(0),F={8:"b",9:"t",10:"n",12:"f",13:"r"}[$];if(F)return"\\"+F;return"\\x"+($<16?"0":"")+o.call($.toString(16))}function Tw(A){return"Object("+A+")"}function Y(A){return A+" { ? }"}function V(A,$,F,j){var k=j?m(F,j):q.call(F,", ");return A+" ("+$+") {"+k+"}"}function z(A){for(var $=0;$<A.length;$++)if(zw(A[$],`
|
|
16
|
+
`)>=0)return!1;return!0}function c(A,$){var F;if(A.indent==="\t")F="\t";else if(typeof A.indent==="number"&&A.indent>0)F=q.call(Array(A.indent+1)," ");else return null;return{base:F,prev:q.call(Array($+1),F)}}function m(A,$){if(A.length===0)return"";var F=`
|
|
17
|
+
`+$.prev+$.base;return F+q.call(A,","+F)+`
|
|
18
|
+
`+$.prev}function Mw(A,$){var F=ow(A),j=[];if(F){j.length=A.length;for(var k=0;k<A.length;k++)j[k]=qw(A,k)?$(A[k],A):""}var v=typeof ww==="function"?ww(A):[],p;if(n){p={};for(var s=0;s<v.length;s++)p["$"+v[s]]=v[s]}for(var a in A){if(!qw(A,a))continue;if(F&&String(Number(a))===a&&a<A.length)continue;if(n&&p["$"+a]instanceof Symbol)continue;else if(U.call(/[^\w$]/,a))j.push($(a,A)+": "+$(A[a],A));else j.push(a+": "+$(A[a],A))}if(typeof ww==="function"){for(var Xw=0;Xw<v.length;Xw++)if(Ow.call(A,v[Xw]))j.push("["+$(v[Xw])+"]: "+$(A[v[Xw]],A))}return j}}),I0=T((w,K)=>{var W=XK(),J=H2(),P=function(D,X,S){var N=D,L;for(;(L=N.next)!=null;N=L)if(L.key===X){if(N.next=L.next,!S)L.next=D.next,D.next=L;return L}},b=function(D,X){if(!D)return;var S=P(D,X);return S&&S.value},I=function(D,X,S){var N=P(D,X);if(N)N.value=S;else D.next={key:X,next:D.next,value:S}},M=function(D,X){if(!D)return!1;return!!P(D,X)},O=function(D,X){if(D)return P(D,X,!0)};K.exports=function(){var D,X={assert:function(S){if(!X.has(S))throw new J("Side channel does not contain "+W(S))},delete:function(S){var N=D&&D.next,L=O(D,S);if(L&&N&&N===L)D=void 0;return!!L},get:function(S){return b(D,S)},has:function(S){return M(D,S)},set:function(S,N){if(!D)D={next:void 0};I(D,S,N)}};return X}}),$4=T((w,K)=>{K.exports=Object}),M0=T((w,K)=>{K.exports=Error}),G0=T((w,K)=>{K.exports=EvalError}),O0=T((w,K)=>{K.exports=RangeError}),D0=T((w,K)=>{K.exports=ReferenceError}),B0=T((w,K)=>{K.exports=SyntaxError}),N0=T((w,K)=>{K.exports=URIError}),X0=T((w,K)=>{K.exports=Math.abs}),S0=T((w,K)=>{K.exports=Math.floor}),$0=T((w,K)=>{K.exports=Math.max}),A0=T((w,K)=>{K.exports=Math.min}),Y0=T((w,K)=>{K.exports=Math.pow}),Q0=T((w,K)=>{K.exports=Math.round}),V0=T((w,K)=>{K.exports=Number.isNaN||function(W){return W!==W}}),L0=T((w,K)=>{var W=V0();K.exports=function(J){if(W(J)||J===0)return J;return J<0?-1:1}}),U0=T((w,K)=>{K.exports=Object.getOwnPropertyDescriptor}),A4=T((w,K)=>{var W=U0();if(W)try{W([],"length")}catch(J){W=null}K.exports=W}),q0=T((w,K)=>{var W=Object.defineProperty||!1;if(W)try{W({},"a",{value:1})}catch(J){W=!1}K.exports=W}),H0=T((w,K)=>{K.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var W={},J=Symbol("test"),P=Object(J);if(typeof J==="string")return!1;if(Object.prototype.toString.call(J)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;var b=42;W[J]=b;for(var I in W)return!1;if(typeof Object.keys==="function"&&Object.keys(W).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(W).length!==0)return!1;var M=Object.getOwnPropertySymbols(W);if(M.length!==1||M[0]!==J)return!1;if(!Object.prototype.propertyIsEnumerable.call(W,J))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var O=Object.getOwnPropertyDescriptor(W,J);if(O.value!==b||O.enumerable!==!0)return!1}return!0}}),z0=T((w,K)=>{var W=typeof Symbol<"u"&&Symbol,J=H0();K.exports=function(){if(typeof W!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof W("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return J()}}),Y4=T((w,K)=>{K.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),Q4=T((w,K)=>{var W=$4();K.exports=W.getPrototypeOf||null}),h0=T((w,K)=>{var W="Function.prototype.bind called on incompatible ",J=Object.prototype.toString,P=Math.max,b="[object Function]",I=function(D,X){var S=[];for(var N=0;N<D.length;N+=1)S[N]=D[N];for(var L=0;L<X.length;L+=1)S[L+D.length]=X[L];return S},M=function(D,X){var S=[];for(var N=X||0,L=0;N<D.length;N+=1,L+=1)S[L]=D[N];return S},O=function(D,X){var S="";for(var N=0;N<D.length;N+=1)if(S+=D[N],N+1<D.length)S+=X;return S};K.exports=function(D){var X=this;if(typeof X!=="function"||J.apply(X)!==b)throw TypeError(W+X);var S=M(arguments,1),N,L=function(){if(this instanceof N){var _=X.apply(this,I(S,arguments));if(Object(_)===_)return _;return this}return X.apply(D,I(S,arguments))},g=P(0,X.length-S.length),B=[];for(var E=0;E<g;E++)B[E]="$"+E;if(N=Function("binder","return function ("+O(B,",")+"){ return binder.apply(this,arguments); }")(L),X.prototype){var G=function(){};G.prototype=X.prototype,N.prototype=new G,G.prototype=null}return N}}),SK=T((w,K)=>{var W=h0();K.exports=Function.prototype.bind||W}),K1=T((w,K)=>{K.exports=Function.prototype.call}),V4=T((w,K)=>{K.exports=Function.prototype.apply}),F0=T((w,K)=>{K.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),R0=T((w,K)=>{var W=SK(),J=V4(),P=K1(),b=F0();K.exports=b||W.call(P,J)}),L4=T((w,K)=>{var W=SK(),J=H2(),P=K1(),b=R0();K.exports=function(I){if(I.length<1||typeof I[0]!=="function")throw new J("a function is required");return b(W,P,I)}}),E0=T((w,K)=>{var W=L4(),J=A4(),P;try{P=[].__proto__===Array.prototype}catch(O){if(!O||typeof O!=="object"||!("code"in O)||O.code!=="ERR_PROTO_ACCESS")throw O}var b=!!P&&J&&J(Object.prototype,"__proto__"),I=Object,M=I.getPrototypeOf;K.exports=b&&typeof b.get==="function"?W([b.get]):typeof M==="function"?function(O){return M(O==null?O:I(O))}:!1}),v0=T((w,K)=>{var W=Y4(),J=Q4(),P=E0();K.exports=W?function(b){return W(b)}:J?function(b){if(!b||typeof b!=="object"&&typeof b!=="function")throw TypeError("getProto: not an object");return J(b)}:P?function(b){return P(b)}:null}),Z0=T((w,K)=>{var W=Function.prototype.call,J=Object.prototype.hasOwnProperty,P=SK();K.exports=P.call(W,J)}),W1=T((w,K)=>{var W,J=$4(),P=M0(),b=G0(),I=O0(),M=D0(),O=B0(),D=H2(),X=N0(),S=X0(),N=S0(),L=$0(),g=A0(),B=Y0(),E=Q0(),G=L0(),_=Function,C=function(i){try{return _('"use strict"; return ('+i+").constructor;")()}catch(Ww){}},R=A4(),Z=q0(),o=function(){throw new D},r=R?function(){try{return arguments.callee,o}catch(i){try{return R(arguments,"callee").get}catch(Ww){return o}}}():o,U=z0()(),Q=v0(),q=Q4(),H=Y4(),x=V4(),l=K1(),ww={},bw=typeof Uint8Array>"u"||!Q?W:Q(Uint8Array),n={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":U&&Q?Q([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":ww,"%AsyncGenerator%":ww,"%AsyncGeneratorFunction%":ww,"%AsyncIteratorPrototype%":ww,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":P,"%eval%":eval,"%EvalError%":b,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":ww,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":U&&Q?Q(Q([][Symbol.iterator]())):W,"%JSON%":typeof JSON==="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!U||!Q?W:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":J,"%Object.getOwnPropertyDescriptor%":R,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":I,"%ReferenceError%":M,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!U||!Q?W:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":U&&Q?Q(""[Symbol.iterator]()):W,"%Symbol%":U?Symbol:W,"%SyntaxError%":O,"%ThrowTypeError%":r,"%TypedArray%":bw,"%TypeError%":D,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":X,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":l,"%Function.prototype.apply%":x,"%Object.defineProperty%":Z,"%Object.getPrototypeOf%":q,"%Math.abs%":S,"%Math.floor%":N,"%Math.max%":L,"%Math.min%":g,"%Math.pow%":B,"%Math.round%":E,"%Math.sign%":G,"%Reflect.getPrototypeOf%":H};if(Q)try{null.error}catch(i){t=Q(Q(i)),n["%Error.prototype%"]=t}var t,Ow=function i(Ww){var d;if(Ww==="%AsyncFunction%")d=C("async function () {}");else if(Ww==="%GeneratorFunction%")d=C("function* () {}");else if(Ww==="%AsyncGeneratorFunction%")d=C("async function* () {}");else if(Ww==="%AsyncGenerator%"){var Dw=i("%AsyncGeneratorFunction%");if(Dw)d=Dw.prototype}else if(Ww==="%AsyncIteratorPrototype%"){var Aw=i("%AsyncGenerator%");if(Aw&&Q)d=Q(Aw.prototype)}return n[Ww]=d,d},f={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},u=SK(),Iw=Z0(),$w=u.call(l,Array.prototype.concat),y=u.call(x,Array.prototype.splice),hw=u.call(l,String.prototype.replace),uw=u.call(l,String.prototype.slice),Kw=u.call(l,RegExp.prototype.exec),Cw=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ew=/\\(\\)?/g,ow=function(i){var Ww=uw(i,0,1),d=uw(i,-1);if(Ww==="%"&&d!=="%")throw new O("invalid intrinsic syntax, expected closing `%`");else if(d==="%"&&Ww!=="%")throw new O("invalid intrinsic syntax, expected opening `%`");var Dw=[];return hw(i,Cw,function(Aw,Uw,Nw,lw){Dw[Dw.length]=Nw?hw(lw,Ew,"$1"):Uw||Aw}),Dw},yw=function(i,Ww){var d=i,Dw;if(Iw(f,d))Dw=f[d],d="%"+Dw[0]+"%";if(Iw(n,d)){var Aw=n[d];if(Aw===ww)Aw=Ow(d);if(typeof Aw>"u"&&!Ww)throw new D("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:Dw,name:d,value:Aw}}throw new O("intrinsic "+i+" does not exist!")};K.exports=function(i,Ww){if(typeof i!=="string"||i.length===0)throw new D("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ww!=="boolean")throw new D('"allowMissing" argument must be a boolean');if(Kw(/^%?[^%]*%?$/,i)===null)throw new O("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var d=ow(i),Dw=d.length>0?d[0]:"",Aw=yw("%"+Dw+"%",Ww),Uw=Aw.name,Nw=Aw.value,lw=!1,qw=Aw.alias;if(qw)Dw=qw[0],y(d,$w([0,1],qw));for(var Hw=1,mw=!0;Hw<d.length;Hw+=1){var zw=d[Hw],nw=uw(zw,0,1),dw=uw(zw,-1);if((nw==='"'||nw==="'"||nw==="`"||(dw==='"'||dw==="'"||dw==="`"))&&nw!==dw)throw new O("property names with quotes must have matching quotes");if(zw==="constructor"||!mw)lw=!0;if(Dw+="."+zw,Uw="%"+Dw+"%",Iw(n,Uw))Nw=n[Uw];else if(Nw!=null){if(!(zw in Nw)){if(!Ww)throw new D("base intrinsic for "+i+" exists, but the property is not available.");return}if(R&&Hw+1>=d.length){var tw=R(Nw,zw);if(mw=!!tw,mw&&"get"in tw&&!("originalValue"in tw.get))Nw=tw.get;else Nw=Nw[zw]}else mw=Iw(Nw,zw),Nw=Nw[zw];if(mw&&!lw)n[Uw]=Nw}}return Nw}}),U4=T((w,K)=>{var W=W1(),J=L4(),P=J([W("%String.prototype.indexOf%")]);K.exports=function(b,I){var M=W(b,!!I);if(typeof M==="function"&&P(b,".prototype.")>-1)return J([M]);return M}}),q4=T((w,K)=>{var W=W1(),J=U4(),P=XK(),b=H2(),I=W("%Map%",!0),M=J("Map.prototype.get",!0),O=J("Map.prototype.set",!0),D=J("Map.prototype.has",!0),X=J("Map.prototype.delete",!0),S=J("Map.prototype.size",!0);K.exports=!!I&&function(){var N,L={assert:function(g){if(!L.has(g))throw new b("Side channel does not contain "+P(g))},delete:function(g){if(N){var B=X(N,g);if(S(N)===0)N=void 0;return B}return!1},get:function(g){if(N)return M(N,g)},has:function(g){if(N)return D(N,g);return!1},set:function(g,B){if(!N)N=new I;O(N,g,B)}};return L}}),j0=T((w,K)=>{var W=W1(),J=U4(),P=XK(),b=q4(),I=H2(),M=W("%WeakMap%",!0),O=J("WeakMap.prototype.get",!0),D=J("WeakMap.prototype.set",!0),X=J("WeakMap.prototype.has",!0),S=J("WeakMap.prototype.delete",!0);K.exports=M?function(){var N,L,g={assert:function(B){if(!g.has(B))throw new I("Side channel does not contain "+P(B))},delete:function(B){if(M&&B&&(typeof B==="object"||typeof B==="function")){if(N)return S(N,B)}else if(b){if(L)return L.delete(B)}return!1},get:function(B){if(M&&B&&(typeof B==="object"||typeof B==="function")){if(N)return O(N,B)}return L&&L.get(B)},has:function(B){if(M&&B&&(typeof B==="object"||typeof B==="function")){if(N)return X(N,B)}return!!L&&L.has(B)},set:function(B,E){if(M&&B&&(typeof B==="object"||typeof B==="function")){if(!N)N=new M;D(N,B,E)}else if(b){if(!L)L=b();L.set(B,E)}}};return g}:b}),H4=T((w,K)=>{var W=H2(),J=XK(),P=I0(),b=q4(),I=j0(),M=I||b||P;K.exports=function(){var O,D={assert:function(X){if(!D.has(X))throw new W("Side channel does not contain "+J(X))},delete:function(X){return!!O&&O.delete(X)},get:function(X){return O&&O.get(X)},has:function(X){return!!O&&O.has(X)},set:function(X,S){if(!O)O=M();O.set(X,S)}};return D}}),J1=T((w,K)=>{var W=String.prototype.replace,J=/%20/g,P={RFC1738:"RFC1738",RFC3986:"RFC3986"};K.exports={default:P.RFC3986,formatters:{RFC1738:function(b){return W.call(b,J,"+")},RFC3986:function(b){return String(b)}},RFC1738:P.RFC1738,RFC3986:P.RFC3986}}),z4=T((w,K)=>{var W=J1(),J=H4(),P=Object.prototype.hasOwnProperty,b=Array.isArray,I=J(),M=function(U,Q){return I.set(U,Q),U},O=function(U){return I.has(U)},D=function(U){return I.get(U)},X=function(U,Q){I.set(U,Q)},S=function(){var U=[];for(var Q=0;Q<256;++Q)U[U.length]="%"+((Q<16?"0":"")+Q.toString(16)).toUpperCase();return U}(),N=function(U){while(U.length>1){var Q=U.pop(),q=Q.obj[Q.prop];if(b(q)){var H=[];for(var x=0;x<q.length;++x)if(typeof q[x]<"u")H[H.length]=q[x];Q.obj[Q.prop]=H}}},L=function(U,Q){var q=Q&&Q.plainObjects?{__proto__:null}:{};for(var H=0;H<U.length;++H)if(typeof U[H]<"u")q[H]=U[H];return q},g=function U(Q,q,H){if(!q)return Q;if(typeof q!=="object"&&typeof q!=="function"){if(b(Q)){var x=Q.length;if(H&&typeof H.arrayLimit==="number"&&x>H.arrayLimit)return M(L(Q.concat(q),H),x);Q[x]=q}else if(Q&&typeof Q==="object"){if(O(Q)){var l=D(Q)+1;Q[l]=q,X(Q,l)}else if(H&&H.strictMerge)return[Q,q];else if(H&&(H.plainObjects||H.allowPrototypes)||!P.call(Object.prototype,q))Q[q]=!0}else return[Q,q];return Q}if(!Q||typeof Q!=="object"){if(O(q)){var ww=Object.keys(q),bw=H&&H.plainObjects?{__proto__:null,0:Q}:{0:Q};for(var n=0;n<ww.length;n++){var t=parseInt(ww[n],10);bw[t+1]=q[ww[n]]}return M(bw,D(q)+1)}var Ow=[Q].concat(q);if(H&&typeof H.arrayLimit==="number"&&Ow.length>H.arrayLimit)return M(L(Ow,H),Ow.length-1);return Ow}var f=Q;if(b(Q)&&!b(q))f=L(Q,H);if(b(Q)&&b(q))return q.forEach(function(u,Iw){if(P.call(Q,Iw)){var $w=Q[Iw];if($w&&typeof $w==="object"&&u&&typeof u==="object")Q[Iw]=U($w,u,H);else Q[Q.length]=u}else Q[Iw]=u}),Q;return Object.keys(q).reduce(function(u,Iw){var $w=q[Iw];if(P.call(u,Iw))u[Iw]=U(u[Iw],$w,H);else u[Iw]=$w;if(O(q)&&!O(u))M(u,D(q));if(O(u)){var y=parseInt(Iw,10);if(String(y)===Iw&&y>=0&&y>D(u))X(u,y)}return u},f)},B=function(U,Q){return Object.keys(Q).reduce(function(q,H){return q[H]=Q[H],q},U)},E=function(U,Q,q){var H=U.replace(/\+/g," ");if(q==="iso-8859-1")return H.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(H)}catch(x){return H}},G=1024,_=function(U,Q,q,H,x){if(U.length===0)return U;var l=U;if(typeof U==="symbol")l=Symbol.prototype.toString.call(U);else if(typeof U!=="string")l=String(U);if(q==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});var ww="";for(var bw=0;bw<l.length;bw+=G){var n=l.length>=G?l.slice(bw,bw+G):l,t=[];for(var Ow=0;Ow<n.length;++Ow){var f=n.charCodeAt(Ow);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||x===W.RFC1738&&(f===40||f===41)){t[t.length]=n.charAt(Ow);continue}if(f<128){t[t.length]=S[f];continue}if(f<2048){t[t.length]=S[192|f>>6]+S[128|f&63];continue}if(f<55296||f>=57344){t[t.length]=S[224|f>>12]+S[128|f>>6&63]+S[128|f&63];continue}Ow+=1,f=65536+((f&1023)<<10|n.charCodeAt(Ow)&1023),t[t.length]=S[240|f>>18]+S[128|f>>12&63]+S[128|f>>6&63]+S[128|f&63]}ww+=t.join("")}return ww},C=function(U){var Q=[{obj:{o:U},prop:"o"}],q=[];for(var H=0;H<Q.length;++H){var x=Q[H],l=x.obj[x.prop],ww=Object.keys(l);for(var bw=0;bw<ww.length;++bw){var n=ww[bw],t=l[n];if(typeof t==="object"&&t!==null&&q.indexOf(t)===-1)Q[Q.length]={obj:l,prop:n},q[q.length]=t}}return N(Q),U},R=function(U){return Object.prototype.toString.call(U)==="[object RegExp]"},Z=function(U){if(!U||typeof U!=="object")return!1;return!!(U.constructor&&U.constructor.isBuffer&&U.constructor.isBuffer(U))},o=function(U,Q,q,H){if(O(U)){var x=D(U)+1;return U[x]=Q,X(U,x),U}var l=[].concat(U,Q);if(l.length>q)return M(L(l,{plainObjects:H}),l.length-1);return l},r=function(U,Q){if(b(U)){var q=[];for(var H=0;H<U.length;H+=1)q[q.length]=Q(U[H]);return q}return Q(U)};K.exports={arrayToObject:L,assign:B,combine:o,compact:C,decode:E,encode:_,isBuffer:Z,isOverflow:O,isRegExp:R,markOverflow:M,maybeMap:r,merge:g}}),k0=T((w,K)=>{var W=H4(),J=z4(),P=J1(),b=Object.prototype.hasOwnProperty,I={brackets:function(G){return G+"[]"},comma:"comma",indices:function(G,_){return G+"["+_+"]"},repeat:function(G){return G}},M=Array.isArray,O=Array.prototype.push,D=function(G,_){O.apply(G,M(_)?_:[_])},X=Date.prototype.toISOString,S=P.default,N={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:J.encode,encodeValuesOnly:!1,filter:void 0,format:S,formatter:P.formatters[S],indices:!1,serializeDate:function(G){return X.call(G)},skipNulls:!1,strictNullHandling:!1},L=function(G){return typeof G==="string"||typeof G==="number"||typeof G==="boolean"||typeof G==="symbol"||typeof G==="bigint"},g={},B=function G(_,C,R,Z,o,r,U,Q,q,H,x,l,ww,bw,n,t,Ow,f){var u=_,Iw=f,$w=0,y=!1;while((Iw=Iw.get(g))!==void 0&&!y){var hw=Iw.get(_);if($w+=1,typeof hw<"u")if(hw===$w)throw RangeError("Cyclic object value");else y=!0;if(typeof Iw.get(g)>"u")$w=0}if(typeof H==="function")u=H(C,u);else if(u instanceof Date)u=ww(u);else if(R==="comma"&&M(u))u=J.maybeMap(u,function(Nw){if(Nw instanceof Date)return ww(Nw);return Nw});if(u===null){if(r)return q&&!t?q(C,N.encoder,Ow,"key",bw):C;u=""}if(L(u)||J.isBuffer(u)){if(q){var uw=t?C:q(C,N.encoder,Ow,"key",bw);return[n(uw)+"="+n(q(u,N.encoder,Ow,"value",bw))]}return[n(C)+"="+n(String(u))]}var Kw=[];if(typeof u>"u")return Kw;var Cw;if(R==="comma"&&M(u)){if(t&&q)u=J.maybeMap(u,q);Cw=[{value:u.length>0?u.join(",")||null:void 0}]}else if(M(H))Cw=H;else{var Ew=Object.keys(u);Cw=x?Ew.sort(x):Ew}var ow=Q?String(C).replace(/\./g,"%2E"):String(C),yw=Z&&M(u)&&u.length===1?ow+"[]":ow;if(o&&M(u)&&u.length===0)return yw+"[]";for(var i=0;i<Cw.length;++i){var Ww=Cw[i],d=typeof Ww==="object"&&Ww&&typeof Ww.value<"u"?Ww.value:u[Ww];if(U&&d===null)continue;var Dw=l&&Q?String(Ww).replace(/\./g,"%2E"):String(Ww),Aw=M(u)?typeof R==="function"?R(yw,Dw):yw:yw+(l?"."+Dw:"["+Dw+"]");f.set(_,$w);var Uw=W();Uw.set(g,f),D(Kw,G(d,Aw,R,Z,o,r,U,Q,R==="comma"&&t&&M(u)?null:q,H,x,l,ww,bw,n,t,Ow,Uw))}return Kw},E=function(G){if(!G)return N;if(typeof G.allowEmptyArrays<"u"&&typeof G.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof G.encodeDotInKeys<"u"&&typeof G.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(G.encoder!==null&&typeof G.encoder<"u"&&typeof G.encoder!=="function")throw TypeError("Encoder has to be a function.");var _=G.charset||N.charset;if(typeof G.charset<"u"&&G.charset!=="utf-8"&&G.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var C=P.default;if(typeof G.format<"u"){if(!b.call(P.formatters,G.format))throw TypeError("Unknown format option provided.");C=G.format}var R=P.formatters[C],Z=N.filter;if(typeof G.filter==="function"||M(G.filter))Z=G.filter;var o;if(G.arrayFormat in I)o=G.arrayFormat;else if("indices"in G)o=G.indices?"indices":"repeat";else o=N.arrayFormat;if("commaRoundTrip"in G&&typeof G.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");var r=typeof G.allowDots>"u"?G.encodeDotInKeys===!0?!0:N.allowDots:!!G.allowDots;return{addQueryPrefix:typeof G.addQueryPrefix==="boolean"?G.addQueryPrefix:N.addQueryPrefix,allowDots:r,allowEmptyArrays:typeof G.allowEmptyArrays==="boolean"?!!G.allowEmptyArrays:N.allowEmptyArrays,arrayFormat:o,charset:_,charsetSentinel:typeof G.charsetSentinel==="boolean"?G.charsetSentinel:N.charsetSentinel,commaRoundTrip:!!G.commaRoundTrip,delimiter:typeof G.delimiter>"u"?N.delimiter:G.delimiter,encode:typeof G.encode==="boolean"?G.encode:N.encode,encodeDotInKeys:typeof G.encodeDotInKeys==="boolean"?G.encodeDotInKeys:N.encodeDotInKeys,encoder:typeof G.encoder==="function"?G.encoder:N.encoder,encodeValuesOnly:typeof G.encodeValuesOnly==="boolean"?G.encodeValuesOnly:N.encodeValuesOnly,filter:Z,format:C,formatter:R,serializeDate:typeof G.serializeDate==="function"?G.serializeDate:N.serializeDate,skipNulls:typeof G.skipNulls==="boolean"?G.skipNulls:N.skipNulls,sort:typeof G.sort==="function"?G.sort:null,strictNullHandling:typeof G.strictNullHandling==="boolean"?G.strictNullHandling:N.strictNullHandling}};K.exports=function(G,_){var C=G,R=E(_),Z,o;if(typeof R.filter==="function")o=R.filter,C=o("",C);else if(M(R.filter))o=R.filter,Z=o;var r=[];if(typeof C!=="object"||C===null)return"";var U=I[R.arrayFormat],Q=U==="comma"&&R.commaRoundTrip;if(!Z)Z=Object.keys(C);if(R.sort)Z.sort(R.sort);var q=W();for(var H=0;H<Z.length;++H){var x=Z[H],l=C[x];if(R.skipNulls&&l===null)continue;D(r,B(l,x,U,Q,R.allowEmptyArrays,R.strictNullHandling,R.skipNulls,R.encodeDotInKeys,R.encode?R.encoder:null,R.filter,R.sort,R.allowDots,R.serializeDate,R.format,R.formatter,R.encodeValuesOnly,R.charset,q))}var ww=r.join(R.delimiter),bw=R.addQueryPrefix===!0?"?":"";if(R.charsetSentinel)if(R.charset==="iso-8859-1")bw+="utf8=%26%2310003%3B&";else bw+="utf8=%E2%9C%93&";return ww.length>0?bw+ww:""}}),g0=T((w,K)=>{var W=z4(),J=Object.prototype.hasOwnProperty,P=Array.isArray,b={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:W.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1000,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},I=function(B){return B.replace(/&#(\d+);/g,function(E,G){return String.fromCharCode(parseInt(G,10))})},M=function(B,E,G){if(B&&typeof B==="string"&&E.comma&&B.indexOf(",")>-1)return B.split(",");if(E.throwOnLimitExceeded&&G>=E.arrayLimit)throw RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return B},O="utf8=%26%2310003%3B",D="utf8=%E2%9C%93",X=function(B,E){var G={__proto__:null},_=E.ignoreQueryPrefix?B.replace(/^\?/,""):B;_=_.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var C=E.parameterLimit===1/0?void 0:E.parameterLimit,R=_.split(E.delimiter,E.throwOnLimitExceeded?C+1:C);if(E.throwOnLimitExceeded&&R.length>C)throw RangeError("Parameter limit exceeded. Only "+C+" parameter"+(C===1?"":"s")+" allowed.");var Z=-1,o,r=E.charset;if(E.charsetSentinel){for(o=0;o<R.length;++o)if(R[o].indexOf("utf8=")===0){if(R[o]===D)r="utf-8";else if(R[o]===O)r="iso-8859-1";Z=o,o=R.length}}for(o=0;o<R.length;++o){if(o===Z)continue;var U=R[o],Q=U.indexOf("]="),q=Q===-1?U.indexOf("="):Q+1,H,x;if(q===-1)H=E.decoder(U,b.decoder,r,"key"),x=E.strictNullHandling?null:"";else if(H=E.decoder(U.slice(0,q),b.decoder,r,"key"),H!==null)x=W.maybeMap(M(U.slice(q+1),E,P(G[H])?G[H].length:0),function(ww){return E.decoder(ww,b.decoder,r,"value")});if(x&&E.interpretNumericEntities&&r==="iso-8859-1")x=I(String(x));if(U.indexOf("[]=")>-1)x=P(x)?[x]:x;if(E.comma&&P(x)&&x.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");x=W.combine([],x,E.arrayLimit,E.plainObjects)}if(H!==null){var l=J.call(G,H);if(l&&(E.duplicates==="combine"||U.indexOf("[]=")>-1))G[H]=W.combine(G[H],x,E.arrayLimit,E.plainObjects);else if(!l||E.duplicates==="last")G[H]=x}}return G},S=function(B,E,G,_){var C=0;if(B.length>0&&B[B.length-1]==="[]"){var R=B.slice(0,-1).join("");C=Array.isArray(E)&&E[R]?E[R].length:0}var Z=_?E:M(E,G,C);for(var o=B.length-1;o>=0;--o){var r,U=B[o];if(U==="[]"&&G.parseArrays)if(W.isOverflow(Z))r=Z;else r=G.allowEmptyArrays&&(Z===""||G.strictNullHandling&&Z===null)?[]:W.combine([],Z,G.arrayLimit,G.plainObjects);else{r=G.plainObjects?{__proto__:null}:{};var Q=U.charAt(0)==="["&&U.charAt(U.length-1)==="]"?U.slice(1,-1):U,q=G.decodeDotInKeys?Q.replace(/%2E/g,"."):Q,H=parseInt(q,10),x=!isNaN(H)&&U!==q&&String(H)===q&&H>=0&&G.parseArrays;if(!G.parseArrays&&q==="")r={0:Z};else if(x&&H<G.arrayLimit)r=[],r[H]=Z;else if(x&&G.throwOnLimitExceeded)throw RangeError("Array limit exceeded. Only "+G.arrayLimit+" element"+(G.arrayLimit===1?"":"s")+" allowed in an array.");else if(x)r[H]=Z,W.markOverflow(r,H);else if(q!=="__proto__")r[q]=Z}Z=r}return Z},N=function(B,E){var G=E.allowDots?B.replace(/\.([^.[]+)/g,"[$1]"):B;if(E.depth<=0){if(!E.plainObjects&&J.call(Object.prototype,G)){if(!E.allowPrototypes)return}return[G]}var _=/(\[[^[\]]*])/,C=/(\[[^[\]]*])/g,R=_.exec(G),Z=R?G.slice(0,R.index):G,o=[];if(Z){if(!E.plainObjects&&J.call(Object.prototype,Z)){if(!E.allowPrototypes)return}o[o.length]=Z}var r=0;while((R=C.exec(G))!==null&&r<E.depth){r+=1;var U=R[1].slice(1,-1);if(!E.plainObjects&&J.call(Object.prototype,U)){if(!E.allowPrototypes)return}o[o.length]=R[1]}if(R){if(E.strictDepth===!0)throw RangeError("Input depth exceeded depth option of "+E.depth+" and strictDepth is true");o[o.length]="["+G.slice(R.index)+"]"}return o},L=function(B,E,G,_){if(!B)return;var C=N(B,G);if(!C)return;return S(C,E,G,_)},g=function(B){if(!B)return b;if(typeof B.allowEmptyArrays<"u"&&typeof B.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof B.decodeDotInKeys<"u"&&typeof B.decodeDotInKeys!=="boolean")throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(B.decoder!==null&&typeof B.decoder<"u"&&typeof B.decoder!=="function")throw TypeError("Decoder has to be a function.");if(typeof B.charset<"u"&&B.charset!=="utf-8"&&B.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof B.throwOnLimitExceeded<"u"&&typeof B.throwOnLimitExceeded!=="boolean")throw TypeError("`throwOnLimitExceeded` option must be a boolean");var E=typeof B.charset>"u"?b.charset:B.charset,G=typeof B.duplicates>"u"?b.duplicates:B.duplicates;if(G!=="combine"&&G!=="first"&&G!=="last")throw TypeError("The duplicates option must be either combine, first, or last");var _=typeof B.allowDots>"u"?B.decodeDotInKeys===!0?!0:b.allowDots:!!B.allowDots;return{allowDots:_,allowEmptyArrays:typeof B.allowEmptyArrays==="boolean"?!!B.allowEmptyArrays:b.allowEmptyArrays,allowPrototypes:typeof B.allowPrototypes==="boolean"?B.allowPrototypes:b.allowPrototypes,allowSparse:typeof B.allowSparse==="boolean"?B.allowSparse:b.allowSparse,arrayLimit:typeof B.arrayLimit==="number"?B.arrayLimit:b.arrayLimit,charset:E,charsetSentinel:typeof B.charsetSentinel==="boolean"?B.charsetSentinel:b.charsetSentinel,comma:typeof B.comma==="boolean"?B.comma:b.comma,decodeDotInKeys:typeof B.decodeDotInKeys==="boolean"?B.decodeDotInKeys:b.decodeDotInKeys,decoder:typeof B.decoder==="function"?B.decoder:b.decoder,delimiter:typeof B.delimiter==="string"||W.isRegExp(B.delimiter)?B.delimiter:b.delimiter,depth:typeof B.depth==="number"||B.depth===!1?+B.depth:b.depth,duplicates:G,ignoreQueryPrefix:B.ignoreQueryPrefix===!0,interpretNumericEntities:typeof B.interpretNumericEntities==="boolean"?B.interpretNumericEntities:b.interpretNumericEntities,parameterLimit:typeof B.parameterLimit==="number"?B.parameterLimit:b.parameterLimit,parseArrays:B.parseArrays!==!1,plainObjects:typeof B.plainObjects==="boolean"?B.plainObjects:b.plainObjects,strictDepth:typeof B.strictDepth==="boolean"?!!B.strictDepth:b.strictDepth,strictMerge:typeof B.strictMerge==="boolean"?!!B.strictMerge:b.strictMerge,strictNullHandling:typeof B.strictNullHandling==="boolean"?B.strictNullHandling:b.strictNullHandling,throwOnLimitExceeded:typeof B.throwOnLimitExceeded==="boolean"?B.throwOnLimitExceeded:!1}};K.exports=function(B,E){var G=g(E);if(B===""||B===null||typeof B>"u")return G.plainObjects?{__proto__:null}:{};var _=typeof B==="string"?X(B,G):B,C=G.plainObjects?{__proto__:null}:{},R=Object.keys(_);for(var Z=0;Z<R.length;++Z){var o=R[Z],r=L(o,_[o],G,typeof B==="string");C=W.merge(C,r,G)}if(G.allowSparse===!0)return C;return W.compact(C)}}),c0=T((w,K)=>{var W=k0(),J=g0(),P=J1();K.exports={formats:P,parse:J,stringify:W}}),MJ=NK(w1(),1),C0={};S4(C0,{zodSchemaKey:()=>r0,webSocketServerArgsKey:()=>vw,webSocketMessageArgsKey:()=>IK,webSocketKey:()=>OK,webSocketEventKey:()=>u0,webSocketEventArgumentsKey:()=>o0,webSocketConnectionArgsKey:()=>M2,webSocketCloseReasonArgsKey:()=>v4,webSocketCloseCodeArgsKey:()=>E4,routeModelArgsKey:()=>fw,responseStatusTextArgsKey:()=>y2,responseStatusArgsKey:()=>V2,responseHeadersArgsKey:()=>sw,responseBodyArgsKey:()=>u2,requestHeadersArgsKey:()=>L2,requestHeaderArgsKey:()=>O2,requestBodyArgsKey:()=>x2,requestArgsKey:()=>D2,queryArgsKey:()=>Z4,paramsArgsKey:()=>tK,paramArgsKey:()=>r2,moduleKey:()=>bK,middlewareKey:()=>R4,interceptorKey:()=>h4,injectableKey:()=>F4,injectKey:()=>GK,httpServerArgsKey:()=>G2,guardKey:()=>P1,controllerKey:()=>MK,controllerHttpKey:()=>x0,contextArgsKey:()=>U2,containerKey:()=>o2,configKey:()=>dK,argumentsKey:()=>Lw});var Lw=Symbol.for("____boolTypescriptCore:arguments__"),o0=Symbol.for("____boolTypescriptCore:webSocketEventArguments__"),dK=Symbol.for("____boolTypescriptCore:config__"),MK=Symbol.for("____boolTypescriptCore:controller__"),h4=Symbol.for("____boolTypescriptCore:interceptor__"),P1=Symbol.for("____boolTypescriptCore:guard__"),x0=Symbol.for("____boolTypescriptCore:controller.http__"),GK=Symbol.for("____boolTypescriptCore:inject__"),F4=Symbol.for("____boolTypescriptCore:injectable__"),R4=Symbol.for("____boolTypescriptCore:middleware__"),bK=Symbol.for("____boolTypescriptCore:module__"),o2=Symbol.for("____boolTypescriptCore:container__"),r0=Symbol.for("____boolTypescriptCore:zodSchema__"),OK=Symbol.for("____boolTypescriptCore:webSocket__"),u0=Symbol.for("____boolTypescriptCore:webSocket:event__"),vw=Symbol.for("____boolTypescriptCore:webSocketArguments:server__"),M2=Symbol.for("____boolTypescriptCore:webSocketArguments:connection__"),IK=Symbol.for("____boolTypescriptCore:webSocketArguments:message__"),E4=Symbol.for("____boolTypescriptCore:webSocketArguments:closeCode__"),v4=Symbol.for("____boolTypescriptCore:webSocketArguments:closeReason__"),G2=Symbol.for("____boolTypescriptCore:httpArguments:server__"),L2=Symbol.for("____boolTypescriptCore:httpArguments:requestHeaders__"),O2=Symbol.for("____boolTypescriptCore:httpArguments:requestHeader__"),x2=Symbol.for("____boolTypescriptCore:httpArguments:requestBody__"),tK=Symbol.for("____boolTypescriptCore:httpArguments:params__"),r2=Symbol.for("____boolTypescriptCore:httpArguments:param__"),Z4=Symbol.for("____boolTypescriptCore:httpArguments:query__"),D2=Symbol.for("____boolTypescriptCore:httpArguments:request__"),sw=Symbol.for("____boolTypescriptCore:httpArguments:responseHeaders__"),U2=Symbol.for("____boolTypescriptCore:httpArguments:context__"),fw=Symbol.for("____boolTypescriptCore:httpArguments:routeModel__"),u2=Symbol.for("____boolTypescriptCore:httpArguments:responseBody__"),V2=Symbol.for("____boolTypescriptCore:httpArguments:responseStatus__"),y2=Symbol.for("____boolTypescriptCore:httpArguments:responseStatusText__"),Vw={};S4(Vw,{successfulStatuses:()=>k4,serverErrorStatuses:()=>C4,redirectionStatuses:()=>g4,informationalStatuses:()=>j4,httpStatuses:()=>y0,clientErrorStatuses:()=>c4});var j4=Object.freeze({CONTINUE:Object.freeze({status:100,statusText:"Continue"}),SWITCHING_PROTOCOLS:Object.freeze({status:101,statusText:"Switching Protocols"}),EARLY_HINTS:Object.freeze({status:103,statusText:"Early Hints"})}),k4=Object.freeze({OK:Object.freeze({status:200,statusText:"OK"}),CREATED:Object.freeze({status:201,statusText:"Created"}),ACCEPTED:Object.freeze({status:202,statusText:"Accepted"}),NON_AUTHORITATIVE_INFORMATION:Object.freeze({status:203,statusText:"Non-Authoritative Information"}),NO_CONTENT:Object.freeze({status:204,statusText:"No Content"}),RESET_CONTENT:Object.freeze({status:205,statusText:"Reset Content"}),PARTIAL_CONTENT:Object.freeze({status:206,statusText:"Partial Content"}),MULTI_STATUS:Object.freeze({status:207,statusText:"Multi-Status"}),ALREADY_REPORTED:Object.freeze({status:208,statusText:"Already Reported"}),IM_USED:Object.freeze({status:226,statusText:"IM Used"})}),g4=Object.freeze({MULTIPLE_CHOICES:Object.freeze({status:300,statusText:"Multiple Choices"}),MOVED_PERMANENTLY:Object.freeze({status:301,statusText:"Moved Permanently"}),FOUND:Object.freeze({status:302,statusText:"Found"}),SEE_OTHER:Object.freeze({status:303,statusText:"See Other"}),NOT_MODIFIED:Object.freeze({status:304,statusText:"Not Modified"}),UNUSED:Object.freeze({status:306,statusText:"Unused"}),TEMPORARY_REDIRECT:Object.freeze({status:307,statusText:"Temporary Redirect"}),PERMANENT_REDIRECT:Object.freeze({status:308,statusText:"Permanent Redirect"})}),c4=Object.freeze({BAD_REQUEST:Object.freeze({status:400,statusText:"Bad Request"}),UNAUTHORIZED:Object.freeze({status:401,statusText:"Unauthorized"}),PAYMENT_REQUIRED:Object.freeze({status:402,statusText:"Payment Required"}),FORBIDDEN:Object.freeze({status:403,statusText:"Forbidden"}),NOT_FOUND:Object.freeze({status:404,statusText:"Not Found"}),METHOD_NOT_ALLOWED:Object.freeze({status:405,statusText:"Method Not Allowed"}),NOT_ACCEPTABLE:Object.freeze({status:406,statusText:"Not Acceptable"}),PROXY_AUTHENTICATION_REQUIRED:Object.freeze({status:407,statusText:"Proxy Authentication Required"}),REQUEST_TIMEOUT:Object.freeze({status:408,statusText:"Request Timeout"}),CONFLICT:Object.freeze({status:409,statusText:"Conflict"}),GONE:Object.freeze({status:410,statusText:"Gone"}),LENGTH_REQUIRED:Object.freeze({status:411,statusText:"Length Required"}),PRECONDITION_FAILED:Object.freeze({status:412,statusText:"Precondition Failed"}),CONTENT_TOO_LARGE:Object.freeze({status:413,statusText:"Content Too Large"}),URI_TOO_LONG:Object.freeze({status:414,statusText:"URI Too Long"}),UNSUPPORTED_MEDIA_TYPE:Object.freeze({status:415,statusText:"Unsupported Media Type"}),RANGE_NOT_SATISFIABLE:Object.freeze({status:416,statusText:"Range Not Satisfiable"}),EXPECTATION_FAILED:Object.freeze({status:417,statusText:"Expectation Failed"}),I_AM_A_TEAPOT:Object.freeze({status:418,statusText:"I'm a teapot"}),MISDIRECTED_REQUEST:Object.freeze({status:421,statusText:"Misdirected Request"}),UNPROCESSABLE_CONTENT:Object.freeze({status:422,statusText:"Unprocessable Content"}),LOCKED:Object.freeze({status:423,statusText:"Locked"}),FAILED_DEPENDENCY:Object.freeze({status:424,statusText:"Failed Dependency"}),TOO_EARLY:Object.freeze({status:425,statusText:"Too Early"}),UPGRADE_REQUIRED:Object.freeze({status:426,statusText:"Upgrade Required"}),PRECONDITION_REQUIRED:Object.freeze({status:428,statusText:"Precondition Required"}),TOO_MANY_REQUESTS:Object.freeze({status:429,statusText:"Too Many Requests"}),REQUEST_HEADER_FIELDS_TOO_LARGE:Object.freeze({status:431,statusText:"Request Header Fields Too Large"}),UNAVAILABLE_FOR_LEGAL_REASONS:Object.freeze({status:451,statusText:"Unavailable For Legal Reasons"})}),C4=Object.freeze({INTERNAL_SERVER_ERROR:Object.freeze({status:500,statusText:"Internal Server Error"}),NOT_IMPLEMENTED:Object.freeze({status:501,statusText:"Not Implemented"}),BAD_GATEWAY:Object.freeze({status:502,statusText:"Bad Gateway"}),SERVICE_UNAVAILABLE:Object.freeze({status:503,statusText:"Service Unavailable"}),GATEWAY_TIMEOUT:Object.freeze({status:504,statusText:"Gateway Timeout"}),HTTP_VERSION_NOT_SUPPORTED:Object.freeze({status:505,statusText:"HTTP Version Not Supported"}),VARIANT_ALSO_NEGOTIATES:Object.freeze({status:506,statusText:"Variant Also Negotiates"}),INSUFFICIENT_STORAGE:Object.freeze({status:507,statusText:"Insufficient Storage"}),LOOP_DETECTED:Object.freeze({status:508,statusText:"Loop Detected"}),NOT_EXTENDED:Object.freeze({status:510,statusText:"Not Extended"}),NETWORK_AUTHENTICATION_REQUIRED:Object.freeze({status:511,statusText:"Network Authentication Required"})}),y0=Object.freeze({...j4,...k4,...g4,...c4,...C4}),o4=(w)=>(K,W,J)=>{if(!W)return;let P=Reflect.getOwnMetadata(Lw,K.constructor,W)||{};P[`argumentIndexes.${J}`]={index:J,type:L2,validationSchema:w},Reflect.defineMetadata(Lw,P,K.constructor,W)};var $K=(w)=>(K,W,J)=>{if(!W)return;let P=Reflect.getOwnMetadata(Lw,K.constructor,W)||{};P[`argumentIndexes.${J}`]={index:J,type:U2,key:w},Reflect.defineMetadata(Lw,P,K.constructor,W)},x4=()=>(w,K,W)=>{if(!K)return;let J=Reflect.getOwnMetadata(Lw,w.constructor,K)||{};J[`argumentIndexes.${W}`]={index:W,type:fw},Reflect.defineMetadata(Lw,J,w.constructor,K)};var r4=()=>(w)=>{if(!("enforce"in w.prototype)||typeof w.prototype.enforce!=="function")return;let K=void 0;return Reflect.defineMetadata(P1,K,w),w};var u4=(w)=>(K,W,J)=>{let P=Reflect.getMetadata(GK,K)||[];P[J]=w,Reflect.defineMetadata(GK,P,K)};var GJ=Symbol("__bool:webSocket.upgrade__");var xw;(function(w){w.year="year",w.month="month",w.day="day",w.hours="hours",w.minutes="minutes",w.seconds="seconds",w.miliseconds="miliseconds"})(xw||(xw={}));var m0=(w,K,W=xw.day)=>{let J=w instanceof Date?w:new Date(w);switch(W){case xw.year:J.setFullYear(J.getFullYear()+K);break;case xw.month:J.setMonth(J.getMonth()+K);break;case xw.day:J.setDate(J.getDate()+K);break;case xw.hours:J.setHours(J.getHours()+K);break;case xw.minutes:J.setMinutes(J.getMinutes()+K);break;case xw.seconds:J.setSeconds(J.getSeconds()+K);break;case xw.miliseconds:J.setMilliseconds(J.getMilliseconds()+K);break}return J},_0=NK(c0(),1),{serve:l0}=globalThis.Bun,OJ=async function(){}.constructor,N4=Object.freeze({black:"38;5;16",red:"38;5;196",green:"38;5;46",yellow:"38;5;226",blue:"38;5;21",magenta:"38;5;201",cyan:"38;5;51",white:"38;5;231",gray:"38;5;244"}),X4=Object.freeze({black:"48;5;16",red:"48;5;196",green:"48;5;46",yellow:"48;5;226",blue:"48;5;21",magenta:"48;5;201",cyan:"48;5;51",white:"48;5;231",gray:"48;5;244"}),pw=(w,K={})=>{let{color:W,backgroundColor:J,bold:P,underline:b}=K,I=[];if(P)I.push("1");if(b)I.push("4");if(W&&N4[W])I.push(N4[W]);if(J&&X4[J])I.push(X4[J]);if(I.length===0)return w;return`\x1B[${I.join(";")}m${w}\x1B[0m`},DK=(w)=>{for(let[K,W]of Object.entries(Vw.httpStatuses)){if(W.status!==w)continue;return W.statusText}return"Unknown error"},T0=(w)=>{let{headers:K,method:W}=w,J=K.get("upgrade")?.toLowerCase()||"",P=K.get("connection")?.toLowerCase()||"";return W==="GET"&&J?.toLowerCase()==="websocket"&&P?.toLowerCase().includes("upgrade")};class BK extends Error{httpCode;message;data;constructor({httpCode:w,data:K,message:W}){super();this.httpCode=w,this.message=!W?.trim()?DK(w):W.trim(),this.data=K}}class b1 extends Error{httpCode;message;data;constructor({httpCode:w,data:K,message:W}){super();this.httpCode=w,this.message=!W?.trim()?DK(w):W.trim(),this.data=K}}var y4=["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"],p0=(w)=>!!y4.find((K)=>K===w),f0=(w,K=new Headers)=>{if(K.set("Content-Type","application/json"),w instanceof BK||w instanceof b1)return new Response(JSON.stringify(w),{status:w.httpCode,statusText:w.message,headers:K});return new Response(JSON.stringify((()=>{switch(typeof w){case"object":return!(w instanceof Error)?w:{message:w.message,code:w.name,cause:w.cause};case"string":return{message:w};case"number":return{code:w};default:return}})()),{status:500,statusText:"INTERNAL SERVER ERROR",headers:K})};class aK{_staticMap=new Map;_dynamicMap=new Map;_options=void 0;constructor(...w){w.forEach((K)=>{K.staticEntries.forEach(([W,J])=>this.set(W,J,{isStatic:!0,isPassthrough:!0})),K.dynamicEntries.forEach(([W,J])=>this.set(W,J,{isStatic:!1}))})}get(w,K){return!{...this._options,...K}.isStatic?this._dynamicMap.get(w):this._staticMap.get(w)}has(w,K){return!{...this._options,...K}.isStatic?this._dynamicMap.has(w):this._staticMap.has(w)}set(w,K,W){let J={...this._options,...W};if(!J?.isStatic)this._dynamicMap.set(w,K);else if(!this._staticMap.has(w))this._staticMap.set(w,K);else if(!J.isPassthrough)throw Error(`${String(w)} already exists in context static collection.`);return this}setOptions(w){return this._options=w,this}get staticEntries(){return[...this._staticMap.entries()]}get dynamicEntries(){return[...this._dynamicMap.entries()]}}class m4{alias;#w=new Map;#K;constructor({alias:w}){let K=this._thinAlias(w);this.alias=K,this.#K=new URLPattern({pathname:K,baseURL:"https://www.booljs.com"})}test({pathname:w}){try{return this.#K.test({pathname:this._thinAlias(w),baseURL:"https://www.booljs.com"})}catch(K){return console.error(K),!1}}exec({pathname:w,method:K}){try{let W=this.#w.get(K);if(!W)return null;let J=this.#K.exec({pathname:this._thinAlias(w),baseURL:"https://www.booljs.com"});if(!J)return null;let P=J.pathname.groups;return Object.freeze({parameters:P,model:W})}catch(W){return console.error(W),null}}get({model:w}){if(!this.#w.get("GET"))this.#w.set("GET",w);return this}post({model:w}){if(!this.#w.get("POST"))this.#w.set("POST",w);return this}put({model:w}){if(!this.#w.get("PUT"))this.#w.set("PUT",w);return this}delete({model:w}){if(!this.#w.get("DELETE"))this.#w.set("DELETE",w);return this}connect({model:w}){if(!this.#w.get("CONNECT"))return this.#w.set("CONNECT",w);return this}options({model:w}){if(!this.#w.get("OPTIONS"))return this.#w.set("OPTIONS",w);return this}trace({model:w}){if(!this.#w.get("TRACE"))return this.#w.set("TRACE",w);return this}patch({model:w}){if(!this.#w.get("PATCH"))return this.#w.set("PATCH",w);return this}_thinAlias(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get _fullPath(){return this.alias.split("/").map((w,K)=>{let W=new RegExp(":([a-z0-9A-Z_.-]{1,})(\\(.*?\\))","g");if(!W.test(w)){if(W=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!W.test(w))return w;return w.replace(W,(J,P)=>`${J}(.*?)`)}return w}).join("/")}get _filteredPath(){return this.alias.split("/").map((w,K)=>{let W=new RegExp(":([a-z0-9A-Z_.-]{1,})((.*?))","g");if(!W.test(w)){if(W=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!W.test(w))return w;return w.replace(W,(J,P)=>"(.*?)")}return w.replace(W,(J,P,b)=>b)}).join("/")}}var e0=m4;class sK{alias;#w=new Map;#K;#J;#b;constructor({alias:w,guardHandlers:K=[],openInterceptorHandlers:W=[],closeInterceptorHandlers:J=[]}){this.alias=this._thinAlias(w),this.#K=K,this.#J=W,this.#b=J}route({alias:w}){let K=this._thinAlias(`${this.alias}/${w}`),W=this.#w.get(K),J=!W?new e0({alias:`${this.alias}/${w}`}):W;if(!W)this.#w.set(K,J);return J}_thinAlias(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get routes(){return this.#w}get pipes(){return Object.freeze({guardHandlers:[...this.#K],openInterceptorHandlers:[...this.#J],closeInterceptorHandlers:[...this.#b]})}}class B2{#w=new Map;add(...w){for(let K of w){if(this.#w.has(K.alias))continue;this.#w.set(K.alias,K)}return this}find({pathname:w,method:K}){for(let W of this.#w.values())for(let J of W.routes.values()){if(!J.test({pathname:w}))continue;let P=J.exec({pathname:w,method:K});if(!P)continue;return Object.freeze({...P,...W.pipes})}return null}}var DJ=NK(w1(),1);class N2{_mapper=new Map;constructor(...w){w.forEach((K)=>{K.entries.forEach(([W,J])=>{this._mapper.set(W,J)})})}get(w){if(this._mapper.has(w))return this._mapper.get(w);if(typeof w!=="function")return;let K=Reflect.getMetadataKeys(w);if(![F4,MK,R4,P1,h4,OK].some((P)=>K.includes(P)))throw Error("Missing dependency declaration, please check @Injectable() used on dependency(ies).");let W=(Reflect.getOwnMetadata(GK,w)||[]).map((P)=>this.get(P)),J=new w(...W);return this._mapper.set(w,J),J}set(w,K){if(this._mapper.has(w))throw Error(`${String(w)} already exists in injector collection.`);this._mapper.set(w,K)}get entries(){return[...this._mapper.entries()]}}class _4{error;constructor(w){this.error=w}}class l4{eventName;metadata;_context=void 0;constructor({eventName:w,metadata:K}){this.eventName=w,this.metadata=K}bind(w){return this._context=w,this}execute(){if(this._context&&typeof this.metadata.descriptor.value==="function")this.metadata.descriptor.value=this.metadata.descriptor.value.bind(this._context);return Object.freeze({methodName:this.metadata.methodName,descriptor:this.metadata.descriptor,arguments:this.metadata.arguments})}}class I1{rawAlias;alias;routes=[];constructor(w="/"){this.rawAlias=w,this.alias=I1.thinAlias(w)}addRoutes(...w){for(let K of w)if(!this.routes.includes(K))this.routes.push(K);return this}bind(w){for(let K of this.routes)K.bind(w);return this}execute(){let w=new Map;for(let K of this.routes)w.set(`${this.alias}:::${K.eventName}`,K.execute());return w}static thinAlias(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class q2{rawPrefix;prefix;routers=[];constructor(w="/"){this.rawPrefix=w,this.prefix=q2.thinPrefix(w)}addRouters(...w){for(let K=0;K<w.length;K++)if(!this.routers.includes(w[K]))this.routers.push(w[K]);for(let K of w)if(!this.routers.includes(K))this.routers.push(K);return this}execute(){let w=new Map;for(let K of this.routers){let W=K.execute();for(let[J,P]of W.entries())w.set(`/${q2.thinPrefix(`${this.prefix}/${J}`)}`,P)}return w}static thinPrefix(w){return w.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class T4{classConstructor;options;#w;#K;#J=new Map;#b;#G=900;#M;#I=new aK;constructor(w,K){this.classConstructor=w,this.options=K;let W=Reflect.getOwnMetadataKeys(w);if(!W.includes(o2)&&!W.includes(bK))throw Error(`Can not detect! ${w.name} class is not a container or module.`);this.#K=!W.includes(o2)?"MODULE":"CONTAINER",this.#G=typeof K.static?.cacheTimeInSeconds!=="number"?900:K.static.cacheTimeInSeconds,this.#b=Object.freeze({allowLogsMethods:this.options?.log?.methods||[],staticOption:this.options.static,allowOrigins:!this.options.cors?.origins?["*"]:typeof this.options.cors.origins!=="string"?this.options.cors.origins.includes("*")||this.options.cors.origins.length<1?["*"]:this.options.cors.origins:[this.options.cors.origins!=="*"?this.options.cors.origins:"*"],allowMethods:this.options.cors?.methods||y4,allowCredentials:!this.options.cors?.credentials?!1:!0,allowHeaders:!this.options.cors?.headers||this.options.cors.headers.includes("*")?["*"]:this.options.cors.headers,pipelineStrategy:(()=>{switch(K.pipelineStrategy?.type){case"SIMPLE":return Object.freeze({startMiddlewares:"FIFO",endMiddlewares:K.pipelineStrategy.targets?.middlewares||"FIFO",openInterceptors:"FIFO",closeInterceptors:K.pipelineStrategy.targets?.interceptors||"FIFO"});default:return Object.freeze({startMiddlewares:"FIFO",endMiddlewares:"FIFO",openInterceptors:"FIFO",closeInterceptors:"FIFO"})}})()})}static async create(w,K){let W=new T4(w,K);return await W.preLaunch(),W}useValidator(w){this.#M=w}async preLaunch(){if(this.#w)return this.#w;let{startMiddlewareHandlers:w,endMiddlewareHandlers:K,controllerRouterGroup:W,webSocketHttpRouterGroup:J,webSocketRouterGroup:P}=this.#K!=="MODULE"?await this.#$({containerClass:this.classConstructor,prefix:this.options.prefix,options:this.options}):await this.#O({moduleClass:this.classConstructor,prefix:this.options.prefix,options:this.options}),b=new Map,I=P.execute();for(let[M,O]of I.entries())b.set(M,O);return this.#w=Object.freeze({startMiddlewareHandlers:w,endMiddlewareHandlers:K,controllerRouterGroup:W,webSocketHttpRouterGroup:J,webSocketRouterGroup:P,webSocketsMap:b}),this.#w}async listen(){let w=l0({port:this.options.port,idleTimeout:typeof this.options.idleTimeoutInSeconds!=="number"||this.options.idleTimeoutInSeconds<=0?void 0:this.options.idleTimeoutInSeconds,fetch:this.#D.bind(this),websocket:await this.#B.bind(this)()});this.#I.set(vw,w)}async#D(w,K){let{allowLogsMethods:W,allowOrigins:J,allowMethods:P,allowHeaders:b,allowCredentials:I,staticOption:M}=this.#b,{startMiddlewareHandlers:O,endMiddlewareHandlers:D,controllerRouterGroup:X,webSocketHttpRouterGroup:S}=await this.preLaunch(),N=performance.now(),L=new URL(w.url),g=_0.parse(L.searchParams.toString(),this.options.queryParser),B=w.headers.get("origin")||"*",E=w.method.toUpperCase(),G=new Headers,_=new aK().setOptions({isStatic:!0}).set(G2,K).set(D2,w).set(O2,w.headers).set(sw,G).set(Z4,g);try{if([...!I?[]:[{key:"Access-Control-Allow-Credentials",value:"true"}],{key:"Access-Control-Allow-Origin",value:J.includes("*")?"*":!J.includes(B)?J[0]:B},{key:"Access-Control-Allow-Methods",value:P.join(", ")},{key:"Access-Control-Allow-Headers",value:b.join(", ")}].forEach(({key:C,value:R})=>G.set(C,R)),!p0(E)||!P.includes(E))return this.finalizeResponse(new Response(void 0,{...Vw.clientErrorStatuses.METHOD_NOT_ALLOWED,headers:G}));if(T0(w))return await this.#N({request:w,server:K,context:_,url:L,query:g,method:E,responseHeaders:G,httpRouterGroup:S,startMiddlewareHandlers:O,endMiddlewareHandlers:D});if(w.method.toUpperCase()==="OPTIONS")return this.finalizeResponse(J.includes("*")||J.includes(B)?new Response(void 0,{...Vw.successfulStatuses.NO_CONTENT,headers:G}):new Response(void 0,{...Vw.clientErrorStatuses.EXPECTATION_FAILED,headers:G}));if(M){let C=await this.#X({url:L,responseHeaders:G,path:M.path,headers:M.headers,cacheTimeInSeconds:M.cacheTimeInSeconds});if(C instanceof Response)return C}return await this.#S({url:L,method:E,context:_,httpRouterGroup:X,startMiddlewareHandlers:O,endMiddlewareHandlers:D})}catch(C){return this.options.debug&&console.error(C),this.finalizeResponse(f0(C,G))}finally{if(W){let C=performance.now(),R=_.get(V2,{isStatic:!1}),Z=typeof R!=="number"||!R?0:R,o=pw(L.pathname,{color:"blue"}),r=`${Bun.color("yellow","ansi")}${process.pid}`,U=pw(` ${w.method} `,{color:"yellow",backgroundColor:"blue"}),Q=pw(`${w.headers.get("x-forwarded-for")||w.headers.get("x-real-ip")||K.requestIP(w)?.address||"<Unknown>"}`,{color:"yellow"}),q=pw(` ${Math.round((C-N+Number.EPSILON)*100)/100}ms `,{color:"yellow",backgroundColor:"blue"}),H=pw(` ${Z} (${DK(Z)}) `,(()=>{if(Z>=100&&Z<200)return{color:"white",backgroundColor:"cyan"};else if(Z>=200&&Z<300)return{color:"white",backgroundColor:"blue"};else if(Z>=300&&Z<400)return{color:"black",backgroundColor:"magenta"};else if(Z>=400&&Z<500)return{color:"black",backgroundColor:"yellow"};else if(Z>=500&&Z<600)return{color:"white",backgroundColor:"red"};else return{color:"black",backgroundColor:"gray"}})());W.includes(w.method.toUpperCase())&&console.info([`PID: ${r}`,`Method: ${U}`,`IP: ${Q}`,`Time: ${q}`,typeof R!=="number"||!R?void 0:H,o].filter((x)=>!!x?.trim()).join(" - "))}}}async#B(){let{webSocketsMap:w}=await this.preLaunch();return{open:(K)=>{let W=`${K.data.pathname}:::open`,J=w.get(W);if(!J)return;let P=J.arguments||{},b=[];for(let[,I]of Object.entries(P))switch(I.type){case M2:b[I.index]=K;break;case vw:b[I.index]=this.#I.get(vw);break}J.descriptor.value(...b)},close:(K,W,J)=>{let P=`${K.data.pathname}:::close`,b=w.get(P);if(!b)return;let I=b.arguments||{},M=[];for(let[,O]of Object.entries(I))switch(O.type){case M2:M[O.index]=K;break;case E4:M[O.index]=W;break;case v4:M[O.index]=J;break;case vw:M[O.index]=this.#I.get(vw);break}b.descriptor.value(...M)},message:(K,W)=>{let J=`${K.data.pathname}:::message`,P=w.get(J);if(!P)return;let b=P.arguments||{},I=[];for(let[,M]of Object.entries(b))switch(M.type){case M2:I[M.index]=K;break;case IK:I[M.index]=W;break;case vw:I[M.index]=this.#I.get(vw);break}P.descriptor.value(...I)},drain:(K)=>{let W=`${K.data.pathname}:::drain`,J=w.get(W);if(!J)return;let P=J.arguments||{},b=[];for(let[,I]of Object.entries(P))switch(I.type){case M2:b[I.index]=K;break;case vw:b[I.index]=this.#I.get(vw);break}J.descriptor.value(...b)},ping:(K,W)=>{let J=`${K.data.pathname}:::ping`,P=w.get(J);if(!P)return;let b=P.arguments||{},I=[];for(let[,M]of Object.entries(b))switch(M.type){case M2:I[M.index]=K;break;case IK:I[M.index]=W;break;case vw:I[M.index]=this.#I.get(vw);break}P.descriptor.value(...I)},pong:(K,W)=>{let J=`${K.data.pathname}:::pong`,P=w.get(J);if(!P)return;let b=P.arguments||{},I=[];for(let[,M]of Object.entries(b))switch(M.type){case M2:I[M.index]=K;break;case IK:I[M.index]=W;break;case vw:I[M.index]=this.#I.get(vw);break}P.descriptor.value(...I)}}}async#N({request:w,server:K,context:W,url:J,query:P,method:b,responseHeaders:I,httpRouterGroup:M,startMiddlewareHandlers:O,endMiddlewareHandlers:D}){try{await this.#P({type:"START_MIDDLEWARES",handlers:O,context:W});let X=M.find({pathname:J.pathname,method:b}),S=this.finalizeResponse(new Response(void 0,{...Vw.serverErrorStatuses.INTERNAL_SERVER_ERROR,headers:I}));if(X){let N=await this.#P({type:"GUARDS",handlers:X.guardHandlers,context:W});if(N!==!0)S=this.finalizeResponse(new Response(void 0,{...!N||N==="UNAUTHORIZATION"?Vw.clientErrorStatuses.UNAUTHORIZED:Vw.clientErrorStatuses.FORBIDDEN,headers:I}));else{W.set(fw,X.model),await this.#P({type:"OPEN_INTERCEPTORS",handlers:X.openInterceptorHandlers,context:W});let L=await X.model.func(...[K,w,P]);if(await this.#P({type:"CLOSE_INTERCEPTORS",handlers:X.closeInterceptorHandlers,context:W}),typeof L!=="boolean"||!L)S=this.finalizeResponse(new Response(void 0,{...Vw.serverErrorStatuses.INTERNAL_SERVER_ERROR,headers:I}));else S=void 0}}return await this.#P({type:"END_MIDDLEWARES",handlers:D,context:W}),S}catch(X){throw console.error(X),X}}async#X({url:w,path:K,headers:W,cacheTimeInSeconds:J,responseHeaders:P}){let b=`${K}/${w.pathname}`,I=this.#J.get(b);if(!I){let M=Bun.file(b);if(await M.exists()){if(W)for(let[O,D]of Object.entries(W))P.set(O,D);return P.set("Content-Type",M.type),this.finalizeResponse(new Response(await M.arrayBuffer(),{...Vw.successfulStatuses.OK,headers:P}))}}else{let M=new Date>I.expiredAt;if(M)this.#J.delete(b);let O=!M?I.file:Bun.file(b);if(await O.exists()){if(this.#J.set(b,Object.freeze({expiredAt:m0(new Date,this.#G,xw.seconds),file:O})),W)for(let[D,X]of Object.entries(W))P.set(D,X);return P.set("Content-Type",O.type),this.finalizeResponse(new Response(await O.arrayBuffer(),{...Vw.successfulStatuses.OK,headers:P}))}}}async#S({context:w,url:K,method:W,httpRouterGroup:J,startMiddlewareHandlers:P=[],endMiddlewareHandlers:b=[]}){let I={isStatic:!0};w.setOptions(I),await this.#P({type:"START_MIDDLEWARES",handlers:P,context:w});let M=J.find({pathname:K.pathname,method:W});if(!M)w.setOptions({isStatic:!1}).set(V2,Vw.clientErrorStatuses.NOT_FOUND.status).set(y2,Vw.clientErrorStatuses.NOT_FOUND.statusText).set(u2,void 0);else{w.set(fw,M.model),w.set(tK,M.parameters);let N=await this.#P({type:"GUARDS",handlers:M.guardHandlers,context:w});if(N!==!0)w.setOptions({isStatic:!1}).set(V2,!N||N==="UNAUTHORIZATION"?Vw.clientErrorStatuses.UNAUTHORIZED.status:Vw.clientErrorStatuses.FORBIDDEN.status).set(y2,!N||N==="UNAUTHORIZATION"?Vw.clientErrorStatuses.UNAUTHORIZED.statusText:Vw.clientErrorStatuses.FORBIDDEN.statusText).set(u2,void 0);else await this.#P({type:"OPEN_INTERCEPTORS",handlers:M.openInterceptorHandlers,context:w}),await this.#P({type:"CONTROLLER",context:w}),await this.#P({type:"CLOSE_INTERCEPTORS",handlers:M.closeInterceptorHandlers,context:w})}await this.#P({type:"END_MIDDLEWARES",handlers:b,context:w});let O=w.get(sw,{isStatic:!0})||new Headers,D=w.get(u2,{isStatic:!1})||void 0,X=w.get(V2,{isStatic:!1}),S=w.get(y2,{isStatic:!1});return this.serializeResponse({status:typeof X!=="number"?W==="POST"?201:void 0:X,statusText:typeof S!=="string"?void 0:S,headers:O,data:D})}async#$({prefix:w="",startMiddlewareHandlers:K=[],endMiddlewareHandlers:W=[],guardHandlers:J=[],openInterceptorHandlers:P=[],closeInterceptorHandlers:b=[],controllerRouterGroup:I=new B2,webSocketHttpRouterGroup:M=new B2,webSocketRouterGroup:O=new q2,containerClass:D,options:X,extendInjector:S}){if(!Reflect.getOwnMetadataKeys(D).includes(o2))throw Error(`[${D.name}] is not a container.`);let N=!S?new N2:new N2(S),L=Reflect.getOwnMetadata(o2,D),{loaders:g,middlewares:B,dependencies:E,modules:G,guards:_,interceptors:C,prefix:R,config:Z}=L||{},{config:o}=Object.freeze({config:{...typeof X.config!=="function"?X.config:await X.config(),...typeof Z!=="function"?typeof Z!=="object"?void 0:("key"in Z)&&("value"in Z)&&typeof Z.key==="symbol"?typeof Z.value!=="function"?Z.value:await Z.value():Z:await Z()}});if(N.set(Z&&"key"in Z&&"value"in Z&&typeof Z.key==="symbol"?Z.key:dK,o),g){let r=[];for(let[Q,q]of Object.entries(g))r.push(async()=>{try{let H=await q({config:o});return console.info(`${pw(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${Q}] initialized successfully.`),H}catch(H){throw console.error(`${pw(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${Q}] initialization failed.`),X.debug&&console.error(H),H}});let U=await Promise.all(r.map((Q)=>Q()));for(let[Q,q]of U)N.set(Q,q)}if(E){for(let r of E)if(!N.get(r))throw Error(`Can not collect dependency [${r.name}].`)}if(B){let r=(U,Q)=>!!U;for(let U of B){let Q=N.get(U);if(!Q||!r(Q,U))throw Error(`Can not collect middleware [${U.name}].`);if(Q.start&&typeof Q.start==="function"){let q=Reflect.getOwnMetadata(Lw,U,"start")||{};K.push(Object.freeze({class:U,funcName:"start",func:Q.start.bind(Q),argumentsMetadata:q}))}if(Q.end&&typeof Q.end==="function"){let q=Reflect.getOwnMetadata(Lw,U,"end")||{};W.push(Object.freeze({class:U,funcName:"end",func:Q.end.bind(Q),argumentsMetadata:q}))}}}if(_){let r=(U,Q)=>!!U;for(let U of _){let Q=N.get(U);if(!Q||!r(Q,U))throw Error(`Can not collect guard [${U.name}].`);let q=Reflect.getOwnMetadata(Lw,U,"enforce")||{};J.push(Object.freeze({class:U,funcName:"enforce",func:Q.enforce.bind(Q),argumentsMetadata:q}))}}if(C){let r=(U,Q)=>!!U;for(let U of C){let Q=N.get(U);if(!Q||!r(Q,U))throw Error(`Can not collect interceptor [${U.name}].`);if(Q){if(Q.open&&typeof Q.open==="function"){let q=Reflect.getOwnMetadata(Lw,U,"open")||{};P.push(Object.freeze({class:U,funcName:"open",func:Q.open.bind(Q),argumentsMetadata:q}))}if(Q.close&&typeof Q.close==="function"){let q=Reflect.getOwnMetadata(Lw,U,"close")||{};b.push(Object.freeze({class:U,funcName:"close",func:Q.close.bind(Q),argumentsMetadata:q}))}}}}if(G){let r=[w.trim(),R?.trim()||""].filter((U)=>U.length>0).join("/");for(let U of G)try{await this.#O({prefix:r,moduleClass:U,extendInjector:N,options:X,startMiddlewareHandlers:K,endMiddlewareHandlers:W,guardHandlers:[...J],openInterceptorHandlers:[...P],closeInterceptorHandlers:[...b],controllerRouterGroup:I,webSocketHttpRouterGroup:M,webSocketRouterGroup:O})}catch(Q){throw console.group(`Can not resolve module: [${U.name}].`),console.error(Q),console.groupEnd(),Q}}return Object.freeze({startMiddlewareHandlers:K,endMiddlewareHandlers:W,controllerRouterGroup:I,webSocketHttpRouterGroup:M,webSocketRouterGroup:O})}async#O({prefix:w="",startMiddlewareHandlers:K=[],endMiddlewareHandlers:W=[],guardHandlers:J=[],openInterceptorHandlers:P=[],closeInterceptorHandlers:b=[],controllerRouterGroup:I=new B2,webSocketHttpRouterGroup:M=new B2,webSocketRouterGroup:O=new q2,moduleClass:D,options:X,extendInjector:S}){if(!Reflect.getOwnMetadataKeys(D).includes(bK))throw Error(`[${D.name}] is not a module.`);let N=!S?new N2:new N2(S),L=Reflect.getOwnMetadata(bK,D),{loaders:g,middlewares:B,guards:E,interceptors:G,controllers:_,dependencies:C,webSockets:R,prefix:Z,config:o}=L||{},r=[w.trim(),Z?.trim()||""].filter((Q)=>Q.length>0).join("/"),{config:U}=Object.freeze({config:!o?void 0:{...typeof X.config!=="function"?X.config:await X.config(),...typeof o!=="function"?typeof o!=="object"?void 0:("key"in o)&&("value"in o)&&typeof o.key==="symbol"?typeof o.value!=="function"?o.value:await o.value():o:await o()}});if(U&&N.set(o&&"key"in o&&"value"in o&&typeof o.key==="symbol"?o.key:dK,U),g){let Q=[];for(let[H,x]of Object.entries(g))Q.push(async()=>{try{let l=await x({config:U});return console.info(`${pw(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${H}] initialized successfully.`),l}catch(l){throw console.error(`${pw(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${H}] initialization failed.`),X.debug&&console.error(l),l}});let q=await Promise.all(Q.map((H)=>H()));for(let H=0;H<q.length;H++){let[x,l]=q[H];N.set(x,l)}}if(C){for(let Q of C)if(!N.get(Q))throw Error(`Can not collect dependency [${Q.name}].`)}if(B){let Q=(q,H)=>!!q;for(let q of B){let H=N.get(q);if(!H||!Q(H,q))throw Error(`Can not collect middleware [${q.name}].`);if(H.start&&typeof H.start==="function"){let x=Reflect.getOwnMetadata(Lw,q,"start")||{};K.push(Object.freeze({class:q,funcName:"start",func:H.start.bind(H),argumentsMetadata:x}))}if(H.end&&typeof H.end==="function"){let x=Reflect.getOwnMetadata(Lw,q,"end")||{};W.push(Object.freeze({class:q,funcName:"end",func:H.end.bind(H),argumentsMetadata:x}))}}}if(E){let Q=(q,H)=>!!q;for(let q of E){let H=N.get(q);if(!H||!Q(H,q))throw Error(`Can not collect guard [${q.name}].`);let x=Reflect.getOwnMetadata(Lw,q,"enforce")||{};J.push(Object.freeze({class:q,funcName:"enforce",func:H.enforce.bind(H),argumentsMetadata:x}))}}if(G){let Q=(q,H)=>!!q;for(let q of G){let H=N.get(q);if(!H||!Q(H,q))throw Error(`Can not collect interceptor [${q.name}].`);if(H){if(H.open&&typeof H.open==="function"){let x=Reflect.getOwnMetadata(Lw,q,"open")||{};P.push(Object.freeze({class:q,funcName:"open",func:H.open.bind(H),argumentsMetadata:x}))}if(H.close&&typeof H.close==="function"){let x=Reflect.getOwnMetadata(Lw,q,"close")||{};b.push(Object.freeze({class:q,funcName:"close",func:H.close.bind(H),argumentsMetadata:x}))}}}}if(_)for(let Q of _)this.#A({controllerConstructor:Q,prefix:r,injector:N,httpRouterGroup:I,guardHandlers:[...J],openInterceptorHandlers:[...P],closeInterceptorHandlers:[...b]});if(R)for(let Q of R)this.#Y({webSocketConstructor:Q,injector:N,prefix:r,webSocketHttpRouterGroup:M,webSocketRouterGroup:O});return Object.freeze({startMiddlewareHandlers:K,endMiddlewareHandlers:W,controllerRouterGroup:I,webSocketHttpRouterGroup:M,webSocketRouterGroup:O})}#A({controllerConstructor:w,prefix:K="",injector:W=new N2,httpRouterGroup:J=new B2,guardHandlers:P=[],openInterceptorHandlers:b=[],closeInterceptorHandlers:I=[]}){if(!Reflect.getOwnMetadataKeys(w).includes(MK))throw Error(`[${w.name}] is not a controller.`);let M=W.get(w);if(!M)throw Error("Can not initialize controller.");let O=Reflect.getOwnMetadata(MK,w)||{prefix:"/",httpMetadata:[]},D=[K.trim(),O.prefix.trim()].filter((S)=>S.length>0).join("/"),X=new sK({alias:D,guardHandlers:P,openInterceptorHandlers:b,closeInterceptorHandlers:I});for(let S of O.httpMetadata){if(typeof S.descriptor.value!=="function")continue;let N=X.route({alias:S.path}),L=S.descriptor.value.bind(M),g=Object.freeze({class:w,funcName:S.methodName,func:L,argumentsMetadata:S.argumentsMetadata});switch(S.httpMethod){case"GET":N.get({model:g});break;case"POST":N.post({model:g});break;case"PUT":N.put({model:g});break;case"PATCH":N.patch({model:g});break;case"DELETE":N.delete({model:g});break;case"OPTIONS":N.options({model:g});break}}return J.add(X)}async#W({data:w,validationSchema:K,argumentIndex:W,funcName:J}){if(!this.#M)return w;try{let P=await this.#M.validate(w,K,W,J);if(!(P instanceof _4))return P;throw new BK({httpCode:400,message:`Validation at the [${J.toString()}] method fails at positional argument [${W}].`,data:P.error})}catch(P){if(P instanceof BK)throw P;throw new b1({httpCode:500,message:`Validation at the [${J.toString()}] method error at positional argument [${W}].`,data:!(P instanceof Error)?P:[{message:P.message,code:P.name,cause:P.cause}]})}}#Y({webSocketConstructor:w,prefix:K="",injector:W=new N2,webSocketHttpRouterGroup:J=new B2,webSocketRouterGroup:P=new q2,guardHandlers:b=[],openInterceptorHandlers:I=[],closeInterceptorHandlers:M=[]}){if(!Reflect.getOwnMetadataKeys(w).includes(OK))throw Error(`[${w.name}] is not a websocket route.`);let O=W.get(w);if(!O)throw Error("Can not initialize webSocket.");let D=Reflect.getOwnMetadata(OK,w)||{prefix:"/",events:[],http:[]},X=`/${K}/${D.prefix}`,S=new sK({alias:X,guardHandlers:b,openInterceptorHandlers:I,closeInterceptorHandlers:M});for(let[L,g]of Object.entries(D.http)){if(typeof g.descriptor?.value!=="function")continue;let B=S.route({alias:g.path}),E=g.descriptor.value.bind(O),G=Object.freeze({class:w,funcName:g.methodName,func:E,argumentsMetadata:g.argumentsMetadata});switch(g.httpMethod){case"GET":B.get({model:G});break;case"POST":B.post({model:G});break}}J.add(S);let N=new I1(X);for(let[L,g]of Object.entries(D.events)){let B=new l4({eventName:L,metadata:g});N.addRoutes(B)}return N.bind(O),P.addRouters(N),Object.freeze({webSocketHttpRouterGroup:J,webSocketRouterGroup:P})}async#P({type:w,handlers:K,context:W}){let J={isStatic:!0};W.setOptions(J);let P=W.get(G2,J)||void 0,b=W.get(D2,J)||void 0,I=W.get(O2,J)||void 0,M=W.get(sw,J)||void 0,O=W.get(tK,J)||void 0,D=W.get(fw,J)||void 0;if(w==="START_MIDDLEWARES"||w==="END_MIDDLEWARES"){let X=w==="START_MIDDLEWARES"?this.#b.pipelineStrategy.startMiddlewares:this.#b.pipelineStrategy.endMiddlewares;for(let S=X==="FIFO"?0:K.length-1;X==="FIFO"?S<K.length:S>-1;X==="FIFO"?S++:S--){let N=[],{func:L,funcName:g,argumentsMetadata:B}=K[S];for(let[E,G]of Object.entries(B))switch(G.type){case U2:N[G.index]=!G.key?W:W.get(G.key,J);break;case D2:N[G.index]=b;break;case x2:N[G.index]=!G.validationSchema?await b?.[G.parser||"json"]():await this.#W({data:await b?.[G.parser||"json"](),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case L2:N[G.index]=!G.validationSchema?I:await this.#W({data:I?.toJSON(),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case O2:N[G.index]=!G.validationSchema?I?.get(G.key)||void 0:await this.#W({data:I?.get(G.key)||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case r2:N[G.index]=!G.validationSchema?O?.[G.key]||void 0:await this.#W({data:O?.[G.key]||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case fw:N[G.index]=void 0;break;case sw:N[G.index]=M;break;case G2:N[G.index]=P;break;default:N[G.index]=!G.validationSchema?W.get(G.type,J):await this.#W({data:W.get(G.type,J),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break}await L(...N)}}else if(w==="GUARDS"){if(!D||K.length===0)return!0;for(let X=0;X<K.length;X++){let S=[],{func:N,funcName:L,argumentsMetadata:g}=K[X];for(let[E,G]of Object.entries(g))switch(G.type){case D2:S[G.index]=b;break;case x2:S[G.index]=!G.validationSchema?await b?.[G.parser||"json"]():await this.#W({data:await b?.[G.parser||"json"](),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case U2:S[G.index]=!G.key?W:W.get(G.key);break;case L2:S[G.index]=!G.validationSchema?I:await this.#W({data:I?.toJSON(),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case sw:S[G.index]=M;break;case O2:S[G.index]=!G.validationSchema?I?.get(G.key)||void 0:await this.#W({data:I?.get(G.key)||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case r2:S[G.index]=!G.validationSchema?O?.[G.key]||void 0:await this.#W({data:O?.[G.key],validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break;case fw:S[G.index]=D;break;case G2:S[G.index]=P;break;default:S[G.index]=!G.validationSchema?W.get(G.type):await this.#W({data:W.get(G.type),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:L});break}let B=await N(...S);if(B!==!0)return B}return!0}else if(w==="OPEN_INTERCEPTORS"||w==="CLOSE_INTERCEPTORS"){if(!D)return;let X=w==="OPEN_INTERCEPTORS"?this.#b.pipelineStrategy.openInterceptors:this.#b.pipelineStrategy.closeInterceptors;for(let S=X==="FIFO"?0:K.length-1;X==="FIFO"?S<K.length:S>-1;X==="FIFO"?S++:S--){let N=[],{func:L,funcName:g,argumentsMetadata:B}=K[S];for(let[E,G]of Object.entries(B))switch(G.type){case D2:N[G.index]=b;break;case x2:N[G.index]=!G.validationSchema?await b?.[G.parser||"json"]():await this.#W({data:await b?.[G.parser||"json"](),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case U2:N[G.index]=!G.key?W:W.get(G.key);break;case L2:N[G.index]=!G.validationSchema?I:await this.#W({data:I?.toJSON(),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case O2:N[G.index]=!G.validationSchema?I?.get(G.key)||void 0:await this.#W({data:I?.get(G.key)||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case sw:N[G.index]=M;break;case r2:N[G.index]=!G.validationSchema?O?.[G.key]||void 0:await this.#W({data:O?.[G.key]||void 0,validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break;case fw:N[G.index]=D;break;case G2:N[G.index]=P;break;default:N[G.index]=!G.validationSchema?W.get(G.type):await this.#W({data:W.get(G.type),validationSchema:G.validationSchema,argumentIndex:G.index,funcName:g});break}await L(...N)}}else if(w==="CONTROLLER"){if(!D){W.setOptions({isStatic:!1}).set(V2,404).set(y2,"Not found.");return}let X=[],{func:S,funcName:N,argumentsMetadata:L}=D;for(let[g,B]of Object.entries(L))switch(B.type){case D2:X[B.index]=b;break;case x2:X[B.index]=!B.validationSchema?await b?.[B.parser||"json"]():await this.#W({data:await b?.[B.parser||"json"](),validationSchema:B.validationSchema,argumentIndex:B.index,funcName:N});break;case U2:X[B.index]=!B.key?W:W.get(B.key);break;case L2:X[B.index]=!B.validationSchema?I:await this.#W({data:I?.toJSON(),validationSchema:B.validationSchema,argumentIndex:B.index,funcName:N});break;case O2:X[B.index]=!B.validationSchema?I?.get(B.key)||void 0:await this.#W({data:I?.get(B.key)||void 0,validationSchema:B.validationSchema,argumentIndex:B.index,funcName:N});break;case sw:X[B.index]=M;break;case r2:X[B.index]=!B.validationSchema?O?.[B.key]||void 0:await this.#W({data:O?.[B.key]||void 0,validationSchema:B.validationSchema,argumentIndex:B.index,funcName:N});break;case fw:X[B.index]=D;break;case G2:X[B.index]=P;break;default:X[B.index]=!B.validationSchema?W.get(B.type):await this.#W({data:W.get(B.type),validationSchema:B.validationSchema,argumentIndex:B.index,funcName:N});break}W.set(u2,await S(...X),{isStatic:!1})}return}serializeResponse({status:w,statusText:K,headers:W,data:J}){let P=W.get("Content-Type")||"text/plain",b=!w?!J?204:200:w,I=DK(b);if(P.includes("application/json"))return this.finalizeResponse(new Response(!J?void 0:J instanceof ReadableStream?J:JSON.stringify(J),{status:b,statusText:I,headers:W}));if(P.includes("text/plain")||P.includes("text/html"))return this.finalizeResponse(new Response(!J?void 0:J instanceof ReadableStream?J:String(J),{status:b,statusText:I,headers:W}));if(P.includes("application/octet-stream")){if(J instanceof Uint8Array||J instanceof ArrayBuffer||J instanceof Blob||J instanceof ReadableStream)return this.finalizeResponse(new Response(J,{status:b,statusText:I,headers:W}));throw Error("Invalid data type for application/octet-stream")}if(P.includes("multipart/form-data")){if(J instanceof FormData)return this.finalizeResponse(new Response(J,{status:b,statusText:I,headers:W}));throw Error("multipart/form-data requires FormData object")}return this.finalizeResponse(new Response(!J?void 0:String(J),{status:b,statusText:I,headers:W}))}finalizeResponse(w){return w.headers.set("X-Powered-By","Bool Typescript"),w}}var BJ=NK(w1(),1);var i0=()=>$K(Fw.authState);var n0=()=>(w)=>{Reflect.defineMetadata(Fw.guardMetadata,void 0,w)};var M1=Object.freeze({status:"aborted"});function h(w,K,W){function J(M,O){if(!M._zod)Object.defineProperty(M,"_zod",{value:{def:O,constr:I,traits:new Set},enumerable:!1});if(M._zod.traits.has(w))return;M._zod.traits.add(w),K(M,O);let D=I.prototype,X=Object.keys(D);for(let S=0;S<X.length;S++){let N=X[S];if(!(N in M))M[N]=D[N].bind(M)}}let P=W?.Parent??Object;class b extends P{}Object.defineProperty(b,"name",{value:w});function I(M){var O;let D=W?.Parent?new b:this;J(D,M),(O=D._zod).deferred??(O.deferred=[]);for(let X of D._zod.deferred)X();return D}return Object.defineProperty(I,"init",{value:J}),Object.defineProperty(I,Symbol.hasInstance,{value:(M)=>{if(W?.Parent&&M instanceof W.Parent)return!0;return M?._zod?.traits?.has(w)}}),Object.defineProperty(I,"name",{value:w}),I}var d0=Symbol("zod_brand");class ew extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class m2 extends Error{constructor(w){super(`Encountered unidirectional transform during encode: ${w}`);this.name="ZodEncodeError"}}var AK={};function gw(w){if(w)Object.assign(AK,w);return AK}var Pw={};eK(Pw,{unwrapMessage:()=>_2,uint8ArrayToHex:()=>U9,uint8ArrayToBase64url:()=>V9,uint8ArrayToBase64:()=>s4,stringifyPrimitive:()=>LK,slugify:()=>O1,shallowClone:()=>e4,safeExtend:()=>X9,required:()=>A9,randomString:()=>I9,propertyKeyTypes:()=>B1,promiseAllObject:()=>b9,primitiveTypes:()=>i4,prefixIssues:()=>e2,pick:()=>D9,partial:()=>$9,parsedType:()=>X1,optionalKeys:()=>N1,omit:()=>B9,objectClone:()=>W9,numKeys:()=>M9,nullish:()=>p2,normalizeParams:()=>e,mergeDefs:()=>iw,merge:()=>S9,jsonStringifyReplacer:()=>h2,joinValues:()=>YK,issue:()=>F2,isPlainObject:()=>X2,isObject:()=>z2,hexToUint8Array:()=>L9,getSizableOrigin:()=>t4,getParsedType:()=>G9,getLengthableOrigin:()=>i2,getEnumValues:()=>l2,getElementAtPath:()=>P9,floatSafeRemainder:()=>f4,finalizeIssue:()=>_w,extend:()=>N9,escapeRegex:()=>S2,esc:()=>QK,defineLazy:()=>Jw,createTransparentProxy:()=>O9,cloneDef:()=>J9,clone:()=>cw,cleanRegex:()=>f2,cleanEnum:()=>Y9,captureStackTrace:()=>VK,cached:()=>T2,base64urlToUint8Array:()=>Q9,base64ToUint8Array:()=>a4,assignProp:()=>w2,assertNotEqual:()=>a0,assertNever:()=>w9,assertIs:()=>s0,assertEqual:()=>t0,assert:()=>K9,allowsEval:()=>D1,aborted:()=>K2,NUMBER_FORMAT_RANGES:()=>n4,Class:()=>w6,BIGINT_FORMAT_RANGES:()=>d4});function t0(w){return w}function a0(w){return w}function s0(w){}function w9(w){throw Error("Unexpected value in exhaustive check")}function K9(w){}function l2(w){let K=Object.values(w).filter((J)=>typeof J==="number");return Object.entries(w).filter(([J,P])=>K.indexOf(+J)===-1).map(([J,P])=>P)}function YK(w,K="|"){return w.map((W)=>LK(W)).join(K)}function h2(w,K){if(typeof K==="bigint")return K.toString();return K}function T2(w){return{get value(){{let W=w();return Object.defineProperty(this,"value",{value:W}),W}throw Error("cached value already set")}}}function p2(w){return w===null||w===void 0}function f2(w){let K=w.startsWith("^")?1:0,W=w.endsWith("$")?w.length-1:w.length;return w.slice(K,W)}function f4(w,K){let W=(w.toString().split(".")[1]||"").length,J=K.toString(),P=(J.split(".")[1]||"").length;if(P===0&&/\d?e-\d?/.test(J)){let O=J.match(/\d?e-(\d?)/);if(O?.[1])P=Number.parseInt(O[1])}let b=W>P?W:P,I=Number.parseInt(w.toFixed(b).replace(".","")),M=Number.parseInt(K.toFixed(b).replace(".",""));return I%M/10**b}var p4=Symbol("evaluating");function Jw(w,K,W){let J=void 0;Object.defineProperty(w,K,{get(){if(J===p4)return;if(J===void 0)J=p4,J=W();return J},set(P){Object.defineProperty(w,K,{value:P})},configurable:!0})}function W9(w){return Object.create(Object.getPrototypeOf(w),Object.getOwnPropertyDescriptors(w))}function w2(w,K,W){Object.defineProperty(w,K,{value:W,writable:!0,enumerable:!0,configurable:!0})}function iw(...w){let K={};for(let W of w){let J=Object.getOwnPropertyDescriptors(W);Object.assign(K,J)}return Object.defineProperties({},K)}function J9(w){return iw(w._zod.def)}function P9(w,K){if(!K)return w;return K.reduce((W,J)=>W?.[J],w)}function b9(w){let K=Object.keys(w),W=K.map((J)=>w[J]);return Promise.all(W).then((J)=>{let P={};for(let b=0;b<K.length;b++)P[K[b]]=J[b];return P})}function I9(w=10){let W="";for(let J=0;J<w;J++)W+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return W}function QK(w){return JSON.stringify(w)}function O1(w){return w.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var VK="captureStackTrace"in Error?Error.captureStackTrace:(...w)=>{};function z2(w){return typeof w==="object"&&w!==null&&!Array.isArray(w)}var D1=T2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(w){return!1}});function X2(w){if(z2(w)===!1)return!1;let K=w.constructor;if(K===void 0)return!0;if(typeof K!=="function")return!0;let W=K.prototype;if(z2(W)===!1)return!1;if(Object.prototype.hasOwnProperty.call(W,"isPrototypeOf")===!1)return!1;return!0}function e4(w){if(X2(w))return{...w};if(Array.isArray(w))return[...w];return w}function M9(w){let K=0;for(let W in w)if(Object.prototype.hasOwnProperty.call(w,W))K++;return K}var G9=(w)=>{let K=typeof w;switch(K){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(w)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(w))return"array";if(w===null)return"null";if(w.then&&typeof w.then==="function"&&w.catch&&typeof w.catch==="function")return"promise";if(typeof Map<"u"&&w instanceof Map)return"map";if(typeof Set<"u"&&w instanceof Set)return"set";if(typeof Date<"u"&&w instanceof Date)return"date";if(typeof File<"u"&&w instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${K}`)}},B1=new Set(["string","number","symbol"]),i4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function S2(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cw(w,K,W){let J=new w._zod.constr(K??w._zod.def);if(!K||W?.parent)J._zod.parent=w;return J}function e(w){let K=w;if(!K)return{};if(typeof K==="string")return{error:()=>K};if(K?.message!==void 0){if(K?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");K.error=K.message}if(delete K.message,typeof K.error==="string")return{...K,error:()=>K.error};return K}function O9(w){let K;return new Proxy({},{get(W,J,P){return K??(K=w()),Reflect.get(K,J,P)},set(W,J,P,b){return K??(K=w()),Reflect.set(K,J,P,b)},has(W,J){return K??(K=w()),Reflect.has(K,J)},deleteProperty(W,J){return K??(K=w()),Reflect.deleteProperty(K,J)},ownKeys(W){return K??(K=w()),Reflect.ownKeys(K)},getOwnPropertyDescriptor(W,J){return K??(K=w()),Reflect.getOwnPropertyDescriptor(K,J)},defineProperty(W,J,P){return K??(K=w()),Reflect.defineProperty(K,J,P)}})}function LK(w){if(typeof w==="bigint")return w.toString()+"n";if(typeof w==="string")return`"${w}"`;return`${w}`}function N1(w){return Object.keys(w).filter((K)=>{return w[K]._zod.optin==="optional"&&w[K]._zod.optout==="optional"})}var n4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},d4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function D9(w,K){let W=w._zod.def,J=W.checks;if(J&&J.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let b=iw(w._zod.def,{get shape(){let I={};for(let M in K){if(!(M in W.shape))throw Error(`Unrecognized key: "${M}"`);if(!K[M])continue;I[M]=W.shape[M]}return w2(this,"shape",I),I},checks:[]});return cw(w,b)}function B9(w,K){let W=w._zod.def,J=W.checks;if(J&&J.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let b=iw(w._zod.def,{get shape(){let I={...w._zod.def.shape};for(let M in K){if(!(M in W.shape))throw Error(`Unrecognized key: "${M}"`);if(!K[M])continue;delete I[M]}return w2(this,"shape",I),I},checks:[]});return cw(w,b)}function N9(w,K){if(!X2(K))throw Error("Invalid input to extend: expected a plain object");let W=w._zod.def.checks;if(W&&W.length>0){let b=w._zod.def.shape;for(let I in K)if(Object.getOwnPropertyDescriptor(b,I)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let P=iw(w._zod.def,{get shape(){let b={...w._zod.def.shape,...K};return w2(this,"shape",b),b}});return cw(w,P)}function X9(w,K){if(!X2(K))throw Error("Invalid input to safeExtend: expected a plain object");let W=iw(w._zod.def,{get shape(){let J={...w._zod.def.shape,...K};return w2(this,"shape",J),J}});return cw(w,W)}function S9(w,K){let W=iw(w._zod.def,{get shape(){let J={...w._zod.def.shape,...K._zod.def.shape};return w2(this,"shape",J),J},get catchall(){return K._zod.def.catchall},checks:[]});return cw(w,W)}function $9(w,K,W){let P=K._zod.def.checks;if(P&&P.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let I=iw(K._zod.def,{get shape(){let M=K._zod.def.shape,O={...M};if(W)for(let D in W){if(!(D in M))throw Error(`Unrecognized key: "${D}"`);if(!W[D])continue;O[D]=w?new w({type:"optional",innerType:M[D]}):M[D]}else for(let D in M)O[D]=w?new w({type:"optional",innerType:M[D]}):M[D];return w2(this,"shape",O),O},checks:[]});return cw(K,I)}function A9(w,K,W){let J=iw(K._zod.def,{get shape(){let P=K._zod.def.shape,b={...P};if(W)for(let I in W){if(!(I in b))throw Error(`Unrecognized key: "${I}"`);if(!W[I])continue;b[I]=new w({type:"nonoptional",innerType:P[I]})}else for(let I in P)b[I]=new w({type:"nonoptional",innerType:P[I]});return w2(this,"shape",b),b}});return cw(K,J)}function K2(w,K=0){if(w.aborted===!0)return!0;for(let W=K;W<w.issues.length;W++)if(w.issues[W]?.continue!==!0)return!0;return!1}function e2(w,K){return K.map((W)=>{var J;return(J=W).path??(J.path=[]),W.path.unshift(w),W})}function _2(w){return typeof w==="string"?w:w?.message}function _w(w,K,W){let J={...w,path:w.path??[]};if(!w.message){let P=_2(w.inst?._zod.def?.error?.(w))??_2(K?.error?.(w))??_2(W.customError?.(w))??_2(W.localeError?.(w))??"Invalid input";J.message=P}if(delete J.inst,delete J.continue,!K?.reportInput)delete J.input;return J}function t4(w){if(w instanceof Set)return"set";if(w instanceof Map)return"map";if(w instanceof File)return"file";return"unknown"}function i2(w){if(Array.isArray(w))return"array";if(typeof w==="string")return"string";return"unknown"}function X1(w){let K=typeof w;switch(K){case"number":return Number.isNaN(w)?"nan":"number";case"object":{if(w===null)return"null";if(Array.isArray(w))return"array";let W=w;if(W&&Object.getPrototypeOf(W)!==Object.prototype&&"constructor"in W&&W.constructor)return W.constructor.name}}return K}function F2(...w){let[K,W,J]=w;if(typeof K==="string")return{message:K,code:"custom",input:W,inst:J};return{...K}}function Y9(w){return Object.entries(w).filter(([K,W])=>{return Number.isNaN(Number.parseInt(K,10))}).map((K)=>K[1])}function a4(w){let K=atob(w),W=new Uint8Array(K.length);for(let J=0;J<K.length;J++)W[J]=K.charCodeAt(J);return W}function s4(w){let K="";for(let W=0;W<w.length;W++)K+=String.fromCharCode(w[W]);return btoa(K)}function Q9(w){let K=w.replace(/-/g,"+").replace(/_/g,"/"),W="=".repeat((4-K.length%4)%4);return a4(K+W)}function V9(w){return s4(w).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function L9(w){let K=w.replace(/^0x/,"");if(K.length%2!==0)throw Error("Invalid hex string length");let W=new Uint8Array(K.length/2);for(let J=0;J<K.length;J+=2)W[J/2]=Number.parseInt(K.slice(J,J+2),16);return W}function U9(w){return Array.from(w).map((K)=>K.toString(16).padStart(2,"0")).join("")}class w6{constructor(...w){}}var K6=(w,K)=>{w.name="$ZodError",Object.defineProperty(w,"_zod",{value:w._zod,enumerable:!1}),Object.defineProperty(w,"issues",{value:K,enumerable:!1}),w.message=JSON.stringify(K,h2,2),Object.defineProperty(w,"toString",{value:()=>w.message,enumerable:!1})},UK=h("$ZodError",K6),S1=h("$ZodError",K6,{Parent:Error});function $1(w,K=(W)=>W.message){let W={},J=[];for(let P of w.issues)if(P.path.length>0)W[P.path[0]]=W[P.path[0]]||[],W[P.path[0]].push(K(P));else J.push(K(P));return{formErrors:J,fieldErrors:W}}function A1(w,K=(W)=>W.message){let W={_errors:[]},J=(P)=>{for(let b of P.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((I)=>J({issues:I}));else if(b.code==="invalid_key")J({issues:b.issues});else if(b.code==="invalid_element")J({issues:b.issues});else if(b.path.length===0)W._errors.push(K(b));else{let I=W,M=0;while(M<b.path.length){let O=b.path[M];if(M!==b.path.length-1)I[O]=I[O]||{_errors:[]};else I[O]=I[O]||{_errors:[]},I[O]._errors.push(K(b));I=I[O],M++}}};return J(w),W}var qK=(w)=>(K,W,J,P)=>{let b=J?Object.assign(J,{async:!1}):{async:!1},I=K._zod.run({value:W,issues:[]},b);if(I instanceof Promise)throw new ew;if(I.issues.length){let M=new(P?.Err??w)(I.issues.map((O)=>_w(O,b,gw())));throw VK(M,P?.callee),M}return I.value};var HK=(w)=>async(K,W,J,P)=>{let b=J?Object.assign(J,{async:!0}):{async:!0},I=K._zod.run({value:W,issues:[]},b);if(I instanceof Promise)I=await I;if(I.issues.length){let M=new(P?.Err??w)(I.issues.map((O)=>_w(O,b,gw())));throw VK(M,P?.callee),M}return I.value};var n2=(w)=>(K,W,J)=>{let P=J?{...J,async:!1}:{async:!1},b=K._zod.run({value:W,issues:[]},P);if(b instanceof Promise)throw new ew;return b.issues.length?{success:!1,error:new(w??UK)(b.issues.map((I)=>_w(I,P,gw())))}:{success:!0,data:b.value}},W6=n2(S1),d2=(w)=>async(K,W,J)=>{let P=J?Object.assign(J,{async:!0}):{async:!0},b=K._zod.run({value:W,issues:[]},P);if(b instanceof Promise)b=await b;return b.issues.length?{success:!1,error:new w(b.issues.map((I)=>_w(I,P,gw())))}:{success:!0,data:b.value}},J6=d2(S1),P6=(w)=>(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return qK(w)(K,W,P)};var b6=(w)=>(K,W,J)=>{return qK(w)(K,W,J)};var I6=(w)=>async(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return HK(w)(K,W,P)};var M6=(w)=>async(K,W,J)=>{return HK(w)(K,W,J)};var G6=(w)=>(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return n2(w)(K,W,P)};var O6=(w)=>(K,W,J)=>{return n2(w)(K,W,J)};var D6=(w)=>async(K,W,J)=>{let P=J?Object.assign(J,{direction:"backward"}):{direction:"backward"};return d2(w)(K,W,P)};var B6=(w)=>async(K,W,J)=>{return d2(w)(K,W,J)};var N6=/^[cC][^\s-]{8,}$/,X6=/^[0-9a-z]+$/,S6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$6=/^[0-9a-vA-V]{20}$/,A6=/^[A-Za-z0-9]{27}$/,Y6=/^[a-zA-Z0-9_-]{21}$/,Q6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var V6=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Y1=(w)=>{if(!w)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${w}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var L6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var H9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U6(){return new RegExp(H9,"u")}var q6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var z6=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,h6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Q1=/^[A-Za-z0-9_-]*$/;var R6=/^\+[1-9]\d{6,14}$/,E6="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",v6=new RegExp(`^${E6}$`);function Z6(w){return typeof w.precision==="number"?w.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":w.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${w.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function j6(w){return new RegExp(`^${Z6(w)}$`)}function k6(w){let K=Z6({precision:w.precision}),W=["Z"];if(w.local)W.push("");if(w.offset)W.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let J=`${K}(?:${W.join("|")})`;return new RegExp(`^${E6}T(?:${J})$`)}var g6=(w)=>{let K=w?`[\\s\\S]{${w?.minimum??0},${w?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${K}$`)};var c6=/^[^A-Z]*$/,C6=/^[^a-z]*$/;var jw=h("$ZodCheck",(w,K)=>{var W;w._zod??(w._zod={}),w._zod.def=K,(W=w._zod).onattach??(W.onattach=[])});var o6=h("$ZodCheckMaxLength",(w,K)=>{var W;jw.init(w,K),(W=w._zod.def).when??(W.when=(J)=>{let P=J.value;return!p2(P)&&P.length!==void 0}),w._zod.onattach.push((J)=>{let P=J._zod.bag.maximum??Number.POSITIVE_INFINITY;if(K.maximum<P)J._zod.bag.maximum=K.maximum}),w._zod.check=(J)=>{let P=J.value;if(P.length<=K.maximum)return;let I=i2(P);J.issues.push({origin:I,code:"too_big",maximum:K.maximum,inclusive:!0,input:P,inst:w,continue:!K.abort})}}),x6=h("$ZodCheckMinLength",(w,K)=>{var W;jw.init(w,K),(W=w._zod.def).when??(W.when=(J)=>{let P=J.value;return!p2(P)&&P.length!==void 0}),w._zod.onattach.push((J)=>{let P=J._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(K.minimum>P)J._zod.bag.minimum=K.minimum}),w._zod.check=(J)=>{let P=J.value;if(P.length>=K.minimum)return;let I=i2(P);J.issues.push({origin:I,code:"too_small",minimum:K.minimum,inclusive:!0,input:P,inst:w,continue:!K.abort})}}),r6=h("$ZodCheckLengthEquals",(w,K)=>{var W;jw.init(w,K),(W=w._zod.def).when??(W.when=(J)=>{let P=J.value;return!p2(P)&&P.length!==void 0}),w._zod.onattach.push((J)=>{let P=J._zod.bag;P.minimum=K.length,P.maximum=K.length,P.length=K.length}),w._zod.check=(J)=>{let P=J.value,b=P.length;if(b===K.length)return;let I=i2(P),M=b>K.length;J.issues.push({origin:I,...M?{code:"too_big",maximum:K.length}:{code:"too_small",minimum:K.length},inclusive:!0,exact:!0,input:J.value,inst:w,continue:!K.abort})}}),a2=h("$ZodCheckStringFormat",(w,K)=>{var W,J;if(jw.init(w,K),w._zod.onattach.push((P)=>{let b=P._zod.bag;if(b.format=K.format,K.pattern)b.patterns??(b.patterns=new Set),b.patterns.add(K.pattern)}),K.pattern)(W=w._zod).check??(W.check=(P)=>{if(K.pattern.lastIndex=0,K.pattern.test(P.value))return;P.issues.push({origin:"string",code:"invalid_format",format:K.format,input:P.value,...K.pattern?{pattern:K.pattern.toString()}:{},inst:w,continue:!K.abort})});else(J=w._zod).check??(J.check=()=>{})}),u6=h("$ZodCheckRegex",(w,K)=>{a2.init(w,K),w._zod.check=(W)=>{if(K.pattern.lastIndex=0,K.pattern.test(W.value))return;W.issues.push({origin:"string",code:"invalid_format",format:"regex",input:W.value,pattern:K.pattern.toString(),inst:w,continue:!K.abort})}}),y6=h("$ZodCheckLowerCase",(w,K)=>{K.pattern??(K.pattern=c6),a2.init(w,K)}),m6=h("$ZodCheckUpperCase",(w,K)=>{K.pattern??(K.pattern=C6),a2.init(w,K)}),_6=h("$ZodCheckIncludes",(w,K)=>{jw.init(w,K);let W=S2(K.includes),J=new RegExp(typeof K.position==="number"?`^.{${K.position}}${W}`:W);K.pattern=J,w._zod.onattach.push((P)=>{let b=P._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(J)}),w._zod.check=(P)=>{if(P.value.includes(K.includes,K.position))return;P.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:K.includes,input:P.value,inst:w,continue:!K.abort})}}),l6=h("$ZodCheckStartsWith",(w,K)=>{jw.init(w,K);let W=new RegExp(`^${S2(K.prefix)}.*`);K.pattern??(K.pattern=W),w._zod.onattach.push((J)=>{let P=J._zod.bag;P.patterns??(P.patterns=new Set),P.patterns.add(W)}),w._zod.check=(J)=>{if(J.value.startsWith(K.prefix))return;J.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:K.prefix,input:J.value,inst:w,continue:!K.abort})}}),T6=h("$ZodCheckEndsWith",(w,K)=>{jw.init(w,K);let W=new RegExp(`.*${S2(K.suffix)}$`);K.pattern??(K.pattern=W),w._zod.onattach.push((J)=>{let P=J._zod.bag;P.patterns??(P.patterns=new Set),P.patterns.add(W)}),w._zod.check=(J)=>{if(J.value.endsWith(K.suffix))return;J.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:K.suffix,input:J.value,inst:w,continue:!K.abort})}});var p6=h("$ZodCheckOverwrite",(w,K)=>{jw.init(w,K),w._zod.check=(W)=>{W.value=K.tx(W.value)}});class V1{constructor(w=[]){if(this.content=[],this.indent=0,this)this.args=w}indented(w){this.indent+=1,w(this),this.indent-=1}write(w){if(typeof w==="function"){w(this,{execution:"sync"}),w(this,{execution:"async"});return}let W=w.split(`
|
|
19
|
+
`).filter((b)=>b),J=Math.min(...W.map((b)=>b.length-b.trimStart().length)),P=W.map((b)=>b.slice(J)).map((b)=>" ".repeat(this.indent*2)+b);for(let b of P)this.content.push(b)}compile(){let w=Function,K=this?.args,J=[...(this?.content??[""]).map((P)=>` ${P}`)];return new w(...K,J.join(`
|
|
20
|
+
`))}}var e6={major:4,minor:3,patch:6};var Sw=h("$ZodType",(w,K)=>{var W;w??(w={}),w._zod.def=K,w._zod.bag=w._zod.bag||{},w._zod.version=e6;let J=[...w._zod.def.checks??[]];if(w._zod.traits.has("$ZodCheck"))J.unshift(w);for(let P of J)for(let b of P._zod.onattach)b(w);if(J.length===0)(W=w._zod).deferred??(W.deferred=[]),w._zod.deferred?.push(()=>{w._zod.run=w._zod.parse});else{let P=(I,M,O)=>{let D=K2(I),X;for(let S of M){if(S._zod.def.when){if(!S._zod.def.when(I))continue}else if(D)continue;let N=I.issues.length,L=S._zod.check(I);if(L instanceof Promise&&O?.async===!1)throw new ew;if(X||L instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await L,I.issues.length===N)return;if(!D)D=K2(I,N)});else{if(I.issues.length===N)continue;if(!D)D=K2(I,N)}}if(X)return X.then(()=>{return I});return I},b=(I,M,O)=>{if(K2(I))return I.aborted=!0,I;let D=P(M,J,O);if(D instanceof Promise){if(O.async===!1)throw new ew;return D.then((X)=>w._zod.parse(X,O))}return w._zod.parse(D,O)};w._zod.run=(I,M)=>{if(M.skipChecks)return w._zod.parse(I,M);if(M.direction==="backward"){let D=w._zod.parse({value:I.value,issues:[]},{...M,skipChecks:!0});if(D instanceof Promise)return D.then((X)=>{return b(X,I,M)});return b(D,I,M)}let O=w._zod.parse(I,M);if(O instanceof Promise){if(M.async===!1)throw new ew;return O.then((D)=>P(D,J,M))}return P(O,J,M)}}Jw(w,"~standard",()=>({validate:(P)=>{try{let b=W6(w,P);return b.success?{value:b.data}:{issues:b.error?.issues}}catch(b){return J6(w,P).then((I)=>I.success?{value:I.data}:{issues:I.error?.issues})}},vendor:"zod",version:1}))}),FK=h("$ZodString",(w,K)=>{Sw.init(w,K),w._zod.pattern=[...w?._zod.bag?.patterns??[]].pop()??g6(w._zod.bag),w._zod.parse=(W,J)=>{if(K.coerce)try{W.value=String(W.value)}catch(P){}if(typeof W.value==="string")return W;return W.issues.push({expected:"string",code:"invalid_type",input:W.value,inst:w}),W}}),Gw=h("$ZodStringFormat",(w,K)=>{a2.init(w,K),FK.init(w,K)}),W8=h("$ZodGUID",(w,K)=>{K.pattern??(K.pattern=V6),Gw.init(w,K)}),J8=h("$ZodUUID",(w,K)=>{if(K.version){let J={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[K.version];if(J===void 0)throw Error(`Invalid UUID version: "${K.version}"`);K.pattern??(K.pattern=Y1(J))}else K.pattern??(K.pattern=Y1());Gw.init(w,K)}),P8=h("$ZodEmail",(w,K)=>{K.pattern??(K.pattern=L6),Gw.init(w,K)}),b8=h("$ZodURL",(w,K)=>{Gw.init(w,K),w._zod.check=(W)=>{try{let J=W.value.trim(),P=new URL(J);if(K.hostname){if(K.hostname.lastIndex=0,!K.hostname.test(P.hostname))W.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:K.hostname.source,input:W.value,inst:w,continue:!K.abort})}if(K.protocol){if(K.protocol.lastIndex=0,!K.protocol.test(P.protocol.endsWith(":")?P.protocol.slice(0,-1):P.protocol))W.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:K.protocol.source,input:W.value,inst:w,continue:!K.abort})}if(K.normalize)W.value=P.href;else W.value=J;return}catch(J){W.issues.push({code:"invalid_format",format:"url",input:W.value,inst:w,continue:!K.abort})}}}),I8=h("$ZodEmoji",(w,K)=>{K.pattern??(K.pattern=U6()),Gw.init(w,K)}),M8=h("$ZodNanoID",(w,K)=>{K.pattern??(K.pattern=Y6),Gw.init(w,K)}),G8=h("$ZodCUID",(w,K)=>{K.pattern??(K.pattern=N6),Gw.init(w,K)}),O8=h("$ZodCUID2",(w,K)=>{K.pattern??(K.pattern=X6),Gw.init(w,K)}),D8=h("$ZodULID",(w,K)=>{K.pattern??(K.pattern=S6),Gw.init(w,K)}),B8=h("$ZodXID",(w,K)=>{K.pattern??(K.pattern=$6),Gw.init(w,K)}),N8=h("$ZodKSUID",(w,K)=>{K.pattern??(K.pattern=A6),Gw.init(w,K)}),X8=h("$ZodISODateTime",(w,K)=>{K.pattern??(K.pattern=k6(K)),Gw.init(w,K)}),S8=h("$ZodISODate",(w,K)=>{K.pattern??(K.pattern=v6),Gw.init(w,K)}),$8=h("$ZodISOTime",(w,K)=>{K.pattern??(K.pattern=j6(K)),Gw.init(w,K)}),A8=h("$ZodISODuration",(w,K)=>{K.pattern??(K.pattern=Q6),Gw.init(w,K)}),Y8=h("$ZodIPv4",(w,K)=>{K.pattern??(K.pattern=q6),Gw.init(w,K),w._zod.bag.format="ipv4"}),Q8=h("$ZodIPv6",(w,K)=>{K.pattern??(K.pattern=H6),Gw.init(w,K),w._zod.bag.format="ipv6",w._zod.check=(W)=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:"invalid_format",format:"ipv6",input:W.value,inst:w,continue:!K.abort})}}});var V8=h("$ZodCIDRv4",(w,K)=>{K.pattern??(K.pattern=z6),Gw.init(w,K)}),L8=h("$ZodCIDRv6",(w,K)=>{K.pattern??(K.pattern=h6),Gw.init(w,K),w._zod.check=(W)=>{let J=W.value.split("/");try{if(J.length!==2)throw Error();let[P,b]=J;if(!b)throw Error();let I=Number(b);if(`${I}`!==b)throw Error();if(I<0||I>128)throw Error();new URL(`http://[${P}]`)}catch{W.issues.push({code:"invalid_format",format:"cidrv6",input:W.value,inst:w,continue:!K.abort})}}});function U8(w){if(w==="")return!0;if(w.length%4!==0)return!1;try{return atob(w),!0}catch{return!1}}var q8=h("$ZodBase64",(w,K)=>{K.pattern??(K.pattern=F6),Gw.init(w,K),w._zod.bag.contentEncoding="base64",w._zod.check=(W)=>{if(U8(W.value))return;W.issues.push({code:"invalid_format",format:"base64",input:W.value,inst:w,continue:!K.abort})}});function z9(w){if(!Q1.test(w))return!1;let K=w.replace(/[-_]/g,(J)=>J==="-"?"+":"/"),W=K.padEnd(Math.ceil(K.length/4)*4,"=");return U8(W)}var H8=h("$ZodBase64URL",(w,K)=>{K.pattern??(K.pattern=Q1),Gw.init(w,K),w._zod.bag.contentEncoding="base64url",w._zod.check=(W)=>{if(z9(W.value))return;W.issues.push({code:"invalid_format",format:"base64url",input:W.value,inst:w,continue:!K.abort})}}),z8=h("$ZodE164",(w,K)=>{K.pattern??(K.pattern=R6),Gw.init(w,K)});function h9(w,K=null){try{let W=w.split(".");if(W.length!==3)return!1;let[J]=W;if(!J)return!1;let P=JSON.parse(atob(J));if("typ"in P&&P?.typ!=="JWT")return!1;if(!P.alg)return!1;if(K&&(!("alg"in P)||P.alg!==K))return!1;return!0}catch{return!1}}var h8=h("$ZodJWT",(w,K)=>{Gw.init(w,K),w._zod.check=(W)=>{if(h9(W.value,K.alg))return;W.issues.push({code:"invalid_format",format:"jwt",input:W.value,inst:w,continue:!K.abort})}});var F8=h("$ZodUnknown",(w,K)=>{Sw.init(w,K),w._zod.parse=(W)=>W}),R8=h("$ZodNever",(w,K)=>{Sw.init(w,K),w._zod.parse=(W,J)=>{return W.issues.push({expected:"never",code:"invalid_type",input:W.value,inst:w}),W}});function i6(w,K,W){if(w.issues.length)K.issues.push(...e2(W,w.issues));K.value[W]=w.value}var E8=h("$ZodArray",(w,K)=>{Sw.init(w,K),w._zod.parse=(W,J)=>{let P=W.value;if(!Array.isArray(P))return W.issues.push({expected:"array",code:"invalid_type",input:P,inst:w}),W;W.value=Array(P.length);let b=[];for(let I=0;I<P.length;I++){let M=P[I],O=K.element._zod.run({value:M,issues:[]},J);if(O instanceof Promise)b.push(O.then((D)=>i6(D,W,I)));else i6(O,W,I)}if(b.length)return Promise.all(b).then(()=>W);return W}});function hK(w,K,W,J,P){if(w.issues.length){if(P&&!(W in J))return;K.issues.push(...e2(W,w.issues))}if(w.value===void 0){if(W in J)K.value[W]=void 0}else K.value[W]=w.value}function v8(w){let K=Object.keys(w.shape);for(let J of K)if(!w.shape?.[J]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${J}": expected a Zod schema`);let W=N1(w.shape);return{...w,keys:K,keySet:new Set(K),numKeys:K.length,optionalKeys:new Set(W)}}function Z8(w,K,W,J,P,b){let I=[],M=P.keySet,O=P.catchall._zod,D=O.def.type,X=O.optout==="optional";for(let S in K){if(M.has(S))continue;if(D==="never"){I.push(S);continue}let N=O.run({value:K[S],issues:[]},J);if(N instanceof Promise)w.push(N.then((L)=>hK(L,W,S,K,X)));else hK(N,W,S,K,X)}if(I.length)W.issues.push({code:"unrecognized_keys",keys:I,input:K,inst:b});if(!w.length)return W;return Promise.all(w).then(()=>{return W})}var F9=h("$ZodObject",(w,K)=>{if(Sw.init(w,K),!Object.getOwnPropertyDescriptor(K,"shape")?.get){let M=K.shape;Object.defineProperty(K,"shape",{get:()=>{let O={...M};return Object.defineProperty(K,"shape",{value:O}),O}})}let J=T2(()=>v8(K));Jw(w._zod,"propValues",()=>{let M=K.shape,O={};for(let D in M){let X=M[D]._zod;if(X.values){O[D]??(O[D]=new Set);for(let S of X.values)O[D].add(S)}}return O});let P=z2,b=K.catchall,I;w._zod.parse=(M,O)=>{I??(I=J.value);let D=M.value;if(!P(D))return M.issues.push({expected:"object",code:"invalid_type",input:D,inst:w}),M;M.value={};let X=[],S=I.shape;for(let N of I.keys){let L=S[N],g=L._zod.optout==="optional",B=L._zod.run({value:D[N],issues:[]},O);if(B instanceof Promise)X.push(B.then((E)=>hK(E,M,N,D,g)));else hK(B,M,N,D,g)}if(!b)return X.length?Promise.all(X).then(()=>M):M;return Z8(X,D,M,O,J.value,w)}}),j8=h("$ZodObjectJIT",(w,K)=>{F9.init(w,K);let W=w._zod.parse,J=T2(()=>v8(K)),P=(N)=>{let L=new V1(["shape","payload","ctx"]),g=J.value,B=(C)=>{let R=QK(C);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};L.write("const input = payload.value;");let E=Object.create(null),G=0;for(let C of g.keys)E[C]=`key_${G++}`;L.write("const newResult = {};");for(let C of g.keys){let R=E[C],Z=QK(C),r=N[C]?._zod?.optout==="optional";if(L.write(`const ${R} = ${B(C)};`),r)L.write(`
|
|
21
|
+
if (${R}.issues.length) {
|
|
22
22
|
if (${Z} in input) {
|
|
23
|
-
payload.issues = payload.issues.concat(${
|
|
23
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
24
24
|
...iss,
|
|
25
25
|
path: iss.path ? [${Z}, ...iss.path] : [${Z}]
|
|
26
26
|
})));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if (${
|
|
30
|
+
if (${R}.value === undefined) {
|
|
31
31
|
if (${Z} in input) {
|
|
32
32
|
newResult[${Z}] = undefined;
|
|
33
33
|
}
|
|
34
34
|
} else {
|
|
35
|
-
newResult[${Z}] = ${
|
|
35
|
+
newResult[${Z}] = ${R}.value;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
`);else L.write(`
|
|
39
|
-
if (${
|
|
40
|
-
payload.issues = payload.issues.concat(${
|
|
39
|
+
if (${R}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
41
41
|
...iss,
|
|
42
42
|
path: iss.path ? [${Z}, ...iss.path] : [${Z}]
|
|
43
43
|
})));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
if (${
|
|
46
|
+
if (${R}.value === undefined) {
|
|
47
47
|
if (${Z} in input) {
|
|
48
48
|
newResult[${Z}] = undefined;
|
|
49
49
|
}
|
|
50
50
|
} else {
|
|
51
|
-
newResult[${Z}] = ${
|
|
51
|
+
newResult[${Z}] = ${R}.value;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
`)}L.write("payload.value = newResult;"),L.write("return payload;");let u=L.compile();return(o,F)=>u(B,o,F)},I,b=q2,D=!$K.jitless,M=D&&M1.value,N=K.catchall,Q;w._zod.parse=(B,L)=>{Q??(Q=J.value);let g=B.value;if(!b(g))return B.issues.push({expected:"object",code:"invalid_type",input:g,inst:w}),B;if(D&&M&&L?.async===!1&&L.jitless!==!0){if(!I)I=P(K.shape);if(B=I(B,L),!N)return B;return j8([],g,B,L,Q,w)}return W(B,L)}});function n6(w,K,W,J){for(let I of w)if(I.issues.length===0)return K.value=I.value,K;let P=w.filter((I)=>!K2(I));if(P.length===1)return K.value=P[0].value,P[0];return K.issues.push({code:"invalid_union",input:K.value,inst:W,errors:w.map((I)=>I.issues.map((b)=>mw(b,J,gw())))}),K}var k8=h("$ZodUnion",(w,K)=>{Nw.init(w,K),Iw(w._zod,"optin",()=>K.options.some((P)=>P._zod.optin==="optional")?"optional":void 0),Iw(w._zod,"optout",()=>K.options.some((P)=>P._zod.optout==="optional")?"optional":void 0),Iw(w._zod,"values",()=>{if(K.options.every((P)=>P._zod.values))return new Set(K.options.flatMap((P)=>Array.from(P._zod.values)));return}),Iw(w._zod,"pattern",()=>{if(K.options.every((P)=>P._zod.pattern)){let P=K.options.map((I)=>I._zod.pattern);return new RegExp(`^(${P.map((I)=>e2(I.source)).join("|")})$`)}return});let W=K.options.length===1,J=K.options[0]._zod.run;w._zod.parse=(P,I)=>{if(W)return J(P,I);let b=!1,D=[];for(let A of K.options){let M=A._zod.run({value:P.value,issues:[]},I);if(M instanceof Promise)D.push(M),b=!0;else{if(M.issues.length===0)return M;D.push(M)}}if(!b)return n6(D,P,w,I);return Promise.all(D).then((A)=>{return n6(A,P,w,I)})}});var g8=h("$ZodIntersection",(w,K)=>{Nw.init(w,K),w._zod.parse=(W,J)=>{let P=W.value,I=K.left._zod.run({value:P,issues:[]},J),b=K.right._zod.run({value:P,issues:[]},J);if(I instanceof Promise||b instanceof Promise)return Promise.all([I,b]).then(([A,M])=>{return d6(W,A,M)});return d6(W,I,b)}});function L1(w,K){if(w===K)return{valid:!0,data:w};if(w instanceof Date&&K instanceof Date&&+w===+K)return{valid:!0,data:w};if(N2(w)&&N2(K)){let W=Object.keys(K),J=Object.keys(w).filter((I)=>W.indexOf(I)!==-1),P={...w,...K};for(let I of J){let b=L1(w[I],K[I]);if(!b.valid)return{valid:!1,mergeErrorPath:[I,...b.mergeErrorPath]};P[I]=b.data}return{valid:!0,data:P}}if(Array.isArray(w)&&Array.isArray(K)){if(w.length!==K.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let J=0;J<w.length;J++){let P=w[J],I=K[J],b=L1(P,I);if(!b.valid)return{valid:!1,mergeErrorPath:[J,...b.mergeErrorPath]};W.push(b.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function d6(w,K,W){let J=new Map,P;for(let D of K.issues)if(D.code==="unrecognized_keys"){P??(P=D);for(let A of D.keys){if(!J.has(A))J.set(A,{});J.get(A).l=!0}}else w.issues.push(D);for(let D of W.issues)if(D.code==="unrecognized_keys")for(let A of D.keys){if(!J.has(A))J.set(A,{});J.get(A).r=!0}else w.issues.push(D);let I=[...J].filter(([,D])=>D.l&&D.r).map(([D])=>D);if(I.length&&P)w.issues.push({...P,keys:I});if(K2(w))return w;let b=L1(K.value,W.value);if(!b.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return w.value=b.data,w}var C8=h("$ZodEnum",(w,K)=>{Nw.init(w,K);let W=T2(K.entries),J=new Set(W);w._zod.values=J,w._zod.pattern=new RegExp(`^(${W.filter((P)=>O1.has(typeof P)).map((P)=>typeof P==="string"?Q2(P):P.toString()).join("|")})$`),w._zod.parse=(P,I)=>{let b=P.value;if(J.has(b))return P;return P.issues.push({code:"invalid_value",values:W,input:b,inst:w}),P}});var o8=h("$ZodTransform",(w,K)=>{Nw.init(w,K),w._zod.parse=(W,J)=>{if(J.direction==="backward")throw new y2(w.constructor.name);let P=K.transform(W.value,W);if(J.async)return(P instanceof Promise?P:Promise.resolve(P)).then((b)=>{return W.value=b,W});if(P instanceof Promise)throw new fw;return W.value=P,W}});function t6(w,K){if(w.issues.length&&K===void 0)return{issues:[],value:void 0};return w}var E1=h("$ZodOptional",(w,K)=>{Nw.init(w,K),w._zod.optin="optional",w._zod.optout="optional",Iw(w._zod,"values",()=>{return K.innerType._zod.values?new Set([...K.innerType._zod.values,void 0]):void 0}),Iw(w._zod,"pattern",()=>{let W=K.innerType._zod.pattern;return W?new RegExp(`^(${e2(W.source)})?$`):void 0}),w._zod.parse=(W,J)=>{if(K.innerType._zod.optin==="optional"){let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((I)=>t6(I,W.value));return t6(P,W.value)}if(W.value===void 0)return W;return K.innerType._zod.run(W,J)}}),x8=h("$ZodExactOptional",(w,K)=>{E1.init(w,K),Iw(w._zod,"values",()=>K.innerType._zod.values),Iw(w._zod,"pattern",()=>K.innerType._zod.pattern),w._zod.parse=(W,J)=>{return K.innerType._zod.run(W,J)}}),r8=h("$ZodNullable",(w,K)=>{Nw.init(w,K),Iw(w._zod,"optin",()=>K.innerType._zod.optin),Iw(w._zod,"optout",()=>K.innerType._zod.optout),Iw(w._zod,"pattern",()=>{let W=K.innerType._zod.pattern;return W?new RegExp(`^(${e2(W.source)}|null)$`):void 0}),Iw(w._zod,"values",()=>{return K.innerType._zod.values?new Set([...K.innerType._zod.values,null]):void 0}),w._zod.parse=(W,J)=>{if(W.value===null)return W;return K.innerType._zod.run(W,J)}}),c8=h("$ZodDefault",(w,K)=>{Nw.init(w,K),w._zod.optin="optional",Iw(w._zod,"values",()=>K.innerType._zod.values),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);if(W.value===void 0)return W.value=K.defaultValue,W;let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((I)=>a6(I,K));return a6(P,K)}});function a6(w,K){if(w.value===void 0)w.value=K.defaultValue;return w}var _8=h("$ZodPrefault",(w,K)=>{Nw.init(w,K),w._zod.optin="optional",Iw(w._zod,"values",()=>K.innerType._zod.values),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);if(W.value===void 0)W.value=K.defaultValue;return K.innerType._zod.run(W,J)}}),u8=h("$ZodNonOptional",(w,K)=>{Nw.init(w,K),Iw(w._zod,"values",()=>{let W=K.innerType._zod.values;return W?new Set([...W].filter((J)=>J!==void 0)):void 0}),w._zod.parse=(W,J)=>{let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((I)=>s6(I,w));return s6(P,w)}});function s6(w,K){if(!w.issues.length&&w.value===void 0)w.issues.push({code:"invalid_type",expected:"nonoptional",input:w.value,inst:K});return w}var y8=h("$ZodCatch",(w,K)=>{Nw.init(w,K),Iw(w._zod,"optin",()=>K.innerType._zod.optin),Iw(w._zod,"optout",()=>K.innerType._zod.optout),Iw(w._zod,"values",()=>K.innerType._zod.values),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((I)=>{if(W.value=I.value,I.issues.length)W.value=K.catchValue({...W,error:{issues:I.issues.map((b)=>mw(b,J,gw()))},input:W.value}),W.issues=[];return W});if(W.value=P.value,P.issues.length)W.value=K.catchValue({...W,error:{issues:P.issues.map((I)=>mw(I,J,gw()))},input:W.value}),W.issues=[];return W}});var m8=h("$ZodPipe",(w,K)=>{Nw.init(w,K),Iw(w._zod,"values",()=>K.in._zod.values),Iw(w._zod,"optin",()=>K.in._zod.optin),Iw(w._zod,"optout",()=>K.out._zod.optout),Iw(w._zod,"propValues",()=>K.in._zod.propValues),w._zod.parse=(W,J)=>{if(J.direction==="backward"){let I=K.out._zod.run(W,J);if(I instanceof Promise)return I.then((b)=>qK(b,K.in,J));return qK(I,K.in,J)}let P=K.in._zod.run(W,J);if(P instanceof Promise)return P.then((I)=>qK(I,K.out,J));return qK(P,K.out,J)}});function qK(w,K,W){if(w.issues.length)return w.aborted=!0,w;return K._zod.run({value:w.value,issues:w.issues},W)}var T8=h("$ZodReadonly",(w,K)=>{Nw.init(w,K),Iw(w._zod,"propValues",()=>K.innerType._zod.propValues),Iw(w._zod,"values",()=>K.innerType._zod.values),Iw(w._zod,"optin",()=>K.innerType?._zod?.optin),Iw(w._zod,"optout",()=>K.innerType?._zod?.optout),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then(w8);return w8(P)}});function w8(w){return w.value=Object.freeze(w.value),w}var l8=h("$ZodCustom",(w,K)=>{jw.init(w,K),Nw.init(w,K),w._zod.parse=(W,J)=>{return W},w._zod.check=(W)=>{let J=W.value,P=K.fn(J);if(P instanceof Promise)return P.then((I)=>K8(I,W,J,w));K8(P,W,J,w);return}});function K8(w,K,W,J){if(!w){let P={code:"custom",input:W,inst:J,path:[...J._zod.def.path??[]],continue:!J._zod.def.abort};if(J._zod.def.params)P.params=J._zod.def.params;K.issues.push(z2(P))}}var U9=()=>{let w={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function K(P){return w[P]??null}let W={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},J={nan:"NaN"};return(P)=>{switch(P.code){case"invalid_type":{let I=J[P.expected]??P.expected,b=N1(P.input),D=J[b]??b;return`Invalid input: expected ${I}, received ${D}`}case"invalid_value":if(P.values.length===1)return`Invalid input: expected ${LK(P.values[0])}`;return`Invalid option: expected one of ${YK(P.values,"|")}`;case"too_big":{let I=P.inclusive?"<=":"<",b=K(P.origin);if(b)return`Too big: expected ${P.origin??"value"} to have ${I}${P.maximum.toString()} ${b.unit??"elements"}`;return`Too big: expected ${P.origin??"value"} to be ${I}${P.maximum.toString()}`}case"too_small":{let I=P.inclusive?">=":">",b=K(P.origin);if(b)return`Too small: expected ${P.origin} to have ${I}${P.minimum.toString()} ${b.unit}`;return`Too small: expected ${P.origin} to be ${I}${P.minimum.toString()}`}case"invalid_format":{let I=P;if(I.format==="starts_with")return`Invalid string: must start with "${I.prefix}"`;if(I.format==="ends_with")return`Invalid string: must end with "${I.suffix}"`;if(I.format==="includes")return`Invalid string: must include "${I.includes}"`;if(I.format==="regex")return`Invalid string: must match pattern ${I.pattern}`;return`Invalid ${W[I.format]??P.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${P.divisor}`;case"unrecognized_keys":return`Unrecognized key${P.keys.length>1?"s":""}: ${YK(P.keys,", ")}`;case"invalid_key":return`Invalid key in ${P.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${P.origin}`;default:return"Invalid input"}}};function U1(){return{localeError:U9()}}var p8,H9=Symbol("ZodOutput"),q9=Symbol("ZodInput");class e8{constructor(){this._map=new WeakMap,this._idmap=new Map}add(w,...K){let W=K[0];if(this._map.set(w,W),W&&typeof W==="object"&&"id"in W)this._idmap.set(W.id,w);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(w){let K=this._map.get(w);if(K&&typeof K==="object"&&"id"in K)this._idmap.delete(K.id);return this._map.delete(w),this}get(w){let K=w._zod.parent;if(K){let W={...this.get(K)??{}};delete W.id;let J={...W,...this._map.get(w)};return Object.keys(J).length?J:void 0}return this._map.get(w)}has(w){return this._map.has(w)}}function f8(){return new e8}(p8=globalThis).__zod_globalRegistry??(p8.__zod_globalRegistry=f8());var W2=globalThis.__zod_globalRegistry;function i8(w,K){return new w({type:"string",...f(K)})}function H1(w,K){return new w({type:"string",format:"email",check:"string_format",abort:!1,...f(K)})}function q1(w,K){return new w({type:"string",format:"guid",check:"string_format",abort:!1,...f(K)})}function n8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,...f(K)})}function d8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...f(K)})}function t8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...f(K)})}function a8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...f(K)})}function s8(w,K){return new w({type:"string",format:"url",check:"string_format",abort:!1,...f(K)})}function w3(w,K){return new w({type:"string",format:"emoji",check:"string_format",abort:!1,...f(K)})}function K3(w,K){return new w({type:"string",format:"nanoid",check:"string_format",abort:!1,...f(K)})}function W3(w,K){return new w({type:"string",format:"cuid",check:"string_format",abort:!1,...f(K)})}function J3(w,K){return new w({type:"string",format:"cuid2",check:"string_format",abort:!1,...f(K)})}function P3(w,K){return new w({type:"string",format:"ulid",check:"string_format",abort:!1,...f(K)})}function I3(w,K){return new w({type:"string",format:"xid",check:"string_format",abort:!1,...f(K)})}function b3(w,K){return new w({type:"string",format:"ksuid",check:"string_format",abort:!1,...f(K)})}function D3(w,K){return new w({type:"string",format:"ipv4",check:"string_format",abort:!1,...f(K)})}function G3(w,K){return new w({type:"string",format:"ipv6",check:"string_format",abort:!1,...f(K)})}function A3(w,K){return new w({type:"string",format:"cidrv4",check:"string_format",abort:!1,...f(K)})}function M3(w,K){return new w({type:"string",format:"cidrv6",check:"string_format",abort:!1,...f(K)})}function O3(w,K){return new w({type:"string",format:"base64",check:"string_format",abort:!1,...f(K)})}function B3(w,K){return new w({type:"string",format:"base64url",check:"string_format",abort:!1,...f(K)})}function N3(w,K){return new w({type:"string",format:"e164",check:"string_format",abort:!1,...f(K)})}function h1(w,K){return new w({type:"string",format:"jwt",check:"string_format",abort:!1,...f(K)})}function Q3(w,K){return new w({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...f(K)})}function S3(w,K){return new w({type:"string",format:"date",check:"string_format",...f(K)})}function $3(w,K){return new w({type:"string",format:"time",check:"string_format",precision:null,...f(K)})}function Y3(w,K){return new w({type:"string",format:"duration",check:"string_format",...f(K)})}function X3(w){return new w({type:"unknown"})}function V3(w,K){return new w({type:"never",...f(K)})}function FK(w,K){return new x6({check:"max_length",...f(K),maximum:w})}function F2(w,K){return new r6({check:"min_length",...f(K),minimum:w})}function RK(w,K){return new c6({check:"length_equals",...f(K),length:w})}function z1(w,K){return new _6({check:"string_format",format:"regex",...f(K),pattern:w})}function F1(w){return new u6({check:"string_format",format:"lowercase",...f(w)})}function R1(w){return new y6({check:"string_format",format:"uppercase",...f(w)})}function v1(w,K){return new m6({check:"string_format",format:"includes",...f(K),includes:w})}function j1(w,K){return new T6({check:"string_format",format:"starts_with",...f(K),prefix:w})}function Z1(w,K){return new l6({check:"string_format",format:"ends_with",...f(K),suffix:w})}function J2(w){return new p6({check:"overwrite",tx:w})}function k1(w){return J2((K)=>K.normalize(w))}function g1(){return J2((w)=>w.trim())}function C1(){return J2((w)=>w.toLowerCase())}function o1(){return J2((w)=>w.toUpperCase())}function x1(){return J2((w)=>A1(w))}function L3(w,K,W){return new w({type:"array",element:K,...f(W)})}function E3(w,K,W){return new w({type:"custom",check:"custom",fn:K,...f(W)})}function U3(w){let K=h9((W)=>{return W.addIssue=(J)=>{if(typeof J==="string")W.issues.push(z2(J,W.value,K._zod.def));else{let P=J;if(P.fatal)P.continue=!1;P.code??(P.code="custom"),P.input??(P.input=W.value),P.inst??(P.inst=K),P.continue??(P.continue=!K._zod.def.abort),W.issues.push(z2(P))}},w(W.value,W)});return K}function h9(w,K){let W=new jw({check:"custom",...f(K)});return W._zod.check=w,W}function r1(w){let K=w?.target??"draft-2020-12";if(K==="draft-4")K="draft-04";if(K==="draft-7")K="draft-07";return{processors:w.processors??{},metadataRegistry:w?.metadata??W2,target:K,unrepresentable:w?.unrepresentable??"throw",override:w?.override??(()=>{}),io:w?.io??"output",counter:0,seen:new Map,cycles:w?.cycles??"ref",reused:w?.reused??"inline",external:w?.external??void 0}}function $w(w,K,W={path:[],schemaPath:[]}){var J;let P=w._zod.def,I=K.seen.get(w);if(I){if(I.count++,W.schemaPath.includes(w))I.cycle=W.path;return I.schema}let b={schema:{},count:1,cycle:void 0,path:W.path};K.seen.set(w,b);let D=w._zod.toJSONSchema?.();if(D)b.schema=D;else{let N={...W,schemaPath:[...W.schemaPath,w],path:W.path};if(w._zod.processJSONSchema)w._zod.processJSONSchema(K,b.schema,N);else{let B=b.schema,L=K.processors[P.type];if(!L)throw Error(`[toJSONSchema]: Non-representable type encountered: ${P.type}`);L(w,K,B,N)}let Q=w._zod.parent;if(Q){if(!b.ref)b.ref=Q;$w(Q,K,N),K.seen.get(Q).isParent=!0}}let A=K.metadataRegistry.get(w);if(A)Object.assign(b.schema,A);if(K.io==="input"&&zw(w))delete b.schema.examples,delete b.schema.default;if(K.io==="input"&&b.schema._prefault)(J=b.schema).default??(J.default=b.schema._prefault);return delete b.schema._prefault,K.seen.get(w).schema}function c1(w,K){let W=w.seen.get(K);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let J=new Map;for(let b of w.seen.entries()){let D=w.metadataRegistry.get(b[0])?.id;if(D){let A=J.get(D);if(A&&A!==b[0])throw Error(`Duplicate schema id "${D}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);J.set(D,b[0])}}let P=(b)=>{let D=w.target==="draft-2020-12"?"$defs":"definitions";if(w.external){let Q=w.external.registry.get(b[0])?.id,B=w.external.uri??((g)=>g);if(Q)return{ref:B(Q)};let L=b[1].defId??b[1].schema.id??`schema${w.counter++}`;return b[1].defId=L,{defId:L,ref:`${B("__shared")}#/${D}/${L}`}}if(b[1]===W)return{ref:"#"};let M=`${"#"}/${D}/`,N=b[1].schema.id??`__schema${w.counter++}`;return{defId:N,ref:M+N}},I=(b)=>{if(b[1].schema.$ref)return;let D=b[1],{ref:A,defId:M}=P(b);if(D.def={...D.schema},M)D.defId=M;let N=D.schema;for(let Q in N)delete N[Q];N.$ref=A};if(w.cycles==="throw")for(let b of w.seen.entries()){let D=b[1];if(D.cycle)throw Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
|
|
54
|
+
`)}L.write("payload.value = newResult;"),L.write("return payload;");let _=L.compile();return(C,R)=>_(N,C,R)},b,I=z2,M=!AK.jitless,D=M&&D1.value,X=K.catchall,S;w._zod.parse=(N,L)=>{S??(S=J.value);let g=N.value;if(!I(g))return N.issues.push({expected:"object",code:"invalid_type",input:g,inst:w}),N;if(M&&D&&L?.async===!1&&L.jitless!==!0){if(!b)b=P(K.shape);if(N=b(N,L),!X)return N;return Z8([],g,N,L,S,w)}return W(N,L)}});function n6(w,K,W,J){for(let b of w)if(b.issues.length===0)return K.value=b.value,K;let P=w.filter((b)=>!K2(b));if(P.length===1)return K.value=P[0].value,P[0];return K.issues.push({code:"invalid_union",input:K.value,inst:W,errors:w.map((b)=>b.issues.map((I)=>_w(I,J,gw())))}),K}var k8=h("$ZodUnion",(w,K)=>{Sw.init(w,K),Jw(w._zod,"optin",()=>K.options.some((P)=>P._zod.optin==="optional")?"optional":void 0),Jw(w._zod,"optout",()=>K.options.some((P)=>P._zod.optout==="optional")?"optional":void 0),Jw(w._zod,"values",()=>{if(K.options.every((P)=>P._zod.values))return new Set(K.options.flatMap((P)=>Array.from(P._zod.values)));return}),Jw(w._zod,"pattern",()=>{if(K.options.every((P)=>P._zod.pattern)){let P=K.options.map((b)=>b._zod.pattern);return new RegExp(`^(${P.map((b)=>f2(b.source)).join("|")})$`)}return});let W=K.options.length===1,J=K.options[0]._zod.run;w._zod.parse=(P,b)=>{if(W)return J(P,b);let I=!1,M=[];for(let O of K.options){let D=O._zod.run({value:P.value,issues:[]},b);if(D instanceof Promise)M.push(D),I=!0;else{if(D.issues.length===0)return D;M.push(D)}}if(!I)return n6(M,P,w,b);return Promise.all(M).then((O)=>{return n6(O,P,w,b)})}});var g8=h("$ZodIntersection",(w,K)=>{Sw.init(w,K),w._zod.parse=(W,J)=>{let P=W.value,b=K.left._zod.run({value:P,issues:[]},J),I=K.right._zod.run({value:P,issues:[]},J);if(b instanceof Promise||I instanceof Promise)return Promise.all([b,I]).then(([O,D])=>{return d6(W,O,D)});return d6(W,b,I)}});function L1(w,K){if(w===K)return{valid:!0,data:w};if(w instanceof Date&&K instanceof Date&&+w===+K)return{valid:!0,data:w};if(X2(w)&&X2(K)){let W=Object.keys(K),J=Object.keys(w).filter((b)=>W.indexOf(b)!==-1),P={...w,...K};for(let b of J){let I=L1(w[b],K[b]);if(!I.valid)return{valid:!1,mergeErrorPath:[b,...I.mergeErrorPath]};P[b]=I.data}return{valid:!0,data:P}}if(Array.isArray(w)&&Array.isArray(K)){if(w.length!==K.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let J=0;J<w.length;J++){let P=w[J],b=K[J],I=L1(P,b);if(!I.valid)return{valid:!1,mergeErrorPath:[J,...I.mergeErrorPath]};W.push(I.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function d6(w,K,W){let J=new Map,P;for(let M of K.issues)if(M.code==="unrecognized_keys"){P??(P=M);for(let O of M.keys){if(!J.has(O))J.set(O,{});J.get(O).l=!0}}else w.issues.push(M);for(let M of W.issues)if(M.code==="unrecognized_keys")for(let O of M.keys){if(!J.has(O))J.set(O,{});J.get(O).r=!0}else w.issues.push(M);let b=[...J].filter(([,M])=>M.l&&M.r).map(([M])=>M);if(b.length&&P)w.issues.push({...P,keys:b});if(K2(w))return w;let I=L1(K.value,W.value);if(!I.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(I.mergeErrorPath)}`);return w.value=I.data,w}var c8=h("$ZodEnum",(w,K)=>{Sw.init(w,K);let W=l2(K.entries),J=new Set(W);w._zod.values=J,w._zod.pattern=new RegExp(`^(${W.filter((P)=>B1.has(typeof P)).map((P)=>typeof P==="string"?S2(P):P.toString()).join("|")})$`),w._zod.parse=(P,b)=>{let I=P.value;if(J.has(I))return P;return P.issues.push({code:"invalid_value",values:W,input:I,inst:w}),P}});var C8=h("$ZodTransform",(w,K)=>{Sw.init(w,K),w._zod.parse=(W,J)=>{if(J.direction==="backward")throw new m2(w.constructor.name);let P=K.transform(W.value,W);if(J.async)return(P instanceof Promise?P:Promise.resolve(P)).then((I)=>{return W.value=I,W});if(P instanceof Promise)throw new ew;return W.value=P,W}});function t6(w,K){if(w.issues.length&&K===void 0)return{issues:[],value:void 0};return w}var U1=h("$ZodOptional",(w,K)=>{Sw.init(w,K),w._zod.optin="optional",w._zod.optout="optional",Jw(w._zod,"values",()=>{return K.innerType._zod.values?new Set([...K.innerType._zod.values,void 0]):void 0}),Jw(w._zod,"pattern",()=>{let W=K.innerType._zod.pattern;return W?new RegExp(`^(${f2(W.source)})?$`):void 0}),w._zod.parse=(W,J)=>{if(K.innerType._zod.optin==="optional"){let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((b)=>t6(b,W.value));return t6(P,W.value)}if(W.value===void 0)return W;return K.innerType._zod.run(W,J)}}),o8=h("$ZodExactOptional",(w,K)=>{U1.init(w,K),Jw(w._zod,"values",()=>K.innerType._zod.values),Jw(w._zod,"pattern",()=>K.innerType._zod.pattern),w._zod.parse=(W,J)=>{return K.innerType._zod.run(W,J)}}),x8=h("$ZodNullable",(w,K)=>{Sw.init(w,K),Jw(w._zod,"optin",()=>K.innerType._zod.optin),Jw(w._zod,"optout",()=>K.innerType._zod.optout),Jw(w._zod,"pattern",()=>{let W=K.innerType._zod.pattern;return W?new RegExp(`^(${f2(W.source)}|null)$`):void 0}),Jw(w._zod,"values",()=>{return K.innerType._zod.values?new Set([...K.innerType._zod.values,null]):void 0}),w._zod.parse=(W,J)=>{if(W.value===null)return W;return K.innerType._zod.run(W,J)}}),r8=h("$ZodDefault",(w,K)=>{Sw.init(w,K),w._zod.optin="optional",Jw(w._zod,"values",()=>K.innerType._zod.values),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);if(W.value===void 0)return W.value=K.defaultValue,W;let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((b)=>a6(b,K));return a6(P,K)}});function a6(w,K){if(w.value===void 0)w.value=K.defaultValue;return w}var u8=h("$ZodPrefault",(w,K)=>{Sw.init(w,K),w._zod.optin="optional",Jw(w._zod,"values",()=>K.innerType._zod.values),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);if(W.value===void 0)W.value=K.defaultValue;return K.innerType._zod.run(W,J)}}),y8=h("$ZodNonOptional",(w,K)=>{Sw.init(w,K),Jw(w._zod,"values",()=>{let W=K.innerType._zod.values;return W?new Set([...W].filter((J)=>J!==void 0)):void 0}),w._zod.parse=(W,J)=>{let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((b)=>s6(b,w));return s6(P,w)}});function s6(w,K){if(!w.issues.length&&w.value===void 0)w.issues.push({code:"invalid_type",expected:"nonoptional",input:w.value,inst:K});return w}var m8=h("$ZodCatch",(w,K)=>{Sw.init(w,K),Jw(w._zod,"optin",()=>K.innerType._zod.optin),Jw(w._zod,"optout",()=>K.innerType._zod.optout),Jw(w._zod,"values",()=>K.innerType._zod.values),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then((b)=>{if(W.value=b.value,b.issues.length)W.value=K.catchValue({...W,error:{issues:b.issues.map((I)=>_w(I,J,gw()))},input:W.value}),W.issues=[];return W});if(W.value=P.value,P.issues.length)W.value=K.catchValue({...W,error:{issues:P.issues.map((b)=>_w(b,J,gw()))},input:W.value}),W.issues=[];return W}});var _8=h("$ZodPipe",(w,K)=>{Sw.init(w,K),Jw(w._zod,"values",()=>K.in._zod.values),Jw(w._zod,"optin",()=>K.in._zod.optin),Jw(w._zod,"optout",()=>K.out._zod.optout),Jw(w._zod,"propValues",()=>K.in._zod.propValues),w._zod.parse=(W,J)=>{if(J.direction==="backward"){let b=K.out._zod.run(W,J);if(b instanceof Promise)return b.then((I)=>zK(I,K.in,J));return zK(b,K.in,J)}let P=K.in._zod.run(W,J);if(P instanceof Promise)return P.then((b)=>zK(b,K.out,J));return zK(P,K.out,J)}});function zK(w,K,W){if(w.issues.length)return w.aborted=!0,w;return K._zod.run({value:w.value,issues:w.issues},W)}var l8=h("$ZodReadonly",(w,K)=>{Sw.init(w,K),Jw(w._zod,"propValues",()=>K.innerType._zod.propValues),Jw(w._zod,"values",()=>K.innerType._zod.values),Jw(w._zod,"optin",()=>K.innerType?._zod?.optin),Jw(w._zod,"optout",()=>K.innerType?._zod?.optout),w._zod.parse=(W,J)=>{if(J.direction==="backward")return K.innerType._zod.run(W,J);let P=K.innerType._zod.run(W,J);if(P instanceof Promise)return P.then(w8);return w8(P)}});function w8(w){return w.value=Object.freeze(w.value),w}var T8=h("$ZodCustom",(w,K)=>{jw.init(w,K),Sw.init(w,K),w._zod.parse=(W,J)=>{return W},w._zod.check=(W)=>{let J=W.value,P=K.fn(J);if(P instanceof Promise)return P.then((b)=>K8(b,W,J,w));K8(P,W,J,w);return}});function K8(w,K,W,J){if(!w){let P={code:"custom",input:W,inst:J,path:[...J._zod.def.path??[]],continue:!J._zod.def.abort};if(J._zod.def.params)P.params=J._zod.def.params;K.issues.push(F2(P))}}var R9=()=>{let w={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function K(P){return w[P]??null}let W={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},J={nan:"NaN"};return(P)=>{switch(P.code){case"invalid_type":{let b=J[P.expected]??P.expected,I=X1(P.input),M=J[I]??I;return`Invalid input: expected ${b}, received ${M}`}case"invalid_value":if(P.values.length===1)return`Invalid input: expected ${LK(P.values[0])}`;return`Invalid option: expected one of ${YK(P.values,"|")}`;case"too_big":{let b=P.inclusive?"<=":"<",I=K(P.origin);if(I)return`Too big: expected ${P.origin??"value"} to have ${b}${P.maximum.toString()} ${I.unit??"elements"}`;return`Too big: expected ${P.origin??"value"} to be ${b}${P.maximum.toString()}`}case"too_small":{let b=P.inclusive?">=":">",I=K(P.origin);if(I)return`Too small: expected ${P.origin} to have ${b}${P.minimum.toString()} ${I.unit}`;return`Too small: expected ${P.origin} to be ${b}${P.minimum.toString()}`}case"invalid_format":{let b=P;if(b.format==="starts_with")return`Invalid string: must start with "${b.prefix}"`;if(b.format==="ends_with")return`Invalid string: must end with "${b.suffix}"`;if(b.format==="includes")return`Invalid string: must include "${b.includes}"`;if(b.format==="regex")return`Invalid string: must match pattern ${b.pattern}`;return`Invalid ${W[b.format]??P.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${P.divisor}`;case"unrecognized_keys":return`Unrecognized key${P.keys.length>1?"s":""}: ${YK(P.keys,", ")}`;case"invalid_key":return`Invalid key in ${P.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${P.origin}`;default:return"Invalid input"}}};function q1(){return{localeError:R9()}}var p8,E9=Symbol("ZodOutput"),v9=Symbol("ZodInput");class f8{constructor(){this._map=new WeakMap,this._idmap=new Map}add(w,...K){let W=K[0];if(this._map.set(w,W),W&&typeof W==="object"&&"id"in W)this._idmap.set(W.id,w);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(w){let K=this._map.get(w);if(K&&typeof K==="object"&&"id"in K)this._idmap.delete(K.id);return this._map.delete(w),this}get(w){let K=w._zod.parent;if(K){let W={...this.get(K)??{}};delete W.id;let J={...W,...this._map.get(w)};return Object.keys(J).length?J:void 0}return this._map.get(w)}has(w){return this._map.has(w)}}function e8(){return new f8}(p8=globalThis).__zod_globalRegistry??(p8.__zod_globalRegistry=e8());var W2=globalThis.__zod_globalRegistry;function i8(w,K){return new w({type:"string",...e(K)})}function H1(w,K){return new w({type:"string",format:"email",check:"string_format",abort:!1,...e(K)})}function z1(w,K){return new w({type:"string",format:"guid",check:"string_format",abort:!1,...e(K)})}function n8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,...e(K)})}function d8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...e(K)})}function t8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...e(K)})}function a8(w,K){return new w({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...e(K)})}function s8(w,K){return new w({type:"string",format:"url",check:"string_format",abort:!1,...e(K)})}function w3(w,K){return new w({type:"string",format:"emoji",check:"string_format",abort:!1,...e(K)})}function K3(w,K){return new w({type:"string",format:"nanoid",check:"string_format",abort:!1,...e(K)})}function W3(w,K){return new w({type:"string",format:"cuid",check:"string_format",abort:!1,...e(K)})}function J3(w,K){return new w({type:"string",format:"cuid2",check:"string_format",abort:!1,...e(K)})}function P3(w,K){return new w({type:"string",format:"ulid",check:"string_format",abort:!1,...e(K)})}function b3(w,K){return new w({type:"string",format:"xid",check:"string_format",abort:!1,...e(K)})}function I3(w,K){return new w({type:"string",format:"ksuid",check:"string_format",abort:!1,...e(K)})}function M3(w,K){return new w({type:"string",format:"ipv4",check:"string_format",abort:!1,...e(K)})}function G3(w,K){return new w({type:"string",format:"ipv6",check:"string_format",abort:!1,...e(K)})}function O3(w,K){return new w({type:"string",format:"cidrv4",check:"string_format",abort:!1,...e(K)})}function D3(w,K){return new w({type:"string",format:"cidrv6",check:"string_format",abort:!1,...e(K)})}function B3(w,K){return new w({type:"string",format:"base64",check:"string_format",abort:!1,...e(K)})}function N3(w,K){return new w({type:"string",format:"base64url",check:"string_format",abort:!1,...e(K)})}function X3(w,K){return new w({type:"string",format:"e164",check:"string_format",abort:!1,...e(K)})}function h1(w,K){return new w({type:"string",format:"jwt",check:"string_format",abort:!1,...e(K)})}function S3(w,K){return new w({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...e(K)})}function $3(w,K){return new w({type:"string",format:"date",check:"string_format",...e(K)})}function A3(w,K){return new w({type:"string",format:"time",check:"string_format",precision:null,...e(K)})}function Y3(w,K){return new w({type:"string",format:"duration",check:"string_format",...e(K)})}function Q3(w){return new w({type:"unknown"})}function V3(w,K){return new w({type:"never",...e(K)})}function RK(w,K){return new o6({check:"max_length",...e(K),maximum:w})}function R2(w,K){return new x6({check:"min_length",...e(K),minimum:w})}function EK(w,K){return new r6({check:"length_equals",...e(K),length:w})}function F1(w,K){return new u6({check:"string_format",format:"regex",...e(K),pattern:w})}function R1(w){return new y6({check:"string_format",format:"lowercase",...e(w)})}function E1(w){return new m6({check:"string_format",format:"uppercase",...e(w)})}function v1(w,K){return new _6({check:"string_format",format:"includes",...e(K),includes:w})}function Z1(w,K){return new l6({check:"string_format",format:"starts_with",...e(K),prefix:w})}function j1(w,K){return new T6({check:"string_format",format:"ends_with",...e(K),suffix:w})}function J2(w){return new p6({check:"overwrite",tx:w})}function k1(w){return J2((K)=>K.normalize(w))}function g1(){return J2((w)=>w.trim())}function c1(){return J2((w)=>w.toLowerCase())}function C1(){return J2((w)=>w.toUpperCase())}function o1(){return J2((w)=>O1(w))}function L3(w,K,W){return new w({type:"array",element:K,...e(W)})}function U3(w,K,W){return new w({type:"custom",check:"custom",fn:K,...e(W)})}function q3(w){let K=Z9((W)=>{return W.addIssue=(J)=>{if(typeof J==="string")W.issues.push(F2(J,W.value,K._zod.def));else{let P=J;if(P.fatal)P.continue=!1;P.code??(P.code="custom"),P.input??(P.input=W.value),P.inst??(P.inst=K),P.continue??(P.continue=!K._zod.def.abort),W.issues.push(F2(P))}},w(W.value,W)});return K}function Z9(w,K){let W=new jw({check:"custom",...e(K)});return W._zod.check=w,W}function x1(w){let K=w?.target??"draft-2020-12";if(K==="draft-4")K="draft-04";if(K==="draft-7")K="draft-07";return{processors:w.processors??{},metadataRegistry:w?.metadata??W2,target:K,unrepresentable:w?.unrepresentable??"throw",override:w?.override??(()=>{}),io:w?.io??"output",counter:0,seen:new Map,cycles:w?.cycles??"ref",reused:w?.reused??"inline",external:w?.external??void 0}}function Qw(w,K,W={path:[],schemaPath:[]}){var J;let P=w._zod.def,b=K.seen.get(w);if(b){if(b.count++,W.schemaPath.includes(w))b.cycle=W.path;return b.schema}let I={schema:{},count:1,cycle:void 0,path:W.path};K.seen.set(w,I);let M=w._zod.toJSONSchema?.();if(M)I.schema=M;else{let X={...W,schemaPath:[...W.schemaPath,w],path:W.path};if(w._zod.processJSONSchema)w._zod.processJSONSchema(K,I.schema,X);else{let N=I.schema,L=K.processors[P.type];if(!L)throw Error(`[toJSONSchema]: Non-representable type encountered: ${P.type}`);L(w,K,N,X)}let S=w._zod.parent;if(S){if(!I.ref)I.ref=S;Qw(S,K,X),K.seen.get(S).isParent=!0}}let O=K.metadataRegistry.get(w);if(O)Object.assign(I.schema,O);if(K.io==="input"&&Rw(w))delete I.schema.examples,delete I.schema.default;if(K.io==="input"&&I.schema._prefault)(J=I.schema).default??(J.default=I.schema._prefault);return delete I.schema._prefault,K.seen.get(w).schema}function r1(w,K){let W=w.seen.get(K);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let J=new Map;for(let I of w.seen.entries()){let M=w.metadataRegistry.get(I[0])?.id;if(M){let O=J.get(M);if(O&&O!==I[0])throw Error(`Duplicate schema id "${M}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);J.set(M,I[0])}}let P=(I)=>{let M=w.target==="draft-2020-12"?"$defs":"definitions";if(w.external){let S=w.external.registry.get(I[0])?.id,N=w.external.uri??((g)=>g);if(S)return{ref:N(S)};let L=I[1].defId??I[1].schema.id??`schema${w.counter++}`;return I[1].defId=L,{defId:L,ref:`${N("__shared")}#/${M}/${L}`}}if(I[1]===W)return{ref:"#"};let D=`${"#"}/${M}/`,X=I[1].schema.id??`__schema${w.counter++}`;return{defId:X,ref:D+X}},b=(I)=>{if(I[1].schema.$ref)return;let M=I[1],{ref:O,defId:D}=P(I);if(M.def={...M.schema},D)M.defId=D;let X=M.schema;for(let S in X)delete X[S];X.$ref=O};if(w.cycles==="throw")for(let I of w.seen.entries()){let M=I[1];if(M.cycle)throw Error(`Cycle detected: #/${M.cycle?.join("/")}/<root>
|
|
55
55
|
|
|
56
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let b of w.seen.entries()){let D=b[1];if(K===b[0]){I(b);continue}if(w.external){let M=w.external.registry.get(b[0])?.id;if(K!==b[0]&&M){I(b);continue}}if(w.metadataRegistry.get(b[0])?.id){I(b);continue}if(D.cycle){I(b);continue}if(D.count>1){if(w.reused==="ref"){I(b);continue}}}}function _1(w,K){let W=w.seen.get(K);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let J=(b)=>{let D=w.seen.get(b);if(D.ref===null)return;let A=D.def??D.schema,M={...A},N=D.ref;if(D.ref=null,N){J(N);let B=w.seen.get(N),L=B.schema;if(L.$ref&&(w.target==="draft-07"||w.target==="draft-04"||w.target==="openapi-3.0"))A.allOf=A.allOf??[],A.allOf.push(L);else Object.assign(A,L);if(Object.assign(A,M),b._zod.parent===N)for(let O in A){if(O==="$ref"||O==="allOf")continue;if(!(O in M))delete A[O]}if(L.$ref&&B.def)for(let O in A){if(O==="$ref"||O==="allOf")continue;if(O in B.def&&JSON.stringify(A[O])===JSON.stringify(B.def[O]))delete A[O]}}let Q=b._zod.parent;if(Q&&Q!==N){J(Q);let B=w.seen.get(Q);if(B?.schema.$ref){if(A.$ref=B.schema.$ref,B.def)for(let L in A){if(L==="$ref"||L==="allOf")continue;if(L in B.def&&JSON.stringify(A[L])===JSON.stringify(B.def[L]))delete A[L]}}}w.override({zodSchema:b,jsonSchema:A,path:D.path??[]})};for(let b of[...w.seen.entries()].reverse())J(b[0]);let P={};if(w.target==="draft-2020-12")P.$schema="https://json-schema.org/draft/2020-12/schema";else if(w.target==="draft-07")P.$schema="http://json-schema.org/draft-07/schema#";else if(w.target==="draft-04")P.$schema="http://json-schema.org/draft-04/schema#";else if(w.target==="openapi-3.0");if(w.external?.uri){let b=w.external.registry.get(K)?.id;if(!b)throw Error("Schema is missing an `id` property");P.$id=w.external.uri(b)}Object.assign(P,W.def??W.schema);let I=w.external?.defs??{};for(let b of w.seen.entries()){let D=b[1];if(D.def&&D.defId)I[D.defId]=D.def}if(w.external);else if(Object.keys(I).length>0)if(w.target==="draft-2020-12")P.$defs=I;else P.definitions=I;try{let b=JSON.parse(JSON.stringify(P));return Object.defineProperty(b,"~standard",{value:{...K["~standard"],jsonSchema:{input:s2(K,"input",w.processors),output:s2(K,"output",w.processors)}},enumerable:!1,writable:!1}),b}catch(b){throw Error("Error converting schema to JSON.")}}function zw(w,K){let W=K??{seen:new Set};if(W.seen.has(w))return!1;W.seen.add(w);let J=w._zod.def;if(J.type==="transform")return!0;if(J.type==="array")return zw(J.element,W);if(J.type==="set")return zw(J.valueType,W);if(J.type==="lazy")return zw(J.getter(),W);if(J.type==="promise"||J.type==="optional"||J.type==="nonoptional"||J.type==="nullable"||J.type==="readonly"||J.type==="default"||J.type==="prefault")return zw(J.innerType,W);if(J.type==="intersection")return zw(J.left,W)||zw(J.right,W);if(J.type==="record"||J.type==="map")return zw(J.keyType,W)||zw(J.valueType,W);if(J.type==="pipe")return zw(J.in,W)||zw(J.out,W);if(J.type==="object"){for(let P in J.shape)if(zw(J.shape[P],W))return!0;return!1}if(J.type==="union"){for(let P of J.options)if(zw(P,W))return!0;return!1}if(J.type==="tuple"){for(let P of J.items)if(zw(P,W))return!0;if(J.rest&&zw(J.rest,W))return!0;return!1}return!1}var H3=(w,K={})=>(W)=>{let J=r1({...W,processors:K});return $w(w,J),c1(J,w),_1(J,w)},s2=(w,K,W={})=>(J)=>{let{libraryOptions:P,target:I}=J??{},b=r1({...P??{},target:I,io:K,processors:W});return $w(w,b),c1(b,w),_1(b,w)};var z9={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},q3=(w,K,W,J)=>{let P=W;P.type="string";let{minimum:I,maximum:b,format:D,patterns:A,contentEncoding:M}=w._zod.bag;if(typeof I==="number")P.minLength=I;if(typeof b==="number")P.maxLength=b;if(D){if(P.format=z9[D]??D,P.format==="")delete P.format;if(D==="time")delete P.format}if(M)P.contentEncoding=M;if(A&&A.size>0){let N=[...A];if(N.length===1)P.pattern=N[0].source;else if(N.length>1)P.allOf=[...N.map((Q)=>({...K.target==="draft-07"||K.target==="draft-04"||K.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}};var h3=(w,K,W,J)=>{W.not={}};var z3=(w,K,W,J)=>{};var F3=(w,K,W,J)=>{let P=w._zod.def,I=T2(P.entries);if(I.every((b)=>typeof b==="number"))W.type="number";if(I.every((b)=>typeof b==="string"))W.type="string";W.enum=I};var R3=(w,K,W,J)=>{if(K.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var v3=(w,K,W,J)=>{if(K.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var j3=(w,K,W,J)=>{let P=W,I=w._zod.def,{minimum:b,maximum:D}=w._zod.bag;if(typeof b==="number")P.minItems=b;if(typeof D==="number")P.maxItems=D;P.type="array",P.items=$w(I.element,K,{...J,path:[...J.path,"items"]})},Z3=(w,K,W,J)=>{let P=W,I=w._zod.def;P.type="object",P.properties={};let b=I.shape;for(let M in b)P.properties[M]=$w(b[M],K,{...J,path:[...J.path,"properties",M]});let D=new Set(Object.keys(b)),A=new Set([...D].filter((M)=>{let N=I.shape[M]._zod;if(K.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(A.size>0)P.required=Array.from(A);if(I.catchall?._zod.def.type==="never")P.additionalProperties=!1;else if(!I.catchall){if(K.io==="output")P.additionalProperties=!1}else if(I.catchall)P.additionalProperties=$w(I.catchall,K,{...J,path:[...J.path,"additionalProperties"]})},k3=(w,K,W,J)=>{let P=w._zod.def,I=P.inclusive===!1,b=P.options.map((D,A)=>$w(D,K,{...J,path:[...J.path,I?"oneOf":"anyOf",A]}));if(I)W.oneOf=b;else W.anyOf=b},g3=(w,K,W,J)=>{let P=w._zod.def,I=$w(P.left,K,{...J,path:[...J.path,"allOf",0]}),b=$w(P.right,K,{...J,path:[...J.path,"allOf",1]}),D=(M)=>("allOf"in M)&&Object.keys(M).length===1,A=[...D(I)?I.allOf:[I],...D(b)?b.allOf:[b]];W.allOf=A};var C3=(w,K,W,J)=>{let P=w._zod.def,I=$w(P.innerType,K,J),b=K.seen.get(w);if(K.target==="openapi-3.0")b.ref=P.innerType,W.nullable=!0;else W.anyOf=[I,{type:"null"}]},o3=(w,K,W,J)=>{let P=w._zod.def;$w(P.innerType,K,J);let I=K.seen.get(w);I.ref=P.innerType},x3=(w,K,W,J)=>{let P=w._zod.def;$w(P.innerType,K,J);let I=K.seen.get(w);I.ref=P.innerType,W.default=JSON.parse(JSON.stringify(P.defaultValue))},r3=(w,K,W,J)=>{let P=w._zod.def;$w(P.innerType,K,J);let I=K.seen.get(w);if(I.ref=P.innerType,K.io==="input")W._prefault=JSON.parse(JSON.stringify(P.defaultValue))},c3=(w,K,W,J)=>{let P=w._zod.def;$w(P.innerType,K,J);let I=K.seen.get(w);I.ref=P.innerType;let b;try{b=P.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}W.default=b},_3=(w,K,W,J)=>{let P=w._zod.def,I=K.io==="input"?P.in._zod.def.type==="transform"?P.out:P.in:P.out;$w(I,K,J);let b=K.seen.get(w);b.ref=I},u3=(w,K,W,J)=>{let P=w._zod.def;$w(P.innerType,K,J);let I=K.seen.get(w);I.ref=P.innerType,W.readOnly=!0};var u1=(w,K,W,J)=>{let P=w._zod.def;$w(P.innerType,K,J);let I=K.seen.get(w);I.ref=P.innerType};var _9=h("ZodISODateTime",(w,K)=>{N8.init(w,K),Mw.init(w,K)});function y3(w){return Q3(_9,w)}var u9=h("ZodISODate",(w,K)=>{Q8.init(w,K),Mw.init(w,K)});function m3(w){return S3(u9,w)}var y9=h("ZodISOTime",(w,K)=>{S8.init(w,K),Mw.init(w,K)});function T3(w){return $3(y9,w)}var m9=h("ZodISODuration",(w,K)=>{$8.init(w,K),Mw.init(w,K)});function l3(w){return Y3(m9,w)}var e3=(w,K)=>{EK.init(w,K),w.name="ZodError",Object.defineProperties(w,{format:{value:(W)=>$1(w,W)},flatten:{value:(W)=>S1(w,W)},addIssue:{value:(W)=>{w.issues.push(W),w.message=JSON.stringify(w.issues,h2,2)}},addIssues:{value:(W)=>{w.issues.push(...W),w.message=JSON.stringify(w.issues,h2,2)}},isEmpty:{get(){return w.issues.length===0}}})},$P=h("ZodError",e3),Zw=h("ZodError",e3,{Parent:Error});var f3=UK(Zw),i3=HK(Zw),n3=n2(Zw),d3=d2(Zw),t3=P6(Zw),a3=I6(Zw),s3=b6(Zw),w5=D6(Zw),K5=G6(Zw),W5=A6(Zw),J5=M6(Zw),P5=O6(Zw);var Sw=h("ZodType",(w,K)=>{return Nw.init(w,K),Object.assign(w["~standard"],{jsonSchema:{input:s2(w,"input"),output:s2(w,"output")}}),w.toJSONSchema=H3(w,{}),w.def=K,w.type=K.type,Object.defineProperty(w,"_def",{value:K}),w.check=(...W)=>{return w.clone(bw.mergeDefs(K,{checks:[...K.checks??[],...W.map((J)=>typeof J==="function"?{_zod:{check:J,def:{check:"custom"},onattach:[]}}:J)]}),{parent:!0})},w.with=w.check,w.clone=(W,J)=>Cw(w,W,J),w.brand=()=>w,w.register=(W,J)=>{return W.add(w,J),w},w.parse=(W,J)=>f3(w,W,J,{callee:w.parse}),w.safeParse=(W,J)=>n3(w,W,J),w.parseAsync=async(W,J)=>i3(w,W,J,{callee:w.parseAsync}),w.safeParseAsync=async(W,J)=>d3(w,W,J),w.spa=w.safeParseAsync,w.encode=(W,J)=>t3(w,W,J),w.decode=(W,J)=>a3(w,W,J),w.encodeAsync=async(W,J)=>s3(w,W,J),w.decodeAsync=async(W,J)=>w5(w,W,J),w.safeEncode=(W,J)=>K5(w,W,J),w.safeDecode=(W,J)=>W5(w,W,J),w.safeEncodeAsync=async(W,J)=>J5(w,W,J),w.safeDecodeAsync=async(W,J)=>P5(w,W,J),w.refine=(W,J)=>w.check(CW(W,J)),w.superRefine=(W)=>w.check(oW(W)),w.overwrite=(W)=>w.check(J2(W)),w.optional=()=>D5(w),w.exactOptional=()=>EW(w),w.nullable=()=>G5(w),w.nullish=()=>D5(G5(w)),w.nonoptional=(W)=>FW(w,W),w.array=()=>OW(w),w.or=(W)=>QW([w,W]),w.and=(W)=>$W(w,W),w.transform=(W)=>A5(w,VW(W)),w.default=(W)=>qW(w,W),w.prefault=(W)=>zW(w,W),w.catch=(W)=>vW(w,W),w.pipe=(W)=>A5(w,W),w.readonly=()=>kW(w),w.describe=(W)=>{let J=w.clone();return W2.add(J,{description:W}),J},Object.defineProperty(w,"description",{get(){return W2.get(w)?.description},configurable:!0}),w.meta=(...W)=>{if(W.length===0)return W2.get(w);let J=w.clone();return W2.add(J,W[0]),J},w.isOptional=()=>w.safeParse(void 0).success,w.isNullable=()=>w.safeParse(null).success,w.apply=(W)=>W(w),w}),M5=h("_ZodString",(w,K)=>{zK.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(J,P,I)=>q3(w,J,P,I);let W=w._zod.bag;w.format=W.format??null,w.minLength=W.minimum??null,w.maxLength=W.maximum??null,w.regex=(...J)=>w.check(z1(...J)),w.includes=(...J)=>w.check(v1(...J)),w.startsWith=(...J)=>w.check(j1(...J)),w.endsWith=(...J)=>w.check(Z1(...J)),w.min=(...J)=>w.check(F2(...J)),w.max=(...J)=>w.check(FK(...J)),w.length=(...J)=>w.check(RK(...J)),w.nonempty=(...J)=>w.check(F2(1,...J)),w.lowercase=(J)=>w.check(F1(J)),w.uppercase=(J)=>w.check(R1(J)),w.trim=()=>w.check(g1()),w.normalize=(...J)=>w.check(k1(...J)),w.toLowerCase=()=>w.check(C1()),w.toUpperCase=()=>w.check(o1()),w.slugify=()=>w.check(x1())}),p9=h("ZodString",(w,K)=>{zK.init(w,K),M5.init(w,K),w.email=(W)=>w.check(H1(B5,W)),w.url=(W)=>w.check(s8(e9,W)),w.jwt=(W)=>w.check(h1(Q5,W)),w.emoji=(W)=>w.check(w3(f9,W)),w.guid=(W)=>w.check(q1(I5,W)),w.uuid=(W)=>w.check(n8(vK,W)),w.uuidv4=(W)=>w.check(d8(vK,W)),w.uuidv6=(W)=>w.check(t8(vK,W)),w.uuidv7=(W)=>w.check(a8(vK,W)),w.nanoid=(W)=>w.check(K3(i9,W)),w.guid=(W)=>w.check(q1(I5,W)),w.cuid=(W)=>w.check(W3(n9,W)),w.cuid2=(W)=>w.check(J3(d9,W)),w.ulid=(W)=>w.check(P3(t9,W)),w.base64=(W)=>w.check(O3(PW,W)),w.base64url=(W)=>w.check(B3(IW,W)),w.xid=(W)=>w.check(I3(a9,W)),w.ksuid=(W)=>w.check(b3(s9,W)),w.ipv4=(W)=>w.check(D3(wW,W)),w.ipv6=(W)=>w.check(G3(KW,W)),w.cidrv4=(W)=>w.check(A3(WW,W)),w.cidrv6=(W)=>w.check(M3(JW,W)),w.e164=(W)=>w.check(N3(bW,W)),w.datetime=(W)=>w.check(y3(W)),w.date=(W)=>w.check(m3(W)),w.time=(W)=>w.check(T3(W)),w.duration=(W)=>w.check(l3(W))});function O5(w){return i8(p9,w)}var Mw=h("ZodStringFormat",(w,K)=>{Gw.init(w,K),M5.init(w,K)}),B5=h("ZodEmail",(w,K)=>{P8.init(w,K),Mw.init(w,K)});function N5(w){return H1(B5,w)}var I5=h("ZodGUID",(w,K)=>{W8.init(w,K),Mw.init(w,K)});var vK=h("ZodUUID",(w,K)=>{J8.init(w,K),Mw.init(w,K)});var e9=h("ZodURL",(w,K)=>{I8.init(w,K),Mw.init(w,K)});var f9=h("ZodEmoji",(w,K)=>{b8.init(w,K),Mw.init(w,K)});var i9=h("ZodNanoID",(w,K)=>{D8.init(w,K),Mw.init(w,K)});var n9=h("ZodCUID",(w,K)=>{G8.init(w,K),Mw.init(w,K)});var d9=h("ZodCUID2",(w,K)=>{A8.init(w,K),Mw.init(w,K)});var t9=h("ZodULID",(w,K)=>{M8.init(w,K),Mw.init(w,K)});var a9=h("ZodXID",(w,K)=>{O8.init(w,K),Mw.init(w,K)});var s9=h("ZodKSUID",(w,K)=>{B8.init(w,K),Mw.init(w,K)});var wW=h("ZodIPv4",(w,K)=>{Y8.init(w,K),Mw.init(w,K)});var KW=h("ZodIPv6",(w,K)=>{X8.init(w,K),Mw.init(w,K)});var WW=h("ZodCIDRv4",(w,K)=>{V8.init(w,K),Mw.init(w,K)});var JW=h("ZodCIDRv6",(w,K)=>{L8.init(w,K),Mw.init(w,K)});var PW=h("ZodBase64",(w,K)=>{U8.init(w,K),Mw.init(w,K)});var IW=h("ZodBase64URL",(w,K)=>{H8.init(w,K),Mw.init(w,K)});var bW=h("ZodE164",(w,K)=>{q8.init(w,K),Mw.init(w,K)});var Q5=h("ZodJWT",(w,K)=>{h8.init(w,K),Mw.init(w,K)});function S5(w){return h1(Q5,w)}var DW=h("ZodUnknown",(w,K)=>{z8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>z3(w,W,J,P)});function b5(){return X3(DW)}var GW=h("ZodNever",(w,K)=>{F8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>h3(w,W,J,P)});function AW(w){return V3(GW,w)}var MW=h("ZodArray",(w,K)=>{R8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>j3(w,W,J,P),w.element=K.element,w.min=(W,J)=>w.check(F2(W,J)),w.nonempty=(W)=>w.check(F2(1,W)),w.max=(W,J)=>w.check(FK(W,J)),w.length=(W,J)=>w.check(RK(W,J)),w.unwrap=()=>w.element});function OW(w,K){return L3(MW,w,K)}var BW=h("ZodObject",(w,K)=>{Z8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>Z3(w,W,J,P),bw.defineLazy(w,"shape",()=>{return K.shape}),w.keyof=()=>YW(Object.keys(w._zod.def.shape)),w.catchall=(W)=>w.clone({...w._zod.def,catchall:W}),w.passthrough=()=>w.clone({...w._zod.def,catchall:b5()}),w.loose=()=>w.clone({...w._zod.def,catchall:b5()}),w.strict=()=>w.clone({...w._zod.def,catchall:AW()}),w.strip=()=>w.clone({...w._zod.def,catchall:void 0}),w.extend=(W)=>{return bw.extend(w,W)},w.safeExtend=(W)=>{return bw.safeExtend(w,W)},w.merge=(W)=>bw.merge(w,W),w.pick=(W)=>bw.pick(w,W),w.omit=(W)=>bw.omit(w,W),w.partial=(...W)=>bw.partial(Y5,w,W[0]),w.required=(...W)=>bw.required(X5,w,W[0])});function $5(w,K){let W={type:"object",shape:w??{},...bw.normalizeParams(K)};return new BW(W)}var NW=h("ZodUnion",(w,K)=>{k8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>k3(w,W,J,P),w.options=K.options});function QW(w,K){return new NW({type:"union",options:w,...bw.normalizeParams(K)})}var SW=h("ZodIntersection",(w,K)=>{g8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>g3(w,W,J,P)});function $W(w,K){return new SW({type:"intersection",left:w,right:K})}var y1=h("ZodEnum",(w,K)=>{C8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(J,P,I)=>F3(w,J,P,I),w.enum=K.entries,w.options=Object.values(K.entries);let W=new Set(Object.keys(K.entries));w.extract=(J,P)=>{let I={};for(let b of J)if(W.has(b))I[b]=K.entries[b];else throw Error(`Key ${b} not found in enum`);return new y1({...K,checks:[],...bw.normalizeParams(P),entries:I})},w.exclude=(J,P)=>{let I={...K.entries};for(let b of J)if(W.has(b))delete I[b];else throw Error(`Key ${b} not found in enum`);return new y1({...K,checks:[],...bw.normalizeParams(P),entries:I})}});function YW(w,K){let W=Array.isArray(w)?Object.fromEntries(w.map((J)=>[J,J])):w;return new y1({type:"enum",entries:W,...bw.normalizeParams(K)})}var XW=h("ZodTransform",(w,K)=>{o8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>v3(w,W,J,P),w._zod.parse=(W,J)=>{if(J.direction==="backward")throw new y2(w.constructor.name);W.addIssue=(I)=>{if(typeof I==="string")W.issues.push(bw.issue(I,W.value,K));else{let b=I;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=W.value),b.inst??(b.inst=w),W.issues.push(bw.issue(b))}};let P=K.transform(W.value,W);if(P instanceof Promise)return P.then((I)=>{return W.value=I,W});return W.value=P,W}});function VW(w){return new XW({type:"transform",transform:w})}var Y5=h("ZodOptional",(w,K)=>{E1.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>u1(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function D5(w){return new Y5({type:"optional",innerType:w})}var LW=h("ZodExactOptional",(w,K)=>{x8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>u1(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function EW(w){return new LW({type:"optional",innerType:w})}var UW=h("ZodNullable",(w,K)=>{r8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>C3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function G5(w){return new UW({type:"nullable",innerType:w})}var HW=h("ZodDefault",(w,K)=>{c8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>x3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType,w.removeDefault=w.unwrap});function qW(w,K){return new HW({type:"default",innerType:w,get defaultValue(){return typeof K==="function"?K():bw.shallowClone(K)}})}var hW=h("ZodPrefault",(w,K)=>{_8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>r3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function zW(w,K){return new hW({type:"prefault",innerType:w,get defaultValue(){return typeof K==="function"?K():bw.shallowClone(K)}})}var X5=h("ZodNonOptional",(w,K)=>{u8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>o3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function FW(w,K){return new X5({type:"nonoptional",innerType:w,...bw.normalizeParams(K)})}var RW=h("ZodCatch",(w,K)=>{y8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>c3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType,w.removeCatch=w.unwrap});function vW(w,K){return new RW({type:"catch",innerType:w,catchValue:typeof K==="function"?K:()=>K})}var jW=h("ZodPipe",(w,K)=>{m8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>_3(w,W,J,P),w.in=K.in,w.out=K.out});function A5(w,K){return new jW({type:"pipe",in:w,out:K})}var ZW=h("ZodReadonly",(w,K)=>{T8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>u3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function kW(w){return new ZW({type:"readonly",innerType:w})}var gW=h("ZodCustom",(w,K)=>{l8.init(w,K),Sw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>R3(w,W,J,P)});function CW(w,K={}){return E3(gW,w,K)}function oW(w){return U3(w)}gw(U1());var V5=$5({authorization:O5().startsWith("Bearer ").transform((w,K)=>{let[W,J]=w.split(" ");if(!S5().safeParse(J).success)return K.addIssue("Token must be match jsonwebtoken format."),D1;return Object.freeze({schema:W,token:J})})});class m1{clientInstance;constructor(w){this.clientInstance=w}async enforce(w,K,W){if(!this.clientInstance)throw Error("Bool guard instance not found.");let J=Reflect.getOwnMetadataKeys(w.class,w.funcName),P=Reflect.getOwnMetadataKeys(w.class),I=J.includes(hw.guardMetadata),b=P.includes(hw.guardMetadata);if(!I&&!b)return!0;let D=await V5.safeParseAsync(K.toJSON());if(!D.success)return!1;try{let{authorization:{token:A}}=D.data,{account:M,credential:N}=await this.clientInstance.verifyToken({token:A}),Q=Object.freeze({account:M,credential:N});return W.set(hw.authState,Q),!0}catch{return!1}}}iK([C2(0,r4()),C2(1,x4()),C2(2,SK())],m1.prototype,"enforce",null),m1=iK([c4(),C2(0,_4(hw.guardClient))],m1);var jK=new TextEncoder,ZK=new TextDecoder;function L5(...w){let K=w.reduce((P,{length:I})=>P+I,0),W=new Uint8Array(K),J=0;for(let P of w)W.set(P,J),J+=P.length;return W}function kK(w){let K=new Uint8Array(w.length);for(let W=0;W<w.length;W++){let J=w.charCodeAt(W);if(J>127)throw TypeError("non-ASCII string encountered in encode()");K[W]=J}return K}function E5(w){if(Uint8Array.prototype.toBase64)return w.toBase64();let K=32768,W=[];for(let J=0;J<w.length;J+=K)W.push(String.fromCharCode.apply(null,w.subarray(J,J+K)));return btoa(W.join(""))}function U5(w){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(w);let K=atob(w),W=new Uint8Array(K.length);for(let J=0;J<K.length;J++)W[J]=K.charCodeAt(J);return W}function H5(w){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof w==="string"?w:ZK.decode(w),{alphabet:"base64url"});let K=w;if(K instanceof Uint8Array)K=ZK.decode(K);K=K.replace(/-/g,"+").replace(/_/g,"/");try{return U5(K)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function gK(w){let K=w;if(typeof K==="string")K=jK.encode(K);if(Uint8Array.prototype.toBase64)return K.toBase64({alphabet:"base64url",omitPadding:!0});return E5(K).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var P2=(w,K="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${K} must be ${w}`),R2=(w,K)=>w.name===K;function xW(w){return parseInt(w.name.slice(4),10)}function T1(w,K){if(xW(w.hash)!==K)throw P2(`SHA-${K}`,"algorithm.hash")}function rW(w){switch(w){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function cW(w,K){if(K&&!w.usages.includes(K))throw TypeError(`CryptoKey does not support this operation, its usages must include ${K}.`)}function q5(w,K,W){switch(K){case"HS256":case"HS384":case"HS512":{if(!R2(w.algorithm,"HMAC"))throw P2("HMAC");T1(w.algorithm,parseInt(K.slice(2),10));break}case"RS256":case"RS384":case"RS512":{if(!R2(w.algorithm,"RSASSA-PKCS1-v1_5"))throw P2("RSASSA-PKCS1-v1_5");T1(w.algorithm,parseInt(K.slice(2),10));break}case"PS256":case"PS384":case"PS512":{if(!R2(w.algorithm,"RSA-PSS"))throw P2("RSA-PSS");T1(w.algorithm,parseInt(K.slice(2),10));break}case"Ed25519":case"EdDSA":{if(!R2(w.algorithm,"Ed25519"))throw P2("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!R2(w.algorithm,K))throw P2(K);break}case"ES256":case"ES384":case"ES512":{if(!R2(w.algorithm,"ECDSA"))throw P2("ECDSA");let J=rW(K);if(w.algorithm.namedCurve!==J)throw P2(J,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}cW(w,W)}function h5(w,K,...W){if(W=W.filter(Boolean),W.length>2){let J=W.pop();w+=`one of type ${W.join(", ")}, or ${J}.`}else if(W.length===2)w+=`one of type ${W[0]} or ${W[1]}.`;else w+=`of type ${W[0]}.`;if(K==null)w+=` Received ${K}`;else if(typeof K==="function"&&K.name)w+=` Received function ${K.name}`;else if(typeof K==="object"&&K!=null){if(K.constructor?.name)w+=` Received an instance of ${K.constructor.name}`}return w}var z5=(w,...K)=>h5("Key must be ",w,...K),l1=(w,K,...W)=>h5(`Key for the ${w} algorithm must be `,K,...W);class CK extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(w,K){super(w,K);this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class cw extends CK{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class I2 extends CK{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class p1 extends CK{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}var e1=(w)=>{if(w?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return w instanceof CryptoKey}catch{return!1}},f1=(w)=>w?.[Symbol.toStringTag]==="KeyObject",i1=(w)=>e1(w)||f1(w);var Sb=Symbol();function n1(w,K){if(w)throw TypeError(`${K} can only be called once`)}var _W=(w)=>typeof w==="object"&&w!==null;function d1(w){if(!_W(w)||Object.prototype.toString.call(w)!=="[object Object]")return!1;if(Object.getPrototypeOf(w)===null)return!0;let K=w;while(Object.getPrototypeOf(K)!==null)K=Object.getPrototypeOf(K);return Object.getPrototypeOf(w)===K}function F5(...w){let K=w.filter(Boolean);if(K.length===0||K.length===1)return!0;let W;for(let J of K){let P=Object.keys(J);if(!W||W.size===0){W=new Set(P);continue}for(let I of P){if(W.has(I))return!1;W.add(I)}}return!0}var KK=(w)=>d1(w)&&typeof w.kty==="string",R5=(w)=>w.kty!=="oct"&&(w.kty==="AKP"&&typeof w.priv==="string"||typeof w.d==="string"),v5=(w)=>w.kty!=="oct"&&w.d===void 0&&w.priv===void 0,j5=(w)=>w.kty==="oct"&&typeof w.k==="string";function yW(w,K){if(w.startsWith("RS")||w.startsWith("PS")){let{modulusLength:W}=K.algorithm;if(typeof W!=="number"||W<2048)throw TypeError(`${w} requires key modulusLength to be 2048 bits or larger`)}}function mW(w,K){let W=`SHA-${w.slice(-3)}`;switch(w){case"HS256":case"HS384":case"HS512":return{hash:W,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:W,name:"RSA-PSS",saltLength:parseInt(w.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:W,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:W,name:"ECDSA",namedCurve:K.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:w};default:throw new cw(`alg ${w} is not supported either by JOSE or your javascript runtime`)}}async function TW(w,K,W){if(K instanceof Uint8Array){if(!w.startsWith("HS"))throw TypeError(z5(K,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",K,{hash:`SHA-${w.slice(-3)}`,name:"HMAC"},!1,[W])}return q5(K,w,W),K}async function Z5(w,K,W){let J=await TW(w,K,"sign");yW(w,J);let P=await crypto.subtle.sign(mW(w,J.algorithm),J,W);return new Uint8Array(P)}var oK='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';function lW(w){let K,W;switch(w.kty){case"AKP":{switch(w.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":K={name:w.alg},W=w.priv?["sign"]:["verify"];break;default:throw new cw(oK)}break}case"RSA":{switch(w.alg){case"PS256":case"PS384":case"PS512":K={name:"RSA-PSS",hash:`SHA-${w.alg.slice(-3)}`},W=w.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":K={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${w.alg.slice(-3)}`},W=w.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":K={name:"RSA-OAEP",hash:`SHA-${parseInt(w.alg.slice(-3),10)||1}`},W=w.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new cw(oK)}break}case"EC":{switch(w.alg){case"ES256":case"ES384":case"ES512":K={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[w.alg]},W=w.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":K={name:"ECDH",namedCurve:w.crv},W=w.d?["deriveBits"]:[];break;default:throw new cw(oK)}break}case"OKP":{switch(w.alg){case"Ed25519":case"EdDSA":K={name:"Ed25519"},W=w.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":K={name:w.crv},W=w.d?["deriveBits"]:[];break;default:throw new cw(oK)}break}default:throw new cw('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:K,keyUsages:W}}async function k5(w){if(!w.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:K,keyUsages:W}=lW(w),J={...w};if(J.kty!=="AKP")delete J.alg;return delete J.use,crypto.subtle.importKey("jwk",J,K,w.ext??(w.d||w.priv?!1:!0),w.key_ops??W)}var v2="given KeyObject instance cannot be used for this algorithm",j2,g5=async(w,K,W,J=!1)=>{j2||=new WeakMap;let P=j2.get(w);if(P?.[W])return P[W];let I=await k5({...K,alg:W});if(J)Object.freeze(w);if(!P)j2.set(w,{[W]:I});else P[W]=I;return I},pW=(w,K)=>{j2||=new WeakMap;let W=j2.get(w);if(W?.[K])return W[K];let J=w.type==="public",P=J?!0:!1,I;if(w.asymmetricKeyType==="x25519"){switch(K){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(v2)}I=w.toCryptoKey(w.asymmetricKeyType,P,J?[]:["deriveBits"])}if(w.asymmetricKeyType==="ed25519"){if(K!=="EdDSA"&&K!=="Ed25519")throw TypeError(v2);I=w.toCryptoKey(w.asymmetricKeyType,P,[J?"verify":"sign"])}switch(w.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(K!==w.asymmetricKeyType.toUpperCase())throw TypeError(v2);I=w.toCryptoKey(w.asymmetricKeyType,P,[J?"verify":"sign"])}}if(w.asymmetricKeyType==="rsa"){let b;switch(K){case"RSA-OAEP":b="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":b="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":b="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":b="SHA-512";break;default:throw TypeError(v2)}if(K.startsWith("RSA-OAEP"))return w.toCryptoKey({name:"RSA-OAEP",hash:b},P,J?["encrypt"]:["decrypt"]);I=w.toCryptoKey({name:K.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:b},P,[J?"verify":"sign"])}if(w.asymmetricKeyType==="ec"){let D=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(w.asymmetricKeyDetails?.namedCurve);if(!D)throw TypeError(v2);let A={ES256:"P-256",ES384:"P-384",ES512:"P-521"};if(A[K]&&D===A[K])I=w.toCryptoKey({name:"ECDSA",namedCurve:D},P,[J?"verify":"sign"]);if(K.startsWith("ECDH-ES"))I=w.toCryptoKey({name:"ECDH",namedCurve:D},P,J?[]:["deriveBits"])}if(!I)throw TypeError(v2);if(!W)j2.set(w,{[K]:I});else W[K]=I;return I};async function C5(w,K){if(w instanceof Uint8Array)return w;if(e1(w))return w;if(f1(w)){if(w.type==="secret")return w.export();if("toCryptoKey"in w&&typeof w.toCryptoKey==="function")try{return pW(w,K)}catch(J){if(J instanceof TypeError)throw J}let W=w.export({format:"jwk"});return g5(w,W,K)}if(KK(w)){if(w.k)return H5(w.k);return g5(w,w,K,!0)}throw Error("unreachable")}function o5(w,K,W,J,P){if(P.crit!==void 0&&J?.crit===void 0)throw new w('"crit" (Critical) Header Parameter MUST be integrity protected');if(!J||J.crit===void 0)return new Set;if(!Array.isArray(J.crit)||J.crit.length===0||J.crit.some((b)=>typeof b!=="string"||b.length===0))throw new w('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let I;if(W!==void 0)I=new Map([...Object.entries(W),...K.entries()]);else I=K;for(let b of J.crit){if(!I.has(b))throw new cw(`Extension Header Parameter "${b}" is not recognized`);if(P[b]===void 0)throw new w(`Extension Header Parameter "${b}" is missing`);if(I.get(b)&&J[b]===void 0)throw new w(`Extension Header Parameter "${b}" MUST be integrity protected`)}return new Set(J.crit)}var Z2=(w)=>w?.[Symbol.toStringTag],t1=(w,K,W)=>{if(K.use!==void 0){let J;switch(W){case"sign":case"verify":J="sig";break;case"encrypt":case"decrypt":J="enc";break}if(K.use!==J)throw TypeError(`Invalid key for this operation, its "use" must be "${J}" when present`)}if(K.alg!==void 0&&K.alg!==w)throw TypeError(`Invalid key for this operation, its "alg" must be "${w}" when present`);if(Array.isArray(K.key_ops)){let J;switch(!0){case(W==="sign"||W==="verify"):case w==="dir":case w.includes("CBC-HS"):J=W;break;case w.startsWith("PBES2"):J="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(w):if(!w.includes("GCM")&&w.endsWith("KW"))J=W==="encrypt"?"wrapKey":"unwrapKey";else J=W;break;case(W==="encrypt"&&w.startsWith("RSA")):J="wrapKey";break;case W==="decrypt":J=w.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(J&&K.key_ops?.includes?.(J)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${J}" when present`)}return!0},eW=(w,K,W)=>{if(K instanceof Uint8Array)return;if(KK(K)){if(j5(K)&&t1(w,K,W))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!i1(K))throw TypeError(l1(w,K,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(K.type!=="secret")throw TypeError(`${Z2(K)} instances for symmetric algorithms must be of type "secret"`)},fW=(w,K,W)=>{if(KK(K))switch(W){case"decrypt":case"sign":if(R5(K)&&t1(w,K,W))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(v5(K)&&t1(w,K,W))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!i1(K))throw TypeError(l1(w,K,"CryptoKey","KeyObject","JSON Web Key"));if(K.type==="secret")throw TypeError(`${Z2(K)} instances for asymmetric algorithms must not be of type "secret"`);if(K.type==="public")switch(W){case"sign":throw TypeError(`${Z2(K)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${Z2(K)} instances for asymmetric algorithm decryption must be of type "private"`)}if(K.type==="private")switch(W){case"verify":throw TypeError(`${Z2(K)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${Z2(K)} instances for asymmetric algorithm encryption must be of type "public"`)}};function x5(w,K,W){switch(w.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":eW(w,K,W);break;default:fW(w,K,W)}}var S2=(w)=>Math.floor(w.getTime()/1000),r5=60,c5=r5*60,s1=c5*24,iW=s1*7,nW=s1*365.25,dW=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function a1(w){let K=dW.exec(w);if(!K||K[4]&&K[1])throw TypeError("Invalid time period format");let W=parseFloat(K[2]),J=K[3].toLowerCase(),P;switch(J){case"sec":case"secs":case"second":case"seconds":case"s":P=Math.round(W);break;case"minute":case"minutes":case"min":case"mins":case"m":P=Math.round(W*r5);break;case"hour":case"hours":case"hr":case"hrs":case"h":P=Math.round(W*c5);break;case"day":case"days":case"d":P=Math.round(W*s1);break;case"week":case"weeks":case"w":P=Math.round(W*iW);break;default:P=Math.round(W*nW);break}if(K[1]==="-"||K[4]==="ago")return-P;return P}function $2(w,K){if(!Number.isFinite(K))throw TypeError(`Invalid ${w} input`);return K}class w4{#w;constructor(w){if(!d1(w))throw TypeError("JWT Claims Set MUST be an object");this.#w=structuredClone(w)}data(){return jK.encode(JSON.stringify(this.#w))}get iss(){return this.#w.iss}set iss(w){this.#w.iss=w}get sub(){return this.#w.sub}set sub(w){this.#w.sub=w}get aud(){return this.#w.aud}set aud(w){this.#w.aud=w}set jti(w){this.#w.jti=w}set nbf(w){if(typeof w==="number")this.#w.nbf=$2("setNotBefore",w);else if(w instanceof Date)this.#w.nbf=$2("setNotBefore",S2(w));else this.#w.nbf=S2(new Date)+a1(w)}set exp(w){if(typeof w==="number")this.#w.exp=$2("setExpirationTime",w);else if(w instanceof Date)this.#w.exp=$2("setExpirationTime",S2(w));else this.#w.exp=S2(new Date)+a1(w)}set iat(w){if(w===void 0)this.#w.iat=S2(new Date);else if(w instanceof Date)this.#w.iat=$2("setIssuedAt",S2(w));else if(typeof w==="string")this.#w.iat=$2("setIssuedAt",S2(new Date)+a1(w));else this.#w.iat=$2("setIssuedAt",w)}}class K4{#w;#K;#J;constructor(w){if(!(w instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#w=w}setProtectedHeader(w){return n1(this.#K,"setProtectedHeader"),this.#K=w,this}setUnprotectedHeader(w){return n1(this.#J,"setUnprotectedHeader"),this.#J=w,this}async sign(w,K){if(!this.#K&&!this.#J)throw new I2("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!F5(this.#K,this.#J))throw new I2("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let W={...this.#K,...this.#J},J=o5(I2,new Map([["b64",!0]]),K?.crit,this.#K,W),P=!0;if(J.has("b64")){if(P=this.#K.b64,typeof P!=="boolean")throw new I2('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}let{alg:I}=W;if(typeof I!=="string"||!I)throw new I2('JWS "alg" (Algorithm) Header Parameter missing or invalid');x5(I,w,"sign");let b,D;if(P)b=gK(this.#w),D=kK(b);else D=this.#w,b="";let A,M;if(this.#K)A=gK(JSON.stringify(this.#K)),M=kK(A);else A="",M=new Uint8Array;let N=L5(M,kK("."),D),Q=await C5(w,I),B=await Z5(I,Q,N),L={signature:gK(B),payload:b};if(this.#J)L.header=this.#J;if(this.#K)L.protected=A;return L}}class W4{#w;constructor(w){this.#w=new K4(w)}setProtectedHeader(w){return this.#w.setProtectedHeader(w),this}async sign(w,K){let W=await this.#w.sign(w,K);if(W.payload===void 0)throw TypeError("use the flattened module for creating JWS with b64: false");return`${W.protected}.${W.payload}.${W.signature}`}}class xK{#w;#K;constructor(w={}){this.#K=new w4(w)}setIssuer(w){return this.#K.iss=w,this}setSubject(w){return this.#K.sub=w,this}setAudience(w){return this.#K.aud=w,this}setJti(w){return this.#K.jti=w,this}setNotBefore(w){return this.#K.nbf=w,this}setExpirationTime(w){return this.#K.exp=w,this}setIssuedAt(w){return this.#K.iat=w,this}setProtectedHeader(w){return this.#w=w,this}async sign(w,K){let W=new W4(this.#K.data());if(W.setProtectedHeader(this.#w),Array.isArray(this.#w?.crit)&&this.#w.crit.includes("b64")&&this.#w.b64===!1)throw new p1("JWTs MUST NOT use unencoded payload");return W.sign(w,K)}}class rK{params;#w=o2.ETokenAudiences.SYSTEM;#K=1;token;constructor(w){this.params=w}async signToken(){let{params:{credential:{tenantId:w,appId:K,modeId:W,secretKey:J},options:P}}=this;try{let I=new Uint8Array(Buffer.from(J,"base64")),b=await crypto.subtle.importKey("raw",I,{name:"HMAC",hash:"SHA-512"},!1,["sign","verify"]),D=await new xK({tenantId:w,appId:K,modeId:W,iss:w,aud:o2.ETokenAudiences.SYSTEM}).setProtectedHeader({alg:"HS512"}).sign(b);return this.token=D,D}catch(I){if(P?.logs)console.error("[BoolGuard] Sign token error:",I);throw I}}async ping(){let{token:w,params:{credential:{tenantId:K,appId:W,modeId:J},options:P}}=this;try{let I=w||await this.signToken(),b=new Headers;b.append("X-Tenant-ID",K),b.append("X-App-ID",W),b.append("X-Mode-ID",J),b.append("Authorization",`Bearer ${I}`);let D=await fetch(`${this.#w}/v${P?.version||this.#K}/tenant-app-modes/ping`,{method:"GET",headers:b});if(!D.ok)throw await D.json();return D.ok}catch(I){if(P?.logs)console.error("[BoolGuard] Ping error:",I);return!1}}async createPlainAccount({identity:w,password:K,metadata:W}){let{token:J,params:{credential:{tenantId:P,appId:I,modeId:b},options:D}}=this;try{let A=J||await this.signToken(),M=new Headers;M.append("X-Tenant-ID",P),M.append("X-App-ID",I),M.append("X-Mode-ID",b),M.append("Authorization",`Bearer ${A}`),M.append("Content-Type","application/json");let N=await fetch(`${this.#w}/v${D?.version||this.#K}/tenant-app-mode-accounts`,{method:"POST",headers:M,body:JSON.stringify({data:Object.freeze({type:"plain",identity:w,password:K,metadata:W})})});if(!N.ok)throw await N.json();let{data:Q}=await N.json();return Object.freeze({account:Q.account,credential:Q.credential})}catch(A){if(D?.logs)console.error("[BoolGuard] Create plain account error:",A);throw A}}async createEmailAccount({identity:w,password:K,metadata:W}){let{token:J,params:{credential:{tenantId:P,appId:I,modeId:b},options:D}}=this;try{let A=J||await this.signToken(),M=new Headers;M.append("X-Tenant-ID",P),M.append("X-App-ID",I),M.append("X-Mode-ID",b),M.append("Authorization",`Bearer ${A}`),M.append("Content-Type","application/json");let N=await fetch(`${this.#w}/v${D?.version||this.#K}/tenant-app-mode-accounts`,{method:"POST",headers:M,body:JSON.stringify({data:Object.freeze({type:"email",identity:w,password:K,metadata:W})})});if(!N.ok)throw await N.json();let{data:Q}=await N.json();return Object.freeze({account:Q.account,credential:Q.credential})}catch(A){if(D?.logs)console.error("[BoolGuard] Create email account error:",A);throw A}}async authenticate({identity:w,password:K}){let{token:W,params:{credential:{tenantId:J,appId:P,modeId:I},options:b}}=this;try{let D=W||await this.signToken(),A=await N5().safeParseAsync(w),M=new Headers;M.append("X-Tenant-ID",J),M.append("X-App-ID",P),M.append("X-Mode-ID",I),M.append("Authorization",`Bearer ${D}`),M.append("Content-Type","application/json");let N=await fetch(`${this.#w}/v${b?.version||this.#K}/tenant-app-mode-accounts/authenticate`,{method:"POST",headers:M,body:JSON.stringify({data:Object.freeze({type:!A.success?"plain":"email",identity:w,password:K})})});if(!N.ok)throw await N.json();let{data:Q}=await N.json();return Object.freeze({account:Q.account,credential:Q.credential,token:Q.token})}catch(D){if(b?.logs)console.error("[BoolGuard] Authenticate error:",D);throw D}}async verifyToken({token:w}){let{params:{credential:{tenantId:K,appId:W,modeId:J},options:P}}=this;try{let I=this.token||await this.signToken(),b=new Headers;b.append("X-Tenant-ID",K),b.append("X-App-ID",W),b.append("X-Mode-ID",J),b.append("Authorization",`Bearer ${I}`),b.append("Content-Type","application/json");let D=await fetch(`${this.#w}/v${P?.version||this.#K}/tenant-app-mode-accounts/verify`,{method:"POST",headers:b,body:JSON.stringify({data:Object.freeze({token:w})})});if(!D.ok)throw await D.json();let{data:A}=await D.json();return Object.freeze({account:A.account,credential:A.credential})}catch(I){if(P?.logs)console.error("[BoolGuard] Verify token error:",I);throw I}}}var DD=async({credential:w,definition:K,options:W})=>{let J=new rK({credential:w,definition:K,options:W});if(await J.signToken(),!await J.ping())throw Error("Ping to Bool Guard service failed!");return[hw.guardClient,J]};function k2(w){if(typeof w!=="object"||w===null)return w;Object.freeze(w);for(let K of Object.keys(w)){let W=w[K];if(typeof W==="object"&&W!==null&&!Object.isFrozen(W))k2(W)}return w}var tW=(w)=>{if(new Set([...w.map((W)=>typeof W==="string"?void 0:W.alias).filter((W)=>typeof W<"u")]).size!==w.length)throw Error("Duplicated resource alias.");let K=k2(w);return Object.freeze({resources:K,getResource:(W)=>{let J=K.findIndex(({alias:P})=>W===P);if(J===-1)throw Error("Resource not found, intialize resources error.");return K[J]},definePolicies:(W)=>{if(new Set([...W.map((J)=>typeof J==="string"?void 0:J.alias).filter((J)=>typeof J<"u")]).size!==W.length)throw Error("Duplicated policy alias.");return Object.freeze({policies:k2(W)})},defineRoles:(W)=>{if(new Set([...W.map((P)=>typeof P==="string"?void 0:P.alias).filter((P)=>typeof P<"u")]).size!==W.length)throw Error("Duplicated role alias.");let J=k2(W);return Object.freeze({roles:J,getRole:(P)=>{let I=J.findIndex(({alias:b})=>P===b);if(I===-1)throw Error("Role not found, intialize roles error.");return J[I]}})}})};export{DD as loader,tW as defineResources,hw as Keys,m1 as Guard,o2 as Enums,l0 as ControllerGuard,rK as Client,T0 as AuthState,i5 as ActionGuard};
|
|
56
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let I of w.seen.entries()){let M=I[1];if(K===I[0]){b(I);continue}if(w.external){let D=w.external.registry.get(I[0])?.id;if(K!==I[0]&&D){b(I);continue}}if(w.metadataRegistry.get(I[0])?.id){b(I);continue}if(M.cycle){b(I);continue}if(M.count>1){if(w.reused==="ref"){b(I);continue}}}}function u1(w,K){let W=w.seen.get(K);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let J=(I)=>{let M=w.seen.get(I);if(M.ref===null)return;let O=M.def??M.schema,D={...O},X=M.ref;if(M.ref=null,X){J(X);let N=w.seen.get(X),L=N.schema;if(L.$ref&&(w.target==="draft-07"||w.target==="draft-04"||w.target==="openapi-3.0"))O.allOf=O.allOf??[],O.allOf.push(L);else Object.assign(O,L);if(Object.assign(O,D),I._zod.parent===X)for(let B in O){if(B==="$ref"||B==="allOf")continue;if(!(B in D))delete O[B]}if(L.$ref&&N.def)for(let B in O){if(B==="$ref"||B==="allOf")continue;if(B in N.def&&JSON.stringify(O[B])===JSON.stringify(N.def[B]))delete O[B]}}let S=I._zod.parent;if(S&&S!==X){J(S);let N=w.seen.get(S);if(N?.schema.$ref){if(O.$ref=N.schema.$ref,N.def)for(let L in O){if(L==="$ref"||L==="allOf")continue;if(L in N.def&&JSON.stringify(O[L])===JSON.stringify(N.def[L]))delete O[L]}}}w.override({zodSchema:I,jsonSchema:O,path:M.path??[]})};for(let I of[...w.seen.entries()].reverse())J(I[0]);let P={};if(w.target==="draft-2020-12")P.$schema="https://json-schema.org/draft/2020-12/schema";else if(w.target==="draft-07")P.$schema="http://json-schema.org/draft-07/schema#";else if(w.target==="draft-04")P.$schema="http://json-schema.org/draft-04/schema#";else if(w.target==="openapi-3.0");if(w.external?.uri){let I=w.external.registry.get(K)?.id;if(!I)throw Error("Schema is missing an `id` property");P.$id=w.external.uri(I)}Object.assign(P,W.def??W.schema);let b=w.external?.defs??{};for(let I of w.seen.entries()){let M=I[1];if(M.def&&M.defId)b[M.defId]=M.def}if(w.external);else if(Object.keys(b).length>0)if(w.target==="draft-2020-12")P.$defs=b;else P.definitions=b;try{let I=JSON.parse(JSON.stringify(P));return Object.defineProperty(I,"~standard",{value:{...K["~standard"],jsonSchema:{input:s2(K,"input",w.processors),output:s2(K,"output",w.processors)}},enumerable:!1,writable:!1}),I}catch(I){throw Error("Error converting schema to JSON.")}}function Rw(w,K){let W=K??{seen:new Set};if(W.seen.has(w))return!1;W.seen.add(w);let J=w._zod.def;if(J.type==="transform")return!0;if(J.type==="array")return Rw(J.element,W);if(J.type==="set")return Rw(J.valueType,W);if(J.type==="lazy")return Rw(J.getter(),W);if(J.type==="promise"||J.type==="optional"||J.type==="nonoptional"||J.type==="nullable"||J.type==="readonly"||J.type==="default"||J.type==="prefault")return Rw(J.innerType,W);if(J.type==="intersection")return Rw(J.left,W)||Rw(J.right,W);if(J.type==="record"||J.type==="map")return Rw(J.keyType,W)||Rw(J.valueType,W);if(J.type==="pipe")return Rw(J.in,W)||Rw(J.out,W);if(J.type==="object"){for(let P in J.shape)if(Rw(J.shape[P],W))return!0;return!1}if(J.type==="union"){for(let P of J.options)if(Rw(P,W))return!0;return!1}if(J.type==="tuple"){for(let P of J.items)if(Rw(P,W))return!0;if(J.rest&&Rw(J.rest,W))return!0;return!1}return!1}var H3=(w,K={})=>(W)=>{let J=x1({...W,processors:K});return Qw(w,J),r1(J,w),u1(J,w)},s2=(w,K,W={})=>(J)=>{let{libraryOptions:P,target:b}=J??{},I=x1({...P??{},target:b,io:K,processors:W});return Qw(w,I),r1(I,w),u1(I,w)};var j9={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},z3=(w,K,W,J)=>{let P=W;P.type="string";let{minimum:b,maximum:I,format:M,patterns:O,contentEncoding:D}=w._zod.bag;if(typeof b==="number")P.minLength=b;if(typeof I==="number")P.maxLength=I;if(M){if(P.format=j9[M]??M,P.format==="")delete P.format;if(M==="time")delete P.format}if(D)P.contentEncoding=D;if(O&&O.size>0){let X=[...O];if(X.length===1)P.pattern=X[0].source;else if(X.length>1)P.allOf=[...X.map((S)=>({...K.target==="draft-07"||K.target==="draft-04"||K.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))]}};var h3=(w,K,W,J)=>{W.not={}};var F3=(w,K,W,J)=>{};var R3=(w,K,W,J)=>{let P=w._zod.def,b=l2(P.entries);if(b.every((I)=>typeof I==="number"))W.type="number";if(b.every((I)=>typeof I==="string"))W.type="string";W.enum=b};var E3=(w,K,W,J)=>{if(K.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var v3=(w,K,W,J)=>{if(K.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var Z3=(w,K,W,J)=>{let P=W,b=w._zod.def,{minimum:I,maximum:M}=w._zod.bag;if(typeof I==="number")P.minItems=I;if(typeof M==="number")P.maxItems=M;P.type="array",P.items=Qw(b.element,K,{...J,path:[...J.path,"items"]})},j3=(w,K,W,J)=>{let P=W,b=w._zod.def;P.type="object",P.properties={};let I=b.shape;for(let D in I)P.properties[D]=Qw(I[D],K,{...J,path:[...J.path,"properties",D]});let M=new Set(Object.keys(I)),O=new Set([...M].filter((D)=>{let X=b.shape[D]._zod;if(K.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(O.size>0)P.required=Array.from(O);if(b.catchall?._zod.def.type==="never")P.additionalProperties=!1;else if(!b.catchall){if(K.io==="output")P.additionalProperties=!1}else if(b.catchall)P.additionalProperties=Qw(b.catchall,K,{...J,path:[...J.path,"additionalProperties"]})},k3=(w,K,W,J)=>{let P=w._zod.def,b=P.inclusive===!1,I=P.options.map((M,O)=>Qw(M,K,{...J,path:[...J.path,b?"oneOf":"anyOf",O]}));if(b)W.oneOf=I;else W.anyOf=I},g3=(w,K,W,J)=>{let P=w._zod.def,b=Qw(P.left,K,{...J,path:[...J.path,"allOf",0]}),I=Qw(P.right,K,{...J,path:[...J.path,"allOf",1]}),M=(D)=>("allOf"in D)&&Object.keys(D).length===1,O=[...M(b)?b.allOf:[b],...M(I)?I.allOf:[I]];W.allOf=O};var c3=(w,K,W,J)=>{let P=w._zod.def,b=Qw(P.innerType,K,J),I=K.seen.get(w);if(K.target==="openapi-3.0")I.ref=P.innerType,W.nullable=!0;else W.anyOf=[b,{type:"null"}]},C3=(w,K,W,J)=>{let P=w._zod.def;Qw(P.innerType,K,J);let b=K.seen.get(w);b.ref=P.innerType},o3=(w,K,W,J)=>{let P=w._zod.def;Qw(P.innerType,K,J);let b=K.seen.get(w);b.ref=P.innerType,W.default=JSON.parse(JSON.stringify(P.defaultValue))},x3=(w,K,W,J)=>{let P=w._zod.def;Qw(P.innerType,K,J);let b=K.seen.get(w);if(b.ref=P.innerType,K.io==="input")W._prefault=JSON.parse(JSON.stringify(P.defaultValue))},r3=(w,K,W,J)=>{let P=w._zod.def;Qw(P.innerType,K,J);let b=K.seen.get(w);b.ref=P.innerType;let I;try{I=P.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}W.default=I},u3=(w,K,W,J)=>{let P=w._zod.def,b=K.io==="input"?P.in._zod.def.type==="transform"?P.out:P.in:P.out;Qw(b,K,J);let I=K.seen.get(w);I.ref=b},y3=(w,K,W,J)=>{let P=w._zod.def;Qw(P.innerType,K,J);let b=K.seen.get(w);b.ref=P.innerType,W.readOnly=!0};var y1=(w,K,W,J)=>{let P=w._zod.def;Qw(P.innerType,K,J);let b=K.seen.get(w);b.ref=P.innerType};var T9=h("ZodISODateTime",(w,K)=>{X8.init(w,K),Bw.init(w,K)});function m3(w){return S3(T9,w)}var p9=h("ZodISODate",(w,K)=>{S8.init(w,K),Bw.init(w,K)});function _3(w){return $3(p9,w)}var f9=h("ZodISOTime",(w,K)=>{$8.init(w,K),Bw.init(w,K)});function l3(w){return A3(f9,w)}var e9=h("ZodISODuration",(w,K)=>{A8.init(w,K),Bw.init(w,K)});function T3(w){return Y3(e9,w)}var f3=(w,K)=>{UK.init(w,K),w.name="ZodError",Object.defineProperties(w,{format:{value:(W)=>A1(w,W)},flatten:{value:(W)=>$1(w,W)},addIssue:{value:(W)=>{w.issues.push(W),w.message=JSON.stringify(w.issues,h2,2)}},addIssues:{value:(W)=>{w.issues.push(...W),w.message=JSON.stringify(w.issues,h2,2)}},isEmpty:{get(){return w.issues.length===0}}})},UP=h("ZodError",f3),kw=h("ZodError",f3,{Parent:Error});var e3=qK(kw),i3=HK(kw),n3=n2(kw),d3=d2(kw),t3=P6(kw),a3=b6(kw),s3=I6(kw),w5=M6(kw),K5=G6(kw),W5=O6(kw),J5=D6(kw),P5=B6(kw);var Yw=h("ZodType",(w,K)=>{return Sw.init(w,K),Object.assign(w["~standard"],{jsonSchema:{input:s2(w,"input"),output:s2(w,"output")}}),w.toJSONSchema=H3(w,{}),w.def=K,w.type=K.type,Object.defineProperty(w,"_def",{value:K}),w.check=(...W)=>{return w.clone(Pw.mergeDefs(K,{checks:[...K.checks??[],...W.map((J)=>typeof J==="function"?{_zod:{check:J,def:{check:"custom"},onattach:[]}}:J)]}),{parent:!0})},w.with=w.check,w.clone=(W,J)=>cw(w,W,J),w.brand=()=>w,w.register=(W,J)=>{return W.add(w,J),w},w.parse=(W,J)=>e3(w,W,J,{callee:w.parse}),w.safeParse=(W,J)=>n3(w,W,J),w.parseAsync=async(W,J)=>i3(w,W,J,{callee:w.parseAsync}),w.safeParseAsync=async(W,J)=>d3(w,W,J),w.spa=w.safeParseAsync,w.encode=(W,J)=>t3(w,W,J),w.decode=(W,J)=>a3(w,W,J),w.encodeAsync=async(W,J)=>s3(w,W,J),w.decodeAsync=async(W,J)=>w5(w,W,J),w.safeEncode=(W,J)=>K5(w,W,J),w.safeDecode=(W,J)=>W5(w,W,J),w.safeEncodeAsync=async(W,J)=>J5(w,W,J),w.safeDecodeAsync=async(W,J)=>P5(w,W,J),w.refine=(W,J)=>w.check(uW(W,J)),w.superRefine=(W)=>w.check(yW(W)),w.overwrite=(W)=>w.check(J2(W)),w.optional=()=>M5(w),w.exactOptional=()=>FW(w),w.nullable=()=>G5(w),w.nullish=()=>M5(G5(w)),w.nonoptional=(W)=>kW(w,W),w.array=()=>AW(w),w.or=(W)=>VW([w,W]),w.and=(W)=>UW(w,W),w.transform=(W)=>O5(w,zW(W)),w.default=(W)=>vW(w,W),w.prefault=(W)=>jW(w,W),w.catch=(W)=>cW(w,W),w.pipe=(W)=>O5(w,W),w.readonly=()=>xW(w),w.describe=(W)=>{let J=w.clone();return W2.add(J,{description:W}),J},Object.defineProperty(w,"description",{get(){return W2.get(w)?.description},configurable:!0}),w.meta=(...W)=>{if(W.length===0)return W2.get(w);let J=w.clone();return W2.add(J,W[0]),J},w.isOptional=()=>w.safeParse(void 0).success,w.isNullable=()=>w.safeParse(null).success,w.apply=(W)=>W(w),w}),D5=h("_ZodString",(w,K)=>{FK.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(J,P,b)=>z3(w,J,P,b);let W=w._zod.bag;w.format=W.format??null,w.minLength=W.minimum??null,w.maxLength=W.maximum??null,w.regex=(...J)=>w.check(F1(...J)),w.includes=(...J)=>w.check(v1(...J)),w.startsWith=(...J)=>w.check(Z1(...J)),w.endsWith=(...J)=>w.check(j1(...J)),w.min=(...J)=>w.check(R2(...J)),w.max=(...J)=>w.check(RK(...J)),w.length=(...J)=>w.check(EK(...J)),w.nonempty=(...J)=>w.check(R2(1,...J)),w.lowercase=(J)=>w.check(R1(J)),w.uppercase=(J)=>w.check(E1(J)),w.trim=()=>w.check(g1()),w.normalize=(...J)=>w.check(k1(...J)),w.toLowerCase=()=>w.check(c1()),w.toUpperCase=()=>w.check(C1()),w.slugify=()=>w.check(o1())}),d9=h("ZodString",(w,K)=>{FK.init(w,K),D5.init(w,K),w.email=(W)=>w.check(H1(N5,W)),w.url=(W)=>w.check(s8(t9,W)),w.jwt=(W)=>w.check(h1(S5,W)),w.emoji=(W)=>w.check(w3(a9,W)),w.guid=(W)=>w.check(z1(b5,W)),w.uuid=(W)=>w.check(n8(vK,W)),w.uuidv4=(W)=>w.check(d8(vK,W)),w.uuidv6=(W)=>w.check(t8(vK,W)),w.uuidv7=(W)=>w.check(a8(vK,W)),w.nanoid=(W)=>w.check(K3(s9,W)),w.guid=(W)=>w.check(z1(b5,W)),w.cuid=(W)=>w.check(W3(wW,W)),w.cuid2=(W)=>w.check(J3(KW,W)),w.ulid=(W)=>w.check(P3(WW,W)),w.base64=(W)=>w.check(B3(OW,W)),w.base64url=(W)=>w.check(N3(DW,W)),w.xid=(W)=>w.check(b3(JW,W)),w.ksuid=(W)=>w.check(I3(PW,W)),w.ipv4=(W)=>w.check(M3(bW,W)),w.ipv6=(W)=>w.check(G3(IW,W)),w.cidrv4=(W)=>w.check(O3(MW,W)),w.cidrv6=(W)=>w.check(D3(GW,W)),w.e164=(W)=>w.check(X3(BW,W)),w.datetime=(W)=>w.check(m3(W)),w.date=(W)=>w.check(_3(W)),w.time=(W)=>w.check(l3(W)),w.duration=(W)=>w.check(T3(W))});function B5(w){return i8(d9,w)}var Bw=h("ZodStringFormat",(w,K)=>{Gw.init(w,K),D5.init(w,K)}),N5=h("ZodEmail",(w,K)=>{P8.init(w,K),Bw.init(w,K)});function X5(w){return H1(N5,w)}var b5=h("ZodGUID",(w,K)=>{W8.init(w,K),Bw.init(w,K)});var vK=h("ZodUUID",(w,K)=>{J8.init(w,K),Bw.init(w,K)});var t9=h("ZodURL",(w,K)=>{b8.init(w,K),Bw.init(w,K)});var a9=h("ZodEmoji",(w,K)=>{I8.init(w,K),Bw.init(w,K)});var s9=h("ZodNanoID",(w,K)=>{M8.init(w,K),Bw.init(w,K)});var wW=h("ZodCUID",(w,K)=>{G8.init(w,K),Bw.init(w,K)});var KW=h("ZodCUID2",(w,K)=>{O8.init(w,K),Bw.init(w,K)});var WW=h("ZodULID",(w,K)=>{D8.init(w,K),Bw.init(w,K)});var JW=h("ZodXID",(w,K)=>{B8.init(w,K),Bw.init(w,K)});var PW=h("ZodKSUID",(w,K)=>{N8.init(w,K),Bw.init(w,K)});var bW=h("ZodIPv4",(w,K)=>{Y8.init(w,K),Bw.init(w,K)});var IW=h("ZodIPv6",(w,K)=>{Q8.init(w,K),Bw.init(w,K)});var MW=h("ZodCIDRv4",(w,K)=>{V8.init(w,K),Bw.init(w,K)});var GW=h("ZodCIDRv6",(w,K)=>{L8.init(w,K),Bw.init(w,K)});var OW=h("ZodBase64",(w,K)=>{q8.init(w,K),Bw.init(w,K)});var DW=h("ZodBase64URL",(w,K)=>{H8.init(w,K),Bw.init(w,K)});var BW=h("ZodE164",(w,K)=>{z8.init(w,K),Bw.init(w,K)});var S5=h("ZodJWT",(w,K)=>{h8.init(w,K),Bw.init(w,K)});function $5(w){return h1(S5,w)}var NW=h("ZodUnknown",(w,K)=>{F8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>F3(w,W,J,P)});function I5(){return Q3(NW)}var XW=h("ZodNever",(w,K)=>{R8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>h3(w,W,J,P)});function SW(w){return V3(XW,w)}var $W=h("ZodArray",(w,K)=>{E8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>Z3(w,W,J,P),w.element=K.element,w.min=(W,J)=>w.check(R2(W,J)),w.nonempty=(W)=>w.check(R2(1,W)),w.max=(W,J)=>w.check(RK(W,J)),w.length=(W,J)=>w.check(EK(W,J)),w.unwrap=()=>w.element});function AW(w,K){return L3($W,w,K)}var YW=h("ZodObject",(w,K)=>{j8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>j3(w,W,J,P),Pw.defineLazy(w,"shape",()=>{return K.shape}),w.keyof=()=>qW(Object.keys(w._zod.def.shape)),w.catchall=(W)=>w.clone({...w._zod.def,catchall:W}),w.passthrough=()=>w.clone({...w._zod.def,catchall:I5()}),w.loose=()=>w.clone({...w._zod.def,catchall:I5()}),w.strict=()=>w.clone({...w._zod.def,catchall:SW()}),w.strip=()=>w.clone({...w._zod.def,catchall:void 0}),w.extend=(W)=>{return Pw.extend(w,W)},w.safeExtend=(W)=>{return Pw.safeExtend(w,W)},w.merge=(W)=>Pw.merge(w,W),w.pick=(W)=>Pw.pick(w,W),w.omit=(W)=>Pw.omit(w,W),w.partial=(...W)=>Pw.partial(Y5,w,W[0]),w.required=(...W)=>Pw.required(Q5,w,W[0])});function A5(w,K){let W={type:"object",shape:w??{},...Pw.normalizeParams(K)};return new YW(W)}var QW=h("ZodUnion",(w,K)=>{k8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>k3(w,W,J,P),w.options=K.options});function VW(w,K){return new QW({type:"union",options:w,...Pw.normalizeParams(K)})}var LW=h("ZodIntersection",(w,K)=>{g8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>g3(w,W,J,P)});function UW(w,K){return new LW({type:"intersection",left:w,right:K})}var m1=h("ZodEnum",(w,K)=>{c8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(J,P,b)=>R3(w,J,P,b),w.enum=K.entries,w.options=Object.values(K.entries);let W=new Set(Object.keys(K.entries));w.extract=(J,P)=>{let b={};for(let I of J)if(W.has(I))b[I]=K.entries[I];else throw Error(`Key ${I} not found in enum`);return new m1({...K,checks:[],...Pw.normalizeParams(P),entries:b})},w.exclude=(J,P)=>{let b={...K.entries};for(let I of J)if(W.has(I))delete b[I];else throw Error(`Key ${I} not found in enum`);return new m1({...K,checks:[],...Pw.normalizeParams(P),entries:b})}});function qW(w,K){let W=Array.isArray(w)?Object.fromEntries(w.map((J)=>[J,J])):w;return new m1({type:"enum",entries:W,...Pw.normalizeParams(K)})}var HW=h("ZodTransform",(w,K)=>{C8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>v3(w,W,J,P),w._zod.parse=(W,J)=>{if(J.direction==="backward")throw new m2(w.constructor.name);W.addIssue=(b)=>{if(typeof b==="string")W.issues.push(Pw.issue(b,W.value,K));else{let I=b;if(I.fatal)I.continue=!1;I.code??(I.code="custom"),I.input??(I.input=W.value),I.inst??(I.inst=w),W.issues.push(Pw.issue(I))}};let P=K.transform(W.value,W);if(P instanceof Promise)return P.then((b)=>{return W.value=b,W});return W.value=P,W}});function zW(w){return new HW({type:"transform",transform:w})}var Y5=h("ZodOptional",(w,K)=>{U1.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>y1(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function M5(w){return new Y5({type:"optional",innerType:w})}var hW=h("ZodExactOptional",(w,K)=>{o8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>y1(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function FW(w){return new hW({type:"optional",innerType:w})}var RW=h("ZodNullable",(w,K)=>{x8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>c3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function G5(w){return new RW({type:"nullable",innerType:w})}var EW=h("ZodDefault",(w,K)=>{r8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>o3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType,w.removeDefault=w.unwrap});function vW(w,K){return new EW({type:"default",innerType:w,get defaultValue(){return typeof K==="function"?K():Pw.shallowClone(K)}})}var ZW=h("ZodPrefault",(w,K)=>{u8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>x3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function jW(w,K){return new ZW({type:"prefault",innerType:w,get defaultValue(){return typeof K==="function"?K():Pw.shallowClone(K)}})}var Q5=h("ZodNonOptional",(w,K)=>{y8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>C3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function kW(w,K){return new Q5({type:"nonoptional",innerType:w,...Pw.normalizeParams(K)})}var gW=h("ZodCatch",(w,K)=>{m8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>r3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType,w.removeCatch=w.unwrap});function cW(w,K){return new gW({type:"catch",innerType:w,catchValue:typeof K==="function"?K:()=>K})}var CW=h("ZodPipe",(w,K)=>{_8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>u3(w,W,J,P),w.in=K.in,w.out=K.out});function O5(w,K){return new CW({type:"pipe",in:w,out:K})}var oW=h("ZodReadonly",(w,K)=>{l8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>y3(w,W,J,P),w.unwrap=()=>w._zod.def.innerType});function xW(w){return new oW({type:"readonly",innerType:w})}var rW=h("ZodCustom",(w,K)=>{T8.init(w,K),Yw.init(w,K),w._zod.processJSONSchema=(W,J,P)=>E3(w,W,J,P)});function uW(w,K={}){return U3(rW,w,K)}function yW(w){return q3(w)}gw(q1());var V5=A5({authorization:B5().startsWith("Bearer ").transform((w,K)=>{let[W,J]=w.split(" ");if(!$5().safeParse(J).success)return K.addIssue("Token must be match jsonwebtoken format."),M1;return Object.freeze({schema:W,token:J})})});class _1{clientInstance;constructor(w){this.clientInstance=w}async enforce(w,K,W){if(!this.clientInstance)throw Error("Bool guard instance not found.");let J=Reflect.getOwnMetadataKeys(w.class,w.funcName),P=Reflect.getOwnMetadataKeys(w.class),b=J.includes(Fw.guardMetadata),I=P.includes(Fw.guardMetadata);if(!b&&!I)return!0;let M=await V5.safeParseAsync(K.toJSON());if(!M.success)return!1;try{let{authorization:{token:O}}=M.data,{account:D,credential:X}=await this.clientInstance.verifyToken({token:O}),S=Object.freeze({account:D,credential:X});return W.set(Fw.authState,S),!0}catch{return!1}}}iK([c2(0,x4()),c2(1,o4()),c2(2,$K())],_1.prototype,"enforce",null),_1=iK([r4(),c2(0,u4(Fw.guardClient))],_1);var ZK=new TextEncoder,jK=new TextDecoder;function L5(...w){let K=w.reduce((P,{length:b})=>P+b,0),W=new Uint8Array(K),J=0;for(let P of w)W.set(P,J),J+=P.length;return W}function kK(w){let K=new Uint8Array(w.length);for(let W=0;W<w.length;W++){let J=w.charCodeAt(W);if(J>127)throw TypeError("non-ASCII string encountered in encode()");K[W]=J}return K}function U5(w){if(Uint8Array.prototype.toBase64)return w.toBase64();let K=32768,W=[];for(let J=0;J<w.length;J+=K)W.push(String.fromCharCode.apply(null,w.subarray(J,J+K)));return btoa(W.join(""))}function q5(w){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(w);let K=atob(w),W=new Uint8Array(K.length);for(let J=0;J<K.length;J++)W[J]=K.charCodeAt(J);return W}function H5(w){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof w==="string"?w:jK.decode(w),{alphabet:"base64url"});let K=w;if(K instanceof Uint8Array)K=jK.decode(K);K=K.replace(/-/g,"+").replace(/_/g,"/");try{return q5(K)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function gK(w){let K=w;if(typeof K==="string")K=ZK.encode(K);if(Uint8Array.prototype.toBase64)return K.toBase64({alphabet:"base64url",omitPadding:!0});return U5(K).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var P2=(w,K="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${K} must be ${w}`),E2=(w,K)=>w.name===K;function mW(w){return parseInt(w.name.slice(4),10)}function l1(w,K){if(mW(w.hash)!==K)throw P2(`SHA-${K}`,"algorithm.hash")}function _W(w){switch(w){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function lW(w,K){if(K&&!w.usages.includes(K))throw TypeError(`CryptoKey does not support this operation, its usages must include ${K}.`)}function z5(w,K,W){switch(K){case"HS256":case"HS384":case"HS512":{if(!E2(w.algorithm,"HMAC"))throw P2("HMAC");l1(w.algorithm,parseInt(K.slice(2),10));break}case"RS256":case"RS384":case"RS512":{if(!E2(w.algorithm,"RSASSA-PKCS1-v1_5"))throw P2("RSASSA-PKCS1-v1_5");l1(w.algorithm,parseInt(K.slice(2),10));break}case"PS256":case"PS384":case"PS512":{if(!E2(w.algorithm,"RSA-PSS"))throw P2("RSA-PSS");l1(w.algorithm,parseInt(K.slice(2),10));break}case"Ed25519":case"EdDSA":{if(!E2(w.algorithm,"Ed25519"))throw P2("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!E2(w.algorithm,K))throw P2(K);break}case"ES256":case"ES384":case"ES512":{if(!E2(w.algorithm,"ECDSA"))throw P2("ECDSA");let J=_W(K);if(w.algorithm.namedCurve!==J)throw P2(J,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}lW(w,W)}function h5(w,K,...W){if(W=W.filter(Boolean),W.length>2){let J=W.pop();w+=`one of type ${W.join(", ")}, or ${J}.`}else if(W.length===2)w+=`one of type ${W[0]} or ${W[1]}.`;else w+=`of type ${W[0]}.`;if(K==null)w+=` Received ${K}`;else if(typeof K==="function"&&K.name)w+=` Received function ${K.name}`;else if(typeof K==="object"&&K!=null){if(K.constructor?.name)w+=` Received an instance of ${K.constructor.name}`}return w}var F5=(w,...K)=>h5("Key must be ",w,...K),T1=(w,K,...W)=>h5(`Key for the ${w} algorithm must be `,K,...W);class cK extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(w,K){super(w,K);this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class rw extends cK{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class b2 extends cK{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class p1 extends cK{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}var f1=(w)=>{if(w?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return w instanceof CryptoKey}catch{return!1}},e1=(w)=>w?.[Symbol.toStringTag]==="KeyObject",i1=(w)=>f1(w)||e1(w);var LI=Symbol();function n1(w,K){if(w)throw TypeError(`${K} can only be called once`)}var TW=(w)=>typeof w==="object"&&w!==null;function d1(w){if(!TW(w)||Object.prototype.toString.call(w)!=="[object Object]")return!1;if(Object.getPrototypeOf(w)===null)return!0;let K=w;while(Object.getPrototypeOf(K)!==null)K=Object.getPrototypeOf(K);return Object.getPrototypeOf(w)===K}function R5(...w){let K=w.filter(Boolean);if(K.length===0||K.length===1)return!0;let W;for(let J of K){let P=Object.keys(J);if(!W||W.size===0){W=new Set(P);continue}for(let b of P){if(W.has(b))return!1;W.add(b)}}return!0}var KK=(w)=>d1(w)&&typeof w.kty==="string",E5=(w)=>w.kty!=="oct"&&(w.kty==="AKP"&&typeof w.priv==="string"||typeof w.d==="string"),v5=(w)=>w.kty!=="oct"&&w.d===void 0&&w.priv===void 0,Z5=(w)=>w.kty==="oct"&&typeof w.k==="string";function fW(w,K){if(w.startsWith("RS")||w.startsWith("PS")){let{modulusLength:W}=K.algorithm;if(typeof W!=="number"||W<2048)throw TypeError(`${w} requires key modulusLength to be 2048 bits or larger`)}}function eW(w,K){let W=`SHA-${w.slice(-3)}`;switch(w){case"HS256":case"HS384":case"HS512":return{hash:W,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:W,name:"RSA-PSS",saltLength:parseInt(w.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:W,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:W,name:"ECDSA",namedCurve:K.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:w};default:throw new rw(`alg ${w} is not supported either by JOSE or your javascript runtime`)}}async function iW(w,K,W){if(K instanceof Uint8Array){if(!w.startsWith("HS"))throw TypeError(F5(K,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",K,{hash:`SHA-${w.slice(-3)}`,name:"HMAC"},!1,[W])}return z5(K,w,W),K}async function j5(w,K,W){let J=await iW(w,K,"sign");fW(w,J);let P=await crypto.subtle.sign(eW(w,J.algorithm),J,W);return new Uint8Array(P)}var CK='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';function nW(w){let K,W;switch(w.kty){case"AKP":{switch(w.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":K={name:w.alg},W=w.priv?["sign"]:["verify"];break;default:throw new rw(CK)}break}case"RSA":{switch(w.alg){case"PS256":case"PS384":case"PS512":K={name:"RSA-PSS",hash:`SHA-${w.alg.slice(-3)}`},W=w.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":K={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${w.alg.slice(-3)}`},W=w.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":K={name:"RSA-OAEP",hash:`SHA-${parseInt(w.alg.slice(-3),10)||1}`},W=w.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new rw(CK)}break}case"EC":{switch(w.alg){case"ES256":case"ES384":case"ES512":K={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[w.alg]},W=w.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":K={name:"ECDH",namedCurve:w.crv},W=w.d?["deriveBits"]:[];break;default:throw new rw(CK)}break}case"OKP":{switch(w.alg){case"Ed25519":case"EdDSA":K={name:"Ed25519"},W=w.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":K={name:w.crv},W=w.d?["deriveBits"]:[];break;default:throw new rw(CK)}break}default:throw new rw('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:K,keyUsages:W}}async function k5(w){if(!w.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:K,keyUsages:W}=nW(w),J={...w};if(J.kty!=="AKP")delete J.alg;return delete J.use,crypto.subtle.importKey("jwk",J,K,w.ext??(w.d||w.priv?!1:!0),w.key_ops??W)}var v2="given KeyObject instance cannot be used for this algorithm",Z2,g5=async(w,K,W,J=!1)=>{Z2||=new WeakMap;let P=Z2.get(w);if(P?.[W])return P[W];let b=await k5({...K,alg:W});if(J)Object.freeze(w);if(!P)Z2.set(w,{[W]:b});else P[W]=b;return b},dW=(w,K)=>{Z2||=new WeakMap;let W=Z2.get(w);if(W?.[K])return W[K];let J=w.type==="public",P=J?!0:!1,b;if(w.asymmetricKeyType==="x25519"){switch(K){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(v2)}b=w.toCryptoKey(w.asymmetricKeyType,P,J?[]:["deriveBits"])}if(w.asymmetricKeyType==="ed25519"){if(K!=="EdDSA"&&K!=="Ed25519")throw TypeError(v2);b=w.toCryptoKey(w.asymmetricKeyType,P,[J?"verify":"sign"])}switch(w.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(K!==w.asymmetricKeyType.toUpperCase())throw TypeError(v2);b=w.toCryptoKey(w.asymmetricKeyType,P,[J?"verify":"sign"])}}if(w.asymmetricKeyType==="rsa"){let I;switch(K){case"RSA-OAEP":I="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":I="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":I="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":I="SHA-512";break;default:throw TypeError(v2)}if(K.startsWith("RSA-OAEP"))return w.toCryptoKey({name:"RSA-OAEP",hash:I},P,J?["encrypt"]:["decrypt"]);b=w.toCryptoKey({name:K.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:I},P,[J?"verify":"sign"])}if(w.asymmetricKeyType==="ec"){let M=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(w.asymmetricKeyDetails?.namedCurve);if(!M)throw TypeError(v2);let O={ES256:"P-256",ES384:"P-384",ES512:"P-521"};if(O[K]&&M===O[K])b=w.toCryptoKey({name:"ECDSA",namedCurve:M},P,[J?"verify":"sign"]);if(K.startsWith("ECDH-ES"))b=w.toCryptoKey({name:"ECDH",namedCurve:M},P,J?[]:["deriveBits"])}if(!b)throw TypeError(v2);if(!W)Z2.set(w,{[K]:b});else W[K]=b;return b};async function c5(w,K){if(w instanceof Uint8Array)return w;if(f1(w))return w;if(e1(w)){if(w.type==="secret")return w.export();if("toCryptoKey"in w&&typeof w.toCryptoKey==="function")try{return dW(w,K)}catch(J){if(J instanceof TypeError)throw J}let W=w.export({format:"jwk"});return g5(w,W,K)}if(KK(w)){if(w.k)return H5(w.k);return g5(w,w,K,!0)}throw Error("unreachable")}function C5(w,K,W,J,P){if(P.crit!==void 0&&J?.crit===void 0)throw new w('"crit" (Critical) Header Parameter MUST be integrity protected');if(!J||J.crit===void 0)return new Set;if(!Array.isArray(J.crit)||J.crit.length===0||J.crit.some((I)=>typeof I!=="string"||I.length===0))throw new w('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let b;if(W!==void 0)b=new Map([...Object.entries(W),...K.entries()]);else b=K;for(let I of J.crit){if(!b.has(I))throw new rw(`Extension Header Parameter "${I}" is not recognized`);if(P[I]===void 0)throw new w(`Extension Header Parameter "${I}" is missing`);if(b.get(I)&&J[I]===void 0)throw new w(`Extension Header Parameter "${I}" MUST be integrity protected`)}return new Set(J.crit)}var j2=(w)=>w?.[Symbol.toStringTag],t1=(w,K,W)=>{if(K.use!==void 0){let J;switch(W){case"sign":case"verify":J="sig";break;case"encrypt":case"decrypt":J="enc";break}if(K.use!==J)throw TypeError(`Invalid key for this operation, its "use" must be "${J}" when present`)}if(K.alg!==void 0&&K.alg!==w)throw TypeError(`Invalid key for this operation, its "alg" must be "${w}" when present`);if(Array.isArray(K.key_ops)){let J;switch(!0){case(W==="sign"||W==="verify"):case w==="dir":case w.includes("CBC-HS"):J=W;break;case w.startsWith("PBES2"):J="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(w):if(!w.includes("GCM")&&w.endsWith("KW"))J=W==="encrypt"?"wrapKey":"unwrapKey";else J=W;break;case(W==="encrypt"&&w.startsWith("RSA")):J="wrapKey";break;case W==="decrypt":J=w.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(J&&K.key_ops?.includes?.(J)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${J}" when present`)}return!0},tW=(w,K,W)=>{if(K instanceof Uint8Array)return;if(KK(K)){if(Z5(K)&&t1(w,K,W))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!i1(K))throw TypeError(T1(w,K,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(K.type!=="secret")throw TypeError(`${j2(K)} instances for symmetric algorithms must be of type "secret"`)},aW=(w,K,W)=>{if(KK(K))switch(W){case"decrypt":case"sign":if(E5(K)&&t1(w,K,W))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(v5(K)&&t1(w,K,W))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!i1(K))throw TypeError(T1(w,K,"CryptoKey","KeyObject","JSON Web Key"));if(K.type==="secret")throw TypeError(`${j2(K)} instances for asymmetric algorithms must not be of type "secret"`);if(K.type==="public")switch(W){case"sign":throw TypeError(`${j2(K)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${j2(K)} instances for asymmetric algorithm decryption must be of type "private"`)}if(K.type==="private")switch(W){case"verify":throw TypeError(`${j2(K)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${j2(K)} instances for asymmetric algorithm encryption must be of type "public"`)}};function o5(w,K,W){switch(w.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":tW(w,K,W);break;default:aW(w,K,W)}}var $2=(w)=>Math.floor(w.getTime()/1000),x5=60,r5=x5*60,s1=r5*24,sW=s1*7,wJ=s1*365.25,KJ=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function a1(w){let K=KJ.exec(w);if(!K||K[4]&&K[1])throw TypeError("Invalid time period format");let W=parseFloat(K[2]),J=K[3].toLowerCase(),P;switch(J){case"sec":case"secs":case"second":case"seconds":case"s":P=Math.round(W);break;case"minute":case"minutes":case"min":case"mins":case"m":P=Math.round(W*x5);break;case"hour":case"hours":case"hr":case"hrs":case"h":P=Math.round(W*r5);break;case"day":case"days":case"d":P=Math.round(W*s1);break;case"week":case"weeks":case"w":P=Math.round(W*sW);break;default:P=Math.round(W*wJ);break}if(K[1]==="-"||K[4]==="ago")return-P;return P}function A2(w,K){if(!Number.isFinite(K))throw TypeError(`Invalid ${w} input`);return K}class w4{#w;constructor(w){if(!d1(w))throw TypeError("JWT Claims Set MUST be an object");this.#w=structuredClone(w)}data(){return ZK.encode(JSON.stringify(this.#w))}get iss(){return this.#w.iss}set iss(w){this.#w.iss=w}get sub(){return this.#w.sub}set sub(w){this.#w.sub=w}get aud(){return this.#w.aud}set aud(w){this.#w.aud=w}set jti(w){this.#w.jti=w}set nbf(w){if(typeof w==="number")this.#w.nbf=A2("setNotBefore",w);else if(w instanceof Date)this.#w.nbf=A2("setNotBefore",$2(w));else this.#w.nbf=$2(new Date)+a1(w)}set exp(w){if(typeof w==="number")this.#w.exp=A2("setExpirationTime",w);else if(w instanceof Date)this.#w.exp=A2("setExpirationTime",$2(w));else this.#w.exp=$2(new Date)+a1(w)}set iat(w){if(w===void 0)this.#w.iat=$2(new Date);else if(w instanceof Date)this.#w.iat=A2("setIssuedAt",$2(w));else if(typeof w==="string")this.#w.iat=A2("setIssuedAt",$2(new Date)+a1(w));else this.#w.iat=A2("setIssuedAt",w)}}class K4{#w;#K;#J;constructor(w){if(!(w instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#w=w}setProtectedHeader(w){return n1(this.#K,"setProtectedHeader"),this.#K=w,this}setUnprotectedHeader(w){return n1(this.#J,"setUnprotectedHeader"),this.#J=w,this}async sign(w,K){if(!this.#K&&!this.#J)throw new b2("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!R5(this.#K,this.#J))throw new b2("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let W={...this.#K,...this.#J},J=C5(b2,new Map([["b64",!0]]),K?.crit,this.#K,W),P=!0;if(J.has("b64")){if(P=this.#K.b64,typeof P!=="boolean")throw new b2('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}let{alg:b}=W;if(typeof b!=="string"||!b)throw new b2('JWS "alg" (Algorithm) Header Parameter missing or invalid');o5(b,w,"sign");let I,M;if(P)I=gK(this.#w),M=kK(I);else M=this.#w,I="";let O,D;if(this.#K)O=gK(JSON.stringify(this.#K)),D=kK(O);else O="",D=new Uint8Array;let X=L5(D,kK("."),M),S=await c5(w,b),N=await j5(b,S,X),L={signature:gK(N),payload:I};if(this.#J)L.header=this.#J;if(this.#K)L.protected=O;return L}}class W4{#w;constructor(w){this.#w=new K4(w)}setProtectedHeader(w){return this.#w.setProtectedHeader(w),this}async sign(w,K){let W=await this.#w.sign(w,K);if(W.payload===void 0)throw TypeError("use the flattened module for creating JWS with b64: false");return`${W.protected}.${W.payload}.${W.signature}`}}class oK{#w;#K;constructor(w={}){this.#K=new w4(w)}setIssuer(w){return this.#K.iss=w,this}setSubject(w){return this.#K.sub=w,this}setAudience(w){return this.#K.aud=w,this}setJti(w){return this.#K.jti=w,this}setNotBefore(w){return this.#K.nbf=w,this}setExpirationTime(w){return this.#K.exp=w,this}setIssuedAt(w){return this.#K.iat=w,this}setProtectedHeader(w){return this.#w=w,this}async sign(w,K){let W=new W4(this.#K.data());if(W.setProtectedHeader(this.#w),Array.isArray(this.#w?.crit)&&this.#w.crit.includes("b64")&&this.#w.b64===!1)throw new p1("JWTs MUST NOT use unencoded payload");return W.sign(w,K)}}class xK{params;#w=C2.ETokenAudiences.SYSTEM;#K=1;token;constructor(w){this.params=w}async signToken(){let{params:{credential:{tenantId:w,appId:K,modeId:W,secretKey:J},options:P}}=this;try{let b=new Uint8Array(Buffer.from(J,"base64")),I=await crypto.subtle.importKey("raw",b,{name:"HMAC",hash:"SHA-512"},!1,["sign","verify"]),M=await new oK({tenantId:w,appId:K,modeId:W,iss:w,aud:C2.ETokenAudiences.SYSTEM}).setProtectedHeader({alg:"HS512"}).sign(I);return this.token=M,M}catch(b){if(P?.logs)console.error("[BoolGuard] Sign token error:",b);throw b}}async ping(){let{token:w,params:{credential:{tenantId:K,appId:W,modeId:J},options:P}}=this;try{let b=w||await this.signToken(),I=new Headers;I.append("X-Tenant-ID",K),I.append("X-App-ID",W),I.append("X-Mode-ID",J),I.append("Authorization",`Bearer ${b}`);let M=await fetch(`${this.#w}/v${P?.version||this.#K}/tenant-app-modes/ping`,{method:"GET",headers:I});if(!M.ok)throw await M.json();return M.ok}catch(b){if(P?.logs)console.error("[BoolGuard] Ping error:",b);return!1}}async createPlainAccount({identity:w,password:K,metadata:W}){let{token:J,params:{credential:{tenantId:P,appId:b,modeId:I},options:M}}=this;try{let O=J||await this.signToken(),D=new Headers;D.append("X-Tenant-ID",P),D.append("X-App-ID",b),D.append("X-Mode-ID",I),D.append("Authorization",`Bearer ${O}`),D.append("Content-Type","application/json");let X=await fetch(`${this.#w}/v${M?.version||this.#K}/tenant-app-mode-accounts`,{method:"POST",headers:D,body:JSON.stringify({data:Object.freeze({type:"plain",identity:w,password:K,metadata:W})})});if(!X.ok)throw await X.json();let{data:S}=await X.json();return Object.freeze({account:S.account,credential:S.credential})}catch(O){if(M?.logs)console.error("[BoolGuard] Create plain account error:",O);throw O}}async createEmailAccount({identity:w,password:K,metadata:W}){let{token:J,params:{credential:{tenantId:P,appId:b,modeId:I},options:M}}=this;try{let O=J||await this.signToken(),D=new Headers;D.append("X-Tenant-ID",P),D.append("X-App-ID",b),D.append("X-Mode-ID",I),D.append("Authorization",`Bearer ${O}`),D.append("Content-Type","application/json");let X=await fetch(`${this.#w}/v${M?.version||this.#K}/tenant-app-mode-accounts`,{method:"POST",headers:D,body:JSON.stringify({data:Object.freeze({type:"email",identity:w,password:K,metadata:W})})});if(!X.ok)throw await X.json();let{data:S}=await X.json();return Object.freeze({account:S.account,credential:S.credential})}catch(O){if(M?.logs)console.error("[BoolGuard] Create email account error:",O);throw O}}async authenticate({identity:w,password:K}){let{token:W,params:{credential:{tenantId:J,appId:P,modeId:b},options:I}}=this;try{let M=W||await this.signToken(),O=await X5().safeParseAsync(w),D=new Headers;D.append("X-Tenant-ID",J),D.append("X-App-ID",P),D.append("X-Mode-ID",b),D.append("Authorization",`Bearer ${M}`),D.append("Content-Type","application/json");let X=await fetch(`${this.#w}/v${I?.version||this.#K}/tenant-app-mode-accounts/authenticate`,{method:"POST",headers:D,body:JSON.stringify({data:Object.freeze({type:!O.success?"plain":"email",identity:w,password:K})})});if(!X.ok)throw await X.json();let{data:S}=await X.json();return Object.freeze({account:S.account,credential:S.credential,token:S.token})}catch(M){if(I?.logs)console.error("[BoolGuard] Authenticate error:",M);throw M}}async verifyToken({token:w}){let{params:{credential:{tenantId:K,appId:W,modeId:J},options:P}}=this;try{let b=this.token||await this.signToken(),I=new Headers;I.append("X-Tenant-ID",K),I.append("X-App-ID",W),I.append("X-Mode-ID",J),I.append("Authorization",`Bearer ${b}`),I.append("Content-Type","application/json");let M=await fetch(`${this.#w}/v${P?.version||this.#K}/tenant-app-mode-accounts/verify`,{method:"POST",headers:I,body:JSON.stringify({data:Object.freeze({token:w})})});if(!M.ok)throw await M.json();let{data:O}=await M.json();return Object.freeze({account:O.account,credential:O.credential})}catch(b){if(P?.logs)console.error("[BoolGuard] Verify token error:",b);throw b}}}var NM=async({credential:w,definition:K,options:W})=>{let J=new xK({credential:w,definition:K,options:W});if(await J.signToken(),!await J.ping())throw Error("Ping to Bool Guard service failed!");return[Fw.guardClient,J]};function k2(w){if(typeof w!=="object"||w===null)return w;Object.freeze(w);for(let K of Object.keys(w)){let W=w[K];if(typeof W==="object"&&W!==null&&!Object.isFrozen(W))k2(W)}return w}var WJ=(w)=>{if(new Set([...w.map((W)=>typeof W==="string"?void 0:W.alias).filter((W)=>typeof W<"u")]).size!==w.length)throw Error("Duplicated resource alias.");let K=k2(w);return Object.freeze({resources:K,getResource:(W)=>{let J=K.findIndex(({alias:P})=>W===P);if(J===-1)throw Error("Resource not found, intialize resources error.");return K[J]},definePolicies:(W)=>{if(new Set([...W.map((J)=>typeof J==="string"?void 0:J.alias).filter((J)=>typeof J<"u")]).size!==W.length)throw Error("Duplicated policy alias.");return Object.freeze({policies:k2(W)})},defineRoles:(W)=>{if(new Set([...W.map((P)=>typeof P==="string"?void 0:P.alias).filter((P)=>typeof P<"u")]).size!==W.length)throw Error("Duplicated role alias.");let J=k2(W);return Object.freeze({roles:J,getRole:(P)=>{let b=J.findIndex(({alias:I})=>P===I);if(b===-1)throw Error("Role not found, intialize roles error.");return J[b]}})}})};export{NM as loader,WJ as defineResources,Fw as Keys,_1 as Guard,C2 as Enums,n0 as ControllerGuard,xK as Client,i0 as AuthState,i5 as ActionGuard};
|
|
57
57
|
|
|
58
|
-
//# debugId=
|
|
58
|
+
//# debugId=34AEF54052496C0364756E2164756E21
|