@transmitsecurity/platform-web-sdk 1.17.1 → 1.17.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.17.2 – Sep. 28, 2025
4
+ * feat: Add package LICENSE file
5
+
6
+ **Fraud Prevention**
7
+ * fix: Update `getSessionToken` error format from object to string.
8
+ * improve device event performance and reselience.
9
+
10
+ **Orchestration**
11
+ * feat: Add Generic OTP Authentication step type
12
+
3
13
  ## 1.17.1 – Sep. 14, 2025
4
14
  **Fraud Prevention**
5
15
  * feat: Improve resilience of building encrypted request's body.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023–2025 Transmit Security Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/drs.cjs ADDED
@@ -0,0 +1 @@
1
+ "undefined"==typeof globalThis&&("undefined"!=typeof window?(window.globalThis=window,window.global=window):"undefined"!=typeof self&&(self.globalThis=self,self.global=self));const t=Symbol("MODULE_INITIALIZED"),e=new Map;function i(t,i){var n,r;null===(n=e.get(t))||void 0===n||n.forEach((r=t=>t(i),function(){try{return r(...arguments)}catch(t){console.log(t)}}))}let n=null;function r(t){n=t}var a=Object.freeze({__proto__:null,getInitConfig:function(){return n},get initConfig(){return n},setInitConfig:r});function s(e){r(e),i(t,void 0)}var o=Object.freeze({__proto__:null,initialize:s});function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){x(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function d(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function x(t,e,i){return(e=d(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function h(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},a=Object.keys(t);for(n=0;n<a.length;n++)i=a[n],e.indexOf(i)>=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function u(t,e){return Object.entries(e).reduce(((e,i)=>{let[n,r]=i;return l(l({},e),{},{[n]:f.isPrototypeOf(r)?new r(t.slug):"function"==typeof r?r.bind(t):"object"==typeof r&&!Array.isArray(r)&&r?u(t,r):r})}),{})}class f{constructor(t){this.slug=t}static create(t){return class extends f{constructor(e){super(e),Object.assign(this,u(this,t(this)))}}}}var g=Object.freeze({__proto__:null,Agent:f}),_=Object.freeze({__proto__:null,MODULE_INITIALIZED:t,emit:i,off:function(t,i){const n=e.get(t);if(!n)return;const r=n.indexOf(i);-1!==r&&n.splice(r,1)},on:function(t,i){var n;e.has(t)?null===(n=e.get(t))||void 0===n||n.push(i):e.set(t,[i])}});function p(t,e){const i=!t||"object"!=typeof t||Array.isArray(t)?{}:t;return[e.reduce(((t,e)=>{if(e in t){const i=t[e];if(null!==i&&"object"==typeof i&&!Array.isArray(i))return i}const i={};return t[e]=i,i}),i),i]}function y(t,e){let i=t;return e.every((t=>!(!i||"object"!=typeof i||Array.isArray(i)||!(t in i))&&(i=i[t],!0)),t)}const w="tsec",m="general";function v(t){return t?m:n.clientId}function b(t){return function(t){if(!t)return{};try{return JSON.parse(t)}catch(t){return{}}}((t?sessionStorage:localStorage).getItem(w))}function S(t,e){const i=t?sessionStorage:localStorage,n=e(b(t));i.setItem(w,JSON.stringify(n))}var E=Object.freeze({__proto__:null,COMMON_STORAGE_KEY:w,GENERAL_ID_KEY:m,getValue:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=v(!!e.isGeneral),n=b(!!e.sessionOnly),[r]=p(n,[this.slug.toString(),i]);return r[t]},hasValue:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=v(!!e.isGeneral),n=b(!!e.sessionOnly);return y(n,[this.slug.toString(),i,t])},removeValue:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=v(!!e.isGeneral);S(!!e.sessionOnly,(e=>{const[n,r]=p(e,[this.slug.toString(),i]);return delete n[t],r}))},setValue:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=v(!!i.isGeneral);S(!!i.sessionOnly,(i=>{const[r,a]=p(i,[this.slug.toString(),n]);return r[t]=e,a}))}});const D="RSA-PSS",I=async(t,e)=>await window.crypto.subtle.generateKey({name:t,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,e),T=async()=>await I("RSA-OAEP",["encrypt","decrypt"]),k=async()=>await I(D,["sign"]),A=async(t,e)=>{const i=(new TextEncoder).encode(e);return await window.crypto.subtle.sign({name:D,saltLength:32},t,i)};class P{constructor(t,e,i){this.slug=t,this.dbName=e,this.dbVersion=i}queryObjectStore(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB).open(`${this.slug}:${this.dbName}`,this.dbVersion||1);n.onupgradeneeded=()=>{var e;const i=n.result;(null===(e=null==i?void 0:i.objectStoreNames)||void 0===e?void 0:e.contains)&&!i.objectStoreNames.contains(t)&&i.createObjectStore(t,{keyPath:"key"})},n.onsuccess=()=>{const r=n.result,a=r.transaction(t,(null==i?void 0:i.operation)||"readwrite"),s=a.objectStore(t);e(s),a.oncomplete=()=>{r.close()}}}put(t,e,i){return new Promise(((n,r)=>{this.queryObjectStore(t,(t=>{const a=t.put({key:e,value:i});a.onsuccess=()=>{n(a.result)},a.onerror=t=>{r("Failed adding item to objectStore, err: "+t)}}))}))}add(t,e,i){return new Promise(((n,r)=>{this.queryObjectStore(t,(t=>{const a=t.add({key:e,value:i});a.onsuccess=()=>{n(a.result)},a.onerror=t=>{const e=t.target.error;r(e)}}))}))}get(t,e){return new Promise(((i,n)=>{this.queryObjectStore(t,(t=>{const r=t.get(e);r.onsuccess=()=>{var t;r.result?i(null===(t=r.result)||void 0===t?void 0:t.value):i(void 0)},r.onerror=t=>{n("Failed adding item to objectStore, err: "+t)}}))}))}getAll(t,e){return new Promise(((i,n)=>{this.queryObjectStore(t,(t=>{const r=t.getAll(null,e);r.onsuccess=()=>{if(r.result){const t=r.result;(null==t?void 0:t.length)?i(t.map((t=>null==t?void 0:t.value))):i(t)}else i([])},r.onerror=t=>{n("Failed getting items, err: "+t)}}))}))}delete(t,e){return new Promise(((i,n)=>{this.queryObjectStore(t,(t=>{const r=t.delete(e);r.onsuccess=()=>{i()},r.onerror=t=>{n(`Failed deleting key: '${e}' from objectStore, err: `+t)}}))}))}clear(t){return new Promise(((e,i)=>{this.queryObjectStore(t,(t=>{const n=t.clear();n.onsuccess=()=>{e()},n.onerror=t=>{i("Failed clearing objectStore, err: "+t)}}))}))}}const C="platform",R="init",M="completed",O="RSA2048",K=[R,M];class L{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sign",i=arguments.length>2?arguments[2]:void 0;var r,a,s,o;this.agent=t,this.keysType=e,this.options=i,this._extractingKeysPromise=null;const c=!(null===(r=this.options)||void 0===r?void 0:r.productScope);this.keysDatabaseName=c||!(null===(a=this.options)||void 0===a?void 0:a.indexedDBName)?"ts_crypto_binding":this.options.indexedDBName,this.dbVersion=c?1:(null===(s=this.options)||void 0===s?void 0:s.dbVersion)||1,this.keysStoreName=c||!(null===(o=this.options)||void 0===o?void 0:o.keysStoreName)?"identifiers_store":this.options.keysStoreName,this.indexedDBClient=new P(c?C:t.slug,this.keysDatabaseName,this.dbVersion),this.indexedDBClientFallback=new P((c?C:t.slug)+`:${n.clientId}`,this.keysDatabaseName,this.dbVersion)}getKeysRecordKey(){return`${this.keysType}_keys`}getRotatedKeysRecordKey(){return`rotated_${this.keysType}_keys`}getRotatedKeysRecordKeyPending(){return`rotated_pending_${this.keysType}_keys`}arrayBufferToBase64(t){return window.btoa(String.fromCharCode(...new Uint8Array(t)))}async getPKRepresentations(t){const e=await crypto.subtle.exportKey("spki",t);return{arrayBufferKey:e,base64Key:this.arrayBufferToBase64(e)}}async generateKeyPair(){return"sign"==this.keysType?await k():await T()}async calcKeyIdentifier(t){const e=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(e)).map((t=>t.toString(16).padStart(2,"0"))).join("")}async extractKeysData(){if(this._extractingKeysPromise)return this._extractingKeysPromise;this._extractingKeysPromise=(async()=>{var t,e;const i=(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyRotation)||void 0===e?void 0:e.isEnabled)?await this.getRotatedKeysData():await this.getKeysData(),{base64Key:n}=await this.getPKRepresentations(i.publicKey);return this.publicKeyBase64=n,this.keyIdentifier=i.keyIdentifier,i})();try{return await this._extractingKeysPromise}finally{this._extractingKeysPromise=null}}async generateKeyPairData(t){const e=await this.generateKeyPair(),{arrayBufferKey:i}=await this.getPKRepresentations(e.publicKey),n=t||await this.calcKeyIdentifier(i);return l(l({},e),{},{keyIdentifier:n,createdDate:Date.now()})}shouldKeyBeRotated(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.keyRotation;if(!(null==i?void 0:i.isEnabled)||!i.expiryDays||void 0===i.startedAt)return!1;const n=24*i.expiryDays*60*60*1e3,r=t.createdDate&&t.createdDate>=i.startedAt?t.createdDate:i.startedAt;return Date.now()-r>n-2592e6}async extractMainKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getKeysRecordKey())}async extractFallbackMainKeysData(){return await this.indexedDBClientFallback.get(this.keysStoreName,this.getKeysRecordKey())}async extractRotatedKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getRotatedKeysRecordKey())}async extractPendingRotatedKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getRotatedKeysRecordKeyPending())}async saveKeyData(t,e){try{return await this.indexedDBClient.add(this.keysStoreName,t,e),e}catch(e){if(e instanceof DOMException&&"ConstraintError"===e.name){const e=await this.indexedDBClient.get(this.keysStoreName,t);if(e)return e}throw e}}async getKeysData(){const t=this.getKeysRecordKey();let e=await this.extractMainKeysData();if(e)return e;if(e=await this.extractFallbackMainKeysData(),e)return this.saveKeyData(t,e);const i=await this.generateKeyPairData();return this.saveKeyData(t,i)}async getOrCreateRotatedKeys(){let t=await this.extractRotatedKeysData();if(!t){const e=this.getRotatedKeysRecordKey(),i=await this.getKeysData(),n=l(l({},i),{},{createdDate:i.createdDate||Date.now()});t=await this.saveKeyData(e,n)}return t}async getRotatedKeysData(){const t=await this.getOrCreateRotatedKeys();if(this.shouldKeyBeRotated(t)){if(!await this.extractPendingRotatedKeysData()){const e=this.getRotatedKeysRecordKeyPending(),i=await this.generateKeyPairData(t.keyIdentifier);await this.saveKeyData(e,i)}}return t}async getPublicData(){return this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData(),{publicKey:this.publicKeyBase64,keyIdentifier:this.keyIdentifier}}async sign(t){if("sign"==this.keysType){const{privateKey:e}=await this.extractKeysData(),i=await A(e,t);return this.arrayBufferToBase64(i)}throw new Error("keysType must be 'sign' in order to use sign keys")}async clearKeys(){const t=this.getKeysRecordKey();await this.indexedDBClient.delete(this.keysStoreName,t)}getBaseRotationPayload(){return{keyIdentifier:this.keyIdentifier,slot:this.getRotatedKeysRecordKey(),publicKey:this.publicKeyBase64,publicKeyType:O,tenantId:this.options.keyRotation.tenantId}}async getRotationData(){var t,e;if(!(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyRotation)||void 0===e?void 0:e.isEnabled))return;this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData();const i=await this.extractPendingRotatedKeysData();if(i){const{base64Key:t}=await this.getPKRepresentations(i.publicKey),{privateKey:e}=await this.extractKeysData(),n=l(l({},this.getBaseRotationPayload()),{},{newPublicKey:t,createdDate:i.createdDate,newPublicKeyType:O}),r=JSON.stringify(n);return{data:r,signature:await this.signPayload(r,e)}}const n=await this.extractRotatedKeysData();if(n&&!1===n.confirmed){await this.extractKeysData();const t=JSON.stringify(this.getBaseRotationPayload());return{data:t,signature:await this.signPayload(t,n.privateKey)}}}async signPayload(t,e){const i=await A(e,t);return this.arrayBufferToBase64(i)}async handleRotateResponse(t){if(K.includes(t))if(t===R){const t=await this.extractPendingRotatedKeysData();if(t){await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKey());const e=l(l({},t),{},{confirmed:!1});await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),e),await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKeyPending());const{base64Key:i}=await this.getPKRepresentations(t.publicKey);this.publicKeyBase64=i,this.keyIdentifier=t.keyIdentifier}}else if(t===M){const t=await this.extractRotatedKeysData();t&&!1===t.confirmed&&await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),l(l({},t),{},{confirmed:!0}))}}}var N=Object.freeze({__proto__:null,createCryptoBinding:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sign",e=arguments.length>1?arguments[1]:void 0;return new L(this,t,e)},generateRSAKeyPair:T,generateRSASignKeyPair:k,signAssymetric:A,verifyAssymetric:async(t,e,i)=>{const n=(new TextEncoder).encode(e);return await window.crypto.subtle.verify(D,t,i,n)}}),z=Object.freeze({__proto__:null});const B=f.create((t=>{class e extends Error{constructor(e,i){super(`${t.slug}-${e} ${i}`)}}return{TsError:e,TsInternalError:class extends e{constructor(t){super(t,"Internal error")}}}}));var U=f.create((()=>l({exceptions:B},g)));class F{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.agent=t,this.middlewares=e,this.logs=[]}info(t,e){this.pushLog(3,t,e)}warn(t,e){this.pushLog(4,t,e)}error(t,e){this.pushLog(5,t,e)}pushLog(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.logs.push({timestamp:Date.now(),module:this.agent.slug,severity:t,fields:i,message:e});const n=this.middlewares.map((t=>t(this)));Promise.all(n).catch((()=>{}))}}var j=Object.freeze({__proto__:null,consoleMiddleware:function(t){const e=t.logs[t.logs.length-1];console.log(`${e.severity} ${e.message}`,e.fields)},createSdkLogger:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new F(this,t)}});function Z(t,e){if(!(null==t?void 0:t.trim()))return"";if(function(t){try{return new URL(t),!0}catch(t){return!1}}(t))return t;const i="http://mock.com",n=new URL(i);n.search=(null==e?void 0:e.toString())||"",n.pathname=t;return n.href.replace(i,"")}const V={"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent};function H(t,e,i){var n;const r=(a=e||{},encodeURI(JSON.stringify(a)).split(/%..|./).length-1);var a;return{method:t,headers:l(l(l({},{"X-TS-body-size":String(r)}),V),i||{}),body:null!==(n=e&&JSON.stringify(e||{}))&&void 0!==n?n:void 0}}function G(t,e,i,n,r){const a=Z(t,n),s=H(e,i,r);return fetch(a,s)}async function W(t,e,i,n,r){let a;if(a=await G(t,e,i,n,r),!a.ok)throw new Error("Request failed");return a}var Y=Object.freeze({__proto__:null,httpDelete:async function(t,e){const i=await W(t,"DELETE",void 0,void 0,e);return l(l({data:await i.json()},i),{},{headers:i.headers})},httpGet:async function(t,e,i){const n=await W(t,"GET",void 0,e,i);return l(l({data:await n.json()},n),{},{headers:n.headers})},httpPost:async function(t,e,i,n){const r=await W(t,"POST",e,i,n);return l(l({data:await r.json()},r),{},{headers:r.headers})},httpPut:async function(t,e,i,n){const r=await W(t,"PUT",e,i,n);return l(l({data:await r.json()},r),{},{headers:r.headers})},init:H}),J=f.create((()=>({events:_,moduleMetadata:a,mainEntry:o,utils:U,storage:E,crypto:N,indexedDB:z,logger:j,http:Y}))),q={},$={};function X(t){let e=t.length;for(;--e>=0;)t[e]=0}const Q=256,tt=286,et=30,it=15,nt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),rt=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),at=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),st=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ot=new Array(576);X(ot);const ct=new Array(60);X(ct);const lt=new Array(512);X(lt);const dt=new Array(256);X(dt);const xt=new Array(29);X(xt);const ht=new Array(et);function ut(t,e,i,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}let ft,gt,_t;function pt(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}X(ht);const yt=t=>t<256?lt[t]:lt[256+(t>>>7)],wt=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},mt=(t,e,i)=>{t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,wt(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)},vt=(t,e,i)=>{mt(t,i[2*e],i[2*e+1])},bt=(t,e)=>{let i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1},St=(t,e,i)=>{const n=new Array(16);let r,a,s=0;for(r=1;r<=it;r++)n[r]=s=s+i[r-1]<<1;for(a=0;a<=e;a++){let e=t[2*a+1];0!==e&&(t[2*a]=bt(n[e]++,e))}},Et=t=>{let e;for(e=0;e<tt;e++)t.dyn_ltree[2*e]=0;for(e=0;e<et;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},Dt=t=>{t.bi_valid>8?wt(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},It=(t,e,i,n)=>{const r=2*e,a=2*i;return t[r]<t[a]||t[r]===t[a]&&n[e]<=n[i]},Tt=(t,e,i)=>{const n=t.heap[i];let r=i<<1;for(;r<=t.heap_len&&(r<t.heap_len&&It(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!It(e,n,t.heap[r],t.depth));)t.heap[i]=t.heap[r],i=r,r<<=1;t.heap[i]=n},kt=(t,e,i)=>{let n,r,a,s,o=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],r=t.pending_buf[t.l_buf+o],o++,0===n?vt(t,r,e):(a=dt[r],vt(t,a+Q+1,e),s=nt[a],0!==s&&(r-=xt[a],mt(t,r,s)),n--,a=yt(n),vt(t,a,i),s=rt[a],0!==s&&(n-=ht[a],mt(t,n,s)))}while(o<t.last_lit);vt(t,256,e)},At=(t,e)=>{const i=e.dyn_tree,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems;let s,o,c,l=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<a;s++)0!==i[2*s]?(t.heap[++t.heap_len]=l=s,t.depth[s]=0):i[2*s+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=l<2?++l:0,i[2*c]=1,t.depth[c]=0,t.opt_len--,r&&(t.static_len-=n[2*c+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)Tt(t,i,s);c=a;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Tt(t,i,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,i[2*c]=i[2*s]+i[2*o],t.depth[c]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,i[2*s+1]=i[2*o+1]=c,t.heap[1]=c++,Tt(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const i=e.dyn_tree,n=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,c=e.stat_desc.max_length;let l,d,x,h,u,f,g=0;for(h=0;h<=it;h++)t.bl_count[h]=0;for(i[2*t.heap[t.heap_max]+1]=0,l=t.heap_max+1;l<573;l++)d=t.heap[l],h=i[2*i[2*d+1]+1]+1,h>c&&(h=c,g++),i[2*d+1]=h,d>n||(t.bl_count[h]++,u=0,d>=o&&(u=s[d-o]),f=i[2*d],t.opt_len+=f*(h+u),a&&(t.static_len+=f*(r[2*d+1]+u)));if(0!==g){do{for(h=c-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[c]--,g-=2}while(g>0);for(h=c;0!==h;h--)for(d=t.bl_count[h];0!==d;)x=t.heap[--l],x>n||(i[2*x+1]!==h&&(t.opt_len+=(h-i[2*x+1])*i[2*x],i[2*x+1]=h),d--)}})(t,e),St(i,l,t.bl_count)},Pt=(t,e,i)=>{let n,r,a=-1,s=e[1],o=0,c=7,l=4;for(0===s&&(c=138,l=3),e[2*(i+1)+1]=65535,n=0;n<=i;n++)r=s,s=e[2*(n+1)+1],++o<c&&r===s||(o<l?t.bl_tree[2*r]+=o:0!==r?(r!==a&&t.bl_tree[2*r]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=r,0===s?(c=138,l=3):r===s?(c=6,l=3):(c=7,l=4))},Ct=(t,e,i)=>{let n,r,a=-1,s=e[1],o=0,c=7,l=4;for(0===s&&(c=138,l=3),n=0;n<=i;n++)if(r=s,s=e[2*(n+1)+1],!(++o<c&&r===s)){if(o<l)do{vt(t,r,t.bl_tree)}while(0!=--o);else 0!==r?(r!==a&&(vt(t,r,t.bl_tree),o--),vt(t,16,t.bl_tree),mt(t,o-3,2)):o<=10?(vt(t,17,t.bl_tree),mt(t,o-3,3)):(vt(t,18,t.bl_tree),mt(t,o-11,7));o=0,a=r,0===s?(c=138,l=3):r===s?(c=6,l=3):(c=7,l=4)}};let Rt=!1;const Mt=(t,e,i,n)=>{mt(t,0+(n?1:0),3),((t,e,i,n)=>{Dt(t),n&&(wt(t,i),wt(t,~i)),t.pending_buf.set(t.window.subarray(e,e+i),t.pending),t.pending+=i})(t,e,i,!0)};$._tr_init=t=>{Rt||((()=>{let t,e,i,n,r;const a=new Array(16);for(i=0,n=0;n<28;n++)for(xt[n]=i,t=0;t<1<<nt[n];t++)dt[i++]=n;for(dt[i-1]=n,r=0,n=0;n<16;n++)for(ht[n]=r,t=0;t<1<<rt[n];t++)lt[r++]=n;for(r>>=7;n<et;n++)for(ht[n]=r<<7,t=0;t<1<<rt[n]-7;t++)lt[256+r++]=n;for(e=0;e<=it;e++)a[e]=0;for(t=0;t<=143;)ot[2*t+1]=8,t++,a[8]++;for(;t<=255;)ot[2*t+1]=9,t++,a[9]++;for(;t<=279;)ot[2*t+1]=7,t++,a[7]++;for(;t<=287;)ot[2*t+1]=8,t++,a[8]++;for(St(ot,287,a),t=0;t<et;t++)ct[2*t+1]=5,ct[2*t]=bt(t,5);ft=new ut(ot,nt,257,tt,it),gt=new ut(ct,rt,0,et,it),_t=new ut(new Array(0),at,0,19,7)})(),Rt=!0),t.l_desc=new pt(t.dyn_ltree,ft),t.d_desc=new pt(t.dyn_dtree,gt),t.bl_desc=new pt(t.bl_tree,_t),t.bi_buf=0,t.bi_valid=0,Et(t)},$._tr_stored_block=Mt,$._tr_flush_block=(t,e,i,n)=>{let r,a,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<Q;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),At(t,t.l_desc),At(t,t.d_desc),s=(t=>{let e;for(Pt(t,t.dyn_ltree,t.l_desc.max_code),Pt(t,t.dyn_dtree,t.d_desc.max_code),At(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*st[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),r=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=r&&(r=a)):r=a=i+5,i+4<=r&&-1!==e?Mt(t,e,i,n):4===t.strategy||a===r?(mt(t,2+(n?1:0),3),kt(t,ot,ct)):(mt(t,4+(n?1:0),3),((t,e,i,n)=>{let r;for(mt(t,e-257,5),mt(t,i-1,5),mt(t,n-4,4),r=0;r<n;r++)mt(t,t.bl_tree[2*st[r]+1],3);Ct(t,t.dyn_ltree,e-1),Ct(t,t.dyn_dtree,i-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),kt(t,t.dyn_ltree,t.dyn_dtree)),Et(t),n&&Dt(t)},$._tr_tally=(t,e,i)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(dt[i]+Q+1)]++,t.dyn_dtree[2*yt(e)]++),t.last_lit===t.lit_bufsize-1),$._tr_align=t=>{mt(t,2,3),vt(t,256,ot),(t=>{16===t.bi_valid?(wt(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)};var Ot=(t,e,i,n)=>{let r=65535&t|0,a=t>>>16&65535|0,s=0;for(;0!==i;){s=i>2e3?2e3:i,i-=s;do{r=r+e[n++]|0,a=a+r|0}while(--s);r%=65521,a%=65521}return r|a<<16|0};const Kt=new Uint32Array((()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e})());var Lt=(t,e,i,n)=>{const r=Kt,a=n+i;t^=-1;for(let i=n;i<a;i++)t=t>>>8^r[255&(t^e[i])];return-1^t},Nt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},zt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Bt,_tr_stored_block:Ut,_tr_flush_block:Ft,_tr_tally:jt,_tr_align:Zt}=$,Vt=Ot,Ht=Lt,Gt=Nt,{Z_NO_FLUSH:Wt,Z_PARTIAL_FLUSH:Yt,Z_FULL_FLUSH:Jt,Z_FINISH:qt,Z_BLOCK:$t,Z_OK:Xt,Z_STREAM_END:Qt,Z_STREAM_ERROR:te,Z_DATA_ERROR:ee,Z_BUF_ERROR:ie,Z_DEFAULT_COMPRESSION:ne,Z_FILTERED:re,Z_HUFFMAN_ONLY:ae,Z_RLE:se,Z_FIXED:oe,Z_DEFAULT_STRATEGY:ce,Z_UNKNOWN:le,Z_DEFLATED:de}=zt,xe=258,he=262,ue=103,fe=113,ge=666,_e=(t,e)=>(t.msg=Gt[e],e),pe=t=>(t<<1)-(t>4?9:0),ye=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let we=(t,e,i)=>(e<<t.hash_shift^i)&t.hash_mask;const me=t=>{const e=t.state;let i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+i),t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))},ve=(t,e)=>{Ft(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,me(t.strm)},be=(t,e)=>{t.pending_buf[t.pending++]=e},Se=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Ee=(t,e,i,n)=>{let r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),i),1===t.state.wrap?t.adler=Vt(t.adler,e,r,i):2===t.state.wrap&&(t.adler=Ht(t.adler,e,r,i)),t.next_in+=r,t.total_in+=r,r)},De=(t,e)=>{let i,n,r=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match;const c=t.strstart>t.w_size-he?t.strstart-(t.w_size-he):0,l=t.window,d=t.w_mask,x=t.prev,h=t.strstart+xe;let u=l[a+s-1],f=l[a+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do{if(i=e,l[i+s]===f&&l[i+s-1]===u&&l[i]===l[a]&&l[++i]===l[a+1]){a+=2,i++;do{}while(l[++a]===l[++i]&&l[++a]===l[++i]&&l[++a]===l[++i]&&l[++a]===l[++i]&&l[++a]===l[++i]&&l[++a]===l[++i]&&l[++a]===l[++i]&&l[++a]===l[++i]&&a<h);if(n=xe-(h-a),a=h-xe,n>s){if(t.match_start=e,s=n,n>=o)break;u=l[a+s-1],f=l[a+s]}}}while((e=x[e&d])>c&&0!=--r);return s<=t.lookahead?s:t.lookahead},Ie=t=>{const e=t.w_size;let i,n,r,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-he)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,i=n;do{r=t.head[--i],t.head[i]=r>=e?r-e:0}while(--n);n=e,i=n;do{r=t.prev[--i],t.prev[i]=r>=e?r-e:0}while(--n);a+=e}if(0===t.strm.avail_in)break;if(n=Ee(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=n,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=we(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=we(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<he&&0!==t.strm.avail_in)},Te=(t,e)=>{let i,n;for(;;){if(t.lookahead<he){if(Ie(t),t.lookahead<he&&e===Wt)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=we(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-he&&(t.match_length=De(t,i)),t.match_length>=3)if(n=jt(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=we(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=we(t,t.ins_h,t.window[t.strstart+1]);else n=jt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(ve(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===qt?(ve(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ve(t,!1),0===t.strm.avail_out)?1:2},ke=(t,e)=>{let i,n,r;for(;;){if(t.lookahead<he){if(Ie(t),t.lookahead<he&&e===Wt)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=we(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-he&&(t.match_length=De(t,i),t.match_length<=5&&(t.strategy===re||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=jt(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=we(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(ve(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=jt(t,0,t.window[t.strstart-1]),n&&ve(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=jt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===qt?(ve(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ve(t,!1),0===t.strm.avail_out)?1:2};function Ae(t,e,i,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=n,this.func=r}const Pe=[new Ae(0,0,0,0,((t,e)=>{let i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ie(t),0===t.lookahead&&e===Wt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,ve(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-he&&(ve(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===qt?(ve(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(ve(t,!1),t.strm.avail_out),1)})),new Ae(4,4,8,4,Te),new Ae(4,5,16,8,Te),new Ae(4,6,32,32,Te),new Ae(4,4,16,16,ke),new Ae(8,16,32,32,ke),new Ae(8,16,128,128,ke),new Ae(8,32,128,256,ke),new Ae(32,128,258,1024,ke),new Ae(32,258,258,4096,ke)];function Ce(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=de,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ye(this.dyn_ltree),ye(this.dyn_dtree),ye(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ye(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ye(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Re=t=>{if(!t||!t.state)return _e(t,te);t.total_in=t.total_out=0,t.data_type=le;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:fe,t.adler=2===e.wrap?0:1,e.last_flush=Wt,Bt(e),Xt},Me=t=>{const e=Re(t);return e===Xt&&(t=>{t.window_size=2*t.w_size,ye(t.head),t.max_lazy_match=Pe[t.level].max_lazy,t.good_match=Pe[t.level].good_length,t.nice_match=Pe[t.level].nice_length,t.max_chain_length=Pe[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0})(t.state),e},Oe=(t,e,i,n,r,a)=>{if(!t)return te;let s=1;if(e===ne&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||i!==de||n<8||n>15||e<0||e>9||a<0||a>oe)return _e(t,te);8===n&&(n=9);const o=new Ce;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=a,o.method=i,Me(t)};q.deflateInit=(t,e)=>Oe(t,e,de,15,8,ce),q.deflateInit2=Oe,q.deflateReset=Me,q.deflateResetKeep=Re,q.deflateSetHeader=(t,e)=>t&&t.state?2!==t.state.wrap?te:(t.state.gzhead=e,Xt):te,q.deflate=(t,e)=>{let i,n;if(!t||!t.state||e>$t||e<0)return t?_e(t,te):te;const r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===ge&&e!==qt)return _e(t,0===t.avail_out?ie:te);r.strm=t;const a=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,be(r,31),be(r,139),be(r,8),r.gzhead?(be(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),be(r,255&r.gzhead.time),be(r,r.gzhead.time>>8&255),be(r,r.gzhead.time>>16&255),be(r,r.gzhead.time>>24&255),be(r,9===r.level?2:r.strategy>=ae||r.level<2?4:0),be(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(be(r,255&r.gzhead.extra.length),be(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ht(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(be(r,0),be(r,0),be(r,0),be(r,0),be(r,0),be(r,9===r.level?2:r.strategy>=ae||r.level<2?4:0),be(r,3),r.status=fe);else{let e=de+(r.w_bits-8<<4)<<8,i=-1;i=r.strategy>=ae||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=i<<6,0!==r.strstart&&(e|=32),e+=31-e%31,r.status=fe,Se(r,e),0!==r.strstart&&(Se(r,t.adler>>>16),Se(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),me(t),i=r.pending,r.pending!==r.pending_buf_size));)be(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),me(t),i=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,be(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),me(t),i=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,be(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),0===n&&(r.status=ue)}else r.status=ue;if(r.status===ue&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&me(t),r.pending+2<=r.pending_buf_size&&(be(r,255&t.adler),be(r,t.adler>>8&255),t.adler=0,r.status=fe)):r.status=fe),0!==r.pending){if(me(t),0===t.avail_out)return r.last_flush=-1,Xt}else if(0===t.avail_in&&pe(e)<=pe(a)&&e!==qt)return _e(t,ie);if(r.status===ge&&0!==t.avail_in)return _e(t,ie);if(0!==t.avail_in||0!==r.lookahead||e!==Wt&&r.status!==ge){let i=r.strategy===ae?((t,e)=>{let i;for(;;){if(0===t.lookahead&&(Ie(t),0===t.lookahead)){if(e===Wt)return 1;break}if(t.match_length=0,i=jt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(ve(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===qt?(ve(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ve(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===se?((t,e)=>{let i,n,r,a;const s=t.window;for(;;){if(t.lookahead<=xe){if(Ie(t),t.lookahead<=xe&&e===Wt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=t.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){a=t.strstart+xe;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<a);t.match_length=xe-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=jt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=jt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(ve(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===qt?(ve(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(ve(t,!1),0===t.strm.avail_out)?1:2})(r,e):Pe[r.level].func(r,e);if(3!==i&&4!==i||(r.status=ge),1===i||3===i)return 0===t.avail_out&&(r.last_flush=-1),Xt;if(2===i&&(e===Yt?Zt(r):e!==$t&&(Ut(r,0,0,!1),e===Jt&&(ye(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),me(t),0===t.avail_out))return r.last_flush=-1,Xt}return e!==qt?Xt:r.wrap<=0?Qt:(2===r.wrap?(be(r,255&t.adler),be(r,t.adler>>8&255),be(r,t.adler>>16&255),be(r,t.adler>>24&255),be(r,255&t.total_in),be(r,t.total_in>>8&255),be(r,t.total_in>>16&255),be(r,t.total_in>>24&255)):(Se(r,t.adler>>>16),Se(r,65535&t.adler)),me(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Xt:Qt)},q.deflateEnd=t=>{if(!t||!t.state)return te;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ue&&e!==fe&&e!==ge?_e(t,te):(t.state=null,e===fe?_e(t,ee):Xt)},q.deflateSetDictionary=(t,e)=>{let i=e.length;if(!t||!t.state)return te;const n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return te;if(1===r&&(t.adler=Vt(t.adler,e,i,0)),n.wrap=0,i>=n.w_size){0===r&&(ye(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(i-n.w_size,i),0),e=t,i=n.w_size}const a=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=i,t.next_in=0,t.input=e,Ie(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=we(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Ie(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=o,t.avail_in=a,n.wrap=r,Xt},q.deflateInfo="pako deflate (from Nodeca project)";var Ke={};const Le=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);Ke.assign=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)Le(i,e)&&(t[e]=i[e])}}return t},Ke.flattenChunks=t=>{let e=0;for(let i=0,n=t.length;i<n;i++)e+=t[i].length;const i=new Uint8Array(e);for(let e=0,n=0,r=t.length;e<r;e++){let r=t[e];i.set(r,n),n+=r.length}return i};var Ne={};let ze=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){ze=!1}const Be=new Uint8Array(256);for(let t=0;t<256;t++)Be[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Be[254]=Be[254]=1,Ne.string2buf=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,i,n,r,a,s=t.length,o=0;for(r=0;r<s;r++)i=t.charCodeAt(r),55296==(64512&i)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(o),a=0,r=0;a<o;r++)i=t.charCodeAt(r),55296==(64512&i)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?e[a++]=i:i<2048?(e[a++]=192|i>>>6,e[a++]=128|63&i):i<65536?(e[a++]=224|i>>>12,e[a++]=128|i>>>6&63,e[a++]=128|63&i):(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63,e[a++]=128|i>>>6&63,e[a++]=128|63&i);return e};Ne.buf2string=(t,e)=>{const i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,r;const a=new Array(2*i);for(r=0,n=0;n<i;){let e=t[n++];if(e<128){a[r++]=e;continue}let s=Be[e];if(s>4)a[r++]=65533,n+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&n<i;)e=e<<6|63&t[n++],s--;s>1?a[r++]=65533:e<65536?a[r++]=e:(e-=65536,a[r++]=55296|e>>10&1023,a[r++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&ze)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let n=0;n<e;n++)i+=String.fromCharCode(t[n]);return i})(a,r)},Ne.utf8border=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Be[t[i]]>e?i:e};const Ue=q,Fe=Ke,je=Ne,Ze=Nt,Ve=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},He=Object.prototype.toString,{Z_NO_FLUSH:Ge,Z_SYNC_FLUSH:We,Z_FULL_FLUSH:Ye,Z_FINISH:Je,Z_OK:qe,Z_STREAM_END:$e,Z_DEFAULT_COMPRESSION:Xe,Z_DEFAULT_STRATEGY:Qe,Z_DEFLATED:ti}=zt;function ei(t){this.options=Fe.assign({level:Xe,method:ti,chunkSize:16384,windowBits:15,memLevel:8,strategy:Qe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ve,this.strm.avail_out=0;let i=Ue.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==qe)throw new Error(Ze[i]);if(e.header&&Ue.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?je.string2buf(e.dictionary):"[object ArrayBuffer]"===He.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,i=Ue.deflateSetDictionary(this.strm,t),i!==qe)throw new Error(Ze[i]);this._dict_set=!0}}ei.prototype.push=function(t,e){const i=this.strm,n=this.options.chunkSize;let r,a;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Je:Ge,"string"==typeof t?i.input=je.string2buf(t):"[object ArrayBuffer]"===He.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),(a===We||a===Ye)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(r=Ue.deflate(i,a),r===$e)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),r=Ue.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===qe;if(0!==i.avail_out){if(a>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},ei.prototype.onData=function(t){this.chunks.push(t)},ei.prototype.onEnd=function(t){t===qe&&(this.result=Fe.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ii=function(t,e){return(e=e||{}).gzip=!0,function(t,e){const i=new ei(e);if(i.push(t,!0),i.err)throw i.msg||Ze[i.err];return i.result}(t,e)};const ni=["enabled","userId"];var ri,ai,si=["drs"];ri=si,ai=162,function(t){for(;--t;)ri.push(ri.shift())}(++ai);var oi,ci,li,di=new J((oi="0x0",si[oi-=0])),xi=["setItemSessionStorageSafe","removeItem","getItemLocalStorageSafe","FALLBACK_LOCAL_STORAGE","setItemLocalStorageSafe","localStorage","setItem","removeItemLocalStorageSafe","clientId","setClientId","getFullStorageKey","getItemSessionStorageSafe","sessionStorage","getItem","FALLBACK_SESSION_STORAGE"];ci=xi,li=293,function(t){for(;--t;)ci.push(ci.shift())}(++li);var hi=function(t,e){return xi[t-=0]};class ui{constructor(t){this.FALLBACK_SESSION_STORAGE={},this.FALLBACK_LOCAL_STORAGE={},this[hi("0x0")]=t}getClientId(){return this[hi("0x0")]}[hi("0x1")](t){this[hi("0x0")]=t}[hi("0x2")](t){return this.clientId+"_"+t}[hi("0x3")](t){const e=this[hi("0x2")](t);try{return window[hi("0x4")][hi("0x5")](e)}catch(t){return this[hi("0x6")][e]}}[hi("0x7")](t,e){const i=this[hi("0x2")](t);try{window[hi("0x4")].setItem(i,e)}catch(t){this[hi("0x6")][i]=e}}removeItemSessionStorageSafe(t){const e=this.getFullStorageKey(t);try{window.sessionStorage[hi("0x8")](e)}catch(t){this[hi("0x6")][e]=void 0}}[hi("0x9")](t){const e=this[hi("0x2")](t);try{return window.localStorage[hi("0x5")](e)}catch(t){return this[hi("0xa")][e]}}[hi("0xb")](t,e){const i=this.getFullStorageKey(t);try{window[hi("0xc")][hi("0xd")](i,e)}catch(t){this[hi("0xa")][i]=e}}[hi("0xe")](t){const e=this[hi("0x2")](t);try{window.localStorage.removeItem(e)}catch(t){this[hi("0xa")][e]=void 0}}}var fi,gi,_i=["pushLog","error","enabled","log","%s %s %s","stringify","push","now","unshift","map","catch","formatter","logPrefix","logsLimit","logs","middlewares","info"];fi=_i,gi=131,function(t){for(;--t;)fi.push(fi.shift())}(++gi);var pi=function(t,e){return _i[t-=0]};class yi{constructor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.enabled=t,this[pi("0x0")]="[AccountProtection SDK]",this[pi("0x1")]=1e4,this[pi("0x2")]=[],this[pi("0x3")]=[]}[pi("0x4")](t,e){this.pushLog(3,t,e)}warn(t,e){this[pi("0x5")](4,t,e)}[pi("0x6")](t,e){this[pi("0x5")](5,t,e)}flush(){const t=this[pi("0x2")];return this[pi("0x2")]=[],t}pushLog(t,e,i){this[pi("0x7")]&&console[pi("0x8")](pi("0x9"),this[pi("0x0")],e,JSON[pi("0xa")](i)),this[pi("0x2")][pi("0xb")]({timestamp:Date[pi("0xc")](),severity:t,text:JSON[pi("0xa")](l(l({},i),{},{message:e}),this.formatter)}),this[pi("0x2")].length>this.logsLimit&&this[pi("0x2")][pi("0xd")]();const n=this[pi("0x3")][pi("0xe")]((t=>t()));Promise.all(n)[pi("0xf")]((()=>{}))}[pi("0x10")](t,e){if(e instanceof Error){const{name:t,stack:i,message:n}=e;return{name:t,stack:i,message:n}}return e}}const wi=new yi;var mi,vi,bi=["requestsManager","loadConf","fetchConf","device/conf?tenantId=","getData","error","error fetching config","getItemLocalStorageSafe","parse","error loading config","shouldUpdateConf","now","refreshConf","keys","length","setItemLocalStorageSafe","stringify","conf","getConfValue","timestamp","ric","storageManager"];mi=bi,vi=459,function(t){for(;--t;)mi.push(mi.shift())}(++vi);var Si=function(t,e){return bi[t-=0]};const Ei=Si("0x0"),Di=Si("0x1");class Ii{constructor(t,e){this[Si("0x2")]=t,this[Si("0x3")]=e,this.conf=this[Si("0x4")]()}async[Si("0x5")](t){try{const e=Si("0x6")+t,i=await this[Si("0x3")][Si("0x7")](e);return null!=i?i:{}}catch(e){return wi[Si("0x8")](Si("0x9"),{clientId:t,error:e}),{}}}loadConf(){const t=this[Si("0x2")][Si("0xa")](Di);if(null!=t)try{return JSON[Si("0xb")](t)}catch(t){wi.error(Si("0xc"),{error:t})}return{}}[Si("0xd")](){const t=this.getConfValue(Ei,0);return Date[Si("0xe")]()-t>36e5}async[Si("0xf")](t){if(!this[Si("0xd")]())return!1;let e=await this[Si("0x5")](t);return 0==Object[Si("0x10")](e)[Si("0x11")]?e=this[Si("0x4")]():this.storageManager[Si("0x12")](Di,JSON[Si("0x13")](e)),this[Si("0x14")]=e,!0}[Si("0x15")](t,e){const i=void 0!==this[Si("0x14")]?this.conf[t]:void 0;return null!=i?i:e}}var Ti,ki,Ai=["EVENT_TYPE_INTERACTION","interaction","identification","desktop_web","mobile_web","EVENT_TYPE_ACTION","EVENT_TYPE_DEVICE"];Ti=Ai,ki=439,function(t){for(;--t;)Ti.push(Ti.shift())}(++ki);var Pi,Ci,Ri=function(t,e){return Ai[t-=0]};(Ci=Pi||(Pi={}))[Ri("0x0")]="action",Ci[Ri("0x1")]="device",Ci[Ri("0x2")]=Ri("0x3"),Ci.EVENT_TYPE_IDENTIFICATION=Ri("0x4");const Mi=Ri("0x5"),Oi=Ri("0x6");var Ki,Li,Ni=["push","maintainLastXItems","splice"];Ki=Ni,Li=478,function(t){for(;--t;)Ki.push(Ki.shift())}(++Li);var zi=function(t,e){return Ni[t-=0]};class Bi{static[zi("0x0")](t,e,i){return t.length>=e&&t[zi("0x1")](0,1),t[zi("0x2")](i),t}}var Ui,Fi,ji=["maintainLastXItems","location","isTrusted","buffer","extractEventData","getData","now","extractButtonsPressedData","ctrlKey","altKey","shiftKey","buttons","data","detail","offsetX","sourceCapabilities","firesTouchEvents","target","bufferSize","collect","cancelable","composed","view"];Ui=ji,Fi=394,function(t){for(;--t;)Ui.push(Ui.shift())}(++Fi);var Zi=function(t,e){return ji[t-=0]};class Vi{constructor(t){this.data=[],this[Zi("0x0")]=t}collect(t){const e=this[Zi("0x1")](t);Bi.maintainLastXItems(this.data,this[Zi("0x0")],e)}[Zi("0x2")](){return this.data}[Zi("0x1")](t){return l({x:t.x,y:t.y,tspl:Date[Zi("0x3")]()},this[Zi("0x4")](t))}extractButtonsPressedData(t){return l(l(l(l({},t[Zi("0x5")]&&{ctrlKey:!0}),t[Zi("0x6")]&&{altKey:!0}),t[Zi("0x7")]&&{shiftKey:!0}),0!=t[Zi("0x8")]&&{buttons:t[Zi("0x8")]})}}class Hi{constructor(t){this[Zi("0x9")]=[],this[Zi("0x0")]=t}collect(t){var e;const i={x:t.x,y:t.y,timestamp:Date[Zi("0x3")](),mouseButtonType:t[Zi("0xa")],offsetX:t[Zi("0xb")],offsetY:t.offsetY,isPressed:null==(null===(e=t[Zi("0xc")])||void 0===e?void 0:e[Zi("0xd")])?null:!t[Zi("0xc")].firesTouchEvents,target_id:t[Zi("0xe")].id};Bi.maintainLastXItems(this[Zi("0x9")],this[Zi("0x0")],i)}getData(){const t=[...this.data];return this[Zi("0x9")]=[],t}}class Gi{constructor(t){this[Zi("0x9")]=[],this[Zi("0xf")]=t}[Zi("0x10")](t){var e;const i={isTrusted:t.isTrusted,cancelable:t[Zi("0x11")],composed:t[Zi("0x12")],isView:!!t[Zi("0x13")],shiftKey:t.shiftKey,metaKey:t.metaKey,firesTouchEvents:null===(e=t[Zi("0xc")])||void 0===e?void 0:e[Zi("0xd")],timestamp:Date[Zi("0x3")]()};Bi[Zi("0x14")](this[Zi("0x9")],this.bufferSize,i)}[Zi("0x2")](){const t=[...this[Zi("0x9")]];return this.data=[],t}}class Wi{constructor(t){this.data=[],this.bufferSize=t}[Zi("0x10")](t){var e;const i={isTrusted:t.isTrusted,cancelable:t[Zi("0x11")],composed:t.composed,isView:!!t[Zi("0x13")],location:t[Zi("0x15")],shiftKey:t[Zi("0x7")],firesTouchEvents:null===(e=t.sourceCapabilities)||void 0===e?void 0:e[Zi("0xd")],timestamp:Date[Zi("0x3")]()};Bi[Zi("0x14")](this.data,this.bufferSize,i)}[Zi("0x2")](){const t=this[Zi("0x9")];return this[Zi("0x9")]=[],t}}class Yi{constructor(t){this.data=[],this[Zi("0xf")]=t}[Zi("0x10")](t){const e={isTrusted:t[Zi("0x16")],cancelable:t[Zi("0x11")],composed:t[Zi("0x12")],inputType:t.inputType,isView:!!t.view,timestamp:Date[Zi("0x3")]()};Bi.maintainLastXItems(this.data,this.bufferSize,e)}getData(){const t=this.data;return this[Zi("0x9")]=[],t}}class Ji{constructor(t){this[Zi("0x9")]=[],this[Zi("0xf")]=t}[Zi("0x10")](t){const e={isTrusted:t[Zi("0x16")],cancelable:t[Zi("0x11")],composed:t[Zi("0x12")],timestamp:Date[Zi("0x3")]()};Bi[Zi("0x14")](this[Zi("0x9")],this[Zi("0xf")],e)}[Zi("0x2")](){const t=this.data;return this.data=[],t}}var qi,$i,Xi=["paste","mousemove","mousedown","submit","keyup","keydown","input","deviceEventDataCollectionIgnoreList","safeEventCallback","interactionEventsCollectorsData","detail","sourceCapabilities","firesTouchEvents","offsetX","offsetY","isTrusted","clipboardData","dropEffect","mouseEventsCollectionBuffer","inputTypeFilter","keys","dataset","virtualKeyboard","target","tagName","includes","registerEventListeners","entries","addSafeInteractionListener","Error while adding listener","filter","handleEvent","getGenericAttributes","getAttachedData","addEventListener","error","error adding interaction listener","eventTypesToAttach","forEach","getData","location","href","change","click"];qi=Xi,$i=394,function(t){for(;--t;)qi.push(qi.shift())}(++$i);var Qi=function(t,e){return Xi[t-=0]};const tn=Qi("0x0"),en=Qi("0x1"),nn=Qi("0x2"),rn=Qi("0x3"),an="mouseup",sn=Qi("0x4"),on=Qi("0x5"),cn=Qi("0x6"),ln=Qi("0x7"),dn=Qi("0x8"),xn=["INPUT","SELECT","TEXTAREA"];class hn{constructor(t,e,i){this[Qi("0x9")]=t,this.mouseEventsCollectionBuffer=e,this[Qi("0xa")]=i,this[Qi("0xb")]={[en]:{eventTypesToAttach:[rn,an,sn],attributesMapper:t=>{var e;return{x:t.x,y:t.y,mouseButtonType:t[Qi("0xc")],isPressed:null==(null===(e=t[Qi("0xd")])||void 0===e?void 0:e.firesTouchEvents)?null:!t.sourceCapabilities[Qi("0xe")],offsetX:t[Qi("0xf")],offsetY:t[Qi("0x10")],target_id:t.target.id}}},[nn]:{attributesMapper:t=>({target_id:t.target.id,isTrusted:t[Qi("0x11")],cancelable:t.cancelable,composed:t.composed,dropEffect:t[Qi("0x12")][Qi("0x13")],effectAllowed:t[Qi("0x12")].effectAllowed})},[on]:{attributesMapper:t=>({target_id:t.target.id})},[rn]:{continousCollectors:[new Vi(this[Qi("0x14")])]},[an]:{continousCollectors:[new Hi(1)]},[sn]:{continousCollectors:[new Hi(1)]},focusout:{eventTypesToAttach:[dn,cn,ln,tn],filter:this[Qi("0x15")],attributesMapper:t=>{const{target:e,isTrusted:i,cancelable:n,composed:r}=t;return l({target_id:e.id,dataset_keys:Object[Qi("0x16")](e[Qi("0x17")]||{}),isTrusted:i,cancelable:n,composed:r},navigator.virtualKeyboard&&{navigator_virtualKeyboard:navigator[Qi("0x18")].overlaysContent})}},[dn]:{filter:this[Qi("0x15")],continousCollectors:[new Yi(50)]},[cn]:{filter:this.inputTypeFilter,continousCollectors:[new Wi(50)]},[ln]:{filter:this.inputTypeFilter,continousCollectors:[new Gi(50)]},[tn]:{continousCollectors:[new Ji(50)]}}}[Qi("0x15")](t){var e;const i=null===(e=t[Qi("0x19")])||void 0===e?void 0:e[Qi("0x1a")];return xn[Qi("0x1b")](i)}[Qi("0x1c")](){for(const[t,e]of Object[Qi("0x1d")](this[Qi("0xb")]))if(!this[Qi("0x9")][Qi("0x1b")](t))try{this[Qi("0x1e")](t,e)}catch(e){wi.error(Qi("0x1f"),{error:e,eventType:t})}}[Qi("0x20")](t,e){return!t[Qi("0x20")]||t[Qi("0x20")](e)}async[Qi("0x21")](t,e,i){const{attributesMapper:n,continousCollectors:r}=t;if(!this[Qi("0x20")](t,e))return!1;if(r)r.forEach((t=>{t.collect(e)}));else{const t=this[Qi("0x22")](),r=this[Qi("0x23")](i),a=l(l(l({},t),n(e)),r&&{attachedEventsData:r});await this.safeEventCallback(i,a)}return!0}[Qi("0x1e")](t,e){window[Qi("0x24")](t,(async i=>{try{await this.handleEvent(e,i,t)}catch(t){wi[Qi("0x25")](Qi("0x26"),{error:t})}}))}[Qi("0x23")](t){let e;const i=this[Qi("0xb")][t][Qi("0x27")];return i&&(e={},i[Qi("0x28")]((t=>{const{continousCollectors:i}=this[Qi("0xb")][t];i&&i[Qi("0x28")]((i=>e[t]=i[Qi("0x29")]()))}))),e}getGenericAttributes(){return{location:window[Qi("0x2a")][Qi("0x2b")]}}}var un,fn,gn=["mobile","wow64","setTimeout","race","catch","warn","name","finally","userAgentData","getHighEntropyValues","model","platform","platformVersion","bitness"];un=gn,fn=232,function(t){for(;--t;)un.push(un.shift())}(++fn);var _n=function(t,e){return gn[t-=0]};function pn(){var t;return null===(t=navigator[_n("0x0")])||void 0===t?void 0:t[_n("0x1")](["architecture",_n("0x2"),_n("0x3"),_n("0x4"),"fullVersionList",_n("0x5"),_n("0x6"),_n("0x7"),"uaFullVersion"])}function yn(t,e){let i;const n=[Promise.resolve(t()).catch((()=>{})),new Promise(((t,n)=>i=window[_n("0x8")](n,e)))];return Promise[_n("0x9")](n)[_n("0xa")]((()=>wi[_n("0xb")]("executor reached timeout",{fnName:t[_n("0xc")]})))[_n("0xd")]((()=>clearTimeout(i)))}var wn,mn,vn=["getCryptoBindingData","bind","getNavigatorPermissionsState","notifications","isGeoLocationExists","isSendBeaconFunction","getInstalledRelatedApps","windowConstructorAliasTest","windowDocumentAuxVarsTest","CDPRuntimeDomainTest","Error","Object","defineProperty","stack","getOwnPropertyNames","document","test","values","getOwnPropertyDescriptors","value","getPrototypeOf","isNodeReachable_","sort","every","Array","Promise","name","getAsyncToken","startPromisesLoop","includes","warn","collectPromisesData","entries","resolve","credentials","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","from","webRTCDisabled","RTCPeerConnection","getWindowBasedKeys","__crWeb","__yb","__ybro","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice","_phantom","__phantomas","Buffer","emit","spawn","domAutomationController","domAutomation","__nightmare","_selenium","calledSelenium","callSelenium","_Selenium_IDE_Recorder","__$webdriverAsyncExecutor","__fxdriver_evaluate","__fxdriver_unwrapped","__lastWatirAlert","__lastWatirPrompt","__selenium_evaluate","__webdriver__chr","__webdriver_script_fn","__webdriver_script_func","__webdriver_script_function","__webdriverFuncgeb","awesomium","calledPhantom","cdc_adoQpoasnfa76pfcZLmcfl_Array","chrome_asyncScriptInfo","fmget_targets","geb","OSMJIF","spynner_additional_js_loaded","watinExpressionResult","push","high","no-preference","low","more","less","forced","100","1000","none","inverted","rec2020","srgb","replace","matches","getMathFingerprint","log","sqrt","exp","acos","acosh","asin","asinh","atanh","atan","sin","sinh","cosh","tan","tanh","expm1","log1p","length","toString","hashCodeString","sessionStorage","localStorage","external","Sequentum","webdriver","__driver_evaluate","__webdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__selenium_unwrapped","_WEBDRIVER_ELEM_CACHE","ChromeDriverw","driver-evaluate","webdriver-evaluate","selenium-evaluate","webdriverCommand","webdriver-evaluate-response","__webdriverFunc","__lastWatirConfirm","$cdc_asdjflasutopfhvcZLmcfl_","serviceWorker","getNavigatorProduct","product","getNavigatorUAData","userAgentData","navigatorStorageEstimation","storage","estimate","onLine","navigatorIsUserActive","permissions","geolocation","sendBeacon","function","getNavigatorPrototype","getOwnPropertyDescriptor","hardwareConcurrency","get","languages","isArray","platform","url","referrer","getPerformanceMemory","indexedDB","DocumentTouch","maxTouchPoints","msMaxTouchPoints","type","suffixes","plugins","description","availHeight","colorDepth","width","pixelDepth","angle","devicePixelRatio","charCodeAt","outerWidth","outerHeight","getWebDriver","orientation","getOsCpu","HTMLElement","prototype","mediaDevices","enumerateDevices","kind","groupId","OfflineAudioContext","createOscillator","triangle","frequency","threshold","ratio","attack","release","connect","destination","start","renderedBuffer","getChannelData","subarray","webkitOfflineAudioContext","createDynamicsCompressor","knee","createAnalyser","startRendering","disconnect","frequencyBinCount","call","fftSize","getFloatTimeDomainData","reduction","getHash","mmMwWLliI0O&1","monospace","sans-serif","serif","sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Clarendon","Futura Bk BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Reference Specialty","MS UI Gothic","MT Extra","Marlett","Minion Pro","Monotype Corsiva","PMingLiU","SCRIPTINA","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","div","hidden","createElement","span","position","top","left","fontSize","10px","map","offsetWidth","offsetHeight","body","appendChild","filter","removeChild","language","getLanguages","deviceMemory","DateTimeFormat","resolvedOptions","timeZone","getVendor","buildID","height","textBaseline","alphabetic","fillStyle","#f60","#069","font",'11pt "Times New Roman"',"Cwm fjordbank gly ","fromCharCode","fillText","toDataURL","globalCompositeOperation","multiply","#f2f","#2ff","#ff2","beginPath","arc","closePath","fill","#f9c","evenodd","rect","isPointInPath","canvas","getContext","getBattery","charging","chargingTime","dischargingTime","brave","isBrave","webgl","WEBGL_debug_renderer_info","UNMASKED_RENDERER_WEBGL","video","canPlayType","video/mp4;;Codecs =avc1.42E01E","getPublicData","isMobile","userAgent","matchMedia","only screen and (max-width: 600px)","sdkDeviceDataCollectionIgnoreList","deviceDataCalculationExpiry","reduce","abs","configManager","getConfValue","cryptoBinding","dataPointsExtractor","lastDeviceData","storageManager","setItemLocalStorageSafe","now","getDeviceData","calculate","dataPoints","getBrave","getCanvasFingerprint","getCodesTests","getConnection","getCookieEnabled","getCryptoRandomValues","getDeviceMemory","getDocumentBasedKeys","getHardwareConcurrency","getIndexedDB","getFIDOEnabled","getLanguage","getTimezoneOffset","getLocalStorage","getNavigatorBasedKeys","getNavigatorUserAgent","getNavigatorHighEntropyData","navigatorOnLine","getMediaMatch","getWindowOrientation","getPlatform","getCpuClass","getAddBehavior","getProductSub","getMediaDevices","getPerformanceTiming","getPlugins","getScreen","hasSequentum","getSessionStorage","getReferrer","getTimezone","getBuildID","getWebGlRenderer"];wn=vn,mn=324,function(t){for(;--t;)wn.push(wn.shift())}(++mn);var bn=function(t,e){return vn[t-=0]};const Sn=bn("0x0"),En=bn("0x1"),Dn=t=>t?[...t][bn("0x2")](((t,e)=>t+Math[bn("0x3")](e)),0):0;class In{constructor(t,e,i){this.storageManager=t,this[bn("0x4")]=e,this.cryptoBinding=i}async calculate(){const t=this[bn("0x4")][bn("0x5")](Sn,[]),e=this[bn("0x4")][bn("0x5")](En,36e5),i=await new Tn(t,this[bn("0x6")])[bn("0x7")]();return this[bn("0x8")]=i,this[bn("0x9")][bn("0xa")](En,Date[bn("0xb")]()+e),i}async[bn("0xc")](){return Number(this[bn("0x9")].getItemLocalStorageSafe(En))<Date[bn("0xb")]()||!this[bn("0x8")]?await this[bn("0xd")]()||{}:this.lastDeviceData||{}}}class Tn{constructor(t,e){this[bn("0x0")]=t,this[bn("0x6")]=e,this[bn("0xe")]={battery:this.getBattery,brave:this[bn("0xf")],canvas:this[bn("0x10")],codecs:this[bn("0x11")],connection:this[bn("0x12")],cookieEnabled:this[bn("0x13")],cryptoRandomValues:this[bn("0x14")],deviceMemory:this[bn("0x15")],documentBasedKeys:this[bn("0x16")],hardwareConcurrency:this[bn("0x17")],indexedDB:this[bn("0x18")],fidoEnabled:this[bn("0x19")],languages:this.getLanguages,language:this[bn("0x1a")],timezoneOffset:this[bn("0x1b")],localStorage:this[bn("0x1c")],navigatorBasedKeys:this[bn("0x1d")],navigatorProduct:this.getNavigatorProduct,navigatorUserAgent:this[bn("0x1e")],navigatorUAData:this.getNavigatorUAData,navigatorHighEntropyData:this[bn("0x1f")],navigatorStorageEstimation:this.navigatorStorageEstimation,navigatorOnLine:this[bn("0x20")],navigatorIsUserActive:this.navigatorIsUserActive,math:this.getMathFingerprint,mediaMatch:this[bn("0x21")],openDatabase:this.getOpenDatabase,windowOrientation:this[bn("0x22")],platform:this[bn("0x23")],cpuClass:this[bn("0x24")],osClass:this.getOsCpu,addBehavior:this[bn("0x25")],productSub:this[bn("0x26")],mediaDevices:this[bn("0x27")],audioFingerprint:this.getAudioFingerprint,audioFingerprintExtended:this.getAudioFingerprintExtended,fonts:this.getFonts,performanceTiming:this[bn("0x28")],performanceMemory:this.getPerformanceMemory,plugins:this[bn("0x29")],screen:this[bn("0x2a")],sequentum:this[bn("0x2b")],sessionStorage:this[bn("0x2c")],referrer:this[bn("0x2d")],timezone:this[bn("0x2e")],touchSupport:this.getTouchSupport,vendor:this.getVendor,buildID:this[bn("0x2f")],webdriver:this.getWebDriver,webGlRenderer:this[bn("0x30")],windowBasedKeys:this.getWindowBasedKeys,windowOuter:this.getWindowOuter,webRTCDisabled:this.webRTCDisabled,cryptoBindingData:this[bn("0x31")][bn("0x32")](this),notificationState:this[bn("0x33")][bn("0x32")](this,bn("0x34")),geolocationState:this.getNavigatorPermissionsState[bn("0x32")](this,"geolocation"),isGeoLocationExists:this[bn("0x35")],isSendBeaconExists:this[bn("0x36")],navigatorPrototype:this.getNavigatorPrototype,installedRelatedApps:this[bn("0x37")],windowConstructorAliasTest:this[bn("0x38")],windowDocumentAuxVarsTest:this[bn("0x39")],CDPRuntimeDomainTest:this.CDPRuntimeDomainTest}}[bn("0x3a")](){let t=!1;const e=new(window[bn("0x3b")]);return window[bn("0x3c")][bn("0x3d")](e,bn("0x3e"),{configurable:!1,enumerable:!1,get:function(){return t=!0,""}}),window.console.debug(e[bn("0x3e")]),t}[bn("0x39")](){for(const t of window[bn("0x3c")][bn("0x3f")](window[bn("0x40")]))if("$chrome_asyncScriptInfo"==t||/^\$cdc_[a-zA-Z0-9]{22}_$/[bn("0x41")](t))return!0;for(const t of window[bn("0x3c")][bn("0x42")](window[bn("0x3c")][bn("0x43")](window[bn("0x40")]))){if(!t.value||void 0===t[bn("0x44")].cache_)continue;const e=window[bn("0x3c")].getOwnPropertyNames(window[bn("0x3c")][bn("0x45")](t[bn("0x44")])),i=["storeItem","retrieveItem",bn("0x46")];if(e[bn("0x47")](),i[bn("0x47")](),e[bn("0x48")](((t,e)=>t==i[e])))return!0}return!1}[bn("0x38")](){const t=window[bn("0x3c")][bn("0x3f")](window);for(const e of t){if(/^cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)$/.test(e))return!0;for(const t of[window[bn("0x49")],window[bn("0x4a")],window.Symbol])if(e!=(null==t?void 0:t[bn("0x4b")])&&"token"!=e&&e!=bn("0x4c")&&window[e]===t)return!0}return!1}async dataPointsExtractor(){const t=this[bn("0x4d")]();return await this.collectPromisesData(t)}startPromisesLoop(){const t={};for(const[e,i]of Object.entries(this[bn("0xe")]))if(!this[bn("0x0")][bn("0x4e")](e))try{t[e]=yn(i,100)}catch(i){wi[bn("0x4f")]("worker throw error",{e:i,key:e}),t[e]=Promise.resolve()}return t}async[bn("0x50")](t){const e={};for(const[i,n]of Object[bn("0x51")](t))try{e[i]=await n}catch(t){wi.warn("worker promise rejected",{e:t,key:i}),e[i]=void 0}return e}[bn("0x13")](){const t=navigator.cookieEnabled;return Promise[bn("0x52")](t)}async[bn("0x19")](){return!!navigator[bn("0x53")]&&await window[bn("0x54")][bn("0x55")]()}getCryptoRandomValues(){const t=window.crypto.getRandomValues(new Uint8Array(16));return Array[bn("0x56")](t)}[bn("0x57")](){const t=null==window[bn("0x58")];return Promise[bn("0x52")](t)}[bn("0x59")](){const t=["chrome","safari",bn("0x5a"),"__gCrWeb","yandex",bn("0x5b"),bn("0x5c"),"__firefox__",bn("0x5d"),bn("0x5e"),bn("0x5f"),bn("0x60"),bn("0x61"),bn("0x62"),bn("0x63"),bn("0x64"),bn("0x65"),"callPhantom",bn("0x66"),bn("0x67"),bn("0x68"),bn("0x69"),bn("0x6a"),bn("0x6b"),bn("0x6c"),bn("0x6d"),bn("0x6e"),bn("0x6f"),bn("0x70"),"__driver_evaluate","__driver_unwrapped",bn("0x71"),bn("0x72"),bn("0x73"),"__lastWatirConfirm",bn("0x74"),bn("0x75"),"__selenium_unwrapped",bn("0x76"),"__webdriver_evaluate",bn("0x77"),bn("0x78"),bn("0x79"),"__webdriver_unwrapped",bn("0x7a"),bn("0x7b"),bn("0x7c"),bn("0x7d"),"cdc_adoQpoasnfa76pfcZLmcfl_Promise","cdc_adoQpoasnfa76pfcZLmcfl_Symbol",bn("0x7e"),bn("0x7f"),bn("0x80"),bn("0x81"),bn("0x82"),"watinExpressionError",bn("0x83")],e=[];for(const i of t){const t=window[i];void 0!==t&&null!=t&&e[bn("0x84")](i)}return Promise[bn("0x52")](e)}[bn("0x21")](){const t={"dynamic-range":[bn("0x85"),"standard"],"prefers-reduced-motion":[bn("0x86"),bn("0x2")],"prefers-contrast":[bn("0x86"),bn("0x85"),bn("0x87"),bn("0x88"),bn("0x89"),bn("0x8a")],"max-monochrome":["0","10",bn("0x8b"),bn("0x8c")],"forced-colors":["active",bn("0x8d")],"inverted-colors":[bn("0x8e"),bn("0x8d")],"color-gamut":[bn("0x8f"),"p3",bn("0x90")]},e={};for(const[i,n]of Object.entries(t))for(const t of n)e[i[bn("0x91")](/-/g,"_")+"_"+t.replace(/-/g,"_")]=window.matchMedia("("+i+": "+t+")")[bn("0x92")];return Promise[bn("0x52")](e)}[bn("0x93")](){const t=[Math[bn("0x97")](.12312423423423424),Math[bn("0x98")](1e308),(e=1e154,Math[bn("0x94")](e+Math[bn("0x95")](e*e-1))),Math[bn("0x99")](.12312423423423424),Math[bn("0x9a")](1),Math[bn("0x94")](1+Math[bn("0x95")](2)),Math[bn("0x9b")](.5),Math.log(3)/2,Math[bn("0x9c")](.5),Math[bn("0x9d")](-1e300),Math[bn("0x9e")](1),Math[bn("0x96")](1)-1/Math[bn("0x96")](1)/2,Math.cos(10.000000000123),Math[bn("0x9f")](1),(Math[bn("0x96")](1)+1/Math[bn("0x96")](1))/2,Math[bn("0xa0")](-1e300),Math[bn("0xa1")](1),(Math.exp(2)-1)/(Math.exp(2)+1),Math[bn("0x96")](1),Math[bn("0xa2")](1),Math[bn("0x96")](1)-1,Math[bn("0xa3")](10),Math[bn("0x94")](11),Math.PI**-100];var e;let i="";for(let e=0;e<t[bn("0xa4")];e++)i+=t[e][bn("0xa5")]();return Promise.resolve(Tn[bn("0xa6")](i))}getConnection(){const{connection:t}=navigator,e=(t=>{let{downlink:e,effectiveType:i,rtt:n,saveData:r}=t;return{downlink:e,effectiveType:i,rtt:n,saveData:r}})(t);return Promise.resolve(e)}[bn("0x2c")](){return Promise.resolve(!!window[bn("0xa7")])}[bn("0x1c")](){return Promise.resolve(!!window[bn("0xa8")])}[bn("0x2b")](){return-1!==window[bn("0xa9")][bn("0xa5")]().indexOf(bn("0xaa"))}[bn("0x1d")](){return[bn("0xab"),bn("0xac"),bn("0xad"),bn("0x75"),"__fxdriver_evaluate",bn("0xae"),bn("0xaf"),bn("0xb0"),bn("0x72"),"_Selenium_IDE_Recorder","_selenium",bn("0x6d"),bn("0xb1"),bn("0xb2"),bn("0xb3"),bn("0xb4"),bn("0xb5"),bn("0xb6"),bn("0xb7"),bn("0xb8"),bn("0x77"),bn("0x70"),bn("0x73"),bn("0xb9"),bn("0x74"),"$chrome_asyncScriptInfo",bn("0xba"),bn("0xbb")].filter((t=>navigator[t]))}[bn("0xbc")](){const t=navigator[bn("0xbd")];return Promise[bn("0x52")](t)}[bn("0x1e")](){return navigator.userAgent}[bn("0xbe")](){return navigator[bn("0xbf")]}[bn("0x1f")](){return pn()}[bn("0xc0")](){return navigator[bn("0xc1")][bn("0xc2")]()}[bn("0x20")](){return navigator[bn("0xc3")]}[bn("0xc4")](){return navigator.userActivation.isActive}async[bn("0x33")](t){try{const e=await navigator[bn("0xc5")].query({name:t});return null==e?void 0:e.state}catch(t){}}isGeoLocationExists(){return!!navigator[bn("0xc6")]}isSendBeaconFunction(){return typeof navigator[bn("0xc7")]===bn("0xc8")}[bn("0xc9")](){return{hardwareConcurrency:Object[bn("0xca")](Object[bn("0x45")](navigator),bn("0xcb"))[bn("0xcc")][bn("0xa5")](),languages:Object[bn("0xca")](Object[bn("0x45")](navigator),bn("0xcd"))[bn("0xcc")].toString()}}async[bn("0x37")](){if(typeof navigator[bn("0x37")]===bn("0xc8"))try{const{related_applications:t}=await navigator[bn("0x37")]();if(t&&Array[bn("0xce")](t))return t.map((t=>({platform:t[bn("0xcf")],url:t[bn("0xd0")]})))}catch(t){}}[bn("0x2d")](){return document[bn("0xd1")]}[bn("0x28")](){return performance.timing}[bn("0xd2")](){const{jsHeapSizeLimit:t,totalJSHeapSize:e,usedJSHeapSize:i}=performance.memory;return{jsHeapSizeLimit:t,totalJSHeapSize:e,usedJSHeapSize:i}}[bn("0x18")](){return Promise[bn("0x52")](!!window[bn("0xd3")])}getOpenDatabase(){const{openDatabase:t}=window;return Promise.resolve(!!t)}getTouchSupport(){const t=window[bn("0xd4")]&&document instanceof DocumentTouch,e={maxTouchPoints:navigator[bn("0xd5")]||navigator[bn("0xd6")]||0,documentTouch:t,ontouchstart:"ontouchstart"in window};return Promise.resolve(e)}getPlugins(){function t(t){const e=[];for(let i=0;i<t.length;++i)e[bn("0x84")]({type:t[i][bn("0xd7")],suffixes:t[i][bn("0xd8")]});return e}const e=[];for(let i=0;i<navigator[bn("0xd9")][bn("0xa4")];++i){const n=navigator.plugins[i];n&&e[bn("0x84")]({name:n[bn("0x4b")],description:n[bn("0xda")],mimeTypes:t(n)})}return Promise[bn("0x52")](e)}[bn("0x2a")](){const t=window.screen||screen,{availLeft:e}=t,{availTop:i}=t,n={availHeight:t[bn("0xdb")],availLeft:e,availTop:i,availWidth:t.availWidth,colorDepth:t[bn("0xdc")],height:t.height,width:t[bn("0xdd")],pixelDepth:t[bn("0xde")],orientationAngle:t.orientation&&t.orientation[bn("0xdf")],orientationType:t.orientation&&t.orientation.type,devicePixelRatio:window[bn("0xe0")]};return Promise[bn("0x52")](n)}static[bn("0xa6")](t){if(null==t)return;let e=0,i=0;const n=t[bn("0xa4")];for(;i<n;)e=(e<<5)-e+t[bn("0xe1")](i++)|0;return e}getWindowOuter(){const t={outerWidth:window[bn("0xe2")],outerHeight:window[bn("0xe3")]};return Promise[bn("0x52")](t)}[bn("0xe4")](){const t=navigator[bn("0xab")];return Promise[bn("0x52")](t)}getWindowOrientation(){const t=window[bn("0xe5")];return Promise.resolve(t)}[bn("0x23")](){const t=navigator.platform;return Promise[bn("0x52")](t)}[bn("0x24")](){const t=navigator.cpuClass;return Promise[bn("0x52")](t)}[bn("0xe6")](){const t=navigator.oscpu;return Promise[bn("0x52")](t)}[bn("0x25")](){const t=!!window[bn("0xe7")][bn("0xe8")].addBehavior;return Promise[bn("0x52")](t)}[bn("0x26")](){const t=navigator.productSub;return Promise[bn("0x52")](t)}async[bn("0x27")](){const t=await navigator[bn("0xe9")][bn("0xea")](),e=[];for(const i of t)e.push({kind:i[bn("0xeb")],label:i.label,deviceId:i.deviceId,groupId:i[bn("0xec")]});return e}async getAudioFingerprint(){const t=window[bn("0xed")]||window.webkitOfflineAudioContext;if(!t)return-1;const e=new t(1,5e3,44100),i=e[bn("0xee")]();i.type=bn("0xef"),i[bn("0xf0")][bn("0x44")]=1e4;const n=e.createDynamicsCompressor();n[bn("0xf1")][bn("0x44")]=-50,n.knee[bn("0x44")]=40,n[bn("0xf2")][bn("0x44")]=12,n[bn("0xf3")][bn("0x44")]=0,n[bn("0xf4")][bn("0x44")]=.25,i[bn("0xf5")](n),n[bn("0xf5")](e[bn("0xf6")]),i[bn("0xf7")](0);const r=new Promise((async(t,i)=>{e.oncomplete=e=>t(e[bn("0xf8")]);try{await e.startRendering()}catch(t){i(t)}})),a=(await r)[bn("0xf9")](0)[bn("0xfa")](4500);return Tn.getHash(a)}async getAudioFingerprintExtended(){var t;const e=window[bn("0xed")]||window[bn("0xfb")];if(!e)return{};const i=new e(1,5e3,44100),n=i.createOscillator();n[bn("0xd7")]=bn("0xef"),n[bn("0xf0")][bn("0x44")]=1e4;const r=i[bn("0xfc")]();r[bn("0xf1")].value=-50,r[bn("0xfd")].value=40,r.attack[bn("0x44")]=0;const a=i[bn("0xfe")]();n.connect(r),r.connect(a),r[bn("0xf5")](i[bn("0xf6")]),n[bn("0xf7")](0);try{await i[bn("0xff")](),r[bn("0x100")](),n.disconnect();const e=new Float32Array(a[bn("0x101")]);null===(t=a.getFloatFrequencyData)||void 0===t||t[bn("0x102")](a,e);const s=new Float32Array(a[bn("0x103")]);return"getFloatTimeDomainData"in a&&a[bn("0x104")](s),{gain:r[bn("0x105")][bn("0x44")]||r[bn("0x105")],freq:Dn(e),time:Dn(s)}}catch(t){return{}}}static[bn("0x106")](t){let e=0;for(let i=0;i<t[bn("0xa4")];++i)e+=Math[bn("0x3")](t[i]);return e}getFonts(){const t=bn("0x107"),e=[bn("0x108"),bn("0x109"),bn("0x10a")],i=[bn("0x10b"),bn("0x10c"),bn("0x10d"),bn("0x10e"),"Arial Unicode MS",bn("0x10f"),bn("0x110"),bn("0x111"),bn("0x112"),bn("0x113"),"Century","Century Gothic",bn("0x114"),"EUROSTILE","Franklin Gothic",bn("0x115"),"Futura Md BT",bn("0x116"),bn("0x117"),bn("0x118"),bn("0x119"),"Helvetica Neue",bn("0x11a"),bn("0x11b"),bn("0x11c"),bn("0x11d"),bn("0x11e"),bn("0x11f"),bn("0x120"),bn("0x121"),"MS Outlook",bn("0x122"),bn("0x123"),bn("0x124"),"MYRIAD PRO",bn("0x125"),"Meiryo UI","Microsoft Uighur",bn("0x126"),bn("0x127"),bn("0x128"),"Pristina",bn("0x129"),"Segoe UI Light",bn("0x12a"),bn("0x12b"),bn("0x12c"),bn("0x12d"),bn("0x12e"),bn("0x12f"),bn("0x130"),"ZWAdobeF"],n=document.createElement(bn("0x131"));n.style.visibility=bn("0x132");const r={},a={},s=e=>{const i=document[bn("0x133")](bn("0x134")),{style:r}=i;return r[bn("0x135")]="absolute",r[bn("0x136")]="0",r[bn("0x137")]="0",r.fontFamily=e,r[bn("0x138")]=bn("0x139"),i.textContent=t,n.appendChild(i),i},o=(t,e)=>s("'"+t+"',"+e),c=e.map(s),l=(()=>{const t={};for(const n of i)t[n]=e[bn("0x13a")]((t=>o(n,t)));return t})();document[bn("0x13d")][bn("0x13e")](n);try{for(let t=0;t<e[bn("0xa4")];t++)r[e[t]]=c[t].offsetWidth,a[e[t]]=c[t].offsetHeight;const t=i[bn("0x13f")]((t=>{return i=l[t],e.some(((t,e)=>i[e][bn("0x13b")]!==r[t]||i[e][bn("0x13c")]!==a[t]));var i}));return Promise.resolve(t)}finally{document[bn("0x13d")][bn("0x140")](n)}}[bn("0x1b")](){const t=(new Date)[bn("0x1b")]();return Promise.resolve(t)}[bn("0x1a")](){const t=navigator[bn("0x141")];return Promise.resolve(t)}[bn("0x142")](){const t=navigator[bn("0xcd")];return Promise[bn("0x52")](t)}[bn("0x17")](){const t=navigator[bn("0xcb")];return Promise.resolve(t)}[bn("0x15")](){const t=navigator[bn("0x143")];return Promise[bn("0x52")](t)}[bn("0x16")](){return[bn("0xad"),bn("0x75"),"__webdriver_script_function",bn("0x78"),bn("0x77"),"__fxdriver_evaluate",bn("0xae"),bn("0xaf"),bn("0xac"),bn("0xb0"),bn("0x72")][bn("0x13f")]((t=>document[t]))}[bn("0x2e")](){const t=Intl[bn("0x144")]()[bn("0x145")]()[bn("0x146")];return Promise[bn("0x52")](t)}[bn("0x147")](){const t=navigator.vendor;return Promise[bn("0x52")](t)}[bn("0x2f")](){const t=navigator[bn("0x148")];return Promise[bn("0x52")](t)}async getCanvasFingerprint(){const t=document[bn("0x133")](bn("0x162"));t[bn("0xdd")]=1,t[bn("0x149")]=1;const e=t[bn("0x163")]("2d"),i={winding:function(t){return t[bn("0x160")](0,0,10,10),t.rect(2,2,6,6),!t[bn("0x161")](5,5,"evenodd")}(e),geometry:function(t,e){t[bn("0xdd")]=122,t[bn("0x149")]=110,e[bn("0x155")]=bn("0x156");const i=[[bn("0x157"),40,40],[bn("0x158"),80,40],[bn("0x159"),60,80]];for(const[t,n,r]of i)e[bn("0x14c")]=t,e[bn("0x15a")](),e[bn("0x15b")](n,r,40,0,2*Math.PI,!0),e[bn("0x15c")](),e[bn("0x15d")]();return e[bn("0x14c")]=bn("0x15e"),e[bn("0x15b")](60,60,60,0,2*Math.PI,!0),e.arc(60,60,20,0,2*Math.PI,!0),e[bn("0x15d")](bn("0x15f")),Tn[bn("0xa6")](t[bn("0x154")]())}(t,e),text:function(t,e){t[bn("0xdd")]=240,t[bn("0x149")]=60,e[bn("0x14a")]=bn("0x14b"),e[bn("0x14c")]=bn("0x14d"),e.fillRect(100,1,62,20),e[bn("0x14c")]=bn("0x14e"),e[bn("0x14f")]=bn("0x150");const i=bn("0x151")+String[bn("0x152")](55357,56835);return e[bn("0x153")](i,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e[bn("0x14f")]="18pt Arial",e[bn("0x153")](i,4,45),Tn[bn("0xa6")](t[bn("0x154")]())}(t,e)};return Promise[bn("0x52")](i)}async[bn("0x164")](){const t=await navigator[bn("0x164")]();return{charging:t[bn("0x165")],chargingTime:t[bn("0x166")],dischargingTime:t[bn("0x167")],level:t.level}}async[bn("0xf")](){return!!navigator[bn("0x168")]&&await navigator[bn("0x168")][bn("0x169")]()}async getWebGlRenderer(){const t=document[bn("0x133")](bn("0x162")),e=t.getContext(bn("0x16a"))||t[bn("0x163")]("webgl-experimental"),i=e.getExtension(bn("0x16b"));return Promise.resolve(e.getParameter(i[bn("0x16c")]))}async[bn("0x11")](){const t=document[bn("0x133")](bn("0x16d")),e={basic:""===t.canPlayType('video/mp4; codecs="avc1.42E01E"'),advanced:""===t[bn("0x16e")](bn("0x16f"))};return Promise[bn("0x52")](e)}async[bn("0x31")](){const{publicKey:t,keyIdentifier:e}=await this.cryptoBinding[bn("0x170")]();return{publicKey:t,keyIdentifier:e}}static[bn("0x171")](){return/iPhone|iPad|iPod|Android|MiuiBrowser/i.test(navigator[bn("0x172")])||null!=window[bn("0xe5")]||window[bn("0x173")](bn("0x174")).matches}}var kn,An,Pn=["uncompressed","ALLOW","DENY","TRUST","compress","compressed"];kn=Pn,An=490,function(t){for(;--t;)kn.push(kn.shift())}(++An);var Cn,Rn,Mn,On,Kn=function(t,e){return Pn[t-=0]};(Rn=Cn||(Cn={}))[Kn("0x0")]=Kn("0x1"),Rn[Kn("0x2")]="uncompressed",(On=Mn||(Mn={}))[Kn("0x3")]=Kn("0x3"),On.CHALLENGE="CHALLENGE",On[Kn("0x4")]=Kn("0x4"),On[Kn("0x5")]=Kn("0x5");var Ln,Nn,zn=["encode","AES-GCM","encrypt","exportKey","raw","stringify","RSA-OAEP","arrayBufferToBase64","btoa","importPublicKey","jwk","parse","SHA-256","generateSymKey","configManager","crypto","subtle","generateKey","decrypt","encryptPayload"];Ln=zn,Nn=494,function(t){for(;--t;)Ln.push(Ln.shift())}(++Nn);var Bn=function(t,e){return zn[t-=0]};class Un{constructor(t){this[Bn("0x0")]=t}generateSymKey(){return window[Bn("0x1")][Bn("0x2")][Bn("0x3")]({name:"AES-GCM",length:256},!0,["encrypt",Bn("0x4")])}async[Bn("0x5")](t,e){const i="string"==typeof t?(new TextEncoder)[Bn("0x6")](t):t,n=window[Bn("0x1")].getRandomValues(new Uint8Array(12)),r={name:Bn("0x7"),iv:n},a=await window.crypto.subtle[Bn("0x8")](r,e,i);return{payloadCipherText:this.arrayBufferToBase64(a),iv:n}}async encryptSymKeyBundle(t,e,i){const n=await window[Bn("0x1")].subtle[Bn("0x9")](Bn("0xa"),t),r=this.arrayBufferToBase64(n),a=this.arrayBufferToBase64(e),s=(new TextEncoder)[Bn("0x6")](JSON[Bn("0xb")]({symKey:r,iv:a})),o=await window[Bn("0x1")][Bn("0x2")].encrypt({name:Bn("0xc")},i,s);return this.arrayBufferToBase64(o)}[Bn("0xd")](t){let e="";const i=new Uint8Array(t),n=i.byteLength;for(let t=0;t<n;t++)e+=String.fromCharCode(i[t]);return window[Bn("0xe")](e)}[Bn("0xf")](t){return window[Bn("0x1")].subtle.importKey(Bn("0x10"),JSON[Bn("0x11")](t),{name:Bn("0xc"),hash:Bn("0x12")},!0,["encrypt"])}async[Bn("0x8")](t,e){if(!window[Bn("0x1")]||!window[Bn("0x1")][Bn("0x2")])throw new Error("crypto is not supported");const i=await this[Bn("0x13")](),{payloadCipherText:n,iv:r}=await this[Bn("0x5")](e,i),a=await this[Bn("0xf")](t);return{encryptedData:n,encryptedKey:await this.encryptSymKeyBundle(i,r,a)}}}var Fn,jn,Zn=["client","SERVER","COMMUNICATION","communication","errorSpace","message","error","toString","name",", errorCode: ","errorCode","toLog"];Fn=Zn,jn=384,function(t){for(;--t;)Fn.push(Fn.shift())}(++jn);var Vn,Hn,Gn=function(t,e){return Zn[t-=0]};(Hn=Vn||(Vn={})).CLIENT=Gn("0x0"),Hn[Gn("0x1")]="server",Hn[Gn("0x2")]=Gn("0x3");class Wn extends Error{constructor(t,e,i){var n,r;super(),this.error=t,this[Gn("0x4")]=e,this.errorCode=i,this[Gn("0x5")]=(null===(n=this[Gn("0x6")])||void 0===n?void 0:n[Gn("0x5")])||this[Gn("0x6")][Gn("0x7")](),this.name=(null===(r=this.error)||void 0===r?void 0:r[Gn("0x8")])||Wn.name}[Gn("0x7")](){return"SDKError: "+this[Gn("0x5")]+(this[Gn("0x4")]?", errorSpace: "+this.errorSpace:"")+(this.errorCode?Gn("0x9")+this[Gn("0xa")]:"")}[Gn("0xb")](){return l(l({name:this[Gn("0x8")],message:this[Gn("0x5")]},this[Gn("0x4")]&&{errorSpace:this[Gn("0x4")]}),this[Gn("0xa")]&&{errorCode:this[Gn("0xa")]})}}var Yn,Jn,qn=["type","addEventToLocalStorage","length","flush","Error while emitting event","errorCode","toLog","min","catch","error","Error while emitting event (delayed flush)","getClientId","refreshSessionToken","sendDeviceDataEvent","Failed to refresh data","isTokenExpired","attributes","navigatorHighEntropyData","popAllEvents","fetchEventsFromLocalStorage","pop","sort","clientId","getDeviceId","userId","getUserId","sdkPlatform","getPublicData","keyIdentifier","warn","Crypto-binding is not supported. ","buildEncryptedRequestBody","getRotationData","data","signature","requestsManager","postData","device/events","headers","find","value","handleRotateResponse","deviceId","setDeviceId","sessionToken","setSessionToken","cleanLocalStorageEvents","Encryption error - missing public key","COMMUNICATION","stringify","compressData","encrypt","uncompressed","Failed to compress data, sending the data to the service uncompressed","storageManager","getItemLocalStorageSafe","parseInt","setItemLocalStorageSafe","shouldSendDeviceEvent","now","info","getDeviceData","emitEvent","sendPageLoadEvent","extractWindowRespurces","location","referrer","history","performance","getEntriesByType","resources","isArray","name","initiatorType","registerEventListeners","parse","removeItemLocalStorageSafe","ddls","lastDeviceInDeviceEvent","rei","lse","mouseEventsCollectionBuffer","deviceEventDataCollectionIgnoreList","publicKey","bufferSize","bufferInterval","EVENT_TYPE_IDENTIFICATION","localStoredEventTypes","configManager","deviceDataManager","cryptoBinding","serverPath","enableSessionToken","eventIndex","flushTimeoutHandle","safeEventCallback","EVENT_TYPE_INTERACTION","eventsQueue","interactionEventsManager","getConfValue","isMobile","eventTypesToStore","EVENT_TYPE_ACTION","maxEventStored","pollingInterval","pollingSessionToken","increaseEventIndex","toString","platform","sdkVersion","identityManager","getTabId","timestamp","enrichUADataIfDoesNotExist","includes"];Yn=qn,Jn=307,function(t){for(;--t;)Yn.push(Yn.shift())}(++Jn);var $n=function(t,e){return qn[t-=0]};const Xn=$n("0x0"),Qn=$n("0x1"),tr=$n("0x2"),er=$n("0x3"),ir=$n("0x4"),nr=$n("0x5"),rr=$n("0x6"),ar=$n("0x7"),sr=$n("0x8"),or=[Pi.EVENT_TYPE_ACTION,Pi[$n("0x9")]],cr=$n("0xa");class lr{constructor(t,e,i,n,r,a,s,o){this[$n("0xb")]=t,this.storageManager=e,this[$n("0xc")]=i,this.requestsManager=n,this.identityManager=r,this[$n("0xd")]=a,this[$n("0xe")]=s,this[$n("0xf")]=o,this[$n("0x10")]=null,this[$n("0x11")]=null,this[$n("0x12")]=async(t,e)=>{try{const i=l({},l({interaction_type:t},e)),n={type:Pi[$n("0x13")],attributes:i};return await this.emitEvent(n)}catch(t){}},this[$n("0xf")]=o,this[$n("0x14")]=[],this.crypto=new Un(t),this[$n("0x15")]=new hn(this[$n("0xb")][$n("0x16")](nr,[]),this[$n("0xb")].getConfValue(ir,100),this[$n("0x12")]),this[$n("0x17")]=Tn[$n("0x17")](),this[$n("0x18")]=this[$n("0xb")].getConfValue(cr,[Pi[$n("0x19")]]),this[$n("0x1a")]=this[$n("0xb")][$n("0x16")]("maxLocalStoredEvents",4),this[$n("0x1b")]=36e4,this[$n("0x1c")]()}async emitEvent(t){t.index=this[$n("0x1d")](),t.location=location[$n("0x1e")](),t.platform=navigator[$n("0x1f")],t[$n("0x20")]="1.52.6",t[$n("0xe")]=this.serverPath,t.tabId=this[$n("0x21")][$n("0x22")](),t[$n("0x23")]=Date.now(),await this[$n("0x24")](t);let e=0;this[$n("0x18")][$n("0x25")](t[$n("0x26")])?e=this[$n("0x27")](t):this[$n("0x14")].push(t);const i=this[$n("0xb")][$n("0x16")](ar,2);if(this[$n("0x14")][$n("0x28")]+e>=i||or[$n("0x25")](t[$n("0x26")])){this[$n("0x11")]&&(clearTimeout(this[$n("0x11")]),this.flushTimeoutHandle=null);try{return await this[$n("0x29")]()}catch(e){throw wi.error($n("0x2a"),{clientId:this.identityManager.getClientId(),eventType:t[$n("0x26")],error:e[$n("0x2b")]?e[$n("0x2c")]():e}),e}}if(!this[$n("0x11")]&&this[$n("0x14")].length>0){const e=this[$n("0xb")][$n("0x16")](sr,2),i=Math[$n("0x2d")](e,30);this[$n("0x11")]=setTimeout((()=>{this[$n("0x11")]=null,this[$n("0x29")]()[$n("0x2e")]((e=>{wi[$n("0x2f")]($n("0x30"),{clientId:this[$n("0x21")][$n("0x31")](),eventType:t[$n("0x26")],error:e[$n("0x2b")]?e[$n("0x2c")]():e})}))}),1e3*i)}return{}}async[$n("0x32")](){try{return this.eventsQueue[$n("0x28")]>0?await this[$n("0x29")]():(await this[$n("0x33")](!0),await this.flush())}catch(t){wi[$n("0x2f")]($n("0x34"),{e:t})}}async[$n("0x1c")](){try{this[$n("0x21")][$n("0x35")]()&&await this[$n("0x32")]()}catch(t){wi.error("Failed to polling data",{e:t})}finally{setTimeout((async()=>{await this.pollingSessionToken()}),this[$n("0x1b")])}}async[$n("0x24")](t){var e;if(!(null===(e=t.attributes)||void 0===e?void 0:e.navigatorHighEntropyData))try{t[$n("0x36")][$n("0x37")]=await pn()}catch(t){}}[$n("0x38")](){const t=[],e=this[$n("0x39")]();for(;this[$n("0x14")].length;)t.push(this.eventsQueue[$n("0x3a")]());return(null==e?void 0:e[$n("0x28")])&&t.push(...e),t[$n("0x3b")](((t,e)=>t[$n("0x23")]-e[$n("0x23")]))}async flush(){const t=this[$n("0x38")]();if(0===t[$n("0x28")])return{};const e={};e[$n("0x3c")]=this.identityManager[$n("0x31")](),e.deviceId=this[$n("0x21")][$n("0x3d")](),e[$n("0x3e")]=this[$n("0x21")][$n("0x3f")](),e[$n("0x40")]=this[$n("0x17")]?Oi:Mi,e.events=t;try{const{keyIdentifier:t}=await this.cryptoBinding[$n("0x41")]();e[$n("0x42")]=t}catch(t){wi[$n("0x43")]($n("0x44")+t)}this[$n("0xf")]&&(e.sessionToken=!0);const i=await this[$n("0x45")](e,!0),n=await this[$n("0xd")][$n("0x46")]();let r;n&&(r=[{type:"key_rotation_data",data:n[$n("0x47")],signature:n[$n("0x48")]}]);const a=await this[$n("0x49")][$n("0x4a")]($n("0x4b"),l(l({},i),r?{headers:r}:{}));if(a[$n("0x4c")]){const t=a[$n("0x4c")][$n("0x4d")]((t=>"key_rotation_status"===t[$n("0x26")]));t&&t[$n("0x4e")]&&this[$n("0xd")][$n("0x4f")](t[$n("0x4e")])}return a[$n("0x50")]&&this[$n("0x21")][$n("0x51")](a[$n("0x50")]),a[$n("0x52")]&&this.identityManager[$n("0x53")](a[$n("0x52")]),a[$n("0x3e")]&&this[$n("0x21")].setUserId(a[$n("0x3e")]),this[$n("0x54")](),a}async[$n("0x45")](t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.configManager[$n("0x16")](rr,null);if(null===i&&e)return await this[$n("0xb")].refreshConf(this[$n("0x21")][$n("0x31")]()),await this[$n("0x45")](t);if(null===i)throw new Wn(new Error($n("0x55")),Vn[$n("0x56")]);try{const e=JSON[$n("0x57")](t),n=this[$n("0x58")](e),r=n||e,{encryptedData:a,encryptedKey:s}=await this.crypto[$n("0x59")](i,r);return{data:a,key:s,dataType:n?Cn.compress:Cn[$n("0x5a")]}}catch(t){throw new Wn(t,Vn.CLIENT)}}[$n("0x58")](t){try{return ii(t)}catch(t){wi[$n("0x2f")]($n("0x5b"),{clientId:this[$n("0x21")][$n("0x31")](),error:t})}}increaseEventIndex(){if(null===this[$n("0x10")]){const t=this[$n("0x5c")][$n("0x5d")](tr),e=Number[$n("0x5e")](t);this.eventIndex=Number.isNaN(e)?-1:e}return this.eventIndex++,this[$n("0x5c")][$n("0x5f")](tr,this[$n("0x10")][$n("0x1e")]()),this[$n("0x10")]}[$n("0x60")](){const t=this[$n("0x5c")][$n("0x5d")](Xn),e=this.storageManager[$n("0x5d")](Qn);return!t||!e||Date[$n("0x61")]()-t>864e5||e!=this[$n("0x21")][$n("0x3d")]()}async[$n("0x33")](t){if(!t&&!this.shouldSendDeviceEvent())return wi[$n("0x62")]("no need to send device event"),!1;const e=await this[$n("0xc")][$n("0x63")](),i={type:Pi.EVENT_TYPE_DEVICE,attributes:e},n=await this[$n("0x64")](i);return n&&(this[$n("0x5c")][$n("0x5f")](Xn,Date[$n("0x61")]()),this.storageManager[$n("0x5f")](Qn,this[$n("0x21")][$n("0x3d")]())),n}async[$n("0x65")](){const t="page_load";if(this[$n("0xb")][$n("0x16")](nr,[])[$n("0x25")](t))return!1;const e=this[$n("0x66")]();return await this[$n("0x64")]({type:Pi.EVENT_TYPE_INTERACTION,attributes:l(l({interaction_type:t,location:window[$n("0x67")].href,referrer:document[$n("0x68")]},window[$n("0x69")]&&{window_historyLength:window.history[$n("0x28")]}),e&&{windowResources:e})}),!0}[$n("0x66")](){try{const t=window[$n("0x6a")][$n("0x6b")]($n("0x6c"));return t&&Array[$n("0x6d")](t)?t.map((t=>({name:t[$n("0x6e")],initiatorType:t[$n("0x6f")]}))):void 0}catch(t){}}registerEventListeners(){this.interactionEventsManager.registerEventListeners(),this[$n("0x21")][$n("0x70")]()}[$n("0x39")](){const t=this.storageManager[$n("0x5d")](er);return t?JSON[$n("0x71")](t):[]}addEventToLocalStorage(t){const e=this[$n("0x39")]();return Bi.maintainLastXItems(e,this[$n("0x1a")],t),this[$n("0x5c")].setItemLocalStorageSafe(er,JSON[$n("0x57")](e)),e[$n("0x28")]}[$n("0x54")](){this[$n("0x5c")][$n("0x72")](er)}}var dr,xr,hr=["beforeunload","saveTabIdOnUnload","getDeviceId","deviceId","setDeviceId","info","Updating DeviceId","setItemLocalStorageSafe","getItemSessionStorageSafe","getItemLocalStorageSafe","setItemSessionStorageSafe","getUserId","configManager","getConfValue","now","removeUserId","userId","removeItemSessionStorageSafe","removeItemLocalStorageSafe","random","MAX_SAFE_INTEGER","toString","getTabId","setSessionToken","isTokenExpired","getSessionToken","parse","split","exp","iat","rci","rdi","rdit","rti","rst","userIdStorageExpiry","storageManager","clientId","setClientId","load","loadDeviceId","loadTabId","registerEventListeners","addEventListener"];dr=hr,xr=426,function(t){for(;--t;)dr.push(dr.shift())}(++xr);var ur=function(t,e){return hr[t-=0]};const fr="rui",gr=ur("0x0"),_r=ur("0x1"),pr=ur("0x2"),yr=ur("0x3"),wr=ur("0x4"),mr=ur("0x5");class vr{constructor(t,e,i){this[ur("0x6")]=t,this.configManager=e,this[ur("0x7")]=i,this[ur("0x8")](this[ur("0x7")])}[ur("0x9")](){this[ur("0xa")](),this[ur("0xb")]()}[ur("0xc")](){window[ur("0xd")](ur("0xe"),(async()=>this[ur("0xf")]()))}[ur("0x10")](){return this[ur("0x11")]}[ur("0x12")](t){this.deviceId!==t&&(wi[ur("0x13")](ur("0x14"),{deviceId:t}),this[ur("0x11")]=t,this.storageManager.setItemSessionStorageSafe(_r,t),this.storageManager[ur("0x15")](_r,t))}[ur("0xa")](){const t=this[ur("0x6")][ur("0x16")](_r)||this.storageManager[ur("0x17")](_r);return null!=t&&this.setDeviceId(t),t}getClientId(){return this.clientId}[ur("0x8")](t){this[ur("0x6")].getClientId()!=t&&this[ur("0x6")][ur("0x8")](t),this[ur("0x6")][ur("0x18")](gr,t)}[ur("0x19")](){if(Number(this[ur("0x6")].getItemLocalStorageSafe(pr))+this[ur("0x1a")][ur("0x1b")](mr,864e5)<Date[ur("0x1c")]())return this[ur("0x1d")](),null;const t=this.storageManager[ur("0x16")](fr);return null!=t?t:this[ur("0x6")][ur("0x17")](fr)}setUserId(t){this[ur("0x1e")]=t,this[ur("0x6")].setItemSessionStorageSafe(fr,t),this[ur("0x6")][ur("0x15")](fr,t),this.storageManager[ur("0x15")](pr,Date[ur("0x1c")]())}[ur("0x1d")](){this[ur("0x6")][ur("0x1f")](fr),this[ur("0x6")].removeItemLocalStorageSafe(fr),this[ur("0x6")][ur("0x20")](pr)}[ur("0xb")](){const t=this.storageManager[ur("0x16")](yr);t?(this.storageManager[ur("0x1f")](yr),this.tabId=t):this.tabId=Math.floor(Math[ur("0x21")]()*Number[ur("0x22")])[ur("0x23")]()}[ur("0x24")](){return this.tabId}saveTabIdOnUnload(){this.storageManager.setItemSessionStorageSafe(yr,this.tabId)}[ur("0x25")](t){this[ur("0x6")][ur("0x15")](wr,t)}getSessionToken(){return this[ur("0x6")][ur("0x17")](wr)||this[ur("0x6")][ur("0x16")](wr)}[ur("0x26")](){var t;const e=this[ur("0x27")]();if(!e)return!0;try{const i=JSON[ur("0x28")](atob(e[ur("0x29")](".")[1]));let n=(null!==(t=i[ur("0x2a")])&&void 0!==t?t:i[ur("0x2b")])*(i.exp&&i[ur("0x2a")]<1e12?1e3:1);return i[ur("0x2a")]||(n+=9e5),Date[ur("0x1c")]()>=n}catch(t){return wi.error("Invalid JWT:",{error:t}),!0}}}var br,Sr,Er=["serverPath","postDataFromURL","POST","include","application/json","stringify","GET","callServer","fetch-api is not supported","CLIENT","json","status","message","COMMUNICATION","postData"];br=Er,Sr=134,function(t){for(;--t;)br.push(br.shift())}(++Sr);var Dr=function(t,e){return Er[t-=0]};class Ir{constructor(t){this.serverPath=t}async[Dr("0x0")](t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.postDataFromURL(this[Dr("0x1")]+t,e,i)}async[Dr("0x2")](t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={method:Dr("0x3"),credentials:Dr("0x4"),headers:new Headers(l({"Content-Type":Dr("0x5")},i)),body:JSON[Dr("0x6")](e)};return await this.callServer(t,n)}async getData(t){const e=this[Dr("0x1")]+t,i={method:Dr("0x7"),credentials:"include"};return await this[Dr("0x8")](e,i)}async[Dr("0x8")](t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!("fetch"in window))throw new Wn(new Error(Dr("0x9")),Vn[Dr("0xa")]);try{const i=await fetch(t,e),n=await i[Dr("0xb")]();if(i.ok)return n;throw new Wn(new Error(n.message||i.statusText),Vn.SERVER,i[Dr("0xc")])}catch(t){if(!(t instanceof Wn))throw new Wn(new Error(t[Dr("0xd")]),Vn[Dr("0xe")]);throw t}}}var Tr,kr,Ar=["stringify","string","throwError","validateSDKParams","keys","REQUIRED_SDK_PARAMS","filter","throwOrReturnResult"];Tr=Ar,kr=113,function(t){for(;--t;)Tr.push(Tr.shift())}(++kr);var Pr=function(t,e){return Ar[t-=0]};class Cr{constructor(){this.REQUIRED_SDK_PARAMS={clientId:Pr("0x0")}}throwOrReturnResult(t,e,i){if(!t&&((null==e?void 0:e.logIfInvalid)&&wi.info(i),null==e?void 0:e[Pr("0x1")]))throw new Error(i);return t}[Pr("0x2")](t,e){const i=Object[Pr("0x3")](this[Pr("0x4")])[Pr("0x5")]((e=>typeof t[e]!=this.REQUIRED_SDK_PARAMS[e]));return this[Pr("0x6")](0==i.length,e,"Invalid SDK params was provided: "+JSON[Pr("0x7")](i))}}var Rr,Mr,Or=["push","logsMinimumBatch","getConfValue","logsMinimumDelay","logs","now","lastTimeLogsSent","getClientId","floor","platform","postData","device/logs","requestsManager","identityManager","configManager","logMiddleware","reportLogs","middlewares"];Rr=Or,Mr=426,function(t){for(;--t;)Rr.push(Rr.shift())}(++Mr);var Kr=function(t,e){return Or[t-=0]};class Lr{constructor(t,e,i){this[Kr("0x0")]=t,this[Kr("0x1")]=e,this[Kr("0x2")]=i,this.lastTimeLogsSent=0,this[Kr("0x3")]=async()=>{try{await this[Kr("0x4")]()}catch(t){}},wi[Kr("0x5")][Kr("0x6")](this.logMiddleware)}async[Kr("0x4")](){if(!this[Kr("0x2")].getConfValue("enableLogsReporting",!1))return;const t=this[Kr("0x2")].getConfValue(Kr("0x7"),6),e=this.configManager[Kr("0x8")](Kr("0x9"),12e4);if(wi[Kr("0xa")].length<t||this.lastTimeLogsSent+e>Date[Kr("0xb")]())return;this[Kr("0xc")]=Date.now();const i=wi.flush(),n=this.identityManager[Kr("0xd")](),r=Math[Kr("0xe")](Date[Kr("0xb")]()/1e3),a={sdkVersion:"1.52.6",platform:navigator[Kr("0xf")],clientId:n,timestamp:r,logEntries:i};await this[Kr("0x0")][Kr("0x10")](Kr("0x11"),a)}}var Nr,zr,Br=["getItemLocalStorageSafe","getDeviceId","getClientId","device/migrate-identifiers","requestsManager","postDataFromURL","deviceId","true","rimd","identityManager","storageManager","migrateIdentifiers"];Nr=Br,zr=284,function(t){for(;--t;)Nr.push(Nr.shift())}(++zr);var Ur=function(t,e){return Br[t-=0]};const Fr=Ur("0x0");class jr{constructor(t,e,i){this[Ur("0x1")]=t,this.requestsManager=e,this[Ur("0x2")]=i}async[Ur("0x3")](t){if("true"!=this[Ur("0x2")][Ur("0x4")](Fr)){const e=this.identityManager[Ur("0x5")](),i=this[Ur("0x1")][Ur("0x6")](),n=(t.endsWith("/")?t:t+"/")+Ur("0x7"),r=await this[Ur("0x8")][Ur("0x9")](n,{deviceId:e,clientId:i});r[Ur("0xa")]&&r.deviceId==e&&this[Ur("0x2")].setItemLocalStorageSafe(Fr,Ur("0xb"))}}}var Zr,Vr,Hr=["userId","sdk init started","refreshConf","getClientId","tenantId","cryptoBinding","createCryptoBinding","expiryDays","deviceDataManager","config_disabled","identifiersMigrationEnabled","migrateIdentifiers","sendDeviceDataEvent","catch","sendPageLoadEvent","updateUserId","registerEventListeners","sdk init done","init_not_called","init_failed","triggerActionEvent","includes","warn","_error_'invalid action type - ","claimedUserIdType","Invalid claimedUserIdType","invalid_claimed_user_id_type_","getDeviceData","correlationId","claimedUserId","publicKey","extensionMetadata","extensionDeviceAttributes","suspiciousSignals","suspiciousContext","downloadFile","uploadFile","transactionData","customAttributes","emitEvent","Unhandled SDK error. Received eventResponse: ","stringify","slice","CLIENT","SERVER","errorSpace","_error_","errorCode","message","unexpected_error_","identifyUser","identifyUser called without a valid userid","toString","setUserId","EVENT_TYPE_IDENTIFICATION","deviceId","unidentifiedUser","getUserId","removeUserId","setAuthenticatedUser","setUser","RiskID","TSAccountProtection","dispatchEvent","RiskIDReady","TSAccountProtectionReady","undefined","enableIdentifiersMigration","enableDeviceAttributesInActions","actions","https://collect.riskid.security/","phone_number","account_id","ssn","passport_number","drivers_license_number","other","initializationPromise","disabledReason","enableSessionToken","firstPartyMigrationUrl","initializedInstance","SDK already initialized","string","clientId","serverPath","options","platformSdkVersion","enabled","validationManager","validateSDKParams","invalid_params","storageManager","requestsManager","configManager","identityManager","load","migrationsManager","logsReporter","generateDisabledToken","now","disabled_sdk_","getConfValue","getActions","Session token is not enabled","isInitialized","info","SDK disabled","isTokenExpired","eventsManager","refreshSessionToken","getSessionToken","object"];Zr=Hr,Vr=405,function(t){for(;--t;)Zr.push(Zr.shift())}(++Vr);var Gr=function(t,e){return Hr[t-=0]};const Wr=[null,void 0,Gr("0x0"),"",0],Yr=Gr("0x1"),Jr=Gr("0x2"),qr=Gr("0x3"),$r=Gr("0x4"),Xr=["email",Gr("0x5"),Gr("0x6"),Gr("0x7"),"national_id",Gr("0x8"),Gr("0x9"),Gr("0xa")];class Qr{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(this[Gr("0xb")]=null,this[Gr("0xc")]=null,this[Gr("0xd")]=!1,this.identifiersMigrationEnabled=!1,this[Gr("0xe")]=null,this.validationManager=new Cr,Qr[Gr("0xf")])throw new Error(Gr("0x10"));Qr.initializedInstance=!0;const n=typeof e===Gr("0x11");this[Gr("0x12")]=n?e:t,this.options=n?{serverPath:t}:e,(i=this.options).serverPath||(i[Gr("0x13")]=$r),this[Gr("0x14")][Gr("0x13")]=new URL(this[Gr("0x14")][Gr("0x13")]).toString(),this[Gr("0xe")]=this[Gr("0x14")][Gr("0xe")]||null,this[Gr("0x15")]=this[Gr("0x14")][Gr("0x15")],wi[Gr("0x16")]=!!this[Gr("0x14")].verbose,this[Gr("0x17")][Gr("0x18")](this,{throwError:!0,logIfInvalid:!0})||(this[Gr("0xc")]=Gr("0x19")),this[Gr("0x1a")]=new ui(this[Gr("0x12")]),this[Gr("0x1b")]=new Ir(this[Gr("0x14")][Gr("0x13")]),this[Gr("0x1c")]=new Ii(this.storageManager,this[Gr("0x1b")]),this[Gr("0x1d")]=new vr(this[Gr("0x1a")],this[Gr("0x1c")],this[Gr("0x12")]),this[Gr("0x1d")][Gr("0x1e")](),this[Gr("0x1f")]=new jr(this[Gr("0x1d")],this.requestsManager,this[Gr("0x1a")]),this.enableSessionToken=this[Gr("0x14")][Gr("0xd")]||!1,this[Gr("0x20")]=new Lr(this[Gr("0x1b")],this[Gr("0x1d")],this[Gr("0x1c")])}[Gr("0x21")](t){const e=Date[Gr("0x22")]();return Gr("0x23")+(this.disabledReason||"unknown")+"_"+t+"_"+e}get[Gr("0x3")](){return this[Gr("0x1c")][Gr("0x24")](qr,[])}async[Gr("0x25")](){return await this.isInitialized(),this[Gr("0x3")]}async getSessionToken(){if(!this[Gr("0xd")])throw new Error(Gr("0x26"));return await this[Gr("0x27")]()?(this[Gr("0x1d")][Gr("0x2a")]()&&await this[Gr("0x2b")][Gr("0x2c")](),this[Gr("0x1d")][Gr("0x2d")]()):(wi[Gr("0x28")](Gr("0x29")),{actionToken:this[Gr("0x21")]("session")})}async init(t){const e=typeof t!==Gr("0x2e")?t:null==t?void 0:t[Gr("0x2f")];return wi[Gr("0x28")](Gr("0x30")),this.initializationPromise=(async()=>{await this.configManager[Gr("0x31")](this[Gr("0x1d")][Gr("0x32")]());const t=this[Gr("0x1c")][Gr("0x24")](Gr("0x33"),null),i=this[Gr("0x1c")][Gr("0x24")]("keyRotation",null);if(this[Gr("0x34")]=di.crypto[Gr("0x35")]("sign",(null==i?void 0:i.isEnabled)?{keyRotation:{isEnabled:!0,expiryDays:i[Gr("0x36")],startedAt:i.startedAt,tenantId:t}}:void 0),this.deviceDataManager=new In(this[Gr("0x1a")],this[Gr("0x1c")],this[Gr("0x34")]),this[Gr("0x2b")]=new lr(this[Gr("0x1c")],this.storageManager,this[Gr("0x37")],this[Gr("0x1b")],this[Gr("0x1d")],this[Gr("0x34")],this[Gr("0x14")][Gr("0x13")],this[Gr("0xd")]),null!==this.disabledReason)return!1;const n=this[Gr("0x1c")][Gr("0x24")]("sdkEnabled",void 0);return n?(this[Gr("0x39")]=this.identifiersMigrationEnabled||this[Gr("0x1c")][Gr("0x24")](Yr,!1),this[Gr("0x39")]&&this[Gr("0xe")]&&await this[Gr("0x1f")][Gr("0x3a")](this[Gr("0xe")]),wi.enabled=wi[Gr("0x16")]||!!this[Gr("0x1c")][Gr("0x24")]("verbose",!1),await this[Gr("0x2b")][Gr("0x3b")]()[Gr("0x3c")]((()=>{})),await this[Gr("0x2b")][Gr("0x3d")]()[Gr("0x3c")]((()=>{})),await this[Gr("0x3e")](e)[Gr("0x3c")]((()=>{})),this[Gr("0x2b")][Gr("0x3f")](),await this[Gr("0x2b")].flush()[Gr("0x3c")]((()=>{})),wi.info(Gr("0x40")),!0):(this[Gr("0xc")]=void 0===n?"missing_config":Gr("0x38"),!1)})(),await this[Gr("0xb")]}async[Gr("0x27")](){if(null===this[Gr("0xb")])return this.disabledReason||(this[Gr("0xc")]=Gr("0x41")),!1;const t=await this[Gr("0xb")];return t||this[Gr("0xc")]||(this[Gr("0xc")]=Gr("0x42")),t}async[Gr("0x43")](t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Date.now();if(!await this[Gr("0x27")]())return wi[Gr("0x28")]("SDK disabled"),{actionToken:this[Gr("0x21")]("action")};if(!this.actions[Gr("0x44")](t))return wi[Gr("0x45")]("Invalid action type",{actionType:t}),{actionToken:Vn.CLIENT+Gr("0x46")+t+"'_"+i};const n=null==e?void 0:e[Gr("0x47")];if(n&&!Xr[Gr("0x44")](n))return wi[Gr("0x45")](Gr("0x48"),{claimedUserIdType:n}),{actionToken:Gr("0x49")+n+"_"+i};let r;this[Gr("0x1c")][Gr("0x24")](Jr,!1)&&(r=await this[Gr("0x37")][Gr("0x4a")]());const a=l({type:Pi.EVENT_TYPE_ACTION,attributes:l(l(l(l(l(l(l(l(l(l(l(l(l({action_type:t},(null==e?void 0:e[Gr("0x4b")])&&{correlation_id:e[Gr("0x4b")]}),(null==e?void 0:e.claimedUserId)&&{claimed_user_id:e[Gr("0x4c")]}),n&&{claimed_user_id_type:n}),(null==e?void 0:e[Gr("0x4d")])&&{public_key:e[Gr("0x4d")]}),(null==e?void 0:e[Gr("0x4e")])&&{extension_metadata:e[Gr("0x4e")]}),(null==e?void 0:e[Gr("0x4f")])&&{extension_device_attributes:e.extensionDeviceAttributes}),(null==e?void 0:e[Gr("0x50")])&&{suspicious_signals:e[Gr("0x50")]}),(null==e?void 0:e.suspiciousContext)&&{suspicious_context:e[Gr("0x51")]}),(null==e?void 0:e[Gr("0x52")])&&{download_file:e[Gr("0x52")]}),(null==e?void 0:e[Gr("0x53")])&&{upload_file:e.uploadFile}),this[Gr("0x15")]&&{platform_sdk_version:this[Gr("0x15")]}),(null==e?void 0:e[Gr("0x54")])&&{transactionData:e[Gr("0x54")]}),r)},(null==e?void 0:e[Gr("0x55")])&&{customAttributes:e[Gr("0x55")]});try{const t=await this[Gr("0x2b")][Gr("0x56")](a),{actionToken:e}=t;if(!e)throw new Wn(new Error(Gr("0x57")+("object"==typeof t?JSON[Gr("0x58")](t)[Gr("0x59")](15):t)),Vn[Gr("0x5a")]);return t}catch(e){return{actionToken:e instanceof Wn?e.errorSpace===Vn[Gr("0x5b")]?e[Gr("0x5c")]+Gr("0x5d")+t+"_"+e[Gr("0x5e")]+"_'"+e[Gr("0x5f")]+"'_"+i:e.errorSpace+Gr("0x5d")+t+"_'"+e[Gr("0x5f")]+"'_"+i:Gr("0x60")+t+"_"+i}}}async[Gr("0x61")](t){return await this[Gr("0x27")]()?this[Gr("0x3e")](t):(wi[Gr("0x28")]("SDK disabled"),!1)}async[Gr("0x3e")](t){if(Wr.includes(t))return wi[Gr("0x28")](Gr("0x62"),{userId:t}),!1;t=t[Gr("0x63")](),wi[Gr("0x28")](Gr("0x61"),{userId:t});const e=this[Gr("0x1d")].getUserId();return e===t||(this[Gr("0x1d")][Gr("0x64")](t),!!(await this[Gr("0x2b")][Gr("0x56")]({type:Pi[Gr("0x65")],attributes:{previous_user_id:e,user_id:t}}))[Gr("0x66")])}async[Gr("0x67")](){if(!await this[Gr("0x27")]())return wi[Gr("0x28")](Gr("0x29")),!1;const t=this.identityManager[Gr("0x68")]();return null!=t&&this[Gr("0x1d")][Gr("0x69")](),!!(await this[Gr("0x2b")][Gr("0x56")]({type:Pi[Gr("0x65")],attributes:{previous_user_id:t}})).deviceId}async[Gr("0x6a")](t){return await this[Gr("0x61")](t)}async[Gr("0x6b")](t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this[Gr("0x6a")](t,e)}async clearUser(){return await this.unidentifiedUser()}}Qr[Gr("0xf")]=!1,document[Gr("0x6e")](new CustomEvent(Gr("0x70")));var ta,ea,ia=["moduleMetadata","getInitConfig","undefined","__PLATFORM_SDK_VERSION__","platformSdkVersion","utils","exceptions","TsError","tsPlatform not initialized","triggerActionEvent","setAuthenticatedUser","clearUser","identifyUser","unidentifiedUser","getActions","getSessionToken","identityManager","getClientId","eventsManager","flush","events","MODULE_INITIALIZED"];ta=ia,ea=394,function(t){for(;--t;)ta.push(ta.shift())}(++ea);var na=function(t,e){return ia[t-=0]};let ra=null;function aa(t){if(!t)throw new(di[na("0x7")][na("0x8")][na("0x9")])("not_initialized",na("0xa"))}di[na("0x0")].on(di.events[na("0x1")],(()=>{const{clientId:t,drs:e}=di[na("0x2")][na("0x3")](),i=e||{},{enabled:n,userId:r}=i,a=h(i,ni);if(!1===n)return;const s=typeof window!==na("0x4")&&window[na("0x5")]||typeof globalThis!==na("0x4")&&globalThis[na("0x5")]||void 0;s&&(a[na("0x6")]=s),ra=new Qr(t,a),ra.init({userId:r})}));const sa=function(){return aa(ra),ra[na("0xb")](...arguments)},oa=function(){return aa(ra),ra.setUser(...arguments)},ca=function(){return aa(ra),ra[na("0xc")](...arguments)},la=function(){return aa(ra),ra[na("0xd")](...arguments)},da=function(){return aa(ra),ra[na("0xe")](...arguments)},xa=function(){return aa(ra),ra[na("0xf")](...arguments)},ha=function(){return aa(ra),ra[na("0x10")]()},ua=function(){return aa(ra),ra[na("0x11")]()},fa={getDeviceId:()=>ra[na("0x12")].getDeviceId(),getClientId:()=>ra.identityManager[na("0x13")](),flush:()=>ra[na("0x14")][na("0x15")]()};const ga={initialize:s,...Object.freeze({__proto__:null,__internal:fa,clearUser:la,getActions:ha,getSessionToken:ua,identifyUser:da,setAuthenticatedUser:ca,setUser:oa,triggerActionEvent:sa,unidentifiedUser:xa})};exports.PACKAGE_VERSION="1.17.1",exports.__internal=fa,exports.clearUser=la,exports.drs=ga,exports.getActions=ha,exports.getSessionToken=ua,exports.identifyUser=da,exports.initialize=s,exports.setAuthenticatedUser=ca,exports.setUser=oa,exports.triggerActionEvent=sa,exports.unidentifiedUser=xa;
package/dist/drs.d.ts ADDED
@@ -0,0 +1,235 @@
1
+ declare enum RecommendationType {
2
+ ALLOW = "ALLOW",
3
+ CHALLENGE = "CHALLENGE",
4
+ DENY = "DENY",
5
+ TRUST = "TRUST"
6
+ }
7
+ type EventResponse = {
8
+ actionToken?: string;
9
+ deviceId?: string;
10
+ recommendation?: Recommendation;
11
+ userId?: string;
12
+ };
13
+ type Recommendation = {
14
+ type: RecommendationType;
15
+ };
16
+
17
+ interface ActionResponse {
18
+ /** The token return by the SDK when the action was reported */
19
+ actionToken?: string;
20
+ }
21
+ interface InitOptions {
22
+ /** Opaque identifier of the user in your system */
23
+ userId?: string;
24
+ }
25
+ /**
26
+ * Initial parameters for SDK
27
+ */
28
+ interface ConstructorOptions {
29
+ /** Print logs to console */
30
+ verbose?: boolean;
31
+ /** Your server URL
32
+ *
33
+ * Default value is https://collect.riskid.security */
34
+ serverPath?: string;
35
+ /** Enable session token fetching
36
+ *
37
+ * Default value is false */
38
+ enableSessionToken?: boolean;
39
+ /** First party server url for the identifiers migration
40
+ *
41
+ * Default value is undefined */
42
+ firstPartyMigrationUrl?: string;
43
+ }
44
+ interface TransactionData {
45
+ amount: number;
46
+ currency: string;
47
+ reason?: string;
48
+ transactionDate?: number;
49
+ payer?: {
50
+ name?: string;
51
+ bankIdentifier?: string;
52
+ branchIdentifier?: string;
53
+ accountNumber?: string;
54
+ };
55
+ payee?: {
56
+ name?: string;
57
+ bankIdentifier?: string;
58
+ branchIdentifier?: string;
59
+ accountNumber?: string;
60
+ };
61
+ }
62
+ interface ActionEventOptions {
63
+ /** Any ID that could help relate the action with external context or session */
64
+ correlationId?: string;
65
+ /** User ID of the not yet authenticated user, used to enhance risk and
66
+ * trust assessments. Once the user is authenticated,
67
+ * {@link TSAccountProtection.setAuthenticatedUser} should be called. */
68
+ claimedUserId?: string;
69
+ /**
70
+ * The reported claimedUserId type (if provided), should not contain PII unless it is hashed.
71
+ * Supported values: email, phone_number, account_id, ssn, national_id, passport_number, drivers_license_number, other.
72
+ */
73
+ claimedUserIdType?: string;
74
+ /**
75
+ * A transaction data-points object for transaction-monitoring
76
+ */
77
+ transactionData?: TransactionData;
78
+ /**
79
+ * Custom attributes matching the schema previously defined in the Admin Portal
80
+ */
81
+ customAttributes?: Record<string, string | number | boolean>;
82
+ /**
83
+ * The fields below are supported for Enterprise-IAM sdk usage actions, added `ignore` for avoiding preseting this attribute in the docs
84
+ * @ignore
85
+ */
86
+ publicKey?: string;
87
+ /**
88
+ * @ignore
89
+ */
90
+ extensionMetadata?: string;
91
+ /**
92
+ * @ignore
93
+ */
94
+ extensionDeviceAttributes?: Record<string, string>;
95
+ /**
96
+ * @ignore
97
+ */
98
+ suspiciousSignals?: string[];
99
+ /**
100
+ * @ignore
101
+ */
102
+ suspiciousContext?: string;
103
+ /**
104
+ * @ignore
105
+ */
106
+ downloadFile?: Record<string, boolean | string | number>;
107
+ /**
108
+ * @ignore
109
+ */
110
+ uploadFile?: Record<string, boolean | string | number>;
111
+ }
112
+ declare class TSAccountProtection {
113
+ private static initializedInstance;
114
+ private initializationPromise;
115
+ private isSDKDisabled;
116
+ private enableSessionToken;
117
+ private identifiersMigrationEnabled;
118
+ private firstPartyMigrationUrl;
119
+ private validationManager;
120
+ private storageManager;
121
+ private eventsManager;
122
+ private deviceDataManager;
123
+ private configManager;
124
+ private requestsManager;
125
+ private identityManager;
126
+ private migrationsManager;
127
+ private cryptoBinding;
128
+ private logsReporter;
129
+ private options;
130
+ private clientId;
131
+ /**
132
+ *
133
+ Creates a new Account Protection SDK instance with your client context
134
+ @param clientId Your AccountProtection client identifier
135
+ @param options SDK configuration options
136
+ */
137
+ constructor(clientId: string, options?: ConstructorOptions);
138
+ /** @ignore */
139
+ constructor(serverPath: string, clientId: string);
140
+ /**
141
+ * @ignore
142
+ * @returns List of loaded actions that can be invoked
143
+ */
144
+ get actions(): string[];
145
+ /** @ignore */
146
+ getActions(): Promise<string[]>;
147
+ getSessionToken(): Promise<any>;
148
+ /**
149
+ * Initializes the AccountProtection SDK, which starts automatically tracking and submitting info of the user journey
150
+ * @param options Init options
151
+ * @returns Indicates if the call succeeded
152
+ */
153
+ init(options?: InitOptions | string): Promise<boolean>;
154
+ private isInitialized;
155
+ /**
156
+ * Reports a user action event to the SDK
157
+ * @param actionType Type of user action event that was predefined in the Transmit Security server
158
+ * @returns Indicates if the call succeeded
159
+ */
160
+ triggerActionEvent(actionType: string, options?: ActionEventOptions): Promise<ActionResponse>;
161
+ /**
162
+ * @ignore
163
+ */
164
+ identifyUser(userId: string): Promise<boolean>;
165
+ private updateUserId;
166
+ /**
167
+ * @ignore
168
+ */
169
+ unidentifiedUser(): Promise<boolean>;
170
+ /**
171
+ * Sets the user context for all subsequent events in the browser session (or until the user is explicitly cleared)
172
+ * It should be set only after you've fully authenticated the user (including, for example, any 2FA that was required)
173
+ * @param userId Opaque identifier of the user in your system
174
+ * @param options Reserved for future use
175
+ * @returns Indicates if the call succeeded
176
+ */
177
+ setAuthenticatedUser(userId: string, options?: {}): Promise<boolean>;
178
+ /** @ignore */
179
+ setUser(userId: string, _options?: {}): Promise<boolean>;
180
+ /**
181
+ * Clears the user context for all subsequent events in the browser session
182
+ * @param options Reserved for future use
183
+ * @returns Indicates if the call succeeded
184
+ */
185
+ clearUser(options?: {}): Promise<boolean>;
186
+ }
187
+
188
+ declare module '@transmit-security/web-sdk-common/dist/module-metadata/module-metadata' {
189
+ interface initConfigParams {
190
+ drs?: InitOptions & ConstructorOptions & {
191
+ enabled: boolean;
192
+ };
193
+ }
194
+ }
195
+ /**
196
+ * Reports a user action event to the SDK
197
+ * @param actionType Type of user action event that was predefined in the Transmit Security server
198
+ * @returns Indicates if the call succeeded
199
+ */
200
+ declare const triggerActionEvent: TSAccountProtection['triggerActionEvent'];
201
+ /** @ignore */
202
+ declare const setUser: TSAccountProtection['setUser'];
203
+ /**
204
+ * Sets the user context for all subsequent events in the browser session (or until the user is explicitly cleared)
205
+ * It should be set only after you've fully authenticated the user (including, for example, any 2FA that was required)
206
+ * @param userId Opaque identifier of the user in your system
207
+ * @param options Reserved for future use
208
+ * @returns Indicates if the call succeeded
209
+ */
210
+ declare const setAuthenticatedUser: TSAccountProtection['setAuthenticatedUser'];
211
+ /**
212
+ * Clears the user context for all subsequent events in the browser session
213
+ * @param options Reserved for future use
214
+ * @returns Indicates if the call succeeded
215
+ */
216
+ declare const clearUser: TSAccountProtection['clearUser'];
217
+ /** @ignore */
218
+ declare const identifyUser: TSAccountProtection['identifyUser'];
219
+ /** @ignore */
220
+ declare const unidentifiedUser: TSAccountProtection['unidentifiedUser'];
221
+ /** @ignore */
222
+ declare const getActions: TSAccountProtection['getActions'];
223
+ /** @ignore */
224
+ declare const getSessionToken: TSAccountProtection['getSessionToken'];
225
+ /** @ignore */
226
+ declare const __internal: {
227
+ getDeviceId(): string;
228
+ getClientId(): string;
229
+ flush(): Promise<EventResponse>;
230
+ };
231
+
232
+ declare const PACKAGE_VERSION: string;
233
+ declare function initialize(config: any): void;
234
+
235
+ export { ActionEventOptions, ActionResponse, PACKAGE_VERSION, __internal, clearUser, getActions, getSessionToken, identifyUser, initialize, setAuthenticatedUser, setUser, triggerActionEvent, unidentifiedUser };