@tonysamperi/ts-mapi-core 2.0.0-beta.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +3 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +33 -7
- package/dist/cjs/rxjs.cjs +1 -1
- package/dist/cjs/rxjs.cjs.map +1 -1
- package/dist/cjs/rxjs.d.cts +3 -3
- package/dist/cjs/{smp-cached-value.interface-DoiEsQxI.d.cts → smp-cached-value.interface-BdPg-J7L.d.cts} +2 -2
- package/dist/esm/index.d.ts +33 -7
- package/dist/esm/index.js +1 -1
- package/dist/esm/rxjs.d.ts +3 -3
- package/dist/esm/rxjs.js +1 -1
- package/dist/esm/{smp-cached-value.interface-DoiEsQxI.d.ts → smp-cached-value.interface-BdPg-J7L.d.ts} +2 -2
- package/package.json +11 -7
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as dc,b as mc,c as gc}from"./chunk-DIVAYUSN.js";import{a as Le,b as ze}from"./chunk-VBEMFJKM.js";import{a as ct}from"./chunk-F3OJMKBL.js";import{a as n}from"./chunk-EI7MMDWY.js";import{DateTime as Ue}from"ts-luxon";var ht=class extends Le{static{n(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(t){let e=this._readRaw(t);if(this._isSmpCachedValue(e)){if(e.expiry>=Ue.now().ts)return e.value;this._removeRaw(t);return}return e}remove(t){this._removeRaw(t)}write(t,e,o){if(isNaN(+o)||+o<=0){this._writeRaw(t,e,o);return}let s=Ue.now().ts+o*1e3,i={value:e,expiry:s};this._writeRaw(t,i,o)}_isSmpCachedValue(t){return ze(t)}};var jt=class extends ht{static{n(this,"SmpBrowserCache")}_storage;_prefix;constructor(t,e){super(),this._storage=t,this._prefix=e}_flushRaw(){let t=[],e=-1;for(;++e<this._storage.length;){let o=this._storage.key(e);o&&o.startsWith(this._prefix)&&t.push(o)}for(e=-1;++e<t.length;)this._storage.removeItem(t[e])}_readRaw(t){let e=this._storage.getItem(this._prefix+t);try{return e?JSON.parse(e):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+t}`);return}}_removeRaw(t){this._storage.removeItem(this._prefix+t)}_writeRaw(t,e){try{this._storage.setItem(this._prefix+t,JSON.stringify(e))}catch(o){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+t}`,o)}}};var Mt=class extends jt{static{n(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var $e=(function(r){return r[r.Continue=100]="Continue",r[r.SwitchingProtocols=101]="SwitchingProtocols",r[r.Processing=102]="Processing",r[r.EarlyHints=103]="EarlyHints",r[r.Ok=200]="Ok",r[r.Created=201]="Created",r[r.Accepted=202]="Accepted",r[r.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",r[r.NoContent=204]="NoContent",r[r.ResetContent=205]="ResetContent",r[r.PartialContent=206]="PartialContent",r[r.MultiStatus=207]="MultiStatus",r[r.AlreadyReported=208]="AlreadyReported",r[r.ImUsed=226]="ImUsed",r[r.MultipleChoices=300]="MultipleChoices",r[r.MovedPermanently=301]="MovedPermanently",r[r.Found=302]="Found",r[r.SeeOther=303]="SeeOther",r[r.NotModified=304]="NotModified",r[r.UseProxy=305]="UseProxy",r[r.Unused=306]="Unused",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",r[r.BadRequest=400]="BadRequest",r[r.Unauthorized=401]="Unauthorized",r[r.PaymentRequired=402]="PaymentRequired",r[r.Forbidden=403]="Forbidden",r[r.NotFound=404]="NotFound",r[r.MethodNotAllowed=405]="MethodNotAllowed",r[r.NotAcceptable=406]="NotAcceptable",r[r.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",r[r.RequestTimeout=408]="RequestTimeout",r[r.Conflict=409]="Conflict",r[r.Gone=410]="Gone",r[r.LengthRequired=411]="LengthRequired",r[r.PreconditionFailed=412]="PreconditionFailed",r[r.PayloadTooLarge=413]="PayloadTooLarge",r[r.UriTooLong=414]="UriTooLong",r[r.UnsupportedMediaType=415]="UnsupportedMediaType",r[r.RangeNotSatisfiable=416]="RangeNotSatisfiable",r[r.ExpectationFailed=417]="ExpectationFailed",r[r.ImATeapot=418]="ImATeapot",r[r.MisdirectedRequest=421]="MisdirectedRequest",r[r.UnprocessableEntity=422]="UnprocessableEntity",r[r.Locked=423]="Locked",r[r.FailedDependency=424]="FailedDependency",r[r.TooEarly=425]="TooEarly",r[r.UpgradeRequired=426]="UpgradeRequired",r[r.PreconditionRequired=428]="PreconditionRequired",r[r.TooManyRequests=429]="TooManyRequests",r[r.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",r[r.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",r[r.InternalServerError=500]="InternalServerError",r[r.NotImplemented=501]="NotImplemented",r[r.BadGateway=502]="BadGateway",r[r.ServiceUnavailable=503]="ServiceUnavailable",r[r.GatewayTimeout=504]="GatewayTimeout",r[r.HttpVersionNotSupported=505]="HttpVersionNotSupported",r[r.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",r[r.InsufficientStorage=507]="InsufficientStorage",r[r.LoopDetected=508]="LoopDetected",r[r.NotExtended=510]="NotExtended",r[r.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",r})({});import{Expose as Se,plainToInstance as ys}from"class-transformer";import{Expose as ms,instanceToPlain as gs,plainToInstance as _s,Transform as ws}from"class-transformer";import{Expose as Ge}from"class-transformer";function ke(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(ke,"_ts_decorate");function Dt(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(Dt,"_ts_metadata");var F=class r{static{n(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(t,e=ct.ERROR){this._message=t,this._type=e}static sanitizeMessages(t){return typeof t=="string"?t.length?[new r(t)]:[]:[t].flat().map(e=>typeof e=="string"?new r(e):e)}};ke([Ge(),Dt("design:type",String),Dt("design:paramtypes",[])],F.prototype,"message",null);ke([Ge(),Dt("design:type",typeof ct>"u"?Object:ct),Dt("design:paramtypes",[])],F.prototype,"type",null);function ds(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(ds,"_ts_decorate");function Ke(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(Ke,"_ts_metadata");var Et=class r{static{n(this,"SmpGenericResponse")}_messages;data;set messages(t){this._messages=F.sanitizeMessages(t)}get messages(){return this._messages}constructor(t=[],e){this._messages=t,this.data=e}static create(t){return new r([t.messages||[]].flat().map(e=>e instanceof F?e:new F(e,t.type||ct.SUCCESS)),t.data)}static fromPlain(t){return _s(r,t)}isError(){return!this.isSuccess()}isSuccess(){return typeof this._errorCode=="number"}serialize(){return gs(this,{excludePrefixes:["_"]})}};ds([ms(),ws(({value:r})=>r?.length?r:void 0),Ke("design:type",Object),Ke("design:paramtypes",[])],Et.prototype,"messages",null);function We(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(We,"_ts_decorate");function Nt(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(Nt,"_ts_metadata");var z=class r extends Et{static{n(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new F("GENERIC_ERROR")]}set errorCode(t){this._errorCode=t}get errorCode(){return this._errorCode}get status(){return this._status}set timestamp(t){this._timestamp=t}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(t=r.DEFAULT_MESSAGES,e="GENERIC_ERROR",o=500,s){super(t,s),this._errorCode=e,this._status=o}static create({messages:t=r.DEFAULT_MESSAGES,...e}={}){return new r(F.sanitizeMessages(t),e.errorCode,e.status,e.data)}static fromPlain(t){let e=ys(xs,t,{excludePrefixes:["_"]}),o=new r;return Object.getOwnPropertyNames(e).forEach(s=>{s in o&&(o[s]=e[s])}),o}};We([Se(),Nt("design:type",Object),Nt("design:paramtypes",[])],z.prototype,"errorCode",null);We([Se(),Nt("design:type",Number),Nt("design:paramtypes",[])],z.prototype,"timestamp",null);var xs=class extends z{static{n(this,"SmpErrorResponseMutable")}set errorCode(t){this._errorCode=t}set status(t){this._status=t}set timestamp(t){this._timestamp=t}};var H=class{static{n(this,"Hex")}static parse(t){let e=t.length,o=[];for(let s=0;s<e;s+=2)o[s>>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new _(o,e/2)}static stringify(t){let e=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;e.push((s>>>4).toString(16)),e.push((s&15).toString(16))}return e.join("")}};var _=class he{static{n(this,"WordArray")}constructor(t,e){this.words=t||[],e!==void 0?this.sigBytes=e:this.sigBytes=this.words.length*4}static random(t){let e=[],o=n(function(s){let i=987654321,a=4294967295;return function(){i=36969*(i&65535)+(i>>16)&a,s=18e3*(s&65535)+(s>>16)&a;let c=(i<<16)+s&a;return c/=4294967296,c+=.5,c*(Math.random()>.5?1:-1)}},"r");for(let s=0,i;s<t;s+=4){let a=o((i||Math.random())*4294967296);i=a()*987654071,e.push(a()*4294967296|0)}return new he(e,t)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new he(this.words.slice(0),this.sigBytes)}concat(t){if(this.clamp(),this.sigBytes%4)for(let e=0;e<t.sigBytes;e++){let o=t.words[e>>>2]>>>24-e%4*8&255;this.words[this.sigBytes+e>>>2]|=o<<24-(this.sigBytes+e)%4*8}else for(let e=0;e<t.sigBytes;e+=4)this.words[this.sigBytes+e>>>2]=t.words[e>>>2];return this.sigBytes+=t.sigBytes,this}toString(t){return(t||H).stringify(this)}};var Ft=class{static{n(this,"Latin1")}static parse(t){let e=t.length,o=[];for(let s=0;s<e;s++)o[s>>>2]|=(t.charCodeAt(s)&255)<<24-s%4*8;return new _(o,e)}static stringify(t){let e=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;e.push(String.fromCharCode(s))}return e.join("")}};var I=class{static{n(this,"Utf8")}static parse(t){return Ft.parse(unescape(encodeURIComponent(t)))}static stringify(t){try{return decodeURIComponent(escape(Ft.stringify(t)))}catch(e){throw console.error("Malformed UTF-8 data",e),new Error("Malformed UTF-8 data")}}};var Lt=class{static{n(this,"BufferedBlockAlgorithm")}constructor(t){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},t),this._data=new _,this._nDataBytes=0}clone(){let t=this.constructor();for(let e in this)Object.prototype.hasOwnProperty.call(this,e)&&(t[e]=this[e]);return t._data=this._data.clone(),t}reset(){this._data=new _,this._nDataBytes=0}_append(t){typeof t=="string"&&(t=I.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_process(t){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let e=this.cfg.blockSize*4,o=this._data.sigBytes/e;t?o=Math.ceil(o):o=Math.max((o|0)-this._minBufferSize,0);let s=o*this.cfg.blockSize,i=Math.min(s*4,this._data.sigBytes),a;if(s){for(let c=0;c<s;c+=this.cfg.blockSize)this._doProcessBlock(this._data.words,c);a=this._data.words.splice(0,s),this._data.sigBytes-=i}return new _(a,i)}};var lt=class{static{n(this,"CipherParams")}constructor(t){this.ciphertext=t.ciphertext,this.key=t.key,this.iv=t.iv,this.salt=t.salt,this.algorithm=t.algorithm,this.mode=t.mode,this.padding=t.padding,this.blockSize=t.blockSize,this.formatter=t.formatter}extend(t){return t.ciphertext!==void 0&&(this.ciphertext=t.ciphertext),t.key!==void 0&&(this.key=t.key),t.iv!==void 0&&(this.iv=t.iv),t.salt!==void 0&&(this.salt=t.salt),t.algorithm!==void 0&&(this.algorithm=t.algorithm),t.mode!==void 0&&(this.mode=t.mode),t.padding!==void 0&&(this.padding=t.padding),t.blockSize!==void 0&&(this.blockSize=t.blockSize),t.formatter!==void 0&&(this.formatter=t.formatter),this}toString(t){if(t)return t.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var U=class{static{n(this,"Base64")}static parse(t){let e=t.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let s=0;s<this._map.length;s++)this._reverseMap[this._map.charCodeAt(s)]=s}let o=this._map.charAt(64);if(o){let s=t.indexOf(o);s!==-1&&(e=s)}return this.parseLoop(t,e,this._reverseMap)}static parseLoop(t,e,o){let s=[],i=0;for(let a=0;a<e;a++)if(a%4){let c=o[t.charCodeAt(a-1)]<<a%4*2,h=o[t.charCodeAt(a)]>>>6-a%4*2;s[i>>>2]|=(c|h)<<24-i%4*8,i++}return new _(s,i)}static stringify(t){t.clamp();let e=[];for(let s=0;s<t.sigBytes;s+=3){let i=t.words[s>>>2]>>>24-s%4*8&255,a=t.words[s+1>>>2]>>>24-(s+1)%4*8&255,c=t.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=i<<16|a<<8|c;for(let f=0;f<4&&s+f*.75<t.sigBytes;f++)e.push(this._map.charAt(h>>>6*(3-f)&63))}let o=this._map.charAt(64);if(o)for(;e.length%4;)e.push(o);return e.join("")}};U._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";U._reverseMap=void 0;var zt=class{static{n(this,"OpenSSL")}static parse(t){let e=U.parse(t),o;return e.words[0]===1398893684&&e.words[1]===1701076831&&(o=new _(e.words.slice(2,4)),e.words.splice(0,4),e.sigBytes-=16),new lt({ciphertext:e,salt:o})}static stringify(t){if(!t.ciphertext)throw new Error("missing ciphertext in params");let e=t.ciphertext,o=t.salt,s;if(o){if(typeof o=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(o).concat(e)}else s=e;return s.toString(U)}};var Q=class{static{n(this,"SerializableCipher")}static decrypt(t,e,o,s){let i=Object.assign({},this.cfg,s);if(!i.format)throw new Error("could not determine format");if(e=this._parse(e,i.format),!e.ciphertext)throw new Error("could not determine ciphertext");return t.createDecryptor(o,i).finalize(e.ciphertext)}static encrypt(t,e,o,s){let i=Object.assign({},this.cfg,s),a=t.createEncryptor(o,i),c=a.finalize(e);return new lt({ciphertext:c,key:o,iv:a.cfg.iv,algorithm:t,mode:a.cfg.mode,padding:a.cfg.padding,blockSize:a.cfg.blockSize,formatter:i.format})}static _parse(t,e){return typeof t=="string"?e.parse(t):t}};Q.cfg={blockSize:4,iv:new _([]),format:zt};var C=class extends Lt{static{n(this,"Hasher")}constructor(t){super(Object.assign({blockSize:512/32},t)),this.reset()}static _createHelper(t){function e(o,s){return new t(s).finalize(o)}return n(e,"helper"),e}finalize(t){return t&&this._append(t),this._doFinalize()}update(t){return this._append(t),this._process(),this}};var p=[];for(let r=0;r<64;r++)p[r]=Math.abs(Math.sin(r+1))*4294967296|0;var $=class u extends C{static{n(this,"MD5")}get hash(){return this._hash}static FF(t,e,o,s,i,a,c){let h=t+(e&o|~e&s)+i+c;return(h<<a|h>>>32-a)+e}static GG(t,e,o,s,i,a,c){let h=t+(e&s|o&~s)+i+c;return(h<<a|h>>>32-a)+e}static HH(t,e,o,s,i,a,c){let h=t+(e^o^s)+i+c;return(h<<a|h>>>32-a)+e}static II(t,e,o,s,i,a,c){let h=t+(o^(e|~s))+i+c;return(h<<a|h>>>32-a)+e}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let t=this._nDataBytes*8,e=this._data.sigBytes*8;this._data.words[e>>>5]|=128<<24-e%32;let o=Math.floor(t/4294967296),s=t;this._data.words[(e+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,this._data.words[(e+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let i=0;i<4;i++)this._hash.words[i]=(this._hash.words[i]<<8|this._hash.words[i]>>>24)&16711935|(this._hash.words[i]<<24|this._hash.words[i]>>>8)&4278255360;return this._hash}_doProcessBlock(t,e){for(let h=0;h<16;h++){let f=e+h,g=t[f];t[f]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let o=Array.from({length:16});for(let h=0;h<16;h++)o[h]=t[e+h];let s=this._hash.words[0],i=this._hash.words[1],a=this._hash.words[2],c=this._hash.words[3];s=u.FF(s,i,a,c,o[0],7,p[0]),c=u.FF(c,s,i,a,o[1],12,p[1]),a=u.FF(a,c,s,i,o[2],17,p[2]),i=u.FF(i,a,c,s,o[3],22,p[3]),s=u.FF(s,i,a,c,o[4],7,p[4]),c=u.FF(c,s,i,a,o[5],12,p[5]),a=u.FF(a,c,s,i,o[6],17,p[6]),i=u.FF(i,a,c,s,o[7],22,p[7]),s=u.FF(s,i,a,c,o[8],7,p[8]),c=u.FF(c,s,i,a,o[9],12,p[9]),a=u.FF(a,c,s,i,o[10],17,p[10]),i=u.FF(i,a,c,s,o[11],22,p[11]),s=u.FF(s,i,a,c,o[12],7,p[12]),c=u.FF(c,s,i,a,o[13],12,p[13]),a=u.FF(a,c,s,i,o[14],17,p[14]),i=u.FF(i,a,c,s,o[15],22,p[15]),s=u.GG(s,i,a,c,o[1],5,p[16]),c=u.GG(c,s,i,a,o[6],9,p[17]),a=u.GG(a,c,s,i,o[11],14,p[18]),i=u.GG(i,a,c,s,o[0],20,p[19]),s=u.GG(s,i,a,c,o[5],5,p[20]),c=u.GG(c,s,i,a,o[10],9,p[21]),a=u.GG(a,c,s,i,o[15],14,p[22]),i=u.GG(i,a,c,s,o[4],20,p[23]),s=u.GG(s,i,a,c,o[9],5,p[24]),c=u.GG(c,s,i,a,o[14],9,p[25]),a=u.GG(a,c,s,i,o[3],14,p[26]),i=u.GG(i,a,c,s,o[8],20,p[27]),s=u.GG(s,i,a,c,o[13],5,p[28]),c=u.GG(c,s,i,a,o[2],9,p[29]),a=u.GG(a,c,s,i,o[7],14,p[30]),i=u.GG(i,a,c,s,o[12],20,p[31]),s=u.HH(s,i,a,c,o[5],4,p[32]),c=u.HH(c,s,i,a,o[8],11,p[33]),a=u.HH(a,c,s,i,o[11],16,p[34]),i=u.HH(i,a,c,s,o[14],23,p[35]),s=u.HH(s,i,a,c,o[1],4,p[36]),c=u.HH(c,s,i,a,o[4],11,p[37]),a=u.HH(a,c,s,i,o[7],16,p[38]),i=u.HH(i,a,c,s,o[10],23,p[39]),s=u.HH(s,i,a,c,o[13],4,p[40]),c=u.HH(c,s,i,a,o[0],11,p[41]),a=u.HH(a,c,s,i,o[3],16,p[42]),i=u.HH(i,a,c,s,o[6],23,p[43]),s=u.HH(s,i,a,c,o[9],4,p[44]),c=u.HH(c,s,i,a,o[12],11,p[45]),a=u.HH(a,c,s,i,o[15],16,p[46]),i=u.HH(i,a,c,s,o[2],23,p[47]),s=u.II(s,i,a,c,o[0],6,p[48]),c=u.II(c,s,i,a,o[7],10,p[49]),a=u.II(a,c,s,i,o[14],15,p[50]),i=u.II(i,a,c,s,o[5],21,p[51]),s=u.II(s,i,a,c,o[12],6,p[52]),c=u.II(c,s,i,a,o[3],10,p[53]),a=u.II(a,c,s,i,o[10],15,p[54]),i=u.II(i,a,c,s,o[1],21,p[55]),s=u.II(s,i,a,c,o[8],6,p[56]),c=u.II(c,s,i,a,o[15],10,p[57]),a=u.II(a,c,s,i,o[6],15,p[58]),i=u.II(i,a,c,s,o[13],21,p[59]),s=u.II(s,i,a,c,o[4],6,p[60]),c=u.II(c,s,i,a,o[11],10,p[61]),a=u.II(a,c,s,i,o[2],15,p[62]),i=u.II(i,a,c,s,o[9],21,p[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+a|0,this._hash.words[3]=this._hash.words[3]+c|0}};var le=class qe{static{n(this,"EVPKDF")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:$,iterations:1},t)}static execute(t,e,o){return new qe(o).compute(t,e)}compute(t,e){let o=new this.cfg.hasher,s=new _,i;for(;s.words.length<this.cfg.keySize;){i&&o.update(i),i=o.update(t).finalize(e),o.reset();for(let a=1;a<this.cfg.iterations;a++)i=o.finalize(i),o.reset();s.concat(i)}return s.sigBytes=this.cfg.keySize*4,s}};var He=class{static{n(this,"OpenSSLKdf")}static execute(t,e,o,s){s||(s=_.random(64/8));let i=new le({keySize:e+o}).compute(t,s),a=new _(i.words.slice(e),o*4);return i.sigBytes=e*4,new lt({key:i,iv:a,salt:s})}};var Ut=class{static{n(this,"PasswordBasedCipher")}static decrypt(t,e,o,s){let i=Object.assign({},this.cfg,s);if(i.format===void 0)throw new Error("missing format in config");if(e=this._parse(e,i.format),i.kdf===void 0)throw new Error("the key derivation function must be set");let a=i.kdf.execute(o,t.keySize,t.ivSize,e.salt);return a.iv!==void 0&&(i.iv=a.iv),Q.decrypt.call(this,t,e,a.key,i)}static encrypt(t,e,o,s){let i=Object.assign({},this.cfg,s);if(i.kdf===void 0)throw new Error("missing kdf in config");let a=i.kdf.execute(o,t.keySize,t.ivSize);return a.iv!==void 0&&(i.iv=a.iv),Q.encrypt.call(this,t,e,a.key,i).extend(a)}static _parse(t,e){return typeof t=="string"?e.parse(t):t}};Ut.cfg={blockSize:4,iv:new _([]),format:zt,kdf:He};var Ve=class{static{n(this,"CipherHelper")}constructor(t){this._cipher=t}decrypt(t,e,o){return typeof e=="string"?Ut.decrypt(this._cipher,t,e,o):Q.decrypt(this._cipher,t,e,o)}encrypt(t,e,o){return typeof e=="string"?Ut.encrypt(this._cipher,t,e,o):Q.encrypt(this._cipher,t,e,o)}};var ft=class extends Lt{static{n(this,"Cipher")}constructor(t,e,o){super(Object.assign({blockSize:1},o)),this._xformMode=t,this._key=e,this.reset()}static _createHelper(t){return new Ve(t)}static createDecryptor(t,e){let o=this;return new o(this._DEC_XFORM_MODE,t,e)}static createEncryptor(t,e){return new this(this._ENC_XFORM_MODE,t,e)}finalize(t){return t&&this._append(t),this._doFinalize()}process(t){return this._append(t),this._process()}};ft.ivSize=4;ft.keySize=4;ft._DEC_XFORM_MODE=2;ft._ENC_XFORM_MODE=1;var tt=class{static{n(this,"BlockCipherModeAlgorithm")}constructor(t,e){this.init(t,e)}init(t,e){this._cipher=t,this._iv=e}};var $t=class{static{n(this,"BlockCipherMode")}static createDecryptor(t,e){let o=this.Decryptor;return new o(t,e)}static createEncryptor(t,e){let o=this.Encryptor;return new o(t,e)}};$t.Decryptor=tt;$t.Encryptor=tt;var Xe=class extends tt{static{n(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(t,e){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(t,e,this._cipher.cfg.blockSize),this._cipher.encryptBlock(t,e),this._prevBlock=t.slice(e,e+this._cipher.cfg.blockSize)}xorBlock(t,e,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[e+i]^=s[i]}};var Ze=class extends tt{static{n(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(t,e){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let o=t.slice(e,e+this._cipher.cfg.blockSize);this._cipher.decryptBlock(t,e),this.xorBlock(t,e,this._cipher.cfg.blockSize),this._prevBlock=o}xorBlock(t,e,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[e+i]^=s[i]}};var V=class extends $t{static{n(this,"CBC")}};V.Decryptor=Ze;V.Encryptor=Xe;var pt=class{static{n(this,"PKCS7")}static pad(t,e){let o=e*4,s=o-t.sigBytes%o,i=s<<24|s<<16|s<<8|s,a=[];for(let h=0;h<s;h+=4)a.push(i);let c=new _(a,s);t.concat(c)}static unpad(t){let e=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=e}};var kt=class extends ft{static{n(this,"BlockCipher")}constructor(t,e,o){super(t,e,Object.assign({blockSize:4,mode:V,padding:pt},o))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let t;this._xformMode===this.constructor._ENC_XFORM_MODE?t=this.cfg.mode.createEncryptor:(t=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===t?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=t.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=t)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let t;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),t=this._process(!0)}else t=this._process(!0),this.cfg.padding.unpad(t);return t}_doProcessBlock(t,e){this._mode.processBlock(t,e)}};var l=class L{static{n(this,"X64Word")}constructor(t,e){this.high=t,this.low=e}add(t){let e=this.low+t.low|0,o=e>>>0<this.low>>>0?1:0,s=this.high+t.high+o|0;return new L(s,e)}and(t){return new L(this.high&t.high,this.low&t.low)}not(){return new L(~this.high,~this.low)}or(t){return new L(this.high|t.high,this.low|t.low)}rotL(t){return this.shiftL(t).or(this.shiftR(64-t))}rotR(t){return this.shiftR(t).or(this.shiftL(64-t))}shiftL(t){return t<32?new L(this.high<<t|this.low>>>32-t,this.low<<t):new L(this.low<<t-32,0)}shiftR(t){return t<32?new L(this.high>>>t,this.low>>>t|this.high<<32-t):new L(0,this.high>>>t-32)}xor(t){return new L(this.high^t.high,this.low^t.low)}};var Je=class fe{static{n(this,"X64WordArray")}constructor(t=[],e){this.words=t,this.sigBytes=e!==void 0?e:t.length*8}static create(t=[],e){return new fe(t,e)}clone(){let t=this.words.map(e=>new l(e.high,e.low));return new fe(t,this.sigBytes)}toX32(){let t=[];for(let e of this.words)t.push(e.high,e.low);return new _(t,this.sigBytes)}};var P=[],Ye=[],Qe=[],tr=[],er=[],rr=[],pe=[],ue=[],de=[],me=[];(function(){let r=[];for(let o=0;o<256;o++)o<128?r[o]=o<<1:r[o]=o<<1^283;let t=0,e=0;for(let o=0;o<256;o++){let s=e^e<<1^e<<2^e<<3^e<<4;s=s>>>8^s&255^99,P[t]=s,Ye[s]=t;let i=r[t],a=r[i],c=r[a],h=r[s]*257^s*16843008;Qe[t]=h<<24|h>>>8,tr[t]=h<<16|h>>>16,er[t]=h<<8|h>>>24,rr[t]=h,h=c*16843009^a*65537^i*257^t*16843008,pe[s]=h<<24|h>>>8,ue[s]=h<<16|h>>>16,de[s]=h<<8|h>>>24,me[s]=h,t?(t=i^r[r[r[c^i]]],e^=r[r[e]]):t=e=1}})();var bs=[0,1,2,4,8,16,32,64,128,27,54],Gt=class extends kt{static{n(this,"AES")}constructor(t,e,o){super(t,e,o),super.reset()}decryptBlock(t,e){let o=t[e+1];t[e+1]=t[e+3],t[e+3]=o,this._doCryptBlock(t,e,this._invKeySchedule,pe,ue,de,me,Ye),o=t[e+1],t[e+1]=t[e+3],t[e+3]=o}encryptBlock(t,e){this._doCryptBlock(t,e,this._keySchedule,Qe,tr,er,rr,P)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let t=this._keyPriorReset=this._key,e=t.words,o=t.sigBytes/4,i=((this._nRounds=o+6)+1)*4,a=this._keySchedule=[];for(let c=0;c<i;c++)if(c<o)a[c]=e[c];else{let h=a[c-1];c%o?o>6&&c%o===4&&(h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255]):(h=h<<8|h>>>24,h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255],h^=bs[c/o|0]<<24),a[c]=a[c-o]^h}this._invKeySchedule=[];for(let c=0;c<i;c++){let h=i-c,f;c%4?f=a[h]:f=a[h-4],c<4||h<=4?this._invKeySchedule[c]=f:this._invKeySchedule[c]=pe[P[f>>>24]]^ue[P[f>>>16&255]]^de[P[f>>>8&255]]^me[P[f&255]]}}_doCryptBlock(t,e,o,s,i,a,c,h){let f=t[e]^o[0],g=t[e+1]^o[1],d=t[e+2]^o[2],m=t[e+3]^o[3],w=4;for(let E=1;E<this._nRounds;E++){let x=s[f>>>24]^i[g>>>16&255]^a[d>>>8&255]^c[m&255]^o[w++],b=s[g>>>24]^i[d>>>16&255]^a[m>>>8&255]^c[f&255]^o[w++],T=s[d>>>24]^i[m>>>16&255]^a[f>>>8&255]^c[g&255]^o[w++],ce=s[m>>>24]^i[f>>>16&255]^a[g>>>8&255]^c[d&255]^o[w++];f=x,g=b,d=T,m=ce}let y=(h[f>>>24]<<24|h[g>>>16&255]<<16|h[d>>>8&255]<<8|h[m&255])^o[w++],v=(h[g>>>24]<<24|h[d>>>16&255]<<16|h[m>>>8&255]<<8|h[f&255])^o[w++],R=(h[d>>>24]<<24|h[m>>>16&255]<<16|h[f>>>8&255]<<8|h[g&255])^o[w++],O=(h[m>>>24]<<24|h[f>>>16&255]<<16|h[g>>>8&255]<<8|h[d&255])^o[w++];t[e]=y,t[e+1]=v,t[e+2]=R,t[e+3]=O}};Gt.keySize=256/32;var As=[1732584193,4023233417,2562383102,271733878,3285377520],et=new Array(80),rt=class extends C{static{n(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(As.slice(0))}_doFinalize(){let t=this._nDataBytes*8,e=this._data.sigBytes*8;return this._data.words[e>>>5]|=128<<24-e%32,this._data.words[(e+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(e+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,e){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)et[h]=t[e+h]|0;else{let m=et[h-3]^et[h-8]^et[h-14]^et[h-16];et[h]=m<<1|m>>>31}let f,g;h<20?(f=s&i|~s&a,g=1518500249):h<40?(f=s^i^a,g=1859775393):h<60?(f=s&i|s&a|i&a,g=2400959708):(f=s^i^a,g=3395469782);let d=(o<<5|o>>>27)+f+c+g+et[h];c=a,a=i,i=s<<30|s>>>2,s=o,o=d|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0}};var or=[],sr=[];(function(){function r(s){let i=Math.sqrt(s);for(let a=2;a<=i;a++)if(!(s%a))return!1;return!0}n(r,"isPrime");function t(s){return(s-(s|0))*4294967296|0}n(t,"getFractionalBits");let e=2,o=0;for(;o<64;)r(e)&&(o<8&&(or[o]=t(Math.pow(e,1/2))),sr[o]=t(Math.pow(e,1/3)),o++),e++})();var ot=[],Rt=class extends C{static{n(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(or.slice(0))}_doFinalize(){let t=this._nDataBytes*8,e=this._data.sigBytes*8;return this._data.words[e>>>5]|=128<<24-e%32,this._data.words[(e+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(e+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,e){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4],h=this._hash.words[5],f=this._hash.words[6],g=this._hash.words[7];for(let d=0;d<64;d++){if(d<16)ot[d]=t[e+d]|0;else{let E=ot[d-15],x=(E<<25|E>>>7)^(E<<14|E>>>18)^E>>>3,b=ot[d-2],T=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;ot[d]=x+ot[d-7]+T+ot[d-16]}let m=c&h^~c&f,w=o&s^o&i^s&i,y=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),v=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),R=g+v+m+sr[d]+ot[d],O=y+w;g=f,f=h,h=c,c=a+R|0,a=i,i=s,s=o,o=R+O|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+f|0,this._hash.words[7]=this._hash.words[7]+g|0}};var ge=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],D=[];(function(){for(let r=0;r<80;r++)D[r]=new l(void 0,void 0)})();var _e=class extends C{static{n(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new Je([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let t=this._data,e=t.words,o=this._nDataBytes*8,s=t.sigBytes*8;return e[s>>>5]|=128<<24-s%32,e[(s+128>>>10<<5)+30]=Math.floor(o/4294967296),e[(s+128>>>10<<5)+31]=o,t.sigBytes=e.length*4,this._process(),this._hash.toX32()}_doProcessBlock(t,e){let o=this._hash.words[0].high,s=this._hash.words[0].low,i=this._hash.words[1].high,a=this._hash.words[1].low,c=this._hash.words[2].high,h=this._hash.words[2].low,f=this._hash.words[3].high,g=this._hash.words[3].low,d=this._hash.words[4].high,m=this._hash.words[4].low,w=this._hash.words[5].high,y=this._hash.words[5].low,v=this._hash.words[6].high,R=this._hash.words[6].low,O=this._hash.words[7].high,E=this._hash.words[7].low;for(let x=0;x<80;x++){let b,T;if(x<16)T=D[x].high=t[e+x*2]|0,b=D[x].low=t[e+x*2+1]|0;else{let Me=D[x-15],nt=Me.high,At=Me.low,ps=(nt>>>1|At<<31)^(nt>>>8|At<<24)^nt>>>7,De=(At>>>1|nt<<31)^(At>>>8|nt<<24)^(At>>>7|nt<<25),Ne=D[x-2],at=Ne.high,vt=Ne.low,us=(at>>>19|vt<<13)^(at<<3|vt>>>29)^at>>>6,Fe=(vt>>>19|at<<13)^(vt<<3|at>>>29)^(vt>>>6|at<<26);b=De+D[x-7].low,T=ps+D[x-7].high+(b>>>0<De>>>0?1:0),b=b+Fe,T=T+us+(b>>>0<Fe>>>0?1:0),b=b+D[x-16].low,T=T+D[x-16].high+(b>>>0<D[x-16].low>>>0?1:0),D[x].high=T,D[x].low=b}let ce=d&w^~d&v,Ie=m&y^~m&R,ns=o&i^o&c^i&c,as=s&a^s&h^a&h,cs=(o>>>28|s<<4)^(o<<30|s>>>2)^(o<<25|s>>>7),Pe=(s>>>28|o<<4)^(s<<30|o>>>2)^(s<<25|o>>>7),hs=(d>>>14|m<<18)^(d>>>18|m<<14)^(d<<23|m>>>9),ls=(m>>>14|d<<18)^(m>>>18|d<<14)^(m<<23|d>>>9),j=E+ls,q=O+hs+(j>>>0<E>>>0?1:0);j=j+Ie,q=q+ce+(j>>>0<Ie>>>0?1:0),j=j+ge[x].low,q=q+ge[x].high+(j>>>0<ge[x].low>>>0?1:0),j=j+b,q=q+T+(j>>>0<b>>>0?1:0);let je=Pe+as,fs=cs+ns+(je>>>0<Pe>>>0?1:0);O=v,E=R,v=w,R=y,w=d,y=m,m=g+j|0,d=f+q+(m>>>0<g>>>0?1:0)|0,f=c,g=h,c=i,h=a,i=o,a=s,s=j+je|0,o=q+fs+(s>>>0<j>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+s,this._hash.words[0].high=this._hash.words[0].high+o+(this._hash.words[0].low>>>0<s>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+a,this._hash.words[1].high=this._hash.words[1].high+i+(this._hash.words[1].low>>>0<a>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+c+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+f+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+m,this._hash.words[4].high=this._hash.words[4].high+d+(this._hash.words[4].low>>>0<m>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+y,this._hash.words[5].high=this._hash.words[5].high+w+(this._hash.words[5].low>>>0<y>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+R,this._hash.words[6].high=this._hash.words[6].high+v+(this._hash.words[6].low>>>0<R>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+E,this._hash.words[7].high=this._hash.words[7].high+O+(this._hash.words[7].low>>>0<E>>>0?1:0)}};var ir=class{static{n(this,"HMAC")}constructor(t,e){this._hasher=new t;let o=typeof e=="string"?I.parse(e):e,s=this._hasher.cfg.blockSize,i=s*4;o.sigBytes>i&&(o=this._hasher.finalize(o)),o.clamp();let a=this._oKey=o.clone(),c=this._iKey=o.clone(),h=a.words,f=c.words;for(let g=0;g<s;g++)h[g]^=1549556828,f[g]^=909522486;a.sigBytes=c.sigBytes=i,this.reset()}finalize(t){let e=this._hasher.finalize(t);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(e))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(t){return this._hasher.update(t),this}};var we=class nr{static{n(this,"PBKDF2")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:Rt,iterations:25e4},t)}static execute(t,e,o){return new nr(o).compute(t,e)}compute(t,e){let o=this.cfg,s=new ir(o.hasher,t),i=new _,a=new _([1]),c=i.words,h=a.words,f=o.keySize,g=o.iterations;for(;c.length<f;){let d=s.update(e).finalize(a);s.reset();let m=d.words,w=m.length,y=d;for(let v=1;v<g;v++){y=s.finalize(y),s.reset();let R=y.words;for(let O=0;O<w;O++)m[O]^=R[O]}i.concat(d),h[0]++}return i.sigBytes=f*4,i}};var Ot=kt._createHelper(Gt);var ut=C._createHelper($);var dt=C._createHelper(rt);var Kt=C._createHelper(Rt);var Wt=C._createHelper(_e);var mt=class{static{n(this,"SmpCrypto")}static base64Decode(t){return I.stringify(U.parse(t))}static base64Encode(t){return U.stringify(I.parse(t))}static md5(t){return ut(t).toString()}static sha1(t){return dt(t).toString()}static sha256(t){return Kt(t).toString()}static sha512(t){return Wt(t).toString()}};var St=class extends ht{static{n(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(t){return this._staticSelf._storage.get(t)}_removeRaw(t){this._staticSelf._storage.delete(t)}_writeRaw(t,e){this._staticSelf._storage.set(t,e)}};var ar=class{static{n(this,"SmpHttpTwoService")}static _cacheStrategy=typeof sessionStorage<"u"?new Mt:new St;static _errorClass=z;static _mergeParamsFallbackBaseUrl="https://uc-api-nest-common-fe";static _running=new Map;static $http(t){return this._generateAjax(t)}static async _generateAjax(t){let e=this._generateCacheKey(t),o=+(t.ttl||0)>0;if(o){let a=this._cacheStrategy.read(e);if(a)return Promise.resolve(a)}let s=this._running.get(e);if(s)return s;let i=this._generateAjaxBase(t).then(a=>(o&&this._cacheStrategy.write(e,a,t.ttl),a)).finally(()=>{this._running.delete(e)});return this._running.set(e,i),i}static async _generateAjaxBase(t){let e=await this._preprocessRequest(t),o={method:e.method,headers:new Headers({"content-type":"application/json",...e.headers}),body:e.body?JSON.stringify(e.body):null};return e.useCredentials&&(o.credentials="include"),e.url=this.mergeQueryParams(e.url,e.queryParams),fetch(e.url,o).then(s=>this._preprocessResponse(t,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(e.responseType){case"blob":return s.blob();case"arraybuffer":return s.arrayBuffer();case"text":return s.text();case"json":default:return s.json()}}return s.json().then(i=>{let a=i;try{a=this._errorClass.fromPlain(i)}catch(c){console.debug("http: failed to parse error response into ErrorResponse",c)}return Promise.reject({status:s.status,message:s.statusText,body:a})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(t,e){if(!e||Object.keys(e).length===0)return t;let o=t.startsWith("http"),s=new URL(t,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),a={...Object.fromEntries(new URLSearchParams(s.search).entries()),...e},c=[];for(let[d,m]of Object.entries(a))if(m!=null)if(Array.isArray(m))for(let w of m)c.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(w))}`);else c.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(m))}`);let h=c.length?`?${c.join("&")}`:"",g=s.origin+s.pathname+h;return o?g:g.replace(s.origin,"")}static _generateCacheKey(t){let e=`${t.method}:${t.url}`;return t.queryParams&&Object.keys(t.queryParams).length>0&&(e+=`:${mt.md5(JSON.stringify(t.queryParams))}`),t.body&&Object.keys(t.body).length>0?`${e}:${mt.md5(JSON.stringify(t.body))}`:e}static async _preprocessRequest(t){return t}static async _preprocessResponse(t,e){return e}};import{SmpLoggerMethods as vs}from"@tonysamperi/logger";var cr=class{static{n(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new vs;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(t,e){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}static fromBearer(t=""){return t.split(" ")[1]}static getCountryFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[1]}static getLocaleFromReferer(t){return t?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(t,e){try{return t.replace(this._pathParamRegex,(o,s)=>{let i=e[s];return i!==void 0?encodeURIComponent(i):o})}catch(o){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,o)}return t}};var Ep={status:"OK"};var hr=(function(r){return r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r})({});var lr=class{static{n(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(t,e,o){this._access_token=t,this._exp=e,this._iss=o}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};var fr=class{static{n(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};var Bt=class{static{n(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?H.parse(this._initVector):void 0}_mode=V;_padding=pt;constructor(t,e,o){this._password=t,this._salt=e,this._initVector=o}decryptAES(t){return Ot.decrypt(t,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(t){return Ot.encrypt(t,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return we.execute(this._password,H.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:rt})}};var ye=class{static{n(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(t){this._baseCode=t}static check(t,e){if(new this(t).secureCode!==e)throw z.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:$e.BadRequest})}_encode(){let t=new $;return t.update(I.parse(this._seed+this._baseCode)),t.finalize().toString(H).substring(0,this._crcLength).toUpperCase()}};import{Expose as Rs,instanceToPlain as Os,plainToInstance as Bs}from"class-transformer";import{DateTime as xe}from"ts-luxon";var M=(function(r){return r.ACTIVATE="ACTIVATE",r.BLOCK="BLOCK",r.CHECK="CHECK",r.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",r.FREEZE="FREEZE",r.PURCHASE="PURCHASE",r.RECHARGE="RECHARGE",r.ROLLBACK="ROLLBACK",r.TRANSACTION="TRANSACTION",r.TRANSACTION_DETAIL="TRANSACTION_DETAIL",r.UNFREEZE="UNFREEZE",r.XREFUND="XREFUND",r})({});var gt=(function(r){return r.MD5="MD5",r.MD5_HMAC="MD5_HMAC",r.SHA1="SHA1",r.SHA1_HMAC="SHA1_HMAC",r})({});function Es(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(Es,"_ts_decorate");function pr(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(pr,"_ts_metadata");var be=class r{static{n(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new Bt("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _OP_CODES={[M.CHECK]:"",[M.TRANSACTION]:"",[M.TRANSACTION_DETAIL]:"",[M.ACTIVATE]:"A",[M.BLOCK]:"B",[M.DIGITAL_ACTIVATE]:"D",[M.FREEZE]:"F",[M.PURCHASE]:"P",[M.RECHARGE]:"G",[M.ROLLBACK]:"R",[M.UNFREEZE]:"U",[M.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[gt.MD5]:t=>ut(t),[gt.MD5_HMAC]:t=>{let e=new $;return e.update(I.parse(t)),e.finalize()},[gt.SHA1]:t=>dt(t),[gt.SHA1_HMAC]:t=>{let e=new rt;return e.update(I.parse(t)),e.finalize()}};_hashStrategy=this._hashStrategies[gt.MD5];constructor(t="ACTIVATION",e,o,s){this.gc=t,this.op=e,this.ot=o,this._dto=typeof s=="number"&&s>=0?xe.fromMillis(+`${s}000`.slice(0,13)):xe.local()}static build({gc:t,op:e,ot:o,dto:s}){return new this(t,e,o,s?.ts)}static explode(t){let e=this.constructor,o=(t||"").split(e._SEP);if(o.length<4)throw new Error(`${this.constructor.name}::explode: invalid transactionId provided => "${t}"`);return this.build({gc:o[1],op:e.prefixToOperation(o[2]),dto:xe.fromSeconds(+o[3])})}static isBase64(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)&&t.length%4===0}static parse(t){console.info(`${this.constructor.name}::parse: trying to parse ${t}`);try{if(this.isBase64(t)){let e=this._AES_ENCODER.decryptAES(t),o=JSON.parse(e);return Bs(r,o)}else return this.explode(t)}catch(e){throw console.error(`${this.constructor.name}::parse: failed to parse ${t}`,e),new Error(`${this.constructor.name}::parse: could not parse transactionId ${t}`)}}static prefixToOperation(t){return Object.entries(this._OP_CODES).find(([,o])=>o===t)[0]}serialize(){return Os(this,{excludePrefixes:["_"]})}toString(){let t=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(t)}};Es([Rs(),pr("design:type",Number),pr("design:paramtypes",[])],be.prototype,"ts",null);var Qp=(function(r){return r.ListDetectiveValidator="ListDetectiveValidator",r.MXValidator="MXValidator",r.SyntaxValidator="SyntaxValidator",r})({});function eu(r,t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{o!=="constructor"&&(o in r.prototype||Object.defineProperty(r.prototype,o,Object.getOwnPropertyDescriptor(e.prototype,o)))});try{let o=new e;Object.getOwnPropertyNames(o).forEach(s=>{s in r.prototype||Object.defineProperty(r.prototype,s,Object.getOwnPropertyDescriptor(o,s))})}catch{}Object.getOwnPropertyNames(e).forEach(o=>{o!=="prototype"&&o!=="name"&&o!=="length"&&(o in r||Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(e,o)))})})}n(eu,"smpApplyMixin");function Ts(){this.__data__=[],this.size=0}n(Ts,"listCacheClear");var ur=Ts;function Cs(r,t){return r===t||r!==r&&t!==t}n(Cs,"eq");var qt=Cs;function Is(r,t){for(var e=r.length;e--;)if(qt(r[e][0],t))return e;return-1}n(Is,"assocIndexOf");var X=Is;var Ps=Array.prototype,js=Ps.splice;function Ms(r){var t=this.__data__,e=X(t,r);if(e<0)return!1;var o=t.length-1;return e==o?t.pop():js.call(t,e,1),--this.size,!0}n(Ms,"listCacheDelete");var dr=Ms;function Ds(r){var t=this.__data__,e=X(t,r);return e<0?void 0:t[e][1]}n(Ds,"listCacheGet");var mr=Ds;function Ns(r){return X(this.__data__,r)>-1}n(Ns,"listCacheHas");var gr=Ns;function Fs(r,t){var e=this.__data__,o=X(e,r);return o<0?(++this.size,e.push([r,t])):e[o][1]=t,this}n(Fs,"listCacheSet");var _r=Fs;function _t(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}n(_t,"ListCache");_t.prototype.clear=ur;_t.prototype.delete=dr;_t.prototype.get=mr;_t.prototype.has=gr;_t.prototype.set=_r;var Z=_t;function Ls(){this.__data__=new Z,this.size=0}n(Ls,"stackClear");var wr=Ls;function zs(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}n(zs,"stackDelete");var yr=zs;function Us(r){return this.__data__.get(r)}n(Us,"stackGet");var xr=Us;function $s(r){return this.__data__.has(r)}n($s,"stackHas");var br=$s;var ks=typeof global=="object"&&global&&global.Object===Object&&global,Ht=ks;var Gs=typeof self=="object"&&self&&self.Object===Object&&self,Ks=Ht||Gs||Function("return this")(),B=Ks;var Ws=B.Symbol,k=Ws;var Ar=Object.prototype,Ss=Ar.hasOwnProperty,qs=Ar.toString,Tt=k?k.toStringTag:void 0;function Hs(r){var t=Ss.call(r,Tt),e=r[Tt];try{r[Tt]=void 0;var o=!0}catch{}var s=qs.call(r);return o&&(t?r[Tt]=e:delete r[Tt]),s}n(Hs,"getRawTag");var vr=Hs;var Vs=Object.prototype,Xs=Vs.toString;function Zs(r){return Xs.call(r)}n(Zs,"objectToString");var Er=Zs;var Js="[object Null]",Ys="[object Undefined]",Rr=k?k.toStringTag:void 0;function Qs(r){return r==null?r===void 0?Ys:Js:Rr&&Rr in Object(r)?vr(r):Er(r)}n(Qs,"baseGetTag");var G=Qs;function ti(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}n(ti,"isObject");var Vt=ti;var ei="[object AsyncFunction]",ri="[object Function]",oi="[object GeneratorFunction]",si="[object Proxy]";function ii(r){if(!Vt(r))return!1;var t=G(r);return t==ri||t==oi||t==ei||t==si}n(ii,"isFunction");var Xt=ii;var ni=B["__core-js_shared__"],Zt=ni;var Or=(function(){var r=/[^.]+$/.exec(Zt&&Zt.keys&&Zt.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function ai(r){return!!Or&&Or in r}n(ai,"isMasked");var Br=ai;var ci=Function.prototype,hi=ci.toString;function li(r){if(r!=null){try{return hi.call(r)}catch{}try{return r+""}catch{}}return""}n(li,"toSource");var K=li;var fi=/[\\^$.*+?()[\]{}|]/g,pi=/^\[object .+?Constructor\]$/,ui=Function.prototype,di=Object.prototype,mi=ui.toString,gi=di.hasOwnProperty,_i=RegExp("^"+mi.call(gi).replace(fi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wi(r){if(!Vt(r)||Br(r))return!1;var t=Xt(r)?_i:pi;return t.test(K(r))}n(wi,"baseIsNative");var Tr=wi;function yi(r,t){return r?.[t]}n(yi,"getValue");var Cr=yi;function xi(r,t){var e=Cr(r,t);return Tr(e)?e:void 0}n(xi,"getNative");var N=xi;var bi=N(B,"Map"),J=bi;var Ai=N(Object,"create"),W=Ai;function vi(){this.__data__=W?W(null):{},this.size=0}n(vi,"hashClear");var Ir=vi;function Ei(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}n(Ei,"hashDelete");var Pr=Ei;var Ri="__lodash_hash_undefined__",Oi=Object.prototype,Bi=Oi.hasOwnProperty;function Ti(r){var t=this.__data__;if(W){var e=t[r];return e===Ri?void 0:e}return Bi.call(t,r)?t[r]:void 0}n(Ti,"hashGet");var jr=Ti;var Ci=Object.prototype,Ii=Ci.hasOwnProperty;function Pi(r){var t=this.__data__;return W?t[r]!==void 0:Ii.call(t,r)}n(Pi,"hashHas");var Mr=Pi;var ji="__lodash_hash_undefined__";function Mi(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=W&&t===void 0?ji:t,this}n(Mi,"hashSet");var Dr=Mi;function wt(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}n(wt,"Hash");wt.prototype.clear=Ir;wt.prototype.delete=Pr;wt.prototype.get=jr;wt.prototype.has=Mr;wt.prototype.set=Dr;var Ae=wt;function Di(){this.size=0,this.__data__={hash:new Ae,map:new(J||Z),string:new Ae}}n(Di,"mapCacheClear");var Nr=Di;function Ni(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}n(Ni,"isKeyable");var Fr=Ni;function Fi(r,t){var e=r.__data__;return Fr(t)?e[typeof t=="string"?"string":"hash"]:e.map}n(Fi,"getMapData");var Y=Fi;function Li(r){var t=Y(this,r).delete(r);return this.size-=t?1:0,t}n(Li,"mapCacheDelete");var Lr=Li;function zi(r){return Y(this,r).get(r)}n(zi,"mapCacheGet");var zr=zi;function Ui(r){return Y(this,r).has(r)}n(Ui,"mapCacheHas");var Ur=Ui;function $i(r,t){var e=Y(this,r),o=e.size;return e.set(r,t),this.size+=e.size==o?0:1,this}n($i,"mapCacheSet");var $r=$i;function yt(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}n(yt,"MapCache");yt.prototype.clear=Nr;yt.prototype.delete=Lr;yt.prototype.get=zr;yt.prototype.has=Ur;yt.prototype.set=$r;var Jt=yt;var ki=200;function Gi(r,t){var e=this.__data__;if(e instanceof Z){var o=e.__data__;if(!J||o.length<ki-1)return o.push([r,t]),this.size=++e.size,this;e=this.__data__=new Jt(o)}return e.set(r,t),this.size=e.size,this}n(Gi,"stackSet");var kr=Gi;function xt(r){var t=this.__data__=new Z(r);this.size=t.size}n(xt,"Stack");xt.prototype.clear=wr;xt.prototype.delete=yr;xt.prototype.get=xr;xt.prototype.has=br;xt.prototype.set=kr;var Yt=xt;var Ki="__lodash_hash_undefined__";function Wi(r){return this.__data__.set(r,Ki),this}n(Wi,"setCacheAdd");var Gr=Wi;function Si(r){return this.__data__.has(r)}n(Si,"setCacheHas");var Kr=Si;function Qt(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Jt;++t<e;)this.add(r[t])}n(Qt,"SetCache");Qt.prototype.add=Qt.prototype.push=Gr;Qt.prototype.has=Kr;var Wr=Qt;function qi(r,t){for(var e=-1,o=r==null?0:r.length;++e<o;)if(t(r[e],e,r))return!0;return!1}n(qi,"arraySome");var Sr=qi;function Hi(r,t){return r.has(t)}n(Hi,"cacheHas");var qr=Hi;var Vi=1,Xi=2;function Zi(r,t,e,o,s,i){var a=e&Vi,c=r.length,h=t.length;if(c!=h&&!(a&&h>c))return!1;var f=i.get(r),g=i.get(t);if(f&&g)return f==t&&g==r;var d=-1,m=!0,w=e&Xi?new Wr:void 0;for(i.set(r,t),i.set(t,r);++d<c;){var y=r[d],v=t[d];if(o)var R=a?o(v,y,d,t,r,i):o(y,v,d,r,t,i);if(R!==void 0){if(R)continue;m=!1;break}if(w){if(!Sr(t,function(O,E){if(!qr(w,E)&&(y===O||s(y,O,e,o,i)))return w.push(E)})){m=!1;break}}else if(!(y===v||s(y,v,e,o,i))){m=!1;break}}return i.delete(r),i.delete(t),m}n(Zi,"equalArrays");var te=Zi;var Ji=B.Uint8Array,ve=Ji;function Yi(r){var t=-1,e=Array(r.size);return r.forEach(function(o,s){e[++t]=[s,o]}),e}n(Yi,"mapToArray");var Hr=Yi;function Qi(r){var t=-1,e=Array(r.size);return r.forEach(function(o){e[++t]=o}),e}n(Qi,"setToArray");var Vr=Qi;var tn=1,en=2,rn="[object Boolean]",on="[object Date]",sn="[object Error]",nn="[object Map]",an="[object Number]",cn="[object RegExp]",hn="[object Set]",ln="[object String]",fn="[object Symbol]",pn="[object ArrayBuffer]",un="[object DataView]",Xr=k?k.prototype:void 0,Ee=Xr?Xr.valueOf:void 0;function dn(r,t,e,o,s,i,a){switch(e){case un:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case pn:return!(r.byteLength!=t.byteLength||!i(new ve(r),new ve(t)));case rn:case on:case an:return qt(+r,+t);case sn:return r.name==t.name&&r.message==t.message;case cn:case ln:return r==t+"";case nn:var c=Hr;case hn:var h=o&tn;if(c||(c=Vr),r.size!=t.size&&!h)return!1;var f=a.get(r);if(f)return f==t;o|=en,a.set(r,t);var g=te(c(r),c(t),o,s,i,a);return a.delete(r),g;case fn:if(Ee)return Ee.call(r)==Ee.call(t)}return!1}n(dn,"equalByTag");var Zr=dn;function mn(r,t){for(var e=-1,o=t.length,s=r.length;++e<o;)r[s+e]=t[e];return r}n(mn,"arrayPush");var Jr=mn;var gn=Array.isArray,st=gn;function _n(r,t,e){var o=t(r);return st(r)?o:Jr(o,e(r))}n(_n,"baseGetAllKeys");var Yr=_n;function wn(r,t){for(var e=-1,o=r==null?0:r.length,s=0,i=[];++e<o;){var a=r[e];t(a,e,r)&&(i[s++]=a)}return i}n(wn,"arrayFilter");var Qr=wn;function yn(){return[]}n(yn,"stubArray");var to=yn;var xn=Object.prototype,bn=xn.propertyIsEnumerable,eo=Object.getOwnPropertySymbols,An=eo?function(r){return r==null?[]:(r=Object(r),Qr(eo(r),function(t){return bn.call(r,t)}))}:to,ro=An;function vn(r,t){for(var e=-1,o=Array(r);++e<r;)o[e]=t(e);return o}n(vn,"baseTimes");var oo=vn;function En(r){return r!=null&&typeof r=="object"}n(En,"isObjectLike");var S=En;var Rn="[object Arguments]";function On(r){return S(r)&&G(r)==Rn}n(On,"baseIsArguments");var Re=On;var so=Object.prototype,Bn=so.hasOwnProperty,Tn=so.propertyIsEnumerable,Cn=Re((function(){return arguments})())?Re:function(r){return S(r)&&Bn.call(r,"callee")&&!Tn.call(r,"callee")},io=Cn;function In(){return!1}n(In,"stubFalse");var no=In;var ho=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ao=ho&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=ao&&ao.exports===ho,co=Pn?B.Buffer:void 0,jn=co?co.isBuffer:void 0,Mn=jn||no,Ct=Mn;var Dn=9007199254740991,Nn=/^(?:0|[1-9]\d*)$/;function Fn(r,t){var e=typeof r;return t=t??Dn,!!t&&(e=="number"||e!="symbol"&&Nn.test(r))&&r>-1&&r%1==0&&r<t}n(Fn,"isIndex");var lo=Fn;var Ln=9007199254740991;function zn(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ln}n(zn,"isLength");var ee=zn;var Un="[object Arguments]",$n="[object Array]",kn="[object Boolean]",Gn="[object Date]",Kn="[object Error]",Wn="[object Function]",Sn="[object Map]",qn="[object Number]",Hn="[object Object]",Vn="[object RegExp]",Xn="[object Set]",Zn="[object String]",Jn="[object WeakMap]",Yn="[object ArrayBuffer]",Qn="[object DataView]",ta="[object Float32Array]",ea="[object Float64Array]",ra="[object Int8Array]",oa="[object Int16Array]",sa="[object Int32Array]",ia="[object Uint8Array]",na="[object Uint8ClampedArray]",aa="[object Uint16Array]",ca="[object Uint32Array]",A={};A[ta]=A[ea]=A[ra]=A[oa]=A[sa]=A[ia]=A[na]=A[aa]=A[ca]=!0;A[Un]=A[$n]=A[Yn]=A[kn]=A[Qn]=A[Gn]=A[Kn]=A[Wn]=A[Sn]=A[qn]=A[Hn]=A[Vn]=A[Xn]=A[Zn]=A[Jn]=!1;function ha(r){return S(r)&&ee(r.length)&&!!A[G(r)]}n(ha,"baseIsTypedArray");var fo=ha;function la(r){return function(t){return r(t)}}n(la,"baseUnary");var po=la;var uo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,It=uo&&typeof module=="object"&&module&&!module.nodeType&&module,fa=It&&It.exports===uo,Oe=fa&&Ht.process,pa=(function(){try{var r=It&&It.require&&It.require("util").types;return r||Oe&&Oe.binding&&Oe.binding("util")}catch{}})(),Be=pa;var mo=Be&&Be.isTypedArray,ua=mo?po(mo):fo,re=ua;var da=Object.prototype,ma=da.hasOwnProperty;function ga(r,t){var e=st(r),o=!e&&io(r),s=!e&&!o&&Ct(r),i=!e&&!o&&!s&&re(r),a=e||o||s||i,c=a?oo(r.length,String):[],h=c.length;for(var f in r)(t||ma.call(r,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||lo(f,h)))&&c.push(f);return c}n(ga,"arrayLikeKeys");var go=ga;var _a=Object.prototype;function wa(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||_a;return r===e}n(wa,"isPrototype");var _o=wa;function ya(r,t){return function(e){return r(t(e))}}n(ya,"overArg");var wo=ya;var xa=wo(Object.keys,Object),yo=xa;var ba=Object.prototype,Aa=ba.hasOwnProperty;function va(r){if(!_o(r))return yo(r);var t=[];for(var e in Object(r))Aa.call(r,e)&&e!="constructor"&&t.push(e);return t}n(va,"baseKeys");var xo=va;function Ea(r){return r!=null&&ee(r.length)&&!Xt(r)}n(Ea,"isArrayLike");var bo=Ea;function Ra(r){return bo(r)?go(r):xo(r)}n(Ra,"keys");var Ao=Ra;function Oa(r){return Yr(r,Ao,ro)}n(Oa,"getAllKeys");var Te=Oa;var Ba=1,Ta=Object.prototype,Ca=Ta.hasOwnProperty;function Ia(r,t,e,o,s,i){var a=e&Ba,c=Te(r),h=c.length,f=Te(t),g=f.length;if(h!=g&&!a)return!1;for(var d=h;d--;){var m=c[d];if(!(a?m in t:Ca.call(t,m)))return!1}var w=i.get(r),y=i.get(t);if(w&&y)return w==t&&y==r;var v=!0;i.set(r,t),i.set(t,r);for(var R=a;++d<h;){m=c[d];var O=r[m],E=t[m];if(o)var x=a?o(E,O,m,t,r,i):o(O,E,m,r,t,i);if(!(x===void 0?O===E||s(O,E,e,o,i):x)){v=!1;break}R||(R=m=="constructor")}if(v&&!R){var b=r.constructor,T=t.constructor;b!=T&&"constructor"in r&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(v=!1)}return i.delete(r),i.delete(t),v}n(Ia,"equalObjects");var vo=Ia;var Pa=N(B,"DataView"),oe=Pa;var ja=N(B,"Promise"),se=ja;var Ma=N(B,"Set"),ie=Ma;var Da=N(B,"WeakMap"),ne=Da;var Eo="[object Map]",Na="[object Object]",Ro="[object Promise]",Oo="[object Set]",Bo="[object WeakMap]",To="[object DataView]",Fa=K(oe),La=K(J),za=K(se),Ua=K(ie),$a=K(ne),it=G;(oe&&it(new oe(new ArrayBuffer(1)))!=To||J&&it(new J)!=Eo||se&&it(se.resolve())!=Ro||ie&&it(new ie)!=Oo||ne&&it(new ne)!=Bo)&&(it=n(function(r){var t=G(r),e=t==Na?r.constructor:void 0,o=e?K(e):"";if(o)switch(o){case Fa:return To;case La:return Eo;case za:return Ro;case Ua:return Oo;case $a:return Bo}return t},"getTag"));var Ce=it;var ka=1,Co="[object Arguments]",Io="[object Array]",ae="[object Object]",Ga=Object.prototype,Po=Ga.hasOwnProperty;function Ka(r,t,e,o,s,i){var a=st(r),c=st(t),h=a?Io:Ce(r),f=c?Io:Ce(t);h=h==Co?ae:h,f=f==Co?ae:f;var g=h==ae,d=f==ae,m=h==f;if(m&&Ct(r)){if(!Ct(t))return!1;a=!0,g=!1}if(m&&!g)return i||(i=new Yt),a||re(r)?te(r,t,e,o,s,i):Zr(r,t,h,e,o,s,i);if(!(e&ka)){var w=g&&Po.call(r,"__wrapped__"),y=d&&Po.call(t,"__wrapped__");if(w||y){var v=w?r.value():r,R=y?t.value():t;return i||(i=new Yt),s(v,R,e,o,i)}}return m?(i||(i=new Yt),vo(r,t,e,o,s,i)):!1}n(Ka,"baseIsEqualDeep");var jo=Ka;function Mo(r,t,e,o,s){return r===t?!0:r==null||t==null||!S(r)&&!S(t)?r!==r&&t!==t:jo(r,t,e,o,Mo,s)}n(Mo,"baseIsEqual");var Do=Mo;function Wa(r,t){return Do(r,t)}n(Wa,"isEqual");var No=Wa;var Sa=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Fo(r){return r.match(Sa)}n(Fo,"smpAsciiWords");var Go="\\ud800-\\udfff",qa="\\u0300-\\u036f",Ha="\\ufe20-\\ufe2f",Va="\\u20d0-\\u20ff",Xa="\\u1ab0-\\u1aff",Za="\\u1dc0-\\u1dff",Ja=qa+Ha+Va+Xa+Za,Ko="\\u2700-\\u27bf",Wo="a-z\\xdf-\\xf6\\xf8-\\xff",Ya="\\xac\\xb1\\xd7\\xf7",Qa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tc="\\u2000-\\u206f",ec=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",So="A-Z\\xc0-\\xd6\\xd8-\\xde",rc="\\ufe0e\\ufe0f",qo=Ya+Qa+tc+ec,Ho="['\u2019]",Lo=`[${qo}]`,oc=`[${Ja}]`,Vo="\\d",sc=`[${Ko}]`,Xo=`[${Wo}]`,Zo=`[^${Go}${qo+Vo+Ko+Wo+So}]`,ic="\\ud83c[\\udffb-\\udfff]",nc=`(?:${oc}|${ic})`,ac=`[^${Go}]`,Jo="(?:\\ud83c[\\udde6-\\uddff]){2}",Yo="[\\ud800-\\udbff][\\udc00-\\udfff]",bt=`[${So}]`,cc="\\u200d",zo=`(?:${Xo}|${Zo})`,hc=`(?:${bt}|${Zo})`,Uo=`(?:${Ho}(?:d|ll|m|re|s|t|ve))?`,$o=`(?:${Ho}(?:D|LL|M|RE|S|T|VE))?`,Qo=`${nc}?`,ts=`[${rc}]?`,lc=`(?:${cc}(?:${[ac,Jo,Yo].join("|")})${ts+Qo})*`,fc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",uc=ts+Qo+lc,ko=`(?:${[sc,Jo,Yo].join("|")})${uc}`,Pt=class{static{n(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${bt}?${Xo}+${Uo}(?=${[Lo,bt,"$"].join("|")})`,`${hc}+${$o}(?=${[Lo,bt+zo,"$"].join("|")})`,`${bt}?${zo}+${Uo}`,`${bt}+${$o}`,pc,fc,`${Vo}+`,ko].join("|"),"g");static RS_EMOJI=ko;static unicodeWords(t){return t.match(this.RE_UNICODE_WORDS)}};var es=class{static{n(this,"SmpCommonUtils")}static arrayRemove(t,e){let o=[],s=t.filter((i,a)=>e(i,a)&&o.push(a));return o.reverse().forEach(i=>t.splice(i,1)),s}static assertIsArray(t,e){if(!Array.isArray(t))throw new Error(e||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(t,e){if(!this.isBoolean(t))throw new Error(e||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(t,e){if(!this.isFunction(t))throw new Error(e||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(t,e,o){if(!(t instanceof e))throw new Error(o||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(t,e){if(this.isEmpty(t))throw new Error(e||`${this.constructor.name} => entity was empty`)}static assertIsNumber(t,e){if(typeof t!="number")throw new Error(e||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(t,e){if(!this.isNumeric(t))throw new Error(e||`${this.constructor.name} => val was not numeric`)}static assertIsObject(t,e){if(!this.isObject(t))throw new Error(e||`${this.constructor.name} => val was not an object`)}static assertIsString(t,e){if(!this.isString(t))throw new Error(e||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(t,e){if(!t)throw new Error(e||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...t){let e=t.filter(o=>!!o).join("/").replace(/(?<!:)\/\/+/g,"/");return e.startsWith("http")&&!e.endsWith("/")?`${e}/`:e}static downloadBlob(t,e){let o=window.URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.setAttribute("download",e),document.body.appendChild(s),s.click()}static generateRandomHexString(t=12){let e="0123456789abcdef",o="";for(let s=0;s<t;s++){let i=Math.floor(Math.random()*e.length);o+=e[i]}return o}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}static getDecimalPrecision(t){if(this.assertIsNumeric(t),!isFinite(+t))return 0;let e=1,o=0;for(;Math.round(+t*e)/e!==t;)e*=10,o++;return o}static getType(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}static isBoolean(t){return typeof t=="boolean"}static isColor(t){if(!t||!this.isString(t))return!1;let e=new Option().style;return e.color=t,e.color!==""}static isEmpty(t){return!t&&t!==0}static isEqual(t,e){return No(t,e)}static isFormField(t){return/^(?:input|select|textarea|button)$/i.test(t.nodeName)}static isFunction(t){return typeof t==typeof isNaN}static isNotEmpty(t){return!this.isEmpty(t)}static isNumber(t){return typeof t=="number"&&this.isNumeric(t)}static isNumeric(t){return!isNaN(t)}static isObject(t){return!!t&&t===Object(t)&&t.constructor===Object}static isPrimitive(t){let e=this.getType(t);return e!=="function"&&(e!=="object"||!t)}static isString(t){return typeof t=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(t,e){if(this.assertIsFunction(e,`CommonUtils => expected type of iteratee to be Function, got ${typeof e}`),this.isObject(t))return Object.entries(t).reduce((o,[s,i])=>(o.push(e(i,s)),o),[]);if(Array.isArray(t))return t.map(e);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof e}`)}static mapObjectKeys(t,e){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>{let a=e(s,i);return o[a]=i,o},{}):{}}static mapObjectValues(t,e){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>(o[s]=e.call(null,i,s),o),{}):{}}static noop(){}static objectHasValue(t,e){return!!~Object.values(t).filter(o=>this.isEqual(o,e))}static omit(t,e){return Object.keys(t).filter(s=>!e.includes(s)).reduce((s,i)=>(s[i]=t[i],s),{})}static parseBoolean(t){return t?/^true$/i.test(t):!1}static parseJsonSafely(t){try{return JSON.parse(t)}catch(e){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:t,error:e});return}}static pick(t,e){return e.reduce((o,s)=>(s in t&&(o[s]=t[s]),o),{})}static runSafely(t,e=null,o=[]){if(this.isFunction(t))return t.apply(e,o)}static sleep(t){return new Promise(e=>setTimeout(e,t))}static sprintf(t,...e){return this.isString(t)&&e.length?this.sprintf(t.replace("%s",String(e.shift())),...e):t}static stripComments(t){return typeof t=="string"?t.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):t}static submitFakeForm({action:t,method:e=hr.POST,data:o,target:s}){let i=Object.entries(o||{}).map(([c,h])=>`<input name="${c}" type="hidden" value="${h}" />`),a=document.createElement("form");a.method=e,a.action=t,a.innerHTML=`${i}`,a.target=s||"_self",document.body.append(a),a.submit()}static toCamelCase(t){return this.words(t.replace(/['\u2019]/g,"")).reduce((e,o,s)=>(o=o.toLowerCase(),e+(s?o.charAt(0).toUpperCase()+o.slice(1):o)),"")}static toKebabCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(t){return this.toCamelCase(t).replace(/^(.)/,e=>e.toUpperCase())}static toSnakeCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(t){return this.toSnakeCase(t).toUpperCase()}static words(t,e){return e===void 0?(Pt.HAS_UNICODE_WORD(t)?Pt.unicodeWords(t):Fo(t))||[]:t.match(e)||[]}};var rs=class extends Error{static{n(this,"SmpFilterException")}message;data;constructor(t="Filter Exception",e){super(),this.message=t,this.data=e}};import{DateTime as os}from"ts-luxon";var ss=class r{static{n(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return os.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(t=`sid-xxxx-${+os.now().ts}`,e=0){this.value=t,this.expiry=e}static parse(t){return new r(t.value,t.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};import{smpNoop as q0}from"@tonysamperi/logger";var is=class{static{n(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var X0="2.0.0-beta.5";export{Ep as SMP_HEALTHZ,Le as SmpAbstractCacheStrategy,ht as SmpAbstractTtlCacheStrategy,Bt as SmpAesCrypt,cr as SmpApiCommonUtils,lr as SmpBaseJwtToken,fr as SmpBaseJwtTokenPlain,jt as SmpBrowserCache,es as SmpCommonUtils,mt as SmpCrypto,z as SmpErrorResponse,rs as SmpFilterException,gc as SmpFirebaseErrors,Et as SmpGenericResponse,be as SmpGiftcardTransaction,gt as SmpGiftcardTransactionHashStrategies,M as SmpGiftcardTransactionOps,Mt as SmpHttpSessionStorageCache,$e as SmpHttpStatusCodes,ar as SmpHttpTwoService,St as SmpInMemoryCache,Qp as SmpMarketingCloudValidators,is as SmpRegularExpressions,F as SmpResponseMessage,ct as SmpResponseMessageTypes,hr as SmpRestVerbs,ye as SmpSecureCode,ss as SmpSid,dc as SmpSocialSignInKeys,mc as SmpSocialSignInUxModes,X0 as VERSION,eu as smpApplyMixin,ze as smpIsSmpCachedValue,q0 as smpNoop};
|
|
1
|
+
import{a as gc,b as _c,c as wc}from"./chunk-DIVAYUSN.js";import{a as Ue,b as ke}from"./chunk-VBEMFJKM.js";import{a as ft}from"./chunk-F3OJMKBL.js";import{a as n}from"./chunk-EI7MMDWY.js";import{DateTime as $e}from"ts-luxon";var pt=class extends Ue{static{n(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(t){let e=this._readRaw(t);if(this._isSmpCachedValue(e)){if(e.expiry>=$e.now().ts)return e.value;this._removeRaw(t);return}return e}remove(t){this._removeRaw(t)}write(t,e,o){if(isNaN(+o)||+o<=0){this._writeRaw(t,e,o);return}let s=$e.now().ts+o*1e3,i={value:e,expiry:s};this._writeRaw(t,i,o)}_isSmpCachedValue(t){return ke(t)}};var Mt=class extends pt{static{n(this,"SmpBrowserCache")}_storage;_prefix;constructor(t,e){super(),this._storage=t,this._prefix=e}_flushRaw(){let t=[],e=-1;for(;++e<this._storage.length;){let o=this._storage.key(e);o&&o.startsWith(this._prefix)&&t.push(o)}for(e=-1;++e<t.length;)this._storage.removeItem(t[e])}_readRaw(t){let e=this._storage.getItem(this._prefix+t);try{return e?JSON.parse(e):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+t}`);return}}_removeRaw(t){this._storage.removeItem(this._prefix+t)}_writeRaw(t,e){try{this._storage.setItem(this._prefix+t,JSON.stringify(e))}catch(o){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+t}`,o)}}};var Dt=class extends Mt{static{n(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var Ke=(function(r){return r[r.Continue=100]="Continue",r[r.SwitchingProtocols=101]="SwitchingProtocols",r[r.Processing=102]="Processing",r[r.EarlyHints=103]="EarlyHints",r[r.Ok=200]="Ok",r[r.Created=201]="Created",r[r.Accepted=202]="Accepted",r[r.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",r[r.NoContent=204]="NoContent",r[r.ResetContent=205]="ResetContent",r[r.PartialContent=206]="PartialContent",r[r.MultiStatus=207]="MultiStatus",r[r.AlreadyReported=208]="AlreadyReported",r[r.ImUsed=226]="ImUsed",r[r.MultipleChoices=300]="MultipleChoices",r[r.MovedPermanently=301]="MovedPermanently",r[r.Found=302]="Found",r[r.SeeOther=303]="SeeOther",r[r.NotModified=304]="NotModified",r[r.UseProxy=305]="UseProxy",r[r.Unused=306]="Unused",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",r[r.BadRequest=400]="BadRequest",r[r.Unauthorized=401]="Unauthorized",r[r.PaymentRequired=402]="PaymentRequired",r[r.Forbidden=403]="Forbidden",r[r.NotFound=404]="NotFound",r[r.MethodNotAllowed=405]="MethodNotAllowed",r[r.NotAcceptable=406]="NotAcceptable",r[r.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",r[r.RequestTimeout=408]="RequestTimeout",r[r.Conflict=409]="Conflict",r[r.Gone=410]="Gone",r[r.LengthRequired=411]="LengthRequired",r[r.PreconditionFailed=412]="PreconditionFailed",r[r.PayloadTooLarge=413]="PayloadTooLarge",r[r.UriTooLong=414]="UriTooLong",r[r.UnsupportedMediaType=415]="UnsupportedMediaType",r[r.RangeNotSatisfiable=416]="RangeNotSatisfiable",r[r.ExpectationFailed=417]="ExpectationFailed",r[r.ImATeapot=418]="ImATeapot",r[r.MisdirectedRequest=421]="MisdirectedRequest",r[r.UnprocessableEntity=422]="UnprocessableEntity",r[r.Locked=423]="Locked",r[r.FailedDependency=424]="FailedDependency",r[r.TooEarly=425]="TooEarly",r[r.UpgradeRequired=426]="UpgradeRequired",r[r.PreconditionRequired=428]="PreconditionRequired",r[r.TooManyRequests=429]="TooManyRequests",r[r.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",r[r.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",r[r.InternalServerError=500]="InternalServerError",r[r.NotImplemented=501]="NotImplemented",r[r.BadGateway=502]="BadGateway",r[r.ServiceUnavailable=503]="ServiceUnavailable",r[r.GatewayTimeout=504]="GatewayTimeout",r[r.HttpVersionNotSupported=505]="HttpVersionNotSupported",r[r.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",r[r.InsufficientStorage=507]="InsufficientStorage",r[r.LoopDetected=508]="LoopDetected",r[r.NotExtended=510]="NotExtended",r[r.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",r})({});import{Expose as qe,plainToInstance as bs}from"class-transformer";import{Expose as _s,instanceToPlain as ws,plainToInstance as ys,Transform as xs}from"class-transformer";import{Expose as Se}from"class-transformer";function Ge(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(Ge,"_ts_decorate");function Nt(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(Nt,"_ts_metadata");var F=class r{static{n(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(t,e=ft.ERROR){this._message=t,this._type=e}static sanitizeMessages(t){return typeof t=="string"?t.length?[new r(t)]:[]:[t].flat().map(e=>typeof e=="string"?new r(e):e)}};Ge([Se(),Nt("design:type",String),Nt("design:paramtypes",[])],F.prototype,"message",null);Ge([Se(),Nt("design:type",typeof ft>"u"?Object:ft),Nt("design:paramtypes",[])],F.prototype,"type",null);function gs(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(gs,"_ts_decorate");function We(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(We,"_ts_metadata");var Ot=class r{static{n(this,"SmpGenericResponse")}_messages;data;set messages(t){this._messages=F.sanitizeMessages(t)}get messages(){return this._messages}constructor(t=[],e){this._messages=t,this.data=e}static create(t){return new r([t.messages||[]].flat().map(e=>e instanceof F?e:new F(e,t.type||ft.SUCCESS)),t.data)}static fromPlain(t){return ys(r,t)}isError(){return!this.isSuccess()}isSuccess(){return typeof this._errorCode=="number"}serialize(){return ws(this,{excludePrefixes:["_"]})}};gs([_s(),xs(({value:r})=>r?.length?r:void 0),We("design:type",Object),We("design:paramtypes",[])],Ot.prototype,"messages",null);function He(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(He,"_ts_decorate");function Ft(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(Ft,"_ts_metadata");var k=class r extends Ot{static{n(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new F("GENERIC_ERROR")]}set errorCode(t){this._errorCode=t}get errorCode(){return this._errorCode}get status(){return this._status}set timestamp(t){this._timestamp=t}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(t=r.DEFAULT_MESSAGES,e="GENERIC_ERROR",o=500,s){super(t,s),this._errorCode=e,this._status=o}static create({messages:t=r.DEFAULT_MESSAGES,...e}={}){return new r(F.sanitizeMessages(t),e.errorCode,e.status,e.data)}static fromPlain(t){let e=bs(As,t,{excludePrefixes:["_"]}),o=new r;return Object.getOwnPropertyNames(e).forEach(s=>{s in o&&(o[s]=e[s])}),o}};He([qe(),Ft("design:type",Object),Ft("design:paramtypes",[])],k.prototype,"errorCode",null);He([qe(),Ft("design:type",Number),Ft("design:paramtypes",[])],k.prototype,"timestamp",null);var As=class extends k{static{n(this,"SmpErrorResponseMutable")}set errorCode(t){this._errorCode=t}set status(t){this._status=t}set timestamp(t){this._timestamp=t}};var L=class{static{n(this,"Hex")}static parse(t){let e=t.length,o=[];for(let s=0;s<e;s+=2)o[s>>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new _(o,e/2)}static stringify(t){let e=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;e.push((s>>>4).toString(16)),e.push((s&15).toString(16))}return e.join("")}};var _=class fe{static{n(this,"WordArray")}constructor(t,e){this.words=t||[],e!==void 0?this.sigBytes=e:this.sigBytes=this.words.length*4}static random(t){let e=[],o=n(function(s){let i=987654321,a=4294967295;return function(){i=36969*(i&65535)+(i>>16)&a,s=18e3*(s&65535)+(s>>16)&a;let c=(i<<16)+s&a;return c/=4294967296,c+=.5,c*(Math.random()>.5?1:-1)}},"r");for(let s=0,i;s<t;s+=4){let a=o((i||Math.random())*4294967296);i=a()*987654071,e.push(a()*4294967296|0)}return new fe(e,t)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new fe(this.words.slice(0),this.sigBytes)}concat(t){if(this.clamp(),this.sigBytes%4)for(let e=0;e<t.sigBytes;e++){let o=t.words[e>>>2]>>>24-e%4*8&255;this.words[this.sigBytes+e>>>2]|=o<<24-(this.sigBytes+e)%4*8}else for(let e=0;e<t.sigBytes;e+=4)this.words[this.sigBytes+e>>>2]=t.words[e>>>2];return this.sigBytes+=t.sigBytes,this}toString(t){return(t||L).stringify(this)}};var Lt=class{static{n(this,"Latin1")}static parse(t){let e=t.length,o=[];for(let s=0;s<e;s++)o[s>>>2]|=(t.charCodeAt(s)&255)<<24-s%4*8;return new _(o,e)}static stringify(t){let e=[];for(let o=0;o<t.sigBytes;o++){let s=t.words[o>>>2]>>>24-o%4*8&255;e.push(String.fromCharCode(s))}return e.join("")}};var I=class{static{n(this,"Utf8")}static parse(t){return Lt.parse(unescape(encodeURIComponent(t)))}static stringify(t){try{return decodeURIComponent(escape(Lt.stringify(t)))}catch(e){throw console.error("Malformed UTF-8 data",e),new Error("Malformed UTF-8 data")}}};var zt=class{static{n(this,"BufferedBlockAlgorithm")}constructor(t){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},t),this._data=new _,this._nDataBytes=0}clone(){let t=this.constructor();for(let e in this)Object.prototype.hasOwnProperty.call(this,e)&&(t[e]=this[e]);return t._data=this._data.clone(),t}reset(){this._data=new _,this._nDataBytes=0}_append(t){typeof t=="string"&&(t=I.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_process(t){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let e=this.cfg.blockSize*4,o=this._data.sigBytes/e;t?o=Math.ceil(o):o=Math.max((o|0)-this._minBufferSize,0);let s=o*this.cfg.blockSize,i=Math.min(s*4,this._data.sigBytes),a;if(s){for(let c=0;c<s;c+=this.cfg.blockSize)this._doProcessBlock(this._data.words,c);a=this._data.words.splice(0,s),this._data.sigBytes-=i}return new _(a,i)}};var dt=class{static{n(this,"CipherParams")}constructor(t){this.ciphertext=t.ciphertext,this.key=t.key,this.iv=t.iv,this.salt=t.salt,this.algorithm=t.algorithm,this.mode=t.mode,this.padding=t.padding,this.blockSize=t.blockSize,this.formatter=t.formatter}extend(t){return t.ciphertext!==void 0&&(this.ciphertext=t.ciphertext),t.key!==void 0&&(this.key=t.key),t.iv!==void 0&&(this.iv=t.iv),t.salt!==void 0&&(this.salt=t.salt),t.algorithm!==void 0&&(this.algorithm=t.algorithm),t.mode!==void 0&&(this.mode=t.mode),t.padding!==void 0&&(this.padding=t.padding),t.blockSize!==void 0&&(this.blockSize=t.blockSize),t.formatter!==void 0&&(this.formatter=t.formatter),this}toString(t){if(t)return t.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var $=class{static{n(this,"Base64")}static parse(t){let e=t.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let s=0;s<this._map.length;s++)this._reverseMap[this._map.charCodeAt(s)]=s}let o=this._map.charAt(64);if(o){let s=t.indexOf(o);s!==-1&&(e=s)}return this.parseLoop(t,e,this._reverseMap)}static parseLoop(t,e,o){let s=[],i=0;for(let a=0;a<e;a++)if(a%4){let c=o[t.charCodeAt(a-1)]<<a%4*2,h=o[t.charCodeAt(a)]>>>6-a%4*2;s[i>>>2]|=(c|h)<<24-i%4*8,i++}return new _(s,i)}static stringify(t){t.clamp();let e=[];for(let s=0;s<t.sigBytes;s+=3){let i=t.words[s>>>2]>>>24-s%4*8&255,a=t.words[s+1>>>2]>>>24-(s+1)%4*8&255,c=t.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=i<<16|a<<8|c;for(let f=0;f<4&&s+f*.75<t.sigBytes;f++)e.push(this._map.charAt(h>>>6*(3-f)&63))}let o=this._map.charAt(64);if(o)for(;e.length%4;)e.push(o);return e.join("")}};$._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$._reverseMap=void 0;var Ut=class{static{n(this,"OpenSSL")}static parse(t){let e=$.parse(t),o;return e.words[0]===1398893684&&e.words[1]===1701076831&&(o=new _(e.words.slice(2,4)),e.words.splice(0,4),e.sigBytes-=16),new dt({ciphertext:e,salt:o})}static stringify(t){if(!t.ciphertext)throw new Error("missing ciphertext in params");let e=t.ciphertext,o=t.salt,s;if(o){if(typeof o=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(o).concat(e)}else s=e;return s.toString($)}};var et=class{static{n(this,"SerializableCipher")}static decrypt(t,e,o,s){let i=Object.assign({},this.cfg,s);if(!i.format)throw new Error("could not determine format");if(e=this._parse(e,i.format),!e.ciphertext)throw new Error("could not determine ciphertext");return t.createDecryptor(o,i).finalize(e.ciphertext)}static encrypt(t,e,o,s){let i=Object.assign({},this.cfg,s),a=t.createEncryptor(o,i),c=a.finalize(e);return new dt({ciphertext:c,key:o,iv:a.cfg.iv,algorithm:t,mode:a.cfg.mode,padding:a.cfg.padding,blockSize:a.cfg.blockSize,formatter:i.format})}static _parse(t,e){return typeof t=="string"?e.parse(t):t}};et.cfg={blockSize:4,iv:new _([]),format:Ut};var C=class extends zt{static{n(this,"Hasher")}constructor(t){super(Object.assign({blockSize:512/32},t)),this.reset()}static _createHelper(t){function e(o,s){return new t(s).finalize(o)}return n(e,"helper"),e}finalize(t){return t&&this._append(t),this._doFinalize()}update(t){return this._append(t),this._process(),this}};var p=[];for(let r=0;r<64;r++)p[r]=Math.abs(Math.sin(r+1))*4294967296|0;var K=class d extends C{static{n(this,"MD5")}get hash(){return this._hash}static FF(t,e,o,s,i,a,c){let h=t+(e&o|~e&s)+i+c;return(h<<a|h>>>32-a)+e}static GG(t,e,o,s,i,a,c){let h=t+(e&s|o&~s)+i+c;return(h<<a|h>>>32-a)+e}static HH(t,e,o,s,i,a,c){let h=t+(e^o^s)+i+c;return(h<<a|h>>>32-a)+e}static II(t,e,o,s,i,a,c){let h=t+(o^(e|~s))+i+c;return(h<<a|h>>>32-a)+e}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let t=this._nDataBytes*8,e=this._data.sigBytes*8;this._data.words[e>>>5]|=128<<24-e%32;let o=Math.floor(t/4294967296),s=t;this._data.words[(e+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,this._data.words[(e+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let i=0;i<4;i++)this._hash.words[i]=(this._hash.words[i]<<8|this._hash.words[i]>>>24)&16711935|(this._hash.words[i]<<24|this._hash.words[i]>>>8)&4278255360;return this._hash}_doProcessBlock(t,e){for(let h=0;h<16;h++){let f=e+h,g=t[f];t[f]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let o=Array.from({length:16});for(let h=0;h<16;h++)o[h]=t[e+h];let s=this._hash.words[0],i=this._hash.words[1],a=this._hash.words[2],c=this._hash.words[3];s=d.FF(s,i,a,c,o[0],7,p[0]),c=d.FF(c,s,i,a,o[1],12,p[1]),a=d.FF(a,c,s,i,o[2],17,p[2]),i=d.FF(i,a,c,s,o[3],22,p[3]),s=d.FF(s,i,a,c,o[4],7,p[4]),c=d.FF(c,s,i,a,o[5],12,p[5]),a=d.FF(a,c,s,i,o[6],17,p[6]),i=d.FF(i,a,c,s,o[7],22,p[7]),s=d.FF(s,i,a,c,o[8],7,p[8]),c=d.FF(c,s,i,a,o[9],12,p[9]),a=d.FF(a,c,s,i,o[10],17,p[10]),i=d.FF(i,a,c,s,o[11],22,p[11]),s=d.FF(s,i,a,c,o[12],7,p[12]),c=d.FF(c,s,i,a,o[13],12,p[13]),a=d.FF(a,c,s,i,o[14],17,p[14]),i=d.FF(i,a,c,s,o[15],22,p[15]),s=d.GG(s,i,a,c,o[1],5,p[16]),c=d.GG(c,s,i,a,o[6],9,p[17]),a=d.GG(a,c,s,i,o[11],14,p[18]),i=d.GG(i,a,c,s,o[0],20,p[19]),s=d.GG(s,i,a,c,o[5],5,p[20]),c=d.GG(c,s,i,a,o[10],9,p[21]),a=d.GG(a,c,s,i,o[15],14,p[22]),i=d.GG(i,a,c,s,o[4],20,p[23]),s=d.GG(s,i,a,c,o[9],5,p[24]),c=d.GG(c,s,i,a,o[14],9,p[25]),a=d.GG(a,c,s,i,o[3],14,p[26]),i=d.GG(i,a,c,s,o[8],20,p[27]),s=d.GG(s,i,a,c,o[13],5,p[28]),c=d.GG(c,s,i,a,o[2],9,p[29]),a=d.GG(a,c,s,i,o[7],14,p[30]),i=d.GG(i,a,c,s,o[12],20,p[31]),s=d.HH(s,i,a,c,o[5],4,p[32]),c=d.HH(c,s,i,a,o[8],11,p[33]),a=d.HH(a,c,s,i,o[11],16,p[34]),i=d.HH(i,a,c,s,o[14],23,p[35]),s=d.HH(s,i,a,c,o[1],4,p[36]),c=d.HH(c,s,i,a,o[4],11,p[37]),a=d.HH(a,c,s,i,o[7],16,p[38]),i=d.HH(i,a,c,s,o[10],23,p[39]),s=d.HH(s,i,a,c,o[13],4,p[40]),c=d.HH(c,s,i,a,o[0],11,p[41]),a=d.HH(a,c,s,i,o[3],16,p[42]),i=d.HH(i,a,c,s,o[6],23,p[43]),s=d.HH(s,i,a,c,o[9],4,p[44]),c=d.HH(c,s,i,a,o[12],11,p[45]),a=d.HH(a,c,s,i,o[15],16,p[46]),i=d.HH(i,a,c,s,o[2],23,p[47]),s=d.II(s,i,a,c,o[0],6,p[48]),c=d.II(c,s,i,a,o[7],10,p[49]),a=d.II(a,c,s,i,o[14],15,p[50]),i=d.II(i,a,c,s,o[5],21,p[51]),s=d.II(s,i,a,c,o[12],6,p[52]),c=d.II(c,s,i,a,o[3],10,p[53]),a=d.II(a,c,s,i,o[10],15,p[54]),i=d.II(i,a,c,s,o[1],21,p[55]),s=d.II(s,i,a,c,o[8],6,p[56]),c=d.II(c,s,i,a,o[15],10,p[57]),a=d.II(a,c,s,i,o[6],15,p[58]),i=d.II(i,a,c,s,o[13],21,p[59]),s=d.II(s,i,a,c,o[4],6,p[60]),c=d.II(c,s,i,a,o[11],10,p[61]),a=d.II(a,c,s,i,o[2],15,p[62]),i=d.II(i,a,c,s,o[9],21,p[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+a|0,this._hash.words[3]=this._hash.words[3]+c|0}};var pe=class Ve{static{n(this,"EVPKDF")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:K,iterations:1},t)}static execute(t,e,o){return new Ve(o).compute(t,e)}compute(t,e){let o=new this.cfg.hasher,s=new _,i;for(;s.words.length<this.cfg.keySize;){i&&o.update(i),i=o.update(t).finalize(e),o.reset();for(let a=1;a<this.cfg.iterations;a++)i=o.finalize(i),o.reset();s.concat(i)}return s.sigBytes=this.cfg.keySize*4,s}};var Xe=class{static{n(this,"OpenSSLKdf")}static execute(t,e,o,s){s||(s=_.random(64/8));let i=new pe({keySize:e+o}).compute(t,s),a=new _(i.words.slice(e),o*4);return i.sigBytes=e*4,new dt({key:i,iv:a,salt:s})}};var kt=class{static{n(this,"PasswordBasedCipher")}static decrypt(t,e,o,s){let i=Object.assign({},this.cfg,s);if(i.format===void 0)throw new Error("missing format in config");if(e=this._parse(e,i.format),i.kdf===void 0)throw new Error("the key derivation function must be set");let a=i.kdf.execute(o,t.keySize,t.ivSize,e.salt);return a.iv!==void 0&&(i.iv=a.iv),et.decrypt.call(this,t,e,a.key,i)}static encrypt(t,e,o,s){let i=Object.assign({},this.cfg,s);if(i.kdf===void 0)throw new Error("missing kdf in config");let a=i.kdf.execute(o,t.keySize,t.ivSize);return a.iv!==void 0&&(i.iv=a.iv),et.encrypt.call(this,t,e,a.key,i).extend(a)}static _parse(t,e){return typeof t=="string"?e.parse(t):t}};kt.cfg={blockSize:4,iv:new _([]),format:Ut,kdf:Xe};var Ze=class{static{n(this,"CipherHelper")}constructor(t){this._cipher=t}decrypt(t,e,o){return typeof e=="string"?kt.decrypt(this._cipher,t,e,o):et.decrypt(this._cipher,t,e,o)}encrypt(t,e,o){return typeof e=="string"?kt.encrypt(this._cipher,t,e,o):et.encrypt(this._cipher,t,e,o)}};var ut=class extends zt{static{n(this,"Cipher")}constructor(t,e,o){super(Object.assign({blockSize:1},o)),this._xformMode=t,this._key=e,this.reset()}static _createHelper(t){return new Ze(t)}static createDecryptor(t,e){let o=this;return new o(this._DEC_XFORM_MODE,t,e)}static createEncryptor(t,e){return new this(this._ENC_XFORM_MODE,t,e)}finalize(t){return t&&this._append(t),this._doFinalize()}process(t){return this._append(t),this._process()}};ut.ivSize=4;ut.keySize=4;ut._DEC_XFORM_MODE=2;ut._ENC_XFORM_MODE=1;var rt=class{static{n(this,"BlockCipherModeAlgorithm")}constructor(t,e){this.init(t,e)}init(t,e){this._cipher=t,this._iv=e}};var $t=class{static{n(this,"BlockCipherMode")}static createDecryptor(t,e){let o=this.Decryptor;return new o(t,e)}static createEncryptor(t,e){let o=this.Encryptor;return new o(t,e)}};$t.Decryptor=rt;$t.Encryptor=rt;var Je=class extends rt{static{n(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(t,e){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(t,e,this._cipher.cfg.blockSize),this._cipher.encryptBlock(t,e),this._prevBlock=t.slice(e,e+this._cipher.cfg.blockSize)}xorBlock(t,e,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[e+i]^=s[i]}};var Ye=class extends rt{static{n(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(t,e){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let o=t.slice(e,e+this._cipher.cfg.blockSize);this._cipher.decryptBlock(t,e),this.xorBlock(t,e,this._cipher.cfg.blockSize),this._prevBlock=o}xorBlock(t,e,o){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let i=0;i<o;i++)t[e+i]^=s[i]}};var z=class extends $t{static{n(this,"CBC")}};z.Decryptor=Ye;z.Encryptor=Je;var X=class{static{n(this,"PKCS7")}static pad(t,e){let o=e*4,s=o-t.sigBytes%o,i=s<<24|s<<16|s<<8|s,a=[];for(let h=0;h<s;h+=4)a.push(i);let c=new _(a,s);t.concat(c)}static unpad(t){let e=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=e}};var Kt=class extends ut{static{n(this,"BlockCipher")}constructor(t,e,o){super(t,e,Object.assign({blockSize:4,mode:z,padding:X},o))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let t;this._xformMode===this.constructor._ENC_XFORM_MODE?t=this.cfg.mode.createEncryptor:(t=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===t?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=t.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=t)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let t;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),t=this._process(!0)}else t=this._process(!0),this.cfg.padding.unpad(t);return t}_doProcessBlock(t,e){this._mode.processBlock(t,e)}};var l=class U{static{n(this,"X64Word")}constructor(t,e){this.high=t,this.low=e}add(t){let e=this.low+t.low|0,o=e>>>0<this.low>>>0?1:0,s=this.high+t.high+o|0;return new U(s,e)}and(t){return new U(this.high&t.high,this.low&t.low)}not(){return new U(~this.high,~this.low)}or(t){return new U(this.high|t.high,this.low|t.low)}rotL(t){return this.shiftL(t).or(this.shiftR(64-t))}rotR(t){return this.shiftR(t).or(this.shiftL(64-t))}shiftL(t){return t<32?new U(this.high<<t|this.low>>>32-t,this.low<<t):new U(this.low<<t-32,0)}shiftR(t){return t<32?new U(this.high>>>t,this.low>>>t|this.high<<32-t):new U(0,this.high>>>t-32)}xor(t){return new U(this.high^t.high,this.low^t.low)}};var Qe=class de{static{n(this,"X64WordArray")}constructor(t=[],e){this.words=t,this.sigBytes=e!==void 0?e:t.length*8}static create(t=[],e){return new de(t,e)}clone(){let t=this.words.map(e=>new l(e.high,e.low));return new de(t,this.sigBytes)}toX32(){let t=[];for(let e of this.words)t.push(e.high,e.low);return new _(t,this.sigBytes)}};var P=[],tr=[],er=[],rr=[],or=[],sr=[],ue=[],me=[],ge=[],_e=[];(function(){let r=[];for(let o=0;o<256;o++)o<128?r[o]=o<<1:r[o]=o<<1^283;let t=0,e=0;for(let o=0;o<256;o++){let s=e^e<<1^e<<2^e<<3^e<<4;s=s>>>8^s&255^99,P[t]=s,tr[s]=t;let i=r[t],a=r[i],c=r[a],h=r[s]*257^s*16843008;er[t]=h<<24|h>>>8,rr[t]=h<<16|h>>>16,or[t]=h<<8|h>>>24,sr[t]=h,h=c*16843009^a*65537^i*257^t*16843008,ue[s]=h<<24|h>>>8,me[s]=h<<16|h>>>16,ge[s]=h<<8|h>>>24,_e[s]=h,t?(t=i^r[r[r[c^i]]],e^=r[r[e]]):t=e=1}})();var vs=[0,1,2,4,8,16,32,64,128,27,54],Gt=class extends Kt{static{n(this,"AES")}constructor(t,e,o){super(t,e,o),super.reset()}decryptBlock(t,e){let o=t[e+1];t[e+1]=t[e+3],t[e+3]=o,this._doCryptBlock(t,e,this._invKeySchedule,ue,me,ge,_e,tr),o=t[e+1],t[e+1]=t[e+3],t[e+3]=o}encryptBlock(t,e){this._doCryptBlock(t,e,this._keySchedule,er,rr,or,sr,P)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let t=this._keyPriorReset=this._key,e=t.words,o=t.sigBytes/4,i=((this._nRounds=o+6)+1)*4,a=this._keySchedule=[];for(let c=0;c<i;c++)if(c<o)a[c]=e[c];else{let h=a[c-1];c%o?o>6&&c%o===4&&(h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255]):(h=h<<8|h>>>24,h=P[h>>>24]<<24|P[h>>>16&255]<<16|P[h>>>8&255]<<8|P[h&255],h^=vs[c/o|0]<<24),a[c]=a[c-o]^h}this._invKeySchedule=[];for(let c=0;c<i;c++){let h=i-c,f;c%4?f=a[h]:f=a[h-4],c<4||h<=4?this._invKeySchedule[c]=f:this._invKeySchedule[c]=ue[P[f>>>24]]^me[P[f>>>16&255]]^ge[P[f>>>8&255]]^_e[P[f&255]]}}_doCryptBlock(t,e,o,s,i,a,c,h){let f=t[e]^o[0],g=t[e+1]^o[1],u=t[e+2]^o[2],m=t[e+3]^o[3],w=4;for(let E=1;E<this._nRounds;E++){let x=s[f>>>24]^i[g>>>16&255]^a[u>>>8&255]^c[m&255]^o[w++],b=s[g>>>24]^i[u>>>16&255]^a[m>>>8&255]^c[f&255]^o[w++],T=s[u>>>24]^i[m>>>16&255]^a[f>>>8&255]^c[g&255]^o[w++],le=s[m>>>24]^i[f>>>16&255]^a[g>>>8&255]^c[u&255]^o[w++];f=x,g=b,u=T,m=le}let y=(h[f>>>24]<<24|h[g>>>16&255]<<16|h[u>>>8&255]<<8|h[m&255])^o[w++],v=(h[g>>>24]<<24|h[u>>>16&255]<<16|h[m>>>8&255]<<8|h[f&255])^o[w++],R=(h[u>>>24]<<24|h[m>>>16&255]<<16|h[f>>>8&255]<<8|h[g&255])^o[w++],O=(h[m>>>24]<<24|h[f>>>16&255]<<16|h[g>>>8&255]<<8|h[u&255])^o[w++];t[e]=y,t[e+1]=v,t[e+2]=R,t[e+3]=O}};Gt.keySize=256/32;var Es=[1732584193,4023233417,2562383102,271733878,3285377520],ot=new Array(80),st=class extends C{static{n(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(Es.slice(0))}_doFinalize(){let t=this._nDataBytes*8,e=this._data.sigBytes*8;return this._data.words[e>>>5]|=128<<24-e%32,this._data.words[(e+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(e+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,e){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)ot[h]=t[e+h]|0;else{let m=ot[h-3]^ot[h-8]^ot[h-14]^ot[h-16];ot[h]=m<<1|m>>>31}let f,g;h<20?(f=s&i|~s&a,g=1518500249):h<40?(f=s^i^a,g=1859775393):h<60?(f=s&i|s&a|i&a,g=2400959708):(f=s^i^a,g=3395469782);let u=(o<<5|o>>>27)+f+c+g+ot[h];c=a,a=i,i=s<<30|s>>>2,s=o,o=u|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0}};var ir=[],nr=[];(function(){function r(s){let i=Math.sqrt(s);for(let a=2;a<=i;a++)if(!(s%a))return!1;return!0}n(r,"isPrime");function t(s){return(s-(s|0))*4294967296|0}n(t,"getFractionalBits");let e=2,o=0;for(;o<64;)r(e)&&(o<8&&(ir[o]=t(Math.pow(e,1/2))),nr[o]=t(Math.pow(e,1/3)),o++),e++})();var it=[],nt=class extends C{static{n(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(ir.slice(0))}_doFinalize(){let t=this._nDataBytes*8,e=this._data.sigBytes*8;return this._data.words[e>>>5]|=128<<24-e%32,this._data.words[(e+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(e+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,e){let o=this._hash.words[0],s=this._hash.words[1],i=this._hash.words[2],a=this._hash.words[3],c=this._hash.words[4],h=this._hash.words[5],f=this._hash.words[6],g=this._hash.words[7];for(let u=0;u<64;u++){if(u<16)it[u]=t[e+u]|0;else{let E=it[u-15],x=(E<<25|E>>>7)^(E<<14|E>>>18)^E>>>3,b=it[u-2],T=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;it[u]=x+it[u-7]+T+it[u-16]}let m=c&h^~c&f,w=o&s^o&i^s&i,y=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),v=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),R=g+v+m+nr[u]+it[u],O=y+w;g=f,f=h,h=c,c=a+R|0,a=i,i=s,s=o,o=R+O|0}this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+a|0,this._hash.words[4]=this._hash.words[4]+c|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+f|0,this._hash.words[7]=this._hash.words[7]+g|0}};var we=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],D=[];(function(){for(let r=0;r<80;r++)D[r]=new l(void 0,void 0)})();var ye=class extends C{static{n(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new Qe([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let t=this._data,e=t.words,o=this._nDataBytes*8,s=t.sigBytes*8;return e[s>>>5]|=128<<24-s%32,e[(s+128>>>10<<5)+30]=Math.floor(o/4294967296),e[(s+128>>>10<<5)+31]=o,t.sigBytes=e.length*4,this._process(),this._hash.toX32()}_doProcessBlock(t,e){let o=this._hash.words[0].high,s=this._hash.words[0].low,i=this._hash.words[1].high,a=this._hash.words[1].low,c=this._hash.words[2].high,h=this._hash.words[2].low,f=this._hash.words[3].high,g=this._hash.words[3].low,u=this._hash.words[4].high,m=this._hash.words[4].low,w=this._hash.words[5].high,y=this._hash.words[5].low,v=this._hash.words[6].high,R=this._hash.words[6].low,O=this._hash.words[7].high,E=this._hash.words[7].low;for(let x=0;x<80;x++){let b,T;if(x<16)T=D[x].high=t[e+x*2]|0,b=D[x].low=t[e+x*2+1]|0;else{let Ne=D[x-15],ht=Ne.high,Et=Ne.low,us=(ht>>>1|Et<<31)^(ht>>>8|Et<<24)^ht>>>7,Fe=(Et>>>1|ht<<31)^(Et>>>8|ht<<24)^(Et>>>7|ht<<25),Le=D[x-2],lt=Le.high,Rt=Le.low,ms=(lt>>>19|Rt<<13)^(lt<<3|Rt>>>29)^lt>>>6,ze=(Rt>>>19|lt<<13)^(Rt<<3|lt>>>29)^(Rt>>>6|lt<<26);b=Fe+D[x-7].low,T=us+D[x-7].high+(b>>>0<Fe>>>0?1:0),b=b+ze,T=T+ms+(b>>>0<ze>>>0?1:0),b=b+D[x-16].low,T=T+D[x-16].high+(b>>>0<D[x-16].low>>>0?1:0),D[x].high=T,D[x].low=b}let le=u&w^~u&v,je=m&y^~m&R,cs=o&i^o&c^i&c,hs=s&a^s&h^a&h,ls=(o>>>28|s<<4)^(o<<30|s>>>2)^(o<<25|s>>>7),Me=(s>>>28|o<<4)^(s<<30|o>>>2)^(s<<25|o>>>7),fs=(u>>>14|m<<18)^(u>>>18|m<<14)^(u<<23|m>>>9),ps=(m>>>14|u<<18)^(m>>>18|u<<14)^(m<<23|u>>>9),j=E+ps,V=O+fs+(j>>>0<E>>>0?1:0);j=j+je,V=V+le+(j>>>0<je>>>0?1:0),j=j+we[x].low,V=V+we[x].high+(j>>>0<we[x].low>>>0?1:0),j=j+b,V=V+T+(j>>>0<b>>>0?1:0);let De=Me+hs,ds=ls+cs+(De>>>0<Me>>>0?1:0);O=v,E=R,v=w,R=y,w=u,y=m,m=g+j|0,u=f+V+(m>>>0<g>>>0?1:0)|0,f=c,g=h,c=i,h=a,i=o,a=s,s=j+De|0,o=V+ds+(s>>>0<j>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+s,this._hash.words[0].high=this._hash.words[0].high+o+(this._hash.words[0].low>>>0<s>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+a,this._hash.words[1].high=this._hash.words[1].high+i+(this._hash.words[1].low>>>0<a>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+c+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+f+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+m,this._hash.words[4].high=this._hash.words[4].high+u+(this._hash.words[4].low>>>0<m>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+y,this._hash.words[5].high=this._hash.words[5].high+w+(this._hash.words[5].low>>>0<y>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+R,this._hash.words[6].high=this._hash.words[6].high+v+(this._hash.words[6].low>>>0<R>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+E,this._hash.words[7].high=this._hash.words[7].high+O+(this._hash.words[7].low>>>0<E>>>0?1:0)}};var ar=class{static{n(this,"HMAC")}constructor(t,e){this._hasher=new t;let o=typeof e=="string"?I.parse(e):e,s=this._hasher.cfg.blockSize,i=s*4;o.sigBytes>i&&(o=this._hasher.finalize(o)),o.clamp();let a=this._oKey=o.clone(),c=this._iKey=o.clone(),h=a.words,f=c.words;for(let g=0;g<s;g++)h[g]^=1549556828,f[g]^=909522486;a.sigBytes=c.sigBytes=i,this.reset()}finalize(t){let e=this._hasher.finalize(t);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(e))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(t){return this._hasher.update(t),this}};var Bt=class cr{static{n(this,"PBKDF2")}constructor(t){this.cfg=Object.assign({keySize:128/32,hasher:nt,iterations:25e4},t)}static execute(t,e,o){return new cr(o).compute(t,e)}compute(t,e){let o=this.cfg,s=new ar(o.hasher,t),i=new _,a=new _([1]),c=i.words,h=a.words,f=o.keySize,g=o.iterations;for(;c.length<f;){let u=s.update(e).finalize(a);s.reset();let m=u.words,w=m.length,y=u;for(let v=1;v<g;v++){y=s.finalize(y),s.reset();let R=y.words;for(let O=0;O<w;O++)m[O]^=R[O]}i.concat(u),h[0]++}return i.sigBytes=f*4,i}};var Z=Kt._createHelper(Gt);var St=n(function(){let r=Date.now().toString(36),t=globalThis.crypto;if(t?.getRandomValues){let e=new Uint8Array(8);t.getRandomValues(e);let o="";for(let s=0;s<e.length;s++){let i=e[s].toString(16);o+=i.length===1?"0"+i:i}return r+"-"+o}return r+"-"+Math.random().toString(36).slice(2,10)},"correlationIdHelper");var mt=C._createHelper(K);var gt=C._createHelper(st);var Wt=C._createHelper(nt);var Ht=C._createHelper(ye);var _t=class{static{n(this,"SmpCrypto")}static base64Decode(t){return I.stringify($.parse(t))}static base64Encode(t){return $.stringify(I.parse(t))}static generateCorrelationId(){return St()}static md5(t){return mt(t).toString()}static sha1(t){return gt(t).toString()}static sha256(t){return Wt(t).toString()}static sha512(t){return Ht(t).toString()}};var qt=class extends pt{static{n(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(t){return this._staticSelf._storage.get(t)}_removeRaw(t){this._staticSelf._storage.delete(t)}_writeRaw(t,e){this._staticSelf._storage.set(t,e)}};var hr=class{static{n(this,"SmpHttpTwoService")}static _cacheStrategy=typeof sessionStorage<"u"?new Dt:new qt;static _errorClass=k;static _mergeParamsFallbackBaseUrl="https://uc-api-nest-common-fe";static _running=new Map;static $http(t){return this._generateAjax(t)}static async _generateAjax(t){let e=this._generateCacheKey(t),o=+(t.ttl||0)>0;if(o){let a=this._cacheStrategy.read(e);if(a)return Promise.resolve(a)}let s=this._running.get(e);if(s)return s;let i=this._generateAjaxBase(t).then(a=>(o&&this._cacheStrategy.write(e,a,t.ttl),a)).finally(()=>{this._running.delete(e)});return this._running.set(e,i),i}static async _generateAjaxBase(t){let e=await this._preprocessRequest(t),o={method:e.method,headers:new Headers({"content-type":"application/json",...e.headers}),body:e.body?JSON.stringify(e.body):null};return e.useCredentials&&(o.credentials="include"),e.url=this.mergeQueryParams(e.url,e.queryParams),fetch(e.url,o).then(s=>this._preprocessResponse(t,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(e.responseType){case"blob":return s.blob();case"arraybuffer":return s.arrayBuffer();case"text":return s.text();case"json":default:return s.json()}}return s.json().then(i=>{let a=i;try{a=this._errorClass.fromPlain(i)}catch(c){console.debug("http: failed to parse error response into ErrorResponse",c)}return Promise.reject({status:s.status,message:s.statusText,body:a})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(t,e){if(!e||Object.keys(e).length===0)return t;let o=t.startsWith("http"),s=new URL(t,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),a={...Object.fromEntries(new URLSearchParams(s.search).entries()),...e},c=[];for(let[u,m]of Object.entries(a))if(m!=null)if(Array.isArray(m))for(let w of m)c.push(`${encodeURIComponent(u)}=${encodeURIComponent(String(w))}`);else c.push(`${encodeURIComponent(u)}=${encodeURIComponent(String(m))}`);let h=c.length?`?${c.join("&")}`:"",g=s.origin+s.pathname+h;return o?g:g.replace(s.origin,"")}static _generateCacheKey(t){let e=`${t.method}:${t.url}`;return t.queryParams&&Object.keys(t.queryParams).length>0&&(e+=`:${_t.md5(JSON.stringify(t.queryParams))}`),t.body&&Object.keys(t.body).length>0?`${e}:${_t.md5(JSON.stringify(t.body))}`:e}static async _preprocessRequest(t){return t}static async _preprocessResponse(t,e){return e}};import{SmpLoggerMethods as Rs}from"@tonysamperi/logger";var lr=class{static{n(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new Rs;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(t,e){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}static fromBearer(t=""){return t.split(" ")[1]}static getCountryFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[1]}static getLocaleFromReferer(t){return t?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(t,e){try{return t.replace(this._pathParamRegex,(o,s)=>{let i=e[s];return i!==void 0?encodeURIComponent(i):o})}catch(o){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,o)}return t}};var Ip={status:"OK"};var fr=(function(r){return r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r})({});var pr=class{static{n(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(t,e,o){this._access_token=t,this._exp=e,this._iss=o}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};var dr=class{static{n(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};var Tt=class{static{n(this,"SmpAesCrypt")}_password;_salt;_initVector;_iv;_key;_mode=z;_padding=X;constructor(t,e,o){this._password=t,this._salt=e,this._initVector=o,this._iv=this._initVector?L.parse(this._initVector):void 0,this._key=this._buildKey()}decryptAES(t){return Z.decrypt(t,this._key,{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(t){return Z.encrypt(t,this._key,{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return Bt.execute(this._password,L.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:st})}};var xe=class r{static{n(this,"SmpAesCryptV2")}_password;_salt;_initVector;static _KEY_SIZE=256/32;static _PBKDF2_ITERATIONS=1e5;_iv;_key;_mode=z;_padding=X;constructor(t,e,o){this._password=t,this._salt=e,this._initVector=o,this._iv=this._initVector?L.parse(this._initVector):void 0,this._key=this._buildKey()}decryptAES(t){return Z.decrypt(t,this._key,{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(t){return Z.encrypt(t,this._key,{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return Bt.execute(this._password,L.parse(this._salt),{keySize:r._KEY_SIZE,iterations:r._PBKDF2_ITERATIONS,hasher:nt})}};var be=class{static{n(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(t){this._baseCode=t}static check(t,e){if(new this(t).secureCode!==e)throw k.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:Ke.BadRequest})}_encode(){let t=new K;return t.update(I.parse(this._seed+this._baseCode)),t.finalize().toString(L).substring(0,this._crcLength).toUpperCase()}};import{Expose as Bs,instanceToPlain as Ts,plainToInstance as Is}from"class-transformer";import{DateTime as Ae}from"ts-luxon";var M=(function(r){return r.ACTIVATE="ACTIVATE",r.BLOCK="BLOCK",r.CHECK="CHECK",r.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",r.FREEZE="FREEZE",r.PURCHASE="PURCHASE",r.RECHARGE="RECHARGE",r.ROLLBACK="ROLLBACK",r.TRANSACTION="TRANSACTION",r.TRANSACTION_DETAIL="TRANSACTION_DETAIL",r.UNFREEZE="UNFREEZE",r.XREFUND="XREFUND",r})({});var wt=(function(r){return r.MD5="MD5",r.MD5_HMAC="MD5_HMAC",r.SHA1="SHA1",r.SHA1_HMAC="SHA1_HMAC",r})({});function Os(r,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,o);else for(var c=r.length-1;c>=0;c--)(a=r[c])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i}n(Os,"_ts_decorate");function ur(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}n(ur,"_ts_metadata");var ve=class r{static{n(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new Tt("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _OP_CODES={[M.CHECK]:"",[M.TRANSACTION]:"",[M.TRANSACTION_DETAIL]:"",[M.ACTIVATE]:"A",[M.BLOCK]:"B",[M.DIGITAL_ACTIVATE]:"D",[M.FREEZE]:"F",[M.PURCHASE]:"P",[M.RECHARGE]:"G",[M.ROLLBACK]:"R",[M.UNFREEZE]:"U",[M.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[wt.MD5]:t=>mt(t),[wt.MD5_HMAC]:t=>{let e=new K;return e.update(I.parse(t)),e.finalize()},[wt.SHA1]:t=>gt(t),[wt.SHA1_HMAC]:t=>{let e=new st;return e.update(I.parse(t)),e.finalize()}};_hashStrategy=this._hashStrategies[wt.MD5];constructor(t="ACTIVATION",e,o,s){this.gc=t,this.op=e,this.ot=o,this._dto=typeof s=="number"&&s>=0?Ae.fromMillis(+`${s}000`.slice(0,13)):Ae.local()}static build({gc:t,op:e,ot:o,dto:s}){return new this(t,e,o,s?.ts)}static explode(t){let e=this.constructor,o=(t||"").split(e._SEP);if(o.length<4)throw new Error(`${this.constructor.name}::explode: invalid transactionId provided => "${t}"`);return this.build({gc:o[1],op:e.prefixToOperation(o[2]),dto:Ae.fromSeconds(+o[3])})}static isBase64(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)&&t.length%4===0}static parse(t){console.info(`${this.constructor.name}::parse: trying to parse ${t}`);try{if(this.isBase64(t)){let e=this._AES_ENCODER.decryptAES(t),o=JSON.parse(e);return Is(r,o)}else return this.explode(t)}catch(e){throw console.error(`${this.constructor.name}::parse: failed to parse ${t}`,e),new Error(`${this.constructor.name}::parse: could not parse transactionId ${t}`)}}static prefixToOperation(t){return Object.entries(this._OP_CODES).find(([,o])=>o===t)[0]}serialize(){return Ts(this,{excludePrefixes:["_"]})}toString(){let t=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(t)}};Os([Bs(),ur("design:type",Number),ur("design:paramtypes",[])],ve.prototype,"ts",null);var cd=(function(r){return r.ListDetectiveValidator="ListDetectiveValidator",r.MXValidator="MXValidator",r.SyntaxValidator="SyntaxValidator",r})({});function ld(r,t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{o!=="constructor"&&(o in r.prototype||Object.defineProperty(r.prototype,o,Object.getOwnPropertyDescriptor(e.prototype,o)))});try{let o=new e;Object.getOwnPropertyNames(o).forEach(s=>{s in r.prototype||Object.defineProperty(r.prototype,s,Object.getOwnPropertyDescriptor(o,s))})}catch{}Object.getOwnPropertyNames(e).forEach(o=>{o!=="prototype"&&o!=="name"&&o!=="length"&&(o in r||Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(e,o)))})})}n(ld,"smpApplyMixin");function Cs(){this.__data__=[],this.size=0}n(Cs,"listCacheClear");var mr=Cs;function Ps(r,t){return r===t||r!==r&&t!==t}n(Ps,"eq");var Vt=Ps;function js(r,t){for(var e=r.length;e--;)if(Vt(r[e][0],t))return e;return-1}n(js,"assocIndexOf");var J=js;var Ms=Array.prototype,Ds=Ms.splice;function Ns(r){var t=this.__data__,e=J(t,r);if(e<0)return!1;var o=t.length-1;return e==o?t.pop():Ds.call(t,e,1),--this.size,!0}n(Ns,"listCacheDelete");var gr=Ns;function Fs(r){var t=this.__data__,e=J(t,r);return e<0?void 0:t[e][1]}n(Fs,"listCacheGet");var _r=Fs;function Ls(r){return J(this.__data__,r)>-1}n(Ls,"listCacheHas");var wr=Ls;function zs(r,t){var e=this.__data__,o=J(e,r);return o<0?(++this.size,e.push([r,t])):e[o][1]=t,this}n(zs,"listCacheSet");var yr=zs;function yt(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}n(yt,"ListCache");yt.prototype.clear=mr;yt.prototype.delete=gr;yt.prototype.get=_r;yt.prototype.has=wr;yt.prototype.set=yr;var Y=yt;function Us(){this.__data__=new Y,this.size=0}n(Us,"stackClear");var xr=Us;function ks(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}n(ks,"stackDelete");var br=ks;function $s(r){return this.__data__.get(r)}n($s,"stackGet");var Ar=$s;function Ks(r){return this.__data__.has(r)}n(Ks,"stackHas");var vr=Ks;var Gs=typeof global=="object"&&global&&global.Object===Object&&global,Xt=Gs;var Ss=typeof self=="object"&&self&&self.Object===Object&&self,Ws=Xt||Ss||Function("return this")(),B=Ws;var Hs=B.Symbol,G=Hs;var Er=Object.prototype,qs=Er.hasOwnProperty,Vs=Er.toString,It=G?G.toStringTag:void 0;function Xs(r){var t=qs.call(r,It),e=r[It];try{r[It]=void 0;var o=!0}catch{}var s=Vs.call(r);return o&&(t?r[It]=e:delete r[It]),s}n(Xs,"getRawTag");var Rr=Xs;var Zs=Object.prototype,Js=Zs.toString;function Ys(r){return Js.call(r)}n(Ys,"objectToString");var Or=Ys;var Qs="[object Null]",ti="[object Undefined]",Br=G?G.toStringTag:void 0;function ei(r){return r==null?r===void 0?ti:Qs:Br&&Br in Object(r)?Rr(r):Or(r)}n(ei,"baseGetTag");var S=ei;function ri(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}n(ri,"isObject");var Zt=ri;var oi="[object AsyncFunction]",si="[object Function]",ii="[object GeneratorFunction]",ni="[object Proxy]";function ai(r){if(!Zt(r))return!1;var t=S(r);return t==si||t==ii||t==oi||t==ni}n(ai,"isFunction");var Jt=ai;var ci=B["__core-js_shared__"],Yt=ci;var Tr=(function(){var r=/[^.]+$/.exec(Yt&&Yt.keys&&Yt.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function hi(r){return!!Tr&&Tr in r}n(hi,"isMasked");var Ir=hi;var li=Function.prototype,fi=li.toString;function pi(r){if(r!=null){try{return fi.call(r)}catch{}try{return r+""}catch{}}return""}n(pi,"toSource");var W=pi;var di=/[\\^$.*+?()[\]{}|]/g,ui=/^\[object .+?Constructor\]$/,mi=Function.prototype,gi=Object.prototype,_i=mi.toString,wi=gi.hasOwnProperty,yi=RegExp("^"+_i.call(wi).replace(di,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xi(r){if(!Zt(r)||Ir(r))return!1;var t=Jt(r)?yi:ui;return t.test(W(r))}n(xi,"baseIsNative");var Cr=xi;function bi(r,t){return r?.[t]}n(bi,"getValue");var Pr=bi;function Ai(r,t){var e=Pr(r,t);return Cr(e)?e:void 0}n(Ai,"getNative");var N=Ai;var vi=N(B,"Map"),Q=vi;var Ei=N(Object,"create"),H=Ei;function Ri(){this.__data__=H?H(null):{},this.size=0}n(Ri,"hashClear");var jr=Ri;function Oi(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}n(Oi,"hashDelete");var Mr=Oi;var Bi="__lodash_hash_undefined__",Ti=Object.prototype,Ii=Ti.hasOwnProperty;function Ci(r){var t=this.__data__;if(H){var e=t[r];return e===Bi?void 0:e}return Ii.call(t,r)?t[r]:void 0}n(Ci,"hashGet");var Dr=Ci;var Pi=Object.prototype,ji=Pi.hasOwnProperty;function Mi(r){var t=this.__data__;return H?t[r]!==void 0:ji.call(t,r)}n(Mi,"hashHas");var Nr=Mi;var Di="__lodash_hash_undefined__";function Ni(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=H&&t===void 0?Di:t,this}n(Ni,"hashSet");var Fr=Ni;function xt(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}n(xt,"Hash");xt.prototype.clear=jr;xt.prototype.delete=Mr;xt.prototype.get=Dr;xt.prototype.has=Nr;xt.prototype.set=Fr;var Ee=xt;function Fi(){this.size=0,this.__data__={hash:new Ee,map:new(Q||Y),string:new Ee}}n(Fi,"mapCacheClear");var Lr=Fi;function Li(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}n(Li,"isKeyable");var zr=Li;function zi(r,t){var e=r.__data__;return zr(t)?e[typeof t=="string"?"string":"hash"]:e.map}n(zi,"getMapData");var tt=zi;function Ui(r){var t=tt(this,r).delete(r);return this.size-=t?1:0,t}n(Ui,"mapCacheDelete");var Ur=Ui;function ki(r){return tt(this,r).get(r)}n(ki,"mapCacheGet");var kr=ki;function $i(r){return tt(this,r).has(r)}n($i,"mapCacheHas");var $r=$i;function Ki(r,t){var e=tt(this,r),o=e.size;return e.set(r,t),this.size+=e.size==o?0:1,this}n(Ki,"mapCacheSet");var Kr=Ki;function bt(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}n(bt,"MapCache");bt.prototype.clear=Lr;bt.prototype.delete=Ur;bt.prototype.get=kr;bt.prototype.has=$r;bt.prototype.set=Kr;var Qt=bt;var Gi=200;function Si(r,t){var e=this.__data__;if(e instanceof Y){var o=e.__data__;if(!Q||o.length<Gi-1)return o.push([r,t]),this.size=++e.size,this;e=this.__data__=new Qt(o)}return e.set(r,t),this.size=e.size,this}n(Si,"stackSet");var Gr=Si;function At(r){var t=this.__data__=new Y(r);this.size=t.size}n(At,"Stack");At.prototype.clear=xr;At.prototype.delete=br;At.prototype.get=Ar;At.prototype.has=vr;At.prototype.set=Gr;var te=At;var Wi="__lodash_hash_undefined__";function Hi(r){return this.__data__.set(r,Wi),this}n(Hi,"setCacheAdd");var Sr=Hi;function qi(r){return this.__data__.has(r)}n(qi,"setCacheHas");var Wr=qi;function ee(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Qt;++t<e;)this.add(r[t])}n(ee,"SetCache");ee.prototype.add=ee.prototype.push=Sr;ee.prototype.has=Wr;var Hr=ee;function Vi(r,t){for(var e=-1,o=r==null?0:r.length;++e<o;)if(t(r[e],e,r))return!0;return!1}n(Vi,"arraySome");var qr=Vi;function Xi(r,t){return r.has(t)}n(Xi,"cacheHas");var Vr=Xi;var Zi=1,Ji=2;function Yi(r,t,e,o,s,i){var a=e&Zi,c=r.length,h=t.length;if(c!=h&&!(a&&h>c))return!1;var f=i.get(r),g=i.get(t);if(f&&g)return f==t&&g==r;var u=-1,m=!0,w=e&Ji?new Hr:void 0;for(i.set(r,t),i.set(t,r);++u<c;){var y=r[u],v=t[u];if(o)var R=a?o(v,y,u,t,r,i):o(y,v,u,r,t,i);if(R!==void 0){if(R)continue;m=!1;break}if(w){if(!qr(t,function(O,E){if(!Vr(w,E)&&(y===O||s(y,O,e,o,i)))return w.push(E)})){m=!1;break}}else if(!(y===v||s(y,v,e,o,i))){m=!1;break}}return i.delete(r),i.delete(t),m}n(Yi,"equalArrays");var re=Yi;var Qi=B.Uint8Array,Re=Qi;function tn(r){var t=-1,e=Array(r.size);return r.forEach(function(o,s){e[++t]=[s,o]}),e}n(tn,"mapToArray");var Xr=tn;function en(r){var t=-1,e=Array(r.size);return r.forEach(function(o){e[++t]=o}),e}n(en,"setToArray");var Zr=en;var rn=1,on=2,sn="[object Boolean]",nn="[object Date]",an="[object Error]",cn="[object Map]",hn="[object Number]",ln="[object RegExp]",fn="[object Set]",pn="[object String]",dn="[object Symbol]",un="[object ArrayBuffer]",mn="[object DataView]",Jr=G?G.prototype:void 0,Oe=Jr?Jr.valueOf:void 0;function gn(r,t,e,o,s,i,a){switch(e){case mn:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case un:return!(r.byteLength!=t.byteLength||!i(new Re(r),new Re(t)));case sn:case nn:case hn:return Vt(+r,+t);case an:return r.name==t.name&&r.message==t.message;case ln:case pn:return r==t+"";case cn:var c=Xr;case fn:var h=o&rn;if(c||(c=Zr),r.size!=t.size&&!h)return!1;var f=a.get(r);if(f)return f==t;o|=on,a.set(r,t);var g=re(c(r),c(t),o,s,i,a);return a.delete(r),g;case dn:if(Oe)return Oe.call(r)==Oe.call(t)}return!1}n(gn,"equalByTag");var Yr=gn;function _n(r,t){for(var e=-1,o=t.length,s=r.length;++e<o;)r[s+e]=t[e];return r}n(_n,"arrayPush");var Qr=_n;var wn=Array.isArray,at=wn;function yn(r,t,e){var o=t(r);return at(r)?o:Qr(o,e(r))}n(yn,"baseGetAllKeys");var to=yn;function xn(r,t){for(var e=-1,o=r==null?0:r.length,s=0,i=[];++e<o;){var a=r[e];t(a,e,r)&&(i[s++]=a)}return i}n(xn,"arrayFilter");var eo=xn;function bn(){return[]}n(bn,"stubArray");var ro=bn;var An=Object.prototype,vn=An.propertyIsEnumerable,oo=Object.getOwnPropertySymbols,En=oo?function(r){return r==null?[]:(r=Object(r),eo(oo(r),function(t){return vn.call(r,t)}))}:ro,so=En;function Rn(r,t){for(var e=-1,o=Array(r);++e<r;)o[e]=t(e);return o}n(Rn,"baseTimes");var io=Rn;function On(r){return r!=null&&typeof r=="object"}n(On,"isObjectLike");var q=On;var Bn="[object Arguments]";function Tn(r){return q(r)&&S(r)==Bn}n(Tn,"baseIsArguments");var Be=Tn;var no=Object.prototype,In=no.hasOwnProperty,Cn=no.propertyIsEnumerable,Pn=Be((function(){return arguments})())?Be:function(r){return q(r)&&In.call(r,"callee")&&!Cn.call(r,"callee")},ao=Pn;function jn(){return!1}n(jn,"stubFalse");var co=jn;var fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ho=fo&&typeof module=="object"&&module&&!module.nodeType&&module,Mn=ho&&ho.exports===fo,lo=Mn?B.Buffer:void 0,Dn=lo?lo.isBuffer:void 0,Nn=Dn||co,Ct=Nn;var Fn=9007199254740991,Ln=/^(?:0|[1-9]\d*)$/;function zn(r,t){var e=typeof r;return t=t??Fn,!!t&&(e=="number"||e!="symbol"&&Ln.test(r))&&r>-1&&r%1==0&&r<t}n(zn,"isIndex");var po=zn;var Un=9007199254740991;function kn(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Un}n(kn,"isLength");var oe=kn;var $n="[object Arguments]",Kn="[object Array]",Gn="[object Boolean]",Sn="[object Date]",Wn="[object Error]",Hn="[object Function]",qn="[object Map]",Vn="[object Number]",Xn="[object Object]",Zn="[object RegExp]",Jn="[object Set]",Yn="[object String]",Qn="[object WeakMap]",ta="[object ArrayBuffer]",ea="[object DataView]",ra="[object Float32Array]",oa="[object Float64Array]",sa="[object Int8Array]",ia="[object Int16Array]",na="[object Int32Array]",aa="[object Uint8Array]",ca="[object Uint8ClampedArray]",ha="[object Uint16Array]",la="[object Uint32Array]",A={};A[ra]=A[oa]=A[sa]=A[ia]=A[na]=A[aa]=A[ca]=A[ha]=A[la]=!0;A[$n]=A[Kn]=A[ta]=A[Gn]=A[ea]=A[Sn]=A[Wn]=A[Hn]=A[qn]=A[Vn]=A[Xn]=A[Zn]=A[Jn]=A[Yn]=A[Qn]=!1;function fa(r){return q(r)&&oe(r.length)&&!!A[S(r)]}n(fa,"baseIsTypedArray");var uo=fa;function pa(r){return function(t){return r(t)}}n(pa,"baseUnary");var mo=pa;var go=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pt=go&&typeof module=="object"&&module&&!module.nodeType&&module,da=Pt&&Pt.exports===go,Te=da&&Xt.process,ua=(function(){try{var r=Pt&&Pt.require&&Pt.require("util").types;return r||Te&&Te.binding&&Te.binding("util")}catch{}})(),Ie=ua;var _o=Ie&&Ie.isTypedArray,ma=_o?mo(_o):uo,se=ma;var ga=Object.prototype,_a=ga.hasOwnProperty;function wa(r,t){var e=at(r),o=!e&&ao(r),s=!e&&!o&&Ct(r),i=!e&&!o&&!s&&se(r),a=e||o||s||i,c=a?io(r.length,String):[],h=c.length;for(var f in r)(t||_a.call(r,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||po(f,h)))&&c.push(f);return c}n(wa,"arrayLikeKeys");var wo=wa;var ya=Object.prototype;function xa(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||ya;return r===e}n(xa,"isPrototype");var yo=xa;function ba(r,t){return function(e){return r(t(e))}}n(ba,"overArg");var xo=ba;var Aa=xo(Object.keys,Object),bo=Aa;var va=Object.prototype,Ea=va.hasOwnProperty;function Ra(r){if(!yo(r))return bo(r);var t=[];for(var e in Object(r))Ea.call(r,e)&&e!="constructor"&&t.push(e);return t}n(Ra,"baseKeys");var Ao=Ra;function Oa(r){return r!=null&&oe(r.length)&&!Jt(r)}n(Oa,"isArrayLike");var vo=Oa;function Ba(r){return vo(r)?wo(r):Ao(r)}n(Ba,"keys");var Eo=Ba;function Ta(r){return to(r,Eo,so)}n(Ta,"getAllKeys");var Ce=Ta;var Ia=1,Ca=Object.prototype,Pa=Ca.hasOwnProperty;function ja(r,t,e,o,s,i){var a=e&Ia,c=Ce(r),h=c.length,f=Ce(t),g=f.length;if(h!=g&&!a)return!1;for(var u=h;u--;){var m=c[u];if(!(a?m in t:Pa.call(t,m)))return!1}var w=i.get(r),y=i.get(t);if(w&&y)return w==t&&y==r;var v=!0;i.set(r,t),i.set(t,r);for(var R=a;++u<h;){m=c[u];var O=r[m],E=t[m];if(o)var x=a?o(E,O,m,t,r,i):o(O,E,m,r,t,i);if(!(x===void 0?O===E||s(O,E,e,o,i):x)){v=!1;break}R||(R=m=="constructor")}if(v&&!R){var b=r.constructor,T=t.constructor;b!=T&&"constructor"in r&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(v=!1)}return i.delete(r),i.delete(t),v}n(ja,"equalObjects");var Ro=ja;var Ma=N(B,"DataView"),ie=Ma;var Da=N(B,"Promise"),ne=Da;var Na=N(B,"Set"),ae=Na;var Fa=N(B,"WeakMap"),ce=Fa;var Oo="[object Map]",La="[object Object]",Bo="[object Promise]",To="[object Set]",Io="[object WeakMap]",Co="[object DataView]",za=W(ie),Ua=W(Q),ka=W(ne),$a=W(ae),Ka=W(ce),ct=S;(ie&&ct(new ie(new ArrayBuffer(1)))!=Co||Q&&ct(new Q)!=Oo||ne&&ct(ne.resolve())!=Bo||ae&&ct(new ae)!=To||ce&&ct(new ce)!=Io)&&(ct=n(function(r){var t=S(r),e=t==La?r.constructor:void 0,o=e?W(e):"";if(o)switch(o){case za:return Co;case Ua:return Oo;case ka:return Bo;case $a:return To;case Ka:return Io}return t},"getTag"));var Pe=ct;var Ga=1,Po="[object Arguments]",jo="[object Array]",he="[object Object]",Sa=Object.prototype,Mo=Sa.hasOwnProperty;function Wa(r,t,e,o,s,i){var a=at(r),c=at(t),h=a?jo:Pe(r),f=c?jo:Pe(t);h=h==Po?he:h,f=f==Po?he:f;var g=h==he,u=f==he,m=h==f;if(m&&Ct(r)){if(!Ct(t))return!1;a=!0,g=!1}if(m&&!g)return i||(i=new te),a||se(r)?re(r,t,e,o,s,i):Yr(r,t,h,e,o,s,i);if(!(e&Ga)){var w=g&&Mo.call(r,"__wrapped__"),y=u&&Mo.call(t,"__wrapped__");if(w||y){var v=w?r.value():r,R=y?t.value():t;return i||(i=new te),s(v,R,e,o,i)}}return m?(i||(i=new te),Ro(r,t,e,o,s,i)):!1}n(Wa,"baseIsEqualDeep");var Do=Wa;function No(r,t,e,o,s){return r===t?!0:r==null||t==null||!q(r)&&!q(t)?r!==r&&t!==t:Do(r,t,e,o,No,s)}n(No,"baseIsEqual");var Fo=No;function Ha(r,t){return Fo(r,t)}n(Ha,"isEqual");var Lo=Ha;var qa=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function zo(r){return r.match(qa)}n(zo,"smpAsciiWords");var So="\\ud800-\\udfff",Va="\\u0300-\\u036f",Xa="\\ufe20-\\ufe2f",Za="\\u20d0-\\u20ff",Ja="\\u1ab0-\\u1aff",Ya="\\u1dc0-\\u1dff",Qa=Va+Xa+Za+Ja+Ya,Wo="\\u2700-\\u27bf",Ho="a-z\\xdf-\\xf6\\xf8-\\xff",tc="\\xac\\xb1\\xd7\\xf7",ec="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",oc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qo="A-Z\\xc0-\\xd6\\xd8-\\xde",sc="\\ufe0e\\ufe0f",Vo=tc+ec+rc+oc,Xo="['\u2019]",Uo=`[${Vo}]`,ic=`[${Qa}]`,Zo="\\d",nc=`[${Wo}]`,Jo=`[${Ho}]`,Yo=`[^${So}${Vo+Zo+Wo+Ho+qo}]`,ac="\\ud83c[\\udffb-\\udfff]",cc=`(?:${ic}|${ac})`,hc=`[^${So}]`,Qo="(?:\\ud83c[\\udde6-\\uddff]){2}",ts="[\\ud800-\\udbff][\\udc00-\\udfff]",vt=`[${qo}]`,lc="\\u200d",ko=`(?:${Jo}|${Yo})`,fc=`(?:${vt}|${Yo})`,$o=`(?:${Xo}(?:d|ll|m|re|s|t|ve))?`,Ko=`(?:${Xo}(?:D|LL|M|RE|S|T|VE))?`,es=`${cc}?`,rs=`[${sc}]?`,pc=`(?:${lc}(?:${[hc,Qo,ts].join("|")})${rs+es})*`,dc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mc=rs+es+pc,Go=`(?:${[nc,Qo,ts].join("|")})${mc}`,jt=class{static{n(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${vt}?${Jo}+${$o}(?=${[Uo,vt,"$"].join("|")})`,`${fc}+${Ko}(?=${[Uo,vt+ko,"$"].join("|")})`,`${vt}?${ko}+${$o}`,`${vt}+${Ko}`,uc,dc,`${Zo}+`,Go].join("|"),"g");static RS_EMOJI=Go;static unicodeWords(t){return t.match(this.RE_UNICODE_WORDS)}};var os=class{static{n(this,"SmpCommonUtils")}static arrayRemove(t,e){let o=[],s=t.filter((i,a)=>e(i,a)&&o.push(a));return o.reverse().forEach(i=>t.splice(i,1)),s}static assertIsArray(t,e){if(!Array.isArray(t))throw new Error(e||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(t,e){if(!this.isBoolean(t))throw new Error(e||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(t,e){if(!this.isFunction(t))throw new Error(e||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(t,e,o){if(!(t instanceof e))throw new Error(o||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(t,e){if(this.isEmpty(t))throw new Error(e||`${this.constructor.name} => entity was empty`)}static assertIsNumber(t,e){if(typeof t!="number")throw new Error(e||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(t,e){if(!this.isNumeric(t))throw new Error(e||`${this.constructor.name} => val was not numeric`)}static assertIsObject(t,e){if(!this.isObject(t))throw new Error(e||`${this.constructor.name} => val was not an object`)}static assertIsString(t,e){if(!this.isString(t))throw new Error(e||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(t,e){if(!t)throw new Error(e||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...t){let e=t.filter(o=>!!o).join("/").replace(/(?<!:)\/\/+/g,"/");return e.startsWith("http")&&!e.endsWith("/")?`${e}/`:e}static downloadBlob(t,e){let o=window.URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.setAttribute("download",e),document.body.appendChild(s),s.click()}static fixDecimalPrecision(t,e=2){this.assertIsNumber(t),this.assertIsNumber(e);let s=10**Math.max(0,Math.trunc(e));return Math.round((t+Number.EPSILON)*s)/s}static generateRandomHexString(t=12){let e="0123456789abcdef",o="";for(let s=0;s<t;s++){let i=Math.floor(Math.random()*e.length);o+=e[i]}return o}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}static getDecimalPrecision(t){if(this.assertIsNumeric(t),!isFinite(+t))return 0;let e=1,o=0;for(;Math.round(+t*e)/e!==t;)e*=10,o++;return o}static getType(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}static isBoolean(t){return typeof t=="boolean"}static isColor(t){if(!t||!this.isString(t))return!1;let e=new Option().style;return e.color=t,e.color!==""}static isEmpty(t){return!t&&t!==0}static isEqual(t,e){return Lo(t,e)}static isFormField(t){return/^(?:input|select|textarea|button)$/i.test(t.nodeName)}static isFunction(t){return typeof t==typeof isNaN}static isNotEmpty(t){return!this.isEmpty(t)}static isNumber(t){return typeof t=="number"&&this.isNumeric(t)}static isNumeric(t){return!isNaN(t)}static isObject(t){return!!t&&t===Object(t)&&t.constructor===Object}static isPrimitive(t){let e=this.getType(t);return e!=="function"&&(e!=="object"||!t)}static isString(t){return typeof t=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(t,e){if(this.assertIsFunction(e,`CommonUtils => expected type of iteratee to be Function, got ${typeof e}`),this.isObject(t))return Object.entries(t).reduce((o,[s,i])=>(o.push(e(i,s)),o),[]);if(Array.isArray(t))return t.map(e);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof e}`)}static mapObjectKeys(t,e){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>{let a=e(s,i);return o[a]=i,o},{}):{}}static mapObjectValues(t,e){return this.isObject(t)?Object.entries(t).reduce((o,[s,i])=>(o[s]=e.call(null,i,s),o),{}):{}}static noop(){}static objectHasValue(t,e){return!!~Object.values(t).filter(o=>this.isEqual(o,e))}static omit(t,e){return Object.keys(t).filter(s=>!e.includes(s)).reduce((s,i)=>(s[i]=t[i],s),{})}static parseBoolean(t){return t?/^true$/i.test(t):!1}static parseJsonSafely(t){try{return JSON.parse(t)}catch(e){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:t,error:e});return}}static pick(t,e){return e.reduce((o,s)=>(s in t&&(o[s]=t[s]),o),{})}static runSafely(t,e=null,o=[]){if(this.isFunction(t))return t.apply(e,o)}static sleep(t){return new Promise(e=>setTimeout(e,t))}static sprintf(t,...e){return this.isString(t)&&e.length?this.sprintf(t.replace("%s",String(e.shift())),...e):t}static stripComments(t){return typeof t=="string"?t.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):t}static stripHtml(t,e=!0){this.assertIsString(t);let o=t.replace(/<[^>]*>?/g,"");return(e?this._decodeHtmlEntities(o):o).replace(/\s+/g," ").trim()}static submitFakeForm({action:t,method:e=fr.POST,data:o,target:s}){let i=Object.entries(o||{}).map(([c,h])=>`<input name="${c}" type="hidden" value="${h}" />`),a=document.createElement("form");a.method=e,a.action=t,a.innerHTML=`${i}`,a.target=s||"_self",document.body.append(a),a.submit()}static toCamelCase(t){return this.words(t.replace(/['\u2019]/g,"")).reduce((e,o,s)=>(o=o.toLowerCase(),e+(s?o.charAt(0).toUpperCase()+o.slice(1):o)),"")}static toKebabCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(t){return this.toCamelCase(t).replace(/^(.)/,e=>e.toUpperCase())}static toSnakeCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(t){return this.toSnakeCase(t).toUpperCase()}static words(t,e){return e===void 0?(jt.HAS_UNICODE_WORD(t)?jt.unicodeWords(t):zo(t))||[]:t.match(e)||[]}static _decodeHtmlEntities(t){let e={amp:"&",apos:"'",euro:"\u20AC",gt:">",lt:"<",nbsp:" ",quot:'"'};return t.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(o,s)=>{let i=s.toLowerCase();if(i.startsWith("#x")){let a=Number.parseInt(i.slice(2),16);return Number.isNaN(a)?o:String.fromCodePoint(a)}if(i.startsWith("#")){let a=Number.parseInt(i.slice(1),10);return Number.isNaN(a)?o:String.fromCodePoint(a)}return e[i]||o})}};var ss=class extends Error{static{n(this,"SmpFilterException")}message;data;constructor(t="Filter Exception",e){super(),this.message=t,this.data=e}};import{DateTime as is}from"ts-luxon";var ns=class r{static{n(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return is.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(t=`sid-xxxx-${+is.now().ts}`,e=0){this.value=t,this.expiry=e}static parse(t){return new r(t.value,t.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};import{smpNoop as e1}from"@tonysamperi/logger";var as=class{static{n(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var s1="2.0.0";export{Ip as SMP_HEALTHZ,Ue as SmpAbstractCacheStrategy,pt as SmpAbstractTtlCacheStrategy,Tt as SmpAesCrypt,xe as SmpAesCryptV2,lr as SmpApiCommonUtils,pr as SmpBaseJwtToken,dr as SmpBaseJwtTokenPlain,Mt as SmpBrowserCache,os as SmpCommonUtils,_t as SmpCrypto,k as SmpErrorResponse,ss as SmpFilterException,wc as SmpFirebaseErrors,Ot as SmpGenericResponse,ve as SmpGiftcardTransaction,wt as SmpGiftcardTransactionHashStrategies,M as SmpGiftcardTransactionOps,Dt as SmpHttpSessionStorageCache,Ke as SmpHttpStatusCodes,hr as SmpHttpTwoService,qt as SmpInMemoryCache,cd as SmpMarketingCloudValidators,as as SmpRegularExpressions,F as SmpResponseMessage,ft as SmpResponseMessageTypes,fr as SmpRestVerbs,be as SmpSecureCode,ns as SmpSid,gc as SmpSocialSignInKeys,_c as SmpSocialSignInUxModes,s1 as VERSION,ld as smpApplyMixin,ke as smpIsSmpCachedValue,e1 as smpNoop};
|
package/dist/esm/rxjs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable, ObservableInput, OperatorFunction, ObservedValueOf } from 'rxjs';
|
|
2
|
-
import { S as SmpAbstractCacheStrategy, a as SmpCachedValue } from './smp-cached-value.interface-
|
|
2
|
+
import { S as SmpAbstractCacheStrategy, a as SmpCachedValue } from './smp-cached-value.interface-BdPg-J7L.js';
|
|
3
3
|
|
|
4
4
|
declare abstract class SmpAbstractRxjsTtlCacheStrategy extends SmpAbstractCacheStrategy {
|
|
5
5
|
protected abstract _flushRaw(): Observable<void>;
|
|
@@ -7,7 +7,7 @@ declare abstract class SmpAbstractRxjsTtlCacheStrategy extends SmpAbstractCacheS
|
|
|
7
7
|
protected abstract _removeRaw(key: string): Observable<void>;
|
|
8
8
|
protected abstract _writeRaw(key: string, value: unknown, ttl?: number): Observable<void>;
|
|
9
9
|
flush(): Observable<void>;
|
|
10
|
-
read<T =
|
|
10
|
+
read<T = unknown>(key: string): Observable<T | undefined>;
|
|
11
11
|
remove(key: string): Observable<void>;
|
|
12
12
|
write<T = any>(key: string, value: T, ttl?: number): Observable<void>;
|
|
13
13
|
protected _isSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
|
|
@@ -19,7 +19,7 @@ declare class SmpRxjsInMemoryCache extends SmpAbstractRxjsTtlCacheStrategy {
|
|
|
19
19
|
private static _storage;
|
|
20
20
|
protected get _staticSelf(): typeof SmpRxjsInMemoryCache;
|
|
21
21
|
protected _flushRaw(): Observable<void>;
|
|
22
|
-
protected _readRaw(key: string): Observable<
|
|
22
|
+
protected _readRaw(key: string): Observable<unknown | undefined>;
|
|
23
23
|
protected _removeRaw(key: string): Observable<void>;
|
|
24
24
|
protected _writeRaw(key: string, value: any): Observable<void>;
|
|
25
25
|
}
|
package/dist/esm/rxjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h,b as x}from"./chunk-VBEMFJKM.js";import{a as s}from"./chunk-EI7MMDWY.js";import{map as R}from"rxjs";import{DateTime as l}from"ts-luxon";var p=class extends h{static{s(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(r){return this._readRaw(r).pipe(R(e=>{if(this._isSmpCachedValue(e)){if(e.expiry>=l.now().ts)return e.value;this._removeRaw(r).subscribe();return}return e}))}remove(r){return this._removeRaw(r)}write(r,e,o){let n;if(isNaN(+o)||+o<=0)n=this._writeRaw(r,e,o);else{let i=l.now().ts+o*1e3,c={value:e,expiry:i};n=this._writeRaw(r,c,o)}return n.subscribe({error:s(i=>console.error(`${this.constructor.name}::write: error occurred`,i),"error")}),n}_isSmpCachedValue(r){return x(r)}};import{catchError as y,throwError as _}from"rxjs";function S(t,r){return e=>e.pipe(y(o=>(typeof t==typeof isNaN?d(t)?j(o,t):t(o):!1)?r(o):_(()=>o)))}s(S,"smpRxjsCatchOnly");function d(t){try{return Reflect.construct(String,[],t),!0}catch{return!1}}s(d,"isConstructor");function j(t,r){return typeof t=="object"&&t!==null&&t.constructor===r}s(j,"isExactInstance");import{defer as m,of as a}from"rxjs";var f=class extends p{static{s(this,"SmpRxjsInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){return m(()=>(this._staticSelf._storage.clear(),a(void 0)))}_readRaw(r){return m(()=>a(this._staticSelf._storage.get(r)))}_removeRaw(r){return m(()=>(this._staticSelf._storage.delete(r),a(void 0)))}_writeRaw(r,e){return this._staticSelf._storage.set(r,e),a(void 0)}};import{map as g,of as C,defer as E,switchMap as b}from"rxjs";function w(t){let r=[];function e(o){return o>=t.length?C(r):E(()=>t[o]()).pipe(b(n=>(r[o]=n,e(o+1))))}return s(e,"runStep"),e(0)}s(w,"smpRxjsSequence");function O(t){if(Array.isArray(t))return w(t);{let r=Object.keys(t),e=r.map(o=>t[o]);return w(e).pipe(g(o=>{let n={};return r.forEach((i,c)=>{n[i]=o[c]}),n}))}}s(O,"smpRxjsQueue");import{concatMap as v,from as T,toArray as A}from"rxjs";function I(t){return T(t).pipe(v(e=>e()),A())}s(I,"smpRxjsSequence");import{map as N}from"rxjs";function u(t=M){return r=>r.pipe(N(e=>{if(~q.indexOf(JSON.stringify(e)))throw t(e);return e}))}s(u,"smpRxjsThrowIfEmpty");var q=[void 0,null,!1,0,"","0",[],{}].map(t=>JSON.stringify(t)),M=s(()=>new Error,"defaultErrorFactory");import{defaultIfEmpty as J,filter as Q}from"rxjs";function V(t,r){return e=>e.pipe(Q(o=>!t(o)),J(!1),u(r))}s(V,"smpRxjsThrowOnCondition");export{p as SmpAbstractRxjsTtlCacheStrategy,f as SmpRxjsInMemoryCache,S as smpRxjsCatchOnly,O as smpRxjsQueue,I as smpRxjsSequence,u as smpRxjsThrowIfEmpty,V as smpRxjsThrowOnCondition};
|
|
@@ -7,8 +7,8 @@ import { Observable } from 'rxjs';
|
|
|
7
7
|
* For instance, for a local cache, you may stay sync, while for a Valkey cache, you should start with the rxjs.
|
|
8
8
|
*/
|
|
9
9
|
declare abstract class SmpAbstractCacheStrategy {
|
|
10
|
-
abstract read<T =
|
|
11
|
-
abstract write<T =
|
|
10
|
+
abstract read<T = unknown>(key: string): T | undefined | Observable<T | undefined>;
|
|
11
|
+
abstract write<T = unknown>(key: string, value: T, ttl?: number): void | Observable<void>;
|
|
12
12
|
abstract remove(key: string): void | Observable<void>;
|
|
13
13
|
abstract flush(): void | Observable<void>;
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonysamperi/ts-mapi-core",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A set of shared utils to be used at BE or FE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -94,12 +94,16 @@
|
|
|
94
94
|
"check-exports": "node scripts/check-exports.js",
|
|
95
95
|
"lint": "eslint && tsc --noEmit",
|
|
96
96
|
"prepublishOnly": "npm run build && npm run check-exports",
|
|
97
|
-
"release": "npm publish",
|
|
98
|
-
"release:beta": "npm publish --tag beta",
|
|
99
|
-
"release:next": "npm publish --tag next",
|
|
97
|
+
"release": "npm publish --access public --provenance",
|
|
98
|
+
"release:beta": "npm publish --access public --tag beta --provenance",
|
|
99
|
+
"release:next": "npm publish --access public --tag next --provenance",
|
|
100
100
|
"test": "jest"
|
|
101
101
|
},
|
|
102
102
|
"author": "Tony Samperi",
|
|
103
|
+
"repository": {
|
|
104
|
+
"type": "git",
|
|
105
|
+
"url": "https://github.com/tonysamperi/ts-mapi-core"
|
|
106
|
+
},
|
|
103
107
|
"license": "ISC",
|
|
104
108
|
"peerDependencies": {
|
|
105
109
|
"@aws-sdk/client-dynamodb": "^3.758.0",
|
|
@@ -120,7 +124,7 @@
|
|
|
120
124
|
"@pollyjs/core": "^6.0.6",
|
|
121
125
|
"@pollyjs/persister-fs": "^6.0.6",
|
|
122
126
|
"@swc/core": "^1.13.2",
|
|
123
|
-
"@tonysamperi/krypto": "^1.
|
|
127
|
+
"@tonysamperi/krypto": "^1.1.0",
|
|
124
128
|
"@tonysamperi/logger": "^2.0.0",
|
|
125
129
|
"@types/babel__preset-env": "^7",
|
|
126
130
|
"@types/jest": "~29.5.14",
|
|
@@ -135,8 +139,8 @@
|
|
|
135
139
|
"firebase": "^11.4.0",
|
|
136
140
|
"glob": "^11.1.0",
|
|
137
141
|
"jest": "~29.7.0",
|
|
138
|
-
"lodash-es": "^4.17.
|
|
139
|
-
"reflect-metadata": "^0.
|
|
142
|
+
"lodash-es": "^4.17.23",
|
|
143
|
+
"reflect-metadata": "^0.2.2",
|
|
140
144
|
"replace-in-file": "^8.3.0",
|
|
141
145
|
"rxjs": "^7.5.6",
|
|
142
146
|
"setup-polly-jest": "^0.11.0",
|