@tonysamperi/ts-mapi-core 1.4.0 → 1.6.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/README.md +4 -0
- package/changelog.md +11 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +20 -14
- package/dist/cjs/services/http/index.cjs +1 -1
- package/dist/cjs/services/http/index.cjs.map +1 -1
- package/dist/cjs/services/http/index.d.cts +4 -0
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs +1 -1
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs.map +1 -1
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.d.cts +4 -1
- package/dist/cjs/services/http/smp-http.service.cjs +1 -1
- package/dist/cjs/services/http/smp-http.service.cjs.map +1 -1
- package/dist/cjs/services/index.cjs +1 -1
- package/dist/cjs/services/index.cjs.map +1 -1
- package/dist/cjs/services/index.d.cts +4 -0
- package/dist/cjs/shared/api/index.cjs +1 -1
- package/dist/cjs/shared/api/index.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-error-response-build-opts.interface.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-error-response.class.cjs +1 -1
- package/dist/cjs/shared/api/smp-error-response.class.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-error-response.class.d.cts +2 -6
- package/dist/cjs/shared/common/index.cjs.map +1 -1
- package/dist/cjs/shared/crypto/index.cjs +1 -1
- package/dist/cjs/shared/crypto/index.cjs.map +1 -1
- package/dist/cjs/shared/crypto/smp-secure-code.class.cjs +1 -1
- package/dist/cjs/shared/crypto/smp-secure-code.class.cjs.map +1 -1
- package/dist/cjs/shared/crypto/smp-secure-code.class.d.cts +5 -0
- package/dist/cjs/shared/rxjs/index.cjs +1 -1
- package/dist/cjs/shared/rxjs/index.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/index.d.cts +3 -0
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs +2 -0
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs.map +1 -0
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.d.cts +17 -0
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.d.cts +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs +2 -0
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs.map +1 -0
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.d.cts +15 -0
- package/dist/cjs/shared/utils/cache/index.cjs +1 -1
- package/dist/cjs/shared/utils/cache/index.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/index.d.cts +5 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs +2 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs.map +1 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.d.cts +10 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs +2 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs.map +1 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.d.cts +17 -0
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs +1 -1
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.d.cts +11 -8
- package/dist/cjs/shared/utils/cache/smp-cache-strategy.interface.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-cache-strategy.interface.d.cts +4 -0
- package/dist/cjs/shared/utils/{smp-gcpsid-raw.interface.cjs → cache/smp-cached-value.interface.cjs} +1 -1
- package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs.map +1 -0
- package/dist/cjs/shared/utils/cache/smp-cached-value.interface.d.cts +6 -0
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs +1 -1
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.d.cts +10 -7
- package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs +2 -0
- package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs.map +1 -0
- package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.d.cts +9 -0
- package/dist/cjs/shared/utils/index.cjs +1 -1
- package/dist/cjs/shared/utils/index.cjs.map +1 -1
- package/dist/cjs/shared/utils/index.d.cts +5 -1
- package/dist/cjs/shared/utils/smp-common-utils.class.cjs +1 -1
- package/dist/cjs/shared/utils/smp-common-utils.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/smp-common-utils.class.d.cts +2 -1
- package/dist/cjs/shared/utils/smp-sid.class.cjs +1 -1
- package/dist/cjs/shared/utils/smp-sid.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/smp-sid.class.d.cts +4 -4
- package/dist/cjs/shared/zod/index.cjs +2 -0
- package/dist/cjs/shared/zod/index.cjs.map +1 -0
- package/dist/cjs/shared/zod/index.d.cts +3 -0
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs +2 -0
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs.map +1 -0
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.d.cts +28 -0
- package/dist/esm/chunk-3AFPQCOH.js +1 -0
- package/dist/esm/{chunk-35U7P4SV.js → chunk-3XWLMKWI.js} +1 -1
- package/dist/esm/chunk-5VCNTUI6.js +1 -0
- package/dist/esm/chunk-DADFHUII.js +1 -0
- package/dist/esm/chunk-DTVHTARR.js +1 -0
- package/dist/esm/chunk-FAUAQNPB.js +1 -0
- package/dist/esm/chunk-GALYBKBP.js +1 -0
- package/dist/esm/chunk-JFKLRHIQ.js +1 -0
- package/dist/esm/{chunk-FUXO6KMS.js → chunk-MMNEY2JK.js} +1 -1
- package/dist/esm/chunk-O7TJDNO6.js +0 -0
- package/dist/esm/chunk-QPKVVZUA.js +1 -0
- package/dist/esm/chunk-QW43DOPY.js +1 -0
- package/dist/esm/{chunk-NIJJBDPY.js → chunk-V2OQU7B5.js} +1 -1
- package/dist/esm/chunk-VP72PKJQ.js +1 -0
- package/dist/esm/chunk-Z7KKB4KI.js +1 -0
- package/dist/esm/index.d.ts +11 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/services/http/index.d.ts +4 -0
- package/dist/esm/services/http/index.js +1 -1
- package/dist/esm/services/http/smp-http-session-storage-cache.class.d.ts +4 -1
- package/dist/esm/services/http/smp-http-session-storage-cache.class.js +1 -1
- package/dist/esm/services/http/smp-http.service.js +1 -1
- package/dist/esm/services/index.d.ts +4 -0
- package/dist/esm/services/index.js +1 -1
- package/dist/esm/shared/api/index.js +1 -1
- package/dist/esm/shared/api/smp-error-response.class.d.ts +2 -6
- package/dist/esm/shared/api/smp-error-response.class.js +1 -1
- package/dist/esm/shared/crypto/index.js +1 -1
- package/dist/esm/shared/crypto/smp-secure-code.class.d.ts +5 -0
- package/dist/esm/shared/crypto/smp-secure-code.class.js +1 -1
- package/dist/esm/shared/rxjs/index.d.ts +3 -0
- package/dist/esm/shared/rxjs/index.js +1 -1
- package/dist/esm/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.d.ts +17 -0
- package/dist/esm/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.js +1 -0
- package/dist/esm/shared/rxjs/smp-rxjs-catch-only.function.d.ts +1 -1
- package/dist/esm/shared/rxjs/smp-rxjs-catch-only.function.js +1 -1
- package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.d.ts +15 -0
- package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.js +1 -0
- package/dist/esm/shared/utils/cache/index.d.ts +5 -0
- package/dist/esm/shared/utils/cache/index.js +1 -1
- package/dist/esm/shared/utils/cache/smp-abstract-cache-strategy.class.d.ts +10 -0
- package/dist/esm/shared/utils/cache/smp-abstract-cache-strategy.class.js +1 -0
- package/dist/esm/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.d.ts +17 -0
- package/dist/esm/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.js +1 -0
- package/dist/esm/shared/utils/cache/smp-browser-cache.class.d.ts +11 -8
- package/dist/esm/shared/utils/cache/smp-browser-cache.class.js +1 -1
- package/dist/esm/shared/utils/cache/smp-cache-strategy.interface.d.ts +4 -0
- package/dist/esm/shared/utils/cache/smp-cached-value.interface.d.ts +6 -0
- package/dist/esm/shared/utils/cache/smp-cached-value.interface.js +1 -0
- package/dist/esm/shared/utils/cache/smp-in-memory-cache.class.d.ts +10 -7
- package/dist/esm/shared/utils/cache/smp-in-memory-cache.class.js +1 -1
- package/dist/esm/shared/utils/cache/smp-is-smp-cached-value.function.d.ts +9 -0
- package/dist/esm/shared/utils/cache/smp-is-smp-cached-value.function.js +1 -0
- package/dist/esm/shared/utils/index.d.ts +5 -1
- package/dist/esm/shared/utils/index.js +1 -1
- package/dist/esm/shared/utils/smp-common-utils.class.d.ts +2 -1
- package/dist/esm/shared/utils/smp-common-utils.class.js +1 -1
- package/dist/esm/shared/utils/smp-sid.class.d.ts +4 -4
- package/dist/esm/shared/utils/smp-sid.class.js +1 -1
- package/dist/esm/shared/zod/index.d.ts +3 -0
- package/dist/esm/shared/zod/index.js +1 -0
- package/dist/esm/shared/zod/smp-zod-date-time.definition.d.ts +28 -0
- package/dist/esm/shared/zod/smp-zod-date-time.definition.js +1 -0
- package/package.json +6 -4
- package/dist/cjs/shared/utils/smp-gcpsid-raw.interface.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-gcpsid-raw.interface.d.cts +0 -6
- package/dist/esm/chunk-CZTKNLYX.js +0 -1
- package/dist/esm/chunk-LDLBKVKD.js +0 -1
- package/dist/esm/chunk-OM2B3B4I.js +0 -1
- package/dist/esm/chunk-OXO327UX.js +0 -1
- package/dist/esm/chunk-QMTVV3AM.js +0 -1
- package/dist/esm/chunk-RZ4YI35O.js +0 -1
- package/dist/esm/shared/utils/smp-gcpsid-raw.interface.d.ts +0 -6
- /package/dist/esm/{chunk-L6UZLRQU.js → chunk-6MJDU4CZ.js} +0 -0
- /package/dist/esm/{chunk-THUEL7AA.js → chunk-B3OEBKFG.js} +0 -0
- /package/dist/esm/{shared/utils/smp-gcpsid-raw.interface.js → chunk-EB55SS67.js} +0 -0
package/README.md
CHANGED
|
@@ -15,3 +15,7 @@ To release a beta version, just push a beta tag, e.g. `3.0.0-beta.0`
|
|
|
15
15
|
|
|
16
16
|
## Release a production version ⚠️
|
|
17
17
|
To release a production version you just need to push a tag
|
|
18
|
+
|
|
19
|
+
<!--
|
|
20
|
+
`(?:import|export)\s+(?:[^'"]+?\s+from\s+|\*\s+from\s+)?["'](\.\/[^'"]*?)(?<!\.js)["']`
|
|
21
|
+
-->
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 1.6.0
|
|
2
|
+
* Make arg optional in KikErrorResponse.create, to create a generic error by simply calling KikErrorResponse.create()
|
|
3
|
+
* Add rxjs implementations of cache
|
|
4
|
+
|
|
5
|
+
## 1.5.0
|
|
6
|
+
* Fixed smpRxjsCatchOnly catching derived classes
|
|
7
|
+
* Improved dramatically smpZodDateTime that now works like a native definition with concatenation
|
|
8
|
+
* Improved cache utils to support TTL (in seconds)
|
|
9
|
+
* Added SmpCachedValue (removed SmpSidRaw)
|
|
10
|
+
* Added more automatic tests
|
|
11
|
+
|
|
1
12
|
## 1.4.0
|
|
2
13
|
* Breaking change: SmpFirebaseService.instance now is SmpFirebaseService.INSTANCE
|
|
3
14
|
* Improved build to emit decorators
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Ie=Object.defineProperty;var Vr=Object.getOwnPropertyDescriptor;var qr=Object.getOwnPropertyNames;var Xr=Object.prototype.hasOwnProperty;var a=(i,e)=>Ie(i,"name",{value:e,configurable:!0});var E=(i,e)=>()=>(i&&(e=i(i=0)),e);var Be=(i,e)=>{for(var t in e)Ie(i,t,{get:e[t],enumerable:!0})},Zr=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qr(e))!Xr.call(i,s)&&s!==t&&Ie(i,s,{get:()=>e[s],enumerable:!(r=Vr(e,s))||r.enumerable});return i};var se=i=>Zr(Ie({},"__esModule",{value:!0}),i);var Dt,kt=E(()=>{"use strict";Dt=class{static{a(this,"SmpSessionManagerService")}get sessionId(){return this._sessionId||this._storage.getItem(this._sessionIdKey)||void 0}constructor(e="lggr_sid"){this._sessionIdKey=e,this._storage=this._getStorage(),this._sessionId=this.sessionId||this._generateSessionId()}_generateSessionId(){let e=this._generateUUID();return this._storage.setItem(this._sessionIdKey,e),e}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}_getStorage(){try{if(typeof window<"u"&&typeof window.sessionStorage==typeof isNaN)return sessionStorage}catch(e){console.warn(`${this.constructor.name}: error while checking sessionStorage`,e)}return{getItem:a(()=>null,"getItem"),setItem:a(()=>null,"setItem"),removeItem:a(()=>null,"removeItem"),clear:a(()=>null,"clear")}}}});var U,et=E(()=>{"use strict";(function(i){i[i.OFF=0]="OFF",i[i.ERROR=1]="ERROR",i[i.WARN=2]="WARN",i[i.INFO=3]="INFO",i[i.LOG=4]="LOG",i[i.DEBUG=5]="DEBUG"})(U||(U={}))});function O(){}var Ce=E(()=>{"use strict";a(O,"smpNoop")});var Hr,K,tt=E(()=>{"use strict";Ce();Hr=class{static{a(this,"SmpConsoleOnlyMethods")}constructor(){this.group=O,this.groupCollapsed=O,this.groupEnd=O,this.time=O,this.timeEnd=O}},K=class Ut extends Hr{static{a(this,"SmpLoggerMethods")}constructor(){super(...arguments),this.debug=O,this.error=O,this.info=O,this.log=O,this.warn=O}static describe(){return Object.getOwnPropertyNames(new Ut).map(e=>e)}}});var Tt,ve,Pe,Mt=E(()=>{"use strict";kt();et();tt();Ce();ve="[DEFAULT]",Pe=class extends K{static{a(this,"SmpLoggerService")}static get INSTANCE(){return this.get(ve)}static get INSTANCES(){return this._instances.keys()}static get NOOP_INSTANCE(){return this._noopInstance}get activeLevels(){return Object.values(U).filter(e=>+e>U.OFF&&+e<=this.level).map(e=>U[e])}get appName(){return this._appName}get currentConfig(){return{level:this.level,enableSessionId:this.enableSessionId,enablePreprocessing:this.enablePreprocessing,sensitiveProps:this._sensitiveProps}}get enablePreprocessing(){return this.preprocessArgs!==this._noopPreprocessArgs}get enableSessionId(){return!!this.sessionId}get level(){return this.constructor._level}get sessionId(){return this._sessionId}constructor(e){super(),this._sensitivePropMask="*****",this._sessionManager=new Dt,this._loadConfig(e)}static destroy(e){return this._instances.delete(e)}static get(e=ve){return this._instances.get(e)||this._instances.get(ve)||this._noopInstance}static init(e,t=ve){let r;if(this._instances.has(t)){r=this.get(t);let s=r.currentConfig;r._loadConfig(Object.assign(Object.assign({},s),e))}else this._instances.set(t,new this(e)),r=this.get(t),r._appName=t;return r}static pop(e){let t=this.get(e);return this.destroy(e),t}destroy(){return this.constructor.destroy(this.appName)}filterSensitiveData(e){if(e===null||typeof e!="object"||Array.isArray(e)||e.constructor!==Object)return e;let t={};for(let r in e){let s=e[r];if(!Object.prototype.hasOwnProperty.call(e,r)||s===null||s===void 0){t[r]=s;continue}if(this._sensitiveProps.includes(r)){t[r]=this._sensitivePropMask;continue}t[r]=this.filterSensitiveData(s)}return t}preprocessArgs(e,...t){return this._defaultPreprocessArgs.apply(this,[e,...t])}_defaultPreprocessArgs(e,...t){let r=new Date;return[`${r.toISOString()}`,`${t.shift()}`.trim(),...t.map(s=>({tags:[this._appName,`level-${U[this.level]}`,e],timestamp:+r,sessionId:this.sessionId,metadata:this.filterSensitiveData(s)}))]}_loadConfig({sensitiveProps:e=[],level:t=U.OFF,enablePreprocessing:r=!1,enableSessionId:s=!1}){this._sensitiveProps=[...e,"pwd","password","buffer","token","accessToken","refreshToken"],this.preprocessArgs=r?this.preprocessArgs:this._noopPreprocessArgs,this._sessionId=s?this._sessionManager.sessionId:void 0,this._updateLevel(t)}_noopPreprocessArgs(...e){return e}_setup(e){let t=this.preprocessArgs.bind(this);this.activeLevels.forEach(r=>{let s=`${r}`.toLowerCase();typeof e[s]==typeof isNaN&&(this[s]=function(...o){e[s].apply(e,t.apply(null,[s,...o]))})}),this.level>U.OFF&&console&&(console.group&&console.groupEnd&&(this.group=console.group.bind(console),this.groupEnd=console.groupEnd.bind(console)),console.groupCollapsed&&(this.groupCollapsed=console.groupCollapsed.bind(console)),console.time&&console.timeEnd&&(this.time=console.time.bind(console),this.timeEnd=console.timeEnd.bind(console)))}_updateLevel(e=U.WARN){this.constructor.describe().forEach(t=>{this[t]=O}),this.constructor._level=e,console&&this._setup(console)}};Tt=Pe;Pe._instances=new Map;Pe._level=U.OFF;Pe._noopInstance=new Tt({level:U.OFF})});var jt=E(()=>{"use strict"});var Lt=E(()=>{"use strict"});var zt=E(()=>{"use strict";jt();Lt();tt();et();Ce()});var _e=E(()=>{"use strict";Mt();zt()});var V,Gt=E(()=>{"use strict";V=function(i){return i.APPLE="APPLE",i.FACEBOOK="FACEBOOK",i.GOOGLE="GOOGLE",i}({})});var oe,St=E(()=>{"use strict";oe=function(i){return i.POPUP="POPUP",i.REDIRECT="REDIRECT",i}({})});var xe,ar=E(()=>{"use strict";xe=function(i){return i.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",i.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",i.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",i.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",i.EMAIL_EXISTS="auth/email-already-exists",i.INVALID_ACTION_CODE="auth/invalid-action-code",i.POPUP_BLOCKED="auth/popup-blocked",i.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",i.USER_NOT_FOUND="auth/user-not-found",i.WRONG_PASSWORD="auth/wrong-password",i}({})});function Cr(i,e){return t=>t.pipe((0,Ve.catchError)(r=>r instanceof i?e(r):(0,Ve.throwError)(()=>r)))}var Ve,vr=E(()=>{"use strict";Ve=require("rxjs");a(Cr,"smpRxjsCatchOnly")});function qe(i=Cs){return e=>e.pipe((0,Pr.map)(t=>{if(~Bs.indexOf(JSON.stringify(t)))throw i(t);return t}))}var Pr,Bs,Cs,At=E(()=>{"use strict";Pr=require("rxjs");a(qe,"smpRxjsThrowIfEmpty");Bs=[void 0,null,!1,0,"","0",[],{}].map(i=>JSON.stringify(i)),Cs=a(()=>new Error,"defaultErrorFactory")});function Nr(i,e){return t=>t.pipe((0,Xe.filter)(r=>!i(r)),(0,Xe.defaultIfEmpty)(!1),qe(e))}var Xe,Fr=E(()=>{"use strict";Xe=require("rxjs");At();a(Nr,"smpRxjsThrowOnCondition")});var Ze={};Be(Ze,{smpRxjsCatchOnly:()=>Cr,smpRxjsThrowIfEmpty:()=>qe,smpRxjsThrowOnCondition:()=>Nr});var He=E(()=>{"use strict";vr();At();Fr()});var kr={};Be(kr,{SmpDynamoService:()=>Ot});var Dr,Ye,Je,Ot,Ur=E(()=>{"use strict";Dr=require("@aws-sdk/client-dynamodb"),Ye=require("@aws-sdk/util-dynamodb");_e();Je=function(i){return i.CouldNotDelete="ERR_COULD_NOT_DELETE",i.CouldNotRead="ERR_COULD_NOT_READ",i.CouldNotWrite="ERR_COULD_NOT_WRITE",i.ConditionalCheckFailedException="ERR_DUPE_TOKEN",i}(Je||{}),Ot=class{static{a(this,"SmpDynamoService")}_config;_tableName;get marshall(){return Ye.marshall}get unmarshall(){return Ye.unmarshall}_db;_logger;constructor(e,t){this._config=e,this._tableName=t,this._db=new Dr.DynamoDB([this._buildConfig()]),this._logger=new K}_buildConfig(){return this._config}_delete(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.deleteItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_DELETE")))}_read(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.getItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_READ")))}_write(e,t=this._tableName,r){let s={TableName:t,Item:this.marshall(e),...r};return this._db.putItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_WRITE")))}}});var Tr={};Be(Tr,{SmpFirebaseService:()=>bt});var be,u,bt,Mr=E(()=>{"use strict";_e();be=require("firebase/app"),u=require("firebase/auth");Gt();St();ar();bt=class i{static{a(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof i))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":V.FACEBOOK,"google.com":V.GOOGLE,"apple.com":V.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return(0,u.getAuth)(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=oe.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||oe.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new K,this._app=(0,be.getApps)().length?(0,be.getApps)()[0]:(0,be.initializeApp)(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new i(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return(0,u.checkActionCode)(this._auth,e)}confirmPasswordReset(e,t){return(0,u.confirmPasswordReset)(this._auth,e,t)}fetchSignInMethodsForEmail(e){return(0,u.fetchSignInMethodsForEmail)(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return(0,u.getRedirectResult)(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.sendEmailVerification)(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return(0,u.sendPasswordResetEmail)(this._auth,e,{url:t})}setPersistence(e){return(0,u.setPersistence)(this._auth,e?u.browserLocalPersistence:u.browserSessionPersistence)}signInWithCustomToken(e){return(0,u.signInWithCustomToken)(this._auth,e)}signInWithEmailAndPassword(e,t){return(0,u.signInWithEmailAndPassword)(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return(0,u.signOut)(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=u.EmailAuthProvider.credential(this.loggedUser.email,e);return(0,u.reauthenticateWithCredential)(this.loggedUser,r).then(()=>(0,u.updatePassword)(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.updateProfile)(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[V.APPLE]:new u.OAuthProvider("apple.com"),[V.FACEBOOK]:new u.FacebookAuthProvider().setCustomParameters({prompt:"select_account"}),[V.GOOGLE]:new u.GoogleAuthProvider().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===xe.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=xe["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:a(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===oe.POPUP?u.signInWithPopup:u.signInWithRedirect)(this._auth,e).then(s=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),s.user)).catch(async s=>s?.code===xe.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,oe.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,s),await this._expandDifferentCredential(s),Promise.reject(s)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}}});var Ps={};Be(Ps,{SMP_HEALTHZ:()=>Qr,SmpAesCrypt:()=>de,SmpApiCommonUtils:()=>rt,SmpBrowserCache:()=>Re,SmpCommonUtils:()=>mt,SmpCrypto:()=>$e,SmpErrorResponse:()=>j,SmpFilterException:()=>wt,SmpFirebaseErrors:()=>xe,SmpGenericResponse:()=>ie,SmpGiftcardTransaction:()=>Se,SmpGiftcardTransactionHashStrategies:()=>ee,SmpGiftcardTransactionOps:()=>C,SmpHttpService:()=>Rt,SmpHttpSessionStorageCache:()=>Oe,SmpHttpStatusCodes:()=>_t,SmpInMemoryCache:()=>Ae,SmpMarketingCloudValidators:()=>ss,SmpRegularExpressions:()=>Et,SmpResponseMessage:()=>N,SmpResponseMessageTypes:()=>G,SmpRestVerbs:()=>ot,SmpSecureCode:()=>Ke,SmpSid:()=>xt,SmpSocialSignInKeys:()=>V,SmpSocialSignInUxModes:()=>oe,VERSION:()=>vs,smpNoop:()=>O});module.exports=se(Ps);_e();var rt=class{static{a(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new K;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(e,t){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}static fromBearer(e=""){return e.split(" ")[1]}static getCountryFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[1]}static getLocaleFromReferer(e){return e?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(e,t){try{return e.replace(this._pathParamRegex,(r,s)=>{let o=t[s];return o!==void 0?encodeURIComponent(o):r})}catch(r){this._logger.warn("KikApiCommonUtils: couldn't interpolate params",r)}return e}};var me=require("class-transformer");var S=require("class-transformer");var st=require("class-transformer");var G=function(i){return i.INFO="INFO",i.SUCCESS="SUCCESS",i.WARNING="WARNING",i.ERROR="ERROR",i}({});function Wt(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var h=i.length-1;h>=0;h--)(n=i[h])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}a(Wt,"_ts_decorate");function Ne(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}a(Ne,"_ts_metadata");var N=class i{static{a(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=G.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new i(e)]:[]:[e].flat().map(t=>typeof t=="string"?new i(t):t)}};Wt([(0,st.Expose)(),Ne("design:type",String),Ne("design:paramtypes",[])],N.prototype,"message",null);Wt([(0,st.Expose)(),Ne("design:type",typeof G>"u"?Object:G),Ne("design:paramtypes",[])],N.prototype,"type",null);function Jr(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var h=i.length-1;h>=0;h--)(n=i[h])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}a(Jr,"_ts_decorate");function $t(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}a($t,"_ts_metadata");var ie=class i{static{a(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=N.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],t){this._messages=e,this.data=t}static buildInfo(e,t){return new i([e].flat().map(r=>new N(r,G.INFO)),t)}static buildSuccess(e,t){return new i([e].flat().map(r=>new N(r,G.SUCCESS)),t)}static fromPlain(e){return(0,S.plainToInstance)(i,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return(0,S.instanceToPlain)(this,{excludePrefixes:["_"]})}};Jr([(0,S.Expose)(),(0,S.Transform)(({value:i})=>i?.length?i:void 0),$t("design:type",Object),$t("design:paramtypes",[])],ie.prototype,"messages",null);function Kt(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var h=i.length-1;h>=0;h--)(n=i[h])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}a(Kt,"_ts_decorate");function Fe(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}a(Fe,"_ts_metadata");function it(){return[new N("GENERIC_ERROR")]}a(it,"getDefaultMessages");var j=class i extends ie{static{a(this,"SmpErrorResponse")}_errorCode;_status;get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp;constructor(e=it(),t="GENERIC_ERROR",r=500,s){super(e,s),this._errorCode=t,this._status=r,this._timestamp=Date.now()}static build(e=it(),t,r,s){return new i(N.sanitizeMessages(e),t,r,s)}static create({messages:e=it(),...t}){return new i(N.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=(0,me.plainToInstance)(Yr,e,{excludePrefixes:["_"]}),r=new i;return Object.getOwnPropertyNames(t).forEach(s=>{s in r&&(r[s]=t[s])}),r}};Kt([(0,me.Expose)(),Fe("design:type",Object),Fe("design:paramtypes",[])],j.prototype,"errorCode",null);Kt([(0,me.Expose)(),Fe("design:type",Number),Fe("design:paramtypes",[])],j.prototype,"timestamp",null);var Yr=class extends j{static{a(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};var Qr={status:"OK"};var ot=function(i){return i.GET="GET",i.POST="POST",i.PUT="PUT",i.DELETE="DELETE",i.PATCH="PATCH",i}({});var q=class{static{a(this,"Hex")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s+=2)r[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new m(r,t/2)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push((s>>>4).toString(16)),t.push((s&15).toString(16))}return t.join("")}};var m=class nt{static{a(this,"WordArray")}constructor(e,t){this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=this.words.length*4}static random(e){let t=[],r=a(function(s){let o=987654321,n=4294967295;return function(){o=36969*(o&65535)+(o>>16)&n,s=18e3*(s&65535)+(s>>16)&n;let h=(o<<16)+s&n;return h/=4294967296,h+=.5,h*(Math.random()>.5?1:-1)}},"r");for(let s=0,o;s<e;s+=4){let n=r((o||Math.random())*4294967296);o=n()*987654071,t.push(n()*4294967296|0)}return new nt(t,e)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new nt(this.words.slice(0),this.sigBytes)}concat(e){if(this.clamp(),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let r=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];return this.sigBytes+=e.sigBytes,this}toString(e){return(e||q).stringify(this)}};var De=class{static{a(this,"Latin1")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s++)r[s>>>2]|=(e.charCodeAt(s)&255)<<24-s%4*8;return new m(r,t)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push(String.fromCharCode(s))}return t.join("")}};var b=class{static{a(this,"Utf8")}static parse(e){return De.parse(unescape(encodeURIComponent(e)))}static stringify(e){try{return decodeURIComponent(escape(De.stringify(e)))}catch(t){throw console.error("Malformed UTF-8 data",t),new Error("Malformed UTF-8 data")}}};var ke=class{static{a(this,"BufferedBlockAlgorithm")}constructor(e){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},e),this._data=new m,this._nDataBytes=0}clone(){let e=this.constructor();for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e._data=this._data.clone(),e}reset(){this._data=new m,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=b.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let t=this.cfg.blockSize*4,r=this._data.sigBytes/t;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);let s=r*this.cfg.blockSize,o=Math.min(s*4,this._data.sigBytes),n;if(s){for(let h=0;h<s;h+=this.cfg.blockSize)this._doProcessBlock(this._data.words,h);n=this._data.words.splice(0,s),this._data.sigBytes-=o}return new m(n,o)}};var ne=class{static{a(this,"CipherParams")}constructor(e){this.ciphertext=e.ciphertext,this.key=e.key,this.iv=e.iv,this.salt=e.salt,this.algorithm=e.algorithm,this.mode=e.mode,this.padding=e.padding,this.blockSize=e.blockSize,this.formatter=e.formatter}extend(e){return e.ciphertext!==void 0&&(this.ciphertext=e.ciphertext),e.key!==void 0&&(this.key=e.key),e.iv!==void 0&&(this.iv=e.iv),e.salt!==void 0&&(this.salt=e.salt),e.algorithm!==void 0&&(this.algorithm=e.algorithm),e.mode!==void 0&&(this.mode=e.mode),e.padding!==void 0&&(this.padding=e.padding),e.blockSize!==void 0&&(this.blockSize=e.blockSize),e.formatter!==void 0&&(this.formatter=e.formatter),this}toString(e){if(e)return e.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 z=class{static{a(this,"Base64")}static parse(e){let t=e.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 r=this._map.charAt(64);if(r){let s=e.indexOf(r);s!==-1&&(t=s)}return this.parseLoop(e,t,this._reverseMap)}static parseLoop(e,t,r){let s=[],o=0;for(let n=0;n<t;n++)if(n%4){let h=r[e.charCodeAt(n-1)]<<n%4*2,c=r[e.charCodeAt(n)]>>>6-n%4*2;s[o>>>2]|=(h|c)<<24-o%4*8,o++}return new m(s,o)}static stringify(e){e.clamp();let t=[];for(let s=0;s<e.sigBytes;s+=3){let o=e.words[s>>>2]>>>24-s%4*8&255,n=e.words[s+1>>>2]>>>24-(s+1)%4*8&255,h=e.words[s+2>>>2]>>>24-(s+2)%4*8&255,c=o<<16|n<<8|h;for(let p=0;p<4&&s+p*.75<e.sigBytes;p++)t.push(this._map.charAt(c>>>6*(3-p)&63))}let r=this._map.charAt(64);if(r)for(;t.length%4;)t.push(r);return t.join("")}};z._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";z._reverseMap=void 0;var Ue=class{static{a(this,"OpenSSL")}static parse(e){let t=z.parse(e),r;return t.words[0]===1398893684&&t.words[1]===1701076831&&(r=new m(t.words.slice(2,4)),t.words.splice(0,4),t.sigBytes-=16),new ne({ciphertext:t,salt:r})}static stringify(e){if(!e.ciphertext)throw new Error("missing ciphertext in params");let t=e.ciphertext,r=e.salt,s;if(r){if(typeof r=="string")throw new Error("salt is expected to be a WordArray");s=new m([1398893684,1701076831]).concat(r).concat(t)}else s=t;return s.toString(z)}};var Z=class{static{a(this,"SerializableCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(!o.format)throw new Error("could not determine format");if(t=this._parse(t,o.format),!t.ciphertext)throw new Error("could not determine ciphertext");return e.createDecryptor(r,o).finalize(t.ciphertext)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s),n=e.createEncryptor(r,o),h=n.finalize(t);return new ne({ciphertext:h,key:r,iv:n.cfg.iv,algorithm:e,mode:n.cfg.mode,padding:n.cfg.padding,blockSize:n.cfg.blockSize,formatter:o.format})}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};Z.cfg={blockSize:4,iv:new m([]),format:Ue};var A=class extends ke{static{a(this,"Hasher")}constructor(e){super(Object.assign({blockSize:512/32},e)),this.reset()}static _createHelper(e){function t(r,s){return new e(s).finalize(r)}return a(t,"helper"),t}finalize(e){return e&&this._append(e),this._doFinalize()}update(e){return this._append(e),this._process(),this}};var d=[];for(let i=0;i<64;i++)d[i]=Math.abs(Math.sin(i+1))*4294967296|0;var W=class f extends A{static{a(this,"MD5")}get hash(){return this._hash}static FF(e,t,r,s,o,n,h){let c=e+(t&r|~t&s)+o+h;return(c<<n|c>>>32-n)+t}static GG(e,t,r,s,o,n,h){let c=e+(t&s|r&~s)+o+h;return(c<<n|c>>>32-n)+t}static HH(e,t,r,s,o,n,h){let c=e+(t^r^s)+o+h;return(c<<n|c>>>32-n)+t}static II(e,t,r,s,o,n,h){let c=e+(r^(t|~s))+o+h;return(c<<n|c>>>32-n)+t}reset(){super.reset(),this._hash=new m([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;this._data.words[t>>>5]|=128<<24-t%32;let r=Math.floor(e/4294967296),s=e;this._data.words[(t+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,this._data.words[(t+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 o=0;o<4;o++)this._hash.words[o]=(this._hash.words[o]<<8|this._hash.words[o]>>>24)&16711935|(this._hash.words[o]<<24|this._hash.words[o]>>>8)&4278255360;return this._hash}_doProcessBlock(e,t){for(let c=0;c<16;c++){let p=t+c,_=e[p];e[p]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}let r=Array.from({length:16});for(let c=0;c<16;c++)r[c]=e[t+c];let s=this._hash.words[0],o=this._hash.words[1],n=this._hash.words[2],h=this._hash.words[3];s=f.FF(s,o,n,h,r[0],7,d[0]),h=f.FF(h,s,o,n,r[1],12,d[1]),n=f.FF(n,h,s,o,r[2],17,d[2]),o=f.FF(o,n,h,s,r[3],22,d[3]),s=f.FF(s,o,n,h,r[4],7,d[4]),h=f.FF(h,s,o,n,r[5],12,d[5]),n=f.FF(n,h,s,o,r[6],17,d[6]),o=f.FF(o,n,h,s,r[7],22,d[7]),s=f.FF(s,o,n,h,r[8],7,d[8]),h=f.FF(h,s,o,n,r[9],12,d[9]),n=f.FF(n,h,s,o,r[10],17,d[10]),o=f.FF(o,n,h,s,r[11],22,d[11]),s=f.FF(s,o,n,h,r[12],7,d[12]),h=f.FF(h,s,o,n,r[13],12,d[13]),n=f.FF(n,h,s,o,r[14],17,d[14]),o=f.FF(o,n,h,s,r[15],22,d[15]),s=f.GG(s,o,n,h,r[1],5,d[16]),h=f.GG(h,s,o,n,r[6],9,d[17]),n=f.GG(n,h,s,o,r[11],14,d[18]),o=f.GG(o,n,h,s,r[0],20,d[19]),s=f.GG(s,o,n,h,r[5],5,d[20]),h=f.GG(h,s,o,n,r[10],9,d[21]),n=f.GG(n,h,s,o,r[15],14,d[22]),o=f.GG(o,n,h,s,r[4],20,d[23]),s=f.GG(s,o,n,h,r[9],5,d[24]),h=f.GG(h,s,o,n,r[14],9,d[25]),n=f.GG(n,h,s,o,r[3],14,d[26]),o=f.GG(o,n,h,s,r[8],20,d[27]),s=f.GG(s,o,n,h,r[13],5,d[28]),h=f.GG(h,s,o,n,r[2],9,d[29]),n=f.GG(n,h,s,o,r[7],14,d[30]),o=f.GG(o,n,h,s,r[12],20,d[31]),s=f.HH(s,o,n,h,r[5],4,d[32]),h=f.HH(h,s,o,n,r[8],11,d[33]),n=f.HH(n,h,s,o,r[11],16,d[34]),o=f.HH(o,n,h,s,r[14],23,d[35]),s=f.HH(s,o,n,h,r[1],4,d[36]),h=f.HH(h,s,o,n,r[4],11,d[37]),n=f.HH(n,h,s,o,r[7],16,d[38]),o=f.HH(o,n,h,s,r[10],23,d[39]),s=f.HH(s,o,n,h,r[13],4,d[40]),h=f.HH(h,s,o,n,r[0],11,d[41]),n=f.HH(n,h,s,o,r[3],16,d[42]),o=f.HH(o,n,h,s,r[6],23,d[43]),s=f.HH(s,o,n,h,r[9],4,d[44]),h=f.HH(h,s,o,n,r[12],11,d[45]),n=f.HH(n,h,s,o,r[15],16,d[46]),o=f.HH(o,n,h,s,r[2],23,d[47]),s=f.II(s,o,n,h,r[0],6,d[48]),h=f.II(h,s,o,n,r[7],10,d[49]),n=f.II(n,h,s,o,r[14],15,d[50]),o=f.II(o,n,h,s,r[5],21,d[51]),s=f.II(s,o,n,h,r[12],6,d[52]),h=f.II(h,s,o,n,r[3],10,d[53]),n=f.II(n,h,s,o,r[10],15,d[54]),o=f.II(o,n,h,s,r[1],21,d[55]),s=f.II(s,o,n,h,r[8],6,d[56]),h=f.II(h,s,o,n,r[15],10,d[57]),n=f.II(n,h,s,o,r[6],15,d[58]),o=f.II(o,n,h,s,r[13],21,d[59]),s=f.II(s,o,n,h,r[4],6,d[60]),h=f.II(h,s,o,n,r[11],10,d[61]),n=f.II(n,h,s,o,r[2],15,d[62]),o=f.II(o,n,h,s,r[9],21,d[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+n|0,this._hash.words[3]=this._hash.words[3]+h|0}};var ht=class Vt{static{a(this,"EVPKDF")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:W,iterations:1},e)}static execute(e,t,r){return new Vt(r).compute(e,t)}compute(e,t){let r=new this.cfg.hasher,s=new m,o;for(;s.words.length<this.cfg.keySize;){o&&r.update(o),o=r.update(e).finalize(t),r.reset();for(let n=1;n<this.cfg.iterations;n++)o=r.finalize(o),r.reset();s.concat(o)}return s.sigBytes=this.cfg.keySize*4,s}};var qt=class{static{a(this,"OpenSSLKdf")}static execute(e,t,r,s){s||(s=m.random(64/8));let o=new ht({keySize:t+r}).compute(e,s),n=new m(o.words.slice(t),r*4);return o.sigBytes=t*4,new ne({key:o,iv:n,salt:s})}};var Te=class{static{a(this,"PasswordBasedCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.format===void 0)throw new Error("missing format in config");if(t=this._parse(t,o.format),o.kdf===void 0)throw new Error("the key derivation function must be set");let n=o.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv!==void 0&&(o.iv=n.iv),Z.decrypt.call(this,e,t,n.key,o)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.kdf===void 0)throw new Error("missing kdf in config");let n=o.kdf.execute(r,e.keySize,e.ivSize);return n.iv!==void 0&&(o.iv=n.iv),Z.encrypt.call(this,e,t,n.key,o).extend(n)}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};Te.cfg={blockSize:4,iv:new m([]),format:Ue,kdf:qt};var Xt=class{static{a(this,"CipherHelper")}constructor(e){this._cipher=e}decrypt(e,t,r){return typeof t=="string"?Te.decrypt(this._cipher,e,t,r):Z.decrypt(this._cipher,e,t,r)}encrypt(e,t,r){return typeof t=="string"?Te.encrypt(this._cipher,e,t,r):Z.encrypt(this._cipher,e,t,r)}};var he=class extends ke{static{a(this,"Cipher")}constructor(e,t,r){super(Object.assign({blockSize:1},r)),this._xformMode=e,this._key=t,this.reset()}static _createHelper(e){return new Xt(e)}static createDecryptor(e,t){let r=this;return new r(this._DEC_XFORM_MODE,e,t)}static createEncryptor(e,t){return new this(this._ENC_XFORM_MODE,e,t)}finalize(e){return e&&this._append(e),this._doFinalize()}process(e){return this._append(e),this._process()}};he.ivSize=4;he.keySize=4;he._DEC_XFORM_MODE=2;he._ENC_XFORM_MODE=1;var H=class{static{a(this,"BlockCipherModeAlgorithm")}constructor(e,t){this.init(e,t)}init(e,t){this._cipher=e,this._iv=t}};var Me=class{static{a(this,"BlockCipherMode")}static createDecryptor(e,t){let r=this.Decryptor;return new r(e,t)}static createEncryptor(e,t){let r=this.Encryptor;return new r(e,t)}};Me.Decryptor=H;Me.Encryptor=H;var Zt=class extends H{static{a(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(e,t,this._cipher.cfg.blockSize),this._cipher.encryptBlock(e,t),this._prevBlock=e.slice(t,t+this._cipher.cfg.blockSize)}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var Ht=class extends H{static{a(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let r=e.slice(t,t+this._cipher.cfg.blockSize);this._cipher.decryptBlock(e,t),this.xorBlock(e,t,this._cipher.cfg.blockSize),this._prevBlock=r}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var X=class extends Me{static{a(this,"CBC")}};X.Decryptor=Ht;X.Encryptor=Zt;var ae=class{static{a(this,"PKCS7")}static pad(e,t){let r=t*4,s=r-e.sigBytes%r,o=s<<24|s<<16|s<<8|s,n=[];for(let c=0;c<s;c+=4)n.push(o);let h=new m(n,s);e.concat(h)}static unpad(e){let t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};var je=class extends he{static{a(this,"BlockCipher")}constructor(e,t,r){super(e,t,Object.assign({blockSize:4,mode:X,padding:ae},r))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let e;this._xformMode===this.constructor._ENC_XFORM_MODE?e=this.cfg.mode.createEncryptor:(e=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===e?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=e.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=e)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let e;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),e=this._process(!0)}else e=this._process(!0),this.cfg.padding.unpad(e);return e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}};var l=class L{static{a(this,"X64Word")}constructor(e,t){this.high=e,this.low=t}add(e){let t=this.low+e.low|0,r=t>>>0<this.low>>>0?1:0,s=this.high+e.high+r|0;return new L(s,t)}and(e){return new L(this.high&e.high,this.low&e.low)}not(){return new L(~this.high,~this.low)}or(e){return new L(this.high|e.high,this.low|e.low)}rotL(e){return this.shiftL(e).or(this.shiftR(64-e))}rotR(e){return this.shiftR(e).or(this.shiftL(64-e))}shiftL(e){return e<32?new L(this.high<<e|this.low>>>32-e,this.low<<e):new L(this.low<<e-32,0)}shiftR(e){return e<32?new L(this.high>>>e,this.low>>>e|this.high<<32-e):new L(0,this.high>>>e-32)}xor(e){return new L(this.high^e.high,this.low^e.low)}};var Jt=class at{static{a(this,"X64WordArray")}constructor(e=[],t){this.words=e,this.sigBytes=t!==void 0?t:e.length*8}static create(e=[],t){return new at(e,t)}clone(){let e=this.words.map(t=>new l(t.high,t.low));return new at(e,this.sigBytes)}toX32(){let e=[];for(let t of this.words)e.push(t.high,t.low);return new m(e,this.sigBytes)}};var B=[],Yt=[],Qt=[],er=[],tr=[],rr=[],ct=[],lt=[],dt=[],ft=[];(function(){let i=[];for(let r=0;r<256;r++)r<128?i[r]=r<<1:i[r]=r<<1^283;let e=0,t=0;for(let r=0;r<256;r++){let s=t^t<<1^t<<2^t<<3^t<<4;s=s>>>8^s&255^99,B[e]=s,Yt[s]=e;let o=i[e],n=i[o],h=i[n],c=i[s]*257^s*16843008;Qt[e]=c<<24|c>>>8,er[e]=c<<16|c>>>16,tr[e]=c<<8|c>>>24,rr[e]=c,c=h*16843009^n*65537^o*257^e*16843008,ct[s]=c<<24|c>>>8,lt[s]=c<<16|c>>>16,dt[s]=c<<8|c>>>24,ft[s]=c,e?(e=o^i[i[i[h^o]]],t^=i[i[t]]):e=t=1}})();var es=[0,1,2,4,8,16,32,64,128,27,54],Le=class extends je{static{a(this,"AES")}constructor(e,t,r){super(e,t,r),super.reset()}decryptBlock(e,t){let r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,ct,lt,dt,ft,Yt),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,Qt,er,tr,rr,B)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[];for(let h=0;h<o;h++)if(h<r)n[h]=t[h];else{let c=n[h-1];h%r?r>6&&h%r===4&&(c=B[c>>>24]<<24|B[c>>>16&255]<<16|B[c>>>8&255]<<8|B[c&255]):(c=c<<8|c>>>24,c=B[c>>>24]<<24|B[c>>>16&255]<<16|B[c>>>8&255]<<8|B[c&255],c^=es[h/r|0]<<24),n[h]=n[h-r]^c}this._invKeySchedule=[];for(let h=0;h<o;h++){let c=o-h,p;h%4?p=n[c]:p=n[c-4],h<4||c<=4?this._invKeySchedule[h]=p:this._invKeySchedule[h]=ct[B[p>>>24]]^lt[B[p>>>16&255]]^dt[B[p>>>8&255]]^ft[B[p&255]]}}_doCryptBlock(e,t,r,s,o,n,h,c){let p=e[t]^r[0],_=e[t+1]^r[1],g=e[t+2]^r[2],w=e[t+3]^r[3],R=4;for(let I=1;I<this._nRounds;I++){let y=s[p>>>24]^o[_>>>16&255]^n[g>>>8&255]^h[w&255]^r[R++],x=s[_>>>24]^o[g>>>16&255]^n[w>>>8&255]^h[p&255]^r[R++],k=s[g>>>24]^o[w>>>16&255]^n[p>>>8&255]^h[_&255]^r[R++],Qe=s[w>>>24]^o[p>>>16&255]^n[_>>>8&255]^h[g&255]^r[R++];p=y,_=x,g=k,w=Qe}let v=(c[p>>>24]<<24|c[_>>>16&255]<<16|c[g>>>8&255]<<8|c[w&255])^r[R++],M=(c[_>>>24]<<24|c[g>>>16&255]<<16|c[w>>>8&255]<<8|c[p&255])^r[R++],F=(c[g>>>24]<<24|c[w>>>16&255]<<16|c[p>>>8&255]<<8|c[_&255])^r[R++],D=(c[w>>>24]<<24|c[p>>>16&255]<<16|c[_>>>8&255]<<8|c[g&255])^r[R++];e[t]=v,e[t+1]=M,e[t+2]=F,e[t+3]=D}};Le.keySize=256/32;var ts=[1732584193,4023233417,2562383102,271733878,3285377520],J=new Array(80),Y=class extends A{static{a(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new m(ts.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],h=this._hash.words[4];for(let c=0;c<80;c++){if(c<16)J[c]=e[t+c]|0;else{let w=J[c-3]^J[c-8]^J[c-14]^J[c-16];J[c]=w<<1|w>>>31}let p,_;c<20?(p=s&o|~s&n,_=1518500249):c<40?(p=s^o^n,_=1859775393):c<60?(p=s&o|s&n|o&n,_=2400959708):(p=s^o^n,_=3395469782);let g=(r<<5|r>>>27)+p+h+_+J[c];h=n,n=o,o=s<<30|s>>>2,s=r,r=g|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+h|0}};var sr=[],ir=[];(function(){function i(s){let o=Math.sqrt(s);for(let n=2;n<=o;n++)if(!(s%n))return!1;return!0}a(i,"isPrime");function e(s){return(s-(s|0))*4294967296|0}a(e,"getFractionalBits");let t=2,r=0;for(;r<64;)i(t)&&(r<8&&(sr[r]=e(Math.pow(t,1/2))),ir[r]=e(Math.pow(t,1/3)),r++),t++})();var Q=[],we=class extends A{static{a(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new m(sr.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],h=this._hash.words[4],c=this._hash.words[5],p=this._hash.words[6],_=this._hash.words[7];for(let g=0;g<64;g++){if(g<16)Q[g]=e[t+g]|0;else{let I=Q[g-15],y=(I<<25|I>>>7)^(I<<14|I>>>18)^I>>>3,x=Q[g-2],k=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;Q[g]=y+Q[g-7]+k+Q[g-16]}let w=h&c^~h&p,R=r&s^r&o^s&o,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),M=(h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25),F=_+M+w+ir[g]+Q[g],D=v+R;_=p,p=c,c=h,h=n+F|0,n=o,o=s,s=r,r=F+D|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+h|0,this._hash.words[5]=this._hash.words[5]+c|0,this._hash.words[6]=this._hash.words[6]+p|0,this._hash.words[7]=this._hash.words[7]+_|0}};var pt=[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)],T=[];(function(){for(let i=0;i<80;i++)T[i]=new l(void 0,void 0)})();var ut=class extends A{static{a(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new Jt([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 e=this._data,t=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return t[s>>>5]|=128<<24-s%32,t[(s+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(s+128>>>10<<5)+31]=r,e.sigBytes=t.length*4,this._process(),this._hash.toX32()}_doProcessBlock(e,t){let r=this._hash.words[0].high,s=this._hash.words[0].low,o=this._hash.words[1].high,n=this._hash.words[1].low,h=this._hash.words[2].high,c=this._hash.words[2].low,p=this._hash.words[3].high,_=this._hash.words[3].low,g=this._hash.words[4].high,w=this._hash.words[4].low,R=this._hash.words[5].high,v=this._hash.words[5].low,M=this._hash.words[6].high,F=this._hash.words[6].low,D=this._hash.words[7].high,I=this._hash.words[7].low;for(let y=0;y<80;y++){let x,k;if(y<16)k=T[y].high=e[t+y*2]|0,x=T[y].low=e[t+y*2+1]|0;else{let vt=T[y-15],te=vt.high,ue=vt.low,Gr=(te>>>1|ue<<31)^(te>>>8|ue<<24)^te>>>7,Pt=(ue>>>1|te<<31)^(ue>>>8|te<<24)^(ue>>>7|te<<25),Nt=T[y-2],re=Nt.high,ge=Nt.low,Sr=(re>>>19|ge<<13)^(re<<3|ge>>>29)^re>>>6,Ft=(ge>>>19|re<<13)^(ge<<3|re>>>29)^(ge>>>6|re<<26);x=Pt+T[y-7].low,k=Gr+T[y-7].high+(x>>>0<Pt>>>0?1:0),x=x+Ft,k=k+Sr+(x>>>0<Ft>>>0?1:0),x=x+T[y-16].low,k=k+T[y-16].high+(x>>>0<T[y-16].low>>>0?1:0),T[y].high=k,T[y].low=x}let Qe=g&R^~g&M,It=w&v^~w&F,jr=r&o^r&h^o&h,Lr=s&n^s&c^n&c,zr=(r>>>28|s<<4)^(r<<30|s>>>2)^(r<<25|s>>>7),Bt=(s>>>28|r<<4)^(s<<30|r>>>2)^(s<<25|r>>>7),Wr=(g>>>14|w<<18)^(g>>>18|w<<14)^(g<<23|w>>>9),$r=(w>>>14|g<<18)^(w>>>18|g<<14)^(w<<23|g>>>9),P=I+$r,$=D+Wr+(P>>>0<I>>>0?1:0);P=P+It,$=$+Qe+(P>>>0<It>>>0?1:0),P=P+pt[y].low,$=$+pt[y].high+(P>>>0<pt[y].low>>>0?1:0),P=P+x,$=$+k+(P>>>0<x>>>0?1:0);let Ct=Bt+Lr,Kr=zr+jr+(Ct>>>0<Bt>>>0?1:0);D=M,I=F,M=R,F=v,R=g,v=w,w=_+P|0,g=p+$+(w>>>0<_>>>0?1:0)|0,p=h,_=c,h=o,c=n,o=r,n=s,s=P+Ct|0,r=$+Kr+(s>>>0<P>>>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+r+(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+n,this._hash.words[1].high=this._hash.words[1].high+o+(this._hash.words[1].low>>>0<n>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+c,this._hash.words[2].high=this._hash.words[2].high+h+(this._hash.words[2].low>>>0<c>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+_,this._hash.words[3].high=this._hash.words[3].high+p+(this._hash.words[3].low>>>0<_>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+w,this._hash.words[4].high=this._hash.words[4].high+g+(this._hash.words[4].low>>>0<w>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+v,this._hash.words[5].high=this._hash.words[5].high+R+(this._hash.words[5].low>>>0<v>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+F,this._hash.words[6].high=this._hash.words[6].high+M+(this._hash.words[6].low>>>0<F>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+I,this._hash.words[7].high=this._hash.words[7].high+D+(this._hash.words[7].low>>>0<I>>>0?1:0)}};var or=class{static{a(this,"HMAC")}constructor(e,t){this._hasher=new e;let r=typeof t=="string"?b.parse(t):t,s=this._hasher.cfg.blockSize,o=s*4;r.sigBytes>o&&(r=this._hasher.finalize(r)),r.clamp();let n=this._oKey=r.clone(),h=this._iKey=r.clone(),c=n.words,p=h.words;for(let _=0;_<s;_++)c[_]^=1549556828,p[_]^=909522486;n.sigBytes=h.sigBytes=o,this.reset()}finalize(e){let t=this._hasher.finalize(e);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(t))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(e){return this._hasher.update(e),this}};var gt=class nr{static{a(this,"PBKDF2")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:we,iterations:25e4},e)}static execute(e,t,r){return new nr(r).compute(e,t)}compute(e,t){let r=this.cfg,s=new or(r.hasher,e),o=new m,n=new m([1]),h=o.words,c=n.words,p=r.keySize,_=r.iterations;for(;h.length<p;){let g=s.update(t).finalize(n);s.reset();let w=g.words,R=w.length,v=g;for(let M=1;M<_;M++){v=s.finalize(v),s.reset();let F=v.words;for(let D=0;D<R;D++)w[D]^=F[D]}o.concat(g),c[0]++}return o.sigBytes=p*4,o}};var ye=je._createHelper(Le);var ce=A._createHelper(W);var le=A._createHelper(Y);var ze=A._createHelper(we);var We=A._createHelper(ut);var de=class{static{a(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?q.parse(this._initVector):void 0}_mode;_padding;constructor(e,t,r){this._password=e,this._salt=t,this._initVector=r,this._mode=X,this._padding=ae}decryptAES(e){return ye.decrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(b)}encryptAES(e){return ye.encrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return gt.execute(this._password,q.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:Y})}};var $e=class{static{a(this,"SmpCrypto")}static base64Decode(e){return b.stringify(z.parse(e))}static base64Encode(e){return z.stringify(b.parse(e))}static md5(e){return ce(e).toString()}static sha1(e){return le(e).toString()}static sha256(e){return ze(e).toString()}static sha512(e){return We(e).toString()}};var _t=function(i){return i[i.Continue=100]="Continue",i[i.SwitchingProtocols=101]="SwitchingProtocols",i[i.Processing=102]="Processing",i[i.EarlyHints=103]="EarlyHints",i[i.Ok=200]="Ok",i[i.Created=201]="Created",i[i.Accepted=202]="Accepted",i[i.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",i[i.NoContent=204]="NoContent",i[i.ResetContent=205]="ResetContent",i[i.PartialContent=206]="PartialContent",i[i.MultiStatus=207]="MultiStatus",i[i.AlreadyReported=208]="AlreadyReported",i[i.ImUsed=226]="ImUsed",i[i.MultipleChoices=300]="MultipleChoices",i[i.MovedPermanently=301]="MovedPermanently",i[i.Found=302]="Found",i[i.SeeOther=303]="SeeOther",i[i.NotModified=304]="NotModified",i[i.UseProxy=305]="UseProxy",i[i.Unused=306]="Unused",i[i.TemporaryRedirect=307]="TemporaryRedirect",i[i.PermanentRedirect=308]="PermanentRedirect",i[i.BadRequest=400]="BadRequest",i[i.Unauthorized=401]="Unauthorized",i[i.PaymentRequired=402]="PaymentRequired",i[i.Forbidden=403]="Forbidden",i[i.NotFound=404]="NotFound",i[i.MethodNotAllowed=405]="MethodNotAllowed",i[i.NotAcceptable=406]="NotAcceptable",i[i.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",i[i.RequestTimeout=408]="RequestTimeout",i[i.Conflict=409]="Conflict",i[i.Gone=410]="Gone",i[i.LengthRequired=411]="LengthRequired",i[i.PreconditionFailed=412]="PreconditionFailed",i[i.PayloadTooLarge=413]="PayloadTooLarge",i[i.UriTooLong=414]="UriTooLong",i[i.UnsupportedMediaType=415]="UnsupportedMediaType",i[i.RangeNotSatisfiable=416]="RangeNotSatisfiable",i[i.ExpectationFailed=417]="ExpectationFailed",i[i.ImATeapot=418]="ImATeapot",i[i.MisdirectedRequest=421]="MisdirectedRequest",i[i.UnprocessableEntity=422]="UnprocessableEntity",i[i.Locked=423]="Locked",i[i.FailedDependency=424]="FailedDependency",i[i.TooEarly=425]="TooEarly",i[i.UpgradeRequired=426]="UpgradeRequired",i[i.PreconditionRequired=428]="PreconditionRequired",i[i.TooManyRequests=429]="TooManyRequests",i[i.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",i[i.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",i[i.InternalServerError=500]="InternalServerError",i[i.NotImplemented=501]="NotImplemented",i[i.BadGateway=502]="BadGateway",i[i.ServiceUnavailable=503]="ServiceUnavailable",i[i.GatewayTimeout=504]="GatewayTimeout",i[i.HttpVersionNotSupported=505]="HttpVersionNotSupported",i[i.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",i[i.InsufficientStorage=507]="InsufficientStorage",i[i.LoopDetected=508]="LoopDetected",i[i.NotExtended=510]="NotExtended",i[i.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",i}({});var Ke=class{static{a(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength;_seed;constructor(e){this._baseCode=e,this._crcLength=5,this._seed="changeme"}static check(e,t){if(new this(e).secureCode!==t)throw j.build("WRONG_SECURE_CODE","WRONG_SECURE_CODE",_t.BadRequest)}_encode(){let e=new W;return e.update(b.parse(this._seed+this._baseCode)),e.finalize().toString(q).substring(0,this._crcLength).toUpperCase()}};var fe=require("class-transformer"),Ge=require("ts-luxon");var C=function(i){return i.ACTIVATE="ACTIVATE",i.BLOCK="BLOCK",i.CHECK="CHECK",i.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",i.FREEZE="FREEZE",i.PURCHASE="PURCHASE",i.RECHARGE="RECHARGE",i.ROLLBACK="ROLLBACK",i.TRANSACTION="TRANSACTION",i.TRANSACTION_DETAIL="TRANSACTION_DETAIL",i.UNFREEZE="UNFREEZE",i.XREFUND="XREFUND",i}({});var ee=function(i){return i.MD5="MD5",i.MD5_HMAC="MD5_HMAC",i.SHA1="SHA1",i.SHA1_HMAC="SHA1_HMAC",i}({});function rs(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var h=i.length-1;h>=0;h--)(n=i[h])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}a(rs,"_ts_decorate");function hr(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}a(hr,"_ts_metadata");var Se=class{static{a(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new de("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[C.CHECK]:"",[C.TRANSACTION]:"",[C.TRANSACTION_DETAIL]:"",[C.ACTIVATE]:"A",[C.BLOCK]:"B",[C.DIGITAL_ACTIVATE]:"D",[C.FREEZE]:"F",[C.PURCHASE]:"P",[C.RECHARGE]:"G",[C.ROLLBACK]:"R",[C.UNFREEZE]:"U",[C.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;_hashStrategy;constructor(e="ACTIVATION",t,r,s){this.gc=e,this.op=t,this.ot=r,this._hashStrategies={[ee.MD5]:o=>ce(o),[ee.MD5_HMAC]:o=>{let n=new W;return n.update(b.parse(o)),n.finalize()},[ee.SHA1]:o=>le(o),[ee.SHA1_HMAC]:o=>{let n=new Y;return n.update(b.parse(o)),n.finalize()}},this._hashStrategy=this._hashStrategies[ee.MD5],this._dto=typeof s=="number"&&s>=0?Ge.DateTime.fromMillis(+`${s}000`.slice(0,13)):Ge.DateTime.local()}static build({gc:e,op:t,ot:r,dto:s}){return new this(e,t,r,s?.ts)}static explode(e){let t=this.constructor,r=(e||"").split(t._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${e}"`);return this.build({gc:r[1],op:t.prefixToOperation(r[2]),dto:Ge.DateTime.fromSeconds(+r[3])})}static isBase64(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)&&e.length%4===0}static parse(e){this._LOGGER.info(`${this.constructor.name}: trying to parse ${e}`);try{if(this.isBase64(e)){let t=this.constructor._AES_ENCODER.decryptAES(e),r=JSON.parse(t);return(0,fe.plainToInstance)(this,r)}else return this.explode(e)}catch(t){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${e}`,t),new Error(`UNPARSEABLE "${e}"`)}}static prefixToOperation(e){return Object.entries(this._OP_CODES).find(([,r])=>r===e)[0]}serialize(){return(0,fe.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let e=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(e)}};rs([(0,fe.Expose)(),hr("design:type",Number),hr("design:paramtypes",[])],Se.prototype,"ts",null);var ss=function(i){return i.ListDetectiveValidator="ListDetectiveValidator",i.MXValidator="MXValidator",i.SyntaxValidator="SyntaxValidator",i}({});var is=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function cr(i){return i.match(is)}a(cr,"smpAsciiWords");var gr="\\ud800-\\udfff",os="\\u0300-\\u036f",ns="\\ufe20-\\ufe2f",hs="\\u20d0-\\u20ff",as="\\u1ab0-\\u1aff",cs="\\u1dc0-\\u1dff",ls=os+ns+hs+as+cs,_r="\\u2700-\\u27bf",mr="a-z\\xdf-\\xf6\\xf8-\\xff",ds="\\xac\\xb1\\xd7\\xf7",fs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ps="\\u2000-\\u206f",us=" \\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",wr="A-Z\\xc0-\\xd6\\xd8-\\xde",gs="\\ufe0e\\ufe0f",yr=ds+fs+ps+us,xr="['\u2019]",lr=`[${yr}]`,_s=`[${ls}]`,Er="\\d",ms=`[${_r}]`,Rr=`[${mr}]`,Ar=`[^${gr}${yr+Er+_r+mr+wr}]`,ws="\\ud83c[\\udffb-\\udfff]",ys=`(?:${_s}|${ws})`,xs=`[^${gr}]`,Or="(?:\\ud83c[\\udde6-\\uddff]){2}",br="[\\ud800-\\udbff][\\udc00-\\udfff]",pe=`[${wr}]`,Es="\\u200d",dr=`(?:${Rr}|${Ar})`,Rs=`(?:${pe}|${Ar})`,fr=`(?:${xr}(?:d|ll|m|re|s|t|ve))?`,pr=`(?:${xr}(?:D|LL|M|RE|S|T|VE))?`,Ir=`${ys}?`,Br=`[${gs}]?`,As=`(?:${Es}(?:${[xs,Or,br].join("|")})${Br+Ir})*`,Os="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bs="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Is=Br+Ir+As,ur=`(?:${[ms,Or,br].join("|")})${Is}`,Ee=class{static{a(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([`${pe}?${Rr}+${fr}(?=${[lr,pe,"$"].join("|")})`,`${Rs}+${pr}(?=${[lr,pe+dr,"$"].join("|")})`,`${pe}?${dr}+${fr}`,`${pe}+${pr}`,bs,Os,`${Er}+`,ur].join("|"),"g");static RS_EMOJI=ur;static unicodeWords(e){return e.match(this.RE_UNICODE_WORDS)}};var mt=class i{static{a(this,"SmpCommonUtils")}static arrayRemove(e,t){let r=[],s=e.filter((o,n)=>t(o,n)&&r.push(n));return r.reverse().forEach(o=>e.splice(o,1)),s}static assertIsArray(e,t){if(!Array.isArray(e))throw new Error(t||"KikCommonUtils => val was not an array")}static assertIsBoolean(e,t){if(!this.isBoolean(e))throw new Error(t||"KikCommonUtils => val was not boolean")}static assertIsFunction(e,t){if(!this.isFunction(e))throw new Error(t||"KikCommonUtils => entity was not a function")}static assertIsInstance(e,t,r){if(!(e instanceof t))throw new Error(r||"KikCommonUtils => val was not instance of class")}static assertIsNotEmpty(e,t){if(this.isEmpty(e))throw new Error(t||"KikCommonUtils => entity was empty")}static assertIsNumber(e,t){if(typeof e!="number")throw new Error(t||"KikCommonUtils => val was not numeric")}static assertIsNumeric(e,t){if(!this.isNumeric(e))throw new Error(t||"KikCommonUtils => val was not numeric")}static assertIsObject(e,t){if(!this.isObject(e))throw new Error(t||"KikCommonUtils => val was not an object")}static assertIsString(e,t){if(!this.isString(e))throw new Error(t||"KikCommonUtils => val was not a string")}static assertIsTruthy(e,t){if(!e)throw new Error(t||"KikCommonUtils => condition wasn't truthy")}static buildPath(...e){let t=e.filter(r=>!!r).join("/").replace(/(?<!:)\/\/+/g,"/");return t.startsWith("http")&&!t.endsWith("/")?`${t}/`:t}static downloadBlob(e,t){let r=window.URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.setAttribute("download",t),document.body.appendChild(s),s.click()}static generateRandomHexString(e=12){let t="0123456789abcdef",r="";for(let s=0;s<e;s++){let o=Math.floor(Math.random()*t.length);r+=t[o]}return r}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}static getDecimalPrecision(e){if(this.assertIsNumeric(e),!isFinite(+e))return 0;let t=1,r=0;for(;Math.round(+e*t)/t!==e;)t*=10,r++;return r}static getType(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static isBoolean(e){return typeof e=="boolean"}static isColor(e){if(!e||!this.isString(e))return!1;let t=new Option().style;return t.color=e,t.color!==""}static isEmpty(e){return!e&&e!==0}static isEqual(e,t){function r(){if(e.length!==t.length)return!1;for(let c=0;c<e.length;c++)if(!i.isEqual(e[c],t[c]))return!1;return!0}a(r,"areArraysEqual");function s(){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let c in e)if(Object.prototype.hasOwnProperty.call(e,c)&&!i.isEqual(e[c],t[c]))return!1;return!0}a(s,"areObjectsEqual");function o(){return e.toString()===t.toString()}a(o,"areFunctionsEqual");function n(){return e===t}a(n,"arePrimativesEqual");let h=this.getType(e);return h!==this.getType(t)?!1:h==="array"?r():h==="object"?s():h==="function"?o():n()}static isFormField(e){return/^(?:input|select|textarea|button)$/i.test(e.nodeName)}static isFunction(e){return typeof e==typeof isNaN}static isNotEmpty(e){return!this.isEmpty(e)}static isNumber(e){return typeof e=="number"&&this.isNumeric(e)}static isNumeric(e){return!isNaN(e)}static isObject(e){return!!e&&e===Object(e)&&e.constructor===Object}static isPrimitive(e){let t=this.getType(e);return t!=="function"&&(t!=="object"||!e)}static isString(e){return typeof e=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(e,t){if(this.assertIsFunction(t,`CommonUtils => expected type of iteratee to be Function, got ${typeof t}`),this.isObject(e))return Object.entries(e).reduce((r,[s,o])=>(r.push(t(o,s)),r),[]);if(Array.isArray(e))return e.map(t);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof t}`)}static mapObjectKeys(e,t){return Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,s,o),r),{})}static mapObjectValues(e,t){return this.isObject(e)?Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,o,s),r),{}):{}}static noop(){}static objectHasValue(e,t){return!!~Object.values(e).filter(r=>this.isEqual(r,t))}static parseBoolean(e){return e?/^true$/i.test(e):!1}static parseJsonSafely(e){try{return JSON.parse(e)}catch(t){console.warn("KikCommonUtils => couldn't parse json string",{str:e,error:t});return}}static pick(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}static runSafely(e,t=null,r=[]){if(this.isFunction(e))return e.apply(t,r)}static sleep(e){return new Promise(t=>setTimeout(t,e))}static sprintf(e,...t){return this.isString(e)&&t.length?this.sprintf(e.replace("%s",String(t.shift())),...t):e}static stripComments(e){return typeof e=="string"?e.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):e}static submitFakeForm({action:e,method:t=ot.POST,data:r,target:s}){let o=Object.entries(r||{}).map(([h,c])=>`<input name="${h}" type="hidden" value="${c}" />`),n=document.createElement("form");n.method=t,n.action=e,n.innerHTML=`${o}`,n.target=s||"_self",document.body.append(n),n.submit()}static toCamelCase(e){return this.words(e.replace(/['\u2019]/g,"")).reduce((t,r,s)=>(r=r.toLowerCase(),t+(s?r.charAt(0).toUpperCase()+r.slice(1):r)),"")}static toKebabCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(e){return this.toCamelCase(e).replace(/^(.)/,t=>t.toUpperCase())}static toSnakeCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(e){return this.toSnakeCase(e).toUpperCase()}static words(e,t){return t===void 0?(Ee.HAS_UNICODE_WORD(e)?Ee.unicodeWords(e):cr(e))||[]:e.match(t)||[]}};var wt=class extends Error{static{a(this,"SmpFilterException")}message;data;constructor(e="Filter Exception",t){super(),this.message=e,this.data=t}};var yt=require("ts-luxon");var xt=class i{static{a(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return yt.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix;constructor(e=`gcpsid-xxxx-${+yt.DateTime.now().ts}`,t=0){this.value=e,this.expiry=t,this._controlSuffix="$1"}static parse(e){return new i(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};_e();var Et=class{static{a(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 Re=class{static{a(this,"SmpBrowserCache")}_storage;_prefix;constructor(e,t){this._storage=e,this._prefix=t}flush(){Object.keys(this._storage).filter(e=>e.startsWith(this._prefix)).forEach(this.remove.bind(this))}read(e){let t=this._storage.getItem(this._prefix+e);try{return t?JSON.parse(t):void 0}catch{return}}remove(e){this._storage.removeItem(this._prefix+e)}write(e,t){this._storage.setItem(this._prefix+e,JSON.stringify(t))}};var Ae=class{static{a(this,"SmpInMemoryCache")}static _storage=new Map;get staticStorage(){return this.constructor._storage}flush(){this.staticStorage.clear()}read(e){return this.staticStorage.get(e)}remove(e){this.staticStorage.delete(e)}write(e,t){this.staticStorage.set(e,t)}};var Oe=class extends Re{static{a(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var Rt=class{static{a(this,"SmpHttpService")}static _cachePrefix="kik_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new Oe:new Ae;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=j;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(s=>this._preprocessResponse(e,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(t.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(o=>{let n=o;try{n=this._errorClass.fromPlain(o)}catch(h){console.debug("http: failed to parse error response into ErrorResponse",h)}return Promise.reject({status:s.status,message:s.statusText,body:n})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let s=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),o=Object.fromEntries(s.searchParams.entries());s.search=new URLSearchParams({...o,...Object.fromEntries(Object.entries(t).map(([n,h])=>[n,`${h}`]))}).toString(),e=r?s.href:s.pathname+s.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};var vs="1.4.0";Object.defineProperties(module.exports,{smpRxjsCatchOnly:{get:a(()=>(He(),se(Ze)).smpRxjsCatchOnly,"get")},smpRxjsThrowIfEmpty:{get:a(()=>(He(),se(Ze)).smpRxjsThrowIfEmpty,"get")},smpRxjsThrowOnCondition:{get:a(()=>(He(),se(Ze)).smpRxjsThrowOnCondition,"get")},SmpDynamoService:{get:a(()=>(Ur(),se(kr)).SmpDynamoService,"get")},SmpFirebaseService:{get:a(()=>(Mr(),se(Tr)).SmpFirebaseService,"get")}});0&&(module.exports={SMP_HEALTHZ,SmpAesCrypt,SmpApiCommonUtils,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpService,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpNoop});
|
|
1
|
+
"use strict";var cs=Object.create;var xe=Object.defineProperty;var hs=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var ds=Object.getPrototypeOf,fs=Object.prototype.hasOwnProperty;var c=(i,e)=>xe(i,"name",{value:e,configurable:!0});var x=(i,e)=>()=>(i&&(e=i(i=0)),e);var Ee=(i,e)=>{for(var t in e)xe(i,t,{get:e[t],enumerable:!0})},Kt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ls(e))!fs.call(i,s)&&s!==t&&xe(i,s,{get:()=>e[s],enumerable:!(r=hs(e,s))||r.enumerable});return i};var ps=(i,e,t)=>(t=i!=null?cs(ds(i)):{},Kt(e||!i||!i.__esModule?xe(t,"default",{value:i,enumerable:!0}):t,i)),J=i=>Kt(xe({},"__esModule",{value:!0}),i);var Y,at=x(()=>{"use strict";Y=class{static{c(this,"SmpAbstractCacheStrategy")}}});function Re(i){return typeof i=="object"&&i!==null&&"value"in i&&"expiry"in i&&typeof i.expiry=="number"}var ct=x(()=>{"use strict";c(Re,"smpIsSmpCachedValue")});var qt,Xt=x(()=>{"use strict";qt=class{static{c(this,"SmpSessionManagerService")}get sessionId(){return this._sessionId||this._storage.getItem(this._sessionIdKey)||void 0}constructor(e="lggr_sid"){this._sessionIdKey=e,this._storage=this._getStorage(),this._sessionId=this.sessionId||this._generateSessionId()}_generateSessionId(){let e=this._generateUUID();return this._storage.setItem(this._sessionIdKey,e),e}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}_getStorage(){try{if(typeof window<"u"&&typeof window.sessionStorage==typeof isNaN)return sessionStorage}catch(e){console.warn(`${this.constructor.name}: error while checking sessionStorage`,e)}return{getItem:c(()=>null,"getItem"),setItem:c(()=>null,"setItem"),removeItem:c(()=>null,"removeItem"),clear:c(()=>null,"clear")}}}});var k,pt=x(()=>{"use strict";(function(i){i[i.OFF=0]="OFF",i[i.ERROR=1]="ERROR",i[i.WARN=2]="WARN",i[i.INFO=3]="INFO",i[i.LOG=4]="LOG",i[i.DEBUG=5]="DEBUG"})(k||(k={}))});function O(){}var Ue=x(()=>{"use strict";c(O,"smpNoop")});var gs,V,ut=x(()=>{"use strict";Ue();gs=class{static{c(this,"SmpConsoleOnlyMethods")}constructor(){this.group=O,this.groupCollapsed=O,this.groupEnd=O,this.time=O,this.timeEnd=O}},V=class Zt extends gs{static{c(this,"SmpLoggerMethods")}constructor(){super(...arguments),this.debug=O,this.error=O,this.info=O,this.log=O,this.warn=O}static describe(){return Object.getOwnPropertyNames(new Zt).map(e=>e)}}});var Ht,ke,Me,Jt=x(()=>{"use strict";Xt();pt();ut();Ue();ke="[DEFAULT]",Me=class extends V{static{c(this,"SmpLoggerService")}static get INSTANCE(){return this.get(ke)}static get INSTANCES(){return this._instances.keys()}static get NOOP_INSTANCE(){return this._noopInstance}get activeLevels(){return Object.values(k).filter(e=>+e>k.OFF&&+e<=this.level).map(e=>k[e])}get appName(){return this._appName}get currentConfig(){return{level:this.level,enableSessionId:this.enableSessionId,enablePreprocessing:this.enablePreprocessing,sensitiveProps:this._sensitiveProps}}get enablePreprocessing(){return this.preprocessArgs!==this._noopPreprocessArgs}get enableSessionId(){return!!this.sessionId}get level(){return this.constructor._level}get sessionId(){return this._sessionId}constructor(e){super(),this._sensitivePropMask="*****",this._sessionManager=new qt,this._loadConfig(e)}static destroy(e){return this._instances.delete(e)}static get(e=ke){return this._instances.get(e)||this._instances.get(ke)||this._noopInstance}static init(e,t=ke){let r;if(this._instances.has(t)){r=this.get(t);let s=r.currentConfig;r._loadConfig(Object.assign(Object.assign({},s),e))}else this._instances.set(t,new this(e)),r=this.get(t),r._appName=t;return r}static pop(e){let t=this.get(e);return this.destroy(e),t}destroy(){return this.constructor.destroy(this.appName)}filterSensitiveData(e){if(e===null||typeof e!="object"||Array.isArray(e)||e.constructor!==Object)return e;let t={};for(let r in e){let s=e[r];if(!Object.prototype.hasOwnProperty.call(e,r)||s===null||s===void 0){t[r]=s;continue}if(this._sensitiveProps.includes(r)){t[r]=this._sensitivePropMask;continue}t[r]=this.filterSensitiveData(s)}return t}preprocessArgs(e,...t){return this._defaultPreprocessArgs.apply(this,[e,...t])}_defaultPreprocessArgs(e,...t){let r=new Date;return[`${r.toISOString()}`,`${t.shift()}`.trim(),...t.map(s=>({tags:[this._appName,`level-${k[this.level]}`,e],timestamp:+r,sessionId:this.sessionId,metadata:this.filterSensitiveData(s)}))]}_loadConfig({sensitiveProps:e=[],level:t=k.OFF,enablePreprocessing:r=!1,enableSessionId:s=!1}){this._sensitiveProps=[...e,"pwd","password","buffer","token","accessToken","refreshToken"],this.preprocessArgs=r?this.preprocessArgs:this._noopPreprocessArgs,this._sessionId=s?this._sessionManager.sessionId:void 0,this._updateLevel(t)}_noopPreprocessArgs(...e){return e}_setup(e){let t=this.preprocessArgs.bind(this);this.activeLevels.forEach(r=>{let s=`${r}`.toLowerCase();typeof e[s]==typeof isNaN&&(this[s]=function(...o){e[s].apply(e,t.apply(null,[s,...o]))})}),this.level>k.OFF&&console&&(console.group&&console.groupEnd&&(this.group=console.group.bind(console),this.groupEnd=console.groupEnd.bind(console)),console.groupCollapsed&&(this.groupCollapsed=console.groupCollapsed.bind(console)),console.time&&console.timeEnd&&(this.time=console.time.bind(console),this.timeEnd=console.timeEnd.bind(console)))}_updateLevel(e=k.WARN){this.constructor.describe().forEach(t=>{this[t]=O}),this.constructor._level=e,console&&this._setup(console)}};Ht=Me;Me._instances=new Map;Me._level=k.OFF;Me._noopInstance=new Ht({level:k.OFF})});var Yt=x(()=>{"use strict"});var Qt=x(()=>{"use strict"});var er=x(()=>{"use strict";Yt();Qt();ut();pt();Ue()});var Ce=x(()=>{"use strict";Jt();er()});var q,tr=x(()=>{"use strict";q=function(i){return i.APPLE="APPLE",i.FACEBOOK="FACEBOOK",i.GOOGLE="GOOGLE",i}({})});var he,rr=x(()=>{"use strict";he=function(i){return i.POPUP="POPUP",i.REDIRECT="REDIRECT",i}({})});var Pe,yr=x(()=>{"use strict";Pe=function(i){return i.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",i.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",i.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",i.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",i.EMAIL_EXISTS="auth/email-already-exists",i.INVALID_ACTION_CODE="auth/invalid-action-code",i.POPUP_BLOCKED="auth/popup-blocked",i.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",i.USER_NOT_FOUND="auth/user-not-found",i.WRONG_PASSWORD="auth/wrong-password",i}({})});var zr={};Ee(zr,{SmpDynamoService:()=>Nt});var Lr,Ye,Je,Nt,$r=x(()=>{"use strict";Lr=require("@aws-sdk/client-dynamodb"),Ye=require("@aws-sdk/util-dynamodb");Ce();Je=function(i){return i.CouldNotDelete="ERR_COULD_NOT_DELETE",i.CouldNotRead="ERR_COULD_NOT_READ",i.CouldNotWrite="ERR_COULD_NOT_WRITE",i.ConditionalCheckFailedException="ERR_DUPE_TOKEN",i}(Je||{}),Nt=class{static{c(this,"SmpDynamoService")}_config;_tableName;get marshall(){return Ye.marshall}get unmarshall(){return Ye.unmarshall}_db;_logger;constructor(e,t){this._config=e,this._tableName=t,this._db=new Lr.DynamoDB([this._buildConfig()]),this._logger=new V}_buildConfig(){return this._config}_delete(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.deleteItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_DELETE")))}_read(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.getItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_READ")))}_write(e,t=this._tableName,r){let s={TableName:t,Item:this.marshall(e),...r};return this._db.putItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_WRITE")))}}});var Wr={};Ee(Wr,{SmpFirebaseService:()=>Tt});var Ne,u,Tt,Kr=x(()=>{"use strict";Ce();Ne=require("firebase/app"),u=require("firebase/auth");tr();rr();yr();Tt=class i{static{c(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof i))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":q.FACEBOOK,"google.com":q.GOOGLE,"apple.com":q.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return(0,u.getAuth)(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=he.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||he.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new V,this._app=(0,Ne.getApps)().length?(0,Ne.getApps)()[0]:(0,Ne.initializeApp)(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new i(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return(0,u.checkActionCode)(this._auth,e)}confirmPasswordReset(e,t){return(0,u.confirmPasswordReset)(this._auth,e,t)}fetchSignInMethodsForEmail(e){return(0,u.fetchSignInMethodsForEmail)(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return(0,u.getRedirectResult)(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.sendEmailVerification)(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return(0,u.sendPasswordResetEmail)(this._auth,e,{url:t})}setPersistence(e){return(0,u.setPersistence)(this._auth,e?u.browserLocalPersistence:u.browserSessionPersistence)}signInWithCustomToken(e){return(0,u.signInWithCustomToken)(this._auth,e)}signInWithEmailAndPassword(e,t){return(0,u.signInWithEmailAndPassword)(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return(0,u.signOut)(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=u.EmailAuthProvider.credential(this.loggedUser.email,e);return(0,u.reauthenticateWithCredential)(this.loggedUser,r).then(()=>(0,u.updatePassword)(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.updateProfile)(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[q.APPLE]:new u.OAuthProvider("apple.com"),[q.FACEBOOK]:new u.FacebookAuthProvider().setCustomParameters({prompt:"select_account"}),[q.GOOGLE]:new u.GoogleAuthProvider().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===Pe.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=Pe["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:c(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===he.POPUP?u.signInWithPopup:u.signInWithRedirect)(this._auth,e).then(s=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),s.user)).catch(async s=>s?.code===Pe.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,he.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,s),await this._expandDifferentCredential(s),Promise.reject(s)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}}});var Sr,Ft,Qe,Gr=x(()=>{"use strict";Sr=require("rxjs"),Ft=require("ts-luxon");at();ct();Qe=class extends Y{static{c(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(e){return this._readRaw(e).pipe((0,Sr.map)(t=>{if(this._isSmpCachedValue(t)){if(t.expiry>=Ft.DateTime.now().ts)return t.value;this._removeRaw(e).subscribe();return}return t}))}remove(e){return this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0)return this._writeRaw(e,t,r);let s=Ft.DateTime.now().ts+r*1e3,o={value:t,expiry:s};return this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Re(e)}}});function Vr(i,e){return t=>t.pipe((0,et.catchError)(r=>(typeof i==typeof isNaN?Gs(i)?Vs(r,i):i(r):!1)?e(r):(0,et.throwError)(()=>r)))}function Gs(i){try{return Reflect.construct(String,[],i),!0}catch{return!1}}function Vs(i,e){return typeof i=="object"&&i!==null&&i.constructor===e}var et,qr=x(()=>{"use strict";et=require("rxjs");c(Vr,"smpRxjsCatchOnly");c(Gs,"isConstructor");c(Vs,"isExactInstance")});function tt(i=Xs){return e=>e.pipe((0,Xr.map)(t=>{if(~qs.indexOf(JSON.stringify(t)))throw i(t);return t}))}var Xr,qs,Xs,Ut=x(()=>{"use strict";Xr=require("rxjs");c(tt,"smpRxjsThrowIfEmpty");qs=[void 0,null,!1,0,"","0",[],{}].map(i=>JSON.stringify(i)),Xs=c(()=>new Error,"defaultErrorFactory")});function Zr(i,e){return t=>t.pipe((0,rt.filter)(r=>!i(r)),(0,rt.defaultIfEmpty)(!1),tt(e))}var rt,Hr=x(()=>{"use strict";rt=require("rxjs");Ut();c(Zr,"smpRxjsThrowOnCondition")});var st={};Ee(st,{SmpAbstractRxjsTtlCacheStrategy:()=>Qe,smpRxjsCatchOnly:()=>Vr,smpRxjsThrowIfEmpty:()=>tt,smpRxjsThrowOnCondition:()=>Zr});var it=x(()=>{"use strict";Gr();qr();Ut();Hr()});var R,H,ot,Zs,Jr=x(()=>{"use strict";R=ps(require("zod"),1),H=require("ts-luxon"),ot=class i extends R.default.ZodType{static{c(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let t=this._getOrReturnCtx(e),r=t.data;if(this._def.coerce&&(r=this._coerceToDateTime(r),!(r instanceof H.DateTime)||!r.isValid))return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Invalid date format"}),R.default.INVALID;if((!(r instanceof H.DateTime)||!r.isValid)&&!this._def.coerce)return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Input must be a valid DateTime object"}),R.default.INVALID;let s={min:c((o,n,a)=>{if(o.min&&n<o.min)return{code:R.ZodIssueCode.too_small,minimum:o.min.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2265 ${o.min.toISODate()}`,path:a.path}},"min"),max:c((o,n,a)=>{if(o.max&&n>o.max)return{code:R.ZodIssueCode.too_big,maximum:o.max.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2264 ${o.max.toISODate()}`,path:a.path}},"max"),between:c((o,n,a)=>{if(o.min&&o.max&&(n<o.min||n>o.max))return{code:R.ZodIssueCode.custom,message:o.message??`Date must be between ${o.min.toISODate()} and ${o.max.toISODate()}`,path:a.path}},"between")};for(let o of this._def.checks)if(r instanceof H.DateTime&&r.isValid){let n=s[o.kind](o,r,t);n&&R.default.addIssueToContext(t,n)}return t.common.issues.length>0?R.default.INVALID:R.default.OK(r)}between(e,t,r){return new i({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:t.toUTC(),message:r}]})}coerce(){return new i({...this._def,coerce:!0})}max(e,t){return new i({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:t}]})}min(e,t){return new i({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:t}]})}_coerceToDateTime(e){if(e instanceof H.DateTime&&e.isValid)return e;let t={string:c(()=>H.DateTime.fromJSDate(new Date(e)),"string"),number:c(()=>H.DateTime.fromMillis(e),"number"),object:c(()=>H.DateTime.fromJSDate(e),"object"),default:c(()=>null,"default")};return(t[typeof e]||t.default)()}},Zs=c((i={})=>new ot({coerce:i.coerce??!1,checks:[]}),"smpZodDateTime")});var Yr={};Ee(Yr,{SmpZodDateTime:()=>ot,smpZodDateTime:()=>Zs});var Qr=x(()=>{"use strict";Jr()});var Js={};Ee(Js,{SMP_HEALTHZ:()=>_s,SmpAbstractCacheStrategy:()=>Y,SmpAbstractTtlCacheStrategy:()=>Q,SmpAesCrypt:()=>me,SmpApiCommonUtils:()=>mt,SmpBrowserCache:()=>Ae,SmpCommonUtils:()=>Ct,SmpCrypto:()=>qe,SmpErrorResponse:()=>L,SmpFilterException:()=>Bt,SmpFirebaseErrors:()=>Pe,SmpGenericResponse:()=>ce,SmpGiftcardTransaction:()=>He,SmpGiftcardTransactionHashStrategies:()=>oe,SmpGiftcardTransactionOps:()=>v,SmpHttpService:()=>dt,SmpHttpSessionStorageCache:()=>be,SmpHttpStatusCodes:()=>ft,SmpInMemoryCache:()=>Oe,SmpMarketingCloudValidators:()=>Es,SmpRegularExpressions:()=>Dt,SmpResponseMessage:()=>U,SmpResponseMessageTypes:()=>S,SmpRestVerbs:()=>gt,SmpSecureCode:()=>Xe,SmpSid:()=>Pt,SmpSocialSignInKeys:()=>q,SmpSocialSignInUxModes:()=>he,VERSION:()=>Hs,smpIsSmpCachedValue:()=>Re,smpNoop:()=>O});module.exports=J(Js);var ht=require("ts-luxon");at();ct();var Q=class extends Y{static{c(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(e){let t=this._readRaw(e);if(this._isSmpCachedValue(t)){if(t.expiry>=ht.DateTime.now().ts)return t.value;this._removeRaw(e);return}return t}remove(e){this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0){this._writeRaw(e,t,r);return}let s=ht.DateTime.now().ts+r*1e3,o={value:t,expiry:s};this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Re(e)}};var Ae=class extends Q{static{c(this,"SmpBrowserCache")}_storage;_prefix;constructor(e,t){super(),this._storage=e,this._prefix=t}_flushRaw(){let e=[],t=-1;for(;++t<this._storage.length;){let r=this._storage.key(t);r&&r.startsWith(this._prefix)&&e.push(r)}for(t=-1;++t<e.length;)this._storage.removeItem(e[t])}_readRaw(e){let t=this._storage.getItem(this._prefix+e);try{return t?JSON.parse(t):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+e}`);return}}_removeRaw(e){this._storage.removeItem(this._prefix+e)}_writeRaw(e,t){try{this._storage.setItem(this._prefix+e,JSON.stringify(t))}catch(r){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+e}`,r)}}};var be=class extends Ae{static{c(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var Oe=class extends Q{static{c(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(e){return this._staticSelf._storage.get(e)}_removeRaw(e){this._staticSelf._storage.delete(e)}_writeRaw(e,t){this._staticSelf._storage.set(e,t)}};var Ie=require("class-transformer");var G=require("class-transformer");var lt=require("class-transformer");var S=function(i){return i.INFO="INFO",i.SUCCESS="SUCCESS",i.WARNING="WARNING",i.ERROR="ERROR",i}({});function St(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(St,"_ts_decorate");function Te(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Te,"_ts_metadata");var U=class i{static{c(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=S.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new i(e)]:[]:[e].flat().map(t=>typeof t=="string"?new i(t):t)}};St([(0,lt.Expose)(),Te("design:type",String),Te("design:paramtypes",[])],U.prototype,"message",null);St([(0,lt.Expose)(),Te("design:type",typeof S>"u"?Object:S),Te("design:paramtypes",[])],U.prototype,"type",null);function us(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(us,"_ts_decorate");function Gt(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Gt,"_ts_metadata");var ce=class i{static{c(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=U.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],t){this._messages=e,this.data=t}static buildInfo(e,t){return new i([e].flat().map(r=>new U(r,S.INFO)),t)}static buildSuccess(e,t){return new i([e].flat().map(r=>new U(r,S.SUCCESS)),t)}static fromPlain(e){return(0,G.plainToInstance)(i,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return(0,G.instanceToPlain)(this,{excludePrefixes:["_"]})}};us([(0,G.Expose)(),(0,G.Transform)(({value:i})=>i?.length?i:void 0),Gt("design:type",Object),Gt("design:paramtypes",[])],ce.prototype,"messages",null);function Vt(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(Vt,"_ts_decorate");function Fe(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Fe,"_ts_metadata");var L=class i extends ce{static{c(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new U("GENERIC_ERROR")]}get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp;constructor(e=i.DEFAULT_MESSAGES,t="GENERIC_ERROR",r=500,s){super(e,s),this._errorCode=t,this._status=r,this._timestamp=Date.now()}static create({messages:e=i.DEFAULT_MESSAGES,...t}={}){return new i(U.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=(0,Ie.plainToInstance)(ms,e,{excludePrefixes:["_"]}),r=new i;return Object.getOwnPropertyNames(t).forEach(s=>{s in r&&(r[s]=t[s])}),r}};Vt([(0,Ie.Expose)(),Fe("design:type",Object),Fe("design:paramtypes",[])],L.prototype,"errorCode",null);Vt([(0,Ie.Expose)(),Fe("design:type",Number),Fe("design:paramtypes",[])],L.prototype,"timestamp",null);var ms=class extends L{static{c(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};var dt=class{static{c(this,"SmpHttpService")}static _cachePrefix="smp_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new be:new Oe;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=L;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(s=>this._preprocessResponse(e,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(t.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(o=>{let n=o;try{n=this._errorClass.fromPlain(o)}catch(a){console.debug("http: failed to parse error response into ErrorResponse",a)}return Promise.reject({status:s.status,message:s.statusText,body:n})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let s=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),o=Object.fromEntries(s.searchParams.entries());s.search=new URLSearchParams({...o,...Object.fromEntries(Object.entries(t).map(([n,a])=>[n,`${a}`]))}).toString(),e=r?s.href:s.pathname+s.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};var ft=function(i){return i[i.Continue=100]="Continue",i[i.SwitchingProtocols=101]="SwitchingProtocols",i[i.Processing=102]="Processing",i[i.EarlyHints=103]="EarlyHints",i[i.Ok=200]="Ok",i[i.Created=201]="Created",i[i.Accepted=202]="Accepted",i[i.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",i[i.NoContent=204]="NoContent",i[i.ResetContent=205]="ResetContent",i[i.PartialContent=206]="PartialContent",i[i.MultiStatus=207]="MultiStatus",i[i.AlreadyReported=208]="AlreadyReported",i[i.ImUsed=226]="ImUsed",i[i.MultipleChoices=300]="MultipleChoices",i[i.MovedPermanently=301]="MovedPermanently",i[i.Found=302]="Found",i[i.SeeOther=303]="SeeOther",i[i.NotModified=304]="NotModified",i[i.UseProxy=305]="UseProxy",i[i.Unused=306]="Unused",i[i.TemporaryRedirect=307]="TemporaryRedirect",i[i.PermanentRedirect=308]="PermanentRedirect",i[i.BadRequest=400]="BadRequest",i[i.Unauthorized=401]="Unauthorized",i[i.PaymentRequired=402]="PaymentRequired",i[i.Forbidden=403]="Forbidden",i[i.NotFound=404]="NotFound",i[i.MethodNotAllowed=405]="MethodNotAllowed",i[i.NotAcceptable=406]="NotAcceptable",i[i.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",i[i.RequestTimeout=408]="RequestTimeout",i[i.Conflict=409]="Conflict",i[i.Gone=410]="Gone",i[i.LengthRequired=411]="LengthRequired",i[i.PreconditionFailed=412]="PreconditionFailed",i[i.PayloadTooLarge=413]="PayloadTooLarge",i[i.UriTooLong=414]="UriTooLong",i[i.UnsupportedMediaType=415]="UnsupportedMediaType",i[i.RangeNotSatisfiable=416]="RangeNotSatisfiable",i[i.ExpectationFailed=417]="ExpectationFailed",i[i.ImATeapot=418]="ImATeapot",i[i.MisdirectedRequest=421]="MisdirectedRequest",i[i.UnprocessableEntity=422]="UnprocessableEntity",i[i.Locked=423]="Locked",i[i.FailedDependency=424]="FailedDependency",i[i.TooEarly=425]="TooEarly",i[i.UpgradeRequired=426]="UpgradeRequired",i[i.PreconditionRequired=428]="PreconditionRequired",i[i.TooManyRequests=429]="TooManyRequests",i[i.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",i[i.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",i[i.InternalServerError=500]="InternalServerError",i[i.NotImplemented=501]="NotImplemented",i[i.BadGateway=502]="BadGateway",i[i.ServiceUnavailable=503]="ServiceUnavailable",i[i.GatewayTimeout=504]="GatewayTimeout",i[i.HttpVersionNotSupported=505]="HttpVersionNotSupported",i[i.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",i[i.InsufficientStorage=507]="InsufficientStorage",i[i.LoopDetected=508]="LoopDetected",i[i.NotExtended=510]="NotExtended",i[i.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",i}({});Ce();var mt=class{static{c(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new V;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(e,t){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}static fromBearer(e=""){return e.split(" ")[1]}static getCountryFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[1]}static getLocaleFromReferer(e){return e?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(e,t){try{return e.replace(this._pathParamRegex,(r,s)=>{let o=t[s];return o!==void 0?encodeURIComponent(o):r})}catch(r){this._logger.warn("KikApiCommonUtils: couldn't interpolate params",r)}return e}};var _s={status:"OK"};var gt=function(i){return i.GET="GET",i.POST="POST",i.PUT="PUT",i.DELETE="DELETE",i.PATCH="PATCH",i}({});var X=class{static{c(this,"Hex")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s+=2)r[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new _(r,t/2)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push((s>>>4).toString(16)),t.push((s&15).toString(16))}return t.join("")}};var _=class _t{static{c(this,"WordArray")}constructor(e,t){this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=this.words.length*4}static random(e){let t=[],r=c(function(s){let o=987654321,n=4294967295;return function(){o=36969*(o&65535)+(o>>16)&n,s=18e3*(s&65535)+(s>>16)&n;let a=(o<<16)+s&n;return a/=4294967296,a+=.5,a*(Math.random()>.5?1:-1)}},"r");for(let s=0,o;s<e;s+=4){let n=r((o||Math.random())*4294967296);o=n()*987654071,t.push(n()*4294967296|0)}return new _t(t,e)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new _t(this.words.slice(0),this.sigBytes)}concat(e){if(this.clamp(),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let r=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];return this.sigBytes+=e.sigBytes,this}toString(e){return(e||X).stringify(this)}};var je=class{static{c(this,"Latin1")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s++)r[s>>>2]|=(e.charCodeAt(s)&255)<<24-s%4*8;return new _(r,t)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push(String.fromCharCode(s))}return t.join("")}};var I=class{static{c(this,"Utf8")}static parse(e){return je.parse(unescape(encodeURIComponent(e)))}static stringify(e){try{return decodeURIComponent(escape(je.stringify(e)))}catch(t){throw console.error("Malformed UTF-8 data",t),new Error("Malformed UTF-8 data")}}};var Le=class{static{c(this,"BufferedBlockAlgorithm")}constructor(e){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},e),this._data=new _,this._nDataBytes=0}clone(){let e=this.constructor();for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e._data=this._data.clone(),e}reset(){this._data=new _,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=I.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let t=this.cfg.blockSize*4,r=this._data.sigBytes/t;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);let s=r*this.cfg.blockSize,o=Math.min(s*4,this._data.sigBytes),n;if(s){for(let a=0;a<s;a+=this.cfg.blockSize)this._doProcessBlock(this._data.words,a);n=this._data.words.splice(0,s),this._data.sigBytes-=o}return new _(n,o)}};var le=class{static{c(this,"CipherParams")}constructor(e){this.ciphertext=e.ciphertext,this.key=e.key,this.iv=e.iv,this.salt=e.salt,this.algorithm=e.algorithm,this.mode=e.mode,this.padding=e.padding,this.blockSize=e.blockSize,this.formatter=e.formatter}extend(e){return e.ciphertext!==void 0&&(this.ciphertext=e.ciphertext),e.key!==void 0&&(this.key=e.key),e.iv!==void 0&&(this.iv=e.iv),e.salt!==void 0&&(this.salt=e.salt),e.algorithm!==void 0&&(this.algorithm=e.algorithm),e.mode!==void 0&&(this.mode=e.mode),e.padding!==void 0&&(this.padding=e.padding),e.blockSize!==void 0&&(this.blockSize=e.blockSize),e.formatter!==void 0&&(this.formatter=e.formatter),this}toString(e){if(e)return e.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{c(this,"Base64")}static parse(e){let t=e.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 r=this._map.charAt(64);if(r){let s=e.indexOf(r);s!==-1&&(t=s)}return this.parseLoop(e,t,this._reverseMap)}static parseLoop(e,t,r){let s=[],o=0;for(let n=0;n<t;n++)if(n%4){let a=r[e.charCodeAt(n-1)]<<n%4*2,h=r[e.charCodeAt(n)]>>>6-n%4*2;s[o>>>2]|=(a|h)<<24-o%4*8,o++}return new _(s,o)}static stringify(e){e.clamp();let t=[];for(let s=0;s<e.sigBytes;s+=3){let o=e.words[s>>>2]>>>24-s%4*8&255,n=e.words[s+1>>>2]>>>24-(s+1)%4*8&255,a=e.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=o<<16|n<<8|a;for(let p=0;p<4&&s+p*.75<e.sigBytes;p++)t.push(this._map.charAt(h>>>6*(3-p)&63))}let r=this._map.charAt(64);if(r)for(;t.length%4;)t.push(r);return t.join("")}};$._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$._reverseMap=void 0;var ze=class{static{c(this,"OpenSSL")}static parse(e){let t=$.parse(e),r;return t.words[0]===1398893684&&t.words[1]===1701076831&&(r=new _(t.words.slice(2,4)),t.words.splice(0,4),t.sigBytes-=16),new le({ciphertext:t,salt:r})}static stringify(e){if(!e.ciphertext)throw new Error("missing ciphertext in params");let t=e.ciphertext,r=e.salt,s;if(r){if(typeof r=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(r).concat(t)}else s=t;return s.toString($)}};var ee=class{static{c(this,"SerializableCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(!o.format)throw new Error("could not determine format");if(t=this._parse(t,o.format),!t.ciphertext)throw new Error("could not determine ciphertext");return e.createDecryptor(r,o).finalize(t.ciphertext)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s),n=e.createEncryptor(r,o),a=n.finalize(t);return new le({ciphertext:a,key:r,iv:n.cfg.iv,algorithm:e,mode:n.cfg.mode,padding:n.cfg.padding,blockSize:n.cfg.blockSize,formatter:o.format})}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};ee.cfg={blockSize:4,iv:new _([]),format:ze};var b=class extends Le{static{c(this,"Hasher")}constructor(e){super(Object.assign({blockSize:512/32},e)),this.reset()}static _createHelper(e){function t(r,s){return new e(s).finalize(r)}return c(t,"helper"),t}finalize(e){return e&&this._append(e),this._doFinalize()}update(e){return this._append(e),this._process(),this}};var d=[];for(let i=0;i<64;i++)d[i]=Math.abs(Math.sin(i+1))*4294967296|0;var W=class f extends b{static{c(this,"MD5")}get hash(){return this._hash}static FF(e,t,r,s,o,n,a){let h=e+(t&r|~t&s)+o+a;return(h<<n|h>>>32-n)+t}static GG(e,t,r,s,o,n,a){let h=e+(t&s|r&~s)+o+a;return(h<<n|h>>>32-n)+t}static HH(e,t,r,s,o,n,a){let h=e+(t^r^s)+o+a;return(h<<n|h>>>32-n)+t}static II(e,t,r,s,o,n,a){let h=e+(r^(t|~s))+o+a;return(h<<n|h>>>32-n)+t}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;this._data.words[t>>>5]|=128<<24-t%32;let r=Math.floor(e/4294967296),s=e;this._data.words[(t+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,this._data.words[(t+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 o=0;o<4;o++)this._hash.words[o]=(this._hash.words[o]<<8|this._hash.words[o]>>>24)&16711935|(this._hash.words[o]<<24|this._hash.words[o]>>>8)&4278255360;return this._hash}_doProcessBlock(e,t){for(let h=0;h<16;h++){let p=t+h,g=e[p];e[p]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let r=Array.from({length:16});for(let h=0;h<16;h++)r[h]=e[t+h];let s=this._hash.words[0],o=this._hash.words[1],n=this._hash.words[2],a=this._hash.words[3];s=f.FF(s,o,n,a,r[0],7,d[0]),a=f.FF(a,s,o,n,r[1],12,d[1]),n=f.FF(n,a,s,o,r[2],17,d[2]),o=f.FF(o,n,a,s,r[3],22,d[3]),s=f.FF(s,o,n,a,r[4],7,d[4]),a=f.FF(a,s,o,n,r[5],12,d[5]),n=f.FF(n,a,s,o,r[6],17,d[6]),o=f.FF(o,n,a,s,r[7],22,d[7]),s=f.FF(s,o,n,a,r[8],7,d[8]),a=f.FF(a,s,o,n,r[9],12,d[9]),n=f.FF(n,a,s,o,r[10],17,d[10]),o=f.FF(o,n,a,s,r[11],22,d[11]),s=f.FF(s,o,n,a,r[12],7,d[12]),a=f.FF(a,s,o,n,r[13],12,d[13]),n=f.FF(n,a,s,o,r[14],17,d[14]),o=f.FF(o,n,a,s,r[15],22,d[15]),s=f.GG(s,o,n,a,r[1],5,d[16]),a=f.GG(a,s,o,n,r[6],9,d[17]),n=f.GG(n,a,s,o,r[11],14,d[18]),o=f.GG(o,n,a,s,r[0],20,d[19]),s=f.GG(s,o,n,a,r[5],5,d[20]),a=f.GG(a,s,o,n,r[10],9,d[21]),n=f.GG(n,a,s,o,r[15],14,d[22]),o=f.GG(o,n,a,s,r[4],20,d[23]),s=f.GG(s,o,n,a,r[9],5,d[24]),a=f.GG(a,s,o,n,r[14],9,d[25]),n=f.GG(n,a,s,o,r[3],14,d[26]),o=f.GG(o,n,a,s,r[8],20,d[27]),s=f.GG(s,o,n,a,r[13],5,d[28]),a=f.GG(a,s,o,n,r[2],9,d[29]),n=f.GG(n,a,s,o,r[7],14,d[30]),o=f.GG(o,n,a,s,r[12],20,d[31]),s=f.HH(s,o,n,a,r[5],4,d[32]),a=f.HH(a,s,o,n,r[8],11,d[33]),n=f.HH(n,a,s,o,r[11],16,d[34]),o=f.HH(o,n,a,s,r[14],23,d[35]),s=f.HH(s,o,n,a,r[1],4,d[36]),a=f.HH(a,s,o,n,r[4],11,d[37]),n=f.HH(n,a,s,o,r[7],16,d[38]),o=f.HH(o,n,a,s,r[10],23,d[39]),s=f.HH(s,o,n,a,r[13],4,d[40]),a=f.HH(a,s,o,n,r[0],11,d[41]),n=f.HH(n,a,s,o,r[3],16,d[42]),o=f.HH(o,n,a,s,r[6],23,d[43]),s=f.HH(s,o,n,a,r[9],4,d[44]),a=f.HH(a,s,o,n,r[12],11,d[45]),n=f.HH(n,a,s,o,r[15],16,d[46]),o=f.HH(o,n,a,s,r[2],23,d[47]),s=f.II(s,o,n,a,r[0],6,d[48]),a=f.II(a,s,o,n,r[7],10,d[49]),n=f.II(n,a,s,o,r[14],15,d[50]),o=f.II(o,n,a,s,r[5],21,d[51]),s=f.II(s,o,n,a,r[12],6,d[52]),a=f.II(a,s,o,n,r[3],10,d[53]),n=f.II(n,a,s,o,r[10],15,d[54]),o=f.II(o,n,a,s,r[1],21,d[55]),s=f.II(s,o,n,a,r[8],6,d[56]),a=f.II(a,s,o,n,r[15],10,d[57]),n=f.II(n,a,s,o,r[6],15,d[58]),o=f.II(o,n,a,s,r[13],21,d[59]),s=f.II(s,o,n,a,r[4],6,d[60]),a=f.II(a,s,o,n,r[11],10,d[61]),n=f.II(n,a,s,o,r[2],15,d[62]),o=f.II(o,n,a,s,r[9],21,d[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+n|0,this._hash.words[3]=this._hash.words[3]+a|0}};var wt=class sr{static{c(this,"EVPKDF")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:W,iterations:1},e)}static execute(e,t,r){return new sr(r).compute(e,t)}compute(e,t){let r=new this.cfg.hasher,s=new _,o;for(;s.words.length<this.cfg.keySize;){o&&r.update(o),o=r.update(e).finalize(t),r.reset();for(let n=1;n<this.cfg.iterations;n++)o=r.finalize(o),r.reset();s.concat(o)}return s.sigBytes=this.cfg.keySize*4,s}};var ir=class{static{c(this,"OpenSSLKdf")}static execute(e,t,r,s){s||(s=_.random(64/8));let o=new wt({keySize:t+r}).compute(e,s),n=new _(o.words.slice(t),r*4);return o.sigBytes=t*4,new le({key:o,iv:n,salt:s})}};var $e=class{static{c(this,"PasswordBasedCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.format===void 0)throw new Error("missing format in config");if(t=this._parse(t,o.format),o.kdf===void 0)throw new Error("the key derivation function must be set");let n=o.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv!==void 0&&(o.iv=n.iv),ee.decrypt.call(this,e,t,n.key,o)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.kdf===void 0)throw new Error("missing kdf in config");let n=o.kdf.execute(r,e.keySize,e.ivSize);return n.iv!==void 0&&(o.iv=n.iv),ee.encrypt.call(this,e,t,n.key,o).extend(n)}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};$e.cfg={blockSize:4,iv:new _([]),format:ze,kdf:ir};var or=class{static{c(this,"CipherHelper")}constructor(e){this._cipher=e}decrypt(e,t,r){return typeof t=="string"?$e.decrypt(this._cipher,e,t,r):ee.decrypt(this._cipher,e,t,r)}encrypt(e,t,r){return typeof t=="string"?$e.encrypt(this._cipher,e,t,r):ee.encrypt(this._cipher,e,t,r)}};var de=class extends Le{static{c(this,"Cipher")}constructor(e,t,r){super(Object.assign({blockSize:1},r)),this._xformMode=e,this._key=t,this.reset()}static _createHelper(e){return new or(e)}static createDecryptor(e,t){let r=this;return new r(this._DEC_XFORM_MODE,e,t)}static createEncryptor(e,t){return new this(this._ENC_XFORM_MODE,e,t)}finalize(e){return e&&this._append(e),this._doFinalize()}process(e){return this._append(e),this._process()}};de.ivSize=4;de.keySize=4;de._DEC_XFORM_MODE=2;de._ENC_XFORM_MODE=1;var te=class{static{c(this,"BlockCipherModeAlgorithm")}constructor(e,t){this.init(e,t)}init(e,t){this._cipher=e,this._iv=t}};var We=class{static{c(this,"BlockCipherMode")}static createDecryptor(e,t){let r=this.Decryptor;return new r(e,t)}static createEncryptor(e,t){let r=this.Encryptor;return new r(e,t)}};We.Decryptor=te;We.Encryptor=te;var nr=class extends te{static{c(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(e,t,this._cipher.cfg.blockSize),this._cipher.encryptBlock(e,t),this._prevBlock=e.slice(t,t+this._cipher.cfg.blockSize)}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var ar=class extends te{static{c(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let r=e.slice(t,t+this._cipher.cfg.blockSize);this._cipher.decryptBlock(e,t),this.xorBlock(e,t,this._cipher.cfg.blockSize),this._prevBlock=r}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var Z=class extends We{static{c(this,"CBC")}};Z.Decryptor=ar;Z.Encryptor=nr;var fe=class{static{c(this,"PKCS7")}static pad(e,t){let r=t*4,s=r-e.sigBytes%r,o=s<<24|s<<16|s<<8|s,n=[];for(let h=0;h<s;h+=4)n.push(o);let a=new _(n,s);e.concat(a)}static unpad(e){let t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};var Ke=class extends de{static{c(this,"BlockCipher")}constructor(e,t,r){super(e,t,Object.assign({blockSize:4,mode:Z,padding:fe},r))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let e;this._xformMode===this.constructor._ENC_XFORM_MODE?e=this.cfg.mode.createEncryptor:(e=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===e?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=e.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=e)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let e;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),e=this._process(!0)}else e=this._process(!0),this.cfg.padding.unpad(e);return e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}};var l=class z{static{c(this,"X64Word")}constructor(e,t){this.high=e,this.low=t}add(e){let t=this.low+e.low|0,r=t>>>0<this.low>>>0?1:0,s=this.high+e.high+r|0;return new z(s,t)}and(e){return new z(this.high&e.high,this.low&e.low)}not(){return new z(~this.high,~this.low)}or(e){return new z(this.high|e.high,this.low|e.low)}rotL(e){return this.shiftL(e).or(this.shiftR(64-e))}rotR(e){return this.shiftR(e).or(this.shiftL(64-e))}shiftL(e){return e<32?new z(this.high<<e|this.low>>>32-e,this.low<<e):new z(this.low<<e-32,0)}shiftR(e){return e<32?new z(this.high>>>e,this.low>>>e|this.high<<32-e):new z(0,this.high>>>e-32)}xor(e){return new z(this.high^e.high,this.low^e.low)}};var cr=class yt{static{c(this,"X64WordArray")}constructor(e=[],t){this.words=e,this.sigBytes=t!==void 0?t:e.length*8}static create(e=[],t){return new yt(e,t)}clone(){let e=this.words.map(t=>new l(t.high,t.low));return new yt(e,this.sigBytes)}toX32(){let e=[];for(let t of this.words)e.push(t.high,t.low);return new _(e,this.sigBytes)}};var B=[],hr=[],lr=[],dr=[],fr=[],pr=[],xt=[],Et=[],Rt=[],At=[];(function(){let i=[];for(let r=0;r<256;r++)r<128?i[r]=r<<1:i[r]=r<<1^283;let e=0,t=0;for(let r=0;r<256;r++){let s=t^t<<1^t<<2^t<<3^t<<4;s=s>>>8^s&255^99,B[e]=s,hr[s]=e;let o=i[e],n=i[o],a=i[n],h=i[s]*257^s*16843008;lr[e]=h<<24|h>>>8,dr[e]=h<<16|h>>>16,fr[e]=h<<8|h>>>24,pr[e]=h,h=a*16843009^n*65537^o*257^e*16843008,xt[s]=h<<24|h>>>8,Et[s]=h<<16|h>>>16,Rt[s]=h<<8|h>>>24,At[s]=h,e?(e=o^i[i[i[a^o]]],t^=i[i[t]]):e=t=1}})();var ws=[0,1,2,4,8,16,32,64,128,27,54],Se=class extends Ke{static{c(this,"AES")}constructor(e,t,r){super(e,t,r),super.reset()}decryptBlock(e,t){let r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,xt,Et,Rt,At,hr),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,lr,dr,fr,pr,B)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[];for(let a=0;a<o;a++)if(a<r)n[a]=t[a];else{let h=n[a-1];a%r?r>6&&a%r===4&&(h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255]):(h=h<<8|h>>>24,h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255],h^=ws[a/r|0]<<24),n[a]=n[a-r]^h}this._invKeySchedule=[];for(let a=0;a<o;a++){let h=o-a,p;a%4?p=n[h]:p=n[h-4],a<4||h<=4?this._invKeySchedule[a]=p:this._invKeySchedule[a]=xt[B[p>>>24]]^Et[B[p>>>16&255]]^Rt[B[p>>>8&255]]^At[B[p&255]]}}_doCryptBlock(e,t,r,s,o,n,a,h){let p=e[t]^r[0],g=e[t+1]^r[1],m=e[t+2]^r[2],w=e[t+3]^r[3],A=4;for(let C=1;C<this._nRounds;C++){let y=s[p>>>24]^o[g>>>16&255]^n[m>>>8&255]^a[w&255]^r[A++],E=s[g>>>24]^o[m>>>16&255]^n[w>>>8&255]^a[p&255]^r[A++],F=s[m>>>24]^o[w>>>16&255]^n[p>>>8&255]^a[g&255]^r[A++],nt=s[w>>>24]^o[p>>>16&255]^n[g>>>8&255]^a[m&255]^r[A++];p=y,g=E,m=F,w=nt}let P=(h[p>>>24]<<24|h[g>>>16&255]<<16|h[m>>>8&255]<<8|h[w&255])^r[A++],j=(h[g>>>24]<<24|h[m>>>16&255]<<16|h[w>>>8&255]<<8|h[p&255])^r[A++],N=(h[m>>>24]<<24|h[w>>>16&255]<<16|h[p>>>8&255]<<8|h[g&255])^r[A++],T=(h[w>>>24]<<24|h[p>>>16&255]<<16|h[g>>>8&255]<<8|h[m&255])^r[A++];e[t]=P,e[t+1]=j,e[t+2]=N,e[t+3]=T}};Se.keySize=256/32;var ys=[1732584193,4023233417,2562383102,271733878,3285377520],re=new Array(80),se=class extends b{static{c(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(ys.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)re[h]=e[t+h]|0;else{let w=re[h-3]^re[h-8]^re[h-14]^re[h-16];re[h]=w<<1|w>>>31}let p,g;h<20?(p=s&o|~s&n,g=1518500249):h<40?(p=s^o^n,g=1859775393):h<60?(p=s&o|s&n|o&n,g=2400959708):(p=s^o^n,g=3395469782);let m=(r<<5|r>>>27)+p+a+g+re[h];a=n,n=o,o=s<<30|s>>>2,s=r,r=m|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0}};var ur=[],mr=[];(function(){function i(s){let o=Math.sqrt(s);for(let n=2;n<=o;n++)if(!(s%n))return!1;return!0}c(i,"isPrime");function e(s){return(s-(s|0))*4294967296|0}c(e,"getFractionalBits");let t=2,r=0;for(;r<64;)i(t)&&(r<8&&(ur[r]=e(Math.pow(t,1/2))),mr[r]=e(Math.pow(t,1/3)),r++),t++})();var ie=[],Be=class extends b{static{c(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(ur.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4],h=this._hash.words[5],p=this._hash.words[6],g=this._hash.words[7];for(let m=0;m<64;m++){if(m<16)ie[m]=e[t+m]|0;else{let C=ie[m-15],y=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,E=ie[m-2],F=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;ie[m]=y+ie[m-7]+F+ie[m-16]}let w=a&h^~a&p,A=r&s^r&o^s&o,P=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),j=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),N=g+j+w+mr[m]+ie[m],T=P+A;g=p,p=h,h=a,a=n+N|0,n=o,o=s,s=r,r=N+T|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+p|0,this._hash.words[7]=this._hash.words[7]+g|0}};var bt=[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)],M=[];(function(){for(let i=0;i<80;i++)M[i]=new l(void 0,void 0)})();var Ot=class extends b{static{c(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new cr([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 e=this._data,t=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return t[s>>>5]|=128<<24-s%32,t[(s+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(s+128>>>10<<5)+31]=r,e.sigBytes=t.length*4,this._process(),this._hash.toX32()}_doProcessBlock(e,t){let r=this._hash.words[0].high,s=this._hash.words[0].low,o=this._hash.words[1].high,n=this._hash.words[1].low,a=this._hash.words[2].high,h=this._hash.words[2].low,p=this._hash.words[3].high,g=this._hash.words[3].low,m=this._hash.words[4].high,w=this._hash.words[4].low,A=this._hash.words[5].high,P=this._hash.words[5].low,j=this._hash.words[6].high,N=this._hash.words[6].low,T=this._hash.words[7].high,C=this._hash.words[7].low;for(let y=0;y<80;y++){let E,F;if(y<16)F=M[y].high=e[t+y*2]|0,E=M[y].low=e[t+y*2+1]|0;else{let Lt=M[y-15],ne=Lt.high,we=Lt.low,ns=(ne>>>1|we<<31)^(ne>>>8|we<<24)^ne>>>7,zt=(we>>>1|ne<<31)^(we>>>8|ne<<24)^(we>>>7|ne<<25),$t=M[y-2],ae=$t.high,ye=$t.low,as=(ae>>>19|ye<<13)^(ae<<3|ye>>>29)^ae>>>6,Wt=(ye>>>19|ae<<13)^(ye<<3|ae>>>29)^(ye>>>6|ae<<26);E=zt+M[y-7].low,F=ns+M[y-7].high+(E>>>0<zt>>>0?1:0),E=E+Wt,F=F+as+(E>>>0<Wt>>>0?1:0),E=E+M[y-16].low,F=F+M[y-16].high+(E>>>0<M[y-16].low>>>0?1:0),M[y].high=F,M[y].low=E}let nt=m&A^~m&j,kt=w&P^~w&N,es=r&o^r&a^o&a,ts=s&n^s&h^n&h,rs=(r>>>28|s<<4)^(r<<30|s>>>2)^(r<<25|s>>>7),Mt=(s>>>28|r<<4)^(s<<30|r>>>2)^(s<<25|r>>>7),ss=(m>>>14|w<<18)^(m>>>18|w<<14)^(m<<23|w>>>9),is=(w>>>14|m<<18)^(w>>>18|m<<14)^(w<<23|m>>>9),D=C+is,K=T+ss+(D>>>0<C>>>0?1:0);D=D+kt,K=K+nt+(D>>>0<kt>>>0?1:0),D=D+bt[y].low,K=K+bt[y].high+(D>>>0<bt[y].low>>>0?1:0),D=D+E,K=K+F+(D>>>0<E>>>0?1:0);let jt=Mt+ts,os=rs+es+(jt>>>0<Mt>>>0?1:0);T=j,C=N,j=A,N=P,A=m,P=w,w=g+D|0,m=p+K+(w>>>0<g>>>0?1:0)|0,p=a,g=h,a=o,h=n,o=r,n=s,s=D+jt|0,r=K+os+(s>>>0<D>>>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+r+(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+n,this._hash.words[1].high=this._hash.words[1].high+o+(this._hash.words[1].low>>>0<n>>>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+a+(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+p+(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+w,this._hash.words[4].high=this._hash.words[4].high+m+(this._hash.words[4].low>>>0<w>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+P,this._hash.words[5].high=this._hash.words[5].high+A+(this._hash.words[5].low>>>0<P>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+N,this._hash.words[6].high=this._hash.words[6].high+j+(this._hash.words[6].low>>>0<N>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+C,this._hash.words[7].high=this._hash.words[7].high+T+(this._hash.words[7].low>>>0<C>>>0?1:0)}};var gr=class{static{c(this,"HMAC")}constructor(e,t){this._hasher=new e;let r=typeof t=="string"?I.parse(t):t,s=this._hasher.cfg.blockSize,o=s*4;r.sigBytes>o&&(r=this._hasher.finalize(r)),r.clamp();let n=this._oKey=r.clone(),a=this._iKey=r.clone(),h=n.words,p=a.words;for(let g=0;g<s;g++)h[g]^=1549556828,p[g]^=909522486;n.sigBytes=a.sigBytes=o,this.reset()}finalize(e){let t=this._hasher.finalize(e);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(t))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(e){return this._hasher.update(e),this}};var It=class _r{static{c(this,"PBKDF2")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:Be,iterations:25e4},e)}static execute(e,t,r){return new _r(r).compute(e,t)}compute(e,t){let r=this.cfg,s=new gr(r.hasher,e),o=new _,n=new _([1]),a=o.words,h=n.words,p=r.keySize,g=r.iterations;for(;a.length<p;){let m=s.update(t).finalize(n);s.reset();let w=m.words,A=w.length,P=m;for(let j=1;j<g;j++){P=s.finalize(P),s.reset();let N=P.words;for(let T=0;T<A;T++)w[T]^=N[T]}o.concat(m),h[0]++}return o.sigBytes=p*4,o}};var ve=Ke._createHelper(Se);var pe=b._createHelper(W);var ue=b._createHelper(se);var Ge=b._createHelper(Be);var Ve=b._createHelper(Ot);var me=class{static{c(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?X.parse(this._initVector):void 0}_mode;_padding;constructor(e,t,r){this._password=e,this._salt=t,this._initVector=r,this._mode=Z,this._padding=fe}decryptAES(e){return ve.decrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(e){return ve.encrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return It.execute(this._password,X.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:se})}};var qe=class{static{c(this,"SmpCrypto")}static base64Decode(e){return I.stringify($.parse(e))}static base64Encode(e){return $.stringify(I.parse(e))}static md5(e){return pe(e).toString()}static sha1(e){return ue(e).toString()}static sha256(e){return Ge(e).toString()}static sha512(e){return Ve(e).toString()}};var Xe=class{static{c(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength;_seed;constructor(e){this._baseCode=e,this._crcLength=5,this._seed="changeme"}static check(e,t){if(new this(e).secureCode!==t)throw L.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:ft.BadRequest})}_encode(){let e=new W;return e.update(I.parse(this._seed+this._baseCode)),e.finalize().toString(X).substring(0,this._crcLength).toUpperCase()}};var ge=require("class-transformer"),Ze=require("ts-luxon");var v=function(i){return i.ACTIVATE="ACTIVATE",i.BLOCK="BLOCK",i.CHECK="CHECK",i.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",i.FREEZE="FREEZE",i.PURCHASE="PURCHASE",i.RECHARGE="RECHARGE",i.ROLLBACK="ROLLBACK",i.TRANSACTION="TRANSACTION",i.TRANSACTION_DETAIL="TRANSACTION_DETAIL",i.UNFREEZE="UNFREEZE",i.XREFUND="XREFUND",i}({});var oe=function(i){return i.MD5="MD5",i.MD5_HMAC="MD5_HMAC",i.SHA1="SHA1",i.SHA1_HMAC="SHA1_HMAC",i}({});function xs(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(xs,"_ts_decorate");function wr(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(wr,"_ts_metadata");var He=class{static{c(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new me("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[v.CHECK]:"",[v.TRANSACTION]:"",[v.TRANSACTION_DETAIL]:"",[v.ACTIVATE]:"A",[v.BLOCK]:"B",[v.DIGITAL_ACTIVATE]:"D",[v.FREEZE]:"F",[v.PURCHASE]:"P",[v.RECHARGE]:"G",[v.ROLLBACK]:"R",[v.UNFREEZE]:"U",[v.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;_hashStrategy;constructor(e="ACTIVATION",t,r,s){this.gc=e,this.op=t,this.ot=r,this._hashStrategies={[oe.MD5]:o=>pe(o),[oe.MD5_HMAC]:o=>{let n=new W;return n.update(I.parse(o)),n.finalize()},[oe.SHA1]:o=>ue(o),[oe.SHA1_HMAC]:o=>{let n=new se;return n.update(I.parse(o)),n.finalize()}},this._hashStrategy=this._hashStrategies[oe.MD5],this._dto=typeof s=="number"&&s>=0?Ze.DateTime.fromMillis(+`${s}000`.slice(0,13)):Ze.DateTime.local()}static build({gc:e,op:t,ot:r,dto:s}){return new this(e,t,r,s?.ts)}static explode(e){let t=this.constructor,r=(e||"").split(t._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${e}"`);return this.build({gc:r[1],op:t.prefixToOperation(r[2]),dto:Ze.DateTime.fromSeconds(+r[3])})}static isBase64(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)&&e.length%4===0}static parse(e){this._LOGGER.info(`${this.constructor.name}: trying to parse ${e}`);try{if(this.isBase64(e)){let t=this.constructor._AES_ENCODER.decryptAES(e),r=JSON.parse(t);return(0,ge.plainToInstance)(this,r)}else return this.explode(e)}catch(t){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${e}`,t),new Error(`UNPARSEABLE "${e}"`)}}static prefixToOperation(e){return Object.entries(this._OP_CODES).find(([,r])=>r===e)[0]}serialize(){return(0,ge.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let e=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(e)}};xs([(0,ge.Expose)(),wr("design:type",Number),wr("design:paramtypes",[])],He.prototype,"ts",null);var Es=function(i){return i.ListDetectiveValidator="ListDetectiveValidator",i.MXValidator="MXValidator",i.SyntaxValidator="SyntaxValidator",i}({});var Rs=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function xr(i){return i.match(Rs)}c(xr,"smpAsciiWords");var Ir="\\ud800-\\udfff",As="\\u0300-\\u036f",bs="\\ufe20-\\ufe2f",Os="\\u20d0-\\u20ff",Is="\\u1ab0-\\u1aff",Cs="\\u1dc0-\\u1dff",Bs=As+bs+Os+Is+Cs,Cr="\\u2700-\\u27bf",Br="a-z\\xdf-\\xf6\\xf8-\\xff",vs="\\xac\\xb1\\xd7\\xf7",Ps="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ds="\\u2000-\\u206f",Ns=" \\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",vr="A-Z\\xc0-\\xd6\\xd8-\\xde",Ts="\\ufe0e\\ufe0f",Pr=vs+Ps+Ds+Ns,Dr="['\u2019]",Er=`[${Pr}]`,Fs=`[${Bs}]`,Nr="\\d",Us=`[${Cr}]`,Tr=`[${Br}]`,Fr=`[^${Ir}${Pr+Nr+Cr+Br+vr}]`,ks="\\ud83c[\\udffb-\\udfff]",Ms=`(?:${Fs}|${ks})`,js=`[^${Ir}]`,Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",kr="[\\ud800-\\udbff][\\udc00-\\udfff]",_e=`[${vr}]`,Ls="\\u200d",Rr=`(?:${Tr}|${Fr})`,zs=`(?:${_e}|${Fr})`,Ar=`(?:${Dr}(?:d|ll|m|re|s|t|ve))?`,br=`(?:${Dr}(?:D|LL|M|RE|S|T|VE))?`,Mr=`${Ms}?`,jr=`[${Ts}]?`,$s=`(?:${Ls}(?:${[js,Ur,kr].join("|")})${jr+Mr})*`,Ws="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ks="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ss=jr+Mr+$s,Or=`(?:${[Us,Ur,kr].join("|")})${Ss}`,De=class{static{c(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([`${_e}?${Tr}+${Ar}(?=${[Er,_e,"$"].join("|")})`,`${zs}+${br}(?=${[Er,_e+Rr,"$"].join("|")})`,`${_e}?${Rr}+${Ar}`,`${_e}+${br}`,Ks,Ws,`${Nr}+`,Or].join("|"),"g");static RS_EMOJI=Or;static unicodeWords(e){return e.match(this.RE_UNICODE_WORDS)}};var Ct=class i{static{c(this,"SmpCommonUtils")}static arrayRemove(e,t){let r=[],s=e.filter((o,n)=>t(o,n)&&r.push(n));return r.reverse().forEach(o=>e.splice(o,1)),s}static assertIsArray(e,t){if(!Array.isArray(e))throw new Error(t||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(e,t){if(!this.isBoolean(e))throw new Error(t||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(e,t){if(!this.isFunction(e))throw new Error(t||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(e,t,r){if(!(e instanceof t))throw new Error(r||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(e,t){if(this.isEmpty(e))throw new Error(t||`${this.constructor.name} => entity was empty`)}static assertIsNumber(e,t){if(typeof e!="number")throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(e,t){if(!this.isNumeric(e))throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsObject(e,t){if(!this.isObject(e))throw new Error(t||`${this.constructor.name} => val was not an object`)}static assertIsString(e,t){if(!this.isString(e))throw new Error(t||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(e,t){if(!e)throw new Error(t||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...e){let t=e.filter(r=>!!r).join("/").replace(/(?<!:)\/\/+/g,"/");return t.startsWith("http")&&!t.endsWith("/")?`${t}/`:t}static downloadBlob(e,t){let r=window.URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.setAttribute("download",t),document.body.appendChild(s),s.click()}static generateRandomHexString(e=12){let t="0123456789abcdef",r="";for(let s=0;s<e;s++){let o=Math.floor(Math.random()*t.length);r+=t[o]}return r}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}static getDecimalPrecision(e){if(this.assertIsNumeric(e),!isFinite(+e))return 0;let t=1,r=0;for(;Math.round(+e*t)/t!==e;)t*=10,r++;return r}static getType(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static isBoolean(e){return typeof e=="boolean"}static isColor(e){if(!e||!this.isString(e))return!1;let t=new Option().style;return t.color=e,t.color!==""}static isEmpty(e){return!e&&e!==0}static isEqual(e,t){function r(){if(e.length!==t.length)return!1;for(let h=0;h<e.length;h++)if(!i.isEqual(e[h],t[h]))return!1;return!0}c(r,"areArraysEqual");function s(){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h)&&!i.isEqual(e[h],t[h]))return!1;return!0}c(s,"areObjectsEqual");function o(){return e.toString()===t.toString()}c(o,"areFunctionsEqual");function n(){return e===t}c(n,"arePrimativesEqual");let a=this.getType(e);return a!==this.getType(t)?!1:a==="array"?r():a==="object"?s():a==="function"?o():n()}static isFormField(e){return/^(?:input|select|textarea|button)$/i.test(e.nodeName)}static isFunction(e){return typeof e==typeof isNaN}static isNotEmpty(e){return!this.isEmpty(e)}static isNumber(e){return typeof e=="number"&&this.isNumeric(e)}static isNumeric(e){return!isNaN(e)}static isObject(e){return!!e&&e===Object(e)&&e.constructor===Object}static isPrimitive(e){let t=this.getType(e);return t!=="function"&&(t!=="object"||!e)}static isString(e){return typeof e=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(e,t){if(this.assertIsFunction(t,`CommonUtils => expected type of iteratee to be Function, got ${typeof t}`),this.isObject(e))return Object.entries(e).reduce((r,[s,o])=>(r.push(t(o,s)),r),[]);if(Array.isArray(e))return e.map(t);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof t}`)}static mapObjectKeys(e,t){return Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,s,o),r),{})}static mapObjectValues(e,t){return this.isObject(e)?Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,o,s),r),{}):{}}static noop(){}static objectHasValue(e,t){return!!~Object.values(e).filter(r=>this.isEqual(r,t))}static omit(e,t){return Object.keys(e).filter(s=>!t.includes(s)).reduce((s,o)=>(s[o]=e[o],s),{})}static parseBoolean(e){return e?/^true$/i.test(e):!1}static parseJsonSafely(e){try{return JSON.parse(e)}catch(t){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:e,error:t});return}}static pick(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}static runSafely(e,t=null,r=[]){if(this.isFunction(e))return e.apply(t,r)}static sleep(e){return new Promise(t=>setTimeout(t,e))}static sprintf(e,...t){return this.isString(e)&&t.length?this.sprintf(e.replace("%s",String(t.shift())),...t):e}static stripComments(e){return typeof e=="string"?e.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):e}static submitFakeForm({action:e,method:t=gt.POST,data:r,target:s}){let o=Object.entries(r||{}).map(([a,h])=>`<input name="${a}" type="hidden" value="${h}" />`),n=document.createElement("form");n.method=t,n.action=e,n.innerHTML=`${o}`,n.target=s||"_self",document.body.append(n),n.submit()}static toCamelCase(e){return this.words(e.replace(/['\u2019]/g,"")).reduce((t,r,s)=>(r=r.toLowerCase(),t+(s?r.charAt(0).toUpperCase()+r.slice(1):r)),"")}static toKebabCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(e){return this.toCamelCase(e).replace(/^(.)/,t=>t.toUpperCase())}static toSnakeCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(e){return this.toSnakeCase(e).toUpperCase()}static words(e,t){return t===void 0?(De.HAS_UNICODE_WORD(e)?De.unicodeWords(e):xr(e))||[]:e.match(t)||[]}};var Bt=class extends Error{static{c(this,"SmpFilterException")}message;data;constructor(e="Filter Exception",t){super(),this.message=e,this.data=t}};var vt=require("ts-luxon");var Pt=class i{static{c(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return vt.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix;constructor(e=`sid-xxxx-${+vt.DateTime.now().ts}`,t=0){this.value=e,this.expiry=t,this._controlSuffix="$1"}static parse(e){return new i(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};Ce();var Dt=class{static{c(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 Hs="1.6.0";Object.defineProperties(module.exports,{SmpDynamoService:{get:c(()=>($r(),J(zr)).SmpDynamoService,"get")},SmpFirebaseService:{get:c(()=>(Kr(),J(Wr)).SmpFirebaseService,"get")},smpRxjsCatchOnly:{get:c(()=>(it(),J(st)).smpRxjsCatchOnly,"get")},smpRxjsThrowIfEmpty:{get:c(()=>(it(),J(st)).smpRxjsThrowIfEmpty,"get")},smpRxjsThrowOnCondition:{get:c(()=>(it(),J(st)).smpRxjsThrowOnCondition,"get")},smpZodDateTime:{get:c(()=>(Qr(),J(Yr)).smpZodDateTime,"get")}});0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpService,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpIsSmpCachedValue,smpNoop});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|