@tsed/core
Advanced tools
Comparing version 7.68.3 to 7.68.4
/*! For license information please see core.umd.min.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@tsed/core"]=e():t["@tsed/core"]=e()}(self,(()=>(()=>{var t={340:t=>{function e(t){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}e.keys=()=>[],e.resolve=e,e.id=340,t.exports=e},605:(t,e,r)=>{var n;!function(t){!function(e){var n="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),o=i(t);function i(t,e){return function(r,n){Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0!==n.Reflect&&(o=i(n.Reflect,o)),function(t,e){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,u={__proto__:[]}instanceof Array,a=!s&&!u,c={create:s?function(){return V(Object.create(null))}:u?function(){return V({__proto__:null})}:function(){return V({})},has:a?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:a?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},f=Object.getPrototypeOf(Function),l="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,x(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,n)},e.prototype.values=function(){return new r(this._keys,this._values,o)},e.prototype.entries=function(){return new r(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){if(!x(this._cacheKey,t)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(x(this._keys[r],t)){this._cacheIndex=r;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function o(t,e){return e}function s(t,e){return[t,e]}}(),p="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}(),y="function"==typeof WeakMap?WeakMap:function(){var t=c.create(),e=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?c.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+s()}while(c.has(t,e));return t[e]=!0,e}function o(t,n){if(!r.call(t,e)){if(!n)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}function i(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function s(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):i(new Uint8Array(t),t):i(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",n=0;n<16;++n){var o=e[n];4!==n&&6!==n&&8!==n||(r+="-"),o<16&&(r+="0"),r+=o.toString(16).toLowerCase()}return r}}(),h=n?Symbol.for("@reflect-metadata:registry"):void 0,d=function(){var t;return!P(h)&&S(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[h]),P(t)&&(t=function(){var t,r,n,o;P(h)||void 0===e.Reflect||h in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=function(t){var e=t.defineMetadata,r=t.hasOwnMetadata,n=t.getOwnMetadata,o=t.getOwnMetadataKeys,i=t.deleteMetadata,s=new y;return{isProviderFor:function(t,e){var r=s.get(t);return P(r)?!!o(t,e).length&&(P(r)&&(r=new p,s.set(t,r)),r.add(e),!0):r.has(e)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:i}}(e.Reflect));var i=new y,s={registerProvider:u,getProvider:c,setProvider:d};return s;function u(e){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case P(r):r=e;break;case r===e:break;case P(n):n=e;break;case n===e:break;default:void 0===o&&(o=new p),o.add(e)}}function a(e,i){if(!P(r)){if(r.isProviderFor(e,i))return r;if(!P(n)){if(n.isProviderFor(e,i))return r;if(!P(o))for(var s=F(o);;){var u=K(s);if(!u)return;var a=B(u);if(a.isProviderFor(e,i))return I(s),a}}}if(!P(t)&&t.isProviderFor(e,i))return t}function c(t,e){var r,n=i.get(t);return P(n)||(r=n.get(e)),P(r)?(P(r=a(t,e))||(P(n)&&(n=new l,i.set(t,n)),n.set(e,r)),r):r}function f(t){if(P(t))throw new TypeError;return r===t||n===t||!P(o)&&o.has(t)}function d(t,e,r){if(!f(r))throw new Error("Metadata provider not registered.");var n=c(t,e);if(n!==r){if(!P(n))return!1;var o=i.get(t);P(o)&&(o=new l,i.set(t,o)),o.set(e,r)}return!0}}()),!P(h)&&S(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}(),v=function(t){var e=new y,r={isProviderFor:function(t,r){var n=e.get(t);return!P(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(t,e,r,o){n(r,o,!0).set(t,e)},OrdinaryHasOwnMetadata:function(t,e,r){var o=n(e,r,!1);return!P(o)&&j(o.has(t))},OrdinaryGetOwnMetadata:function(t,e,r){var o=n(e,r,!1);if(!P(o))return o.get(t)},OrdinaryOwnMetadataKeys:function(t,e){var r=[],o=n(t,e,!1);if(P(o))return r;for(var i=F(o.keys()),s=0;;){var u=K(i);if(!u)return r.length=s,r;var a=B(u);try{r[s]=a}catch(t){try{I(i)}finally{throw t}}s++}},OrdinaryDeleteMetadata:function(t,r,o){var i=n(r,o,!1);if(P(i))return!1;if(!i.delete(t))return!1;if(0===i.size){var s=e.get(r);P(s)||(s.delete(o),0===s.size&&e.delete(s))}return!0}};return d.registerProvider(r),r;function n(n,o,i){var s=e.get(n),u=!1;if(P(s)){if(!i)return;s=new l,e.set(n,s),u=!0}var a=s.get(o);if(P(a)){if(!i)return;if(a=new l,s.set(o,a),!t.setProvider(n,o,r))throw s.delete(o),u&&e.delete(n),new Error("Wrong provider for target.")}return a}}(d);function g(t,e,r){if(w(t,e,r))return!0;var n=L(e);return!R(n)&&g(t,n,r)}function w(t,e,r){var n=U(e,r,!1);return!P(n)&&j(n.OrdinaryHasOwnMetadata(t,e,r))}function b(t,e,r){if(w(t,e,r))return m(t,e,r);var n=L(e);return R(n)?void 0:b(t,n,r)}function m(t,e,r){var n=U(e,r,!1);if(!P(n))return n.OrdinaryGetOwnMetadata(t,e,r)}function O(t,e,r,n){U(r,n,!0).OrdinaryDefineOwnMetadata(t,e,r,n)}function _(t,e){var r=E(t,e),n=L(t);if(null===n)return r;var o=_(n,e);if(o.length<=0)return r;if(r.length<=0)return o;for(var i=new p,s=[],u=0,a=r;u<a.length;u++){var c=a[u];i.has(c)||(i.add(c),s.push(c))}for(var f=0,l=o;f<l.length;f++)c=l[f],i.has(c)||(i.add(c),s.push(c));return s}function E(t,e){var r=U(t,e,!1);return r?r.OrdinaryOwnMetadataKeys(t,e):[]}function M(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function P(t){return void 0===t}function R(t){return null===t}function S(t){return"object"==typeof t?null!==t:"function"==typeof t}function T(t,e){switch(M(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",n=N(t,o);if(void 0!==n){var i=n.call(t,r);if(S(i))throw new TypeError;return i}return function(t,e){if("string"===e){var r=t.toString;if(k(r)&&!S(o=r.call(t)))return o;if(k(n=t.valueOf)&&!S(o=n.call(t)))return o}else{var n;if(k(n=t.valueOf)&&!S(o=n.call(t)))return o;var o,i=t.toString;if(k(i)&&!S(o=i.call(t)))return o}throw new TypeError}(t,"default"===r?"number":r)}function j(t){return!!t}function A(t){var e=T(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function D(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function C(t){return"function"==typeof t}function x(t,e){return t===e||t!=t&&e!=e}function N(t,e){var r=t[e];if(null!=r){if(!k(r))throw new TypeError;return r}}function F(t){var e=N(t,i);if(!k(e))throw new TypeError;var r=e.call(t);if(!S(r))throw new TypeError;return r}function B(t){return t.value}function K(t){var e=t.next();return!e.done&&e}function I(t){var e=t.return;e&&e.call(t)}function L(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===f)return e;if(e!==f)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var o=n.constructor;return"function"!=typeof o||o===t?e:o}function U(t,e,r){var n=d.getProvider(t,e);if(!P(n))return n;if(r){if(d.setProvider(t,e,v))return v;throw new Error("Illegal state.")}}function V(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,n){if(P(r)){if(!D(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!P(n)&&!R(n)){if(!C(n))throw new TypeError;e=n}}return e}(t,e)}if(!D(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(n)&&!P(n)&&!R(n))throw new TypeError;return R(n)&&(n=void 0),function(t,e,r,n){for(var o=t.length-1;o>=0;--o){var i=(0,t[o])(e,r,n);if(!P(i)&&!R(i)){if(!S(i))throw new TypeError;n=i}}return n}(t,e,r=A(r),n)})),t("metadata",(function(t,e){return function(r,n){if(!S(r))throw new TypeError;if(!P(n)&&!function(t){switch(M(t)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;O(t,e,r,n)}})),t("defineMetadata",(function(t,e,r,n){if(!S(r))throw new TypeError;return P(n)||(n=A(n)),O(t,e,r,n)})),t("hasMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return P(r)||(r=A(r)),g(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return P(r)||(r=A(r)),w(t,e,r)})),t("getMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return P(r)||(r=A(r)),b(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return P(r)||(r=A(r)),m(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return P(e)||(e=A(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return P(e)||(e=A(e)),E(t,e)})),t("deleteMetadata",(function(t,e,r){if(!S(e))throw new TypeError;if(P(r)||(r=A(r)),!S(e))throw new TypeError;P(r)||(r=A(r));var n=U(e,r,!1);return!P(n)&&n.OrdinaryDeleteMetadata(t,e,r)}))}(o,n),void 0===n.Reflect&&(n.Reflect=t)}()}(n||(n={}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){return Object.getOwnPropertyDescriptor(t&&t.prototype||t,e)}function e(e,r){return t(e,r)?.value}function o(e=!0){return(r,n)=>{const o=t(r,n)||{writable:!0,enumerable:!0};return o.configurable=e,Object.defineProperty(r&&r.prototype||r,n,o),o}}function i(t,e){if("undefined"!=typeof process&&!0===process.noDeprecation)return t;if("undefined"==typeof process)return function(...r){return i(t,e).apply(this,r)};let r=!1;return function(...n){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,n)}}function s(t){return(e,r,n)=>{const o=n.value;return n.value=i(o,t),n}}function u(e=!0){return(r,n)=>{const o=t(r,n)||{writable:!0,configurable:!0};return o.enumerable=e,Object.defineProperty(r&&r.prototype||r,n,o),o}}function a(){return o(!1)}function c(){return u(!1)}function f(e=!0){return(r,n)=>{const o=t(r,n)||{configurable:!0,enumerable:!0};return o.writable=e,Object.defineProperty(r&&r.prototype||r,n,o),o}}function l(){return f(!1)}var p;function y(t){return t.prototype?t:t.constructor}function h(t){return y(t)}function d(t){const[e,r,n]=t,o=t=>e!==h(e)?t:`${t}.static`;return"number"==typeof n?r?o("parameter"):"parameter.constructor":n&&n.value?o("method"):r&&void 0===n||n?o("property"):p.CLASS}function v(t){return Array.isArray(t)}function g(t){return t===Array||v(t)}function w(t){return t===Date||t instanceof Date&&!isNaN(+t)}function b(t){return"function"==typeof t}function m(t){return null==t}function O(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function _(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function E(t){return"number"==typeof t}function M(t){return"number"==typeof t||t instanceof Number||t===Number}function P(t){return"string"==typeof t}function R(t){return"string"==typeof t||t instanceof String||t===String}function S(t){return R(t)||M(t)||_(t)}function T(t){return P(t)||E(t)||O(t)}function j(t){return[String,Number,Boolean].includes(t)}function A(t){return"symbol"==typeof t}function D(t){return"symbol"==typeof t||t instanceof Symbol||t===Symbol}function k(t){return!(!t||!("isBuffer"in t)||"function"!=typeof t.isBuffer)||C(t)}function C(t){return!(!t||!(t===Uint8Array||t instanceof Uint8Array))}function x(t){return t instanceof RegExp}function N(t,e=new WeakMap){let r;if((t=>m(t)||T(t)||A(t)||b(t))(t))return t;if(k(t)){const e=Buffer.alloc(t.length);return t.copy(e),e}if(w(t))return new Date(t);if(x(t))return new RegExp(t);const n=e.get(t);if(n)return n;v(t)?r=[]:(r={},e.set(t,r));for(const n in t){const o=Object.getOwnPropertyDescriptor(t,n);o&&(b(o.value)?Object.defineProperty(r,n,o):r[n]=N(o.value,e))}if(!v(t)){const e=Reflect.getPrototypeOf(t);Reflect.setPrototypeOf(r,e)}return r}function F(t){return t&&h(t)!==Object?Object.create(t):{}}function B(t){return["__proto__","constructor","prototype"].includes(t)}function K(t){return Object.keys(t).filter((t=>!B(t)))}function I(t){return(e,r,n)=>{const o=e.findIndex((e=>t(e,r)));return-1===o?[...e,r]:(e[o]=U(e[o],r,n),e)}}r.r(n),r.d(n,{AnyToPromise:()=>ht,AnyToPromiseResponseTypes:()=>pt,AnyToPromiseStatus:()=>lt,CLASS_STORE:()=>Y,Configurable:()=>o,DecoratorTypes:()=>p,Deprecated:()=>s,Enumerable:()=>u,Env:()=>yt,EnvTypes:()=>dt,Hooks:()=>vt,METHOD_STORE:()=>Q,Metadata:()=>q,NotConfigurable:()=>a,NotEnumerable:()=>c,PARAM_STORE:()=>Z,PROPERTY_STORE:()=>X,Readonly:()=>l,Store:()=>rt,StoreFn:()=>nt,StoreMerge:()=>ot,StoreSet:()=>it,Type:()=>gt,UnsupportedDecoratorType:()=>wt,Writable:()=>f,ancestorOf:()=>Pt,ancestorsOf:()=>St,catchAsyncError:()=>mt,catchError:()=>bt,classOf:()=>h,cleanObject:()=>Kt,constructorOf:()=>Lt,createInstance:()=>F,decorateMethodsOf:()=>At,decoratorArgs:()=>Dt,decoratorTypeOf:()=>d,deepClone:()=>N,deepMerge:()=>U,descriptorOf:()=>t,getClass:()=>y,getClassOrSymbol:()=>$t,getConstructor:()=>It,getConstructorArgNames:()=>Gt,getEnumerableKeys:()=>qt,getHostInfoFromPort:()=>Ft,getInheritedClass:()=>Rt,getRandomId:()=>Ot,getValue:()=>Yt,hasJsonMethod:()=>Qt,importPackage:()=>Bt,inheritedDescriptorOf:()=>kt,isArray:()=>v,isArrayOrArrayClass:()=>g,isArrowFn:()=>Ut,isBoolean:()=>O,isBooleanOrBooleanClass:()=>_,isBuffer:()=>k,isClass:()=>Wt,isClassObject:()=>Vt,isCollection:()=>Xt,isDate:()=>w,isEmpty:()=>Zt,isEnumerable:()=>Jt,isFunction:()=>b,isInheritedFrom:()=>te,isMethodDescriptor:()=>e,isMomentObject:()=>ee,isMongooseObject:()=>ne,isNil:()=>m,isNumber:()=>E,isNumberOrNumberClass:()=>M,isObject:()=>st,isObjectID:()=>re,isObservable:()=>ut,isPlainObject:()=>Ht,isPrimitive:()=>T,isPrimitiveClass:()=>j,isPrimitiveOrPrimitiveClass:()=>S,isPromise:()=>at,isProtectedKey:()=>B,isRegExp:()=>x,isSerializable:()=>oe,isStream:()=>ct,isString:()=>P,isStringOrStringClass:()=>R,isSymbol:()=>A,isSymbolOrSymbolClass:()=>D,isUint8Array:()=>C,mergeReducerBuilder:()=>I,methodsOf:()=>jt,nameOf:()=>W,nameOfClass:()=>V,nameOfSymbol:()=>H,objectKeys:()=>K,primitiveOf:()=>ie,prototypeOf:()=>Tt,proxyDelegation:()=>Mt,setValue:()=>se,toMap:()=>ae,toStringConstructor:()=>zt,uniq:()=>_t,uniqBy:()=>Et,useDecorators:()=>Ct,useMethodDecorator:()=>xt,useMethodDecorators:()=>Nt}),function(t){t.PARAM="parameter",t.PARAM_CTOR="parameter.constructor",t.PARAM_STC="parameter.static",t.PROP="property",t.PROP_STC="property.static",t.METHOD="method",t.METHOD_STC="method.static",t.CLASS="class"}(p||(p={}));const L=I(((t,e)=>t===e));function U(t,e,r={}){if(function(t,e){return null==t||""===t&&""!==e}(e,t))return t;if(function(t,e){return T(t)||A(t)||b(t)||void 0===e}(e,t))return e;if(Array.isArray(t)){const n=function({reducers:t,parentKey:e}){return t?e&&t[e]?t[e]:t.default||L:L}(r);return[].concat(e).reduce(((t,e)=>n(t,e,r)),[...t])}return[...K(t),...K(e)].reduce(((n,o)=>{const i=U(t&&t[o],e&&e[o],{...r,parentKey:o});return r.cleanUndefinedProps&&void 0===i?n:{...n,[o]:i}}),F(t))}function V(t){return"function"==typeof t?t.name:t.constructor.name}const H=t=>t.toString().replace("Symbol(","").replace(")","");function W(t){switch(typeof t){default:return""+t;case"symbol":return H(t);case"function":return V(t)}}r(605);const $="design:paramtypes",z="design:type",G="design:returntype",J=new Map;class q{static get(t,e,r){return Reflect.getMetadata(t,h(e),r)}static getOwn(t,e,r){return Reflect.getOwnMetadata(t,h(e),r)}static getType(t,e){return Reflect.getMetadata(z,t,e)}static getOwnType(t,e){return Reflect.getMetadata(z,t,e)}static getReturnType(t,e){return Reflect.getMetadata(G,t,e)}static getOwnReturnType(t,e){return Reflect.getOwnMetadata(G,t,e)}static has(t,e,r){try{return Reflect.hasMetadata(t,h(e),r)}catch(t){}return!1}static hasOwn(t,e,r){return Reflect.hasOwnMetadata(t,h(e),r)}static delete(t,e,r){return Reflect.deleteMetadata(t,h(e),r)}static setParamTypes(t,e,r){return this.set($,r,t.prototype,e)}static getTargetsFromPropertyKey=t=>J.has(t)&&J.get(t)||[];static set(t,e,r,n){const o=J.has(t)&&J.get(t)||[],i=h(r);-1===o.indexOf(i)&&(o.push(i),J.set(t,o)),Reflect.defineMetadata(t,e,h(r),n)}static getParamTypes(t,e){return Reflect.getMetadata($,t,e)||[]}static getOwnParamTypes(t,e){return Reflect.getOwnMetadata($,t,e)||[]}}const Y="tsed:class:store",Q="tsed:method:store",X="tsed:property:store",Z="tsed:param:store",tt=new Map;function et(t,...e){if(A(e[0]))return tt.has(e[0])||tt.set(e[0],new rt),tt.get(e[0]);{const r=q;return r.hasOwn(t,...e)||r.set(t,new rt,...e),r.getOwn(t,...e)}}class rt{_entries=new Map;static from(...t){return function(t){const[e,r,n]=t;switch(d(t)){case p.PARAM_CTOR:case p.PARAM_STC:case p.PARAM:const t=et(Z,e,r);return t.has(""+n)||t.set(""+n,new rt),t.get(""+n);case p.PROP:case p.PROP_STC:return et(X,e,r);case p.METHOD:case p.METHOD_STC:return et(Q,e,r);case p.CLASS:return et(Y,e)}}(t)}static fromMethod(e,r){return rt.from(e,r,t(e,r))}static mergeStoreFrom(t,e,...r){const n=rt.from(t,...r);return rt.from(e,...r)._entries.forEach(((t,e)=>{n.merge(e,t)})),n}static mergeStoreMethodFrom(e,r,n){return this.mergeStoreFrom(e,r,n,t(e,n))}get(t,e){return this._entries.get(W(t))||e}has(t){return this._entries.has(W(t))}set(t,e){return this._entries.set(W(t),e),this}delete(t){return this._entries.delete(W(t))}merge(t,e,r=!1){let n=this.get(t);return n&&(e=N(e),n=N(n),e=r?U(e,n):U(n,e)),this.set(t,e),this}toJson(){return[...this._entries.entries()].reduce(((t,[e,r])=>({...t,[e]:r})),{})}}function nt(t){return(...e)=>{const r=rt.from(...e),n=t(r,e);return"function"==typeof n&&n(...e),e[2]}}function ot(t,e){return nt((r=>{r.merge(t,e)}))}function it(t,e){return nt((r=>{r.set(t,e)}))}function st(t){return"object"==typeof t}function ut(t){return!!t&&"function"==typeof t.lift&&"function"==typeof t.subscribe}function at(t){return t===Promise||t instanceof Promise||!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}function ct(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function ft(t){return st(t)&&"data"in t&&"headers"in t&&"status"in t&&"statusText"in t}var lt,pt,yt;!function(t){t.PENDING="PENDING",t.CANCELED="CANCELED",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(lt||(lt={})),function(t){t.STREAM="STREAM",t.BUFFER="BUFFER",t.DATA="DATA"}(pt||(pt={}));class ht{status=lt.PENDING;args;#t;#e;#r=!1;#n;constructor({hasNextFunction:t=!1}={}){this.#r=t,this.#n=new Promise(((t,e)=>{this.#t=t,this.#e=e}))}isDone(){return this.status!==lt.PENDING}get next(){return this.#r=!0,t=>{if(!this.isDone())return t?this.reject(t):this.resolve({type:pt.DATA})}}call(t){if(this.isDone())return Promise.resolve(this);try{this.handle(t())}catch(t){this.reject(t)}return this.#n}reject(t){this.isDone()||(this.done(lt.REJECTED),this.#e(t))}resolve(t={}){this.isDone()||(this.done(lt.RESOLVED),this.#t({...t,state:lt.RESOLVED}))}destroy(){}cancel(){if(!this.isDone())return this.done(lt.CANCELED),this.#t({state:lt.CANCELED})}done(t){this.destroy(),this.status=t}handle(t,e={}){if(!this.isDone()){if(t){if(this.isCanceledResponse(t))return this.cancel();if(ut(t)&&(t=t.toPromise()),ft(t))return this.handle(t.data,{...e,status:t.status,headers:t.headers});if(ct(t))return this.resolve({...e,type:pt.STREAM,data:t});if(ct(t)||Buffer.isBuffer(t))return this.resolve({...e,type:pt.BUFFER,data:t});if(at(t))return t.then((t=>this.handle(t,e))).catch((t=>t.response&&ft(t.response)?this.handle(t.response):this.reject(t)))}return this.#r?void 0:this.resolve({...e,data:t,type:pt.DATA})}}isCanceledResponse(t){return t===lt.CANCELED}}!function(t){t.PROD="production",t.DEV="development",t.TEST="test"}(yt||(yt={}));const dt=yt;class vt{#o={};has(t){return!!this.#o[t]}on(t,e){return this.#o[t]||(this.#o[t]=[]),this.#o[t].push(e),this}off(t,e){return this.#o[t]&&(this.#o[t]=this.#o[t].filter((t=>t===e))),this}emit(t,e=[],r=null){const n=this.#o[t];if(n?.length)for(const t of n)t.call(r,...e)}alter(t,e,r=[],n=null){const o=this.#o[t];if(o?.length)for(const t of o)e=t.call(n,e,...r);return e}async asyncEmit(t,e=[],r=null){const n=this.#o[t];if(n?.length){const t=n.map((t=>t.call(r,...e)));await Promise.all(t)}}async asyncAlter(t,e,r=[],n=null){const o=this.#o[t];if(o?.length)for(const t of o)e=await t.call(n,e,...r);return e}destroy(){this.#o={}}}const gt=Function;r.g.Type=gt;class wt extends Error{name;constructor(t,e){super(wt.buildMessage(t,e))}static buildMessage(t,e){const[r,n,o]=e,i=d(e),s=i.split("/")[0],u="parameter"===s?".["+o+"]":"",a=n?"."+n:"parameter"===s?".constructor":"",c=W(h(r))+a+u;return`${t.name} cannot be used as ${i} decorator on ${c}`}}function bt(t){try{t()}catch(t){return t}}async function mt(t){try{await t()}catch(t){return t}}function Ot(){return`e${Math.random().toString(36).substring(7)}`}function _t(t){return Array.from(new Set(t).values())}function Et(t,e="id"){const r=new Map;return t.forEach((t=>{r.set(t[e],t)})),Array.from(r.values())}function Mt(t,e={}){const{handlers:r={},remove:n,ownKeys:o}=e,i=e.getter||((t,e)=>t.get(e)),s=e.setter||((t,e,r)=>!!t.set(e,r)),u=(t,e)=>Reflect.has(t,e)||"symbol"==typeof e;return new Proxy(t,{getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t,e),has:(t,e)=>u(t,e)?Reflect.has(t,e):void 0!==i(t,e),get:(t,e,r)=>u(t,e)?Reflect.get(t,e,r):i(t,e),set:(t,e,r,n)=>u(t,e)?Reflect.set(t,e,r,n):!!s(t,e,r,n),deleteProperty:(t,e)=>u(t,e)||!n?Reflect.deleteProperty(t,e):n(t,e),defineProperty:(t,e,r)=>Reflect.defineProperty(t,e,r),ownKeys:t=>_t(Reflect.ownKeys(t).concat(o&&o(t)||[])),...r})}function Pt(t){return t&&Object.getPrototypeOf(t)}function Rt(t){return Pt(t)}function St(t){const e=[];let r=h(t);for(;r&&""!==W(r);)e.unshift(r),r=Rt(r);return e}function Tt(t){return h(t)===t?t.prototype:t}function jt(t){const e=new Map;return St(t=h(t)).forEach((t=>{Reflect.ownKeys(Tt(t)).forEach((r=>{"constructor"!==r&&e.set(r,{target:t,propertyKey:r})}))})),Array.from(e.values())}function At(e,r){jt(e).forEach((({target:n,propertyKey:o})=>{const i=Tt(e);n!==h(e)&&(Object.defineProperty(i,o,{writable:!0,configurable:!0,value(...t){return Tt(n)[o].apply(this,t)}}),rt.mergeStoreMethodFrom(e,n,o));const s=r(i,o,t(e,o));s&&Object.defineProperty(i,o,s)}))}function Dt(e,r){return[e,r,t(e,r)]}function kt(t,e){for(const r of St(t)){const t=Object.getOwnPropertyDescriptor(r&&r.prototype||r,e);if(t)return t}}function Ct(...t){return(...e)=>{t.filter((t=>!!t)).forEach((t=>{t(...e)}))}}function xt(e){return(r,n)=>e(r,n,t(r,n))}function Nt(...e){return(r,n)=>{e.filter(Boolean).forEach((e=>e(r,n,t(r,n))))}}function Ft(t,e){let r="0.0.0.0",n=e;return"string"==typeof e&&e.indexOf(":")>-1&&([r,n]=e.split(":"),n=+n),{protocol:t,address:r,port:n,toString(){return[`${this.protocol}://${this.address}`,"number"==typeof this.port&&this.port].filter(Boolean).join(":")}}}async function Bt(t,e=(()=>r(340)(t)),n=!1){try{return await e()}catch(t){if(!n)throw t;return{}}}function Kt(t,e=[]){return Object.entries(t).reduce(((t,[r,n])=>B(r)||e.includes(r)||void 0===n?t:{...t,[r]:n}),{})}function It(t){return"function"==typeof t?t:t.constructor}function Lt(t){return It(t)}function Ut(t){return t&&b(t)&&!t.prototype}function Vt(t){return t===Object}function Ht(t){return Vt(h(t))&&t!==Object}function Wt(t){return!!t&&!Ut(t)&&!(A(t)||S(t)||Vt(t)||w(t)||at(t)||g(t)||k(t))}function $t(t){return Wt(t)?h(t):t}function zt(t){return`${(Lt(t).toString().split("\n").find((t=>t.indexOf("constructor(")>-1))||"constructor()").replace("{","").trim()}`}function Gt(t){return zt(t).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map((t=>t.trim()))}function Jt(t,e){const r=h(t);if(r){const t=kt(r,e);if(t)return t.enumerable}return Object.prototype.propertyIsEnumerable.call(t,e)}function qt(t){const e=[];for(const r in t)!B(r)&&Jt(t,r)&&e.push(r);return e}function Yt(...t){const e=(t=>{const[e,r,n,o="."]=t;return st(r)||P(e)?{expression:e,scope:r,defaultValue:n,separator:o}:{expression:r,scope:e,defaultValue:n,separator:o}})(t);let r=e.scope;const{expression:n,defaultValue:o,separator:i}=e;if(!n)return r;if(!r)return o;const s=n.split(i),u=t=>{if(r){if(void 0!==r[t]||st(r)&&t in r)return r[t];if(b(r.get))return r.get(t)}};for(;(r=u(s.shift()))&&s.length;);return void 0===r?o:r}function Qt(t){return t&&"function"==typeof t.toJSON}function Xt(t){return g(t)||t===Map||t instanceof Map||t===Set||t instanceof Set||t===WeakMap||t instanceof WeakMap||t===WeakSet||t instanceof WeakSet}function Zt(t){return""===t||m(t)}function te(t,e,r=5){if(!t||!e)return!1;for(t=h(t),e=h(e);""!==W(t);){if(!r)return!1;if(t===e)return!0;t=Pt(t),r--}return!1}function ee(t){return!(!t||!t?._isAMomentObject)}function re(t){return t&&t._bsontype}function ne(t){return!!(Qt(t)&&t.$isMongooseModelPrototype||re(t))}function oe(t){return!(Buffer.isBuffer(t)||ct(t)||O(t)||E(t)||P(t)||m(t))}function ie(t){return R(t)?"string":M(t)?"number":_(t)?"boolean":"any"}function se(t,e,r,n="."){const o=e.split(n);for(;i=o.shift(),s=!o.length,!B(i)&&(s?("function"==typeof t.set?t.set(i,r):t[i]=r,0):("function"==typeof t.set?(t.has(i)||t.set(i,{}),t=t.get(i)):t=t[i]=t[i]||{},1)););var i,s}function ue(t){return t?P(t)?e=>e[t]:t:(t,e)=>String(e)}function ae(t,e){if(v(t)){const r=ue(e||"id");return t.reduce(((t,e,n)=>([].concat(r(e,n)).forEach((r=>{const n=t.get(r);e=n?.merge?.(e)||e,t.set(r,e)})),t)),new Map)}const r=ue(e);return Object.entries(t).reduce(((t,[e,n])=>t.set(r(n,e),n)),new Map)}})(),n})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@tsed/core"]=e():t["@tsed/core"]=e()}(self,(()=>(()=>{var t={340:t=>{function e(t){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}e.keys=()=>[],e.resolve=e,e.id=340,t.exports=e},605:(t,e,r)=>{var n;!function(t){!function(e){var n="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),o=i(t);function i(t,e){return function(r,n){Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0!==n.Reflect&&(o=i(n.Reflect,o)),function(t,e){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,u={__proto__:[]}instanceof Array,a=!s&&!u,c={create:s?function(){return V(Object.create(null))}:u?function(){return V({__proto__:null})}:function(){return V({})},has:a?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:a?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},f=Object.getPrototypeOf(Function),l="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,x(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,n)},e.prototype.values=function(){return new r(this._keys,this._values,o)},e.prototype.entries=function(){return new r(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){if(!x(this._cacheKey,t)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(x(this._keys[r],t)){this._cacheIndex=r;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function o(t,e){return e}function s(t,e){return[t,e]}}(),p="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}(),y="function"==typeof WeakMap?WeakMap:function(){var t=c.create(),e=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?c.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+s()}while(c.has(t,e));return t[e]=!0,e}function o(t,n){if(!r.call(t,e)){if(!n)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}function i(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function s(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):i(new Uint8Array(t),t):i(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",n=0;n<16;++n){var o=e[n];4!==n&&6!==n&&8!==n||(r+="-"),o<16&&(r+="0"),r+=o.toString(16).toLowerCase()}return r}}(),h=n?Symbol.for("@reflect-metadata:registry"):void 0,d=function(){var t;return!P(h)&&R(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[h]),P(t)&&(t=function(){var t,r,n,o;P(h)||void 0===e.Reflect||h in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=function(t){var e=t.defineMetadata,r=t.hasOwnMetadata,n=t.getOwnMetadata,o=t.getOwnMetadataKeys,i=t.deleteMetadata,s=new y;return{isProviderFor:function(t,e){var r=s.get(t);return P(r)?!!o(t,e).length&&(P(r)&&(r=new p,s.set(t,r)),r.add(e),!0):r.has(e)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:i}}(e.Reflect));var i=new y,s={registerProvider:u,getProvider:c,setProvider:d};return s;function u(e){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case P(r):r=e;break;case r===e:break;case P(n):n=e;break;case n===e:break;default:void 0===o&&(o=new p),o.add(e)}}function a(e,i){if(!P(r)){if(r.isProviderFor(e,i))return r;if(!P(n)){if(n.isProviderFor(e,i))return r;if(!P(o))for(var s=F(o);;){var u=K(s);if(!u)return;var a=B(u);if(a.isProviderFor(e,i))return I(s),a}}}if(!P(t)&&t.isProviderFor(e,i))return t}function c(t,e){var r,n=i.get(t);return P(n)||(r=n.get(e)),P(r)?(P(r=a(t,e))||(P(n)&&(n=new l,i.set(t,n)),n.set(e,r)),r):r}function f(t){if(P(t))throw new TypeError;return r===t||n===t||!P(o)&&o.has(t)}function d(t,e,r){if(!f(r))throw new Error("Metadata provider not registered.");var n=c(t,e);if(n!==r){if(!P(n))return!1;var o=i.get(t);P(o)&&(o=new l,i.set(t,o)),o.set(e,r)}return!0}}()),!P(h)&&R(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}(),v=function(t){var e=new y,r={isProviderFor:function(t,r){var n=e.get(t);return!P(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(t,e,r,o){n(r,o,!0).set(t,e)},OrdinaryHasOwnMetadata:function(t,e,r){var o=n(e,r,!1);return!P(o)&&j(o.has(t))},OrdinaryGetOwnMetadata:function(t,e,r){var o=n(e,r,!1);if(!P(o))return o.get(t)},OrdinaryOwnMetadataKeys:function(t,e){var r=[],o=n(t,e,!1);if(P(o))return r;for(var i=F(o.keys()),s=0;;){var u=K(i);if(!u)return r.length=s,r;var a=B(u);try{r[s]=a}catch(t){try{I(i)}finally{throw t}}s++}},OrdinaryDeleteMetadata:function(t,r,o){var i=n(r,o,!1);if(P(i))return!1;if(!i.delete(t))return!1;if(0===i.size){var s=e.get(r);P(s)||(s.delete(o),0===s.size&&e.delete(s))}return!0}};return d.registerProvider(r),r;function n(n,o,i){var s=e.get(n),u=!1;if(P(s)){if(!i)return;s=new l,e.set(n,s),u=!0}var a=s.get(o);if(P(a)){if(!i)return;if(a=new l,s.set(o,a),!t.setProvider(n,o,r))throw s.delete(o),u&&e.delete(n),new Error("Wrong provider for target.")}return a}}(d);function g(t,e,r){if(w(t,e,r))return!0;var n=L(e);return!S(n)&&g(t,n,r)}function w(t,e,r){var n=U(e,r,!1);return!P(n)&&j(n.OrdinaryHasOwnMetadata(t,e,r))}function b(t,e,r){if(w(t,e,r))return m(t,e,r);var n=L(e);return S(n)?void 0:b(t,n,r)}function m(t,e,r){var n=U(e,r,!1);if(!P(n))return n.OrdinaryGetOwnMetadata(t,e,r)}function O(t,e,r,n){U(r,n,!0).OrdinaryDefineOwnMetadata(t,e,r,n)}function _(t,e){var r=E(t,e),n=L(t);if(null===n)return r;var o=_(n,e);if(o.length<=0)return r;if(r.length<=0)return o;for(var i=new p,s=[],u=0,a=r;u<a.length;u++){var c=a[u];i.has(c)||(i.add(c),s.push(c))}for(var f=0,l=o;f<l.length;f++)c=l[f],i.has(c)||(i.add(c),s.push(c));return s}function E(t,e){var r=U(t,e,!1);return r?r.OrdinaryOwnMetadataKeys(t,e):[]}function M(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function P(t){return void 0===t}function S(t){return null===t}function R(t){return"object"==typeof t?null!==t:"function"==typeof t}function T(t,e){switch(M(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",n=N(t,o);if(void 0!==n){var i=n.call(t,r);if(R(i))throw new TypeError;return i}return function(t,e){if("string"===e){var r=t.toString;if(k(r)&&!R(o=r.call(t)))return o;if(k(n=t.valueOf)&&!R(o=n.call(t)))return o}else{var n;if(k(n=t.valueOf)&&!R(o=n.call(t)))return o;var o,i=t.toString;if(k(i)&&!R(o=i.call(t)))return o}throw new TypeError}(t,"default"===r?"number":r)}function j(t){return!!t}function A(t){var e=T(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function D(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function C(t){return"function"==typeof t}function x(t,e){return t===e||t!=t&&e!=e}function N(t,e){var r=t[e];if(null!=r){if(!k(r))throw new TypeError;return r}}function F(t){var e=N(t,i);if(!k(e))throw new TypeError;var r=e.call(t);if(!R(r))throw new TypeError;return r}function B(t){return t.value}function K(t){var e=t.next();return!e.done&&e}function I(t){var e=t.return;e&&e.call(t)}function L(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===f)return e;if(e!==f)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var o=n.constructor;return"function"!=typeof o||o===t?e:o}function U(t,e,r){var n=d.getProvider(t,e);if(!P(n))return n;if(r){if(d.setProvider(t,e,v))return v;throw new Error("Illegal state.")}}function V(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,n){if(P(r)){if(!D(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!P(n)&&!S(n)){if(!C(n))throw new TypeError;e=n}}return e}(t,e)}if(!D(t))throw new TypeError;if(!R(e))throw new TypeError;if(!R(n)&&!P(n)&&!S(n))throw new TypeError;return S(n)&&(n=void 0),function(t,e,r,n){for(var o=t.length-1;o>=0;--o){var i=(0,t[o])(e,r,n);if(!P(i)&&!S(i)){if(!R(i))throw new TypeError;n=i}}return n}(t,e,r=A(r),n)})),t("metadata",(function(t,e){return function(r,n){if(!R(r))throw new TypeError;if(!P(n)&&!function(t){switch(M(t)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;O(t,e,r,n)}})),t("defineMetadata",(function(t,e,r,n){if(!R(r))throw new TypeError;return P(n)||(n=A(n)),O(t,e,r,n)})),t("hasMetadata",(function(t,e,r){if(!R(e))throw new TypeError;return P(r)||(r=A(r)),g(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!R(e))throw new TypeError;return P(r)||(r=A(r)),w(t,e,r)})),t("getMetadata",(function(t,e,r){if(!R(e))throw new TypeError;return P(r)||(r=A(r)),b(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!R(e))throw new TypeError;return P(r)||(r=A(r)),m(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!R(t))throw new TypeError;return P(e)||(e=A(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!R(t))throw new TypeError;return P(e)||(e=A(e)),E(t,e)})),t("deleteMetadata",(function(t,e,r){if(!R(e))throw new TypeError;if(P(r)||(r=A(r)),!R(e))throw new TypeError;P(r)||(r=A(r));var n=U(e,r,!1);return!P(n)&&n.OrdinaryDeleteMetadata(t,e,r)}))}(o,n),void 0===n.Reflect&&(n.Reflect=t)}()}(n||(n={}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){return Object.getOwnPropertyDescriptor(t&&t.prototype||t,e)}function e(e,r){return t(e,r)?.value}function o(e=!0){return(r,n)=>{const o=t(r,n)||{writable:!0,enumerable:!0};return o.configurable=e,Object.defineProperty(r&&r.prototype||r,n,o),o}}function i(t,e){if("undefined"!=typeof process&&!0===process.noDeprecation)return t;if("undefined"==typeof process)return function(...r){return i(t,e).apply(this,r)};let r=!1;return function(...n){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,n)}}function s(t){return(e,r,n)=>{const o=n.value;return n.value=i(o,t),n}}function u(e=!0){return(r,n)=>{const o=t(r,n)||{writable:!0,configurable:!0};return o.enumerable=e,Object.defineProperty(r&&r.prototype||r,n,o),o}}function a(){return o(!1)}function c(){return u(!1)}function f(e=!0){return(r,n)=>{const o=t(r,n)||{configurable:!0,enumerable:!0};return o.writable=e,Object.defineProperty(r&&r.prototype||r,n,o),o}}function l(){return f(!1)}var p;function y(t){return t.prototype?t:t.constructor}function h(t){return y(t)}function d(t){const[e,r,n]=t,o=t=>e!==h(e)?t:`${t}.static`;return"number"==typeof n?r?o("parameter"):"parameter.constructor":n&&n.value?o("method"):r&&void 0===n||n?o("property"):p.CLASS}function v(t){return t===Date||t instanceof Date&&!isNaN(+t)}function g(t){return"function"==typeof t}function w(t){return null==t}function b(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function m(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function O(t){return"number"==typeof t}function _(t){return"number"==typeof t||t instanceof Number||t===Number}function E(t){return"string"==typeof t}function M(t){return"string"==typeof t||t instanceof String||t===String}function P(t){return M(t)||_(t)||m(t)}function S(t){return E(t)||O(t)||b(t)}function R(t){return[String,Number,Boolean].includes(t)}function T(t){return"symbol"==typeof t}function j(t){return"symbol"==typeof t||t instanceof Symbol||t===Symbol}function A(t){return t instanceof RegExp}r.r(n),r.d(n,{AnyToPromise:()=>ft,AnyToPromiseResponseTypes:()=>at,AnyToPromiseStatus:()=>ut,CLASS_STORE:()=>z,Configurable:()=>o,DecoratorTypes:()=>p,Deprecated:()=>s,Enumerable:()=>u,Env:()=>ct,EnvTypes:()=>lt,Hooks:()=>pt,METHOD_STORE:()=>G,Metadata:()=>$,NotConfigurable:()=>a,NotEnumerable:()=>c,PARAM_STORE:()=>q,PROPERTY_STORE:()=>J,Readonly:()=>l,Store:()=>X,StoreFn:()=>Z,StoreMerge:()=>tt,StoreSet:()=>et,Type:()=>yt,UnsupportedDecoratorType:()=>ht,Writable:()=>f,ancestorOf:()=>Ot,ancestorsOf:()=>Et,catchAsyncError:()=>vt,catchError:()=>dt,classOf:()=>h,cleanObject:()=>xt,constructorOf:()=>Ft,createInstance:()=>k,decorateMethodsOf:()=>St,decoratorArgs:()=>Rt,decoratorTypeOf:()=>d,deepClone:()=>D,deepMerge:()=>B,descriptorOf:()=>t,getClass:()=>y,getClassOrSymbol:()=>$t,getConstructor:()=>Nt,getConstructorArgNames:()=>Gt,getEnumerableKeys:()=>qt,getHostInfoFromPort:()=>kt,getInheritedClass:()=>_t,getRandomId:()=>gt,getValue:()=>Yt,hasJsonMethod:()=>Qt,importPackage:()=>Ct,inheritedDescriptorOf:()=>Tt,isArray:()=>Bt,isArrayOrArrayClass:()=>Kt,isArrowFn:()=>It,isBoolean:()=>b,isBooleanOrBooleanClass:()=>m,isBuffer:()=>Lt,isClass:()=>Wt,isClassObject:()=>Vt,isCollection:()=>Xt,isDate:()=>v,isEmpty:()=>Zt,isEnumerable:()=>Jt,isFunction:()=>g,isInheritedFrom:()=>te,isMethodDescriptor:()=>e,isMomentObject:()=>ee,isMongooseObject:()=>ne,isNil:()=>w,isNumber:()=>O,isNumberOrNumberClass:()=>_,isObject:()=>rt,isObjectID:()=>re,isObservable:()=>nt,isPlainObject:()=>Ht,isPrimitive:()=>S,isPrimitiveClass:()=>R,isPrimitiveOrPrimitiveClass:()=>P,isPromise:()=>ot,isProtectedKey:()=>C,isRegExp:()=>A,isSerializable:()=>oe,isStream:()=>it,isString:()=>E,isStringOrStringClass:()=>M,isSymbol:()=>T,isSymbolOrSymbolClass:()=>j,isUint8Array:()=>Ut,mergeReducerBuilder:()=>N,methodsOf:()=>Pt,nameOf:()=>L,nameOfClass:()=>K,nameOfSymbol:()=>I,objectKeys:()=>x,primitiveOf:()=>ie,prototypeOf:()=>Mt,proxyDelegation:()=>mt,setValue:()=>se,toMap:()=>ae,toStringConstructor:()=>zt,uniq:()=>wt,uniqBy:()=>bt,useDecorators:()=>jt,useMethodDecorator:()=>At,useMethodDecorators:()=>Dt}),function(t){t.PARAM="parameter",t.PARAM_CTOR="parameter.constructor",t.PARAM_STC="parameter.static",t.PROP="property",t.PROP_STC="property.static",t.METHOD="method",t.METHOD_STC="method.static",t.CLASS="class"}(p||(p={}));const D=(t,e=new WeakMap)=>{if((t=>w(t)||S(t)||T(t)||g(t))(t))return t;const r=e.get(t);if(r)return r;if(ArrayBuffer.isView(t))return Buffer.isBuffer(t)?Buffer.from(t):new(h(t))(t.buffer.slice(0),t.byteOffset,t.byteLength);if(v(t))return new Date(t);if(A(t))return new RegExp(t);if(Array.isArray(t)){const r=[];return e.set(t,r),t.forEach(((t,n)=>r[n]=D(t,e))),r}if(t instanceof Map){const r=new Map;return e.set(t,r),t.forEach(((t,n)=>r.set(D(n,e),D(t,e)))),r}if(t instanceof Set){const r=new Set;return e.set(t,r),t.forEach((t=>r.add(D(t,e)))),r}const n=Object.create(Reflect.getPrototypeOf(t));return e.set(t,n),Reflect.ownKeys(t).forEach((r=>{const o=Object.getOwnPropertyDescriptor(t,r);o&&(g(o.value)?Object.defineProperty(n,r,o):Object.defineProperty(n,r,{...o,value:D(o.value,e)}))})),n};function k(t){return t&&h(t)!==Object?Object.create(t):{}}function C(t){return["__proto__","constructor","prototype"].includes(t)}function x(t){return Object.keys(t).filter((t=>!C(t)))}function N(t){return(e,r,n)=>{const o=e.findIndex((e=>t(e,r)));return-1===o?[...e,r]:(e[o]=B(e[o],r,n),e)}}const F=N(((t,e)=>t===e));function B(t,e,r={}){if(function(t,e){return null==t||""===t&&""!==e}(e,t))return t;if(function(t,e){return S(t)||T(t)||g(t)||void 0===e}(e,t))return e;if(Array.isArray(t)){const n=function({reducers:t,parentKey:e}){return t?e&&t[e]?t[e]:t.default||F:F}(r);return[].concat(e).reduce(((t,e)=>n(t,e,r)),[...t])}return[...x(t),...x(e)].reduce(((n,o)=>{const i=B(t&&t[o],e&&e[o],{...r,parentKey:o});return r.cleanUndefinedProps&&void 0===i?n:{...n,[o]:i}}),k(t))}function K(t){return"function"==typeof t?t.name:t.constructor.name}const I=t=>t.toString().replace("Symbol(","").replace(")","");function L(t){switch(typeof t){default:return""+t;case"symbol":return I(t);case"function":return K(t)}}r(605);const U="design:paramtypes",V="design:type",H="design:returntype",W=new Map;class ${static get(t,e,r){return Reflect.getMetadata(t,h(e),r)}static getOwn(t,e,r){return Reflect.getOwnMetadata(t,h(e),r)}static getType(t,e){return Reflect.getMetadata(V,t,e)}static getOwnType(t,e){return Reflect.getMetadata(V,t,e)}static getReturnType(t,e){return Reflect.getMetadata(H,t,e)}static getOwnReturnType(t,e){return Reflect.getOwnMetadata(H,t,e)}static has(t,e,r){try{return Reflect.hasMetadata(t,h(e),r)}catch(t){}return!1}static hasOwn(t,e,r){return Reflect.hasOwnMetadata(t,h(e),r)}static delete(t,e,r){return Reflect.deleteMetadata(t,h(e),r)}static setParamTypes(t,e,r){return this.set(U,r,t.prototype,e)}static getTargetsFromPropertyKey=t=>W.has(t)&&W.get(t)||[];static set(t,e,r,n){const o=W.has(t)&&W.get(t)||[],i=h(r);-1===o.indexOf(i)&&(o.push(i),W.set(t,o)),Reflect.defineMetadata(t,e,h(r),n)}static getParamTypes(t,e){return Reflect.getMetadata(U,t,e)||[]}static getOwnParamTypes(t,e){return Reflect.getOwnMetadata(U,t,e)||[]}}const z="tsed:class:store",G="tsed:method:store",J="tsed:property:store",q="tsed:param:store",Y=new Map;function Q(t,...e){if(T(e[0]))return Y.has(e[0])||Y.set(e[0],new X),Y.get(e[0]);{const r=$;return r.hasOwn(t,...e)||r.set(t,new X,...e),r.getOwn(t,...e)}}class X{_entries=new Map;static from(...t){return function(t){const[e,r,n]=t;switch(d(t)){case p.PARAM_CTOR:case p.PARAM_STC:case p.PARAM:const t=Q(q,e,r);return t.has(""+n)||t.set(""+n,new X),t.get(""+n);case p.PROP:case p.PROP_STC:return Q(J,e,r);case p.METHOD:case p.METHOD_STC:return Q(G,e,r);case p.CLASS:return Q(z,e)}}(t)}static fromMethod(e,r){return X.from(e,r,t(e,r))}static mergeStoreFrom(t,e,...r){const n=X.from(t,...r);return X.from(e,...r)._entries.forEach(((t,e)=>{n.merge(e,t)})),n}static mergeStoreMethodFrom(e,r,n){return this.mergeStoreFrom(e,r,n,t(e,n))}get(t,e){return this._entries.get(L(t))||e}has(t){return this._entries.has(L(t))}set(t,e){return this._entries.set(L(t),e),this}delete(t){return this._entries.delete(L(t))}merge(t,e,r=!1){let n=this.get(t);return n&&(e=D(e),n=D(n),e=r?B(e,n):B(n,e)),this.set(t,e),this}toJson(){return[...this._entries.entries()].reduce(((t,[e,r])=>({...t,[e]:r})),{})}}function Z(t){return(...e)=>{const r=X.from(...e),n=t(r,e);return"function"==typeof n&&n(...e),e[2]}}function tt(t,e){return Z((r=>{r.merge(t,e)}))}function et(t,e){return Z((r=>{r.set(t,e)}))}function rt(t){return"object"==typeof t}function nt(t){return!!t&&"function"==typeof t.lift&&"function"==typeof t.subscribe}function ot(t){return t===Promise||t instanceof Promise||!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}function it(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function st(t){return rt(t)&&"data"in t&&"headers"in t&&"status"in t&&"statusText"in t}var ut,at,ct;!function(t){t.PENDING="PENDING",t.CANCELED="CANCELED",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(ut||(ut={})),function(t){t.STREAM="STREAM",t.BUFFER="BUFFER",t.DATA="DATA"}(at||(at={}));class ft{status=ut.PENDING;args;#t;#e;#r=!1;#n;constructor({hasNextFunction:t=!1}={}){this.#r=t,this.#n=new Promise(((t,e)=>{this.#t=t,this.#e=e}))}isDone(){return this.status!==ut.PENDING}get next(){return this.#r=!0,t=>{if(!this.isDone())return t?this.reject(t):this.resolve({type:at.DATA})}}call(t){if(this.isDone())return Promise.resolve(this);try{this.handle(t())}catch(t){this.reject(t)}return this.#n}reject(t){this.isDone()||(this.done(ut.REJECTED),this.#e(t))}resolve(t={}){this.isDone()||(this.done(ut.RESOLVED),this.#t({...t,state:ut.RESOLVED}))}destroy(){}cancel(){if(!this.isDone())return this.done(ut.CANCELED),this.#t({state:ut.CANCELED})}done(t){this.destroy(),this.status=t}handle(t,e={}){if(!this.isDone()){if(t){if(this.isCanceledResponse(t))return this.cancel();if(nt(t)&&(t=t.toPromise()),st(t))return this.handle(t.data,{...e,status:t.status,headers:t.headers});if(it(t))return this.resolve({...e,type:at.STREAM,data:t});if(it(t)||Buffer.isBuffer(t))return this.resolve({...e,type:at.BUFFER,data:t});if(ot(t))return t.then((t=>this.handle(t,e))).catch((t=>t.response&&st(t.response)?this.handle(t.response):this.reject(t)))}return this.#r?void 0:this.resolve({...e,data:t,type:at.DATA})}}isCanceledResponse(t){return t===ut.CANCELED}}!function(t){t.PROD="production",t.DEV="development",t.TEST="test"}(ct||(ct={}));const lt=ct;class pt{#o={};has(t){return!!this.#o[t]}on(t,e){return this.#o[t]||(this.#o[t]=[]),this.#o[t].push(e),this}off(t,e){return this.#o[t]&&(this.#o[t]=this.#o[t].filter((t=>t===e))),this}emit(t,e=[],r=null){const n=this.#o[t];if(n?.length)for(const t of n)t.call(r,...e)}alter(t,e,r=[],n=null){const o=this.#o[t];if(o?.length)for(const t of o)e=t.call(n,e,...r);return e}async asyncEmit(t,e=[],r=null){const n=this.#o[t];if(n?.length){const t=n.map((t=>t.call(r,...e)));await Promise.all(t)}}async asyncAlter(t,e,r=[],n=null){const o=this.#o[t];if(o?.length)for(const t of o)e=await t.call(n,e,...r);return e}destroy(){this.#o={}}}const yt=Function;r.g.Type=yt;class ht extends Error{name;constructor(t,e){super(ht.buildMessage(t,e))}static buildMessage(t,e){const[r,n,o]=e,i=d(e),s=i.split("/")[0],u="parameter"===s?".["+o+"]":"",a=n?"."+n:"parameter"===s?".constructor":"",c=L(h(r))+a+u;return`${t.name} cannot be used as ${i} decorator on ${c}`}}function dt(t){try{t()}catch(t){return t}}async function vt(t){try{await t()}catch(t){return t}}function gt(){return`e${Math.random().toString(36).substring(7)}`}function wt(t){return Array.from(new Set(t).values())}function bt(t,e="id"){const r=new Map;return t.forEach((t=>{r.set(t[e],t)})),Array.from(r.values())}function mt(t,e={}){const{handlers:r={},remove:n,ownKeys:o}=e,i=e.getter||((t,e)=>t.get(e)),s=e.setter||((t,e,r)=>!!t.set(e,r)),u=(t,e)=>Reflect.has(t,e)||"symbol"==typeof e;return new Proxy(t,{getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t,e),has:(t,e)=>u(t,e)?Reflect.has(t,e):void 0!==i(t,e),get:(t,e,r)=>u(t,e)?Reflect.get(t,e,r):i(t,e),set:(t,e,r,n)=>u(t,e)?Reflect.set(t,e,r,n):!!s(t,e,r,n),deleteProperty:(t,e)=>u(t,e)||!n?Reflect.deleteProperty(t,e):n(t,e),defineProperty:(t,e,r)=>Reflect.defineProperty(t,e,r),ownKeys:t=>wt(Reflect.ownKeys(t).concat(o&&o(t)||[])),...r})}function Ot(t){return t&&Object.getPrototypeOf(t)}function _t(t){return Ot(t)}function Et(t){const e=[];let r=h(t);for(;r&&""!==L(r);)e.unshift(r),r=_t(r);return e}function Mt(t){return h(t)===t?t.prototype:t}function Pt(t){const e=new Map;return Et(t=h(t)).forEach((t=>{Reflect.ownKeys(Mt(t)).forEach((r=>{"constructor"!==r&&e.set(r,{target:t,propertyKey:r})}))})),Array.from(e.values())}function St(e,r){Pt(e).forEach((({target:n,propertyKey:o})=>{const i=Mt(e);n!==h(e)&&(Object.defineProperty(i,o,{writable:!0,configurable:!0,value(...t){return Mt(n)[o].apply(this,t)}}),X.mergeStoreMethodFrom(e,n,o));const s=r(i,o,t(e,o));s&&Object.defineProperty(i,o,s)}))}function Rt(e,r){return[e,r,t(e,r)]}function Tt(t,e){for(const r of Et(t)){const t=Object.getOwnPropertyDescriptor(r&&r.prototype||r,e);if(t)return t}}function jt(...t){return(...e)=>{t.filter((t=>!!t)).forEach((t=>{t(...e)}))}}function At(e){return(r,n)=>e(r,n,t(r,n))}function Dt(...e){return(r,n)=>{e.filter(Boolean).forEach((e=>e(r,n,t(r,n))))}}function kt(t,e){let r="0.0.0.0",n=e;return"string"==typeof e&&e.indexOf(":")>-1&&([r,n]=e.split(":"),n=+n),{protocol:t,address:r,port:n,toString(){return[`${this.protocol}://${this.address}`,"number"==typeof this.port&&this.port].filter(Boolean).join(":")}}}async function Ct(t,e=(()=>r(340)(t)),n=!1){try{return await e()}catch(t){if(!n)throw t;return{}}}function xt(t,e=[]){return Object.entries(t).reduce(((t,[r,n])=>C(r)||e.includes(r)||void 0===n?t:{...t,[r]:n}),{})}function Nt(t){return"function"==typeof t?t:t.constructor}function Ft(t){return Nt(t)}function Bt(t){return Array.isArray(t)}function Kt(t){return t===Array||Bt(t)}function It(t){return t&&g(t)&&!t.prototype}function Lt(t){return!(!t||!("isBuffer"in t)||"function"!=typeof t.isBuffer)||Ut(t)}function Ut(t){return!(!t||!(t===Uint8Array||t instanceof Uint8Array))}function Vt(t){return t===Object}function Ht(t){return Vt(h(t))&&t!==Object}function Wt(t){return!!t&&!It(t)&&!(T(t)||P(t)||Vt(t)||v(t)||ot(t)||Kt(t)||Lt(t))}function $t(t){return Wt(t)?h(t):t}function zt(t){return`${(Ft(t).toString().split("\n").find((t=>t.indexOf("constructor(")>-1))||"constructor()").replace("{","").trim()}`}function Gt(t){return zt(t).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map((t=>t.trim()))}function Jt(t,e){const r=h(t);if(r){const t=Tt(r,e);if(t)return t.enumerable}return Object.prototype.propertyIsEnumerable.call(t,e)}function qt(t){const e=[];for(const r in t)!C(r)&&Jt(t,r)&&e.push(r);return e}function Yt(...t){const e=(t=>{const[e,r,n,o="."]=t;return rt(r)||E(e)?{expression:e,scope:r,defaultValue:n,separator:o}:{expression:r,scope:e,defaultValue:n,separator:o}})(t);let r=e.scope;const{expression:n,defaultValue:o,separator:i}=e;if(!n)return r;if(!r)return o;const s=n.split(i),u=t=>{if(r){if(void 0!==r[t]||rt(r)&&t in r)return r[t];if(g(r.get))return r.get(t)}};for(;(r=u(s.shift()))&&s.length;);return void 0===r?o:r}function Qt(t){return t&&"function"==typeof t.toJSON}function Xt(t){return Kt(t)||t===Map||t instanceof Map||t===Set||t instanceof Set||t===WeakMap||t instanceof WeakMap||t===WeakSet||t instanceof WeakSet}function Zt(t){return""===t||w(t)}function te(t,e,r=5){if(!t||!e)return!1;for(t=h(t),e=h(e);""!==L(t);){if(!r)return!1;if(t===e)return!0;t=Ot(t),r--}return!1}function ee(t){return!(!t||!t?._isAMomentObject)}function re(t){return t&&t._bsontype}function ne(t){return!!(Qt(t)&&t.$isMongooseModelPrototype||re(t))}function oe(t){return!(Buffer.isBuffer(t)||it(t)||b(t)||O(t)||E(t)||w(t))}function ie(t){return M(t)?"string":_(t)?"number":m(t)?"boolean":"any"}function se(t,e,r,n="."){const o=e.split(n);for(;i=o.shift(),s=!o.length,!C(i)&&(s?("function"==typeof t.set?t.set(i,r):t[i]=r,0):("function"==typeof t.set?(t.has(i)||t.set(i,{}),t=t.get(i)):t=t[i]=t[i]||{},1)););var i,s}function ue(t){return t?E(t)?e=>e[t]:t:(t,e)=>String(e)}function ae(t,e){if(Bt(t)){const r=ue(e||"id");return t.reduce(((t,e,n)=>([].concat(r(e,n)).forEach((r=>{const n=t.get(r);e=n?.merge?.(e)||e,t.set(r,e)})),t)),new Map)}const r=ue(e);return Object.entries(t).reduce(((t,[e,n])=>t.set(r(n,e),n)),new Map)}})(),n})())); | ||
//# sourceMappingURL=core.umd.min.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deepClone = void 0; | ||
const isArray_1 = require("./isArray"); | ||
const isDate_1 = require("./isDate"); | ||
@@ -10,4 +9,4 @@ const isFunction_1 = require("./isFunction"); | ||
const isSymbol_1 = require("./isSymbol"); | ||
const isBuffer_1 = require("./isBuffer"); | ||
const isRegExp_1 = require("./isRegExp"); | ||
const classOf_1 = require("./classOf"); | ||
const isBasicType = (source) => (0, isNil_1.isNil)(source) || (0, isPrimitive_1.isPrimitive)(source) || (0, isSymbol_1.isSymbol)(source) || (0, isFunction_1.isFunction)(source); | ||
@@ -19,12 +18,18 @@ /** | ||
*/ | ||
function deepClone(source, stack = new WeakMap()) { | ||
let dest; | ||
const deepClone = (source, stack = new WeakMap()) => { | ||
// provides an early exit for simple cases | ||
if (isBasicType(source)) { | ||
return source; | ||
} | ||
if ((0, isBuffer_1.isBuffer)(source)) { | ||
const copy = Buffer.alloc(source.length); | ||
source.copy(copy); | ||
return copy; | ||
const stacked = stack.get(source); | ||
if (stacked) { | ||
// See issue #1619 | ||
return stacked; | ||
} | ||
if (ArrayBuffer.isView(source)) { | ||
return Buffer.isBuffer(source) | ||
? Buffer.from(source) | ||
: // adds support for all kind of TypedArray such as Int8Array, Uint8Array, etc | ||
new ((0, classOf_1.classOf)(source))(source.buffer.slice(0), source.byteOffset, source.byteLength); | ||
} | ||
if ((0, isDate_1.isDate)(source)) { | ||
@@ -36,33 +41,40 @@ return new Date(source); | ||
} | ||
const stacked = stack.get(source); | ||
if (stacked) { | ||
// See issue #1619 | ||
return stacked; | ||
if (Array.isArray(source)) { | ||
const clone = []; | ||
stack.set(source, clone); | ||
source.forEach((item, idx) => (clone[idx] = (0, exports.deepClone)(item, stack))); | ||
return clone; | ||
} | ||
if ((0, isArray_1.isArray)(source)) { | ||
dest = []; | ||
if (source instanceof Map) { | ||
const clone = new Map(); | ||
stack.set(source, clone); | ||
source.forEach((value, key) => clone.set((0, exports.deepClone)(key, stack), (0, exports.deepClone)(value, stack))); | ||
return clone; | ||
} | ||
else { | ||
dest = {}; | ||
stack.set(source, dest); | ||
if (source instanceof Set) { | ||
const clone = new Set(); | ||
stack.set(source, clone); | ||
source.forEach((value) => clone.add((0, exports.deepClone)(value, stack))); | ||
return clone; | ||
} | ||
for (const key in source) { | ||
// Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter. | ||
const clone = Object.create(Reflect.getPrototypeOf(source)); | ||
stack.set(source, clone); | ||
Reflect.ownKeys(source).forEach((key) => { | ||
// respects property descriptors and the prototype chain more explicitly, which is important for objects with getter/setter. | ||
const descriptor = Object.getOwnPropertyDescriptor(source, key); | ||
if (descriptor) { | ||
if (!(0, isFunction_1.isFunction)(descriptor.value)) { | ||
dest[key] = deepClone(descriptor.value, stack); | ||
Object.defineProperty(clone, key, { | ||
...descriptor, | ||
value: (0, exports.deepClone)(descriptor.value, stack) | ||
}); | ||
} | ||
else { | ||
Object.defineProperty(dest, key, descriptor); | ||
Object.defineProperty(clone, key, descriptor); | ||
} | ||
} | ||
} | ||
if (!(0, isArray_1.isArray)(source)) { | ||
const prototype = Reflect.getPrototypeOf(source); | ||
Reflect.setPrototypeOf(dest, prototype); | ||
} | ||
return dest; | ||
} | ||
}); | ||
return clone; | ||
}; | ||
exports.deepClone = deepClone; | ||
//# sourceMappingURL=deepClone.js.map |
@@ -1,2 +0,1 @@ | ||
import { isArray } from "./isArray.js"; | ||
import { isDate } from "./isDate.js"; | ||
@@ -7,4 +6,4 @@ import { isFunction } from "./isFunction.js"; | ||
import { isSymbol } from "./isSymbol.js"; | ||
import { isBuffer } from "./isBuffer.js"; | ||
import { isRegExp } from "./isRegExp.js"; | ||
import { classOf } from "./classOf.js"; | ||
const isBasicType = (source) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source); | ||
@@ -16,12 +15,18 @@ /** | ||
*/ | ||
export function deepClone(source, stack = new WeakMap()) { | ||
let dest; | ||
export const deepClone = (source, stack = new WeakMap()) => { | ||
// provides an early exit for simple cases | ||
if (isBasicType(source)) { | ||
return source; | ||
} | ||
if (isBuffer(source)) { | ||
const copy = Buffer.alloc(source.length); | ||
source.copy(copy); | ||
return copy; | ||
const stacked = stack.get(source); | ||
if (stacked) { | ||
// See issue #1619 | ||
return stacked; | ||
} | ||
if (ArrayBuffer.isView(source)) { | ||
return Buffer.isBuffer(source) | ||
? Buffer.from(source) | ||
: // adds support for all kind of TypedArray such as Int8Array, Uint8Array, etc | ||
new (classOf(source))(source.buffer.slice(0), source.byteOffset, source.byteLength); | ||
} | ||
if (isDate(source)) { | ||
@@ -33,32 +38,39 @@ return new Date(source); | ||
} | ||
const stacked = stack.get(source); | ||
if (stacked) { | ||
// See issue #1619 | ||
return stacked; | ||
if (Array.isArray(source)) { | ||
const clone = []; | ||
stack.set(source, clone); | ||
source.forEach((item, idx) => (clone[idx] = deepClone(item, stack))); | ||
return clone; | ||
} | ||
if (isArray(source)) { | ||
dest = []; | ||
if (source instanceof Map) { | ||
const clone = new Map(); | ||
stack.set(source, clone); | ||
source.forEach((value, key) => clone.set(deepClone(key, stack), deepClone(value, stack))); | ||
return clone; | ||
} | ||
else { | ||
dest = {}; | ||
stack.set(source, dest); | ||
if (source instanceof Set) { | ||
const clone = new Set(); | ||
stack.set(source, clone); | ||
source.forEach((value) => clone.add(deepClone(value, stack))); | ||
return clone; | ||
} | ||
for (const key in source) { | ||
// Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter. | ||
const clone = Object.create(Reflect.getPrototypeOf(source)); | ||
stack.set(source, clone); | ||
Reflect.ownKeys(source).forEach((key) => { | ||
// respects property descriptors and the prototype chain more explicitly, which is important for objects with getter/setter. | ||
const descriptor = Object.getOwnPropertyDescriptor(source, key); | ||
if (descriptor) { | ||
if (!isFunction(descriptor.value)) { | ||
dest[key] = deepClone(descriptor.value, stack); | ||
Object.defineProperty(clone, key, { | ||
...descriptor, | ||
value: deepClone(descriptor.value, stack) | ||
}); | ||
} | ||
else { | ||
Object.defineProperty(dest, key, descriptor); | ||
Object.defineProperty(clone, key, descriptor); | ||
} | ||
} | ||
} | ||
if (!isArray(source)) { | ||
const prototype = Reflect.getPrototypeOf(source); | ||
Reflect.setPrototypeOf(dest, prototype); | ||
} | ||
return dest; | ||
} | ||
}); | ||
return clone; | ||
}; | ||
//# sourceMappingURL=deepClone.js.map |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export declare function deepClone(source: any, stack?: WeakMap<object, any>): any; | ||
export declare const deepClone: (source: any, stack?: WeakMap<object, any>) => any; |
{ | ||
"name": "@tsed/core", | ||
"version": "7.68.3", | ||
"version": "7.68.4", | ||
"description": "Core module for Ts.ED Framework", | ||
@@ -29,3 +29,3 @@ "source": "./src/index.ts", | ||
"devDependencies": { | ||
"@tsed/typescript": "7.68.3", | ||
"@tsed/typescript": "7.68.4", | ||
"barrelsby": "^2.8.1", | ||
@@ -32,0 +32,0 @@ "eslint": "^8.57.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
533134
5688