@transmitsecurity/platform-web-sdk 1.17.2-beta.0 ā 1.18.1
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 +10 -0
- package/dist/drs.cjs +1 -1
- package/dist/drs.d.ts +2 -1
- package/dist/drs.js +1 -1
- package/dist/ido.cjs +2 -2
- package/dist/ido.d.ts +34 -0
- package/dist/ido.js +2 -2
- package/dist/idv.cjs +1 -1
- package/dist/idv.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/ts-platform-websdk.js +2 -2
- package/dist/web-sdk-drs+idv+webauthn+ido.js +2 -2
- package/dist/web-sdk.d.ts +15 -2
- package/dist/webauthn.cjs +1 -1
- package/dist/webauthn.js +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
function e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function r(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},a=Object.keys(e);for(r=0;r<a.length;r++)i=a[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)i=a[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function a(e,i){return Object.entries(i).reduce(((i,r)=>{let[n,s]=r;return t(t({},i),{},{[n]:o.isPrototypeOf(s)?new s(e.slug):"function"==typeof s?s.bind(e):"object"==typeof s&&!Array.isArray(s)&&s?a(e,s):s})}),{})}"undefined"==typeof globalThis&&("undefined"!=typeof window?(window.globalThis=window,window.global=window):"undefined"!=typeof self&&(self.globalThis=self,self.global=self)),Object.defineProperty(exports,"__esModule",{value:!0});class o{constructor(e){this.slug=e}static create(e){return class extends o{constructor(t){super(t),Object.assign(this,a(this,e(this)))}}}}var s=Object.freeze({__proto__:null,Agent:o});const c=new Map;function d(e,t){var i,r;null===(i=c.get(e))||void 0===i||i.forEach((r=e=>e(t),function(){try{return r(...arguments)}catch(e){console.log(e)}}))}const u=Symbol("MODULE_INITIALIZED");var l=Object.freeze({__proto__:null,MODULE_INITIALIZED:u,emit:d,off:function(e,t){const i=c.get(e);if(!i)return;const r=i.indexOf(t);-1!==r&&i.splice(r,1)},on:function(e,t){var i;c.has(e)?null===(i=c.get(e))||void 0===i||i.push(t):c.set(e,[t])}});let h=null;function f(e){h=e}var p=Object.freeze({__proto__:null,getInitConfig:function(){return h},get initConfig(){return h},setInitConfig:f});function g(e){f(e),d(u,void 0)}var m=Object.freeze({__proto__:null,initialize:g});function b(e,t){const i=!e||"object"!=typeof e||Array.isArray(e)?{}:e;return[t.reduce(((e,t)=>{if(t in e){const i=e[t];if(null!==i&&"object"==typeof i&&!Array.isArray(i))return i}const i={};return e[t]=i,i}),i),i]}function v(e,t){let i=e;return t.every((e=>!(!i||"object"!=typeof i||Array.isArray(i)||!(e in i))&&(i=i[e],!0)),e)}const y="tsec",_="general";function w(e){return e?_:h.clientId}function x(e){return function(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}((e?sessionStorage:localStorage).getItem(y))}function A(e,t){const i=e?sessionStorage:localStorage,r=t(x(e));i.setItem(y,JSON.stringify(r))}var E=Object.freeze({__proto__:null,COMMON_STORAGE_KEY:y,GENERAL_ID_KEY:_,getValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=w(!!t.isGeneral),r=x(!!t.sessionOnly),[n]=b(r,[this.slug.toString(),i]);return n[e]},hasValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=w(!!t.isGeneral),r=x(!!t.sessionOnly);return v(r,[this.slug.toString(),i,e])},removeValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=w(!!t.isGeneral);A(!!t.sessionOnly,(t=>{const[r,n]=b(t,[this.slug.toString(),i]);return delete r[e],n}))},setValue:function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=w(!!i.isGeneral);A(!!i.sessionOnly,(i=>{const[n,a]=b(i,[this.slug.toString(),r]);return n[e]=t,a}))}});const S="RSA-PSS",k=async(e,t)=>await window.crypto.subtle.generateKey({name:e,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,t),M=async()=>await k("RSA-OAEP",["encrypt","decrypt"]),C=async()=>await k(S,["sign"]),I=async(e,t)=>{const i=(new TextEncoder).encode(t);return await window.crypto.subtle.sign({name:S,saltLength:32},e,i)};class D{constructor(e,t,i){this.slug=e,this.dbName=t,this.dbVersion=i}queryObjectStore(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB).open(`${this.slug}:${this.dbName}`,this.dbVersion||1);r.onupgradeneeded=()=>{var t;const i=r.result;(null===(t=null==i?void 0:i.objectStoreNames)||void 0===t?void 0:t.contains)&&!i.objectStoreNames.contains(e)&&i.createObjectStore(e,{keyPath:"key"})},r.onsuccess=()=>{const n=r.result,a=n.transaction(e,(null==i?void 0:i.operation)||"readwrite"),o=a.objectStore(e);t(o),a.oncomplete=()=>{n.close()}}}put(e,t,i){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const a=e.put({key:t,value:i});a.onsuccess=()=>{r(a.result)},a.onerror=e=>{n("Failed adding item to objectStore, err: "+e)}}))}))}add(e,t,i){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const a=e.add({key:t,value:i});a.onsuccess=()=>{r(a.result)},a.onerror=e=>{const t=e.target.error;n(t)}}))}))}get(e,t){return new Promise(((i,r)=>{this.queryObjectStore(e,(e=>{const n=e.get(t);n.onsuccess=()=>{var e;n.result?i(null===(e=n.result)||void 0===e?void 0:e.value):i(void 0)},n.onerror=e=>{r("Failed adding item to objectStore, err: "+e)}}))}))}getAll(e,t){return new Promise(((i,r)=>{this.queryObjectStore(e,(e=>{const n=e.getAll(null,t);n.onsuccess=()=>{if(n.result){const e=n.result;(null==e?void 0:e.length)?i(e.map((e=>null==e?void 0:e.value))):i(e)}else i([])},n.onerror=e=>{r("Failed getting items, err: "+e)}}))}))}delete(e,t){return new Promise(((i,r)=>{this.queryObjectStore(e,(e=>{const n=e.delete(t);n.onsuccess=()=>{i()},n.onerror=e=>{r(`Failed deleting key: '${t}' from objectStore, err: `+e)}}))}))}clear(e){return new Promise(((t,i)=>{this.queryObjectStore(e,(e=>{const r=e.clear();r.onsuccess=()=>{t()},r.onerror=e=>{i("Failed clearing objectStore, err: "+e)}}))}))}}const T="platform",R="init",B="completed",z="RSA2048",P=[R,B];class O{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sign",i=arguments.length>2?arguments[2]:void 0;var r,n,a,o;this.agent=e,this.keysType=t,this.options=i,this._extractingKeysPromise=null;const s=!(null===(r=this.options)||void 0===r?void 0:r.productScope);this.keysDatabaseName=s||!(null===(n=this.options)||void 0===n?void 0:n.indexedDBName)?"ts_crypto_binding":this.options.indexedDBName,this.dbVersion=s?1:(null===(a=this.options)||void 0===a?void 0:a.dbVersion)||1,this.keysStoreName=s||!(null===(o=this.options)||void 0===o?void 0:o.keysStoreName)?"identifiers_store":this.options.keysStoreName,this.indexedDBClient=new D(s?T:e.slug,this.keysDatabaseName,this.dbVersion),this.indexedDBClientFallback=new D((s?T:e.slug)+`:${h.clientId}`,this.keysDatabaseName,this.dbVersion)}getKeysRecordKey(){return`${this.keysType}_keys`}getRotatedKeysRecordKey(){return`rotated_${this.keysType}_keys`}getRotatedKeysRecordKeyPending(){return`rotated_pending_${this.keysType}_keys`}arrayBufferToBase64(e){return window.btoa(String.fromCharCode(...new Uint8Array(e)))}async getPKRepresentations(e){const t=await crypto.subtle.exportKey("spki",e);return{arrayBufferKey:t,base64Key:this.arrayBufferToBase64(t)}}async generateKeyPair(){return"sign"==this.keysType?await C():await M()}async calcKeyIdentifier(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map((e=>e.toString(16).padStart(2,"0"))).join("")}async extractKeysData(){if(this._extractingKeysPromise)return this._extractingKeysPromise;this._extractingKeysPromise=(async()=>{var e,t;const i=(null===(t=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===t?void 0:t.isEnabled)?await this.getRotatedKeysData():await this.getKeysData(),{base64Key:r}=await this.getPKRepresentations(i.publicKey);return this.publicKeyBase64=r,this.keyIdentifier=i.keyIdentifier,i})();try{return await this._extractingKeysPromise}finally{this._extractingKeysPromise=null}}async generateKeyPairData(e){const i=await this.generateKeyPair(),{arrayBufferKey:r}=await this.getPKRepresentations(i.publicKey),n=e||await this.calcKeyIdentifier(r);return t(t({},i),{},{keyIdentifier:n,createdDate:Date.now()})}shouldKeyBeRotated(e){var t;const i=null===(t=this.options)||void 0===t?void 0:t.keyRotation;if(!(null==i?void 0:i.isEnabled)||!i.expiryDays||void 0===i.startedAt)return!1;const r=24*i.expiryDays*60*60*1e3,n=e.createdDate&&e.createdDate>=i.startedAt?e.createdDate:i.startedAt;return Date.now()-n>r-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(e,t){try{return await this.indexedDBClient.add(this.keysStoreName,e,t),t}catch(t){if(t instanceof DOMException&&"ConstraintError"===t.name){const t=await this.indexedDBClient.get(this.keysStoreName,e);if(t)return t}throw t}}async getKeysData(){const e=this.getKeysRecordKey();let t=await this.extractMainKeysData();if(t)return t;if(t=await this.extractFallbackMainKeysData(),t)return this.saveKeyData(e,t);const i=await this.generateKeyPairData();return this.saveKeyData(e,i)}async getOrCreateRotatedKeys(){let e=await this.extractRotatedKeysData();if(!e){const i=this.getRotatedKeysRecordKey(),r=await this.getKeysData(),n=t(t({},r),{},{createdDate:r.createdDate||Date.now()});e=await this.saveKeyData(i,n)}return e}async getRotatedKeysData(){const e=await this.getOrCreateRotatedKeys();if(this.shouldKeyBeRotated(e)){if(!await this.extractPendingRotatedKeysData()){const t=this.getRotatedKeysRecordKeyPending(),i=await this.generateKeyPairData(e.keyIdentifier);await this.saveKeyData(t,i)}}return e}async getPublicData(){return this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData(),{publicKey:this.publicKeyBase64,keyIdentifier:this.keyIdentifier}}async sign(e){if("sign"==this.keysType){const{privateKey:t}=await this.extractKeysData(),i=await I(t,e);return this.arrayBufferToBase64(i)}throw new Error("keysType must be 'sign' in order to use sign keys")}async clearKeys(){const e=this.getKeysRecordKey();await this.indexedDBClient.delete(this.keysStoreName,e)}getBaseRotationPayload(){return{keyIdentifier:this.keyIdentifier,slot:this.getRotatedKeysRecordKey(),publicKey:this.publicKeyBase64,publicKeyType:z,tenantId:this.options.keyRotation.tenantId}}async getRotationData(){var e,i;if(!(null===(i=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===i?void 0:i.isEnabled))return;this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData();const r=await this.extractPendingRotatedKeysData();if(r){const{base64Key:e}=await this.getPKRepresentations(r.publicKey),{privateKey:i}=await this.extractKeysData(),n=t(t({},this.getBaseRotationPayload()),{},{newPublicKey:e,createdDate:r.createdDate,newPublicKeyType:z}),a=JSON.stringify(n);return{data:a,signature:await this.signPayload(a,i)}}const n=await this.extractRotatedKeysData();if(n&&!1===n.confirmed){await this.extractKeysData();const e=JSON.stringify(this.getBaseRotationPayload());return{data:e,signature:await this.signPayload(e,n.privateKey)}}}async signPayload(e,t){const i=await I(t,e);return this.arrayBufferToBase64(i)}async handleRotateResponse(e){if(P.includes(e))if(e===R){const e=await this.extractPendingRotatedKeysData();if(e){await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKey());const i=t(t({},e),{},{confirmed:!1});await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),i),await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKeyPending());const{base64Key:r}=await this.getPKRepresentations(e.publicKey);this.publicKeyBase64=r,this.keyIdentifier=e.keyIdentifier}}else if(e===B){const e=await this.extractRotatedKeysData();e&&!1===e.confirmed&&await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),t(t({},e),{},{confirmed:!0}))}}}var F=Object.freeze({__proto__:null,createCryptoBinding:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sign",t=arguments.length>1?arguments[1]:void 0;return new O(this,e,t)},generateRSAKeyPair:M,generateRSASignKeyPair:C,signAssymetric:I,verifyAssymetric:async(e,t,i)=>{const r=(new TextEncoder).encode(t);return await window.crypto.subtle.verify(S,e,i,r)}}),N=Object.freeze({__proto__:null});const L=o.create((e=>{class t extends Error{constructor(t,i){super(`${e.slug}-${t} ${i}`)}}return{TsError:t,TsInternalError:class extends t{constructor(e){super(e,"Internal error")}}}}));var j=o.create((()=>t({exceptions:L},s)));class U{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.agent=e,this.middlewares=t,this.logs=[]}info(e,t){this.pushLog(3,e,t)}warn(e,t){this.pushLog(4,e,t)}error(e,t){this.pushLog(5,e,t)}pushLog(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.logs.push({timestamp:Date.now(),module:this.agent.slug,severity:e,fields:i,message:t});const r=this.middlewares.map((e=>e(this)));Promise.all(r).catch((()=>{}))}}var q=Object.freeze({__proto__:null,consoleMiddleware:function(e){const t=e.logs[e.logs.length-1];console.log(`${t.severity} ${t.message}`,t.fields)},createSdkLogger:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new U(this,e)}});function K(e,t){if(!(null==e?void 0:e.trim()))return"";if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;const i="http://mock.com",r=new URL(i);r.search=(null==t?void 0:t.toString())||"",r.pathname=e;return r.href.replace(i,"")}const H={"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent};function V(e,i,r){var n;const a=(o=i||{},encodeURI(JSON.stringify(o)).split(/%..|./).length-1);var o;return{method:e,headers:t(t(t({},{"X-TS-body-size":String(a)}),H),r||{}),body:null!==(n=i&&JSON.stringify(i||{}))&&void 0!==n?n:void 0}}function $(e,t,i,r,n){const a=K(e,r),o=V(t,i,n);return fetch(a,o)}async function J(e,t,i,r,n){let a;if(a=await $(e,t,i,r,n),!a.ok)throw new Error("Request failed");return a}var G=Object.freeze({__proto__:null,httpDelete:async function(e,i){const r=await J(e,"DELETE",void 0,void 0,i);return t(t({data:await r.json()},r),{},{headers:r.headers})},httpGet:async function(e,i,r){const n=await J(e,"GET",void 0,i,r);return t(t({data:await n.json()},n),{},{headers:n.headers})},httpPost:async function(e,i,r,n){const a=await J(e,"POST",i,r,n);return t(t({data:await a.json()},a),{},{headers:a.headers})},httpPut:async function(e,i,r,n){const a=await J(e,"PUT",i,r,n);return t(t({data:await a.json()},a),{},{headers:a.headers})},init:V}),W=o.create((()=>({events:l,moduleMetadata:p,mainEntry:m,utils:j,storage:E,crypto:F,indexedDB:N,logger:q,http:G}))),Z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Q(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];i.push.apply(i,arguments);var r=Function.bind.apply(t,i);return new r}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),i}var X={},ee={};function te(e){let t=e.length;for(;--t>=0;)e[t]=0}const ie=256,re=286,ne=30,ae=15,oe=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]),se=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]),ce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),de=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ue=new Array(576);te(ue);const le=new Array(60);te(le);const he=new Array(512);te(he);const fe=new Array(256);te(fe);const pe=new Array(29);te(pe);const ge=new Array(ne);function me(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let be,ve,ye;function _e(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}te(ge);const we=e=>e<256?he[e]:he[256+(e>>>7)],xe=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ae=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,xe(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Ee=(e,t,i)=>{Ae(e,i[2*t],i[2*t+1])},Se=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},ke=(e,t,i)=>{const r=new Array(16);let n,a,o=0;for(n=1;n<=ae;n++)r[n]=o=o+i[n-1]<<1;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=Se(r[t]++,t))}},Me=e=>{let t;for(t=0;t<re;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ne;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Ce=e=>{e.bi_valid>8?xe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ie=(e,t,i,r)=>{const n=2*t,a=2*i;return e[n]<e[a]||e[n]===e[a]&&r[t]<=r[i]},De=(e,t,i)=>{const r=e.heap[i];let n=i<<1;for(;n<=e.heap_len&&(n<e.heap_len&&Ie(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!Ie(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r},Te=(e,t,i)=>{let r,n,a,o,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],n=e.pending_buf[e.l_buf+s],s++,0===r?Ee(e,n,t):(a=fe[n],Ee(e,a+ie+1,t),o=oe[a],0!==o&&(n-=pe[a],Ae(e,n,o)),r--,a=we(r),Ee(e,a,i),o=se[a],0!==o&&(r-=ge[a],Ae(e,r,o)))}while(s<e.last_lit);Ee(e,256,t)},Re=(e,t)=>{const i=t.dyn_tree,r=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,c,d=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)0!==i[2*o]?(e.heap[++e.heap_len]=d=o,e.depth[o]=0):i[2*o+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,i[2*c]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=r[2*c+1]);for(t.max_code=d,o=e.heap_len>>1;o>=1;o--)De(e,i,o);c=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],De(e,i,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,i[2*c]=i[2*o]+i[2*s],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,i[2*o+1]=i[2*s+1]=c,e.heap[1]=c++,De(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,u,l,h,f,p,g=0;for(h=0;h<=ae;h++)e.bl_count[h]=0;for(i[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)u=e.heap[d],h=i[2*i[2*u+1]+1]+1,h>c&&(h=c,g++),i[2*u+1]=h,u>r||(e.bl_count[h]++,f=0,u>=s&&(f=o[u-s]),p=i[2*u],e.opt_len+=p*(h+f),a&&(e.static_len+=p*(n[2*u+1]+f)));if(0!==g){do{for(h=c-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(h=c;0!==h;h--)for(u=e.bl_count[h];0!==u;)l=e.heap[--d],l>r||(i[2*l+1]!==h&&(e.opt_len+=(h-i[2*l+1])*i[2*l],i[2*l+1]=h),u--)}})(e,t),ke(i,d,e.bl_count)},Be=(e,t,i)=>{let r,n,a=-1,o=t[1],s=0,c=7,d=4;for(0===o&&(c=138,d=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)n=o,o=t[2*(r+1)+1],++s<c&&n===o||(s<d?e.bl_tree[2*n]+=s:0!==n?(n!==a&&e.bl_tree[2*n]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=n,0===o?(c=138,d=3):n===o?(c=6,d=3):(c=7,d=4))},ze=(e,t,i)=>{let r,n,a=-1,o=t[1],s=0,c=7,d=4;for(0===o&&(c=138,d=3),r=0;r<=i;r++)if(n=o,o=t[2*(r+1)+1],!(++s<c&&n===o)){if(s<d)do{Ee(e,n,e.bl_tree)}while(0!=--s);else 0!==n?(n!==a&&(Ee(e,n,e.bl_tree),s--),Ee(e,16,e.bl_tree),Ae(e,s-3,2)):s<=10?(Ee(e,17,e.bl_tree),Ae(e,s-3,3)):(Ee(e,18,e.bl_tree),Ae(e,s-11,7));s=0,a=n,0===o?(c=138,d=3):n===o?(c=6,d=3):(c=7,d=4)}};let Pe=!1;const Oe=(e,t,i,r)=>{Ae(e,0+(r?1:0),3),((e,t,i,r)=>{Ce(e),r&&(xe(e,i),xe(e,~i)),e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i})(e,t,i,!0)};ee._tr_init=e=>{Pe||((()=>{let e,t,i,r,n;const a=new Array(16);for(i=0,r=0;r<28;r++)for(pe[r]=i,e=0;e<1<<oe[r];e++)fe[i++]=r;for(fe[i-1]=r,n=0,r=0;r<16;r++)for(ge[r]=n,e=0;e<1<<se[r];e++)he[n++]=r;for(n>>=7;r<ne;r++)for(ge[r]=n<<7,e=0;e<1<<se[r]-7;e++)he[256+n++]=r;for(t=0;t<=ae;t++)a[t]=0;for(e=0;e<=143;)ue[2*e+1]=8,e++,a[8]++;for(;e<=255;)ue[2*e+1]=9,e++,a[9]++;for(;e<=279;)ue[2*e+1]=7,e++,a[7]++;for(;e<=287;)ue[2*e+1]=8,e++,a[8]++;for(ke(ue,287,a),e=0;e<ne;e++)le[2*e+1]=5,le[2*e]=Se(e,5);be=new me(ue,oe,257,re,ae),ve=new me(le,se,0,ne,ae),ye=new me(new Array(0),ce,0,19,7)})(),Pe=!0),e.l_desc=new _e(e.dyn_ltree,be),e.d_desc=new _e(e.dyn_dtree,ve),e.bl_desc=new _e(e.bl_tree,ye),e.bi_buf=0,e.bi_valid=0,Me(e)},ee._tr_stored_block=Oe,ee._tr_flush_block=(e,t,i,r)=>{let n,a,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<ie;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Re(e,e.l_desc),Re(e,e.d_desc),o=(e=>{let t;for(Be(e,e.dyn_ltree,e.l_desc.max_code),Be(e,e.dyn_dtree,e.d_desc.max_code),Re(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*de[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=i+5,i+4<=n&&-1!==t?Oe(e,t,i,r):4===e.strategy||a===n?(Ae(e,2+(r?1:0),3),Te(e,ue,le)):(Ae(e,4+(r?1:0),3),((e,t,i,r)=>{let n;for(Ae(e,t-257,5),Ae(e,i-1,5),Ae(e,r-4,4),n=0;n<r;n++)Ae(e,e.bl_tree[2*de[n]+1],3);ze(e,e.dyn_ltree,t-1),ze(e,e.dyn_dtree,i-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Te(e,e.dyn_ltree,e.dyn_dtree)),Me(e),r&&Ce(e)},ee._tr_tally=(e,t,i)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(fe[i]+ie+1)]++,e.dyn_dtree[2*we(t)]++),e.last_lit===e.lit_bufsize-1),ee._tr_align=e=>{Ae(e,2,3),Ee(e,256,ue),(e=>{16===e.bi_valid?(xe(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)};var Fe=(e,t,i,r)=>{let n=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{n=n+t[r++]|0,a=a+n|0}while(--o);n%=65521,a%=65521}return n|a<<16|0};const Ne=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var Le=(e,t,i,r)=>{const n=Ne,a=r+i;e^=-1;for(let i=r;i<a;i++)e=e>>>8^n[255&(e^t[i])];return-1^e},je={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"},Ue={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:qe,_tr_stored_block:Ke,_tr_flush_block:He,_tr_tally:Ve,_tr_align:$e}=ee,Je=Fe,Ge=Le,We=je,{Z_NO_FLUSH:Ze,Z_PARTIAL_FLUSH:Ye,Z_FULL_FLUSH:Qe,Z_FINISH:Xe,Z_BLOCK:et,Z_OK:tt,Z_STREAM_END:it,Z_STREAM_ERROR:rt,Z_DATA_ERROR:nt,Z_BUF_ERROR:at,Z_DEFAULT_COMPRESSION:ot,Z_FILTERED:st,Z_HUFFMAN_ONLY:ct,Z_RLE:dt,Z_FIXED:ut,Z_DEFAULT_STRATEGY:lt,Z_UNKNOWN:ht,Z_DEFLATED:ft}=Ue,pt=258,gt=262,mt=103,bt=113,vt=666,yt=(e,t)=>(e.msg=We[t],t),_t=e=>(e<<1)-(e>4?9:0),wt=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let xt=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask;const At=e=>{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},Et=(e,t)=>{He(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,At(e.strm)},St=(e,t)=>{e.pending_buf[e.pending++]=t},kt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Mt=(e,t,i,r)=>{let n=e.avail_in;return n>r&&(n=r),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),i),1===e.state.wrap?e.adler=Je(e.adler,t,n,i):2===e.state.wrap&&(e.adler=Ge(e.adler,t,n,i)),e.next_in+=n,e.total_in+=n,n)},Ct=(e,t)=>{let i,r,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-gt?e.strstart-(e.w_size-gt):0,d=e.window,u=e.w_mask,l=e.prev,h=e.strstart+pt;let f=d[a+o-1],p=d[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,d[i+o]===p&&d[i+o-1]===f&&d[i]===d[a]&&d[++i]===d[a+1]){a+=2,i++;do{}while(d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&a<h);if(r=pt-(h-a),a=h-pt,r>o){if(e.match_start=t,o=r,r>=s)break;f=d[a+o-1],p=d[a+o]}}}while((t=l[t&u])>c&&0!=--n);return o<=e.lookahead?o:e.lookahead},It=e=>{const t=e.w_size;let i,r,n,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-gt)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,i=r;do{n=e.head[--i],e.head[i]=n>=t?n-t:0}while(--r);r=t,i=r;do{n=e.prev[--i],e.prev[i]=n>=t?n-t:0}while(--r);a+=t}if(0===e.strm.avail_in)break;if(r=Mt(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=xt(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=xt(e,e.ins_h,e.window[o+3-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<gt&&0!==e.strm.avail_in)},Dt=(e,t)=>{let i,r;for(;;){if(e.lookahead<gt){if(It(e),e.lookahead<gt&&t===Ze)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=xt(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-gt&&(e.match_length=Ct(e,i)),e.match_length>=3)if(r=Ve(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=xt(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=xt(e,e.ins_h,e.window[e.strstart+1]);else r=Ve(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Xe?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2},Tt=(e,t)=>{let i,r,n;for(;;){if(e.lookahead<gt){if(It(e),e.lookahead<gt&&t===Ze)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=xt(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-gt&&(e.match_length=Ct(e,i),e.match_length<=5&&(e.strategy===st||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=Ve(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=xt(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Et(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Ve(e,0,e.window[e.strstart-1]),r&&Et(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Ve(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Xe?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2};function Rt(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}const Bt=[new Rt(0,0,0,0,((e,t)=>{let i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(It(e),0===e.lookahead&&t===Ze)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+i;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Et(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-gt&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Xe?(Et(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Et(e,!1),e.strm.avail_out),1)})),new Rt(4,4,8,4,Dt),new Rt(4,5,16,8,Dt),new Rt(4,6,32,32,Dt),new Rt(4,4,16,16,Tt),new Rt(8,16,32,32,Tt),new Rt(8,16,128,128,Tt),new Rt(8,32,128,256,Tt),new Rt(32,128,258,1024,Tt),new Rt(32,258,258,4096,Tt)];function zt(){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=ft,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),wt(this.dyn_ltree),wt(this.dyn_dtree),wt(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),wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),wt(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 Pt=e=>{if(!e||!e.state)return yt(e,rt);e.total_in=e.total_out=0,e.data_type=ht;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:bt,e.adler=2===t.wrap?0:1,t.last_flush=Ze,qe(t),tt},Ot=e=>{const t=Pt(e);return t===tt&&(e=>{e.window_size=2*e.w_size,wt(e.head),e.max_lazy_match=Bt[e.level].max_lazy,e.good_match=Bt[e.level].good_length,e.nice_match=Bt[e.level].nice_length,e.max_chain_length=Bt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Ft=(e,t,i,r,n,a)=>{if(!e)return rt;let o=1;if(t===ot&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),n<1||n>9||i!==ft||r<8||r>15||t<0||t>9||a<0||a>ut)return yt(e,rt);8===r&&(r=9);const s=new zt;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=i,Ot(e)};X.deflateInit=(e,t)=>Ft(e,t,ft,15,8,lt),X.deflateInit2=Ft,X.deflateReset=Ot,X.deflateResetKeep=Pt,X.deflateSetHeader=(e,t)=>e&&e.state?2!==e.state.wrap?rt:(e.state.gzhead=t,tt):rt,X.deflate=(e,t)=>{let i,r;if(!e||!e.state||t>et||t<0)return e?yt(e,rt):rt;const n=e.state;if(!e.output||!e.input&&0!==e.avail_in||n.status===vt&&t!==Xe)return yt(e,0===e.avail_out?at:rt);n.strm=e;const a=n.last_flush;if(n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,St(n,31),St(n,139),St(n,8),n.gzhead?(St(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),St(n,255&n.gzhead.time),St(n,n.gzhead.time>>8&255),St(n,n.gzhead.time>>16&255),St(n,n.gzhead.time>>24&255),St(n,9===n.level?2:n.strategy>=ct||n.level<2?4:0),St(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(St(n,255&n.gzhead.extra.length),St(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ge(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(St(n,0),St(n,0),St(n,0),St(n,0),St(n,0),St(n,9===n.level?2:n.strategy>=ct||n.level<2?4:0),St(n,3),n.status=bt);else{let t=ft+(n.w_bits-8<<4)<<8,i=-1;i=n.strategy>=ct||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=i<<6,0!==n.strstart&&(t|=32),t+=31-t%31,n.status=bt,kt(n,t),0!==n.strstart&&(kt(n,e.adler>>>16),kt(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ge(e.adler,n.pending_buf,n.pending-i,i)),At(e),i=n.pending,n.pending!==n.pending_buf_size));)St(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Ge(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ge(e.adler,n.pending_buf,n.pending-i,i)),At(e),i=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,St(n,r)}while(0!==r);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ge(e.adler,n.pending_buf,n.pending-i,i)),0===r&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ge(e.adler,n.pending_buf,n.pending-i,i)),At(e),i=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,St(n,r)}while(0!==r);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ge(e.adler,n.pending_buf,n.pending-i,i)),0===r&&(n.status=mt)}else n.status=mt;if(n.status===mt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&At(e),n.pending+2<=n.pending_buf_size&&(St(n,255&e.adler),St(n,e.adler>>8&255),e.adler=0,n.status=bt)):n.status=bt),0!==n.pending){if(At(e),0===e.avail_out)return n.last_flush=-1,tt}else if(0===e.avail_in&&_t(t)<=_t(a)&&t!==Xe)return yt(e,at);if(n.status===vt&&0!==e.avail_in)return yt(e,at);if(0!==e.avail_in||0!==n.lookahead||t!==Ze&&n.status!==vt){let i=n.strategy===ct?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(It(e),0===e.lookahead)){if(t===Ze)return 1;break}if(e.match_length=0,i=Ve(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Xe?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===dt?((e,t)=>{let i,r,n,a;const o=e.window;for(;;){if(e.lookahead<=pt){if(It(e),e.lookahead<=pt&&t===Ze)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,r=o[n],r===o[++n]&&r===o[++n]&&r===o[++n])){a=e.strstart+pt;do{}while(r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&n<a);e.match_length=pt-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=Ve(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=Ve(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Xe?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2})(n,t):Bt[n.level].func(n,t);if(3!==i&&4!==i||(n.status=vt),1===i||3===i)return 0===e.avail_out&&(n.last_flush=-1),tt;if(2===i&&(t===Ye?$e(n):t!==et&&(Ke(n,0,0,!1),t===Qe&&(wt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),At(e),0===e.avail_out))return n.last_flush=-1,tt}return t!==Xe?tt:n.wrap<=0?it:(2===n.wrap?(St(n,255&e.adler),St(n,e.adler>>8&255),St(n,e.adler>>16&255),St(n,e.adler>>24&255),St(n,255&e.total_in),St(n,e.total_in>>8&255),St(n,e.total_in>>16&255),St(n,e.total_in>>24&255)):(kt(n,e.adler>>>16),kt(n,65535&e.adler)),At(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?tt:it)},X.deflateEnd=e=>{if(!e||!e.state)return rt;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&t!==mt&&t!==bt&&t!==vt?yt(e,rt):(e.state=null,t===bt?yt(e,nt):tt)},X.deflateSetDictionary=(e,t)=>{let i=t.length;if(!e||!e.state)return rt;const r=e.state,n=r.wrap;if(2===n||1===n&&42!==r.status||r.lookahead)return rt;if(1===n&&(e.adler=Je(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===n&&(wt(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,It(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=xt(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,It(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=n,tt},X.deflateInfo="pako deflate (from Nodeca project)";var Nt={};const Lt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Nt.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)Lt(i,t)&&(e[t]=i[t])}}return e},Nt.flattenChunks=e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,r=0,n=e.length;t<n;t++){let n=e[t];i.set(n,r),r+=n.length}return i};var jt={};let Ut=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ut=!1}const qt=new Uint8Array(256);for(let e=0;e<256;e++)qt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;qt[254]=qt[254]=1,jt.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,n,a,o=e.length,s=0;for(n=0;n<o;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<o&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),s+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(s),a=0,n=0;a<s;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<o&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|63&i):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|63&i):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|63&i);return t};jt.buf2string=(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,n;const a=new Array(2*i);for(n=0,r=0;r<i;){let t=e[r++];if(t<128){a[n++]=t;continue}let o=qt[t];if(o>4)a[n++]=65533,r+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&r<i;)t=t<<6|63&e[r++],o--;o>1?a[n++]=65533:t<65536?a[n++]=t:(t-=65536,a[n++]=55296|t>>10&1023,a[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Ut)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i})(a,n)},jt.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+qt[e[i]]>t?i:t};const Kt=X,Ht=Nt,Vt=jt,$t=je,Jt=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},Gt=Object.prototype.toString,{Z_NO_FLUSH:Wt,Z_SYNC_FLUSH:Zt,Z_FULL_FLUSH:Yt,Z_FINISH:Qt,Z_OK:Xt,Z_STREAM_END:ei,Z_DEFAULT_COMPRESSION:ti,Z_DEFAULT_STRATEGY:ii,Z_DEFLATED:ri}=Ue;function ni(e){this.options=Ht.assign({level:ti,method:ri,chunkSize:16384,windowBits:15,memLevel:8,strategy:ii},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jt,this.strm.avail_out=0;let i=Kt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==Xt)throw new Error($t[i]);if(t.header&&Kt.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Vt.string2buf(t.dictionary):"[object ArrayBuffer]"===Gt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=Kt.deflateSetDictionary(this.strm,e),i!==Xt)throw new Error($t[i]);this._dict_set=!0}}ni.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let n,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Qt:Wt,"string"==typeof e?i.input=Vt.string2buf(e):"[object ArrayBuffer]"===Gt.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(a===Zt||a===Yt)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(n=Kt.deflate(i,a),n===ei)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=Kt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Xt;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},ni.prototype.onData=function(e){this.chunks.push(e)},ni.prototype.onEnd=function(e){e===Xt&&(this.result=Ht.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ai=function(e,t){return(t=t||{}).gzip=!0,function(e,t){const i=new ni(t);if(i.push(e,!0),i.err)throw i.msg||$t[i.err];return i.result}(e,t)};const oi=["enabled","userId"];var si,ci,di=["drs"];si=di,ci=162,function(e){for(;--e;)si.push(si.shift())}(++ci);var ui,li,hi,fi=new W((ui="0x0",di[ui-=0])),pi=["setItemSessionStorageSafe","removeItem","getItemLocalStorageSafe","FALLBACK_LOCAL_STORAGE","setItemLocalStorageSafe","localStorage","setItem","removeItemLocalStorageSafe","clientId","setClientId","getFullStorageKey","getItemSessionStorageSafe","sessionStorage","getItem","FALLBACK_SESSION_STORAGE"];li=pi,hi=293,function(e){for(;--e;)li.push(li.shift())}(++hi);var gi=function(e,t){return pi[e-=0]};class mi{constructor(e){this.FALLBACK_SESSION_STORAGE={},this.FALLBACK_LOCAL_STORAGE={},this[gi("0x0")]=e}getClientId(){return this[gi("0x0")]}[gi("0x1")](e){this[gi("0x0")]=e}[gi("0x2")](e){return this.clientId+"_"+e}[gi("0x3")](e){const t=this[gi("0x2")](e);try{return window[gi("0x4")][gi("0x5")](t)}catch(e){return this[gi("0x6")][t]}}[gi("0x7")](e,t){const i=this[gi("0x2")](e);try{window[gi("0x4")].setItem(i,t)}catch(e){this[gi("0x6")][i]=t}}removeItemSessionStorageSafe(e){const t=this.getFullStorageKey(e);try{window.sessionStorage[gi("0x8")](t)}catch(e){this[gi("0x6")][t]=void 0}}[gi("0x9")](e){const t=this[gi("0x2")](e);try{return window.localStorage[gi("0x5")](t)}catch(e){return this[gi("0xa")][t]}}[gi("0xb")](e,t){const i=this.getFullStorageKey(e);try{window[gi("0xc")][gi("0xd")](i,t)}catch(e){this[gi("0xa")][i]=t}}[gi("0xe")](e){const t=this[gi("0x2")](e);try{window.localStorage.removeItem(t)}catch(e){this[gi("0xa")][t]=void 0}}}var bi,vi,yi=["pushLog","error","enabled","log","%s %s %s","stringify","push","now","unshift","map","catch","formatter","logPrefix","logsLimit","logs","middlewares","info"];bi=yi,vi=131,function(e){for(;--e;)bi.push(bi.shift())}(++vi);var _i=function(e,t){return yi[e-=0]};class wi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.enabled=e,this[_i("0x0")]="[AccountProtection SDK]",this[_i("0x1")]=1e4,this[_i("0x2")]=[],this[_i("0x3")]=[]}[_i("0x4")](e,t){this.pushLog(3,e,t)}warn(e,t){this[_i("0x5")](4,e,t)}[_i("0x6")](e,t){this[_i("0x5")](5,e,t)}flush(){const e=this[_i("0x2")];return this[_i("0x2")]=[],e}pushLog(e,i,r){this[_i("0x7")]&&console[_i("0x8")](_i("0x9"),this[_i("0x0")],i,JSON[_i("0xa")](r)),this[_i("0x2")][_i("0xb")]({timestamp:Date[_i("0xc")](),severity:e,text:JSON[_i("0xa")](t(t({},r),{},{message:i}),this.formatter)}),this[_i("0x2")].length>this.logsLimit&&this[_i("0x2")][_i("0xd")]();const n=this[_i("0x3")][_i("0xe")]((e=>e()));Promise.all(n)[_i("0xf")]((()=>{}))}[_i("0x10")](e,t){if(t instanceof Error){const{name:e,stack:i,message:r}=t;return{name:e,stack:i,message:r}}return t}}const xi=new wi;var Ai,Ei,Si=["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"];Ai=Si,Ei=459,function(e){for(;--e;)Ai.push(Ai.shift())}(++Ei);var ki=function(e,t){return Si[e-=0]};const Mi=ki("0x0"),Ci=ki("0x1");class Ii{constructor(e,t){this[ki("0x2")]=e,this[ki("0x3")]=t,this.conf=this[ki("0x4")]()}async[ki("0x5")](e){try{const t=ki("0x6")+e,i=await this[ki("0x3")][ki("0x7")](t);return null!=i?i:{}}catch(t){return xi[ki("0x8")](ki("0x9"),{clientId:e,error:t}),{}}}loadConf(){const e=this[ki("0x2")][ki("0xa")](Ci);if(null!=e)try{return JSON[ki("0xb")](e)}catch(e){xi.error(ki("0xc"),{error:e})}return{}}[ki("0xd")](){const e=this.getConfValue(Mi,0);return Date[ki("0xe")]()-e>36e5}async[ki("0xf")](e){if(!this[ki("0xd")]())return!1;let t=await this[ki("0x5")](e);return 0==Object[ki("0x10")](t)[ki("0x11")]?t=this[ki("0x4")]():this.storageManager[ki("0x12")](Ci,JSON[ki("0x13")](t)),this[ki("0x14")]=t,!0}[ki("0x15")](e,t){const i=void 0!==this[ki("0x14")]?this.conf[e]:void 0;return null!=i?i:t}}var Di,Ti,Ri=["EVENT_TYPE_INTERACTION","interaction","identification","desktop_web","mobile_web","EVENT_TYPE_ACTION","EVENT_TYPE_DEVICE"];Di=Ri,Ti=439,function(e){for(;--e;)Di.push(Di.shift())}(++Ti);var Bi,zi,Pi=function(e,t){return Ri[e-=0]};(zi=Bi||(Bi={}))[Pi("0x0")]="action",zi[Pi("0x1")]="device",zi[Pi("0x2")]=Pi("0x3"),zi.EVENT_TYPE_IDENTIFICATION=Pi("0x4");const Oi=Pi("0x5"),Fi=Pi("0x6");var Ni,Li,ji=["push","maintainLastXItems","splice"];Ni=ji,Li=478,function(e){for(;--e;)Ni.push(Ni.shift())}(++Li);var Ui=function(e,t){return ji[e-=0]};class qi{static[Ui("0x0")](e,t,i){return e.length>=t&&e[Ui("0x1")](0,1),e[Ui("0x2")](i),e}}var Ki,Hi,Vi=["maintainLastXItems","location","isTrusted","buffer","extractEventData","getData","now","extractButtonsPressedData","ctrlKey","altKey","shiftKey","buttons","data","detail","offsetX","sourceCapabilities","firesTouchEvents","target","bufferSize","collect","cancelable","composed","view"];Ki=Vi,Hi=394,function(e){for(;--e;)Ki.push(Ki.shift())}(++Hi);var $i=function(e,t){return Vi[e-=0]};class Ji{constructor(e){this.data=[],this[$i("0x0")]=e}collect(e){const t=this[$i("0x1")](e);qi.maintainLastXItems(this.data,this[$i("0x0")],t)}[$i("0x2")](){return this.data}[$i("0x1")](e){return t({x:e.x,y:e.y,tspl:Date[$i("0x3")]()},this[$i("0x4")](e))}extractButtonsPressedData(e){return t(t(t(t({},e[$i("0x5")]&&{ctrlKey:!0}),e[$i("0x6")]&&{altKey:!0}),e[$i("0x7")]&&{shiftKey:!0}),0!=e[$i("0x8")]&&{buttons:e[$i("0x8")]})}}class Gi{constructor(e){this[$i("0x9")]=[],this[$i("0x0")]=e}collect(e){var t;const i={x:e.x,y:e.y,timestamp:Date[$i("0x3")](),mouseButtonType:e[$i("0xa")],offsetX:e[$i("0xb")],offsetY:e.offsetY,isPressed:null==(null===(t=e[$i("0xc")])||void 0===t?void 0:t[$i("0xd")])?null:!e[$i("0xc")].firesTouchEvents,target_id:e[$i("0xe")].id};qi.maintainLastXItems(this[$i("0x9")],this[$i("0x0")],i)}getData(){const e=[...this.data];return this[$i("0x9")]=[],e}}class Wi{constructor(e){this[$i("0x9")]=[],this[$i("0xf")]=e}[$i("0x10")](e){var t;const i={isTrusted:e.isTrusted,cancelable:e[$i("0x11")],composed:e[$i("0x12")],isView:!!e[$i("0x13")],shiftKey:e.shiftKey,metaKey:e.metaKey,firesTouchEvents:null===(t=e[$i("0xc")])||void 0===t?void 0:t[$i("0xd")],timestamp:Date[$i("0x3")]()};qi[$i("0x14")](this[$i("0x9")],this.bufferSize,i)}[$i("0x2")](){const e=[...this[$i("0x9")]];return this.data=[],e}}class Zi{constructor(e){this.data=[],this.bufferSize=e}[$i("0x10")](e){var t;const i={isTrusted:e.isTrusted,cancelable:e[$i("0x11")],composed:e.composed,isView:!!e[$i("0x13")],location:e[$i("0x15")],shiftKey:e[$i("0x7")],firesTouchEvents:null===(t=e.sourceCapabilities)||void 0===t?void 0:t[$i("0xd")],timestamp:Date[$i("0x3")]()};qi[$i("0x14")](this.data,this.bufferSize,i)}[$i("0x2")](){const e=this[$i("0x9")];return this[$i("0x9")]=[],e}}class Yi{constructor(e){this.data=[],this[$i("0xf")]=e}[$i("0x10")](e){const t={isTrusted:e[$i("0x16")],cancelable:e[$i("0x11")],composed:e[$i("0x12")],inputType:e.inputType,isView:!!e.view,timestamp:Date[$i("0x3")]()};qi.maintainLastXItems(this.data,this.bufferSize,t)}getData(){const e=this.data;return this[$i("0x9")]=[],e}}class Qi{constructor(e){this[$i("0x9")]=[],this[$i("0xf")]=e}[$i("0x10")](e){const t={isTrusted:e[$i("0x16")],cancelable:e[$i("0x11")],composed:e[$i("0x12")],timestamp:Date[$i("0x3")]()};qi[$i("0x14")](this[$i("0x9")],this[$i("0xf")],t)}[$i("0x2")](){const e=this.data;return this.data=[],e}}var Xi,er,tr=["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"];Xi=tr,er=394,function(e){for(;--e;)Xi.push(Xi.shift())}(++er);var ir=function(e,t){return tr[e-=0]};const rr=ir("0x0"),nr=ir("0x1"),ar=ir("0x2"),or=ir("0x3"),sr="mouseup",cr=ir("0x4"),dr=ir("0x5"),ur=ir("0x6"),lr=ir("0x7"),hr=ir("0x8"),fr=["INPUT","SELECT","TEXTAREA"];class pr{constructor(e,i,r){this[ir("0x9")]=e,this.mouseEventsCollectionBuffer=i,this[ir("0xa")]=r,this[ir("0xb")]={[nr]:{eventTypesToAttach:[or,sr,cr],attributesMapper:e=>{var t;return{x:e.x,y:e.y,mouseButtonType:e[ir("0xc")],isPressed:null==(null===(t=e[ir("0xd")])||void 0===t?void 0:t.firesTouchEvents)?null:!e.sourceCapabilities[ir("0xe")],offsetX:e[ir("0xf")],offsetY:e[ir("0x10")],target_id:e.target.id}}},[ar]:{attributesMapper:e=>({target_id:e.target.id,isTrusted:e[ir("0x11")],cancelable:e.cancelable,composed:e.composed,dropEffect:e[ir("0x12")][ir("0x13")],effectAllowed:e[ir("0x12")].effectAllowed})},[dr]:{attributesMapper:e=>({target_id:e.target.id})},[or]:{continousCollectors:[new Ji(this[ir("0x14")])]},[sr]:{continousCollectors:[new Gi(1)]},[cr]:{continousCollectors:[new Gi(1)]},focusout:{eventTypesToAttach:[hr,ur,lr,rr],filter:this[ir("0x15")],attributesMapper:e=>{const{target:i,isTrusted:r,cancelable:n,composed:a}=e;return t({target_id:i.id,dataset_keys:Object[ir("0x16")](i[ir("0x17")]||{}),isTrusted:r,cancelable:n,composed:a},navigator.virtualKeyboard&&{navigator_virtualKeyboard:navigator[ir("0x18")].overlaysContent})}},[hr]:{filter:this[ir("0x15")],continousCollectors:[new Yi(50)]},[ur]:{filter:this.inputTypeFilter,continousCollectors:[new Zi(50)]},[lr]:{filter:this.inputTypeFilter,continousCollectors:[new Wi(50)]},[rr]:{continousCollectors:[new Qi(50)]}}}[ir("0x15")](e){var t;const i=null===(t=e[ir("0x19")])||void 0===t?void 0:t[ir("0x1a")];return fr[ir("0x1b")](i)}[ir("0x1c")](){for(const[e,t]of Object[ir("0x1d")](this[ir("0xb")]))if(!this[ir("0x9")][ir("0x1b")](e))try{this[ir("0x1e")](e,t)}catch(t){xi.error(ir("0x1f"),{error:t,eventType:e})}}[ir("0x20")](e,t){return!e[ir("0x20")]||e[ir("0x20")](t)}async[ir("0x21")](e,i,r){const{attributesMapper:n,continousCollectors:a}=e;if(!this[ir("0x20")](e,i))return!1;if(a)a.forEach((e=>{e.collect(i)}));else{const e=this[ir("0x22")](),a=this[ir("0x23")](r),o=t(t(t({},e),n(i)),a&&{attachedEventsData:a});await this.safeEventCallback(r,o)}return!0}[ir("0x1e")](e,t){window[ir("0x24")](e,(async i=>{try{await this.handleEvent(t,i,e)}catch(e){xi[ir("0x25")](ir("0x26"),{error:e})}}))}[ir("0x23")](e){let t;const i=this[ir("0xb")][e][ir("0x27")];return i&&(t={},i[ir("0x28")]((e=>{const{continousCollectors:i}=this[ir("0xb")][e];i&&i[ir("0x28")]((i=>t[e]=i[ir("0x29")]()))}))),t}getGenericAttributes(){return{location:window[ir("0x2a")][ir("0x2b")]}}}var gr,mr,br=["mobile","wow64","setTimeout","race","catch","warn","name","finally","userAgentData","getHighEntropyValues","model","platform","platformVersion","bitness"];gr=br,mr=232,function(e){for(;--e;)gr.push(gr.shift())}(++mr);var vr=function(e,t){return br[e-=0]};function yr(){var e;return null===(e=navigator[vr("0x0")])||void 0===e?void 0:e[vr("0x1")](["architecture",vr("0x2"),vr("0x3"),vr("0x4"),"fullVersionList",vr("0x5"),vr("0x6"),vr("0x7"),"uaFullVersion"])}function _r(e,t){let i;const r=[Promise.resolve(e()).catch((()=>{})),new Promise(((e,r)=>i=window[vr("0x8")](r,t)))];return Promise[vr("0x9")](r)[vr("0xa")]((()=>xi[vr("0xb")]("executor reached timeout",{fnName:e[vr("0xc")]})))[vr("0xd")]((()=>clearTimeout(i)))}var wr,xr,Ar=["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"];wr=Ar,xr=324,function(e){for(;--e;)wr.push(wr.shift())}(++xr);var Er=function(e,t){return Ar[e-=0]};const Sr=Er("0x0"),kr=Er("0x1"),Mr=e=>e?[...e][Er("0x2")](((e,t)=>e+Math[Er("0x3")](t)),0):0;class Cr{constructor(e,t,i){this.storageManager=e,this[Er("0x4")]=t,this.cryptoBinding=i}async calculate(){const e=this[Er("0x4")][Er("0x5")](Sr,[]),t=this[Er("0x4")][Er("0x5")](kr,36e5),i=await new Ir(e,this[Er("0x6")])[Er("0x7")]();return this[Er("0x8")]=i,this[Er("0x9")][Er("0xa")](kr,Date[Er("0xb")]()+t),i}async[Er("0xc")](){return Number(this[Er("0x9")].getItemLocalStorageSafe(kr))<Date[Er("0xb")]()||!this[Er("0x8")]?await this[Er("0xd")]()||{}:this.lastDeviceData||{}}}class Ir{constructor(e,t){this[Er("0x0")]=e,this[Er("0x6")]=t,this[Er("0xe")]={battery:this.getBattery,brave:this[Er("0xf")],canvas:this[Er("0x10")],codecs:this[Er("0x11")],connection:this[Er("0x12")],cookieEnabled:this[Er("0x13")],cryptoRandomValues:this[Er("0x14")],deviceMemory:this[Er("0x15")],documentBasedKeys:this[Er("0x16")],hardwareConcurrency:this[Er("0x17")],indexedDB:this[Er("0x18")],fidoEnabled:this[Er("0x19")],languages:this.getLanguages,language:this[Er("0x1a")],timezoneOffset:this[Er("0x1b")],localStorage:this[Er("0x1c")],navigatorBasedKeys:this[Er("0x1d")],navigatorProduct:this.getNavigatorProduct,navigatorUserAgent:this[Er("0x1e")],navigatorUAData:this.getNavigatorUAData,navigatorHighEntropyData:this[Er("0x1f")],navigatorStorageEstimation:this.navigatorStorageEstimation,navigatorOnLine:this[Er("0x20")],navigatorIsUserActive:this.navigatorIsUserActive,math:this.getMathFingerprint,mediaMatch:this[Er("0x21")],openDatabase:this.getOpenDatabase,windowOrientation:this[Er("0x22")],platform:this[Er("0x23")],cpuClass:this[Er("0x24")],osClass:this.getOsCpu,addBehavior:this[Er("0x25")],productSub:this[Er("0x26")],mediaDevices:this[Er("0x27")],audioFingerprint:this.getAudioFingerprint,audioFingerprintExtended:this.getAudioFingerprintExtended,fonts:this.getFonts,performanceTiming:this[Er("0x28")],performanceMemory:this.getPerformanceMemory,plugins:this[Er("0x29")],screen:this[Er("0x2a")],sequentum:this[Er("0x2b")],sessionStorage:this[Er("0x2c")],referrer:this[Er("0x2d")],timezone:this[Er("0x2e")],touchSupport:this.getTouchSupport,vendor:this.getVendor,buildID:this[Er("0x2f")],webdriver:this.getWebDriver,webGlRenderer:this[Er("0x30")],windowBasedKeys:this.getWindowBasedKeys,windowOuter:this.getWindowOuter,webRTCDisabled:this.webRTCDisabled,cryptoBindingData:this[Er("0x31")][Er("0x32")](this),notificationState:this[Er("0x33")][Er("0x32")](this,Er("0x34")),geolocationState:this.getNavigatorPermissionsState[Er("0x32")](this,"geolocation"),isGeoLocationExists:this[Er("0x35")],isSendBeaconExists:this[Er("0x36")],navigatorPrototype:this.getNavigatorPrototype,installedRelatedApps:this[Er("0x37")],windowConstructorAliasTest:this[Er("0x38")],windowDocumentAuxVarsTest:this[Er("0x39")],CDPRuntimeDomainTest:this.CDPRuntimeDomainTest}}[Er("0x3a")](){let e=!1;const t=new(window[Er("0x3b")]);return window[Er("0x3c")][Er("0x3d")](t,Er("0x3e"),{configurable:!1,enumerable:!1,get:function(){return e=!0,""}}),window.console.debug(t[Er("0x3e")]),e}[Er("0x39")](){for(const e of window[Er("0x3c")][Er("0x3f")](window[Er("0x40")]))if("$chrome_asyncScriptInfo"==e||/^\$cdc_[a-zA-Z0-9]{22}_$/[Er("0x41")](e))return!0;for(const e of window[Er("0x3c")][Er("0x42")](window[Er("0x3c")][Er("0x43")](window[Er("0x40")]))){if(!e.value||void 0===e[Er("0x44")].cache_)continue;const t=window[Er("0x3c")].getOwnPropertyNames(window[Er("0x3c")][Er("0x45")](e[Er("0x44")])),i=["storeItem","retrieveItem",Er("0x46")];if(t[Er("0x47")](),i[Er("0x47")](),t[Er("0x48")](((e,t)=>e==i[t])))return!0}return!1}[Er("0x38")](){const e=window[Er("0x3c")][Er("0x3f")](window);for(const t of e){if(/^cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)$/.test(t))return!0;for(const e of[window[Er("0x49")],window[Er("0x4a")],window.Symbol])if(t!=(null==e?void 0:e[Er("0x4b")])&&"token"!=t&&t!=Er("0x4c")&&window[t]===e)return!0}return!1}async dataPointsExtractor(){const e=this[Er("0x4d")]();return await this.collectPromisesData(e)}startPromisesLoop(){const e={};for(const[t,i]of Object.entries(this[Er("0xe")]))if(!this[Er("0x0")][Er("0x4e")](t))try{e[t]=_r(i,100)}catch(i){xi[Er("0x4f")]("worker throw error",{e:i,key:t}),e[t]=Promise.resolve()}return e}async[Er("0x50")](e){const t={};for(const[i,r]of Object[Er("0x51")](e))try{t[i]=await r}catch(e){xi.warn("worker promise rejected",{e:e,key:i}),t[i]=void 0}return t}[Er("0x13")](){const e=navigator.cookieEnabled;return Promise[Er("0x52")](e)}async[Er("0x19")](){return!!navigator[Er("0x53")]&&await window[Er("0x54")][Er("0x55")]()}getCryptoRandomValues(){const e=window.crypto.getRandomValues(new Uint8Array(16));return Array[Er("0x56")](e)}[Er("0x57")](){const e=null==window[Er("0x58")];return Promise[Er("0x52")](e)}[Er("0x59")](){const e=["chrome","safari",Er("0x5a"),"__gCrWeb","yandex",Er("0x5b"),Er("0x5c"),"__firefox__",Er("0x5d"),Er("0x5e"),Er("0x5f"),Er("0x60"),Er("0x61"),Er("0x62"),Er("0x63"),Er("0x64"),Er("0x65"),"callPhantom",Er("0x66"),Er("0x67"),Er("0x68"),Er("0x69"),Er("0x6a"),Er("0x6b"),Er("0x6c"),Er("0x6d"),Er("0x6e"),Er("0x6f"),Er("0x70"),"__driver_evaluate","__driver_unwrapped",Er("0x71"),Er("0x72"),Er("0x73"),"__lastWatirConfirm",Er("0x74"),Er("0x75"),"__selenium_unwrapped",Er("0x76"),"__webdriver_evaluate",Er("0x77"),Er("0x78"),Er("0x79"),"__webdriver_unwrapped",Er("0x7a"),Er("0x7b"),Er("0x7c"),Er("0x7d"),"cdc_adoQpoasnfa76pfcZLmcfl_Promise","cdc_adoQpoasnfa76pfcZLmcfl_Symbol",Er("0x7e"),Er("0x7f"),Er("0x80"),Er("0x81"),Er("0x82"),"watinExpressionError",Er("0x83")],t=[];for(const i of e){const e=window[i];void 0!==e&&null!=e&&t[Er("0x84")](i)}return Promise[Er("0x52")](t)}[Er("0x21")](){const e={"dynamic-range":[Er("0x85"),"standard"],"prefers-reduced-motion":[Er("0x86"),Er("0x2")],"prefers-contrast":[Er("0x86"),Er("0x85"),Er("0x87"),Er("0x88"),Er("0x89"),Er("0x8a")],"max-monochrome":["0","10",Er("0x8b"),Er("0x8c")],"forced-colors":["active",Er("0x8d")],"inverted-colors":[Er("0x8e"),Er("0x8d")],"color-gamut":[Er("0x8f"),"p3",Er("0x90")]},t={};for(const[i,r]of Object.entries(e))for(const e of r)t[i[Er("0x91")](/-/g,"_")+"_"+e.replace(/-/g,"_")]=window.matchMedia("("+i+": "+e+")")[Er("0x92")];return Promise[Er("0x52")](t)}[Er("0x93")](){const e=[Math[Er("0x97")](.12312423423423424),Math[Er("0x98")](1e308),(t=1e154,Math[Er("0x94")](t+Math[Er("0x95")](t*t-1))),Math[Er("0x99")](.12312423423423424),Math[Er("0x9a")](1),Math[Er("0x94")](1+Math[Er("0x95")](2)),Math[Er("0x9b")](.5),Math.log(3)/2,Math[Er("0x9c")](.5),Math[Er("0x9d")](-1e300),Math[Er("0x9e")](1),Math[Er("0x96")](1)-1/Math[Er("0x96")](1)/2,Math.cos(10.000000000123),Math[Er("0x9f")](1),(Math[Er("0x96")](1)+1/Math[Er("0x96")](1))/2,Math[Er("0xa0")](-1e300),Math[Er("0xa1")](1),(Math.exp(2)-1)/(Math.exp(2)+1),Math[Er("0x96")](1),Math[Er("0xa2")](1),Math[Er("0x96")](1)-1,Math[Er("0xa3")](10),Math[Er("0x94")](11),Math.PI**-100];var t;let i="";for(let t=0;t<e[Er("0xa4")];t++)i+=e[t][Er("0xa5")]();return Promise.resolve(Ir[Er("0xa6")](i))}getConnection(){const{connection:e}=navigator,t=(e=>{let{downlink:t,effectiveType:i,rtt:r,saveData:n}=e;return{downlink:t,effectiveType:i,rtt:r,saveData:n}})(e);return Promise.resolve(t)}[Er("0x2c")](){return Promise.resolve(!!window[Er("0xa7")])}[Er("0x1c")](){return Promise.resolve(!!window[Er("0xa8")])}[Er("0x2b")](){return-1!==window[Er("0xa9")][Er("0xa5")]().indexOf(Er("0xaa"))}[Er("0x1d")](){return[Er("0xab"),Er("0xac"),Er("0xad"),Er("0x75"),"__fxdriver_evaluate",Er("0xae"),Er("0xaf"),Er("0xb0"),Er("0x72"),"_Selenium_IDE_Recorder","_selenium",Er("0x6d"),Er("0xb1"),Er("0xb2"),Er("0xb3"),Er("0xb4"),Er("0xb5"),Er("0xb6"),Er("0xb7"),Er("0xb8"),Er("0x77"),Er("0x70"),Er("0x73"),Er("0xb9"),Er("0x74"),"$chrome_asyncScriptInfo",Er("0xba"),Er("0xbb")].filter((e=>navigator[e]))}[Er("0xbc")](){const e=navigator[Er("0xbd")];return Promise[Er("0x52")](e)}[Er("0x1e")](){return navigator.userAgent}[Er("0xbe")](){return navigator[Er("0xbf")]}[Er("0x1f")](){return yr()}[Er("0xc0")](){return navigator[Er("0xc1")][Er("0xc2")]()}[Er("0x20")](){return navigator[Er("0xc3")]}[Er("0xc4")](){return navigator.userActivation.isActive}async[Er("0x33")](e){try{const t=await navigator[Er("0xc5")].query({name:e});return null==t?void 0:t.state}catch(e){}}isGeoLocationExists(){return!!navigator[Er("0xc6")]}isSendBeaconFunction(){return typeof navigator[Er("0xc7")]===Er("0xc8")}[Er("0xc9")](){return{hardwareConcurrency:Object[Er("0xca")](Object[Er("0x45")](navigator),Er("0xcb"))[Er("0xcc")][Er("0xa5")](),languages:Object[Er("0xca")](Object[Er("0x45")](navigator),Er("0xcd"))[Er("0xcc")].toString()}}async[Er("0x37")](){if(typeof navigator[Er("0x37")]===Er("0xc8"))try{const{related_applications:e}=await navigator[Er("0x37")]();if(e&&Array[Er("0xce")](e))return e.map((e=>({platform:e[Er("0xcf")],url:e[Er("0xd0")]})))}catch(e){}}[Er("0x2d")](){return document[Er("0xd1")]}[Er("0x28")](){return performance.timing}[Er("0xd2")](){const{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:i}=performance.memory;return{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:i}}[Er("0x18")](){return Promise[Er("0x52")](!!window[Er("0xd3")])}getOpenDatabase(){const{openDatabase:e}=window;return Promise.resolve(!!e)}getTouchSupport(){const e=window[Er("0xd4")]&&document instanceof DocumentTouch,t={maxTouchPoints:navigator[Er("0xd5")]||navigator[Er("0xd6")]||0,documentTouch:e,ontouchstart:"ontouchstart"in window};return Promise.resolve(t)}getPlugins(){function e(e){const t=[];for(let i=0;i<e.length;++i)t[Er("0x84")]({type:e[i][Er("0xd7")],suffixes:e[i][Er("0xd8")]});return t}const t=[];for(let i=0;i<navigator[Er("0xd9")][Er("0xa4")];++i){const r=navigator.plugins[i];r&&t[Er("0x84")]({name:r[Er("0x4b")],description:r[Er("0xda")],mimeTypes:e(r)})}return Promise[Er("0x52")](t)}[Er("0x2a")](){const e=window.screen||screen,{availLeft:t}=e,{availTop:i}=e,r={availHeight:e[Er("0xdb")],availLeft:t,availTop:i,availWidth:e.availWidth,colorDepth:e[Er("0xdc")],height:e.height,width:e[Er("0xdd")],pixelDepth:e[Er("0xde")],orientationAngle:e.orientation&&e.orientation[Er("0xdf")],orientationType:e.orientation&&e.orientation.type,devicePixelRatio:window[Er("0xe0")]};return Promise[Er("0x52")](r)}static[Er("0xa6")](e){if(null==e)return;let t=0,i=0;const r=e[Er("0xa4")];for(;i<r;)t=(t<<5)-t+e[Er("0xe1")](i++)|0;return t}getWindowOuter(){const e={outerWidth:window[Er("0xe2")],outerHeight:window[Er("0xe3")]};return Promise[Er("0x52")](e)}[Er("0xe4")](){const e=navigator[Er("0xab")];return Promise[Er("0x52")](e)}getWindowOrientation(){const e=window[Er("0xe5")];return Promise.resolve(e)}[Er("0x23")](){const e=navigator.platform;return Promise[Er("0x52")](e)}[Er("0x24")](){const e=navigator.cpuClass;return Promise[Er("0x52")](e)}[Er("0xe6")](){const e=navigator.oscpu;return Promise[Er("0x52")](e)}[Er("0x25")](){const e=!!window[Er("0xe7")][Er("0xe8")].addBehavior;return Promise[Er("0x52")](e)}[Er("0x26")](){const e=navigator.productSub;return Promise[Er("0x52")](e)}async[Er("0x27")](){const e=await navigator[Er("0xe9")][Er("0xea")](),t=[];for(const i of e)t.push({kind:i[Er("0xeb")],label:i.label,deviceId:i.deviceId,groupId:i[Er("0xec")]});return t}async getAudioFingerprint(){const e=window[Er("0xed")]||window.webkitOfflineAudioContext;if(!e)return-1;const t=new e(1,5e3,44100),i=t[Er("0xee")]();i.type=Er("0xef"),i[Er("0xf0")][Er("0x44")]=1e4;const r=t.createDynamicsCompressor();r[Er("0xf1")][Er("0x44")]=-50,r.knee[Er("0x44")]=40,r[Er("0xf2")][Er("0x44")]=12,r[Er("0xf3")][Er("0x44")]=0,r[Er("0xf4")][Er("0x44")]=.25,i[Er("0xf5")](r),r[Er("0xf5")](t[Er("0xf6")]),i[Er("0xf7")](0);const n=new Promise((async(e,i)=>{t.oncomplete=t=>e(t[Er("0xf8")]);try{await t.startRendering()}catch(e){i(e)}})),a=(await n)[Er("0xf9")](0)[Er("0xfa")](4500);return Ir.getHash(a)}async getAudioFingerprintExtended(){var e;const t=window[Er("0xed")]||window[Er("0xfb")];if(!t)return{};const i=new t(1,5e3,44100),r=i.createOscillator();r[Er("0xd7")]=Er("0xef"),r[Er("0xf0")][Er("0x44")]=1e4;const n=i[Er("0xfc")]();n[Er("0xf1")].value=-50,n[Er("0xfd")].value=40,n.attack[Er("0x44")]=0;const a=i[Er("0xfe")]();r.connect(n),n.connect(a),n[Er("0xf5")](i[Er("0xf6")]),r[Er("0xf7")](0);try{await i[Er("0xff")](),n[Er("0x100")](),r.disconnect();const t=new Float32Array(a[Er("0x101")]);null===(e=a.getFloatFrequencyData)||void 0===e||e[Er("0x102")](a,t);const o=new Float32Array(a[Er("0x103")]);return"getFloatTimeDomainData"in a&&a[Er("0x104")](o),{gain:n[Er("0x105")][Er("0x44")]||n[Er("0x105")],freq:Mr(t),time:Mr(o)}}catch(e){return{}}}static[Er("0x106")](e){let t=0;for(let i=0;i<e[Er("0xa4")];++i)t+=Math[Er("0x3")](e[i]);return t}getFonts(){const e=Er("0x107"),t=[Er("0x108"),Er("0x109"),Er("0x10a")],i=[Er("0x10b"),Er("0x10c"),Er("0x10d"),Er("0x10e"),"Arial Unicode MS",Er("0x10f"),Er("0x110"),Er("0x111"),Er("0x112"),Er("0x113"),"Century","Century Gothic",Er("0x114"),"EUROSTILE","Franklin Gothic",Er("0x115"),"Futura Md BT",Er("0x116"),Er("0x117"),Er("0x118"),Er("0x119"),"Helvetica Neue",Er("0x11a"),Er("0x11b"),Er("0x11c"),Er("0x11d"),Er("0x11e"),Er("0x11f"),Er("0x120"),Er("0x121"),"MS Outlook",Er("0x122"),Er("0x123"),Er("0x124"),"MYRIAD PRO",Er("0x125"),"Meiryo UI","Microsoft Uighur",Er("0x126"),Er("0x127"),Er("0x128"),"Pristina",Er("0x129"),"Segoe UI Light",Er("0x12a"),Er("0x12b"),Er("0x12c"),Er("0x12d"),Er("0x12e"),Er("0x12f"),Er("0x130"),"ZWAdobeF"],r=document.createElement(Er("0x131"));r.style.visibility=Er("0x132");const n={},a={},o=t=>{const i=document[Er("0x133")](Er("0x134")),{style:n}=i;return n[Er("0x135")]="absolute",n[Er("0x136")]="0",n[Er("0x137")]="0",n.fontFamily=t,n[Er("0x138")]=Er("0x139"),i.textContent=e,r.appendChild(i),i},s=(e,t)=>o("'"+e+"',"+t),c=t.map(o),d=(()=>{const e={};for(const r of i)e[r]=t[Er("0x13a")]((e=>s(r,e)));return e})();document[Er("0x13d")][Er("0x13e")](r);try{for(let e=0;e<t[Er("0xa4")];e++)n[t[e]]=c[e].offsetWidth,a[t[e]]=c[e].offsetHeight;const e=i[Er("0x13f")]((e=>{return i=d[e],t.some(((e,t)=>i[t][Er("0x13b")]!==n[e]||i[t][Er("0x13c")]!==a[e]));var i}));return Promise.resolve(e)}finally{document[Er("0x13d")][Er("0x140")](r)}}[Er("0x1b")](){const e=(new Date)[Er("0x1b")]();return Promise.resolve(e)}[Er("0x1a")](){const e=navigator[Er("0x141")];return Promise.resolve(e)}[Er("0x142")](){const e=navigator[Er("0xcd")];return Promise[Er("0x52")](e)}[Er("0x17")](){const e=navigator[Er("0xcb")];return Promise.resolve(e)}[Er("0x15")](){const e=navigator[Er("0x143")];return Promise[Er("0x52")](e)}[Er("0x16")](){return[Er("0xad"),Er("0x75"),"__webdriver_script_function",Er("0x78"),Er("0x77"),"__fxdriver_evaluate",Er("0xae"),Er("0xaf"),Er("0xac"),Er("0xb0"),Er("0x72")][Er("0x13f")]((e=>document[e]))}[Er("0x2e")](){const e=Intl[Er("0x144")]()[Er("0x145")]()[Er("0x146")];return Promise[Er("0x52")](e)}[Er("0x147")](){const e=navigator.vendor;return Promise[Er("0x52")](e)}[Er("0x2f")](){const e=navigator[Er("0x148")];return Promise[Er("0x52")](e)}async getCanvasFingerprint(){const e=document[Er("0x133")](Er("0x162"));e[Er("0xdd")]=1,e[Er("0x149")]=1;const t=e[Er("0x163")]("2d"),i={winding:function(e){return e[Er("0x160")](0,0,10,10),e.rect(2,2,6,6),!e[Er("0x161")](5,5,"evenodd")}(t),geometry:function(e,t){e[Er("0xdd")]=122,e[Er("0x149")]=110,t[Er("0x155")]=Er("0x156");const i=[[Er("0x157"),40,40],[Er("0x158"),80,40],[Er("0x159"),60,80]];for(const[e,r,n]of i)t[Er("0x14c")]=e,t[Er("0x15a")](),t[Er("0x15b")](r,n,40,0,2*Math.PI,!0),t[Er("0x15c")](),t[Er("0x15d")]();return t[Er("0x14c")]=Er("0x15e"),t[Er("0x15b")](60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t[Er("0x15d")](Er("0x15f")),Ir[Er("0xa6")](e[Er("0x154")]())}(e,t),text:function(e,t){e[Er("0xdd")]=240,e[Er("0x149")]=60,t[Er("0x14a")]=Er("0x14b"),t[Er("0x14c")]=Er("0x14d"),t.fillRect(100,1,62,20),t[Er("0x14c")]=Er("0x14e"),t[Er("0x14f")]=Er("0x150");const i=Er("0x151")+String[Er("0x152")](55357,56835);return t[Er("0x153")](i,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t[Er("0x14f")]="18pt Arial",t[Er("0x153")](i,4,45),Ir[Er("0xa6")](e[Er("0x154")]())}(e,t)};return Promise[Er("0x52")](i)}async[Er("0x164")](){const e=await navigator[Er("0x164")]();return{charging:e[Er("0x165")],chargingTime:e[Er("0x166")],dischargingTime:e[Er("0x167")],level:e.level}}async[Er("0xf")](){return!!navigator[Er("0x168")]&&await navigator[Er("0x168")][Er("0x169")]()}async getWebGlRenderer(){const e=document[Er("0x133")](Er("0x162")),t=e.getContext(Er("0x16a"))||e[Er("0x163")]("webgl-experimental"),i=t.getExtension(Er("0x16b"));return Promise.resolve(t.getParameter(i[Er("0x16c")]))}async[Er("0x11")](){const e=document[Er("0x133")](Er("0x16d")),t={basic:""===e.canPlayType('video/mp4; codecs="avc1.42E01E"'),advanced:""===e[Er("0x16e")](Er("0x16f"))};return Promise[Er("0x52")](t)}async[Er("0x31")](){const{publicKey:e,keyIdentifier:t}=await this.cryptoBinding[Er("0x170")]();return{publicKey:e,keyIdentifier:t}}static[Er("0x171")](){return/iPhone|iPad|iPod|Android|MiuiBrowser/i.test(navigator[Er("0x172")])||null!=window[Er("0xe5")]||window[Er("0x173")](Er("0x174")).matches}}var Dr,Tr,Rr=["uncompressed","ALLOW","DENY","TRUST","compress","compressed"];Dr=Rr,Tr=490,function(e){for(;--e;)Dr.push(Dr.shift())}(++Tr);var Br,zr,Pr,Or,Fr=function(e,t){return Rr[e-=0]};(zr=Br||(Br={}))[Fr("0x0")]=Fr("0x1"),zr[Fr("0x2")]="uncompressed",(Or=Pr||(Pr={}))[Fr("0x3")]=Fr("0x3"),Or.CHALLENGE="CHALLENGE",Or[Fr("0x4")]=Fr("0x4"),Or[Fr("0x5")]=Fr("0x5");var Nr,Lr,jr=["encode","AES-GCM","encrypt","exportKey","raw","stringify","RSA-OAEP","arrayBufferToBase64","btoa","importPublicKey","jwk","parse","SHA-256","generateSymKey","configManager","crypto","subtle","generateKey","decrypt","encryptPayload"];Nr=jr,Lr=494,function(e){for(;--e;)Nr.push(Nr.shift())}(++Lr);var Ur=function(e,t){return jr[e-=0]};class qr{constructor(e){this[Ur("0x0")]=e}generateSymKey(){return window[Ur("0x1")][Ur("0x2")][Ur("0x3")]({name:"AES-GCM",length:256},!0,["encrypt",Ur("0x4")])}async[Ur("0x5")](e,t){const i="string"==typeof e?(new TextEncoder)[Ur("0x6")](e):e,r=window[Ur("0x1")].getRandomValues(new Uint8Array(12)),n={name:Ur("0x7"),iv:r},a=await window.crypto.subtle[Ur("0x8")](n,t,i);return{payloadCipherText:this.arrayBufferToBase64(a),iv:r}}async encryptSymKeyBundle(e,t,i){const r=await window[Ur("0x1")].subtle[Ur("0x9")](Ur("0xa"),e),n=this.arrayBufferToBase64(r),a=this.arrayBufferToBase64(t),o=(new TextEncoder)[Ur("0x6")](JSON[Ur("0xb")]({symKey:n,iv:a})),s=await window[Ur("0x1")][Ur("0x2")].encrypt({name:Ur("0xc")},i,o);return this.arrayBufferToBase64(s)}[Ur("0xd")](e){let t="";const i=new Uint8Array(e),r=i.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(i[e]);return window[Ur("0xe")](t)}[Ur("0xf")](e){return window[Ur("0x1")].subtle.importKey(Ur("0x10"),JSON[Ur("0x11")](e),{name:Ur("0xc"),hash:Ur("0x12")},!0,["encrypt"])}async[Ur("0x8")](e,t){if(!window[Ur("0x1")]||!window[Ur("0x1")][Ur("0x2")])throw new Error("crypto is not supported");const i=await this[Ur("0x13")](),{payloadCipherText:r,iv:n}=await this[Ur("0x5")](t,i),a=await this[Ur("0xf")](e);return{encryptedData:r,encryptedKey:await this.encryptSymKeyBundle(i,n,a)}}}var Kr,Hr,Vr=["client","SERVER","COMMUNICATION","communication","errorSpace","message","error","toString","name",", errorCode: ","errorCode","toLog"];Kr=Vr,Hr=384,function(e){for(;--e;)Kr.push(Kr.shift())}(++Hr);var $r,Jr,Gr=function(e,t){return Vr[e-=0]};(Jr=$r||($r={})).CLIENT=Gr("0x0"),Jr[Gr("0x1")]="server",Jr[Gr("0x2")]=Gr("0x3");class Wr extends Error{constructor(e,t,i){var r,n;super(),this.error=e,this[Gr("0x4")]=t,this.errorCode=i,this[Gr("0x5")]=(null===(r=this[Gr("0x6")])||void 0===r?void 0:r[Gr("0x5")])||this[Gr("0x6")][Gr("0x7")](),this.name=(null===(n=this.error)||void 0===n?void 0:n[Gr("0x8")])||Wr.name}[Gr("0x7")](){return"SDKError: "+this[Gr("0x5")]+(this[Gr("0x4")]?", errorSpace: "+this.errorSpace:"")+(this.errorCode?Gr("0x9")+this[Gr("0xa")]:"")}[Gr("0xb")](){return t(t({name:this[Gr("0x8")],message:this[Gr("0x5")]},this[Gr("0x4")]&&{errorSpace:this[Gr("0x4")]}),this[Gr("0xa")]&&{errorCode:this[Gr("0xa")]})}}var Zr,Yr,Qr=["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"];Zr=Qr,Yr=307,function(e){for(;--e;)Zr.push(Zr.shift())}(++Yr);var Xr=function(e,t){return Qr[e-=0]};const en=Xr("0x0"),tn=Xr("0x1"),rn=Xr("0x2"),nn=Xr("0x3"),an=Xr("0x4"),on=Xr("0x5"),sn=Xr("0x6"),cn=Xr("0x7"),dn=Xr("0x8"),un=[Bi.EVENT_TYPE_ACTION,Bi[Xr("0x9")]],ln=Xr("0xa");class hn{constructor(e,i,r,n,a,o,s,c){this[Xr("0xb")]=e,this.storageManager=i,this[Xr("0xc")]=r,this.requestsManager=n,this.identityManager=a,this[Xr("0xd")]=o,this[Xr("0xe")]=s,this[Xr("0xf")]=c,this[Xr("0x10")]=null,this[Xr("0x11")]=null,this[Xr("0x12")]=async(e,i)=>{try{const r=t({},t({interaction_type:e},i)),n={type:Bi[Xr("0x13")],attributes:r};return await this.emitEvent(n)}catch(e){}},this[Xr("0xf")]=c,this[Xr("0x14")]=[],this.crypto=new qr(e),this[Xr("0x15")]=new pr(this[Xr("0xb")][Xr("0x16")](on,[]),this[Xr("0xb")].getConfValue(an,100),this[Xr("0x12")]),this[Xr("0x17")]=Ir[Xr("0x17")](),this[Xr("0x18")]=this[Xr("0xb")].getConfValue(ln,[Bi[Xr("0x19")]]),this[Xr("0x1a")]=this[Xr("0xb")][Xr("0x16")]("maxLocalStoredEvents",4),this[Xr("0x1b")]=36e4,this[Xr("0x1c")]()}async emitEvent(e){e.index=this[Xr("0x1d")](),e.location=location[Xr("0x1e")](),e.platform=navigator[Xr("0x1f")],e[Xr("0x20")]="1.52.6",e[Xr("0xe")]=this.serverPath,e.tabId=this[Xr("0x21")][Xr("0x22")](),e[Xr("0x23")]=Date.now(),await this[Xr("0x24")](e);let t=0;this[Xr("0x18")][Xr("0x25")](e[Xr("0x26")])?t=this[Xr("0x27")](e):this[Xr("0x14")].push(e);const i=this[Xr("0xb")][Xr("0x16")](cn,2);if(this[Xr("0x14")][Xr("0x28")]+t>=i||un[Xr("0x25")](e[Xr("0x26")])){this[Xr("0x11")]&&(clearTimeout(this[Xr("0x11")]),this.flushTimeoutHandle=null);try{return await this[Xr("0x29")]()}catch(t){throw xi.error(Xr("0x2a"),{clientId:this.identityManager.getClientId(),eventType:e[Xr("0x26")],error:t[Xr("0x2b")]?t[Xr("0x2c")]():t}),t}}if(!this[Xr("0x11")]&&this[Xr("0x14")].length>0){const t=this[Xr("0xb")][Xr("0x16")](dn,2),i=Math[Xr("0x2d")](t,30);this[Xr("0x11")]=setTimeout((()=>{this[Xr("0x11")]=null,this[Xr("0x29")]()[Xr("0x2e")]((t=>{xi[Xr("0x2f")](Xr("0x30"),{clientId:this[Xr("0x21")][Xr("0x31")](),eventType:e[Xr("0x26")],error:t[Xr("0x2b")]?t[Xr("0x2c")]():t})}))}),1e3*i)}return{}}async[Xr("0x32")](){try{return this.eventsQueue[Xr("0x28")]>0?await this[Xr("0x29")]():(await this[Xr("0x33")](!0),await this.flush())}catch(e){xi[Xr("0x2f")](Xr("0x34"),{e:e})}}async[Xr("0x1c")](){try{this[Xr("0x21")][Xr("0x35")]()&&await this[Xr("0x32")]()}catch(e){xi.error("Failed to polling data",{e:e})}finally{setTimeout((async()=>{await this.pollingSessionToken()}),this[Xr("0x1b")])}}async[Xr("0x24")](e){var t;if(!(null===(t=e.attributes)||void 0===t?void 0:t.navigatorHighEntropyData))try{e[Xr("0x36")][Xr("0x37")]=await yr()}catch(e){}}[Xr("0x38")](){const e=[],t=this[Xr("0x39")]();for(;this[Xr("0x14")].length;)e.push(this.eventsQueue[Xr("0x3a")]());return(null==t?void 0:t[Xr("0x28")])&&e.push(...t),e[Xr("0x3b")](((e,t)=>e[Xr("0x23")]-t[Xr("0x23")]))}async flush(){const e=this[Xr("0x38")]();if(0===e[Xr("0x28")])return{};const i={};i[Xr("0x3c")]=this.identityManager[Xr("0x31")](),i.deviceId=this[Xr("0x21")][Xr("0x3d")](),i[Xr("0x3e")]=this[Xr("0x21")][Xr("0x3f")](),i[Xr("0x40")]=this[Xr("0x17")]?Fi:Oi,i.events=e;try{const{keyIdentifier:e}=await this.cryptoBinding[Xr("0x41")]();i[Xr("0x42")]=e}catch(e){xi[Xr("0x43")](Xr("0x44")+e)}this[Xr("0xf")]&&(i.sessionToken=!0);const r=await this[Xr("0x45")](i,!0),n=await this[Xr("0xd")][Xr("0x46")]();let a;n&&(a=[{type:"key_rotation_data",data:n[Xr("0x47")],signature:n[Xr("0x48")]}]);const o=await this[Xr("0x49")][Xr("0x4a")](Xr("0x4b"),t(t({},r),a?{headers:a}:{}));if(o[Xr("0x4c")]){const e=o[Xr("0x4c")][Xr("0x4d")]((e=>"key_rotation_status"===e[Xr("0x26")]));e&&e[Xr("0x4e")]&&this[Xr("0xd")][Xr("0x4f")](e[Xr("0x4e")])}return o[Xr("0x50")]&&this[Xr("0x21")][Xr("0x51")](o[Xr("0x50")]),o[Xr("0x52")]&&this.identityManager[Xr("0x53")](o[Xr("0x52")]),o[Xr("0x3e")]&&this[Xr("0x21")].setUserId(o[Xr("0x3e")]),this[Xr("0x54")](),o}async[Xr("0x45")](e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.configManager[Xr("0x16")](sn,null);if(null===i&&t)return await this[Xr("0xb")].refreshConf(this[Xr("0x21")][Xr("0x31")]()),await this[Xr("0x45")](e);if(null===i)throw new Wr(new Error(Xr("0x55")),$r[Xr("0x56")]);try{const t=JSON[Xr("0x57")](e),r=this[Xr("0x58")](t),n=r||t,{encryptedData:a,encryptedKey:o}=await this.crypto[Xr("0x59")](i,n);return{data:a,key:o,dataType:r?Br.compress:Br[Xr("0x5a")]}}catch(e){throw new Wr(e,$r.CLIENT)}}[Xr("0x58")](e){try{return ai(e)}catch(e){xi[Xr("0x2f")](Xr("0x5b"),{clientId:this[Xr("0x21")][Xr("0x31")](),error:e})}}increaseEventIndex(){if(null===this[Xr("0x10")]){const e=this[Xr("0x5c")][Xr("0x5d")](rn),t=Number[Xr("0x5e")](e);this.eventIndex=Number.isNaN(t)?-1:t}return this.eventIndex++,this[Xr("0x5c")][Xr("0x5f")](rn,this[Xr("0x10")][Xr("0x1e")]()),this[Xr("0x10")]}[Xr("0x60")](){const e=this[Xr("0x5c")][Xr("0x5d")](en),t=this.storageManager[Xr("0x5d")](tn);return!e||!t||Date[Xr("0x61")]()-e>864e5||t!=this[Xr("0x21")][Xr("0x3d")]()}async[Xr("0x33")](e){if(!e&&!this.shouldSendDeviceEvent())return xi[Xr("0x62")]("no need to send device event"),!1;const t=await this[Xr("0xc")][Xr("0x63")](),i={type:Bi.EVENT_TYPE_DEVICE,attributes:t},r=await this[Xr("0x64")](i);return r&&(this[Xr("0x5c")][Xr("0x5f")](en,Date[Xr("0x61")]()),this.storageManager[Xr("0x5f")](tn,this[Xr("0x21")][Xr("0x3d")]())),r}async[Xr("0x65")](){const e="page_load";if(this[Xr("0xb")][Xr("0x16")](on,[])[Xr("0x25")](e))return!1;const i=this[Xr("0x66")]();return await this[Xr("0x64")]({type:Bi.EVENT_TYPE_INTERACTION,attributes:t(t({interaction_type:e,location:window[Xr("0x67")].href,referrer:document[Xr("0x68")]},window[Xr("0x69")]&&{window_historyLength:window.history[Xr("0x28")]}),i&&{windowResources:i})}),!0}[Xr("0x66")](){try{const e=window[Xr("0x6a")][Xr("0x6b")](Xr("0x6c"));return e&&Array[Xr("0x6d")](e)?e.map((e=>({name:e[Xr("0x6e")],initiatorType:e[Xr("0x6f")]}))):void 0}catch(e){}}registerEventListeners(){this.interactionEventsManager.registerEventListeners(),this[Xr("0x21")][Xr("0x70")]()}[Xr("0x39")](){const e=this.storageManager[Xr("0x5d")](nn);return e?JSON[Xr("0x71")](e):[]}addEventToLocalStorage(e){const t=this[Xr("0x39")]();return qi.maintainLastXItems(t,this[Xr("0x1a")],e),this[Xr("0x5c")].setItemLocalStorageSafe(nn,JSON[Xr("0x57")](t)),t[Xr("0x28")]}[Xr("0x54")](){this[Xr("0x5c")][Xr("0x72")](nn)}}var fn,pn,gn=["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"];fn=gn,pn=426,function(e){for(;--e;)fn.push(fn.shift())}(++pn);var mn=function(e,t){return gn[e-=0]};const bn="rui",vn=mn("0x0"),yn=mn("0x1"),_n=mn("0x2"),wn=mn("0x3"),xn=mn("0x4"),An=mn("0x5");class En{constructor(e,t,i){this[mn("0x6")]=e,this.configManager=t,this[mn("0x7")]=i,this[mn("0x8")](this[mn("0x7")])}[mn("0x9")](){this[mn("0xa")](),this[mn("0xb")]()}[mn("0xc")](){window[mn("0xd")](mn("0xe"),(async()=>this[mn("0xf")]()))}[mn("0x10")](){return this[mn("0x11")]}[mn("0x12")](e){this.deviceId!==e&&(xi[mn("0x13")](mn("0x14"),{deviceId:e}),this[mn("0x11")]=e,this.storageManager.setItemSessionStorageSafe(yn,e),this.storageManager[mn("0x15")](yn,e))}[mn("0xa")](){const e=this[mn("0x6")][mn("0x16")](yn)||this.storageManager[mn("0x17")](yn);return null!=e&&this.setDeviceId(e),e}getClientId(){return this.clientId}[mn("0x8")](e){this[mn("0x6")].getClientId()!=e&&this[mn("0x6")][mn("0x8")](e),this[mn("0x6")][mn("0x18")](vn,e)}[mn("0x19")](){if(Number(this[mn("0x6")].getItemLocalStorageSafe(_n))+this[mn("0x1a")][mn("0x1b")](An,864e5)<Date[mn("0x1c")]())return this[mn("0x1d")](),null;const e=this.storageManager[mn("0x16")](bn);return null!=e?e:this[mn("0x6")][mn("0x17")](bn)}setUserId(e){this[mn("0x1e")]=e,this[mn("0x6")].setItemSessionStorageSafe(bn,e),this[mn("0x6")][mn("0x15")](bn,e),this.storageManager[mn("0x15")](_n,Date[mn("0x1c")]())}[mn("0x1d")](){this[mn("0x6")][mn("0x1f")](bn),this[mn("0x6")].removeItemLocalStorageSafe(bn),this[mn("0x6")][mn("0x20")](_n)}[mn("0xb")](){const e=this.storageManager[mn("0x16")](wn);e?(this.storageManager[mn("0x1f")](wn),this.tabId=e):this.tabId=Math.floor(Math[mn("0x21")]()*Number[mn("0x22")])[mn("0x23")]()}[mn("0x24")](){return this.tabId}saveTabIdOnUnload(){this.storageManager.setItemSessionStorageSafe(wn,this.tabId)}[mn("0x25")](e){this[mn("0x6")][mn("0x15")](xn,e)}getSessionToken(){return this[mn("0x6")][mn("0x17")](xn)||this[mn("0x6")][mn("0x16")](xn)}[mn("0x26")](){var e;const t=this[mn("0x27")]();if(!t)return!0;try{const i=JSON[mn("0x28")](atob(t[mn("0x29")](".")[1]));let r=(null!==(e=i[mn("0x2a")])&&void 0!==e?e:i[mn("0x2b")])*(i.exp&&i[mn("0x2a")]<1e12?1e3:1);return i[mn("0x2a")]||(r+=9e5),Date[mn("0x1c")]()>=r}catch(e){return xi.error("Invalid JWT:",{error:e}),!0}}}var Sn,kn,Mn=["serverPath","postDataFromURL","POST","include","application/json","stringify","GET","callServer","fetch-api is not supported","CLIENT","json","status","message","COMMUNICATION","postData"];Sn=Mn,kn=134,function(e){for(;--e;)Sn.push(Sn.shift())}(++kn);var Cn=function(e,t){return Mn[e-=0]};class In{constructor(e){this.serverPath=e}async[Cn("0x0")](e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.postDataFromURL(this[Cn("0x1")]+e,t,i)}async[Cn("0x2")](e,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={method:Cn("0x3"),credentials:Cn("0x4"),headers:new Headers(t({"Content-Type":Cn("0x5")},r)),body:JSON[Cn("0x6")](i)};return await this.callServer(e,n)}async getData(e){const t=this[Cn("0x1")]+e,i={method:Cn("0x7"),credentials:"include"};return await this[Cn("0x8")](t,i)}async[Cn("0x8")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!("fetch"in window))throw new Wr(new Error(Cn("0x9")),$r[Cn("0xa")]);try{const i=await fetch(e,t),r=await i[Cn("0xb")]();if(i.ok)return r;throw new Wr(new Error(r.message||i.statusText),$r.SERVER,i[Cn("0xc")])}catch(e){if(!(e instanceof Wr))throw new Wr(new Error(e[Cn("0xd")]),$r[Cn("0xe")]);throw e}}}var Dn,Tn,Rn=["stringify","string","throwError","validateSDKParams","keys","REQUIRED_SDK_PARAMS","filter","throwOrReturnResult"];Dn=Rn,Tn=113,function(e){for(;--e;)Dn.push(Dn.shift())}(++Tn);var Bn=function(e,t){return Rn[e-=0]};class zn{constructor(){this.REQUIRED_SDK_PARAMS={clientId:Bn("0x0")}}throwOrReturnResult(e,t,i){if(!e&&((null==t?void 0:t.logIfInvalid)&&xi.info(i),null==t?void 0:t[Bn("0x1")]))throw new Error(i);return e}[Bn("0x2")](e,t){const i=Object[Bn("0x3")](this[Bn("0x4")])[Bn("0x5")]((t=>typeof e[t]!=this.REQUIRED_SDK_PARAMS[t]));return this[Bn("0x6")](0==i.length,t,"Invalid SDK params was provided: "+JSON[Bn("0x7")](i))}}var Pn,On,Fn=["push","logsMinimumBatch","getConfValue","logsMinimumDelay","logs","now","lastTimeLogsSent","getClientId","floor","platform","postData","device/logs","requestsManager","identityManager","configManager","logMiddleware","reportLogs","middlewares"];Pn=Fn,On=426,function(e){for(;--e;)Pn.push(Pn.shift())}(++On);var Nn=function(e,t){return Fn[e-=0]};class Ln{constructor(e,t,i){this[Nn("0x0")]=e,this[Nn("0x1")]=t,this[Nn("0x2")]=i,this.lastTimeLogsSent=0,this[Nn("0x3")]=async()=>{try{await this[Nn("0x4")]()}catch(e){}},xi[Nn("0x5")][Nn("0x6")](this.logMiddleware)}async[Nn("0x4")](){if(!this[Nn("0x2")].getConfValue("enableLogsReporting",!1))return;const e=this[Nn("0x2")].getConfValue(Nn("0x7"),6),t=this.configManager[Nn("0x8")](Nn("0x9"),12e4);if(xi[Nn("0xa")].length<e||this.lastTimeLogsSent+t>Date[Nn("0xb")]())return;this[Nn("0xc")]=Date.now();const i=xi.flush(),r=this.identityManager[Nn("0xd")](),n=Math[Nn("0xe")](Date[Nn("0xb")]()/1e3),a={sdkVersion:"1.52.6",platform:navigator[Nn("0xf")],clientId:r,timestamp:n,logEntries:i};await this[Nn("0x0")][Nn("0x10")](Nn("0x11"),a)}}var jn,Un,qn=["getItemLocalStorageSafe","getDeviceId","getClientId","device/migrate-identifiers","requestsManager","postDataFromURL","deviceId","true","rimd","identityManager","storageManager","migrateIdentifiers"];jn=qn,Un=284,function(e){for(;--e;)jn.push(jn.shift())}(++Un);var Kn=function(e,t){return qn[e-=0]};const Hn=Kn("0x0");class Vn{constructor(e,t,i){this[Kn("0x1")]=e,this.requestsManager=t,this[Kn("0x2")]=i}async[Kn("0x3")](e){if("true"!=this[Kn("0x2")][Kn("0x4")](Hn)){const t=this.identityManager[Kn("0x5")](),i=this[Kn("0x1")][Kn("0x6")](),r=(e.endsWith("/")?e:e+"/")+Kn("0x7"),n=await this[Kn("0x8")][Kn("0x9")](r,{deviceId:t,clientId:i});n[Kn("0xa")]&&n.deviceId==t&&this[Kn("0x2")].setItemLocalStorageSafe(Hn,Kn("0xb"))}}}var $n,Jn,Gn=["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"];$n=Gn,Jn=405,function(e){for(;--e;)$n.push($n.shift())}(++Jn);var Wn=function(e,t){return Gn[e-=0]};const Zn=[null,void 0,Wn("0x0"),"",0],Yn=Wn("0x1"),Qn=Wn("0x2"),Xn=Wn("0x3"),ea=Wn("0x4"),ta=["email",Wn("0x5"),Wn("0x6"),Wn("0x7"),"national_id",Wn("0x8"),Wn("0x9"),Wn("0xa")];class ia{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(this[Wn("0xb")]=null,this[Wn("0xc")]=null,this[Wn("0xd")]=!1,this.identifiersMigrationEnabled=!1,this[Wn("0xe")]=null,this.validationManager=new zn,ia[Wn("0xf")])throw new Error(Wn("0x10"));ia.initializedInstance=!0;const r=typeof t===Wn("0x11");this[Wn("0x12")]=r?t:e,this.options=r?{serverPath:e}:t,(i=this.options).serverPath||(i[Wn("0x13")]=ea),this[Wn("0x14")][Wn("0x13")]=new URL(this[Wn("0x14")][Wn("0x13")]).toString(),this[Wn("0xe")]=this[Wn("0x14")][Wn("0xe")]||null,this[Wn("0x15")]=this[Wn("0x14")][Wn("0x15")],xi[Wn("0x16")]=!!this[Wn("0x14")].verbose,this[Wn("0x17")][Wn("0x18")](this,{throwError:!0,logIfInvalid:!0})||(this[Wn("0xc")]=Wn("0x19")),this[Wn("0x1a")]=new mi(this[Wn("0x12")]),this[Wn("0x1b")]=new In(this[Wn("0x14")][Wn("0x13")]),this[Wn("0x1c")]=new Ii(this.storageManager,this[Wn("0x1b")]),this[Wn("0x1d")]=new En(this[Wn("0x1a")],this[Wn("0x1c")],this[Wn("0x12")]),this[Wn("0x1d")][Wn("0x1e")](),this[Wn("0x1f")]=new Vn(this[Wn("0x1d")],this.requestsManager,this[Wn("0x1a")]),this.enableSessionToken=this[Wn("0x14")][Wn("0xd")]||!1,this[Wn("0x20")]=new Ln(this[Wn("0x1b")],this[Wn("0x1d")],this[Wn("0x1c")])}[Wn("0x21")](e){const t=Date[Wn("0x22")]();return Wn("0x23")+(this.disabledReason||"unknown")+"_"+e+"_"+t}get[Wn("0x3")](){return this[Wn("0x1c")][Wn("0x24")](Xn,[])}async[Wn("0x25")](){return await this.isInitialized(),this[Wn("0x3")]}async getSessionToken(){if(!this[Wn("0xd")])throw new Error(Wn("0x26"));return await this[Wn("0x27")]()?(this[Wn("0x1d")][Wn("0x2a")]()&&await this[Wn("0x2b")][Wn("0x2c")](),this[Wn("0x1d")][Wn("0x2d")]()):(xi[Wn("0x28")](Wn("0x29")),{actionToken:this[Wn("0x21")]("session")})}async init(e){const t=typeof e!==Wn("0x2e")?e:null==e?void 0:e[Wn("0x2f")];return xi[Wn("0x28")](Wn("0x30")),this.initializationPromise=(async()=>{await this.configManager[Wn("0x31")](this[Wn("0x1d")][Wn("0x32")]());const e=this[Wn("0x1c")][Wn("0x24")](Wn("0x33"),null),i=this[Wn("0x1c")][Wn("0x24")]("keyRotation",null);if(this[Wn("0x34")]=fi.crypto[Wn("0x35")]("sign",(null==i?void 0:i.isEnabled)?{keyRotation:{isEnabled:!0,expiryDays:i[Wn("0x36")],startedAt:i.startedAt,tenantId:e}}:void 0),this.deviceDataManager=new Cr(this[Wn("0x1a")],this[Wn("0x1c")],this[Wn("0x34")]),this[Wn("0x2b")]=new hn(this[Wn("0x1c")],this.storageManager,this[Wn("0x37")],this[Wn("0x1b")],this[Wn("0x1d")],this[Wn("0x34")],this[Wn("0x14")][Wn("0x13")],this[Wn("0xd")]),null!==this.disabledReason)return!1;const r=this[Wn("0x1c")][Wn("0x24")]("sdkEnabled",void 0);return r?(this[Wn("0x39")]=this.identifiersMigrationEnabled||this[Wn("0x1c")][Wn("0x24")](Yn,!1),this[Wn("0x39")]&&this[Wn("0xe")]&&await this[Wn("0x1f")][Wn("0x3a")](this[Wn("0xe")]),xi.enabled=xi[Wn("0x16")]||!!this[Wn("0x1c")][Wn("0x24")]("verbose",!1),await this[Wn("0x2b")][Wn("0x3b")]()[Wn("0x3c")]((()=>{})),await this[Wn("0x2b")][Wn("0x3d")]()[Wn("0x3c")]((()=>{})),await this[Wn("0x3e")](t)[Wn("0x3c")]((()=>{})),this[Wn("0x2b")][Wn("0x3f")](),await this[Wn("0x2b")].flush()[Wn("0x3c")]((()=>{})),xi.info(Wn("0x40")),!0):(this[Wn("0xc")]=void 0===r?"missing_config":Wn("0x38"),!1)})(),await this[Wn("0xb")]}async[Wn("0x27")](){if(null===this[Wn("0xb")])return this.disabledReason||(this[Wn("0xc")]=Wn("0x41")),!1;const e=await this[Wn("0xb")];return e||this[Wn("0xc")]||(this[Wn("0xc")]=Wn("0x42")),e}async[Wn("0x43")](e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Date.now();if(!await this[Wn("0x27")]())return xi[Wn("0x28")]("SDK disabled"),{actionToken:this[Wn("0x21")]("action")};if(!this.actions[Wn("0x44")](e))return xi[Wn("0x45")]("Invalid action type",{actionType:e}),{actionToken:$r.CLIENT+Wn("0x46")+e+"'_"+r};const n=null==i?void 0:i[Wn("0x47")];if(n&&!ta[Wn("0x44")](n))return xi[Wn("0x45")](Wn("0x48"),{claimedUserIdType:n}),{actionToken:Wn("0x49")+n+"_"+r};let a;this[Wn("0x1c")][Wn("0x24")](Qn,!1)&&(a=await this[Wn("0x37")][Wn("0x4a")]());const o=t({type:Bi.EVENT_TYPE_ACTION,attributes:t(t(t(t(t(t(t(t(t(t(t(t(t({action_type:e},(null==i?void 0:i[Wn("0x4b")])&&{correlation_id:i[Wn("0x4b")]}),(null==i?void 0:i.claimedUserId)&&{claimed_user_id:i[Wn("0x4c")]}),n&&{claimed_user_id_type:n}),(null==i?void 0:i[Wn("0x4d")])&&{public_key:i[Wn("0x4d")]}),(null==i?void 0:i[Wn("0x4e")])&&{extension_metadata:i[Wn("0x4e")]}),(null==i?void 0:i[Wn("0x4f")])&&{extension_device_attributes:i.extensionDeviceAttributes}),(null==i?void 0:i[Wn("0x50")])&&{suspicious_signals:i[Wn("0x50")]}),(null==i?void 0:i.suspiciousContext)&&{suspicious_context:i[Wn("0x51")]}),(null==i?void 0:i[Wn("0x52")])&&{download_file:i[Wn("0x52")]}),(null==i?void 0:i[Wn("0x53")])&&{upload_file:i.uploadFile}),this[Wn("0x15")]&&{platform_sdk_version:this[Wn("0x15")]}),(null==i?void 0:i[Wn("0x54")])&&{transactionData:i[Wn("0x54")]}),a)},(null==i?void 0:i[Wn("0x55")])&&{customAttributes:i[Wn("0x55")]});try{const e=await this[Wn("0x2b")][Wn("0x56")](o),{actionToken:t}=e;if(!t)throw new Wr(new Error(Wn("0x57")+("object"==typeof e?JSON[Wn("0x58")](e)[Wn("0x59")](15):e)),$r[Wn("0x5a")]);return e}catch(i){return{actionToken:i instanceof Wr?i.errorSpace===$r[Wn("0x5b")]?i[Wn("0x5c")]+Wn("0x5d")+e+"_"+i[Wn("0x5e")]+"_'"+i[Wn("0x5f")]+"'_"+r:i.errorSpace+Wn("0x5d")+e+"_'"+i[Wn("0x5f")]+"'_"+r:Wn("0x60")+e+"_"+r}}}async[Wn("0x61")](e){return await this[Wn("0x27")]()?this[Wn("0x3e")](e):(xi[Wn("0x28")]("SDK disabled"),!1)}async[Wn("0x3e")](e){if(Zn.includes(e))return xi[Wn("0x28")](Wn("0x62"),{userId:e}),!1;e=e[Wn("0x63")](),xi[Wn("0x28")](Wn("0x61"),{userId:e});const t=this[Wn("0x1d")].getUserId();return t===e||(this[Wn("0x1d")][Wn("0x64")](e),!!(await this[Wn("0x2b")][Wn("0x56")]({type:Bi[Wn("0x65")],attributes:{previous_user_id:t,user_id:e}}))[Wn("0x66")])}async[Wn("0x67")](){if(!await this[Wn("0x27")]())return xi[Wn("0x28")](Wn("0x29")),!1;const e=this.identityManager[Wn("0x68")]();return null!=e&&this[Wn("0x1d")][Wn("0x69")](),!!(await this[Wn("0x2b")][Wn("0x56")]({type:Bi[Wn("0x65")],attributes:{previous_user_id:e}})).deviceId}async[Wn("0x6a")](e){return await this[Wn("0x61")](e)}async[Wn("0x6b")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this[Wn("0x6a")](e,t)}async clearUser(){return await this.unidentifiedUser()}}ia[Wn("0xf")]=!1,document[Wn("0x6e")](new CustomEvent(Wn("0x70")));var ra,na,aa=["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"];ra=aa,na=394,function(e){for(;--e;)ra.push(ra.shift())}(++na);var oa=function(e,t){return aa[e-=0]};let sa=null;function ca(e){if(!e)throw new(fi[oa("0x7")][oa("0x8")][oa("0x9")])("not_initialized",oa("0xa"))}fi[oa("0x0")].on(fi.events[oa("0x1")],(()=>{const{clientId:e,drs:t}=fi[oa("0x2")][oa("0x3")](),i=t||{},{enabled:r,userId:a}=i,o=n(i,oi);if(!1===r)return;const s=typeof window!==oa("0x4")&&window[oa("0x5")]||typeof globalThis!==oa("0x4")&&globalThis[oa("0x5")]||void 0;s&&(o[oa("0x6")]=s),sa=new ia(e,o),sa.init({userId:a})}));const da=function(){return ca(sa),sa[oa("0x11")]()},ua={getDeviceId:()=>sa[oa("0x12")].getDeviceId(),getClientId:()=>sa.identityManager[oa("0x13")](),flush:()=>sa[oa("0x14")][oa("0x15")]()};var la=Object.freeze({__proto__:null,__internal:ua,clearUser:function(){return ca(sa),sa[oa("0xd")](...arguments)},getActions:function(){return ca(sa),sa[oa("0x10")]()},getSessionToken:da,identifyUser:function(){return ca(sa),sa[oa("0xe")](...arguments)},setAuthenticatedUser:function(){return ca(sa),sa[oa("0xc")](...arguments)},setUser:function(){return ca(sa),sa.setUser(...arguments)},triggerActionEvent:function(){return ca(sa),sa[oa("0xb")](...arguments)},unidentifiedUser:function(){return ca(sa),sa[oa("0xf")](...arguments)}});class ha extends Error{constructor(e,t,i){super(i),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}}const fa={BASE:window.location.origin,VERSION:"",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var pa,ga,ma,ba;!function(e){var t;(t=e.feedback||(e.feedback={})).OK="ok",t.OTHER="other",t.DOCUMENT_NOT_FOUND="document_not_found",t.FACE_NOT_FOUND="face_not_found",t.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",t.OBSTRUCTED="obstructed",t.BLUR="blur",t.GLARE="glare",t.DOCUMENT_NOT_SUPPORTED="document_not_supported",t.DOCUMENT_NOT_MATCHING="document_not_matching",t.WRONG_DOCUMENT_SIDE="wrong_document_side",t.MULTI_FACE="multi_face",t.FACE_ROTATED="face_rotated",t.FACE_TOO_SMALL="face_too_small",t.FACE_TOO_CLOSE="face_too_close",t.CLOSED_EYES="closed_eyes",t.FACE_ANGLE_TOO_LARGE="face_angle_too_large",t.FACE_CLOSE_TO_BORDER="face_close_to_border",t.FACE_OCCLUDED="face_occluded",t.FACE_CROPPED="face_cropped",t.BARCODE_NOT_FOUND="barcode_not_found",t.GLARE_SELFIE="glare_selfie",t.BLUR_SELFIE="blur_selfie",t.RESTRICTED_CRITERIA="restricted_criteria"}(pa||(pa={})),function(e){var t;(t=e.image_type||(e.image_type={})).DOCUMENT_FRONT="document_front",t.DOCUMENT_BACK="document_back",t.SELFIE="selfie"}(ga||(ga={})),function(e){var t,i;(t=e.status||(e.status={})).PENDING="pending",t.CAPTURING="capturing",t.PROCESSING="processing",t.RECAPTURE="recapture",t.COMPLETE="complete",t.ERROR="error",t.EXPIRED="expired",(i=e.recapture_reason||(e.recapture_reason={})).IMAGE_MISSING="image_missing",i.DOCUMENT_EXPIRED="document_expired",i.DOCUMENT_NOT_SUPPORTED="document_not_supported",i.DOCUMENT_DAMAGED="document_damaged",i.POOR_IMAGE_QUALITY="poor_image_quality",i.DOCUMENT_NOT_FOUND="document_not_found",i.OBSTRUCTED="obstructed",i.BLUR="blur",i.GLARE="glare",i.DOCUMENT_NOT_MATCHING="document_not_matching",i.WRONG_DOCUMENT_SIDE="wrong_document_side",i.FACE_NOT_FOUND="face_not_found",i.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",i.INVALID_INPUT="invalid_input",i.MULTI_FACE="multi_face",i.FACE_ROTATED="face_rotated",i.FACE_TOO_SMALL="face_too_small",i.FACE_TOO_CLOSE="face_too_close",i.CLOSED_EYES="closed_eyes",i.FACE_ANGLE_TOO_LARGE="face_angle_too_large",i.FACE_CLOSE_TO_BORDER="face_close_to_border",i.FACE_OCCLUDED="face_occluded",i.FACE_CROPPED="face_cropped",i.BARCODE_NOT_FOUND="barcode_not_found",i.GLARE_SELFIE="glare_selfie",i.BLUR_SELFIE="blur_selfie",i.NO_FACE="no_face",i.DOCUMENT_TYPE_RESTRICTED="document_type_restricted"}(ma||(ma={})),function(e){var t;(t=e.client_type||(e.client_type={})).HOSTED_APP="hosted_app",t.MOBILE_SDK="mobile_sdk"}(ba||(ba={}));var va={},ya={get exports(){return va},set exports(e){va=e}};!function(e,t){!function(i,r){var n="function",a="undefined",o="object",s="string",c="major",d="model",u="name",l="type",h="vendor",f="version",p="architecture",g="console",m="mobile",b="tablet",v="smarttv",y="wearable",_="embedded",w="Amazon",x="Apple",A="ASUS",E="BlackBerry",S="Browser",k="Chrome",M="Firefox",C="Google",I="Huawei",D="LG",T="Microsoft",R="Motorola",B="Opera",z="Samsung",P="Sharp",O="Sony",F="Xiaomi",N="Zebra",L="Facebook",j="Chromium OS",U="Mac OS",q=" Browser",K=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},H=function(e,t){return typeof e===s&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,500)},J=function(e,t){for(var i,a,s,c,d,u,l=0;l<t.length&&!d;){var h=t[l],f=t[l+1];for(i=a=0;i<h.length&&!d&&h[i];)if(d=h[i++].exec(e))for(s=0;s<f.length;s++)u=d[++a],typeof(c=f[s])===o&&c.length>0?2===c.length?typeof c[1]==n?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==n||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):r:this[c[0]]=u?c[1].call(this,u,c[2]):r:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):r):this[c]=u||r;l+=2}},G=function(e,t){for(var i in t)if(typeof t[i]===o&&t[i].length>0){for(var n=0;n<t[i].length;n++)if(H(t[i][n],e))return"?"===i?r:i}else if(H(t[i],e))return"?"===i?r:i;return t.hasOwnProperty("*")?t["*"]:e},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,B+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[u,B+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[u,B]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[u,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[u,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[u,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[u,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[u,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360"+q]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1"+q],f],[/samsungbrowser\/([\w\.]+)/i],[f,[u,z+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,L],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,k+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/(wolvic)\/([\w\.]+)/i],[u,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[u,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,V]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[h,z],[l,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[d,[h,z],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[h,x],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[h,x],[l,b]],[/(macintosh);/i],[d,[h,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[h,P],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[h,I],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[h,I],[l,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[d,/_/g," "],[h,F],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[h,F],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[h,"OPPO"],[l,m]],[/\b(opd2\d{3}a?) bui/i],[d,[h,"OPPO"],[l,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[h,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[h,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[h,R],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[h,R],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[h,D],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[h,D],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[h,"Lenovo"],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[h,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[h,C],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[h,C],[l,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[h,O],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[h,O],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[h,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[h,w],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[h,w],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,h,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[h,E],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[h,A],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[h,A],[l,m]],[/(nexus 9)/i],[d,[h,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[d,/_/g," "],[l,m]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[d,[h,"TCL"],[l,b]],[/(itel) ((\w+))/i],[[h,V],d,[l,G,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[h,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[h,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[h,"Ulefone"],[l,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[d,[h,"Nothing"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,d,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,d,[l,b]],[/(surface duo)/i],[d,[h,T],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[h,"Fairphone"],[l,m]],[/(u304aa)/i],[d,[h,"AT&T"],[l,m]],[/\bsie-(\w*)/i],[d,[h,"Siemens"],[l,m]],[/\b(rct\w+) b/i],[d,[h,"RCA"],[l,b]],[/\b(venue[\d ]{2,7}) b/i],[d,[h,"Dell"],[l,b]],[/\b(q(?:mv|ta)\w+) b/i],[d,[h,"Verizon"],[l,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[h,"Barnes & Noble"],[l,b]],[/\b(tm\d{3}\w+) b/i],[d,[h,"NuVision"],[l,b]],[/\b(k88) b/i],[d,[h,"ZTE"],[l,b]],[/\b(nx\d{3}j) b/i],[d,[h,"ZTE"],[l,m]],[/\b(gen\d{3}) b.+49h/i],[d,[h,"Swiss"],[l,m]],[/\b(zur\d{3}) b/i],[d,[h,"Swiss"],[l,b]],[/\b((zeki)?tb.*\b) b/i],[d,[h,"Zeki"],[l,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],d,[l,b]],[/\b(ns-?\w{0,9}) b/i],[d,[h,"Insignia"],[l,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[h,"NextBook"],[l,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],d,[l,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],d,[l,m]],[/\b(ph-1) /i],[d,[h,"Essential"],[l,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[h,"Envizen"],[l,b]],[/\b(trio[-\w\. ]+) b/i],[d,[h,"MachSpeed"],[l,b]],[/\btu_(1491) b/i],[d,[h,"Rotor"],[l,b]],[/(shield[\w ]+) b/i],[d,[h,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[h,d,[l,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[h,T],[l,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[h,N],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[h,N],[l,m]],[/smart-tv.+(samsung)/i],[h,[l,v]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[h,z],[l,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,D],[l,v]],[/(apple) ?tv/i],[h,[d,x+" TV"],[l,v]],[/crkey/i],[[d,k+"cast"],[h,C],[l,v]],[/droid.+aft(\w+)( bui|\))/i],[d,[h,w],[l,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[h,P],[l,v]],[/(bravia[\w ]+)( bui|\))/i],[d,[h,O],[l,v]],[/(mitv-\w{5}) bui/i],[d,[h,F],[l,v]],[/Hbbtv.*(technisat) (.*);/i],[h,d,[l,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,$],[d,$],[l,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,d,[l,g]],[/droid.+; (shield) bui/i],[d,[h,"Nvidia"],[l,g]],[/(playstation [345portablevi]+)/i],[d,[h,O],[l,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[h,T],[l,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[d,[h,z],[l,y]],[/((pebble))app/i],[h,d,[l,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[h,x],[l,y]],[/droid.+; (glass) \d/i],[d,[h,C],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[d,[h,N],[l,y]],[/(quest( \d| pro)?)/i],[d,[h,L],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[l,_]],[/(aeobc)\b/i],[d,[h,w],[l,_]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[f,G,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,G,W],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,U],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[u,k+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,j],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,f]]},Y=function e(t,g){if(typeof t===o&&(g=t,t=r),!(this instanceof e))return new e(t,g).getResult();var v=typeof i!==a&&i.navigator?i.navigator:r,y=t||(v&&v.userAgent?v.userAgent:""),_=v&&v.userAgentData?v.userAgentData:r,w=g?function(e,t){var i={};for(var r in e)t[r]&&t[r].length%2==0?i[r]=t[r].concat(e[r]):i[r]=e[r];return i}(Z,g):Z,x=v&&v.userAgent==y;return this.getBrowser=function(){var e={};return e[u]=r,e[f]=r,J.call(e,y,w.browser),e[c]=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r}(e[f]),x&&v&&v.brave&&typeof v.brave.isBrave==n&&(e[u]="Brave"),e},this.getCPU=function(){var e={};return e[p]=r,J.call(e,y,w.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[d]=r,e[l]=r,J.call(e,y,w.device),x&&!e[l]&&_&&_.mobile&&(e[l]=m),x&&"Macintosh"==e[d]&&v&&typeof v.standalone!==a&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[d]="iPad",e[l]=b),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,J.call(e,y,w.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,J.call(e,y,w.os),x&&!e[u]&&_&&_.platform&&"Unknown"!=_.platform&&(e[u]=_.platform.replace(/chrome os/i,j).replace(/macos/i,U)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=typeof e===s&&e.length>500?$(e,500):e,this},this.setUA(y),this};Y.VERSION="1.0.39",Y.BROWSER=K([u,f,c]),Y.CPU=K([p]),Y.DEVICE=K([d,h,l,g,m,v,b,y,_]),Y.ENGINE=Y.OS=K([u,f]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var Q=typeof i!==a&&(i.jQuery||i.Zepto);if(Q&&!Q.ua){var X=new Y;Q.ua=X.getResult(),Q.ua.get=function(){return X.getUA()},Q.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var i in t)Q.ua[i]=t[i]}}}("object"==typeof window?window:Z)}(ya,va);const _a="1.4.8",wa=va.UAParser(),xa=_a;function Aa(e,t){var i,r,n,a,o;return{Authorization:`Bearer ${t}`,"ts-sdk-version":xa,"ts-client-id":e,"ts-user-agent":navigator.userAgent,"ts-platform":"web-sdk","ts-os":null===(i=null==wa?void 0:wa.os)||void 0===i?void 0:i.name,"ts-os-version":null===(r=null==wa?void 0:wa.os)||void 0===r?void 0:r.version,"ts-device-model":null===(n=null==wa?void 0:wa.device)||void 0===n?void 0:n.model,"ts-manufacturer":null===(a=null==wa?void 0:wa.device)||void 0===a?void 0:a.vendor,"ts-browser":null===(o=null==wa?void 0:wa.browser)||void 0===o?void 0:o.name,"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent}}var Ea="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Sa=[],ka=[],Ma="undefined"!=typeof Uint8Array?Uint8Array:Array,Ca=!1;function Ia(){Ca=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,i=e.length;t<i;++t)Sa[t]=e[t],ka[e.charCodeAt(t)]=t;ka["-".charCodeAt(0)]=62,ka["_".charCodeAt(0)]=63}function Da(e,t,i){for(var r,n,a=[],o=t;o<i;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(Sa[(n=r)>>18&63]+Sa[n>>12&63]+Sa[n>>6&63]+Sa[63&n]);return a.join("")}function Ta(e){var t;Ca||Ia();for(var i=e.length,r=i%3,n="",a=[],o=16383,s=0,c=i-r;s<c;s+=o)a.push(Da(e,s,s+o>c?c:s+o));return 1===r?(t=e[i-1],n+=Sa[t>>2],n+=Sa[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=Sa[t>>10],n+=Sa[t>>4&63],n+=Sa[t<<2&63],n+="="),a.push(n),a.join("")}function Ra(e,t,i,r,n){var a,o,s=8*n-r-1,c=(1<<s)-1,d=c>>1,u=-7,l=i?n-1:0,h=i?-1:1,f=e[t+l];for(l+=h,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+e[t+l],l+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+l],l+=h,u-=8);if(0===a)a=1-d;else{if(a===c)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),a-=d}return(f?-1:1)*o*Math.pow(2,a-r)}function Ba(e,t,i,r,n,a){var o,s,c,d=8*a-n-1,u=(1<<d)-1,l=u>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=u?(s=0,o=u):o+l>=1?(s=(t*c-1)*Math.pow(2,n),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;e[i+f]=255&s,f+=p,s/=256,n-=8);for(o=o<<n|s,d+=n;d>0;e[i+f]=255&o,f+=p,o/=256,d-=8);e[i+f-p]|=128*g}var za={}.toString,Pa=Array.isArray||function(e){return"[object Array]"==za.call(e)};La.TYPED_ARRAY_SUPPORT=void 0===Ea.TYPED_ARRAY_SUPPORT||Ea.TYPED_ARRAY_SUPPORT;var Oa=Fa();function Fa(){return La.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Na(e,t){if(Fa()<t)throw new RangeError("Invalid typed array length");return La.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=La.prototype:(null===e&&(e=new La(t)),e.length=t),e}function La(e,t,i){if(!(La.TYPED_ARRAY_SUPPORT||this instanceof La))return new La(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return qa(this,e)}return ja(this,e,t,i)}function ja(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);La.TYPED_ARRAY_SUPPORT?(e=t).__proto__=La.prototype:e=Ka(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!La.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|$a(t,i);e=Na(e,r);var n=e.write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(Va(t)){var i=0|Ha(t.length);return 0===(e=Na(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Na(e,0):Ka(e,t);if("Buffer"===t.type&&Pa(t.data))return Ka(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Ua(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function qa(e,t){if(Ua(t),e=Na(e,t<0?0:0|Ha(t)),!La.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function Ka(e,t){var i=t.length<0?0:0|Ha(t.length);e=Na(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function Ha(e){if(e>=Fa())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Fa().toString(16)+" bytes");return 0|e}function Va(e){return!(null==e||!e._isBuffer)}function $a(e,t){if(Va(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return _o(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return wo(e).length;default:if(r)return _o(e).length;t=(""+t).toLowerCase(),r=!0}}function Ja(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return co(this,t,i);case"utf8":case"utf-8":return no(this,t,i);case"ascii":return oo(this,t,i);case"latin1":case"binary":return so(this,t,i);case"base64":return ro(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uo(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ga(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Wa(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=La.from(t,r)),Va(t))return 0===t.length?-1:Za(e,t,i,r,n);if("number"==typeof t)return t&=255,La.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Za(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function Za(e,t,i,r,n){var a,o=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,i/=2}function d(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var u=-1;for(a=i;a<s;a++)if(d(e,a)===d(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===c)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(i+c>s&&(i=s-c),a=i;a>=0;a--){for(var l=!0,h=0;h<c;h++)if(d(e,a+h)!==d(t,h)){l=!1;break}if(l)return a}return-1}function Ya(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function Qa(e,t,i,r){return xo(_o(t,e.length-i),e,i,r)}function Xa(e,t,i,r){return xo(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function eo(e,t,i,r){return Xa(e,t,i,r)}function to(e,t,i,r){return xo(wo(t),e,i,r)}function io(e,t,i,r){return xo(function(e,t){for(var i,r,n,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(i=e.charCodeAt(o))>>8,n=i%256,a.push(n),a.push(r);return a}(t,e.length-i),e,i,r)}function ro(e,t,i){return 0===t&&i===e.length?Ta(e):Ta(e.slice(t,i))}function no(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var a,o,s,c,d=e[n],u=null,l=d>239?4:d>223?3:d>191?2:1;if(n+l<=i)switch(l){case 1:d<128&&(u=d);break;case 2:128==(192&(a=e[n+1]))&&(c=(31&d)<<6|63&a)>127&&(u=c);break;case 3:a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&(c=(15&d)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&d)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(u=c)}null===u?(u=65533,l=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),n+=l}return function(e){var t=e.length;if(t<=ao)return String.fromCharCode.apply(String,e);var i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=ao));return i}(r)}La.poolSize=8192,La._augment=function(e){return e.__proto__=La.prototype,e},La.from=function(e,t,i){return ja(null,e,t,i)},La.TYPED_ARRAY_SUPPORT&&(La.prototype.__proto__=Uint8Array.prototype,La.__proto__=Uint8Array),La.alloc=function(e,t,i){return function(e,t,i,r){return Ua(t),t<=0?Na(e,t):void 0!==i?"string"==typeof r?Na(e,t).fill(i,r):Na(e,t).fill(i):Na(e,t)}(null,e,t,i)},La.allocUnsafe=function(e){return qa(null,e)},La.allocUnsafeSlow=function(e){return qa(null,e)},La.isBuffer=Ao,La.compare=function(e,t){if(!Va(e)||!Va(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},La.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},La.concat=function(e,t){if(!Pa(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return La.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=La.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var a=e[i];if(!Va(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,n),n+=a.length}return r},La.byteLength=$a,La.prototype._isBuffer=!0,La.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Ga(this,t,t+1);return this},La.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Ga(this,t,t+3),Ga(this,t+1,t+2);return this},La.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Ga(this,t,t+7),Ga(this,t+1,t+6),Ga(this,t+2,t+5),Ga(this,t+3,t+4);return this},La.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?no(this,0,e):Ja.apply(this,arguments)},La.prototype.equals=function(e){if(!Va(e))throw new TypeError("Argument must be a Buffer");return this===e||0===La.compare(this,e)},La.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},La.prototype.compare=function(e,t,i,r,n){if(!Va(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(r>>>=0),o=(i>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,n),d=e.slice(t,i),u=0;u<s;++u)if(c[u]!==d[u]){a=c[u],o=d[u];break}return a<o?-1:o<a?1:0},La.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},La.prototype.indexOf=function(e,t,i){return Wa(this,e,t,i,!0)},La.prototype.lastIndexOf=function(e,t,i){return Wa(this,e,t,i,!1)},La.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return Ya(this,e,t,i);case"utf8":case"utf-8":return Qa(this,e,t,i);case"ascii":return Xa(this,e,t,i);case"latin1":case"binary":return eo(this,e,t,i);case"base64":return to(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return io(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},La.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ao=4096;function oo(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function so(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function co(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",a=t;a<i;++a)n+=yo(e[a]);return n}function uo(e,t,i){for(var r=e.slice(t,i),n="",a=0;a<r.length;a+=2)n+=String.fromCharCode(r[a]+256*r[a+1]);return n}function lo(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function ho(e,t,i,r,n,a){if(!Va(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function fo(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n<a;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function po(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n<a;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function go(e,t,i,r,n,a){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function mo(e,t,i,r,n){return n||go(e,0,i,4),Ba(e,t,i,r,23,4),i+4}function bo(e,t,i,r,n){return n||go(e,0,i,8),Ba(e,t,i,r,52,8),i+8}La.prototype.slice=function(e,t){var i,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),La.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=La.prototype;else{var n=t-e;i=new La(n,void 0);for(var a=0;a<n;++a)i[a]=this[a+e]}return i},La.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r},La.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},La.prototype.readUInt8=function(e,t){return t||lo(e,1,this.length),this[e]},La.prototype.readUInt16LE=function(e,t){return t||lo(e,2,this.length),this[e]|this[e+1]<<8},La.prototype.readUInt16BE=function(e,t){return t||lo(e,2,this.length),this[e]<<8|this[e+1]},La.prototype.readUInt32LE=function(e,t){return t||lo(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},La.prototype.readUInt32BE=function(e,t){return t||lo(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},La.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},La.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=t,n=1,a=this[e+--r];r>0&&(n*=256);)a+=this[e+--r]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},La.prototype.readInt8=function(e,t){return t||lo(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},La.prototype.readInt16LE=function(e,t){t||lo(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},La.prototype.readInt16BE=function(e,t){t||lo(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},La.prototype.readInt32LE=function(e,t){return t||lo(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},La.prototype.readInt32BE=function(e,t){return t||lo(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},La.prototype.readFloatLE=function(e,t){return t||lo(e,4,this.length),Ra(this,e,!0,23,4)},La.prototype.readFloatBE=function(e,t){return t||lo(e,4,this.length),Ra(this,e,!1,23,4)},La.prototype.readDoubleLE=function(e,t){return t||lo(e,8,this.length),Ra(this,e,!0,52,8)},La.prototype.readDoubleBE=function(e,t){return t||lo(e,8,this.length),Ra(this,e,!1,52,8)},La.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ho(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},La.prototype.writeUIntBE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ho(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},La.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,1,255,0),La.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},La.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,65535,0),La.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fo(this,e,t,!0),t+2},La.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,65535,0),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fo(this,e,t,!1),t+2},La.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,4294967295,0),La.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):po(this,e,t,!0),t+4},La.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,4294967295,0),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):po(this,e,t,!1),t+4},La.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ho(this,e,t,i,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},La.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ho(this,e,t,i,n-1,-n)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},La.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,1,127,-128),La.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},La.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,32767,-32768),La.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fo(this,e,t,!0),t+2},La.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,32767,-32768),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fo(this,e,t,!1),t+2},La.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,2147483647,-2147483648),La.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):po(this,e,t,!0),t+4},La.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):po(this,e,t,!1),t+4},La.prototype.writeFloatLE=function(e,t,i){return mo(this,e,t,!0,i)},La.prototype.writeFloatBE=function(e,t,i){return mo(this,e,t,!1,i)},La.prototype.writeDoubleLE=function(e,t,i){return bo(this,e,t,!0,i)},La.prototype.writeDoubleBE=function(e,t,i){return bo(this,e,t,!1,i)},La.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,a=r-i;if(this===e&&i<t&&t<r)for(n=a-1;n>=0;--n)e[n+t]=this[n+i];else if(a<1e3||!La.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},La.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!La.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=Va(e)?e:_o(new La(e,r).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var vo=/[^+\/0-9A-Za-z-_]/g;function yo(e){return e<16?"0"+e.toString(16):e.toString(16)}function _o(e,t){var i;t=t||1/0;for(var r=e.length,n=null,a=[],o=0;o<r;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function wo(e){return function(e){var t,i,r,n,a,o;Ca||Ia();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Ma(3*s/4-a),r=a>0?s-4:s;var c=0;for(t=0,i=0;t<r;t+=4,i+=3)n=ka[e.charCodeAt(t)]<<18|ka[e.charCodeAt(t+1)]<<12|ka[e.charCodeAt(t+2)]<<6|ka[e.charCodeAt(t+3)],o[c++]=n>>16&255,o[c++]=n>>8&255,o[c++]=255&n;return 2===a?(n=ka[e.charCodeAt(t)]<<2|ka[e.charCodeAt(t+1)]>>4,o[c++]=255&n):1===a&&(n=ka[e.charCodeAt(t)]<<10|ka[e.charCodeAt(t+1)]<<4|ka[e.charCodeAt(t+2)]>>2,o[c++]=n>>8&255,o[c++]=255&n),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(vo,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function xo(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function Ao(e){return null!=e&&(!!e._isBuffer||Eo(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Eo(e.slice(0,0))}(e))}function Eo(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var So=Object.freeze({__proto__:null,Buffer:La,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),La.alloc(+e)},isBuffer:Ao,kMaxLength:Oa});const ko=e=>null!=e,Mo=e=>"string"==typeof e,Co=e=>Mo(e)&&""!==e,Io=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),Do=e=>e instanceof FormData,To=e=>{const t=[],i=(e,r)=>{ko(r)&&(Array.isArray(r)?r.forEach((t=>{i(e,t)})):"object"==typeof r?Object.entries(r).forEach((t=>{let[r,n]=t;i(`${e}[${r}]`,n)})):((e,i)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(i))}`)})(e,r))};return Object.entries(e).forEach((e=>{let[t,r]=e;i(t,r)})),t.length>0?`?${t.join("&")}`:""},Ro=async(e,t)=>"function"==typeof t?t(e):t,Bo=async(e,i)=>{const r=await Ro(i,e.TOKEN),n=await Ro(i,e.USERNAME),a=await Ro(i,e.PASSWORD),o=await Ro(i,e.HEADERS),s=Object.entries(t(t({Accept:"application/json"},o),i.headers)).filter((e=>{let[t,i]=e;return ko(i)})).reduce(((e,i)=>{let[r,n]=i;return t(t({},e),{},{[r]:String(n)})}),{});if(Co(r)&&(s.Authorization=`Bearer ${r}`),Co(n)&&Co(a)){const e=(e=>{try{return btoa(e)}catch(t){return La.from(e).toString("base64")}})(`${n}:${a}`);s.Authorization=`Basic ${e}`}return i.body&&(i.mediaType?s["Content-Type"]=i.mediaType:Io(i.body)?s["Content-Type"]=i.body.type||"application/octet-stream":Mo(i.body)?s["Content-Type"]="text/plain":Do(i.body)||(s["Content-Type"]="application/json")),new Headers(s)},zo=(e,i)=>new Promise((async(r,n)=>{try{const n=((e,t)=>{const i=e.ENCODE_PATH||encodeURI,r=null==t?void 0:t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,r)=>{var n;return(null===(n=null==t?void 0:t.path)||void 0===n?void 0:n.hasOwnProperty(r))?i(String(t.path[r])):e})),n=`${e.BASE}${r}`;return t.query?`${n}${To(t.query)}`:n})(e,i),a=(e=>{if(e.formData){const t=new FormData,i=(e,i)=>{Mo(i)||Io(i)?t.append(e,i):t.append(e,JSON.stringify(i))};return Object.entries(e.formData).filter((e=>{let[t,i]=e;return ko(i)})).forEach((e=>{let[t,r]=e;Array.isArray(r)?r.forEach((e=>i(t,e))):i(t,r)})),t}})(i),o=(e=>{var t;if(void 0!==e.body)return(null===(t=e.mediaType)||void 0===t?void 0:t.includes("/json"))?JSON.stringify(e.body):Mo(e.body)||Io(e.body)||Do(e.body)?e.body:JSON.stringify(e.body)})(i),s=await Bo(e,i),c=await(async(e,t,i,r,n,a)=>{const o=new AbortController,s={headers:a,body:null!=r?r:n,method:t.method,signal:o.signal};return e.WITH_CREDENTIALS&&(s.credentials=e.CREDENTIALS),await fetch(i,s)})(e,i,n,o,a,s),d=await(async e=>{if(204!==e.status)try{const t=e.headers.get("Content-Type");if(t)return["application/json","application/problem+json"].some((e=>t.toLowerCase().startsWith(e)))?await e.json():await e.text()}catch(e){console.error(e)}})(c),u=((e,t)=>{if(t){const i=e.headers.get(t);if(Mo(i))return i}})(c,i.responseHeader),l={url:n,ok:c.ok,status:c.status,statusText:c.statusText,headers:c.headers,body:null!=u?u:d};((e,i)=>{var r,n;const a=t({400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"},e.errors)[i.status];if(a)throw new ha(e,i,a);if(!i.ok){const t=null!==(r=i.status)&&void 0!==r?r:"unknown",a=null!==(n=i.statusText)&&void 0!==n?n:"unknown",o=(()=>{try{return JSON.stringify(i.body,null,2)}catch(e){return}})();throw new ha(e,i,`Generic Error: status: ${t}; status text: ${a}; body: ${o}`)}})(i,l),r(l)}catch(e){n(e)}})),Po=new W("idv"),Oo=Symbol(),Fo=Symbol(),No="verify-id-sdk";function Lo(e){return sessionStorage.getItem(e)}const jo=new Map;function Uo(e,t){const i=jo.get(e);Po.events.emit(i,t)}function qo(e){Uo(Oo,e)}function Ko(e,t,i,r,n){qo({type:"verification-result",status:t,step:e,state:r,callbackUrl:n,sessionId:i})}function Ho(e,t){qo({type:"capture-error",errorCode:t,step:e})}function Vo(e,t,i){qo({type:"api-request-error",errorCode:t,step:e,error:i})}function $o(e,t){return zo(fa,e).catch((i=>(e.url.endsWith("/events")||Vo(t,"request-error",i.message),Promise.reject(i))))}async function Jo(e){var t;fa.HEADERS=Aa(e);const i=await function(e){return $o({keepalive:!0,method:"GET",url:`/verify/api/v1/sdk-settings?clientId=${e}`},"init")}(e);return{autocapture_settings:null!==(t=i.body.autocapture_settings)&&void 0!==t?t:void 0,autocapture_enabled:i.body.autocapture_enabled}}jo.set(Oo,Oo),jo.set(Fo,Fo);var Go={setStep(e,t){e.commit("setStep",t)},setSessionId(e,t){e.commit("setSessionId",t)},setIsCapturingProcessStarted(e,t){e.commit("setIsCapturingProcessStarted",t)},setServerPath(e,t){e.commit("setServerPath",t)},setStartToken(e,t){e.commit("setStartToken",t)},setRootElement(e,t){e.commit("setRootElement",t)},setLanguage(e,t){e.commit("setLanguage",t)},setCallback(e,t){e.commit("setCallback",t)},setUserToken(e,t){e.commit("setUserToken",t)},setConsentVersion(e,t){e.commit("setConsentVersion",t)},setMissingImages(e,t){e.commit("setMissingImages",t)},setClientId(e,t){e.commit("setClientId",t)},setStatus(e,t){e.commit("setStatus",t)},setMarkdownSupportText(e,t){e.commit("setMarkdownSupportText",t)},setVideoCaptureSettings(e,t){e.commit("setVideoCaptureSettings",t)},setCdnHost(e,t){e.commit("setCdnHost",t)},setIsImageSigningEnabled(e,t){e.commit("setIsImageSigningEnabled",t)},setAutoCaptureSettings(e,t){e.commit("setAutoCaptureSettings",t)}},Wo={setStep:(e,t)=>(e.step=t,e),setSessionId:(e,t)=>(e.sessionId=t,e),setIsCapturingProcessStarted:(e,t)=>(e.isCapturingProcessStarted=t,e),setServerPath:(e,t)=>(e.serverPath=t,e),setStartToken:(e,t)=>(e.startToken=t,e),setRootElement:(e,t)=>(e.rootElementId=t,e),setLanguage:(e,t)=>(e.language=t,e),setCallback:(e,t)=>(e.callback=t,e),setUserToken:(e,t)=>(e.userToken=t,e),setConsentVersion:(e,t)=>(e.consentVersion=t,e),setMissingImages:(e,t)=>(e.missingImages=t,e),setClientId:(e,t)=>(e.clientId=t,e),setStatus:(e,t)=>(e.verificationStatus=t,e),setMarkdownSupportText:(e,t)=>(e.markdownSupportText=t,e),setVideoCaptureSettings:(e,t)=>(e.videoCaptureSettings=t,e),setCdnHost:(e,t)=>(e.cdnHost=t,e),setIsImageSigningEnabled:(e,t)=>(e.isImageSigningEnabled=t,e),setAutoCaptureSettings:(e,t)=>(e.autoCaptureSettings=t,e)};const Zo=new class{constructor(e){this.actions={},this.mutations={},this.state={},this.status="resting",Object.prototype.hasOwnProperty.call(e,"actions")&&(this.actions=e.actions),Object.prototype.hasOwnProperty.call(e,"mutations")&&(this.mutations=e.mutations);const t=this;this.state=new Proxy(e.state||{},{get:function(e,t){return e[t]},set:function(e,i,r){return e[i]=r,Uo(Fo,{key:i,state:e}),"mutation"!==t.status&&console.warn(`You should use a mutation to set ${String(i)}`),t.status="resting",!0}})}dispatch(e,t){return"function"!=typeof this.actions[e]?(console.error(`Action "${e} doesn't exist.`),!1):(this.status="action",this.actions[e](this,t),!0)}commit(e,t){if("function"!=typeof this.mutations[e])return console.info(`Mutation "${e}" doesn't exist`),!1;this.status="mutation";const i=this.mutations[e](this.state,t);return this.state=i,!0}}({actions:Go,mutations:Wo,state:{step:"",sessionId:"",serverPath:"",startToken:"",rootElementId:"",language:"en",callback:()=>null,userToken:"",missingImages:[],consentVersion:"",clientId:"",verificationStatus:"pending",markdownSupportText:"",isImageSigningEnabled:!0,isCapturingProcessStarted:!1}});var Yo;function Qo(e){const t=[],i=function(e){var t,i,r,n;const a=e.stats.get(Yo.BLUR_DETECTION),o=e.stats.get(Yo.GLARE_DETECTION);if(!a&&!o||0===(null==a?void 0:a.durations.length)&&0===(null==o?void 0:o.durations.length))return;const s=ts(null!==(t=null==a?void 0:a.durations)&&void 0!==t?t:null==o?void 0:o.durations),c=a&&o?Math.min(a.countSuccess,o.countSuccess):null!==(i=null==a?void 0:a.countSuccess)&&void 0!==i?i:null==o?void 0:o.countSuccess;return{name:es(Yo.BLUR_DETECTION),count_success:c,count_failure_glare:null!==(r=null==o?void 0:o.countFailed)&&void 0!==r?r:0,count_failure_blur:null!==(n=null==a?void 0:a.countFailed)&&void 0!==n?n:0,avg_duration:s.duration_avg,std_duration:s.duration_std}}(e);i&&t.push(i);for(const[i,r]of e.stats.entries())i!==Yo.BLUR_DETECTION&&i!==Yo.GLARE_DETECTION&&r.durations.length>0&&t.push(Xo(r,i));return e.frameHandleDurations.length>0&&t.push(function(e){const t=ts(e.frameHandleDurations);return{name:"stability_manager",avg_stable_count:Math.round(e.stableCounts.reduce(((e,t)=>e+t),0)/e.stableCounts.length),avg_duration:t.duration_avg,std_duration:t.duration_std}}(e)),t}function Xo(e,t){const i=ts(e.durations);return{name:es(t),count_success:e.countSuccess,count_failure:e.countFailed,avg_duration:i.duration_avg,std_duration:i.duration_std}}function es(e){switch(e){case Yo.BLUR_DETECTION:case Yo.GLARE_DETECTION:return"blur_glare_detector";case Yo.DOCUMENT_DETECTION:return"doc_detector";case Yo.DOCUMENT_POSITION:return"doc_frame_detector";case Yo.BARCODE_DETECTION:return"barcode_detector";case Yo.FACE_DETECTION:return"face_detector";case Yo.FACE_POSITION:return"face_frame_detector";default:return e}}function ts(e){var t;if(e.length<2)return{duration_avg:null!==(t=e[0])&&void 0!==t?t:0,duration_std:0};const i=e.length,r=e.reduce(((e,t)=>e+t),0)/i;let n=0;for(let t=0;t<i;t++){const i=e[t];n+=Math.pow(i-r,2)}const a=Math.sqrt(n/(i-1));return{duration_avg:Math.round(r),duration_std:Math.round(a)}}!function(e){e.DOCUMENT_DETECTION="document_detection",e.DOCUMENT_POSITION="document_position",e.GLARE_DETECTION="glare_detection",e.BLUR_DETECTION="blur_detection",e.BARCODE_DETECTION="barcode_detection",e.FACE_DETECTION="face_detection",e.FACE_POSITION="face_position"}(Yo||(Yo={}));const is=new class{createUploadImageEvent(e,t,i,r){return{event_type:"upload_image",upload_image_req:{process_result:"success",image_type:e,request_total_time_ms:String(t),request_processing_time_ms:String(i),request_build_time_ms:String(r)}}}createPageViewEvent(e){return{event_type:"page_view",page_view_req:{page_name:e}}}createProcessingCompleteEvent(){return{event_type:"processing_complete",processing_complete_req:{status:"complete"}}}createSdkInitEvent(e,t){return{event_type:"sdk_init",sdk_init_req:{user_wait_time:Math.round(e),model_stats:this.convertModelStats(t)}}}convertModelStats(e){return e.map((e=>({model_name:e.modelName,init_duration:Math.round(e.initDuration),download_duration:Math.round(e.downloadDuration)})))}createUserActionEvent(e,t,i){var r,n,a;const o={user_action_type:e,page_name:t,autocapture:!!i,autocapture_enabled:null!==(a=null===(n=null===(r=Zo.state)||void 0===r?void 0:r.autoCaptureSettings)||void 0===n?void 0:n.enabled)&&void 0!==a&&a};if(i){const e=Qo(i);o.stats=e}return{event_type:"user_action",user_action_req:o}}createErrorEvent(e,t,i){return{event_type:"error",error_req:{error_name:t,error_description:e,step:i}}}createCameraNotAllowedEvent(e,t){return{event_type:"error",error_req:{error_name:"camera_not_allowed",error_description:e,step:t}}}createDrsInitFailureEvent(e,t){return{event_type:"error",error_req:{error_name:"missing_drs_action_token",error_description:e,step:t}}}};async function rs(e,t,i,r,n){i?(fa.HEADERS=Aa(r,t),await function(e,t,i){return $o({keepalive:!0,method:"POST",url:`/verify/api/v1/verification/${e}/events`,path:{sid:e},body:t},i)}(i,n,e)):console.error("cannot send event, sessionId or startToken is not set")}const ns=new class{handelEventData(e){if("session-id-acquired"===e.type)this.sendRiskSessionToken()}sendRiskSessionToken(){try{const e=`${fa.BASE}/verify/api/v1/verification/${Zo.state.sessionId}/risk-session-token`,t=Zo.state.clientId,i=Aa(t,Zo.state.userToken);da().then((t=>{Po.http.httpPost(e,{session_token:t},null,i).catch((t=>{throw console.log("unable to send session token to IDV",e),console.error(t),t}))})).catch((t=>{var i,r,n,a;console.log("unable to get session token from DRS",e),console.error(t);const o=(null==t?void 0:t.message)||"failed to initialize DRS",s=is.createDrsInitFailureEvent(o,"init");rs(null===(i=Zo.state)||void 0===i?void 0:i.step,null===(r=Zo.state)||void 0===r?void 0:r.userToken,null===(n=Zo.state)||void 0===n?void 0:n.sessionId,null===(a=Zo.state)||void 0===a?void 0:a.clientId,s).then((()=>{qo({type:"failed-to-init-drs",errorCode:"other",step:"init"})}))}))}catch(e){throw console.log("Error sending risk session token"),console.error(e),e}}};async function as(e,t,i){const r=is.createErrorEvent(e,t,i);await os(i,r)}async function os(e,t){var i,r,n,a,o;const s=null===(i=Zo.state)||void 0===i?void 0:i.userToken,c=(null===(r=Zo.state)||void 0===r?void 0:r.sessionId)||(null===(n=Zo.state)||void 0===n?void 0:n.startToken),d=null===(a=Zo.state)||void 0===a?void 0:a.clientId,u=(null===(o=Zo.state)||void 0===o?void 0:o.step)||e;await rs(u,s,c,d,t)}const ss=function(){var e,t;(null===(t=null===(e=Zo.state.autoCaptureSettings)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.debug)&&console.log(...arguments)};var cs;!function(e){e.DOCUMENT_DETECTOR="document_detector",e.BLUR_GLARE_CLASSIFIER="blur_glare_classifier",e.FACE_LANDMARK="face_landmark"}(cs||(cs={}));const ds=["pdf417","qr_code"];class us{constructor(){this.model=new BarcodeDetector({formats:ds})}async detect(e){const t=await this.model.detect(e);return ss("detectedBarcodes:",t),t.map((e=>({class:e.format,score:1,x:e.boundingBox.x,y:e.boundingBox.y,width:e.boundingBox.width,height:e.boundingBox.height,extra:e.rawValue})))}}var ls;!function(e){e.NOT_AVAILABLE="notAvailable",e.LOADING="loading",e.LOADED="loaded"}(ls||(ls={}));const hs={[cs.DOCUMENT_DETECTOR]:{status:ls.LOADING},[cs.BLUR_GLARE_CLASSIFIER]:{status:ls.LOADING},[cs.FACE_LANDMARK]:{status:ls.LOADING}};const fs=[cs.DOCUMENT_DETECTOR,cs.BLUR_GLARE_CLASSIFIER],ps=async()=>{let e=!1;for(;!e;){const t=Object.values(hs).filter((e=>e.status===ls.NOT_AVAILABLE));if(t.length>0)throw new Error(`Model not available: ${t.join(", ")}`);if(e=fs.every((e=>hs[e].status===ls.LOADED)),e)return!0;await new Promise((e=>setTimeout(e,100)))}},gs=e=>"function"==typeof e,ms=function(e){};Po.events.on(Po.events.MODULE_INITIALIZED,(function(){const{clientId:e,IDV:i}=Po.moduleMetadata.getInitConfig();if(!e||!i)return!1;const r=(null==i?void 0:i.serverPath)&&(n=null==i?void 0:i.serverPath,a="/verify",(null==n?void 0:n.endsWith(a))?n.slice(0,n.length-a.length):n);var n,a;fa.BASE=r||window.location.origin,Zo.dispatch("setClientId",e),Zo.dispatch("setRootElement",(null==i?void 0:i.rootElement)||"root-element"),Zo.dispatch("setServerPath",null==i?void 0:i.serverPath),Zo.dispatch("setLanguage",null==i?void 0:i.language),Zo.dispatch("setCallback",null==i?void 0:i.callback),Zo.dispatch("setConsentVersion",null==i?void 0:i.consentVersion),Zo.dispatch("setMarkdownSupportText",null==i?void 0:i.markdownSupportText),Zo.dispatch("setVideoCaptureSettings",null==i?void 0:i.videoCaptureSettings),Zo.dispatch("setCdnHost",null==i?void 0:i.cdnHost),Zo.dispatch("setIsImageSigningEnabled",null==i?void 0:i.isImageSigningEnabled),(null==i?void 0:i.callbacks)&&(e=>{let{callbacks:t,callback:i}=e;gs(t.sessionGranted)&&(bs=t.sessionGranted);gs(t.sessionStarted)&&(vs=t.sessionStarted);gs(t.imageSubmitted)&&(ys=t.imageSubmitted);gs(t.processing)&&(_s=t.processing);gs(t.completed)&&(ws=t.completed);gs(t.recapture)&&(xs=t.recapture);gs(t.error)&&(As=t.error);gs(i)&&(Es=i)})(i);return Zo.dispatch("setStartToken",null==i?void 0:i.startToken),Jo(Zo.state.clientId).then((e=>{!async function(e){if(null==e?void 0:e.autocapture_enabled){if("serviceWorker"in navigator)return Zo.dispatch("setAutoCaptureSettings",{enabled:!0,settings:e.autocapture_settings}),ss("service worker available"),void navigator.serviceWorker.addEventListener("message",(e=>{if(e.data&&"MODEL_READY"===e.data.type){const i=e.data.modelName;hs[i]={status:ls.LOADED,imageDimensions:e.data.imageDimensions,loadingStats:t(t({},e.data.stats),{},{modelName:i})}}else if(e.data&&"MODEL_LOAD_ERROR"===e.data.type){const t=e.data.modelName;hs[t].status=ls.NOT_AVAILABLE,as(`${e.data.modelName} error: ${e.data.error}`,"model_load_error","init")}}));as("service worker not available","service_worker_not_available","init")}Zo.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:e.autocapture_settings})}(e)})),function(e){qo({type:"init",step:e})}("init"),!0})),Po.events.on(Oo,(function(e){switch(ns.handelEventData(e),Es(e),e.type){case"session-granted":bs({session:Zo.state.sessionId});break;case"session-id-acquired":vs({session:Zo.state.sessionId});break;case"capture-image-result":ys({session:Zo.state.sessionId},e.imageType);break;case"start-verification-processing":_s({session:Zo.state.sessionId});break;case"verification-complete":ws({session:Zo.state.sessionId});break;case"capture-error":case"failed-to-init-drs":case"api-request-error":As({session:Zo.state.sessionId},e.errorCode,e.error);break;case"verification-recapture":xs({session:Zo.state.sessionId},e.reason)}}));let bs=ms,vs=ms,ys=ms,_s=ms,ws=ms,xs=ms,As=ms,Es=e=>{};async function Ss(e,t,i){fa.HEADERS=Aa(i,t);var r;return(await(r=e,$o({method:"GET",url:`/verify/api/v1/verification/${r}/status`,path:{sid:r},errors:{404:"Session not found"}},"processing"))).body}function ks(e){try{return JSON.parse(e)}catch(e){return console.error(e),null}}async function Ms(e,t,i,r){fa.HEADERS=Aa(t);const n=await(a={start_token:e,accessed_from_desktop:!1,client_type:ba.client_type.MOBILE_SDK,consent:{granted:!0,document_id:i},image_signing_public_key:r},$o({method:"POST",url:"/verify/api/v1/verification/start",headers:{},body:a,mediaType:"application/json"},"init"));var a;return{sessionId:n.body.session_id,userToken:n.body.user_token,requiredImages:n.body.required_images}}async function Cs(e,t,i){let r,n,a;if(r)try{r=Lo(No);const e=JSON.parse(r);n=e.sessionId,a=e.userToken}catch(e){}try{let o;if(a){o=(await Ss(n,a,i)).missing_images}else{const s=Po.crypto.createCryptoBinding("sign"),c=await s.getPublicData(),d=await Ms(e,i,t,c.publicKey);n=d.sessionId,a=d.userToken,o=d.requiredImages,r=JSON.stringify({sessionId:n,userToken:a}),function(e,t){sessionStorage.setItem(e,t)}(No,r)}return{requiredImages:o,sessionId:n.toString(),userToken:a.toString()}}catch(e){throw console.log("Error starting session"),console.error(e),e}}function Is(e){let{tagName:t,style:i,id:r="",className:n="",testid:a,options:o}=e;const s=document.createElement(t,o);return s.id=r,s.className=n,s.setAttribute("data-auto",a+"-auto"),Object.keys(i).forEach((e=>{s.style[e]=i[e]})),s}function Ds(e,t){Array.isArray(t)?t.forEach((t=>{e.appendChild(t)})):e.appendChild(t)}const Ts={blur_message:"Please focus camera on the document before capturing",blur_title:"Blurred image",document_incorrect_position_message:"Please make sure the document is fully within the frame, and nothing covers it",document_incorrect_position_title:"Incorrect document position",document_not_found_message:"Make sure you capture a valid government issued ID",document_not_found_title:"Document not detected",document_not_matching_message:"Please make sure to capture the back side of the document",document_not_matching_title:"Back image mismatch",document_not_supported_message:"Please use a different government issued ID instead",document_not_supported_title:"Document not supported",capturing_in_progress_message:"Capturing, stay steady",capturing_in_progress_title:"Capturing in progress",face_not_found_message:"Ensure your face is not covered and fully visible",face_not_found_title:"Face not detected",glare_message:"Avoid any direct light reflecting with glare",glare_title:"Glare detected",main_title_document_back:"Back side",main_title_document_face:"Selfie",main_title_document_front:"Front side",obstructed_message:"Some of the document parts are covered or missing",obstructed_title:"Missing information",other_error_code_message:"Please try again",other_error_code_title:"An error occurred",page_header_document:"Scan document",loading_screen_small_title:"Preparing...",page_header_face:"Face Recognition",second_title_document_back:"Please place your document on a solid surface, back side up.",second_title_document_face:"Please position your face in the center of the oval below.",second_title_document_front:"Please place your document on a solid surface, photo side up.",wrong_document_side_message:"The wrong document side has been detected",wrong_document_side_title:"Wrong document side detected",face_angle_too_large_title:"your face is not directly aligned with the camera",face_angle_too_large_message:"Please take another photo with your face fully visible for accurate detection",face_close_to_border_title:"Your face is too close to the edge",face_close_to_border_message:"Please adjust your position and make sure your entire face is within the frame",face_too_small_title:"Your face is too distant from the edge",face_too_small_message:"Please move closer to the camera so your face is clearer and easier to detect",face_too_close_title:"Your face is too close ",face_too_close_message:"Please adjust your position and make sure your entire face is within the frame",face_cropped_title:"Your face is partially cropped",face_cropped_message:"Please adjust your position and make sure your entire face is within the frame for optimal",no_face_title:"Face not found",no_face_message:"Please move closer to the camera or adjust your position so your face is clearer and easier to detect",multi_face_title:"Multiple faces detected",multi_face_message:"Please make sure only one face is visible in the frame to proceed",blur_selfie_title:"The selfie is out of focus",blur_selfie_message:"Please try taking another one with clearer focus for better detection",glare_selfie_title:"Too much reflection in your selfie",glare_selfie_message:"Please try taking another photo with better lighting and without glare for accurate detection",closed_eyes_title:"It looks like your eyes are closed",closed_eyes_message:"Please retake the photo with your eyes open",face_occluded_title:"Your face is partially hidden",face_occluded_message:"Please take another photo with your face fully visible for accurate detection",face_rotated_title:"Your face is not directly aligned with the camera",face_rotated_message:"Please take another photo with your face fully visible for accurate detection",barcode_not_found_title:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",barcode_not_found_message:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",searching_document_autocapture:"Searching for document",capturing_document_autocapture:"Capturing, please hold steady",click_manual_autocapture:"Click to capture manually",glare_blur_issues_autocapture:"Please make sure there are no light reflections, and try again",doc_not_in_frame_issues_autocapture:"Please bring the document closer and ensure it is fully within the capture frame for a clear image.",doc_not_found_autocapture:"Looking for document",capturing_face_issue_closer:"Please move closer to the frame",second_title_face_autocapture:"Get ready! Your selfie will be auto-captured, or tap to capture it manually",capturing_face_autocapture3:"Capturing... please, hold steady for 3",capturing_face_autocapture2:"Capturing... please, hold steady for 2",capturing_face_autocapture1:"Capturing... please, hold steady for 1",selfie_approval_autocapture:"Great job! Approve your selfie to continue"};const Rs=new class{constructor(e){this.translations=e,this.translations=new Proxy(this.translations,{get:function(e,t){return e[t]},set:function(e,t,i){return e[t]=i,!0}})}overrideLanguage(e){Object.assign(this.translations,e)}translate(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];let n=this.translations[e];return n||(n=e),n.replace(/{(\d+)}/g,(function(e,t){return void 0!==i[t]?i[t]:e}))}}(Ts),Bs={en:Ts,es:{blur_message:"Favor enfoca la cĆ”mara en tĆŗ cĆ©dula antes de la captura",blur_title:"Imagen borrosa",document_incorrect_position_message:"AsegĆŗrate de que la cĆ©dula estĆ© completamente dentro del marco y nada la cubra",document_incorrect_position_title:"Posición incorrecta del documento",capturing_in_progress_title:"Capturando en progreso",capturing_in_progress_message:"Capturando, mantente estable",document_not_found_message:"AsegĆŗrate de utilizar una cĆ©dula valida",document_not_found_title:"CĆ©dula no detectada",document_not_matching_message:"Favor AsegĆŗrate de capturar la parte trasera de tu cĆ©dula",document_not_matching_title:"Parte trasera no corresponde",document_not_supported_message:"Favor utliza tu cĆ©dula",document_not_supported_title:"CĆ©dula no compatible",face_not_found_message:"Asegurase de no tapar su rostro",face_not_found_title:"Selfie no detectada",glare_message:"Evite luz directa que pueda generar brillo",glare_title:"Demasiado brillo",main_title_document_back:"Parte trasera de tu cĆ©dula",main_title_document_face:"Tómate un Selfie",main_title_document_front:"Parte frontal de tu cĆ©dula",obstructed_message:"Parte de la cĆ©dula documento no estĆ” visible o falta información",obstructed_title:"Falta información",other_error_code_message:"Intenta nuevamente",other_error_code_title:"Ha ocurrido un error",page_header_document:"EscanĆ©a tu cĆ©dula",page_header_face:"Reconocimiento Facial",second_title_document_back:"AsegĆŗrate de poner su cĆ©dula en una superfice plana con la parte trasera visible.",second_title_document_face:"AsegĆŗrate de posicionar tu rostro en el centro del circulo.",second_title_document_front:"AsegĆŗrate de poner su cĆ©dula en una superfice plana con la parte frontal visible.",wrong_document_side_message:"Lado incorrecto de tu cĆ©dula ha sido detectado",wrong_document_side_title:"Lado de tu cĆ©dula incorrecto",face_angle_too_large_title:"Tu rostro no estĆ” directamente alineado con la cĆ”mara.",face_angle_too_large_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_close_to_border_title:"Tu rostro estĆ” demasiado cerca del borde.",face_close_to_border_message:"Por favor, cambia la posicion de tu rostro y asegĆŗrate de que todo tu rostro estĆ© dentro del marco.",face_too_small_title:"Tu rostro estĆ” demasiado lejos del borde.",face_too_small_message:"Por favor, acĆ©rcate mĆ”s a la cĆ”mara para que tu rostro estĆ© mĆ”s claro y sea mĆ”s fĆ”cil de detectar.",face_too_close_title:"Tu rostro estĆ” demasiado cerca",face_too_close_message:"Acomode la posición y asegĆŗrese de que toda su rostro estĆ© dentro del marco.",face_cropped_title:"Tu rostro estĆ” parcialmente recortado.",face_cropped_message:"Por favor, cambia tu posición y asegĆŗrate de que todo tu rostro estĆ© dentro del marco para una detección óptima.",no_face_title:"Rostro no encontrado.",no_face_message:"Por favor, acĆ©rcate mĆ”s a la cĆ”mara o ajusta tu posición para que tu rostro estĆ© mĆ”s claro y sea mĆ”s fĆ”cil de detectar.",multi_face_title:"Se detectaron mĆŗltiples rostros.",multi_face_message:"Por favor, asegĆŗrate de que solo haya un rostro visible en el marco para continuar.",blur_selfie_title:"El autorretrato estĆ” fuera de foco.",blur_selfie_message:"Por favor, intenta tomar una nueva imagen con un enfoque mĆ”s claro para una mejor detección.",glare_selfie_title:"Demasiado reflejo en tu autorretrato.",glare_selfie_message:"Por favor, intenta tomar otra foto con una mejor iluminación y sin brillos para una detección precisa.",closed_eyes_title:"Parece que tienes los ojos cerrados.",closed_eyes_message:"Por favor, vuelve a tomar la foto con los ojos abiertos.",face_occluded_title:"Tu rostro estĆ” parcialmente oculto.",face_occluded_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_rotated_title:"Tu rostro estĆ” fuera de foco.",face_rotated_message:"Por favor, intenta tomar otro con un enfoque mĆ”s claro para una mejor detección.",barcode_not_found_title:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar mĆ”s despejado.",barcode_not_found_message:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar mĆ”s despejado.",searching_document_autocapture:"Buscando la cedula",capturing_document_autocapture:"Capturando, por favor mantente quieto",click_manual_autocapture:"Haz clic para capturar manualmente",glare_blur_issues_autocapture:"Por favor, asegĆŗrate de que no haya reflejos de luz antes de intentarlo de nuevo",doc_not_in_frame_issues_autocapture:"Por favor, acerque la cedula y asegĆŗrese de que estĆ© completamente dentro del marco de captura para obtener una imagen clara",second_title_face_autocapture:"Ā”PrepĆ”rate! Tu selfie se capturarĆ” automĆ”ticamente, o toca para capturarla manualmente",capturing_face_autocapture3:"Capturando... por favor, mantente quieto durante 3",capturing_face_autocapture2:"Capturando... por favor, mantente quieto durante 2",capturing_face_autocapture1:"Capturando... por favor, mantente quieto durante 1",selfie_approval_autocapture:"Ā”Buen trabajo! Aprueba tu selfie para continuar"},pt:{blur_message:"Por favor, foque a cĆ¢mera no documento antes de capturar",blur_title:"Imagem borrada",document_incorrect_position_message:"Certifique-se de que o documento esteja totalmente dentro do quadro e nada o cubra",document_incorrect_position_title:"Posição incorreta do documento",document_not_found_message:"Certifique-se de capturar um documento vĆ”lido emitido pelo governo",document_not_found_title:"Documento nĆ£o detectado",document_not_matching_message:"Por favor, certifique-se de capturar o verso do documento",document_not_matching_title:"Imagem do verso incorreta",document_not_supported_message:"Por favor, utilize um documento diferente emitido pelo governo",document_not_supported_title:"Documento nĆ£o suportado",capturing_in_progress_message:"Capturando, mantenha-se firme",capturing_in_progress_title:"Captura em andamento",face_not_found_message:"Certifique-se de que seu rosto nĆ£o esteja coberto e esteja totalmente visĆvel",face_not_found_title:"Rosto nĆ£o detectado",glare_message:"Evite qualquer luz direta refletindo com brilho",glare_title:"Brilho detectado",main_title_document_back:"Verso",main_title_document_face:"Selfie",main_title_document_front:"Frente",obstructed_message:"Algumas partes do documento estĆ£o encobertas ou ausentes",obstructed_title:"InformaƧƵes incompletas",other_error_code_message:"Por favor, tente novamente",other_error_code_title:"Ocorreu um eprro",page_header_document:"Digitalizar o documento",page_header_face:"Reconhecimento facial",second_title_document_back:"Coloque o documento em uma superfĆcie sólida, com o verso voltado para cima.",second_title_document_face:"Por favor, posicione seu rosto no centro do oval abaixo.",second_title_document_front:"Coloque o documento em uma superfĆcie sólida, com a foto voltada para cima.",wrong_document_side_message:"O lado errado do documento foi detectado",wrong_document_side_title:"Lado incorreto do documento identificado",face_angle_too_large_title:"Seu rosto nĆ£o estĆ” diretamente alinhado com a cĆ¢mera.",face_angle_too_large_message:"Tire outra foto com seu rosto totalmente visĆvel para uma detecção precisa.",face_close_to_border_title:"Seu rosto estĆ” muito próximo da borda.",face_close_to_border_message:"Por favor, reposicione seu rosto e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_too_small_title:"Seu rosto estĆ” muito longe da borda.",face_too_small_message:"Aproxime-se da cĆ¢mera para que seu rosto fique mais claro e fĆ”cil de detectar.",face_too_close_title:"Seu rosto estĆ” muito perto",face_too_close_message:"Ajuste a posição e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_cropped_title:"Seu rosto estĆ” parcialmente cortado.",face_cropped_message:"Mude sua posição e certifique-se de que todo o seu rosto esteja dentro do enquadramento para uma detecção ideal.",no_face_title:"Rosto nĆ£o encontrado..",no_face_message:"Aproxime-se da cĆ¢mera ou ajuste sua posição para que seu rosto fique mais claro e fĆ”cil de detectar.",multi_face_title:"VĆ”rios rostos foram detectados.",multi_face_message:"Certifique-se de que haja apenas um rosto visĆvel no quadro para continuar.",blur_selfie_title:"O autorretrato estĆ” fora de foco.",blur_selfie_message:"Tente tirar uma nova imagem com foco mais claro para melhor detecção.",glare_selfie_title:"Muita reflexĆ£o em seu autorretrato.",glare_selfie_message:"Tente tirar outra foto com melhor iluminação e sem brilho para uma detecção precisa.",closed_eyes_title:"Parece que seus olhos estĆ£o fechados.",closed_eyes_message:"Por favor, tire a foto novamente com os olhos abertos.",face_occluded_title:"Seu rosto estĆ” parcialmente oculto.",face_occluded_message:"Tire outra foto com seu rosto totalmente visĆvel para uma detecção precisa.",face_rotated_title:"Seu rosto estĆ” fora de foco.",face_rotated_message:"Por favor, tente pegar outro com foco mais claro para melhor detecção.",barcode_not_found_title:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocĆ”-lo em um local mais claro.",barcode_not_found_message:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocĆ”-lo em um local mais claro.",searching_document_autocapture:"Buscando o documento",capturing_document_autocapture:"Capturando, por favor mantenha-se imóvel",click_manual_autocapture:"Clique para capturar manualmente.",glare_blur_issues_autocapture:"Por favor, certifique-se de que nĆ£o hĆ” reflexos de luz antes de tentar novamente",doc_not_in_frame_issues_autocapture:"Por favor, aproxime o documento e certifique-se de que estĆ” totalmente dentro da moldura de captura para uma imagem nĆtida",second_title_face_autocapture:"Prepare-se! Sua selfie serĆ” capturada automaticamente, ou toque para capturĆ”-la manualmente",capturing_face_autocapture3:"Capturando... por favor, fique parado por 3",capturing_face_autocapture2:"Capturando... por favor, fique parado por 2",capturing_face_autocapture1:"Capturando... por favor, fique parado por 1",selfie_approval_autocapture:"Ćtimo trabalho! Aprove sua selfie para continuar"},frCa:{blur_message:"Veuillez faire la mise au point de lāappareil photo sur le document avant de le capturer",blur_title:"Image floue",document_not_found_message:"Munissez-vous dāune piĆØce dāidentitĆ© valide dĆ©livrĆ©e par le gouvernement",document_not_found_title:"Document non dĆ©tectĆ©",document_not_matching_message:"Veillez Ć capturer le verso du document",document_not_matching_title:"Non-concordance entre les images du recto et du verso",document_not_supported_message:"Veuillez utiliser une autre piĆØce dāidentitĆ© dĆ©livrĆ©e par le gouvernement",document_not_supported_title:"Document non pris en charge",face_not_found_message:"Assurez-vous que votre visage nāest pas couvert et quāil est entiĆØrement visible",face_not_found_title:"Visage non dĆ©tectĆ©",glare_message:"Ćvitez la lumiĆØre directe qui pourrait se reflĆ©ter sur le document",glare_title:"Reflet dĆ©tectĆ©",main_title_document_back:"Verso",main_title_document_face:"Ćgoportrait",main_title_document_front:"Face avant",obstructed_message:"Le document comporte des parties manquantes ou couvertes",obstructed_title:"Informations manquantes",other_error_code_message:"Veuillez rĆ©essayer",other_error_code_title:"Une erreur sāest produite",page_header_document:"NumĆ©riser le document",page_header_face:"Reconnaissance faciale",second_title_document_back:"Veuillez placer votre document sur une surface solide, le verso vers le haut.",second_title_document_face:"Veuillez positionner votre visage au centre de lāovale ci-dessous.",second_title_document_front:"Veuillez placer votre document sur une surface solide, photo vers le haut.",wrong_document_side_message:"Le mauvais cĆ“tĆ© du document a Ć©tĆ© dĆ©tectĆ©",wrong_document_side_title:"Mauvais cĆ“tĆ© du document dĆ©tectĆ©",face_angle_too_large_title:"votre visage nāest pas directement alignĆ© avec lāappareil photo",face_angle_too_large_message:"Veuillez prendre une autre photo avec votre visage entiĆØrement visible pour une dĆ©tection prĆ©cise",face_close_to_border_title:"Votre visage est trop prĆØs du bord",face_close_to_border_message:"Veuillez ajuster votre position et vous assurer que lāensemble de votre visage se trouve dans le cadre",face_too_small_title:"Votre visage est trop Ć©loignĆ© du bord",face_too_small_message:"Veuillez vous rapprocher de la camĆ©ra pour que votre visage soit plus clair et plus facile Ć dĆ©tecter",face_too_close_title:"Votre visage est trop proche",face_too_close_message:"Veuillez ajuster votre position et vous assurer que lāensemble de votre visage se trouve dans le cadre",face_cropped_title:"Votre visage est partiellement rognĆ©",face_cropped_message:"Veuillez ajuster votre position et vous assurer que lāensemble de votre visage se trouve dans le cadre pour optimiser",no_face_title:"Visage introuvable",no_face_message:"Veuillez vous rapprocher de la camĆ©ra ou ajuster votre position pour que votre visage soit plus clair et plus facile Ć dĆ©tecter",multi_face_title:"Plusieurs visages dĆ©tectĆ©s",multi_face_message:"Veuillez vous assurer quāun seul visage est visible dans le cadre pour continuer",blur_selfie_title:"LāĆ©goportrait nāest pas net",blur_selfie_message:"Essayez dāen prendre un autre avec une mise au point plus claire pour une meilleure dĆ©tection",glare_selfie_title:"Trop de reflets sur votre Ć©goportrait",glare_selfie_message:"Veuillez essayer de prendre une autre photo avec un meilleur Ć©clairage et sans reflet pour une dĆ©tection prĆ©cise",closed_eyes_title:"Il semble que vos yeux soient fermĆ©s.",closed_eyes_message:"Veuillez reprendre la photo avec les yeux ouverts",face_occluded_title:"Votre visage est partiellement cachĆ©.",face_occluded_message:"Veuillez prendre une autre photo avec votre visage entiĆØrement visible pour une dĆ©tection prĆ©cise",face_rotated_title:"votre visage nāest pas directement alignĆ© avec lāappareil photo",face_rotated_message:"Veuillez prendre une autre photo avec votre visage entiĆØrement visible pour une dĆ©tection prĆ©cise",barcode_not_found_title:"Nous avons des difficultĆ©s Ć capturer certains Ć©lĆ©ments importants de votre document. Veuillez essayer de le placer Ć un endroit plus clair",barcode_not_found_message:"Nous avons des difficultĆ©s Ć capturer certains Ć©lĆ©ments importants de votre document. Veuillez essayer de le placer Ć un endroit plus clair",searching_document_autocapture:"Recherche du document",capturing_document_autocapture:"Capture en cours, veuillez rester immobile",click_manual_autocapture:"Cliquez pour capturer manuellement",glare_blur_issues_autocapture:"Veuillez vous assurer quāil nāy a pas de reflets de lumiĆØre avant de rĆ©essayer",doc_not_in_frame_issues_autocapture:"Veuillez rapprocher le document et assurez-vous quāil soit entiĆØrement dans le cadre de capture pour une image claire",second_title_face_autocapture:"PrĆ©parez-vous! Votre selfie sera capturĆ© automatiquement, ou appuyez pour le capturer manuellement",capturing_face_autocapture3:"Capture... en cours, veuillez rester immobile pendant 3",capturing_face_autocapture2:"Capture... en cours, veuillez rester immobile pendant 2",capturing_face_autocapture1:"Capture... en cours, veuillez rester immobile pendant 1",selfie_approval_autocapture:"Bon travail! Approuvez votre selfie pour continuer"}};const zs=async(e,t,i,r,n,a)=>{var o,s,c,d,u,l,h;fa.HEADERS=Aa(i,t);const f=va.UAParser();let p;if(Zo.state.isImageSigningEnabled){const e=Po.crypto.createCryptoBinding("sign");p=await e.sign(r.data)}const g=await(m=e,b={image:{format:r.format,image_type:a,content:r.data,capture_margins:r.captureMargins,signature:p},device_info:{model:null===(o=null==f?void 0:f.device)||void 0===o?void 0:o.model,type:null===(s=null==f?void 0:f.device)||void 0===s?void 0:s.type,manufacturer:null===(c=null==f?void 0:f.device)||void 0===c?void 0:c.vendor,os:null===(d=null==f?void 0:f.os)||void 0===d?void 0:d.name,os_version:null===(u=null==f?void 0:f.os)||void 0===u?void 0:u.version,browser:null===(l=null==f?void 0:f.browser)||void 0===l?void 0:l.name,browser_version:null===(h=null==f?void 0:f.browser)||void 0===h?void 0:h.version,used_camera:null==n?void 0:n.selectedCamera,cameras:null==n?void 0:n.camerasInfo}},$o({method:"POST",url:"/verify/api/v1/verification/{sid}/images",path:{sid:m},body:b,mediaType:"application/json",errors:{400:"Request is malformed or missing required fields",401:"Access token is malformed, missing data, or expired",404:"Session not found",409:"All required images were successfully submitted"}},b.image.image_type));var m,b;const v=function(e,t){const i=[...e].find((e=>e.includes(t)));return void 0!==i?i[1]:void 0}(g.headers,"x-ts-processing-time-ms");return"ok"!==g.body.feedback&&console.error("Error",g),{missing_images:g.body.missing_images,feedback:g.body.feedback,custom_feedback:g.body.custom_feedback,has_barcode:g.body.has_barcode,serverProcessingTime:v}},Ps=()=>{const e=document.getElementById("overlay-frame");if(e){const t=e.getBoundingClientRect(),i=(3840-screen.width)/2,r=(2160-screen.height)/2;return{top:r+t.top,bottom:r+t.bottom,right:i+t.right,left:i+t.left}}},Os=e=>["document_front","document_back"].includes(e)?"environment":"user";function Fs(e){switch(e){case"document_front":return ga.image_type.DOCUMENT_FRONT;case"document_back":return ga.image_type.DOCUMENT_BACK;case"selfie":return ga.image_type.SELFIE}}var Ns={},Ls={get exports(){return Ns},set exports(e){Ns=e}};Ls.exports=function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,i){i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return o}));var r=i(1),n=i(7);i.d(t,"a",(function(){return n.a})),i.d(t,"d",(function(){return r.b}));var a=r.a.FACING_MODES,o=r.a.IMAGE_TYPES},function(e,t,i){var r=i(6);i.d(t,"a",(function(){return r.a}));var n=i(2);i.d(t,"b",(function(){return n.a}))},function(e,t,i){function r(e,t){if(!(t>=0&&t<=1))throw new Error(t+" is invalid imageCompression, choose between: [0, 1]");if(!h.f.includes(e))throw new Error(e+" is invalid imageType, choose between: "+h.f.join(", "));return!0}function n(e,t){var i={};try{r(e,t),i.imageType=e,i.imageCompression=t}catch(e){console.error(e),console.error("default value of "+h.c.PNG+" is used"),i.imageType=h.c.PNG,i.imageCompression=null}return i}function a(){var e=window.navigator.platform,t=window.navigator.userAgent;return e||t}function o(){return"ontouchend"in document}function s(e,t,i){var r=e*parseFloat(i);return{imageWidth:r,imageHeight:t/(e/r)}}function c(e,t,i){return n(t,i).imageType===h.c.JPG?i?e.toDataURL(h.b[h.c.JPG],i):e.toDataURL(h.b[h.c.JPG]):e.toDataURL(h.b[t])}function d(e,t){return e||t}function u(){var e=a();if(/iPad|iPhone|iPod/.test(e))return!0;var t=o();return!(!/Mac/.test(e)||!t)}function l(){return{userAgent:window.navigator.userAgent,platform:window.navigator.platform,_getStringWithPlatform:a(),_getHasTouchEvents:o(),getIsIOS:u()}}t.c=s,t.b=c,t.e=d,t.d=u,t.a=l;var h=i(3)},function(e,t,i){function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}i.d(t,"e",(function(){return a})),i.d(t,"a",(function(){return o})),i.d(t,"f",(function(){return s})),i.d(t,"c",(function(){return c})),i.d(t,"b",(function(){return d})),i.d(t,"d",(function(){return u}));var n,a=["user","environment"],o={USER:"user",ENVIRONMENT:"environment"},s=["jpg","png"],c={PNG:"png",JPG:"jpg"},d=(r(n={},"jpg","image/jpeg"),r(n,"png","image/png"),n),u={audio:!1,video:!0}},function(e,t,i){e.exports=i(5)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=i(0);i.d(t,"FACING_MODES",(function(){return r.b})),i.d(t,"IMAGE_TYPES",(function(){return r.c})),i.d(t,"_getDebugPlatformInfo",(function(){return r.d}));var n=i(9);i.d(t,"downloadPhoto",(function(){return n.a})),t.default=r.a},function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,"a",(function(){return s}));var n=i(2),a=i(3),o=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=function(){function e(){r(this,e)}return o(e,null,[{key:"getDataUri",value:function(e,t){var i=t.sizeFactor,r=t.imageType,a=t.imageCompression,o=t.isImageMirror,s=e.videoWidth,c=e.videoHeight,d=Object(n.c)(s,c,i),u=d.imageWidth,l=d.imageHeight,h=document.createElement("canvas");h.width=u,h.height=l;var f=h.getContext("2d");return o&&f.setTransform(-1,0,0,1,h.width,0),f.drawImage(e,0,0,u,l),Object(n.b)(h,r,a)}},{key:"getWindowURL",value:function(){return window.URL||window.webkitURL||window.mozURL||window.msURL}},{key:"getNavigatorMediaDevices",value:function(){var e=null,t=!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),i=!(!navigator.mozGetUserMedia&&!navigator.webkitGetUserMedia);if(t)e=navigator.mediaDevices;else if(i){var r=navigator.mozGetUserMedia||navigator.webkitGetUserMedia,n={getUserMedia:function(e){return new Promise((function(t,i){r.call(navigator,e,t,i)}))}};e=Object.assign(r,n)}return e}},{key:"isSupportedFacingMode",value:function(){return e.getNavigatorMediaDevices().getSupportedConstraints().facingMode}},{key:"getIdealConstraints",value:function(t,i){if(!Object(n.e)(t,i))return a.d;var r=e.getNavigatorMediaDevices().getSupportedConstraints();if(!r.width||!r.height)return console.error("Constraint width or height not supported! fallback to default resolution"),a.d;var o=void 0,s=void 0;return t&&(a.e.includes(t)?o=t:s={exact:t}),{audio:!1,video:{facingMode:o,deviceId:s,width:i&&i.width,height:i&&i.height}}}},{key:"getMaxResolutionConstraints",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments[1];console.warn("getMaxResolutionConstraints() numberOfMaxResolutionTry:",i);var r=[{width:{min:640}},{width:{min:800}},{width:{min:900}},{width:{min:1024}},{width:{min:1080}},{width:{min:1280}},{width:{min:1920}},{width:{min:2560}},{width:{min:3840}}],a=e.getIdealConstraints(t,{});if(0===i)return Object(n.d)()?(console.warn("fallback to iOS constraints"),e.getIdealConstraints(t,{width:{min:640,ideal:3840},height:{min:480,ideal:2160}})):(a.video.advanced=r,a);if(i<r.length){var o=r.slice(0,-i);return a.video.advanced=o,a}return null}},{key:"FACING_MODES",get:function(){return a.a}},{key:"IMAGE_TYPES",get:function(){return a.c}}]),e}()},function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,"a",(function(){return c}));var n=i(1),a=i(8),o=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=n.a.IMAGE_TYPES.PNG,c=function(){function e(t){r(this,e),this.videoElement=t,this.stream=null,this.numberOfMaxResolutionTry=0,this.settings=null,this.cameras=[],this.windowURL=n.a.getWindowURL(),this.mediaDevices=n.a.getNavigatorMediaDevices()}return o(e,[{key:"_getStreamDevice",value:function(e,t){var i=this;return new Promise((function(r,a){var o=n.a.getIdealConstraints(e,t);i.mediaDevices.getUserMedia(o).then((function(e){i._gotStream(e),r(e)})).catch((function(e){a(e)}))}))}},{key:"_getStreamDeviceMaxResolution",value:function(e){var t=this,i=n.a.getMaxResolutionConstraints(e,this.numberOfMaxResolutionTry);if(null==i){var r={};return this._getStreamDevice(e,r)}return new Promise((function(r,n){t.mediaDevices.getUserMedia(i).then((function(e){t._gotStream(e),r(e)})).catch((function(i){setTimeout((function(){t.numberOfMaxResolutionTry+=1,t._getStreamDeviceMaxResolution(e).catch((function(){n(i)}))}),20)}))}))}},{key:"_setVideoSrc",value:function(e){if("srcObject"in this.videoElement)this.videoElement.srcObject=e;else{var t=this.windowURL.createObjectURL(e);this.videoElement.src=t}}},{key:"_setSettings",value:function(e){this.settings=null;var t=e&&e.getTracks?e.getTracks():[];t.length>0&&t[0].getSettings&&(this.settings=t[0].getSettings())}},{key:"_enumerateCamerasPromise",value:function(){var e=this;return new Promise((function(t,i){var r=[];e.mediaDevices.enumerateDevices().then((function(e){e.forEach((function(e){"videoinput"===e.kind&&e.deviceId&&r.push(e)})),t(r)})).catch((function(e){i(e)}))}))}},{key:"_gotStream",value:function(e){this.stream=e,this._setSettings(e),this._setVideoSrc(e)}},{key:"getCameraSettings",value:function(){return this.settings}},{key:"enumerateCameras",value:function(){var e=this;return this.stream?this._enumerateCamerasPromise():this.stopCamera().then((function(){})).catch((function(){})).then((function(){var t={video:!0};return e.mediaDevices.getUserMedia(t).then((function(e){setTimeout((function(){e.getTracks().forEach((function(e){e.stop()}))}),20)})).then((function(){})).catch((function(){})).then((function(){return e._enumerateCamerasPromise()}))}))}},{key:"startCamera",value:function(e,t){var i=this;return this.stopCamera().then((function(){})).catch((function(){})).then((function(){return i._getStreamDevice(e,t)}))}},{key:"startCameraMaxResolution",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.numberOfMaxResolutionTry=0,this.stopCamera().then((function(){})).catch((function(){})).then((function(){return e._getStreamDeviceMaxResolution(t)}))}},{key:"getDataUri",value:function(e){var t={sizeFactor:void 0===e.sizeFactor?a.c:e.sizeFactor,imageType:void 0===e.imageType?s:e.imageType,imageCompression:void 0===e.imageCompression?a.a:e.imageCompression,isImageMirror:void 0===e.isImageMirror?a.b:e.isImageMirror};return n.a.getDataUri(this.videoElement,t)}},{key:"stopCamera",value:function(){var e=this;return new Promise((function(t,i){e.stream&&(e.stream.getTracks().forEach((function(e){e.stop()})),e.videoElement.src="",e.stream=null,e._setSettings(null),t()),i(Error("no stream to stop!"))}))}}]),e}()},function(e,t,i){i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return a}));var r=1,n=null,a=!1},function(e,t,i){var r=i(10);i.d(t,"a",(function(){return r.a}))},function(e,t,i){function r(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),n=new Uint8Array(r),a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return new Blob([r],{type:i})}function n(e,t){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function a(e){var t=d.c.PNG;return"image/jpeg"===e&&(t=d.c.JPG),t}function o(e,t,i){return e+"-"+n(t,4)+"."+a(i)}function s(e,t,i){window.URL=window.webkitURL||window.URL;var r=document.createElement("a");r.download=o(t,i,e.type),r.href=window.URL.createObjectURL(e);var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(n)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photo",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s(r(e),t,i)}t.a=c;var d=i(0)}]);var js=Y(Ns);class Us{constructor(){this.currentStream=null,this.currentConstraints=null}static getInstance(){return Us.instance||(Us.instance=new Us),Us.instance}getStream(){return this.currentStream}isStreaming(){return this.currentStream&&this.currentStream.getTracks().some((e=>"live"===e.readyState))}stopStream(){this.currentStream&&(this.currentStream.getTracks().forEach((e=>e.stop())),this.currentStream=null)}areConstraintsEqual(e){return!!this.currentConstraints&&JSON.stringify(this.currentConstraints)===JSON.stringify(e)}async startNewStream(e){this.isStreaming()&&this.areConstraintsEqual(e)||(this.stopStream(),this.currentStream=await navigator.mediaDevices.getUserMedia(e),this.currentConstraints=e)}async enumerateDevices(){try{return await navigator.mediaDevices.enumerateDevices()}catch(e){throw console.error("Failed to enumerate devices:",e),e}}}const qs=[{os:{name:"Android"},label:"2 0"}];async function Ks(){const e=(await async function(){const e=Us.getInstance();let t=await e.enumerateDevices();return t.filter((e=>"videoinput"===e.kind)).every((e=>""===e.label))&&(await e.startNewStream({video:{facingMode:{ideal:"environment"}},audio:!1}),t=await e.enumerateDevices(),e.stopStream()),t}()).filter((e=>{if(!(null==e?void 0:e.label)||"videoinput"!==e.kind||""===e.label)return!1;const t=e.label.toLowerCase();return Hs.some((e=>t.includes(e)))})),t=va.UAParser(),i=e.find((e=>qs.find((i=>i.os.name===t.os.name&&e.label.includes(i.label)))));return i?{optionalCameras:e,selectedCamera:i}:{optionalCameras:e}}const Hs=["rear","back","rück","arriĆØre","trasera","trĆ”s","traseira","posteriore","åé¢","å¾é¢","čé¢","åē½®","å¾ē½®","čē½®","заГней","Ų§ŁŲ®ŁŁŁŲ©","ķ","arka","achterzijde","ąø«ąø„ąø±ąø","baksidan","bagside","sau","bak","tylny","takakamera","belakang","×××ר××Ŗ","ĻĪÆĻĻ","spate","hĆ”tsó","zadnĆ","darrere","zadnĆ”","заГнŃ","stražnja","belakang","ą¤¬ą„ą¤","camera2 0, facing back"],Vs={width:{min:640,max:3840,ideal:3840},height:{min:480,max:2160,ideal:2160},frameRate:30},$s={width:{min:640,max:1280,ideal:1280},height:{min:480,max:720,ideal:720},frameRate:30},Js=async e=>{var t,i;let r;return"environment"==e&&(r=await Ks()),null!==(i=null===(t=null==r?void 0:r.selectedCamera)||void 0===t?void 0:t.deviceId)&&void 0!==i?i:e},Gs=(e,t)=>{var i,r;return"user"===e?null!==(i=null==t?void 0:t.selfieVideoConstraints)&&void 0!==i?i:$s:null!==(r=null==t?void 0:t.environmentVideoConstraints)&&void 0!==r?r:Vs},Ws=e=>{const t=Is({tagName:"video",style:{position:"absolute",zIndex:"0",top:"0",width:"100%",height:"100%",objectFit:"cover"},id:"video",testid:"video"});return t.style.transform="user"===e?"scaleX(-1)":"",t.autoplay=!0,t.muted=!0,t.setAttribute("playsinline","true"),t},Zs={title:"other_error_code_title",message:"other_error_code_message"},Ys={ok:Zs,document_face_not_found:Zs,restricted_criteria:Zs,other:Zs,glare:{title:"glare_title",message:"glare_message"},document_not_found:{title:"document_not_found_title",message:"document_not_found_message"},blur:{title:"blur_title",message:"blur_message"},document_not_supported:{title:"document_not_supported_title",message:"document_not_supported_message"},obstructed:{title:"obstructed_title",message:"obstructed_message"},document_not_matching:{title:"document_not_matching_title",message:"document_not_matching_message"},face_not_found:{title:"face_not_found_title",message:"face_not_found_message"},wrong_document_side:{title:"wrong_document_side_title",message:"wrong_document_side_message"},glare_selfie:{title:"glare_selfie_title",message:"glare_selfie_message"},blur_selfie:{title:"blur_selfie_title",message:"blur_selfie_message"},multi_face:{title:"multi_face_title",message:"multi_face_message"},face_rotated:{title:"face_rotated_title",message:"face_rotated_message"},face_too_small:{title:"face_too_small_title",message:"face_too_small_message"},face_too_close:{title:"face_too_close_title",message:"face_too_close_message"},closed_eyes:{title:"closed_eyes_title",message:"closed_eyes_message"},face_angle_too_large:{title:"face_angle_too_large_title",message:"face_angle_too_large_message"},face_close_to_border:{title:"face_close_to_border_title",message:"face_close_to_border_message"},face_occluded:{title:"face_occluded_title",message:"face_occluded_message"},face_cropped:{title:"face_cropped_title",message:"face_cropped_message"},barcode_not_found:{title:"barcode_not_found_title",message:"barcode_not_found_message"}},Qs={loading_screen:{page:"page_header_document",title:"main_title_document_front",instructions:"loading_screen_small_title"},document_front:{page:"page_header_document",title:"main_title_document_front",instructions:"second_title_document_front"},document_back:{page:"page_header_document",title:"main_title_document_back",instructions:"second_title_document_back"},selfie:{page:"page_header_face",title:"main_title_document_face",instructions:"second_title_document_face"}},Xs=(e,t)=>{const i=Is({tagName:"div",style:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative",zIndex:"1",background:"transparent",boxShadow:"0 0 0 1000px rgb(0 0 0 / 50%)",borderStyle:"solid",borderWidth:"1px",borderColor:"white"},id:`overlay-frame ${e}`,testid:`overlay-frame ${e}`});if("environment"===e){!function(e){Ds(e,Is({tagName:"div",style:{position:"absolute",top:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"none",borderBottomStyle:"none",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-left",testid:"overlay-frame__top-left"})),Ds(e,Is({tagName:"div",style:{position:"absolute",top:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-right",testid:"overlay-frame__top-right"})),Ds(e,Is({tagName:"div",style:{position:"absolute",bottom:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-right",testid:"overlay-frame__bottom-right"})),Ds(e,Is({tagName:"div",style:{position:"absolute",bottom:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"solid",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-left",testid:"overlay-frame__bottom-left"}))}(i);const e=.85*t.clientWidth;i.style.width=`${e}px`,i.style.height=.65*e+"px",i.style.maxHeight=.5*window.innerHeight+"px"}else{const e=t.clientWidth*(t.clientHeight<700?.8:.85);i.style.width=.8*e+"px",i.style.height=`${e}px`,i.style.minHeight=.8*e+"px",i.style.maxHeight=.5*window.innerHeight+"px",i.style.borderRadius="50%"}return i};const ec=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 68 68"),t.innerHTML=`<style>.spinner-autocapture circle {animation: rotate 1.5s linear infinite;} @keyframes rotate { 50% {stroke-dashoffset: 94; stroke-dasharray: 6 57; } 100% { stroke-dashoffset: 188; stroke-dasharray: 51 12; }} </style> <g class="spinner-autocapture"> <circle cx="34" cy="34" fill="none" r="30" stroke-width="4" stroke="${null!=e?e:"#fff"}" stroke-dasharray="51 12" stroke-linecap="round" stroke-dashoffset="0" /> </g>`,t};function tc(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","16px"),e.setAttribute("height","16px"),e.innerHTML='\n <path d="M8 16C12.4187 16 16 12.4187 16 8C16 3.58125 12.4187 0 8 0C3.58125 0 0 3.58125 0 8C0 12.4187 3.58125 16 8 16ZM8 4C8.41562 4 8.75 4.33437 8.75 4.75V8.25C8.75 8.66562 8.41562 9 8 9C7.58437 9 7.25 8.66562 7.25 8.25V4.75C7.25 4.33437 7.58437 4 8 4ZM9 11C9 11.5531 8.55313 12 8 12C7.44688 12 7 11.5531 7 11C7 10.4469 7.44688 10 8 10C8.55313 10 9 10.4469 9 11Z" fill="#F2F2F2"/>\n ',e}const ic={all:{color:"black",margin:"0"},1:{color:"white",fontSize:"var(--font-size-4xl)",fontWeight:"var(--font-weight-bold)"},2:{color:"white",fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-semibold)"},3:{color:"white",fontSize:"var(--font-size-xl)",fontWeight:"var(--font-weight-medium)"},4:{fontSize:"var(--font-size-lg)",fontWeight:"var(--font-weight-regular)"},5:{fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-light)"},6:{fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-light)"}},rc=e=>{let{text:i,level:r=1,style:n={},id:a,testid:o}=e;const s=Is({tagName:`h${r}`,style:t(t(t({},ic.all),ic[r]),n),id:a,testid:o});return s.textContent=i,s.id=a,s};var nc,ac={};let oc=null;try{oc=(nc||(nc=1,function(e){function i(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const a={exec:()=>null};function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(s.caret,"$1"),i=i.replace(e,n),r},getRegex:()=>new RegExp(i,t)};return r}const s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10107}-\u{10133}\u{10140}-\u{10178}\u{1018A}\u{1018B}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{103D1}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10858}-\u{10876}\u{10879}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A60}-\u{10A7E}\u{10A80}-\u{10A9F}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11052}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{11136}-\u{1113F}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111D0}-\u{111DA}\u{111DC}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{112F0}-\u{112F9}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{11450}-\u{11459}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116B8}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11730}-\u{1173B}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C50}-\u{11C6C}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11F50}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{12000}-\u{12399}\u{12400}-\u{1246E}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A70}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E96}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D7FF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1EC71}-\u{1ECAB}\u{1ECAD}-\u{1ECAF}\u{1ECB1}-\u{1ECB4}\u{1ED01}-\u{1ED2D}\u{1ED2F}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10C}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},c=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d=/(?:[*+-]|\d{1,9}[.)])/,u=o(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),l=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\.|[^\[\]\\])+/,f=o(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),p=o(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,d).getRegex(),g="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",m=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b=o("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",m).replace("tag",g).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v=o(l).replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),y={blockquote:o(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",v).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:f,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:c,html:b,lheading:u,list:p,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:v,table:a,text:/^[^\n]+/},_=o("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),w=t(t({},y),{},{table:_,paragraph:o(l).replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex()}),x=t(t({},y),{},{html:o("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:a,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:o(l).replace("hr",c).replace("heading"," *#{1,6} *[^\n]").replace("lheading",u).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),A=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,E=/^( {2,}|\\)\n(?!\s*$)/,S="\\p{P}\\p{S}",k=o(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,S).getRegex(),M=o(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,S).getRegex(),C=o("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,S).getRegex(),I=o("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,S).getRegex(),D=o(/\\([punct])/,"gu").replace(/punct/g,S).getRegex(),T=o(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),R=o(m).replace("(?:--\x3e|$)","--\x3e").getRegex(),B=o("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",R).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),z=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,P=o(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",z).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),O=o(/^!?\[(label)\]\[(ref)\]/).replace("label",z).replace("ref",h).getRegex(),F=o(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),N={_backpedal:a,anyPunctuation:D,autolink:T,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:E,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:a,emStrongLDelim:M,emStrongRDelimAst:C,emStrongRDelimUnd:I,escape:A,link:P,nolink:F,punctuation:k,reflink:O,reflinkSearch:o("reflink|nolink(?!\\()","g").replace("reflink",O).replace("nolink",F).getRegex(),tag:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:a},L=t(t({},N),{},{link:o(/^!?\[(label)\]\((.*?)\)/).replace("label",z).getRegex(),reflink:o(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z).getRegex()}),j=t(t({},N),{},{escape:o(A).replace("])","~|])").getRegex(),url:o(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),U=t(t({},j),{},{br:o(E).replace("{2,}","*").getRegex(),text:o(j.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),q={normal:y,gfm:w,pedantic:x},K={normal:N,gfm:j,breaks:U,pedantic:L},H={"&":"&","<":"<",">":">",'"':""","'":"'"},V=e=>H[e];function $(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,V)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,V);return e}function J(e){try{e=encodeURI(e).replace(s.percentDecode,"%")}catch(e){return null}return e}function G(e,t){const i=e.replace(s.findPipe,((e,t,i)=>{let r=!1,n=t;for(;--n>=0&&"\\"===i[n];)r=!r;return r?"|":" |"})).split(s.splitPipe);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(s.slashPipe,"|");return i}function W(e,t,i){const r=e.length;if(0===r)return"";let n=0;for(;n<r;){const a=e.charAt(r-n-1);if(a!==t||i){if(a===t||!i)break;n++}else n++}return e.slice(0,r-n)}function Z(e,t,i,r,n){const a=t.href,o=t.title||null,s=e[1].replace(n.other.outputLinkReplace,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:i,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:i,href:a,title:o,text:s}}class Y{constructor(t){r(this,"options",void 0),r(this,"rules",void 0),r(this,"lexer",void 0),this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:W(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t,i){const r=e.match(i.other.indentCodeCompensation);if(null===r)return t;const n=r[1];return t.split("\n").map((e=>{const t=e.match(i.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=W(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:W(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=W(t[0],"\n").split("\n"),i="",r="";const n=[];for(;e.length>0;){let t=!1;const a=[];let o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else{if(t)break;a.push(e[o])}e=e.slice(o);const s=a.join("\n"),c=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}\n${s}`:s,r=r?`${r}\n${c}`:c;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,n,!0),this.lexer.state.top=d,0===e.length)break;const u=n[n.length-1];if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,a=t.raw+"\n"+e.join("\n"),o=this.blockquote(a);n[n.length-1]=o,i=i.substring(0,i.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==(null==u?void 0:u.type));else{const t=u,a=t.raw+"\n"+e.join("\n"),o=this.list(a);n[n.length-1]=o,i=i.substring(0,i.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(n[n.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:i,tokens:n,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim();const r=i.length>1,n={type:"list",raw:"",ordered:r,start:r?+i.slice(0,-1):"",loose:!1,items:[]};i=r?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=r?i:"[*+-]");const a=this.rules.other.listItemRegex(i);let o=!1;for(;e;){let i=!1,r="",s="";if(!(t=a.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),d=e.split("\n",1)[0],u=!c.trim(),l=0;if(this.options.pedantic?(l=2,s=c.trimStart()):u?l=t[1].length+1:(l=t[2].search(this.rules.other.nonSpaceChar),l=l>4?1:l,s=c.slice(l),l+=t[1].length),u&&this.rules.other.blankLine.test(d)&&(r+=d+"\n",e=e.substring(d.length+1),i=!0),!i){const t=this.rules.other.nextBulletRegex(l),i=this.rules.other.hrRegex(l),n=this.rules.other.fencesBeginRegex(l),a=this.rules.other.headingBeginRegex(l),o=this.rules.other.htmlBeginRegex(l);for(;e;){const h=e.split("\n",1)[0];let f;if(d=h,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),f=d):f=d.replace(this.rules.other.tabCharGlobal," "),n.test(d))break;if(a.test(d))break;if(o.test(d))break;if(t.test(d))break;if(i.test(d))break;if(f.search(this.rules.other.nonSpaceChar)>=l||!d.trim())s+="\n"+f.slice(l);else{if(u)break;if(c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(n.test(c))break;if(a.test(c))break;if(i.test(c))break;s+="\n"+d}u||d.trim()||(u=!0),r+=h+"\n",e=e.substring(h.length+1),c=f.slice(l)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,f=null;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(h="[ ] "!==f[0],s=s.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:r,task:!!f,checked:h,loose:!1,text:s,tokens:[]}),n.raw+=r}n.items[n.items.length-1].raw=n.items[n.items.length-1].raw.trimEnd(),n.items[n.items.length-1].text=n.items[n.items.length-1].text.trimEnd(),n.raw=n.raw.trimEnd();for(let e=0;e<n.items.length;e++)if(this.lexer.state.top=!1,n.items[e].tokens=this.lexer.blockTokens(n.items[e].text,[]),!n.loose){const t=n.items[e].tokens.filter((e=>"space"===e.type)),i=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));n.loose=i}if(n.loose)for(let e=0;e<n.items.length;e++)n.items[e].loose=!0;return n}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!this.rules.other.tableDelimiter.test(t[2]))return;const i=G(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]&&t[3].trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===r.length){for(const e of r)this.rules.other.tableAlignRight.test(e)?a.align.push("right"):this.rules.other.tableAlignCenter.test(e)?a.align.push("center"):this.rules.other.tableAlignLeft.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<i.length;e++)a.header.push({text:i[e],tokens:this.lexer.inline(i[e]),header:!0,align:a.align[e]});for(const e of n)a.rows.push(G(e,a.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]}))));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=W(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let i=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}(t[2],"()");if(e>-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i.slice(1):i.slice(1,-1)),Z(t,{href:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const e=t[(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return Z(i,e,i[0],this.lexer,this.rules)}}emStrong(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!i.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!i||this.rules.inline.punctuation.exec(i))){const i=[...r[0]].length-1;let n,a,o=i,s=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);null!=(r=c.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(a=[...n].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&i%3&&!((i+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const t=[...r[0]][0].length,c=e.slice(0,i+r.index+t+a);if(Math.min(i,a)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const d=c.slice(2,-2);return{type:"strong",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,i;return"@"===t[2]?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let a;do{var i,r;a=t[0],t[0]=null!==(i=null===(r=this.rules.inline._backpedal.exec(t[0]))||void 0===r?void 0:r[0])&&void 0!==i?i:""}while(a!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class Q{constructor(t){r(this,"tokens",void 0),r(this,"options",void 0),r(this,"state",void 0),r(this,"tokenizer",void 0),r(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new Y,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={other:s,block:q.normal,inline:K.normal};this.options.pedantic?(i.block=q.pedantic,i.inline=K.pedantic):this.options.gfm&&(i.block=q.gfm,this.options.breaks?i.inline=K.breaks:i.inline=K.gfm),this.tokenizer.rules=i}static get rules(){return{block:q,inline:K}}static lex(e,t){return new Q(t).lex(e)}static lexInline(e,t){return new Q(t).inlineTokens(e)}lex(e){e=e.replace(s.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e){let t,i,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(this.options.pedantic&&(e=e.replace(s.tabCharGlobal," ").replace(s.spaceLine,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>!!(t=i.call({lexer:this},e,n))&&(e=e.substring(t.raw.length),n.push(t),!0)))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&n.length>0?n[n.length-1].raw+="\n":n.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),i=n[n.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?n.push(t):(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),i=n[n.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(i.raw+="\n"+t.raw,i.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),n.push(t);else{var o;if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(r)))i=n[n.length-1],a&&"paragraph"===(null===(o=i)||void 0===o?void 0:o.type)?(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t),a=r.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),i=n[n.length-1],i&&"text"===i.type?(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,n}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,i,r,n,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,n.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(o=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((i=>!!(t=i.call({lexer:this},e,s))&&(e=e.substring(t.raw.length),s.push(t),!0)))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),i=s[s.length-1],s.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),i=s[s.length-1],i&&"text"===t.type&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):s.push(t);else if(t=this.tokenizer.emStrong(e,c,o))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.autolink(e))e=e.substring(t.raw.length),s.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(r))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(o=t.raw.slice(-1)),a=!0,i=s[s.length-1],i&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):s.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),s.push(t);return s}}class X{constructor(t){r(this,"options",void 0),r(this,"parser",void 0),this.options=t||e.defaults}space(e){return""}code(e){var t;let{text:i,lang:r,escaped:n}=e;const a=null===(t=(r||"").match(s.notSpaceStart))||void 0===t?void 0:t[0],o=i.replace(s.endingNewline,"")+"\n";return a?'<pre><code class="language-'+$(a)+'">'+(n?o:$(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:$(o,!0))+"</code></pre>\n"}blockquote(e){let{tokens:t}=e;return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html(e){let{text:t}=e;return t}heading(e){let{tokens:t,depth:i}=e;return`<h${i}>${this.parser.parseInline(t)}</h${i}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,i=e.start;let r="";for(let t=0;t<e.items.length;t++){const i=e.items[t];r+=this.listitem(i)}const n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+r+"</"+n+">\n"}listitem(e){let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=i+" "+$(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox(e){let{checked:t}=e;return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){let{tokens:t}=e;return`<p>${this.parser.parseInline(t)}</p>\n`}table(e){let t="",i="";for(let t=0;t<e.header.length;t++)i+=this.tablecell(e.header[t]);t+=this.tablerow({text:i});let r="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];i="";for(let e=0;e<n.length;e++)i+=this.tablecell(n[e]);r+=this.tablerow({text:i})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow(e){let{text:t}=e;return`<tr>\n${t}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>\n`}strong(e){let{tokens:t}=e;return`<strong>${this.parser.parseInline(t)}</strong>`}em(e){let{tokens:t}=e;return`<em>${this.parser.parseInline(t)}</em>`}codespan(e){let{text:t}=e;return`<code>${$(t,!0)}</code>`}br(e){return"<br>"}del(e){let{tokens:t}=e;return`<del>${this.parser.parseInline(t)}</del>`}link(e){let{href:t,title:i,tokens:r}=e;const n=this.parser.parseInline(r),a=J(t);if(null===a)return n;let o='<a href="'+(t=a)+'"';return i&&(o+=' title="'+$(i)+'"'),o+=">"+n+"</a>",o}image(e){let{href:t,title:i,text:r}=e;const n=J(t);if(null===n)return $(r);let a=`<img src="${t=n}" alt="${r}"`;return i&&(a+=` title="${$(i)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:$(e.text)}}class ee{strong(e){let{text:t}=e;return t}em(e){let{text:t}=e;return t}codespan(e){let{text:t}=e;return t}del(e){let{text:t}=e;return t}html(e){let{text:t}=e;return t}text(e){let{text:t}=e;return t}link(e){let{text:t}=e;return""+t}image(e){let{text:t}=e;return""+t}br(){return""}}class te{constructor(t){r(this,"options",void 0),r(this,"renderer",void 0),r(this,"textRenderer",void 0),this.options=t||e.defaults,this.options.renderer=this.options.renderer||new X,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ee}static parse(e,t){return new te(t).parse(e)}static parseInline(e,t){return new te(t).parseInline(e)}parse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="";for(let r=0;r<e.length;r++){const n=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const e=n,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){i+=t||"";continue}}const a=n;switch(a.type){case"space":i+=this.renderer.space(a);continue;case"hr":i+=this.renderer.hr(a);continue;case"heading":i+=this.renderer.heading(a);continue;case"code":i+=this.renderer.code(a);continue;case"table":i+=this.renderer.table(a);continue;case"blockquote":i+=this.renderer.blockquote(a);continue;case"list":i+=this.renderer.list(a);continue;case"html":i+=this.renderer.html(a);continue;case"paragraph":i+=this.renderer.paragraph(a);continue;case"text":{let n=a,o=this.renderer.text(n);for(;r+1<e.length&&"text"===e[r+1].type;)n=e[++r],o+="\n"+this.renderer.text(n);i+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}parseInline(e,t){t=t||this.renderer;let i="";for(let r=0;r<e.length;r++){const n=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=e||"";continue}}const a=n;switch(a.type){case"escape":case"text":i+=t.text(a);break;case"html":i+=t.html(a);break;case"link":i+=t.link(a);break;case"image":i+=t.image(a);break;case"strong":i+=t.strong(a);break;case"em":i+=t.em(a);break;case"codespan":i+=t.codespan(a);break;case"br":i+=t.br(a);break;case"del":i+=t.del(a);break;default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}}class ie{constructor(t){r(this,"options",void 0),r(this,"block",void 0),this.options=t||e.defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?te.parse:te.parseInline}}r(ie,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class re{constructor(){r(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),r(this,"options",this.setOptions),r(this,"parse",this.parseMarkdown(!0)),r(this,"parseInline",this.parseMarkdown(!1)),r(this,"Parser",te),r(this,"Renderer",X),r(this,"TextRenderer",ee),r(this,"Lexer",Q),r(this,"Tokenizer",Y),r(this,"Hooks",ie),this.use(...arguments)}walkTokens(e,t){let i=[];for(const n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const r of e.header)i=i.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;i=i.concat(this.walkTokens(e.items,t));break}default:{var r;const e=n;null!==(r=this.defaults.extensions)&&void 0!==r&&null!==(r=r.childTokens)&&void 0!==r&&r[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const n=e[r].flat(1/0);i=i.concat(this.walkTokens(n,t))})):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];return r.forEach((i=>{const r=t({},i);if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const i=e.renderers[t.name];e.renderers[t.name]=i?function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];let a=t.renderer.apply(this,r);return!1===a&&(a=i.apply(this,r)),a}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),r.extensions=e),i.renderer){const e=this.defaults.renderer||new X(this.defaults);for(const t in i.renderer){if(!(t in e))throw new Error(`renderer '${t}' does not exist`);if(["options","parser"].includes(t))continue;const r=t,n=i.renderer[r],a=e[r];e[r]=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];let o=n.apply(e,i);return!1===o&&(o=a.apply(e,i)),o||""}}r.renderer=e}if(i.tokenizer){const e=this.defaults.tokenizer||new Y(this.defaults);for(const t in i.tokenizer){if(!(t in e))throw new Error(`tokenizer '${t}' does not exist`);if(["options","rules","lexer"].includes(t))continue;const r=t,n=i.tokenizer[r],a=e[r];e[r]=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];let o=n.apply(e,i);return!1===o&&(o=a.apply(e,i)),o}}r.tokenizer=e}if(i.hooks){const e=this.defaults.hooks||new ie;for(const t in i.hooks){if(!(t in e))throw new Error(`hook '${t}' does not exist`);if(["options","block"].includes(t))continue;const r=t,n=i.hooks[r],a=e[r];ie.passThroughHooks.has(t)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(n.call(e,t)).then((t=>a.call(e,t)));const i=n.call(e,t);return a.call(e,i)}:e[r]=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];let o=n.apply(e,i);return!1===o&&(o=a.apply(e,i)),o}}r.hooks=e}if(i.walkTokens){const e=this.defaults.walkTokens,t=i.walkTokens;r.walkTokens=function(i){let r=[];return r.push(t.call(this,i)),e&&(r=r.concat(e.call(this,i))),r}}this.defaults=t(t({},this.defaults),r)})),this}setOptions(e){return this.defaults=t(t({},this.defaults),e),this}lexer(e,t){return Q.lex(e,null!=t?t:this.defaults)}parser(e,t){return te.parse(e,null!=t?t:this.defaults)}parseMarkdown(e){return(i,r)=>{const n=t({},r),a=t(t({},this.defaults),n),o=this.onError(!!a.silent,!!a.async);if(!0===this.defaults.async&&!1===n.async)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==i)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof i)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=e);const s=a.hooks?a.hooks.provideLexer():e?Q.lex:Q.lexInline,c=a.hooks?a.hooks.provideParser():e?te.parse:te.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(i):i).then((e=>s(e,a))).then((e=>a.hooks?a.hooks.processAllTokens(e):e)).then((e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then((()=>e)):e)).then((e=>c(e,a))).then((e=>a.hooks?a.hooks.postprocess(e):e)).catch(o);try{a.hooks&&(i=a.hooks.preprocess(i));let e=s(i,a);a.hooks&&(e=a.hooks.processAllTokens(e)),a.walkTokens&&this.walkTokens(e,a.walkTokens);let t=c(e,a);return a.hooks&&(t=a.hooks.postprocess(t)),t}catch(e){return o(e)}}}onError(e,t){return i=>{if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+$(i.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(i);throw i}}}const ne=new re;function ae(e,t){return ne.parse(e,t)}ae.options=ae.setOptions=function(e){return ne.setOptions(e),ae.defaults=ne.defaults,n(ae.defaults),ae},ae.getDefaults=i,ae.defaults=e.defaults,ae.use=function(){return ne.use(...arguments),ae.defaults=ne.defaults,n(ae.defaults),ae},ae.walkTokens=function(e,t){return ne.walkTokens(e,t)},ae.parseInline=ne.parseInline,ae.Parser=te,ae.parser=te.parse,ae.Renderer=X,ae.TextRenderer=ee,ae.Lexer=Q,ae.lexer=Q.lex,ae.Tokenizer=Y,ae.Hooks=ie,ae.parse=ae;const oe=ae.options,se=ae.setOptions,ce=ae.use,de=ae.walkTokens,ue=ae.parseInline,le=ae,he=te.parse,fe=Q.lex;e.Hooks=ie,e.Lexer=Q,e.Marked=re,e.Parser=te,e.Renderer=X,e.TextRenderer=ee,e.Tokenizer=Y,e.getDefaults=i,e.lexer=fe,e.marked=ae,e.options=oe,e.parse=le,e.parseInline=ue,e.parser=he,e.setOptions=se,e.use=ce,e.walkTokens=de}(ac)),ac).marked}catch(e){console.log("marked is not supported",e)}const sc=oc,cc=e=>{let{text:t,id:i,testid:r,clientHeight:n}=e;const a=!!n&&n<700,o=Is({tagName:"div",style:{position:"relative",zIndex:"2",width:"100%",minHeight:a?"48px":"70px",textAlign:"center",backgroundColor:"#262626",display:"flex",justifyContent:"center",alignItems:"center"},id:i,testid:r});return Ds(o,rc({text:t,level:a?6:5,style:{color:"white"}})),o};const dc=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","270"),e.setAttribute("height","175"),e.setAttribute("viewBox","40 60 250 140"),e.innerHTML='\n <g transform="matrix(1,0,0,1,0,0)"><g id="12" opacity="1" style="mix-blend-mode:normal"><g><defs><clipPath id="12_clipPath" x="-50%" y="-50%" width="200%" height="200%"><path d="M0,260v-260h333v260z" fill="white" clip-rule="nonzero"></path></clipPath></defs><g clip-path="url(#12_clipPath)"><g transform="matrix(1,0,0,1,48,60)"><g id="83287" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83288" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83288_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij3rlyasnggflf" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83288_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij3rlyasnggflf)"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116.5)"><g id="83289" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83289_fill_path" d="M135,0l-135,23.5h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,2)"><g id="83290" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83290_fill_path" d="M0,2c0,-1 1,-2 2,-2h228c1,0 2,1 2,2v18h-232z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,228.54000000000002,62.99940000000001)"><g id="83291" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83291_fill_path" d="M227,-0.00002l-227,60.99934l226.99998,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,42)"><g id="83292" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83292_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h109c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,143,42)"><g id="83293" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83293_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h65c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,58)"><g id="83294" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83294_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,58)"><g id="83295" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83295_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,194,58)"><g id="83296" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83296_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h14c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,74)"><g id="83297" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83297_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h83c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,117,74)"><g id="83298" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83298_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,165,74)"><g id="83299" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83299_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h43c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,68,92)"><g id="83300" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83300_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,74,92)"><g id="83301" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83301_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,80,92)"><g id="83302" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83302_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,86,92)"><g id="83303" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83303_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,92,92)"><g id="83304" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83304_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,98,92)"><g id="83305" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83305_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,104,92)"><g id="83306" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83306_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,110,92)"><g id="83307" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83307_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,116,92)"><g id="83308" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83308_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,122,92)"><g id="83309" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83309_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,128,92)"><g id="83310" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83310_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,134,92)"><g id="83311" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83311_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,140,92)"><g id="83312" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83312_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,146,92)"><g id="83313" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83313_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,152,92)"><g id="83314" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83314_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,158,92)"><g id="83315" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83315_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,164,92)"><g id="83316" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83316_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,170,92)"><g id="83317" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83317_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116)"><g id="83318" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83318_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,21)"><g id="83320" opacity="0.2" style="mix-blend-mode:normal"><g><g><path id="83320_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g><g transform="matrix(1,0,0,1,48,60)"><g id="83268" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83269" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83269_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij4hmxrv43iz67" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83269_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4hmxrv43iz67)"></path></g></g></g></g><g transform="matrix(1,0,0,1,196,100)"><g id="83270" opacity="0.4" style="mix-blend-mode:normal"><g><g><defs><clipPath id="ligziij4roiiqcgytn" clipPathUnits="userSpaceOnUse"><path d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z"></path></clipPath></defs><path id="83270_stroke_path" d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="10" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4roiiqcgytn)"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,98)"><g id="83271" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83271_fill_path" d="M135,0l-135,40h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,1,1)"><g id="83272" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83272_fill_path" d="M0,2c0,-1 1,-2 2,-2h229c1,0 2,1 2,2v18h-233z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,42,74.4508)"><g id="83273" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83273_fill_path" d="M18.00001,0h-8c-5.5225,0 -10.00001,4.47496 -10.00001,9.99992c0,1.09999 0.895,1.99998 2,1.99998h24.00002c1.1045,0 2,-0.89549 2,-1.99998c0,-5.52496 -4.475,-9.99992 -10.00001,-9.99992z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,47.5999,54.4509)"><g id="83274" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83274_fill_path" d="M17.306,8.653c0,0.9077 -0.1428,1.8102 -0.4232,2.6738c-0.2804,0.8636 -0.6957,1.6778 -1.2296,2.4124c-0.5339,0.7346 -1.1794,1.3801 -1.914,1.914c-0.7346,0.5339 -1.5488,0.9492 -2.4124,1.2296c-0.8636,0.2804 -1.7661,0.4232 -2.6738,0.4232c-0.9077,0 -1.8102,-0.1428 -2.6738,-0.4232c-0.8636,-0.2804 -1.6778,-0.6957 -2.4124,-1.2296c-0.7346,-0.5339 -1.3801,-1.1794 -1.914,-1.914c-0.5339,-0.7346 -0.9492,-1.5488 -1.2296,-2.4124c-0.2804,-0.8636 -0.4232,-1.7661 -0.4232,-2.6738c0,-0.9077 0.1428,-1.8102 0.4232,-2.6738c0.2804,-0.8636 0.6957,-1.6778 1.2296,-2.4124c0.5339,-0.7346 1.1794,-1.3801 1.914,-1.914c0.7346,-0.5339 1.5488,-0.9492 2.4124,-1.2296c0.8636,-0.2804 1.7661,-0.4232 2.6738,-0.4232c0.9077,0 1.8102,0.1428 2.6738,0.4232c0.8636,0.2804 1.6778,0.6957 2.4124,1.2296c0.7346,0.5339 1.3801,1.1794 1.914,1.914c0.5339,0.7346 0.9492,1.5488 1.2296,2.4124c0.2804,0.8636 0.4232,1.7661 0.4232,2.6738z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,32,48)"><g id="83275" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83275_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83275_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,32,94)"><g id="83276" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83276_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83276_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(-1,2.4492935982947064e-16,-2.4492935982947064e-16,-1,79,94)"><g id="83277" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83277_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83277_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,79,48)"><g id="83278" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83278_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83278_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,47)"><g id="83279" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83279_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,47)"><g id="83280" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83280_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,67)"><g id="83281" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83281_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,67)"><g id="83282" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83282_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,87)"><g id="83283" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83283_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,87)"><g id="83284" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83284_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h51c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,137,9)"><g id="83285" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83285_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,92.4999,98.9985)"><g id="83286" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83286_fill_path" d="M90.49994,0l-90.49994,96.99852l90.49994,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,0,20)"><g id="83319" opacity="0" style="mix-blend-mode:normal"><g><g><path id="83319_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g></g></g></g></g><animateTransform href="#83287" attributeName="transform" type="translate" values="118 70;118 70;118 70;118 70;118 70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="scale" values="0 1;0 1;1.02 1;1 1;1 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="translate" values="-118 -70;-118 -70;-118 -70;-118 -70;-118 -70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="0 0;0 0;9.018099999999999 -4;9.018099999999999 -4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.42 0 0.15 1;0.42 0 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="113.5 30.4997;113.5 30.4997;113.5 30.4997;113.5 30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="scale" values="-1 -1;-1 -1;-0.88 -0.88;-0.88 -0.88" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animate href="#83320" attributeName="opacity" values="0.2;0.2;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.39;0.43;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate><animateTransform href="#83268" attributeName="transform" type="translate" values="117 75;117 75;117 75;117 75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="scale" values="1 1;1 1;0 1;0 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="translate" values="-117 -75;-117 -75;-117 -75;-117 -75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animate href="#83271_fill_path" attributeName="d" values="M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,-0.0042l-135.0142,40.0042h135.0142z;M135,-0.0364l-135.1228,40.0364h135.1228z;M135,-0.0975l-135.3292,40.0975h135.3292z;M135,-0.1848l-135.6236,40.1848h135.6236z;M135,-0.2958l-135.9982,40.2958h135.9982z;M135,-0.4285l-136.4462,40.4285h136.4462z;M135,-0.5812l-136.9617,40.5812h136.9617z;M135,-0.7525l-137.5397,40.7525h137.5397z;M135,-0.941l-138.176,40.941h138.176z;M135,-1.1457l-138.8667,41.1457h138.8667z;M135,-1.3655l-139.6085,41.3655h139.6085z;M135,-1.5996l-140.3986,41.5996h140.3986z;M135,-1.8472l-141.2343,41.8472h141.2343z;M135,-2.1077l-142.1134,42.1077h142.1134z;M135,-2.3804l-143.0339,42.3804h143.0339z;M135,-2.6649l-143.994,42.6649h143.994z;M135,-2.9607l-144.9922,42.9607h144.9922z;M135,-3.2673l-146.0272,43.2673h146.0272z;M135,-3.5846l-147.0978,43.5846h147.0978z;M135,-3.9121l-148.2031,43.9121h148.2031z;M135,-4.2497l-149.3424,44.2497h149.3424z;M135,-4.5972l-150.5153,44.5972h150.5153z;M135,-4.9545l-151.7213,44.9545h151.7213z;M135,-5.3218l-152.9607,45.3218h152.9607z;M135,-5.6991l-154.2341,45.6991h154.2341z;M135,-6.0868l-155.5427,46.0868h155.5427z;M135,-6.4858l-156.8893,46.4858h156.8893z;M135,-6.898l-158.2804,46.898h158.2804z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z" dur="2.6s" repeatCount="indefinite" keyTimes="0;0.007692307692307693;0.015384615384615385;0.023076923076923078;0.03076923076923077;0.038461538461538464;0.046153846153846156;0.05384615384615385;0.06153846153846154;0.06923076923076923;0.07692307692307693;0.08461538461538462;0.09230769230769231;0.1;0.1076923076923077;0.11538461538461539;0.12307692307692308;0.13076923076923078;0.13846153846153847;0.14615384615384616;0.15384615384615385;0.16153846153846155;0.16923076923076924;0.17692307692307693;0.18461538461538463;0.19230769230769232;0.2;0.2076923076923077;0.2153846153846154;0.2230769230769231;0.23076923076923078;0.23846153846153847;0.24615384615384617;0.25384615384615383;0.26153846153846155;0.2692307692307692;0.27692307692307694;0.2846153846153846;0.2923076923076923;0.3;0.3076923076923077;0.3153846153846154;0.3230769230769231;0.33076923076923076;0.3384615384615385;0.34615384615384615;0.35384615384615387;0.36153846153846153;0.36923076923076925;0.3769230769230769;0.38461538461538464;0.3923076923076923;0.4;0.4076923076923077;0.4153846153846154;0.4230769230769231;0.4307692307692308;0.43846153846153846;0.4461538461538462;0.45384615384615384;0.46153846153846156;0.46923076923076923;0.47692307692307695;0.4846153846153846;0.49230769230769234;0.5;0.5076923076923077;0.5153846153846153;0.5230769230769231;0.5307692307692308;0.5384615384615384;0.5461538461538461;0.5538461538461539;0.5615384615384615;0.5692307692307692;0.5769230769230769;0.5846153846153846;0.5923076923076923;0.6;0.6076923076923076;0.6153846153846154;0.6230769230769231;0.6307692307692307;0.6384615384615384;0.6461538461538462;0.6538461538461539;0.6615384615384615;0.6692307692307692;0.676923076923077;0.6846153846153846;0.6923076923076923;0.7;0.7076923076923077;0.7153846153846154;0.7230769230769231;0.7307692307692307;0.7384615384615385;0.7461538461538462;0.7538461538461538;0.7615384615384615;0.7692307692307693;0.7769230769230769;0.7846153846153846;0.7923076923076923;0.8;0.8076923076923077;0.8153846153846154;0.823076923076923;0.8307692307692308;0.8384615384615385;0.8461538461538461;0.8538461538461538;0.8615384615384616;0.8692307692307693;0.8769230769230769;0.8846153846153846;0.8923076923076924;0.9;0.9076923076923077;0.9153846153846154;0.9230769230769231;0.9307692307692308;0.9384615384615385;0.9461538461538461;0.9538461538461539;0.9615384615384616;0.9692307692307692;0.9769230769230769;0.9846153846153847;0.9923076923076923;1" fill="freeze"></animate><animateTransform href="#83285" attributeName="transform" type="translate" values="88 2;88 2;88 2;88 2;88 2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="scale" values="0.98 1;0.98 1;1 1;0.96 1;0.96 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="translate" values="-88 -2;-88 -2;-88 -2;-88 -2;-88 -2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewX" values="0;0;-4;-4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewY" values="0;0;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animate href="#83319" attributeName="opacity" values="0;0;0.18;0.18" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.31;0.36;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate>\n ',e}();return t.setAttribute("style","position: absolute; z-index: 1; opacity: 0; transition: opacity 0.5s ease-in-out;"),"document_back"===e&&(t.style.opacity="1",setTimeout((()=>{t.style.opacity="0"}),5e3)),t};var uc;!function(e){e.INVALID="invalid",e.VALID="valid",e.ACCEPTED="accepted",e.REJECTED="rejected"}(uc||(uc={}));const lc="#ED3232",hc="#01B678",fc="#FFF";const pc=e=>{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;return t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t};async function gc(e){let{context:t,onDetect:i,frame:r,showError:n,isSelfie:a=!1}=e;const o=t.state.name;if(o===uc.REJECTED){n(function(e){switch(e){case Yo.DOCUMENT_DETECTION:return"searching_document_autocapture";case Yo.DOCUMENT_POSITION:return"doc_not_in_frame_issues_autocapture";case Yo.BARCODE_DETECTION:return pa.feedback.BARCODE_NOT_FOUND;case Yo.BLUR_DETECTION:return pa.feedback.BLUR;case Yo.GLARE_DETECTION:return pa.feedback.GLARE;case Yo.FACE_DETECTION:return pa.feedback.FACE_NOT_FOUND;case Yo.FACE_POSITION:return pa.feedback.FACE_TOO_SMALL}}(t.invalidFramesCause));mc("border-color",t.invalidFramesCause===Yo.DOCUMENT_DETECTION?fc:lc)}if(o===uc.VALID)if(a){mc("border-color",hc);n(`capturing_face_autocapture${Math.ceil((t.validFramesThreshold-t.validFramesCounter)/t.validFramesThreshold*3)}`)}else n("capturing_in_progress_message"),mc("border-color",fc);o===uc.ACCEPTED&&(mc("border-color",fc),n(null),"function"==typeof navigator.vibrate&&navigator.vibrate(200),await i({frame:r,suspendedPreview:!0,context:t}))}function mc(e,t){document.querySelectorAll('[id^="overlay-frame"]').forEach((i=>{i.style[e]=t}))}function bc(e){let t,i,r,{captureFrame:n,object:a,videoWidth:o,videoHeight:s,deviceWidth:c,deviceHeight:d,threshold:u,iouThreshold:l=.85}=e;if(o/s>=c/d){r=d/s;const e=(o*r-c)/2;t=a.x*r-e,i=a.y*r}else{r=c/o;const e=(s*r-d)/2;t=a.x*r,i=a.y*r-e}const h=t+a.width*r,f=i+a.height*r;!function(e,t,i,r){var n,a;if(null===(a=null===(n=Zo.state.autoCaptureSettings)||void 0===n?void 0:n.settings)||void 0===a?void 0:a.debug){const n=document.getElementById("image-preview-section"),a=document.getElementById("rectangle");if(a)a.style.width=`${i}px`,a.style.height=`${r}px`,a.style.left=`${e}px`,a.style.top=`${t}px`;else{const a=document.createElement("div");a.id="rectangle",a.style.position="absolute",a.style.border="1px solid yellow",a.style.width=`${i}px`,a.style.height=`${r}px`,a.style.left=`${e}px`,a.style.top=`${t}px`,n.appendChild(a)}}}(t,i,a.width*r,a.height*r);const p=function(e,t){const i=Math.max(e.left,t.left),r=Math.min(e.right,t.right),n=Math.max(e.top,t.top),a=r-i,o=Math.min(e.bottom,t.bottom)-n;if(a<=0||o<=0)return 0;const s=a*o;return s/((e.right-e.left)*(e.bottom-e.top)+(t.right-t.left)*(t.bottom-t.top)-s)}({top:n.top,left:n.left,bottom:n.bottom,right:n.right},{top:i,left:t,bottom:f,right:h}),g=p>l,m=a.width*r*(a.height*r)>u*(n.width*n.height);return g&&m}const vc=()=>{const e=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M10.7202 25.9524C9.81992 25.9524 9.08331 25.2158 9.08331 24.3155V11.2202C9.08331 10.3199 9.81992 9.58333 10.7202 9.58333C11.6205 9.58333 12.3571 10.3199 12.3571 11.2202V20.6938C16.3675 14.0337 23.662 9.58333 32 9.58333C44.6553 9.58333 54.9166 19.8447 54.9166 32.5C54.9166 45.1553 44.6553 55.4167 32 55.4167C23.8257 55.4167 16.654 51.1403 12.5924 44.6949C11.9274 43.631 12.7357 42.3214 13.994 42.3214C14.6079 42.3214 15.1603 42.6488 15.4979 43.1603C18.9968 48.5621 25.0841 52.1429 32 52.1429C42.8445 52.1429 51.6428 43.3445 51.6428 32.5C51.6428 21.6555 42.8445 12.8571 32 12.8571C24.726 12.8571 18.383 16.8062 14.9864 22.6786H23.8155C24.7158 22.6786 25.4524 23.4152 25.4524 24.3155C25.4524 25.2158 24.7158 25.9524 23.8155 25.9524H10.7202Z" fill="#FF8B8B"/> \n ',e}(),t=Is({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"retake-image",testid:"retake-image"});return Ds(t,e),Ds(t,rc({text:"Retake",level:2,style:{color:"#FF8B8B",margin:"0",width:"100%"},id:"retake-image-text"})),t};const yc=()=>{const e=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M32.5 8.66666C38.6884 8.66666 44.6233 11.125 48.9992 15.5008C53.375 19.8767 55.8333 25.8116 55.8333 32C55.8333 38.1884 53.375 44.1233 48.9992 48.4992C44.6233 52.875 38.6884 55.3333 32.5 55.3333C26.3116 55.3333 20.3767 52.875 16.0009 48.4992C11.625 44.1233 9.16668 38.1884 9.16668 32C9.16668 25.8116 11.625 19.8767 16.0009 15.5008C20.3767 11.125 26.3116 8.66666 32.5 8.66666ZM32.5 58.6667C39.5725 58.6667 46.3552 55.8572 51.3562 50.8562C56.3572 45.8552 59.1667 39.0724 59.1667 32C59.1667 24.9276 56.3572 18.1448 51.3562 13.1438C46.3552 8.14284 39.5725 5.33333 32.5 5.33333C25.4276 5.33333 18.6448 8.14284 13.6438 13.1438C8.64286 18.1448 5.83334 24.9276 5.83334 32C5.83334 39.0724 8.64286 45.8552 13.6438 50.8562C18.6448 55.8572 25.4276 58.6667 32.5 58.6667ZM43.6771 26.5104C44.3229 25.8646 44.3229 24.8021 43.6771 24.1562C43.0313 23.5104 41.9688 23.5104 41.3229 24.1562L29.1667 36.3125L23.6771 30.8229C23.0313 30.1771 21.9688 30.1771 21.3229 30.8229C20.6771 31.4687 20.6771 32.5312 21.3229 33.1771L27.9896 39.8437C28.6354 40.4896 29.6979 40.4896 30.3438 39.8437L43.6771 26.5104Z" fill="#BBF7DD"/>\n ',e}(),t=Is({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"approve-image",testid:"approve-image"});return Ds(t,e),Ds(t,rc({text:"Approve",level:2,style:{color:"#BBF7DD",margin:"0",width:"100%"},id:"check-circle-text"})),t},_c=e=>{let{step:t,setImage:i,camera:r}=e;var n,a,o,s;const c=Qs[t];(null===(n=Zo.state.autoCaptureSettings)||void 0===n?void 0:n.enabled)&&"selfie"===t&&(c.instructions="second_title_face_autocapture");const d=((e,t)=>Is({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"document-capture",className:t}))("document-capture",t),u=Is({tagName:"div",style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},id:"camera-hint-section",testid:"camera-hint-section"}),l=Is({tagName:"div",style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"80%"},id:"central-container",testid:"central-container"}),h=document.getElementById(Zo.state.rootElementId);if(!h)throw new Error("Root element not found");const f=Xs(Os(t),h);Ds(u,dc(t)),Ds(u,f);const p=(()=>{const e=Is({tagName:"div",style:{zIndex:"2",width:"80%",height:"50px",color:"white",display:"flex",alignItems:"center",backgroundColor:"#2E2E2E",justifyContent:"center",opacity:".9"},id:"loading-block",testid:"loading-block"}),t=tc();return t.style.width="16px",t.style.height="16px",t.style.margin="0 10px",Ds(e,t),Ds(e,rc({text:"This may take a few seconds",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-loading-message"})),e})();Ds(f,p),p.style.visibility="hidden";const g=cc({text:Rs.translate(c.page),id:"page-header",testid:"page-header",clientHeight:h.clientHeight}),m=(e=>{let{click:t,id:i,testid:r,color:n,withLoader:a}=e;if(a){const e=ec();e.style.position="absolute",e.style.left="-7px",e.style.top="-7px",e.style.height="63px",e.style.width="63px";const a=Is({tagName:"button",style:{position:"relative",width:"49px",height:"49px",backgroundColor:n||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:i+"-inner",testid:r+"-inner"});return Ds(a,e),a.addEventListener("click",t),a}{const e=Is({tagName:"button",style:{width:"65px",height:"65px",zIndex:"1",backgroundColor:"black",padding:"0",border:"solid 5px "+(n||"white"),borderRadius:"40px"},id:i+"-outer",testid:r+"-outer"});return Ds(e,Is({tagName:"div",style:{width:"49px",height:"49px",backgroundColor:n||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:i+"-inner",testid:r+"-inner"})),e.addEventListener("click",t),e}})({click:()=>i({frame:pc(r.videoElement),suspendedPreview:!1}),id:"submit-image",testid:"submit-image",withLoader:null===(o=null===(a=Zo.state)||void 0===a?void 0:a.autoCaptureSettings)||void 0===o?void 0:o.enabled}),b=(()=>{const e=Is({tagName:"div",style:{zIndex:"2",width:"70%",paddingBottom:"30px",alignItems:"center",backgroundColor:"transparent",justifyContent:"space-between",display:"none"},id:"approve-retake-block",testid:"approve-retake-block"}),t=yc();return Ds(e,vc()),Ds(e,t),e})(),v=(e=>{let{title:t,text:i,clientHeight:r,customTextColor:n}=e;const a=r<700,o=Is({tagName:"div",style:{position:"relative",zIndex:"2",padding:"0 25px",margin:a?"8px 0":"32px 0"},id:"page-info",testid:"page-info"}),s=rc({text:t,level:a?2:1,style:{color:n||"white",textAlign:"center",marginBottom:a?"4px":"10px"},id:"step-title"}),c=rc({text:i,level:a?6:5,style:{color:n||"white",textAlign:"center",height:"35px"},id:"step-instructions"});return Ds(o,s),Ds(o,c),o})({text:Rs.translate(c.instructions),title:Rs.translate(c.title),clientHeight:h.clientHeight}),y=(e=>{const t=e<700,i=Is({tagName:"div",style:{zIndex:"2",width:"85%",display:"flex",flexDirection:Zo.state.markdownSupportText?"column":"row",backgroundColor:"#2E2E2E",borderRadius:"4px",padding:"12px",visibility:"hidden",marginTop:"16px"},id:"error-block",testid:"error-block"}),r=Is({tagName:"div",style:{display:"flex",flexDirection:"row",width:"100%",height:"inherit",alignItems:"center",paddingTop:"25px"},id:"image-error-block",testid:"image-error-block"}),n=tc();n.style.width="16px",n.style.height="16px",n.style.margin="0 10px",Zo.state.markdownSupportText?Ds(r,n):Ds(i,n);const a=Zo.state.markdownSupportText&&null!=sc?sc.parse(Zo.state.markdownSupportText,{async:!1}):"",o=rc({text:"",level:t?6:5,style:{color:"white",margin:"0",width:"85%",fontWeight:"400",height:"fit-content"},id:"image-error-message"}),s=rc({text:"",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-error-support-message"});return a&&(s.innerHTML=a,Ds(r,o)),Ds(i,a?[r,s]:o),i})(h.clientHeight),_=(null===(s=Zo.state.autoCaptureSettings)||void 0===s?void 0:s.enabled)?ec():function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","65"),e.setAttribute("height","65"),e.setAttribute("viewBox","0 0 24 24"),e.innerHTML='\n <path fill="#ffffff" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path fill="#ffffff" d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"><animateTransform attributeName="transform" type="rotate" dur="0.75s" values="0 12 12;360 12 12" repeatCount="indefinite"/></path>\n ',e}();_.style.display="none",Ds(l,g),Ds(l,v),Ds(l,u),Ds(l,y),Ds(d,l);const w=Is({tagName:"div",style:{width:"100%",margin:"10%",zIndex:"1",display:"flex",justifyContent:"center"},id:"trigger-section",testid:"trigger-section"});Ds(w,_),Ds(w,m),Ds(w,b),Ds(d,w),Ds(d,r.videoElement);const x=Is({tagName:"img",style:{display:"block",position:"absolute",objectFit:"cover",height:"100%",width:"100%",transform:"user"===Os(t)?"scaleX(-1)":""},id:"image-preview",testid:"image-preview"});const A=(e=>{const t=Is({tagName:"div",style:{position:"absolute",height:"100%",width:"100%",objectFit:"cover"},id:"image-preview-section",testid:"image-preview-section"});return t.appendChild(e),t})(x);return Ds(d,A),{component:d,setLoadingMode:e=>{var t;m.style.display="none",y.style.visibility="hidden",_.style.display="block",(null===(t=Zo.state.autoCaptureSettings)||void 0===t?void 0:t.enabled)&&(_.style.height="63px",_.style.width="63px"),e&&(p.style.visibility="visible")},setApprovalRetakeButtons:e=>{let{approveAction:t,retakeAction:i}=e;var r,n;m.style.display="none",y.style.display="none",b.style.display="flex";const a=b.querySelector("#approve-image"),o=b.querySelector("#retake-image"),s=a.cloneNode(!0);null===(r=a.parentNode)||void 0===r||r.replaceChild(s,a),s.addEventListener("click",t);const c=o.cloneNode(!0);null===(n=o.parentNode)||void 0===n||n.replaceChild(c,o),c.addEventListener("click",i)},hideApprovalRetakeButtons:()=>{b.style.display="none",y.style.display="flex"},setPreviewImage:(e,t)=>{x.src=e,p.style.visibility="hidden",r.videoElement.style.display="none",m.style.display="none",y.style.visibility="hidden",A.style.display="block",_.style.display=t?"none":"block"},setLoadingComplete:()=>{_.style.display="none",p.style.visibility="hidden"},setAutoCapturingError:(e,t)=>{if(!e)return void(y.style.visibility="hidden");let i;i=e==pa.feedback.RESTRICTED_CRITERIA&&t?t:Ys[e]?Ys[e].message:Rs.translate(e)!==e?e:Ys.other.message,document.getElementById("image-error-message").innerHTML=Rs.translate(i),y.style.visibility="visible"},enableVideoElement:()=>{m.style.display="block",r.videoElement.style.display="block",A.style.display="none",_.style.display="none"},setCapturingShowErrorMode:(e,t)=>{m.style.display="block",A.style.display="none",r.videoElement.style.display="block";const i=e==pa.feedback.RESTRICTED_CRITERIA,n=Ys[e]||Ys.other;document.getElementById("image-error-message").innerHTML=t&&i&&null!=sc?sc.parse(t,{async:!1}):Rs.translate(n.message),y.style.visibility="visible",p.style.visibility="hidden"},setTitleInstructionsMidStep:e=>{let{title:t,instructions:i}=e;t&&(document.getElementById("step-title").innerHTML=Rs.translate(t)),i&&(document.getElementById("step-instructions").innerHTML=Rs.translate(i))}}};class wc{constructor(){this.isValid=!0,this.failedStep=null,this.steps=[]}addStepResponse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t||(this.isValid=!1,this.failedStep=e),this.steps.push(new xc(e,t,i))}}class xc{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.duration=0,this.success=!0,this.step=e,this.success=t,this.duration=i}}class Ac{constructor(){this.name=uc.ACCEPTED}async handleFrame(){return new wc}}class Ec{constructor(){this.name=uc.VALID}async handleFrame(e){let{context:t,frame:i,deviceInfo:r,detectionStrategy:n}=e;const a=await n.validate({frame:i,deviceInfo:r});return a.isValid?(t.validFramesCounter++,t.validFramesCounter>=t.validFramesThreshold&&t.setState(new Ac)):(t.validFramesCounter=0,t.invalidFramesCounter=1,t.invalidFramesCause=a.failedStep,t.setState(new kc)),a}}class Sc{constructor(){this.name=uc.REJECTED}async handleFrame(e){let{context:t,frame:i,detectionStrategy:r,deviceInfo:n}=e;const a=await r.validate({frame:i,deviceInfo:n});return a.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Ec),a):t.invalidFramesCause!==a.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=a.failedStep,t.setState(new kc),a):(t.invalidFramesCounter++,a)}}class kc{constructor(){this.name=uc.INVALID}async handleFrame(e){let{context:t,frame:i,detectionStrategy:r,deviceInfo:n}=e;const a=await r.validate({frame:i,deviceInfo:n});return a.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Ec)):t.invalidFramesCause!==a.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=a.failedStep):(t.invalidFramesCounter++,t.invalidFramesCounter>=t.invalidFramesThreshold&&t.setState(new Sc)),a}}class Mc{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;this.detectionStrategy=e,this.state=new kc,this.validFramesCounter=0,this.invalidFramesCounter=0,this.invalidFramesCause=null,this.validFramesThreshold=t,this.invalidFramesThreshold=i}setState(e){this.state=e}async handleFrame(e){let{frame:t,deviceInfo:i}=e;return await this.state.handleFrame({context:this,frame:t,deviceInfo:i,detectionStrategy:this.detectionStrategy})}}async function Cc(e,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const o=Ic(i,n,a),s=await new Promise(((n,a)=>{navigator.serviceWorker.ready.then((s=>{var c;const d=t=>{t.data.type===e+"_RESULT"&&(navigator.serviceWorker.removeEventListener("message",d),n(t.data.result)),t.data.type===e+"_ERROR"&&(navigator.serviceWorker.removeEventListener("message",d),as(t.data.error.toString(),e,"error"),a(t.data.error))};navigator.serviceWorker.addEventListener("message",d),null===(c=s.active)||void 0===c||c.postMessage(t({type:e,imageData:o,height:i.height,width:i.width},r))}))}));return ss(`****** in web-SDK return result for ${e}`,s),s}function Ic(e,t,i){const r=document.createElement("canvas"),n=t||{height:e.height,width:e.width},a=r.getContext("2d");r.width=n.width,r.height=n.height,i?null==a||a.drawImage(e,i.x,i.y,i.width,i.height,0,0,n.width,n.height):null==a||a.drawImage(e,0,0,n.width,n.height);const o=null==a?void 0:a.getImageData(0,0,n.width,n.height);return r.remove(),o}async function Dc(e){if(e instanceof HTMLVideoElement&&e.paused)return[];return Cc("DETECT_DOCUMENT",e,{},hs[cs.DOCUMENT_DETECTOR].imageDimensions)}async function Tc(e,t){return Cc("BLUR_GLARE_CLASSIFY",e,{},hs[cs.BLUR_GLARE_CLASSIFIER].imageDimensions,t)}const Rc=function(){try{return new us}catch(e){return ss("Error initializing barcode model",e),as("Error initializing barcode model","barcode_model_not_supported","init"),null}}();class Bc{constructor(e){this.barcodeModel=null,this.hasBarcode=e,this.barcodeModel=Rc}async validate(e){let{frame:t,deviceInfo:i}=e;var r;const n=new wc;let a=Date.now();const o=null===(r=await Dc(t))||void 0===r?void 0:r[0];let s=Date.now()-a;if(n.addStepResponse(Yo.DOCUMENT_DETECTION,void 0!==o,s),!o)return n;a=Date.now();const c=bc({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:o,videoWidth:t.width,videoHeight:t.height,deviceWidth:i.width,deviceHeight:i.height,threshold:Zo.state.autoCaptureSettings.settings.capture.documentBackSizeThreshold,iouThreshold:Zo.state.autoCaptureSettings.settings.capture.documentBackIouThreshold});if(s=Date.now()-a,n.addStepResponse(Yo.DOCUMENT_POSITION,c,s),!c)return n;a=Date.now();const d=await Tc(t,o);s=Date.now()-a;const u=d.some((e=>"blur"===e.class));if(n.addStepResponse(Yo.BLUR_DETECTION,!u,s),u)return n;const l=d.some((e=>"glare"===e.class));if(n.addStepResponse(Yo.GLARE_DETECTION,!l,s),l)return n;if(this.barcodeModel&&this.hasBarcode){a=Date.now();const e=await this.barcodeModel.detect(t);s=Date.now()-a;const i=(null==e?void 0:e.length)>0;if(n.addStepResponse(Yo.BARCODE_DETECTION,i,s),!i)return n}return n}}class zc{constructor(){this.durations=[],this.countSuccess=0,this.countFailed=0}}class Pc{constructor(){this.frameHandleDurations=[],this.stableCounts=[0],this.stats=new Map,Object.values(Yo).forEach((e=>{this.stats.set(e,new zc)}))}addStats(e,t){this.frameHandleDurations.push(t),e.isValid?this.stableCounts[this.stableCounts.length-1]++:this.stableCounts.push(0),e.steps.forEach((e=>{this.addStat(e.step,e.duration,e.success?1:0,e.success?0:1)}))}addStat(e,t,i,r){const n=this.stats.get(e);if(!n)throw new Error(`Stat for step ${e} not found`);n.durations.push(t),n.countSuccess+=i,n.countFailed+=r}}let Oc=!1;const Fc=e=>{Oc=e};class Nc{async validate(e){let{frame:t,deviceInfo:i}=e;var r;const n=new wc;let a=Date.now();const o=null===(r=await Dc(t))||void 0===r?void 0:r[0];let s=Date.now()-a;if(n.addStepResponse(Yo.DOCUMENT_DETECTION,void 0!==o,s),!o)return n;a=Date.now();const c=bc({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:o,videoWidth:t.width,videoHeight:t.height,deviceWidth:i.width,deviceHeight:i.height,threshold:Zo.state.autoCaptureSettings.settings.capture.documentFrontSizeThreshold,iouThreshold:Zo.state.autoCaptureSettings.settings.capture.documentFrontIouThreshold});if(s=Date.now()-a,n.addStepResponse(Yo.DOCUMENT_POSITION,c,s),!c)return n;a=Date.now();const d=await Tc(t,o);s=Date.now()-a;const u=d.some((e=>"blur"===e.class));if(n.addStepResponse(Yo.BLUR_DETECTION,!u,s),u)return n;const l=d.some((e=>"glare"===e.class));return n.addStepResponse(Yo.GLARE_DETECTION,!l,s),n}}let Lc=!1;const jc=e=>{Lc=e};class Uc{async validate(e){let{frame:t,deviceInfo:i}=e;var r;const n=new wc;let a=Date.now();const o=null===(r=await async function(e){return e instanceof HTMLVideoElement&&e.paused?[]:Cc("DETECT_FACE_LANDMARKS",e)}(t))||void 0===r?void 0:r[0];let s=Date.now()-a;if(n.addStepResponse(Yo.FACE_DETECTION,"face"===(null==o?void 0:o.class),s),!o)return n;a=Date.now();const c=bc({captureFrame:document.getElementById("overlay-frame user").getBoundingClientRect(),object:o,videoWidth:t.width,videoHeight:t.height,deviceWidth:i.width,deviceHeight:i.height,threshold:Zo.state.autoCaptureSettings.settings.faceDetector.selfieSizeThreshold,iouThreshold:Zo.state.autoCaptureSettings.settings.faceDetector.selfieIouThreshold});return s=Date.now()-a,n.addStepResponse(Yo.FACE_POSITION,c,s),n}}let qc=!1;const Kc=e=>{qc=e};async function Hc(e,t){var i,r,n,a;let o="camera-error";if("NotAllowedError"===t.name){o="Permission dismissed"===t.message?"camera-permission-dismissed":"camera-permission-denied";const s=is.createCameraNotAllowedEvent(t.message,e);await rs(null===(i=Zo.state)||void 0===i?void 0:i.step,null===(r=Zo.state)||void 0===r?void 0:r.userToken,null===(n=Zo.state)||void 0===n?void 0:n.sessionId,null===(a=Zo.state)||void 0===a?void 0:a.clientId,s),Zo.dispatch("setIsCapturingProcessStarted",!1)}Ho(e,o)}function Vc(e){const t=(e=>{var t,i,r,n;const[a,o]=e.split(",");if(!a||!o)throw new Error("unable-to-parse-data-uri");const s=null===(r=null===(i=null===(t=a.split(";"))||void 0===t?void 0:t[0])||void 0===i?void 0:i.split(":"))||void 0===r?void 0:r[1];if(!s)throw new Error("unable-to-parse-data-uri");const c=null===(n=s.split("/"))||void 0===n?void 0:n[1];if(!c)throw new Error("unable-to-parse-data-uri");return{data:o,format:c}})(e);return{image:{data:t.data,format:t.format,captureMargins:Ps()}}}let $c=!1;const Jc=async()=>{const e=await Ss(Zo.state.sessionId,Zo.state.userToken,Zo.state.clientId);Gc(e)},Gc=async e=>{var t;"expired"===(null==e?void 0:e.status)?Vo("processing","session-expired",`Session expired for session id: ${Zo.state.sessionId}`):(null==e?void 0:e.missing_images)&&(null===(t=null==e?void 0:e.missing_images)||void 0===t?void 0:t.length)>0&&setTimeout(Jc,3e3)},Wc=e=>{let{step:t}=e;var i,r,n;const a=null===(r=null===(i=Zo.state)||void 0===i?void 0:i.autoCaptureSettings)||void 0===r?void 0:r.enabled;let o=!1;const s=null===(n=Zo.state)||void 0===n?void 0:n.videoCaptureSettings,c=(e=>{let t,i,r=!1;const n=Ws(e),a=new js(n),o=async()=>{r&&(await a.stopCamera(),a.stream&&a.stream.getTracks().forEach((e=>{"live"==e.readyState&&e.stop()})),r=!1)};return{videoStream:i,startVideoFeed:async e=>{var n,s,c;r&&await o(),"environment"==e&&(t=await Ks());const d=null!==(s=null===(n=null==t?void 0:t.selectedCamera)||void 0===n?void 0:n.deviceId)&&void 0!==s?s:e,u=Gs(e,null===(c=Zo.state)||void 0===c?void 0:c.videoCaptureSettings);Us.getInstance().stopStream(),i=await a.startCamera(d,u),r=!0},stopVideoFeed:o,videoElement:a.videoElement,getDataUri:a.getDataUri,getCameraInfo:()=>t}})(Os(t));!function(e){qo({type:"page-load",step:e})}(t),Jc();const d=_c({step:t,setImage:u,camera:c});async function u(e){let{suspendedPreview:i=!1,frame:r,context:n}=e;r||(r=pc(c.videoElement)),"document_front"===t&&jc(!1),"document_back"===t&&Fc(!1),"selfie"===t&&Kc(!1);const a=Date.now(),u=function(e){const t=e.getCameraInfo();return{selectedCamera:(null==t?void 0:t.selectedCamera)&&{label:t.selectedCamera.label},camerasInfo:(null==t?void 0:t.optionalCameras)&&t.optionalCameras.map((e=>({label:e.label})))}}(c);if(!o)return;d.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(e=>e.toDataURL("image/jpeg"))(r);d.setPreviewImage(f,"selfie"===t),await c.stopVideoFeed(),"selfie"!==t?await h(i,f,u,a,null==n?void 0:n.stats):(d.setTitleInstructionsMidStep({instructions:"selfie_approval_autocapture"}),d.setApprovalRetakeButtons({approveAction:async()=>{d.hideApprovalRetakeButtons(),await h(i,f,u,a,null==n?void 0:n.stats)},retakeAction:()=>{d.hideApprovalRetakeButtons(),l()}}))}function l(){"selfie"===t&&d.setTitleInstructionsMidStep({instructions:"second_title_face_autocapture"}),c.startVideoFeed(Os(t)).then((()=>{o=!0,d.enableVideoElement(),a&&(d.setAutoCapturingError(null),f(t))})).catch((async e=>{throw await Hc(t,e),e}))}async function h(e,i,r,n,u){const h=[];!function(e){var i,r,n,a;const o=is.createUserActionEvent("capture_image",t,e);rs(null===(i=Zo.state)||void 0===i?void 0:i.step,null===(r=Zo.state)||void 0===r?void 0:r.userToken,null===(n=Zo.state)||void 0===n?void 0:n.sessionId,null===(a=Zo.state)||void 0===a?void 0:a.clientId,o)}(u),function(e,t){qo({type:"capture-image",imageType:t,step:e})}(t,Fs(t));try{const c=Date.now(),u=Vc(i);o=!1,h.push(zs(Zo.state.sessionId,Zo.state.userToken,Zo.state.clientId,null==u?void 0:u.image,r,Fs(t))),h.push(e?new Promise((e=>setTimeout(e,500))):Promise.resolve(null)),d.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(await Promise.all(h))[0];if(Object.prototype.hasOwnProperty.call(f,"has_barcode")&&($c=f.has_barcode),async function(e){let{step:t,requestStartTime:i,imageProcessingStartTime:r,serverProcessingTime:n,userToken:a,sessionId:o,clientId:s}=e;const c=Date.now()-i,d=r?i-r:0,u=is.createUploadImageEvent(t,String(c),String(n),String(d));await rs(t,a,o,s,u)}({step:t,requestStartTime:c,imageProcessingStartTime:n,serverProcessingTime:f.serverProcessingTime,userToken:Zo.state.userToken,sessionId:Zo.state.sessionId,clientId:Zo.state.clientId}),Zo.dispatch("setMissingImages",f.missing_images),d.setLoadingComplete(),function(e,t,i){qo({type:"capture-image-result",imageType:t,feedback:i,step:e})}(t,Fs(t),f.feedback),"ok"!==f.feedback)return await async function(e){mc("border-color",lc),a?d.setAutoCapturingError(e.feedback,e.custom_feedback):d.setCapturingShowErrorMode(e.feedback,e.custom_feedback),await new Promise((e=>setTimeout(e,1e3))),mc("border-color",fc)}(f),void l();mc("border-color",hc),await new Promise((e=>setTimeout(e,750))),mc("border-color",fc),Zo.dispatch("setStep",(e=>{let t;return t=e&&e.length>0?e.shift():"processing",t})(Zo.state.missingImages))}catch(e){d.setLoadingComplete(),d.setCapturingShowErrorMode(pa.feedback.OTHER),c.startVideoFeed(Os(t)).then((()=>{o=!0})).catch((async e=>{throw await Hc(t,e),e})),Ho(t,"failed-to-submit-image")}}async function f(e){if("document_front"===e){for(;!o||c.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return c.videoElement.onloadedmetadata=()=>{var e;ss("video dimensions (width, height, orientation): ",c.videoElement.videoWidth,c.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:i,showError:r}=e;var n,a,o,s,c,d,u;const l=new Mc(new Nc,null!==(o=null===(a=null===(n=Zo.state.autoCaptureSettings.settings)||void 0===n?void 0:n.stability)||void 0===a?void 0:a.numStableFrames)&&void 0!==o?o:2),h=new Pc;for(jc(!0);l.state.name!==uc.ACCEPTED&&Lc;){const e=Date.now(),n=pc(t.videoElement),a={width:null!==(c=null===(s=t.videoElement.getBoundingClientRect())||void 0===s?void 0:s.width)&&void 0!==c?c:0,height:null!==(u=null===(d=t.videoElement.getBoundingClientRect())||void 0===d?void 0:d.height)&&void 0!==u?u:0},o=await l.handleFrame({frame:n,deviceInfo:a}),f=Date.now()-e+50;h.addStats(o,f),l.stats=h,await gc({context:l,onDetect:i,showError:r,frame:n}),await new Promise((e=>setTimeout(e,50)))}}({camera:c,onDetect:u,showError:d.setAutoCapturingError})}if("document_back"===e){for(;!o||c.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return c.videoElement.onloadedmetadata=()=>{var e;ss("video dimensions (width, height, orientation): ",c.videoElement.videoWidth,c.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:i,showError:r,hasBarcode:n}=e;var a,o,s,c,d,u,l;const h=new Mc(new Bc(n),null!==(s=null===(o=null===(a=Zo.state.autoCaptureSettings.settings)||void 0===a?void 0:a.stability)||void 0===o?void 0:o.numStableFrames)&&void 0!==s?s:2);Fc(!0);const f=new Pc;for(;h.state.name!==uc.ACCEPTED&&Oc;){const e=Date.now(),n=pc(t.videoElement),a={width:null!==(d=null===(c=t.videoElement.getBoundingClientRect())||void 0===c?void 0:c.width)&&void 0!==d?d:0,height:null!==(l=null===(u=t.videoElement.getBoundingClientRect())||void 0===u?void 0:u.height)&&void 0!==l?l:0},o=await h.handleFrame({frame:n,deviceInfo:a}),s=Date.now()-e+50;f.addStats(o,s),h.stats=f,await gc({context:h,onDetect:i,showError:r,frame:n}),await new Promise((e=>setTimeout(e,50)))}}({camera:c,onDetect:u,showError:d.setAutoCapturingError,hasBarcode:$c})}if("selfie"===e){for(;!o||c.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return c.videoElement.onloadedmetadata=()=>{var e;ss("video dimensions (width, height, orientation): ",c.videoElement.videoWidth,c.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:i,showError:r}=e;var n,a,o,s;const c=new Mc(new Uc,30);Kc(!0);const d=new Pc;for(;c.state.name!==uc.ACCEPTED&&qc;){const e=Date.now(),u=pc(t.videoElement),l={width:null!==(a=null===(n=t.videoElement.getBoundingClientRect())||void 0===n?void 0:n.width)&&void 0!==a?a:0,height:null!==(s=null===(o=t.videoElement.getBoundingClientRect())||void 0===o?void 0:o.height)&&void 0!==s?s:0},h=await c.handleFrame({frame:u,deviceInfo:l}),f=Date.now()-e;d.addStats(h,f),c.stats=d,await gc({context:c,onDetect:i,showError:r,frame:u,isSelfie:!0}),await new Promise((e=>setTimeout(e,50)))}}({camera:c,onDetect:u,showError:d.setAutoCapturingError})}}return a&&f(t),(async e=>{var t,i,r,n;const a=is.createPageViewEvent(e);await rs(null===(t=Zo.state)||void 0===t?void 0:t.step,null===(i=Zo.state)||void 0===i?void 0:i.userToken,null===(r=Zo.state)||void 0===r?void 0:r.sessionId,null===(n=Zo.state)||void 0===n?void 0:n.clientId,a)})(t),c.startVideoFeed(Os(t)).then((()=>{o=!0})).catch((async e=>{throw await Hc(t,e),e})),d.component},Zc=()=>{qo({type:"start-verification-processing",step:Zo.state.step}),Ko("processing","processing",Zo.state.sessionId);const e=Yc("processing-verification");Ds(e,cc({text:"Processing Verification",id:"processing-verification-header",testid:"processing-verification-header"}));const t=async()=>{const e=await Ss(Zo.state.sessionId,Zo.state.userToken,Zo.state.clientId);n(e)},i=()=>{setTimeout(t,3e3)},r=async e=>{Zo.dispatch("setStep",e.status),Zo.dispatch("setStatus",e.status)},n=async e=>{var t,n;if(Zo.dispatch("setMissingImages",e.missing_images),e.status)if("complete"===(null==e?void 0:e.status)){Us.getInstance().stopStream();const i=is.createProcessingCompleteEvent();await rs(Zo.state.step,Zo.state.userToken,null===(t=Zo.state)||void 0===t?void 0:t.sessionId,null===(n=Zo.state)||void 0===n?void 0:n.clientId,i),r(e),Ko("complete",e.status,Zo.state.sessionId),function(e,t,i){qo({type:"verification-complete",step:e,sessionId:t,callbackUrl:i})}("complete",Zo.state.sessionId,e.callback_url),function(e){sessionStorage.removeItem(e)}(No)}else"recapture"===(null==e?void 0:e.status)?(r(e),Zo.dispatch("setIsCapturingProcessStarted",!1),Ko("recapture",e.status,Zo.state.sessionId),function(e,t,i){qo({type:"verification-recapture",step:e,sessionId:t,reason:i})}("recapture",e.status,e.recapture_reason)):"expired"===(null==e?void 0:e.status)?Vo("processing","session-expired",`Session expired for session id: ${Zo.state.sessionId}`):i();else"processing"!==e.state&&(r(e),i())};return t(),e},Yc=e=>Is({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"processing-verification"});function Qc(e,t){var i;if(!e)return;null===(i=t.firstChild)||void 0===i||i.remove();const r=function(e){switch(e){case"processing":return Zc;case"document_front":case"document_back":case"selfie":return Wc;default:throw new Error("Invalid step")}}(e);Ds(t,r({step:e}))}function Xc(e){let{key:t,state:i}=e;const r=i.rootElementId,n=document.getElementById(r);"step"===t&&"complete"!==i.step&&"recapture"!==i.step&&Qc(i.step,n),n&&"processing"===i.step&&(n.style.visibility="hidden")}function ed(){const e=ks(Lo(No));if(!ks)throw console.log("Error restarting session, stored session data is invalid or missing"),new Error("Error restarting session, stored session data is invalid or missing");const t=e.sessionId,i=e.userToken;return Zo.dispatch("setSessionId",t),Zo.dispatch("setUserToken",i),{sessionId:t,userToken:i}}async function td(){var e,t;if(null===(e=Zo.state.autoCaptureSettings)||void 0===e?void 0:e.enabled){const e=Date.now();try{await nd(),ss("all models loaded - auto-capture enabled")}catch(e){Zo.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:null===(t=Zo.state.autoCaptureSettings)||void 0===t?void 0:t.settings}),ss("Model loading did not complete on time:",e);as(`timed out loading models: ${fs.filter((e=>hs[e].status!==ls.LOADED)).map((e=>e)).join(", ")}`,"model_load_timeout","init")}const i=Object.values(hs).filter((e=>e.status===ls.LOADED)).map((e=>e.loadingStats));!async function(e,t){const i=is.createSdkInitEvent(e,t);await os("init",i)}(Date.now()-e,i)}}async function id(e){var i;try{await Us.getInstance().startNewStream({video:t(t({},Gs("environment",null===(i=Zo.state)||void 0===i?void 0:i.videoCaptureSettings)),{},{deviceId:await Js("environment")})}),function(e,t){qo({type:"session-id-acquired",step:e,sessionId:t})}("init",e),function(e,t,i){const r=document.getElementById(i);r.style.visibility="visible",Qc(e.shift(),r)}(Zo.state.missingImages,Zo.state.sessionId,Zo.state.rootElementId)}catch(e){await Hc("init",e)}}async function rd(e){let{status:t,sessionId:i,userToken:r,missingImages:n,rootElementId:a,language:o}=e;!function(e,t){qo({type:"session-granted",step:e,sessionId:t})}("init",i),Zo.dispatch("setStatus",t),Zo.dispatch("setSessionId",i),Zo.dispatch("setUserToken",r),Zo.dispatch("setMissingImages",n),Zo.dispatch("setRootElement",a),Zo.dispatch("setLanguage",o),async function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";Rs.overrideLanguage(Bs[i]||Bs.en);let r=document.getElementById(t);if(!r){r=Is({tagName:"div",style:{background:"#fff",position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%",font:"inherit"},id:t,testid:"root"});const e=document.createElement("style");e.innerHTML=`\n @media only screen and (max-height: 576px) {\n #${t} #trigger-section {\n margin: 0 !important;\n }\n #${t} #page-header {\n height: 5% !important;\n }\n }\n `,Ds(document.head,e),Ds(document.body,r)}}(Zo.state.sessionId,Zo.state.rootElementId,Zo.state.language),function(){try{Po.events.off(Fo,Xc)}catch(e){}Po.events.on(Fo,Xc)}(),await td(),await id(i)}const nd=async()=>{const e=Zo.state.autoCaptureSettings.settings.modelLoadingTimeout;return Promise.race([ps(),new Promise(((t,i)=>setTimeout((()=>i(new Error(`Model loading timed out after ${e} ms`))),e)))])};async function ad(e){if(Zo.state.isCapturingProcessStarted)return void Ho(Zo.state.step,"trying-to-initialize-active-session");let t,i;if(e){const r=await async function(e){let t,i;try{const r=await Cs(e,Zo.state.consentVersion,Zo.state.clientId);return t=r.sessionId,i=r.userToken,Zo.dispatch("setSessionId",t),Zo.dispatch("setUserToken",i),{sessionId:t,userToken:i}}catch(e){throw console.log("Error starting session"),console.error(e),e}}(e);t=r.sessionId,i=r.userToken}else{const e=ed();t=e.sessionId,i=e.userToken}if(!t)return void Ho(Zo.state.step,"other");const{missing_images:r,status:n}=await Ss(t,i,Zo.state.clientId);return Zo.dispatch("setIsCapturingProcessStarted",!0),await rd({status:n,sessionId:t,userToken:i,missingImages:r,rootElementId:Zo.state.rootElementId,language:Zo.state.language}),!0}async function od(){try{return await async function(){if("recapture"===Zo.state.verificationStatus||"pending"===Zo.state.verificationStatus){const{sessionId:e,userToken:t}=ed(),{missing_images:i,status:r}=await Ss(e,t,Zo.state.clientId);return await rd({status:r,sessionId:e,userToken:t,missingImages:i,rootElementId:Zo.state.rootElementId,language:Zo.state.language}),!0}Ho(Zo.state.step,"trying-to-initialize-active-session")}()}catch(e){throw console.log("Error restarting session"),console.error(e),e}}var sd=Object.freeze({__proto__:null,recapture:od,restart:async function(){return od()},start:async function(e){try{return await ad(e)}catch(e){throw console.log("Error starting session"),console.error(e),e}},version:()=>_a});class cd{static arrayBufferToBase64(e){return btoa(String.fromCharCode(...new Uint8Array(e)))}static base64ToArrayBuffer(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}static stringToBase64(e){return btoa(e)}static jsonToBase64(e){const t=JSON.stringify(e);return btoa(t)}static base64ToJson(e){const t=atob(e);return JSON.parse(t)}}const dd={log:console.log,error:console.error};var ud,ld;!function(e){e.NotInitialized="not_initialized",e.AuthenticationFailed="authentication_failed",e.AuthenticationAbortedTimeout="authentication_aborted_timeout",e.AuthenticationCanceled="webauthn_authentication_canceled",e.RegistrationFailed="registration_failed",e.AlreadyRegistered="username_already_registered",e.RegistrationAbortedTimeout="registration_aborted_timeout",e.RegistrationCanceled="webauthn_registration_canceled",e.AutofillAuthenticationAborted="autofill_authentication_aborted",e.AuthenticationProcessAlreadyActive="authentication_process_already_active",e.InvalidApprovalData="invalid_approval_data",e.FailedToInitCrossDeviceSession="cross_device_init_failed",e.FailedToGetCrossDeviceStatus="cross_device_status_failed",e.Unknown="unknown"}(ud||(ud={}));class hd extends Error{constructor(e,t){super(e),this.errorCode=ud.NotInitialized,this.data=t}}class fd extends hd{constructor(e,t){super(null!=e?e:"WebAuthnSdk is not initialized",t),this.errorCode=ud.NotInitialized}}class pd extends hd{constructor(e,t){super(null!=e?e:"Authentication failed with an error",t),this.errorCode=ud.AuthenticationFailed}}class gd extends hd{constructor(e,t){super(null!=e?e:"Authentication was canceled by the user or got timeout",t),this.errorCode=ud.AuthenticationCanceled}}class md extends hd{constructor(e,t){super(null!=e?e:"Registration failed with an error",t),this.errorCode=ud.RegistrationFailed}}class bd extends hd{constructor(e,t){super(null!=e?e:"Registration was canceled by the user or got timeout",t),this.errorCode=ud.RegistrationCanceled}}class vd extends hd{constructor(e){super(null!=e?e:"Autofill flow was aborted"),this.errorCode=ud.AutofillAuthenticationAborted}}class yd extends hd{constructor(e){super(null!=e?e:"Operation was aborted by timeout"),this.errorCode=ud.AutofillAuthenticationAborted}}class _d extends hd{constructor(e){super(null!=e?e:"Passkey with this username is already registered with the relying party."),this.errorCode=ud.AlreadyRegistered}}class wd extends hd{constructor(e,t){super(null!=e?e:"Authentication process is already active",t),this.errorCode=ud.AuthenticationProcessAlreadyActive}}class xd extends hd{constructor(e,t){super(null!=e?e:"Invalid approval data",t),this.errorCode=ud.InvalidApprovalData}}class Ad extends hd{constructor(e,t){super(null!=e?e:"Failed to init cross device authentication",t),this.errorCode=ud.FailedToInitCrossDeviceSession}}class Ed extends hd{constructor(e,t){super(null!=e?e:"Failed to get cross device status",t),this.errorCode=ud.FailedToGetCrossDeviceStatus}}function Sd(e){return e.errorCode&&Object.values(ud).includes(e.errorCode)}!function(e){e[e.persistent=0]="persistent",e[e.session=1]="session"}(ld||(ld={}));class kd{static get(e){return kd.getStorageMedium(kd.allowedKeys[e]).getItem(kd.getStorageKey(e))||void 0}static set(e,t){return kd.getStorageMedium(kd.allowedKeys[e]).setItem(kd.getStorageKey(e),t)}static remove(e){kd.getStorageMedium(kd.allowedKeys[e]).removeItem(kd.getStorageKey(e))}static clear(e){for(const[t,i]of Object.entries(kd.allowedKeys)){const r=t;e&&this.configurationKeys.includes(r)||kd.getStorageMedium(i).removeItem(kd.getStorageKey(r))}}static getStorageKey(e){return`WebAuthnSdk:${e}`}static getStorageMedium(e){return e===ld.session?sessionStorage:localStorage}}kd.allowedKeys={clientId:ld.session},kd.configurationKeys=["clientId"];class Md{static isNewApiDomain(e){return e&&(this.newApiDomains.includes(e)||e.startsWith("api.")&&e.endsWith(".transmitsecurity.io"))}static dnsPrefetch(e){const t=document.createElement("link");t.rel="dns-prefetch",t.href=e,document.head.appendChild(t)}static preconnect(e,t){const i=document.createElement("link");i.rel="preconnect",i.href=e,t&&(i.crossOrigin="anonymous"),document.head.appendChild(i)}static warmupConnection(e){this.dnsPrefetch(e),this.preconnect(e,!1),this.preconnect(e,!0)}static init(e,t){var i,r;try{this._serverPath=new URL(t.serverPath),this.isNewApiDomain(null===(i=this._serverPath)||void 0===i?void 0:i.hostname)&&this.warmupConnection(this._serverPath.origin),this._apiPaths=null!==(r=t.webauthnApiPaths)&&void 0!==r?r:this.getDefaultPaths(),this._clientId=e,kd.set("clientId",e)}catch(e){throw new fd("Invalid options.serverPath",{error:e})}}static getDefaultPaths(){var e;const t=this.isNewApiDomain(null===(e=this._serverPath)||void 0===e?void 0:e.hostname)?"/cis":"";return{startAuthentication:`${t}/v1/auth/webauthn/authenticate/start`,startRegistration:`${t}/v1/auth/webauthn/register/start`,initCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/init`,startCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/start`,startCrossDeviceRegistration:`${t}/v1/auth/webauthn/cross-device/register/start`,getCrossDeviceTicketStatus:`${t}/v1/auth/webauthn/cross-device/status`,attachDeviceToCrossDeviceSession:`${t}/v1/auth/webauthn/cross-device/attach-device`}}static getApiPaths(){return this._apiPaths}static async sendRequest(e,t,i){dd.log(`[WebAuthn SDK] Calling ${t.method} ${e}...`);const r=new URL(this._serverPath);return r.pathname=e,i&&(r.search=i),fetch(r.toString(),t)}static async startRegistration(e){const i=await this.sendRequest(this._apiPaths.startRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(t({client_id:this.getValidatedClientId(),username:e.username,display_name:e.displayName},e.timeout&&{timeout:e.timeout}),e.limitSingleCredentialToDevice&&{limit_single_credential_to_device:e.limitSingleCredentialToDevice}))});if(!(null==i?void 0:i.ok))throw new pd("Failed to start registration",null==i?void 0:i.body);return await i.json()}static async startAuthentication(e){const i=await this.sendRequest(this._apiPaths.startAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(t(t({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}),e.timeout&&{timeout:e.timeout}))});if(!(null==i?void 0:i.ok))throw new pd("Failed to start authentication",null==i?void 0:i.body);return await i.json()}static async initCrossDeviceAuthentication(e){const i=await this.sendRequest(this._apiPaths.initCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(t({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}))});if(!(null==i?void 0:i.ok))throw new Ad(void 0,null==i?void 0:i.body);return await i.json()}static async getCrossDeviceTicketStatus(e){const t=await this.sendRequest(this._apiPaths.getCrossDeviceTicketStatus,{method:"GET"},`cross_device_ticket_id=${e.ticketId}`);if(!(null==t?void 0:t.ok))throw new Ed(void 0,null==t?void 0:t.body);return await t.json()}static async startCrossDeviceAuthentication(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new pd("Failed to start cross device authentication",null==t?void 0:t.body);return await t.json()}static async startCrossDeviceRegistration(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new md("Failed to start cross device registration",null==t?void 0:t.body);return await t.json()}static async attachDeviceToCrossDeviceSession(e){const t=await this.sendRequest(this._apiPaths.attachDeviceToCrossDeviceSession,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new md("Failed to attach device to cross device session",null==t?void 0:t.body);return await t.json()}static getValidatedClientId(){var e;const t=null!==(e=this._clientId)&&void 0!==e?e:kd.get("clientId");if(!t)throw new fd("Missing clientId");return t}}var Cd,Id,Dd,Td;Md.newApiDomains=["api.idsec-dev.com","api.idsec-stg.com"],function(e){e.InputAutofill="input-autofill",e.Modal="modal"}(Cd||(Cd={})),function(e){e.Pending="pending",e.Scanned="scanned",e.Success="success",e.Error="error",e.Timeout="timeout",e.Aborted="aborted"}(Id||(Id={})),function(e){e.toAuthenticationError=e=>Sd(e)?e:"NotAllowedError"===e.name?new gd:"OperationError"===e.name?new wd(e.message):"SecurityError"===e.name?new pd(e.message):e===ud.AuthenticationAbortedTimeout?new yd:"AbortError"===e.name||e===ud.AutofillAuthenticationAborted?new vd:new pd("Something went wrong during authentication",{error:e}),e.toRegistrationError=e=>Sd(e)?e:"NotAllowedError"===e.name?new bd:"SecurityError"===e.name?new md(e.message):"InvalidStateError"===e.name?new _d:e===ud.RegistrationAbortedTimeout?new yd:new md("Something went wrong during registration",{error:e})}(Dd||(Dd={})),function(e){e.processCredentialRequestOptions=e=>t(t({},e),{},{challenge:cd.base64ToArrayBuffer(e.challenge),allowCredentials:e.allowCredentials.map((e=>t(t({},e),{},{id:cd.base64ToArrayBuffer(e.id)})))}),e.processCredentialCreationOptions=(e,i)=>{var r;const n=JSON.parse(JSON.stringify(e));return n.challenge=cd.base64ToArrayBuffer(e.challenge),n.user.id=cd.base64ToArrayBuffer(e.user.id),(null==i?void 0:i.limitSingleCredentialToDevice)&&(n.excludeCredentials=null===(r=e.excludeCredentials)||void 0===r?void 0:r.map((e=>t(t({},e),{},{id:cd.base64ToArrayBuffer(e.id)})))),(null==i?void 0:i.registerAsDiscoverable)?(n.authenticatorSelection.residentKey="preferred",n.authenticatorSelection.requireResidentKey=!0):(n.authenticatorSelection.residentKey="discouraged",n.authenticatorSelection.requireResidentKey=!1),n.authenticatorSelection.authenticatorAttachment=(null==i?void 0:i.allowCrossPlatformAuthenticators)?void 0:"platform",n},e.encodeAuthenticationResult=e=>{const{authenticatorAttachment:t}=e,i=e.response;return{id:e.id,rawId:cd.arrayBufferToBase64(e.rawId),response:{authenticatorData:cd.arrayBufferToBase64(i.authenticatorData),clientDataJSON:cd.arrayBufferToBase64(i.clientDataJSON),signature:cd.arrayBufferToBase64(i.signature),userHandle:cd.arrayBufferToBase64(i.userHandle)},authenticatorAttachment:t,type:e.type}},e.encodeRegistrationResult=e=>{const{authenticatorAttachment:t}=e,i=e.response;return{id:e.id,rawId:cd.arrayBufferToBase64(e.rawId),response:{attestationObject:cd.arrayBufferToBase64(i.attestationObject),clientDataJSON:cd.arrayBufferToBase64(i.clientDataJSON)},authenticatorAttachment:t,type:e.type}}}(Td||(Td={}));class Rd{async modal(e){try{const i=await this.performAuthentication(t(t({},e),{},{mediationType:Cd.Modal}));return cd.jsonToBase64(i)}catch(e){throw Dd.toAuthenticationError(e)}}activateAutofill(e,t){const{onSuccess:i,onError:r,onReady:n}=e;this.performAuthentication({username:t,mediationType:Cd.InputAutofill,onReady:n}).then((e=>{i(cd.jsonToBase64(e))})).catch((e=>{const t=Dd.toAuthenticationError(e);if(!r)throw t;r(t)}))}abortAutofill(){this.abortController&&this.abortController.abort(ud.AutofillAuthenticationAborted)}abortAuthentication(){this.abortController&&this.abortController.abort(ud.AuthenticationAbortedTimeout)}async performAuthentication(e){var t,i;const r="crossDeviceTicketId"in e?await Md.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await Md.startAuthentication({username:e.username,timeout:null===(t=e.options)||void 0===t?void 0:t.timeout}),n=r.credential_request_options,a=Td.processCredentialRequestOptions(n),o=this.getMediatedCredentialRequest(a,e.mediationType);e.mediationType===Cd.InputAutofill&&(null===(i=e.onReady)||void 0===i||i.call(e));const s=await navigator.credentials.get(o).catch((e=>{throw Dd.toAuthenticationError(e)}));return{webauthnSessionId:r.webauthn_session_id,publicKeyCredential:Td.encodeAuthenticationResult(s),userAgent:navigator.userAgent}}getMediatedCredentialRequest(e,t){const i={publicKey:e};return this.abortController=new AbortController,i.signal=this.abortController&&this.abortController.signal,t===Cd.InputAutofill?i.mediation="conditional":e.timeout&&setTimeout((()=>{this.abortAuthentication()}),e.timeout),i}}class Bd{constructor(e,t){this.handler=e,this.intervalInMs=t}begin(){var e;this.intervalId=window.setInterval((e=this.handler,async function(){e.isRunning||(e.isRunning=!0,await e(...arguments),e.isRunning=!1)}),this.intervalInMs)}stop(){clearInterval(this.intervalId)}}const zd=/^[A-Za-z0-9\-_.: ]*$/;function Pd(e){if(e&&(!function(e){return Object.keys(e).length<=10}(e)||!function(e){const t=e=>"string"==typeof e,i=e=>zd.test(e);return Object.keys(e).every((r=>t(r)&&t(e[r])&&i(r)&&i(e[r])))}(e)))throw dd.error("Failed validating approval data"),new xd("Provided approval data should have 10 properties max. Also, it should contain only \n alphanumeric characters, numbers, and the special characters: '-', '_', '.'")}class Od{constructor(e,i,r){this.authenticationHandler=e,this.registrationHandler=i,this.approvalHandler=r,this.init={registration:async e=>(this.ticketStatus=Id.Pending,this.pollCrossDeviceSession(e.crossDeviceTicketId,e.handlers)),authentication:async e=>{const{username:i}=e,r=(await Md.initCrossDeviceAuthentication(t({},i&&{username:i}))).cross_device_ticket_id;return this.ticketStatus=Id.Pending,this.pollCrossDeviceSession(r,e.handlers)},approval:async e=>{const{username:t,approvalData:i}=e;Pd(i);const r=(await Md.initCrossDeviceAuthentication({username:t,approvalData:i})).cross_device_ticket_id;return this.ticketStatus=Id.Pending,this.pollCrossDeviceSession(r,e.handlers)}},this.authenticate={modal:async e=>this.authenticationHandler.modal({crossDeviceTicketId:e})},this.approve={modal:async e=>this.approvalHandler.modal({crossDeviceTicketId:e})}}async register(e,t){return this.registrationHandler.register({crossDeviceTicketId:e},t)}async attachDevice(e){const i=await Md.attachDeviceToCrossDeviceSession({ticketId:e});return t({status:i.status,startedAt:i.started_at},i.approval_data&&{approvalData:i.approval_data})}async pollCrossDeviceSession(e,t){return this.poller=new Bd((async()=>{var i,r;const n=await Md.getCrossDeviceTicketStatus({ticketId:e}),a=n.status;if(a!==this.ticketStatus)switch(this.ticketStatus=a,a){case Id.Scanned:await t.onDeviceAttach();break;case Id.Error:case Id.Timeout:case Id.Aborted:await t.onFailure(n),null===(i=this.poller)||void 0===i||i.stop();break;case Id.Success:if("onCredentialRegister"in t)await t.onCredentialRegister();else{if(!n.session_id)throw new Ed("Cross device session is complete without returning session_id",n);await t.onCredentialAuthenticate(n.session_id)}null===(r=this.poller)||void 0===r||r.stop()}}),1e3),this.poller.begin(),setTimeout((()=>{var e;null===(e=this.poller)||void 0===e||e.stop(),t.onFailure({status:Id.Timeout})}),3e5),{crossDeviceTicketId:e,stop:()=>{var e;null===(e=this.poller)||void 0===e||e.stop()}}}}class Fd{async register(e,i){this.abortController=new AbortController;const r=t({allowCrossPlatformAuthenticators:!("crossDeviceTicketId"in e),registerAsDiscoverable:!0},i);try{const t="crossDeviceTicketId"in e?await Md.startCrossDeviceRegistration({ticketId:e.crossDeviceTicketId}):await Md.startRegistration({username:e.username,displayName:(null==i?void 0:i.displayName)||e.username,timeout:null==i?void 0:i.timeout,limitSingleCredentialToDevice:null==i?void 0:i.limitSingleCredentialToDevice}),n=Td.processCredentialCreationOptions(t.credential_creation_options,r);setTimeout((()=>{this.abortRegistration()}),n.timeout);const a=await this.registerCredential(n),o={webauthnSessionId:t.webauthn_session_id,publicKeyCredential:a,userAgent:navigator.userAgent};return cd.jsonToBase64(o)}catch(e){throw Dd.toRegistrationError(e)}}abortRegistration(){this.abortController&&this.abortController.abort(ud.RegistrationAbortedTimeout)}async registerCredential(e){const t=await navigator.credentials.create({publicKey:e,signal:this.abortController&&this.abortController.signal}).catch((e=>{throw Dd.toRegistrationError(e)}));return Td.encodeRegistrationResult(t)}}class Nd{async modal(e){try{const t=await this.performApproval(e);return cd.jsonToBase64(t)}catch(e){throw Dd.toAuthenticationError(e)}}async performApproval(e){"approvalData"in e&&Pd(e.approvalData);const t="crossDeviceTicketId"in e?await Md.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await Md.startAuthentication({username:e.username,approvalData:e.approvalData}),i=t.credential_request_options,r=Td.processCredentialRequestOptions(i),n=await navigator.credentials.get({publicKey:r}).catch((e=>{throw Dd.toAuthenticationError(e)}));return{webauthnSessionId:t.webauthn_session_id,publicKeyCredential:Td.encodeAuthenticationResult(n),userAgent:navigator.userAgent}}}class Ld{constructor(){this._initialized=!1,this._authenticationHandler=new Rd,this._registrationHandler=new Fd,this._approvalHandler=new Nd,this._crossDeviceHandler=new Od(this._authenticationHandler,this._registrationHandler,this._approvalHandler),this.authenticate={modal:async(e,t)=>(this.initCheck(),this._authenticationHandler.modal({username:e,options:t})),autofill:{activate:(e,t)=>(this.initCheck(),this._authenticationHandler.activateAutofill(e,t)),abort:()=>this._authenticationHandler.abortAutofill()}},this.approve={modal:async(e,t)=>(this.initCheck(),this._approvalHandler.modal({username:e,approvalData:t}))},this.register=async(e,t)=>(this.initCheck(),this._registrationHandler.register({username:e},t)),this.crossDevice={init:{registration:async e=>(this.initCheck(),this._crossDeviceHandler.init.registration(e)),authentication:async e=>(this.initCheck(),this._crossDeviceHandler.init.authentication(e)),approval:async e=>(this.initCheck(),this._crossDeviceHandler.init.approval(e))},authenticate:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.authenticate.modal(e))},approve:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.approve.modal(e))},register:async(e,t)=>(this.initCheck(),this._crossDeviceHandler.register(e,t)),attachDevice:async e=>(this.initCheck(),this._crossDeviceHandler.attachDevice(e))},this.isPlatformAuthenticatorSupported=async()=>{var e;try{return await(null===(e=Ld.StaticPublicKeyCredential)||void 0===e?void 0:e.isUserVerifyingPlatformAuthenticatorAvailable())}catch(e){return!1}},this.isAutofillSupported=async()=>{var e,t;return!(!(null===(e=Ld.StaticPublicKeyCredential)||void 0===e?void 0:e.isConditionalMediationAvailable)||!await(null===(t=Ld.StaticPublicKeyCredential)||void 0===t?void 0:t.isConditionalMediationAvailable()))}}async init(e,t){try{if(!e)throw new fd("Invalid clientId",{clientId:e});if(t.webauthnApiPaths){const e=Md.getDefaultPaths();if(function(e,t){const i=new Set(e),r=new Set(t);return[...e.filter((e=>!r.has(e))),...t.filter((e=>!i.has(e)))]}(Object.keys(t.webauthnApiPaths),Object.keys(e)).length)throw new fd("Invalid custom paths",{customApiPaths:t.webauthnApiPaths})}Md.init(e,t),this._initialized=!0}catch(e){throw Sd(e)?e:new fd("Failed to initialize SDK")}}getDefaultPaths(){return this.initCheck(),Md.getDefaultPaths()}getApiPaths(){return this.initCheck(),Md.getApiPaths()}initCheck(){if(!this._initialized)throw new fd}}Ld.StaticPublicKeyCredential=window.PublicKeyCredential;const jd=new W("webauthn"),Ud=new Ld;jd.events.on(jd.events.MODULE_INITIALIZED,(()=>{var e;const i=jd.moduleMetadata.getInitConfig();if(!(null===(e=null==i?void 0:i.webauthn)||void 0===e?void 0:e.serverPath))return;const{clientId:r,webauthn:n}=i;Ud.init(r,t({},n))}));const qd={modal:async(e,t)=>(Ud.initCheck(),Ud.authenticate.modal(e,t)),autofill:{activate:(e,t)=>{Ud.initCheck(),Ud.authenticate.autofill.activate(e,t)},abort:()=>{Ud.initCheck(),Ud.authenticate.autofill.abort()}}},Kd={modal:async(e,t)=>(Ud.initCheck(),Ud.approve.modal(e,t))};async function Hd(e,t){return Ud.initCheck(),Ud.register(e,t)}const{crossDevice:Vd}=Ud,{isPlatformAuthenticatorSupported:$d}=Ud,{isAutofillSupported:Jd}=Ud,{getDefaultPaths:Gd}=Ud;window.localWebAuthnSDK=Ud;var Wd=Object.freeze({__proto__:null,get WebauthnCrossDeviceStatus(){return Id},approve:Kd,authenticate:qd,crossDevice:Vd,getDefaultPaths:Gd,isAutofillSupported:Jd,isPlatformAuthenticatorSupported:$d,register:Hd});const Zd=new W("ido");var Yd,Qd,Xd,eu,tu;!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(Yd||(Yd={})),function(e){e.InvalidInitOptions="invalid_initialization_options",e.NotInitialized="not_initialized",e.NoActiveJourney="no_active_journey",e.NetworkError="network_error",e.ClientResponseNotValid="client_response_not_valid",e.ServerError="server_error",e.InvalidState="invalid_state",e.InvalidCredentials="invalid_credentials",e.ExpiredOTPPasscode="expired_otp_passcode",e.ExpiredValidationPasscode="expired_validation_passcode",e.MaxResendReached="expired_otp_passcode"}(Qd||(Qd={})),function(e){e.ClientInput="client_input",e.Cancel="cancel",e.Fail="failure",e.Custom="custom",e.Resend="resend"}(Xd||(Xd={})),function(e){e.JourneySuccess="journey_success",e.ClientInputRequired="client_input_required",e.ClientInputUpdateRequired="client_input_update_required",e.JourneyRejection="journey_rejection"}(eu||(eu={})),function(e){e.Rejection="action:rejection",e.Success="action:success",e.Information="action:information",e.DebugBreak="action:debug_break",e.WaitForAnotherDevice="action:wait_for_another_device",e.CryptoBindingRegistration="action:crypto_binding_registration",e.CryptoBindingValidation="action:crypto_binding_validation",e.RegisterDeviceAction="transmit_platform_device_registration",e.ValidateDeviceAction="transmit_platform_device_validation",e.WebAuthnRegistration="action:webauthn_registration",e.DrsTriggerAction="action:drs_trigger_action",e.IdentityVerification="action:id_verification",e.EmailOTPAuthentication="transmit_platform_email_otp_authentication",e.SmsOTPAuthentication="transmit_platform_sms_otp_authentication",e.EmailValidation="transmit_platform_email_validation",e.SmsValidation="transmit_platform_sms_validation",e.TotpRegistration="transmit_platform_totp_registration",e.TransactionSigningTOTP="transmit_platform_transaction_signing_totp",e.InvokeIDP="invoke_idp",e.WebAuthnTransactionSigning="transmit_platform_transaction_signing_webauthn",e.SelectOrganization="transmit_platform_select_organization",e.MobileApproveAuthentication="transmit_platform_mobile_approve_authentication"}(tu||(tu={}));const iu=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yd.Info;this.logLevel=e}setLogLevel(e){e<Yd.Debug||e>Yd.Error?this.error("Invalid log level"):this.logLevel=e}debug(e){this.logLevel<=Yd.Debug&&console.debug(`[DEBUG] ${e}`)}info(e){this.logLevel<=Yd.Info&&console.info(`[INFO] ${e}`)}warning(e){this.logLevel<=Yd.Warning&&console.warn(`[WARNING] ${e}`)}error(e){this.logLevel<=Yd.Error&&console.error(`[ERROR] ${e}`)}},ru={[tu.CryptoBindingRegistration]:"input",[tu.CryptoBindingValidation]:"input",[tu.RegisterDeviceAction]:"data",[tu.ValidateDeviceAction]:"data"},nu="api/v2/",au={path:"auth/sso"},ou={path:"auth/anonymous_invoke"},su={path:"auth/assert"},cu={path:"auth/poll"},du={path:"auth/create_debug_token"},uu={path:"auth/key_exchange"},lu={headers:{mandatory:!0,dummy:[{type:"correlation_id",correlation_id:"337BFFE6BEE7D694B8FA41F42B00742CA537DC398F79369A3A60E04D0EB2E8E1"}]},data:{mandatory:!0,dummy:{collection_result:{metadata:{timestamp:(new Date).getTime()},content:{}},policy_request_id:"LoginWithMenu"},large_dummy:{metadata:{timestamp:1679422144431},content:{device_details:{logged_users:1,persistence_mode:"persistent",device_id:"8951bd7b67a959e7b12b5018816f9ce4",os_type:"Mac OS",os_version:"10.15.7",device_model:"Chrome 111.0.0.0"},location:{enabled:!1},capabilities:{fido2_user_verifying_platform_authenticator_available:!0,audio_acquisition_supported:!0,finger_print_supported:!1,image_acquisition_supported:!1,persistent_keys_supported:!0,face_id_key_bio_protection_supported:!1,fido_client_present:!1,fido2_client_present:!0,dyadic_present:!1,installed_plugins:[]},collector_state:{accounts:"disabled",devicedetails:"active",contacts:"disabled",owner:"disabled",software:"disabled",location:"disabled",locationcountry:"disabled",bluetooth:"disabled",externalsdkdetails:"active",hwauthenticators:"active",capabilities:"active",fidoauthenticators:"disabled",largedata:"active",localenrollments:"active",devicefingerprint:"active",apppermissions:"disabled"},local_enrollments:{}},fp2:{user_agent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",webdriver:!0,language:"en-US",color_depth:30,device_memory:8,pixel_ratio:2,hardware_concurrency:12,screen_resolution:[1680,1050],available_screen_resolution:[1680,1025],timezone_offset:240,timezone:"America/New_York",session_storage:!0,local_storage:!0,indexed_db:!0,add_behavior:!1,open_database:!0,cpu_class:"not available",platform:"MacIntel",do_not_track:"not available",plugins:[["PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chrome PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chromium PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Microsoft Edge PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["WebKit built-in PDF","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]]],canvas:["canvas winding:yes","canvas fp:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB9AAAADICAYAAACwGnoBAAAAAXNSR0IArs4c6QAAIABJREFUeF7s3XeYXVW9//H3Omdaeu+FGgiE9BDAgmIBQRRQ4eIP0JCQmdC8YgHrZRQLAooSSjIpRMpVCZciiIAiKhoIpEMoUtILKaS3KWf/nu8+e0/2nDkzc+bMmckMfNbz8Ejm7L3W2q8zwT8++/tdjlY+PLz+wAhgKHA0MBjoB/QEDq9j+6uAzcAGYDXwFvA6sMzh1of3eHjtgWHA8ZH/7Qa0q+Mfu3VfHf9sA14Flof/63B7q/fn5fY5cAefo5V/hdqeBCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQggTYh4FrbLj2844BPAh8FTg4C81xucyewBygAeuRy4uhcrwF/6sx7Tw3lwMKT6LDtNDr7T2Sxf26GvRjwAvBP4G84Z0tmNLxivIwufJ9d5Mpodb/v7zNiPY4EJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAE2rRAqwgUPbyTgC8AnwMsQG+TYz7wEPAYUGeaPQr4MPCh4BWBQTl7VFvSln4I52wrdQ4F6Dkz10QSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkMD7SOCQBegenlV/XwpMCtqzt0nWrcDdwKygR3yjH+IU4LPBqwPWqD43w8J029IcnLMt1hgK0HODrFkkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIIH3l0D9AXppaR6lpZX+I0f/vQkGHt5w4EqgJJNprNf4GnYzgA7EcWxhPz0pyuTWjK7ZxgG6UehfW0mCchK0J6/Be18G7gCmN3ilPYER5jd4JacDnw/CdDvpPXXsPQDxOBQ2vL/IrdOAO3HOtuwPC9C3056uHDyiveHNte0rttCRXmW7c/PCSH1/F+r6LJt72ja5di8BCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCCBNidQO1CcNPNo4lU/Ak7AeTvwXAc8twbnHUdl3jhmT9qVzVN6eFZf/W3g4kzvf43tXMW/6EIBf2Ud/+YcRvAgD3E653F4ptOkve6fbOBbvEARcZ7lc3ydefyW//AHPsWZ1N1XfRlwM3Bfg6sngEWA5dZ2lHsjOtPb+wHWzN7C9C8DO3fD3Bdg4Ttw3blwZO8GV09zwb3ALUyZftyR3pbfn83L/IY/ZDNPm7vnGYbyKa6BWGI40y5/JesHmDTzMPIqLwGOwnPjgd9QVlLmzze5bAKxxEA8Z9+Y/ZpcR1nJarK5J+sN6kYJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSKApAjUD9MllZ+K8J/DcNLZ3/W/mXlBOaWmMDX2/h+duIBHry8zJ7zZmQQ+vF3B9UHXemFv5DE9QwvF+oD2L15nAMfyOt/3wvEcOqtBLeI632MEznM1G9tKP+3iCM9MG6JuAHwdV55k/hIXoM4PDzhsRoEcXOAGYAHxmG9w2tykBejjrHeNLrrvyZFa1ugB9PV1ZS1fGszJz4gyutGr7uYyluPD8IqZ+7UAGt6S/ZHLZTJx3P2Ulz/qBufPuJq+yH55rT2XeLGYUn+Z3aljfbwUwl7KSb5DNPVlvUDdKQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAJNETgYoF9+Zzeq4quAFfTfMJrSUkt/D47JZc/iuYnMnGzhYEbDw7sK+CnQOaMbUi7qzN0NVoRnM294z38zD6tyf5qz2EE5XZmTNkC/Hfi+FYJntZidkN7ICvR06/TfBX1+B788F07LqgK9eta8kmv4CBt4thVVoO8jnzP4b67mWc5nYVbSDd3kymhaC/eSaU+SiC1hRvF3KJ4+FHgN532RRGwjzvs35QXdmHPpdoqn3w+Mo6zkWLK5p6EH0ecSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkECzCBwMFIunX+6fle25S5lRPKfWapfNOI5YYj0wFRjmH/+diC3Eeb8hlojjuespK3ma4um39NhUOOL5x88teKRy5cfWsofx9OYuXuUIOvFTTuQJVnMfb/lnmc/k1Fpnmr/Bdn7CYu7jTT7NQAbRgV9wEovYwu94iy9zNKczkASeP6+1Y99DJcfSlR8yhnbEeYxVzOYNJnIsv+YVzmAgP2AMv+Zl/swaulHA62ynH+15MhKg38h4/sMO/sVGPs3R/IfR/IUYYDXo9u7APvDPDv8Y0A74D/AOcDzwFrANOBGqW8yHAfoQ8IPh7UBfwDrap+a5Nu/rwA7ACqUtKG8PWFZrnfN/B+3PhQsLoO+L0KcSThqS/OfNjfDnRfCpkbBtF7z4Fpx0DCx8GzZuh48Ng9NtTTt9/hpgC0f564xlLOuYzT104ABv+d/Vx/xK8G104G7mMMDfc3JUEqOEi1nCIE7jDW7hQd6hJ5O5hE/xOt/lz2yiE9/jPJYxgE/yOpfzDwbzHj/lLJ7jaH++ā¦brB0xZVAGAtqpyy+87fNf4HUyf1sNzSz83GXvYnYKXM6qTDBVhJ29tL7uzrJF+rcOC5Dy8Hq5efB1QGSkNdigBLnWXzB/zn10h7RWRj1hcaCpHOK7cB1fwKc4cvBQCWL6UDjnPuTG//1SRguT7Vqy8CqoAWMXRFBQBWRaE0X3bu9kH/avgtoVv6ndkDVJq9tRY7wErc8bOvknxFBt+/csByS787LgGqxK1PMj2AlaStg6TOvmLQv3JLv9f+FVAlbnnS6QGspO0VOXerbBaF/PoNfwNUiVttIj2AlbjNZ2+W9l2XgVXiNptJD2CZsZpEUUC/AgBLv4dkgAJmFABYZqwmURTQrwDA0u8hGaCAGQUAlhmrSRQF9CsAsPR7SAYoYEYBgGXGahJFAf0K/B9qEBa1B23aowAAAABJRU5ErkJggg==","extensions:ANGLE_instanced_arrays;EXT_blend_minmax;EXT_color_buffer_half_float;EXT_disjoint_timer_query;EXT_float_blend;EXT_frag_depth;EXT_shader_texture_lod;EXT_texture_compression_rgtc;EXT_texture_filter_anisotropic;EXT_sRGB;KHR_parallel_shader_compile;OES_element_index_uint;OES_fbo_render_mipmap;OES_standard_derivatives;OES_texture_float;OES_texture_float_linear;OES_texture_half_float;OES_texture_half_float_linear;OES_vertex_array_object;WEBGL_color_buffer_float;WEBGL_compressed_texture_s3tc;WEBGL_compressed_texture_s3tc_srgb;WEBGL_debug_renderer_info;WEBGL_debug_shaders;WEBGL_depth_texture;WEBGL_draw_buffers;WEBGL_lose_context;WEBGL_multi_draw","webgl aliased line width range:[1, 1]","webgl aliased point size range:[1, 8191]","webgl alpha bits:8","webgl antialiasing:yes","webgl blue bits:8","webgl depth bits:24","webgl green bits:8","webgl max anisotropy:16","webgl max combined texture image units:32","webgl max cube map texture size:16384","webgl max fragment uniform vectors:1024","webgl max render buffer size:16384","webgl max texture image units:16","webgl max texture size:16384","webgl max varying vectors:32","webgl max vertex attribs:16","webgl max vertex texture image units:16","webgl max vertex uniform vectors:1024","webgl max viewport dims:[16384, 16384]","webgl red bits:8","webgl renderer:WebKit WebGL","webgl shading language version:WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)","webgl stencil bits:0","webgl vendor:WebKit","webgl version:WebGL 1.0 (OpenGL ES 2.0 Chromium)","webgl unmasked vendor:Google Inc. (ATI Technologies Inc.)","webgl unmasked renderer:ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)","webgl vertex shader high float precision:23","webgl vertex shader high float precision rangeMin:127","webgl vertex shader high float precision rangeMax:127","webgl vertex shader medium float precision:23","webgl vertex shader medium float precision rangeMin:127","webgl vertex shader medium float precision rangeMax:127","webgl vertex shader low float precision:23","webgl vertex shader low float precision rangeMin:127","webgl vertex shader low float precision rangeMax:127","webgl fragment shader high float precision:23","webgl fragment shader high float precision rangeMin:127","webgl fragment shader high float precision rangeMax:127","webgl fragment shader medium float precision:23","webgl fragment shader medium float precision rangeMin:127","webgl fragment shader medium float precision rangeMax:127","webgl fragment shader low float precision:23","webgl fragment shader low float precision rangeMin:127","webgl fragment shader low float precision rangeMax:127","webgl vertex shader high int precision:0","webgl vertex shader high int precision rangeMin:31","webgl vertex shader high int precision rangeMax:30","webgl vertex shader medium int precision:0","webgl vertex shader medium int precision rangeMin:31","webgl vertex shader medium int precision rangeMax:30","webgl vertex shader low int precision:0","webgl vertex shader low int precision rangeMin:31","webgl vertex shader low int precision rangeMax:30","webgl fragment shader high int precision:0","webgl fragment shader high int precision rangeMin:31","webgl fragment shader high int precision rangeMax:30","webgl fragment shader medium int precision:0","webgl fragment shader medium int precision rangeMin:31","webgl fragment shader medium int precision rangeMax:30","webgl fragment shader low int precision:0","webgl fragment shader low int precision rangeMin:31","webgl fragment shader low int precision rangeMax:30"],webgl_vendor_and_renderer:"Google Inc. (ATI Technologies Inc.)~ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)",ad_block:!1,has_lied_languages:!1,has_lied_resolution:!1,has_lied_os:!1,has_lied_browser:!1,touch_support:[0,!1,!1],fonts:["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Comic Sans MS","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","LUCIDA GRANDE","Microsoft Sans Serif","Monaco","Palatino","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],fonts_flash:"swf object not loaded",audio:"124.04347657808103",enumerate_devices:["id=;gid=;audioinput;","id=;gid=;videoinput;","id=;gid=;audiooutput;"]}},policy_request_id:"LoginWithMenu",params:{}}},hu=[{"control_flow.0":["assertion_id","type"]}];class fu extends Error{constructor(e,t){iu.error(`[ERROR] ${e}`),super(e),this.description=e,this.errorCode=t}static convertFromAssertionError(e){switch(e){case 28:return Qd.ClientResponseNotValid;case 29:case 31:case 35:return Qd.InvalidCredentials;case 30:return Qd.ExpiredOTPPasscode;case 32:return Qd.ExpiredValidationPasscode;case 33:return Qd.MaxResendReached;default:return Qd.ServerError}}}var pu,gu,mu;!function(e){e.JsonRejection="Json Rejection",e.TextRejection="Text Rejection",e.UpdateAction="Update Action",e.NextAction="Next Action",e.JourneyEnd="Journey End"}(pu||(pu={})),function(e){e.Pending="pending",e.Completed="completed",e.Rejected="rejected"}(gu||(gu={})),function(e){e.Form="form",e.LoginForm="login_form",e.Rejection="rejection",e.Information="information",e.DebugBreak="debug_break",e.WaitForTicket="wait_for_ticket",e.DrsTriggerAction="transmit_acp",e.IdentityVerification="kyc",e.WebAuthnRegistration="transmit_platform_web_authn_registration"}(mu||(mu={}));var bu={},vu="6.6.1",yu={},_u={},wu={get exports(){return _u},set exports(e){_u=e}},xu=Q(So);!function(e,t){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function n(e,t,i){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var a;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:xu.Buffer}catch(e){}function o(e,t){var i=e.charCodeAt(t);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function s(e,t,i){var r=o(e,i);return i-1>=t&&(r|=o(e,i-1)<<4),r}function c(e,t,i,r){for(var n=0,a=Math.min(e.length,i),o=t;o<a;o++){var s=e.charCodeAt(o)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},n.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},n.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,o,s=0;if("be"===r)for(n=e.length-1,a=0;n>=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(n=0,a=0;n<e.length;n+=3)o=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,a=0,o=0;if("be"===i)for(r=e.length-1;r>=t;r-=2)n=s(e,t,r)<<a,this.words[o]|=67108863&n,a>=18?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)n=s(e,t,r)<<a,this.words[o]|=67108863&n,a>=18?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var a=e.length-i,o=a%r,s=Math.min(a,a-o)+i,d=0,u=i;u<s;u+=r)d=c(e,u,u+r,t),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==o){var l=1;for(d=c(e,u,e.length,t),u=0;u<o;u++)l*=t;this.imuln(l),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,i){i.negative=t.negative^e.negative;var r=e.length+t.length|0;i.length=r,r=r-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var u=c>>>26,l=67108863&c,h=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=h;f++){var p=d-f|0;u+=(o=(n=0|e.words[p])*(a=0|t.words[f])+l)/67108864|0,l=67108863&o}i.words[d]=0|l,c=0|u}return 0!==c?i.words[d]=0|c:i.length--,i.strip()}n.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=(16777215&(s<<n|a)).toString(16);a=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==a||o!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=u[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?g+r:d[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return i(void 0!==a),this.toArrayLike(a,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),a=r||Math.max(1,n);i(n<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,d=new e(a),u=this.clone();if(c){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),d[s]=o;for(;s<a;s++)d[s]=0}else{for(s=0;s<a-n;s++)d[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),d[a-s-1]=o}return d},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var r=0;r<i.length;r++)this.words[r]=t.words[r]^i.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,i,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,r=e):(i=e,r=this);for(var n=0,a=0;a<r.length;a++)t=(0|i.words[a])+(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<i.length;a++)t=(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=e):(i=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|i.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<i.length;o++)a=(t=(0|i.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,i){var r,n,a,o=e.words,s=t.words,c=i.words,d=0,u=0|o[0],l=8191&u,h=u>>>13,f=0|o[1],p=8191&f,g=f>>>13,m=0|o[2],b=8191&m,v=m>>>13,y=0|o[3],_=8191&y,w=y>>>13,x=0|o[4],A=8191&x,E=x>>>13,S=0|o[5],k=8191&S,M=S>>>13,C=0|o[6],I=8191&C,D=C>>>13,T=0|o[7],R=8191&T,B=T>>>13,z=0|o[8],P=8191&z,O=z>>>13,F=0|o[9],N=8191&F,L=F>>>13,j=0|s[0],U=8191&j,q=j>>>13,K=0|s[1],H=8191&K,V=K>>>13,$=0|s[2],J=8191&$,G=$>>>13,W=0|s[3],Z=8191&W,Y=W>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],ie=8191&te,re=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,de=se>>>13,ue=0|s[8],le=8191&ue,he=ue>>>13,fe=0|s[9],pe=8191&fe,ge=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var me=(d+(r=Math.imul(l,U))|0)+((8191&(n=(n=Math.imul(l,q))+Math.imul(h,U)|0))<<13)|0;d=((a=Math.imul(h,q))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(p,U),n=(n=Math.imul(p,q))+Math.imul(g,U)|0,a=Math.imul(g,q);var be=(d+(r=r+Math.imul(l,H)|0)|0)+((8191&(n=(n=n+Math.imul(l,V)|0)+Math.imul(h,H)|0))<<13)|0;d=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,q))+Math.imul(v,U)|0,a=Math.imul(v,q),r=r+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0;var ve=(d+(r=r+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(h,J)|0))<<13)|0;d=((a=a+Math.imul(h,G)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,q))+Math.imul(w,U)|0,a=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,V)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,G)|0;var ye=(d+(r=r+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(h,Z)|0))<<13)|0;d=((a=a+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,q))+Math.imul(E,U)|0,a=Math.imul(E,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,V)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,G)|0,r=r+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,Y)|0;var _e=(d+(r=r+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(h,X)|0))<<13)|0;d=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,q))+Math.imul(M,U)|0,a=Math.imul(M,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,r=r+Math.imul(_,J)|0,n=(n=n+Math.imul(_,G)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,a=a+Math.imul(v,Y)|0,r=r+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,X)|0,a=a+Math.imul(g,ee)|0;var we=(d+(r=r+Math.imul(l,ie)|0)|0)+((8191&(n=(n=n+Math.imul(l,re)|0)+Math.imul(h,ie)|0))<<13)|0;d=((a=a+Math.imul(h,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,U),n=(n=Math.imul(I,q))+Math.imul(D,U)|0,a=Math.imul(D,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,G)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,a=a+Math.imul(w,Y)|0,r=r+Math.imul(b,X)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,ee)|0,r=r+Math.imul(p,ie)|0,n=(n=n+Math.imul(p,re)|0)+Math.imul(g,ie)|0,a=a+Math.imul(g,re)|0;var xe=(d+(r=r+Math.imul(l,ae)|0)|0)+((8191&(n=(n=n+Math.imul(l,oe)|0)+Math.imul(h,ae)|0))<<13)|0;d=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,U),n=(n=Math.imul(R,q))+Math.imul(B,U)|0,a=Math.imul(B,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,V)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,G)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,G)|0,r=r+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(E,Z)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(_,X)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,ee)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(v,ie)|0,a=a+Math.imul(v,re)|0,r=r+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0;var Ae=(d+(r=r+Math.imul(l,ce)|0)|0)+((8191&(n=(n=n+Math.imul(l,de)|0)+Math.imul(h,ce)|0))<<13)|0;d=((a=a+Math.imul(h,de)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,q))+Math.imul(O,U)|0,a=Math.imul(O,q),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(B,H)|0,a=a+Math.imul(B,V)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(k,Z)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(M,Z)|0,a=a+Math.imul(M,Y)|0,r=r+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(E,X)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(w,ie)|0,a=a+Math.imul(w,re)|0,r=r+Math.imul(b,ae)|0,n=(n=n+Math.imul(b,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,r=r+Math.imul(p,ce)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var Ee=(d+(r=r+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;d=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,U),n=(n=Math.imul(N,q))+Math.imul(L,U)|0,a=Math.imul(L,q),r=r+Math.imul(P,H)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,H)|0,a=a+Math.imul(O,V)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(B,J)|0,a=a+Math.imul(B,G)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(D,Z)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(k,X)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(M,X)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(E,ie)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,de)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,de)|0,r=r+Math.imul(p,le)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,he)|0;var Se=(d+(r=r+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ge)|0)+Math.imul(h,pe)|0))<<13)|0;d=((a=a+Math.imul(h,ge)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(N,H),n=(n=Math.imul(N,V))+Math.imul(L,H)|0,a=Math.imul(L,V),r=r+Math.imul(P,J)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,G)|0,r=r+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(B,Z)|0,a=a+Math.imul(B,Y)|0,r=r+Math.imul(I,X)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(D,X)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(M,ie)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,de)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,de)|0,r=r+Math.imul(b,le)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,he)|0;var ke=(d+(r=r+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;d=((a=a+Math.imul(g,ge)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(N,J),n=(n=Math.imul(N,G))+Math.imul(L,J)|0,a=Math.imul(L,G),r=r+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(O,Z)|0,a=a+Math.imul(O,Y)|0,r=r+Math.imul(R,X)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(B,X)|0,a=a+Math.imul(B,ee)|0,r=r+Math.imul(I,ie)|0,n=(n=n+Math.imul(I,re)|0)+Math.imul(D,ie)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(k,ae)|0,n=(n=n+Math.imul(k,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0,r=r+Math.imul(_,le)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,le)|0,a=a+Math.imul(w,he)|0;var Me=(d+(r=r+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ge)|0)+Math.imul(v,pe)|0))<<13)|0;d=((a=a+Math.imul(v,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(N,Z),n=(n=Math.imul(N,Y))+Math.imul(L,Z)|0,a=Math.imul(L,Y),r=r+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,X)|0,a=a+Math.imul(O,ee)|0,r=r+Math.imul(R,ie)|0,n=(n=n+Math.imul(R,re)|0)+Math.imul(B,ie)|0,a=a+Math.imul(B,re)|0,r=r+Math.imul(I,ae)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(M,ce)|0,a=a+Math.imul(M,de)|0,r=r+Math.imul(A,le)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(E,le)|0,a=a+Math.imul(E,he)|0;var Ce=(d+(r=r+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(w,pe)|0))<<13)|0;d=((a=a+Math.imul(w,ge)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(N,X),n=(n=Math.imul(N,ee))+Math.imul(L,X)|0,a=Math.imul(L,ee),r=r+Math.imul(P,ie)|0,n=(n=n+Math.imul(P,re)|0)+Math.imul(O,ie)|0,a=a+Math.imul(O,re)|0,r=r+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(B,ae)|0,a=a+Math.imul(B,oe)|0,r=r+Math.imul(I,ce)|0,n=(n=n+Math.imul(I,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0,r=r+Math.imul(k,le)|0,n=(n=n+Math.imul(k,he)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,he)|0;var Ie=(d+(r=r+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,ge)|0)+Math.imul(E,pe)|0))<<13)|0;d=((a=a+Math.imul(E,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(N,ie),n=(n=Math.imul(N,re))+Math.imul(L,ie)|0,a=Math.imul(L,re),r=r+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,r=r+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,de)|0)+Math.imul(B,ce)|0,a=a+Math.imul(B,de)|0,r=r+Math.imul(I,le)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,he)|0;var De=(d+(r=r+Math.imul(k,pe)|0)|0)+((8191&(n=(n=n+Math.imul(k,ge)|0)+Math.imul(M,pe)|0))<<13)|0;d=((a=a+Math.imul(M,ge)|0)+(n>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(L,ae)|0,a=Math.imul(L,oe),r=r+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,de)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,de)|0,r=r+Math.imul(R,le)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(B,le)|0,a=a+Math.imul(B,he)|0;var Te=(d+(r=r+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(D,pe)|0))<<13)|0;d=((a=a+Math.imul(D,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(N,ce),n=(n=Math.imul(N,de))+Math.imul(L,ce)|0,a=Math.imul(L,de),r=r+Math.imul(P,le)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,le)|0,a=a+Math.imul(O,he)|0;var Re=(d+(r=r+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ge)|0)+Math.imul(B,pe)|0))<<13)|0;d=((a=a+Math.imul(B,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(N,le),n=(n=Math.imul(N,he))+Math.imul(L,le)|0,a=Math.imul(L,he);var Be=(d+(r=r+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ge)|0)+Math.imul(O,pe)|0))<<13)|0;d=((a=a+Math.imul(O,ge)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863;var ze=(d+(r=Math.imul(N,pe))|0)+((8191&(n=(n=Math.imul(N,ge))+Math.imul(L,pe)|0))<<13)|0;return d=((a=Math.imul(L,ge))+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,c[0]=me,c[1]=be,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=we,c[6]=xe,c[7]=Ae,c[8]=Ee,c[9]=Se,c[10]=ke,c[11]=Me,c[12]=Ce,c[13]=Ie,c[14]=De,c[15]=Te,c[16]=Re,c[17]=Be,c[18]=ze,0!==d&&(c[19]=d,i.length++),i};function p(e,t,i){return(new g).mulp(e,t,i)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=h),n.prototype.mulTo=function(e,t){var i,r=this.length+e.length;return i=10===this.length&&10===e.length?f(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var r=0,n=0,a=0;a<i.length-1;a++){var o=n;n=0;for(var s=67108863&r,c=Math.min(a,t.length-1),d=Math.max(0,a-e.length+1);d<=c;d++){var u=a-d,l=(0|e.words[u])*(0|t.words[d]),h=67108863&l;s=67108863&(h=h+s|0),n+=(o=(o=o+(l/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}i.words[a]=s,r=o,o=n}return 0!==r?i.words[a]=r:i.length--,i.strip()}(this,e,t):p(this,e,t),i},g.prototype.makeRBT=function(e){for(var t=new Array(e),i=n.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,i,e);return t},g.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var r=0,n=0;n<t;n++)r|=(1&e)<<t-n-1,e>>=1;return r},g.prototype.permute=function(e,t,i,r,n,a){for(var o=0;o<a;o++)r[o]=t[e[o]],n[o]=i[e[o]]},g.prototype.transform=function(e,t,i,r,n,a){this.permute(a,e,t,i,r,n);for(var o=1;o<n;o<<=1)for(var s=o<<1,c=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),u=0;u<n;u+=s)for(var l=c,h=d,f=0;f<o;f++){var p=i[u+f],g=r[u+f],m=i[u+f+o],b=r[u+f+o],v=l*m-h*b;b=l*b+h*m,m=v,i[u+f]=p+m,r[u+f]=g+b,i[u+f+o]=p-m,r[u+f+o]=g-b,f!==s&&(v=c*l-d*h,h=c*h+d*l,l=v)}},g.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=e[r];e[r]=e[i-r-1],e[i-r-1]=n,n=t[r],t[r]=-t[i-r-1],t[i-r-1]=-n}},g.prototype.normalize13b=function(e,t){for(var i=0,r=0;r<t/2;r++){var n=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+i;e[r]=67108863&n,i=n<67108864?0:n/67108864|0}return e},g.prototype.convert13b=function(e,t,r,n){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===a),i(0==(-8192&a))},g.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},g.prototype.mulp=function(e,t,i){var r=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(r),a=this.stub(r),o=new Array(r),s=new Array(r),c=new Array(r),d=new Array(r),u=new Array(r),l=new Array(r),h=i.words;h.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,d,r),this.transform(o,a,s,c,r,n),this.transform(d,a,u,l,r,n);for(var f=0;f<r;f++){var p=s[f]*u[f]-c[f]*l[f];c[f]=s[f]*l[f]+c[f]*u[f],s[f]=p}return this.conjugate(s,c,r),this.transform(s,c,h,a,r,n),this.conjugate(h,a,r),this.normalize13b(h,r),i.negative=e.negative^t.negative,i.length=e.length+t.length,i.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var r=i/26|0,n=i%26;t[i]=(e.words[r]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var i=this,r=0;r<t.length&&0===t[r];r++,i=i.sqr());if(++r<t.length)for(var a=i.sqr();r<t.length;r++,a=a.sqr())0!==t[r]&&(i=i.mul(a));return i},n.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,c=(0|this.words[t])-s<<r;this.words[t]=c|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=r;if(n-=o,n=Math.max(0,n),c){for(var d=0;d<o;d++)c.words[d]=this.words[d];c.length=o}if(0===o);else if(this.length>o)for(this.length-=o,d=0;d<this.length;d++)this.words[d]=this.words[d+o];else this.words[0]=0,this.length=1;var u=0;for(d=this.length-1;d>=0&&(0!==u||d>=n);d--){var l=0|this.words[d];this.words[d]=u<<26-a|l>>>a,u=l&s}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r||!(this.words[r]&n))},n.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,r){var n,a,o=e.length+r;this._expand(o);var s=0;for(n=0;n<e.length;n++){a=(0|this.words[n+r])+s;var c=(0|e.words[n])*t;s=((a-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&a}for(;n<this.length-r;n++)s=(a=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&a;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(a=-(0|this.words[n])+s)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var i=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!=(i=26-this._countBits(o))&&(a=a.ushln(i),r.iushln(i),o=0|a.words[a.length-1]);var s,c=r.length-a.length;if("mod"!==t){(s=new n(null)).length=c+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var u=r.clone()._ishlnsubmul(a,1,c);0===u.negative&&(r=u,s&&(s.words[c]=1));for(var l=c-1;l>=0;l--){var h=67108864*(0|r.words[a.length+l])+(0|r.words[a.length+l-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(a,h,l);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(a,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},n.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),a=i.cmp(r);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},n.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),o=new n(0),s=new n(0),c=new n(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var u=r.clone(),l=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(l)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(d)}},n.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new n(1),s=new n(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,u=1;0==(t.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var r=0;t.isEven()&&i.isEven();r++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=t.cmp(i);if(n<0){var a=t;t=i,i=a}else if(0===n||0===i.cmpn(1))break;t.isub(i)}return i.iushln(r)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var a=n,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|e.words[i];if(r!==n){r<n?t=-1:r>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new x(e)},n.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(v,b),v.prototype.split=function(e,t){for(var i=4194303,r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(o&i)<<4|a>>>22,a=o}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var r=0|e.words[i];t+=977*r,e.words[i]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(y,b),r(_,b),r(w,b),w.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var r=19*(0|e.words[i])+t,n=67108863&r;r>>>=26,e.words[i]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},x.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new n(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);i(!a.isZero());var s=new n(1).toRed(this),c=s.redNeg(),d=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,d).cmp(c);)u.redIAdd(c);for(var l=this.pow(u,a),h=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),p=o;0!==f.cmp(s);){for(var g=f,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<p);var b=this.pow(l,new n(1).iushln(p-m-1));h=h.redMul(b),l=b.redSqr(),f=f.redMul(l),p=m}return h},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new n(1).toRed(this),i[1]=e;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],e);var a=i[0],o=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var d=t.words[r],u=c-1;u>=0;u--){var l=d>>u&1;a!==i[0]&&(a=this.sqr(a)),0!==l||0!==o?(o<<=1,o|=l,(4==++s||0===r&&0===u)&&(a=this.mul(a,i[o]),s=0,o=0)):s=0}c=26}return a},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new A(e)},r(A,x),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var i=e.mul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=i.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(wu,Z);var Au=Eu;function Eu(e,t){if(!e)throw new Error(t||"Assertion failed")}Eu.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var Su={};!function(e){var t=Su;function i(e){return 1===e.length?"0"+e:e}function r(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)i[r]=0|e[r];return i}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(r=0;r<e.length;r+=2)i.push(parseInt(e[r]+e[r+1],16))}else for(r=0;r<e.length;r++){var n=e.charCodeAt(r),a=n>>8,o=255&n;a?i.push(a,o):i.push(o)}return i},t.zero2=i,t.toHex=r,t.encode=function(e,t){return"hex"===t?r(e):e}}(),function(e){var t=yu,i=_u,r=Au,n=Su;t.assert=r,t.toArray=n.toArray,t.zero2=n.zero2,t.toHex=n.toHex,t.encode=n.encode,t.getNAF=function(e,t,i){var r,n=new Array(Math.max(e.bitLength(),i)+1);for(r=0;r<n.length;r+=1)n[r]=0;var a=1<<t+1,o=e.clone();for(r=0;r<n.length;r++){var s,c=o.andln(a-1);o.isOdd()?(s=c>(a>>1)-1?(a>>1)-c:c,o.isubn(s)):s=0,n[r]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,a=0;e.cmpn(-n)>0||t.cmpn(-a)>0;){var o,s,c=e.andln(3)+n&3,d=t.andln(3)+a&3;3===c&&(c=-1),3===d&&(d=-1),o=0==(1&c)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==d?c:-c,i[0].push(o),s=0==(1&d)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==c?d:-d,i[1].push(s),2*n===o+1&&(n=1-n),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return i},t.cachedProperty=function(e,t,i){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new i(e,"hex","le")}}();var ku,Mu={},Cu={get exports(){return Mu},set exports(e){Mu=e}},Iu=Q(Object.freeze({__proto__:null,default:{}}));function Du(e){this.rand=e}if(Cu.exports=function(e){return ku||(ku=new Du(null)),ku.generate(e)},Mu.Rand=Du,Du.prototype.generate=function(e){return this._rand(e)},Du.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Du.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?Du.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(Du.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Tu=Iu;if("function"!=typeof Tu.randomBytes)throw new Error("Not supported");Du.prototype._rand=function(e){return Tu.randomBytes(e)}}catch(e){}var Ru={},Bu=_u,zu=yu,Pu=zu.getNAF,Ou=zu.getJSF,Fu=zu.assert;function Nu(e,t){this.type=e,this.p=new Bu(t.p,16),this.red=t.prime?Bu.red(t.prime):Bu.mont(this.p),this.zero=new Bu(0).toRed(this.red),this.one=new Bu(1).toRed(this.red),this.two=new Bu(2).toRed(this.red),this.n=t.n&&new Bu(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Lu=Nu;function ju(e,t){this.curve=e,this.type=t,this.precomputed=null}Nu.prototype.point=function(){throw new Error("Not implemented")},Nu.prototype.validate=function(){throw new Error("Not implemented")},Nu.prototype._fixedNafMul=function(e,t){Fu(e.precomputed);var i=e._getDoubles(),r=Pu(t,1,this._bitLength),n=(1<<i.step+1)-(i.step%2==0?2:1);n/=3;var a,o,s=[];for(a=0;a<r.length;a+=i.step){o=0;for(var c=a+i.step-1;c>=a;c--)o=(o<<1)+r[c];s.push(o)}for(var d=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(a=0;a<s.length;a++)(o=s[a])===l?u=u.mixedAdd(i.points[a]):o===-l&&(u=u.mixedAdd(i.points[a].neg()));d=d.add(u)}return d.toP()},Nu.prototype._wnafMul=function(e,t){var i=4,r=e._getNAFPoints(i);i=r.wnd;for(var n=r.points,a=Pu(t,i,this._bitLength),o=this.jpoint(null,null,null),s=a.length-1;s>=0;s--){for(var c=0;s>=0&&0===a[s];s--)c++;if(s>=0&&c++,o=o.dblp(c),s<0)break;var d=a[s];Fu(0!==d),o="affine"===e.type?d>0?o.mixedAdd(n[d-1>>1]):o.mixedAdd(n[-d-1>>1].neg()):d>0?o.add(n[d-1>>1]):o.add(n[-d-1>>1].neg())}return"affine"===e.type?o.toP():o},Nu.prototype._wnafMulAdd=function(e,t,i,r,n){var a,o,s,c=this._wnafT1,d=this._wnafT2,u=this._wnafT3,l=0;for(a=0;a<r;a++){var h=(s=t[a])._getNAFPoints(e);c[a]=h.wnd,d[a]=h.points}for(a=r-1;a>=1;a-=2){var f=a-1,p=a;if(1===c[f]&&1===c[p]){var g=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(g[1]=t[f].add(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].add(t[p].neg())):(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=Ou(i[f],i[p]);for(l=Math.max(b[0].length,l),u[f]=new Array(l),u[p]=new Array(l),o=0;o<l;o++){var v=0|b[0][o],y=0|b[1][o];u[f][o]=m[3*(v+1)+(y+1)],u[p][o]=0,d[f]=g}}else u[f]=Pu(i[f],c[f],this._bitLength),u[p]=Pu(i[p],c[p],this._bitLength),l=Math.max(u[f].length,l),l=Math.max(u[p].length,l)}var _=this.jpoint(null,null,null),w=this._wnafT4;for(a=l;a>=0;a--){for(var x=0;a>=0;){var A=!0;for(o=0;o<r;o++)w[o]=0|u[o][a],0!==w[o]&&(A=!1);if(!A)break;x++,a--}if(a>=0&&x++,_=_.dblp(x),a<0)break;for(o=0;o<r;o++){var E=w[o];0!==E&&(E>0?s=d[o][E-1>>1]:E<0&&(s=d[o][-E-1>>1].neg()),_="affine"===s.type?_.mixedAdd(s):_.add(s))}}for(a=0;a<r;a++)d[a]=null;return n?_:_.toP()},Nu.BasePoint=ju,ju.prototype.eq=function(){throw new Error("Not implemented")},ju.prototype.validate=function(){return this.curve.validate(this)},Nu.prototype.decodePoint=function(e,t){e=zu.toArray(e,t);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?Fu(e[e.length-1]%2==0):7===e[0]&&Fu(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},ju.prototype.encodeCompressed=function(e){return this.encode(e,!0)},ju.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))},ju.prototype.encode=function(e,t){return zu.encode(this._encode(t),e)},ju.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},ju.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},ju.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n<t;n+=e){for(var a=0;a<e;a++)r=r.dbl();i.push(r)}return{step:e,points:i}},ju.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,r=1===i?null:this.dbl(),n=1;n<i;n++)t[n]=t[n-1].add(r);return{wnd:e,points:t}},ju.prototype._getBeta=function(){return null},ju.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t};var Uu={},qu={get exports(){return Uu},set exports(e){Uu=e}};"function"==typeof Object.create?qu.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:qu.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}};var Ku=_u,Hu=Uu,Vu=Lu,$u=yu.assert;function Ju(e){Vu.call(this,"short",e),this.a=new Ku(e.a,16).toRed(this.red),this.b=new Ku(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Hu(Ju,Vu);var Gu=Ju;function Wu(e,t,i,r){Vu.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ku(t,16),this.y=new Ku(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Zu(e,t,i,r){Vu.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ku(0)):(this.x=new Ku(t,16),this.y=new Ku(i,16),this.z=new Ku(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Ju.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new Ku(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)i=new Ku(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?i=n[0]:(i=n[1],$u(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new Ku(e.a,16),b:new Ku(e.b,16)}})):this._getEndoBasis(i)}}},Ju.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Ku.mont(e),i=new Ku(2).toRed(t).redInvm(),r=i.redNeg(),n=new Ku(3).toRed(t).redNeg().redSqrt().redMul(i);return[r.redAdd(n).fromRed(),r.redSub(n).fromRed()]},Ju.prototype._getEndoBasis=function(e){for(var t,i,r,n,a,o,s,c,d,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),f=new Ku(1),p=new Ku(0),g=new Ku(0),m=new Ku(1),b=0;0!==l.cmpn(0);){var v=h.div(l);c=h.sub(v.mul(l)),d=g.sub(v.mul(f));var y=m.sub(v.mul(p));if(!r&&c.cmp(u)<0)t=s.neg(),i=f,r=c.neg(),n=d;else if(r&&2==++b)break;s=c,h=l,l=c,g=f,f=d,m=p,p=y}a=c.neg(),o=d;var _=r.sqr().add(n.sqr());return a.sqr().add(o.sqr()).cmp(_)>=0&&(a=t,o=i),r.negative&&(r=r.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:r,b:n},{a:a,b:o}]},Ju.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),a=i.b.neg().mul(e).divRound(this.n),o=n.mul(i.a),s=a.mul(r.a),c=n.mul(i.b),d=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:c.add(d).neg()}},Ju.prototype.pointFromX=function(e,t){(e=new Ku(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var n=r.fromRed().isOdd();return(t&&!n||!t&&n)&&(r=r.redNeg()),this.point(e,r)},Ju.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},Ju.prototype._endoWnafMulAdd=function(e,t,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],c=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),r[2*a]=s,r[2*a+1]=c,n[2*a]=o.k1,n[2*a+1]=o.k2}for(var d=this._wnafMulAdd(1,r,n,2*a,i),u=0;u<2*a;u++)r[u]=null,n[u]=null;return d},Hu(Wu,Vu.BasePoint),Ju.prototype.point=function(e,t,i){return new Wu(this,e,t,i)},Ju.prototype.pointFromJSON=function(e,t){return Wu.fromJSON(this,e,t)},Wu.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,r=function(e){return i.point(e.x.redMul(i.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},Wu.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Wu.fromJSON=function(e,t,i){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],i);if(!t[2])return r;function n(t){return e.point(t[0],t[1],i)}var a=t[2];return r.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[r].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[r].concat(a.naf.points.map(n))}},r},Wu.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Wu.prototype.isInfinity=function(){return this.inf},Wu.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},Wu.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),r=e.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(r),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},Wu.prototype.getX=function(){return this.x.fromRed()},Wu.prototype.getY=function(){return this.y.fromRed()},Wu.prototype.mul=function(e){return e=new Ku(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Wu.prototype.mulAdd=function(e,t,i){var r=[this,t],n=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},Wu.prototype.jmulAdd=function(e,t,i){var r=[this,t],n=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},Wu.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Wu.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return t},Wu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Hu(Zu,Vu.BasePoint),Ju.prototype.jpoint=function(e,t,i){return new Zu(this,e,t,i)},Zu.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(i,r)},Zu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Zu.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(i),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(i.redMul(this.z)),s=r.redSub(n),c=a.redSub(o);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=s.redSqr(),u=d.redMul(s),l=r.redMul(d),h=c.redSqr().redIAdd(u).redISub(l).redISub(l),f=c.redMul(l.redISub(h)).redISub(a.redMul(u)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,p)},Zu.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,r=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),o=i.redSub(r),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),d=c.redMul(o),u=i.redMul(c),l=s.redSqr().redIAdd(d).redISub(u).redISub(u),h=s.redMul(u.redISub(l)).redISub(n.redMul(d)),f=this.z.redMul(o);return this.curve.jpoint(l,h,f)},Zu.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var r=this.curve.a,n=this.curve.tinv,a=this.x,o=this.y,s=this.z,c=s.redSqr().redSqr(),d=o.redAdd(o);for(t=0;t<e;t++){var u=a.redSqr(),l=d.redSqr(),h=l.redSqr(),f=u.redAdd(u).redIAdd(u).redIAdd(r.redMul(c)),p=a.redMul(l),g=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),b=f.redMul(m);b=b.redIAdd(b).redISub(h);var v=d.redMul(s);t+1<e&&(c=c.redMul(h)),a=g,s=v,d=b}return this.curve.jpoint(a,d.redMul(n),s)},Zu.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Zu.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r),c=s.redSqr().redISub(o).redISub(o),d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),e=c,t=s.redMul(o.redISub(c)).redISub(d),i=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),f=this.x.redAdd(l).redSqr().redISub(u).redISub(h);f=f.redIAdd(f);var p=u.redAdd(u).redIAdd(u),g=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(e,t,i)},Zu.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=s.redSqr().redISub(o).redISub(o);e=c;var d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),t=s.redMul(o.redISub(c)).redISub(d),i=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),f=this.x.redSub(u).redMul(this.x.redAdd(u));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),g=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(g),i=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,i)},Zu.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,r=this.z,n=r.redSqr().redSqr(),a=t.redSqr(),o=i.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(n)),c=t.redAdd(t),d=(c=c.redIAdd(c)).redMul(o),u=s.redSqr().redISub(d.redAdd(d)),l=d.redISub(u),h=o.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(l).redISub(h),p=i.redAdd(i).redMul(r);return this.curve.jpoint(u,f,p)},Zu.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),r=t.redSqr(),n=e.redAdd(e).redIAdd(e),a=n.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),c=r.redIAdd(r);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=n.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(c),u=t.redMul(d);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(s).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(d.redMul(c.redISub(d)).redISub(o.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(o).redSqr().redISub(i).redISub(s);return this.curve.jpoint(l,h,f)},Zu.prototype.mul=function(e,t){return e=new Ku(e,t),this.curve._wnafMul(this,e)},Zu.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(0!==this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),n=i.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(r)).cmpn(0)},Zu.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(i))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},Zu.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Zu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Yu=_u,Qu=Uu,Xu=Lu,el=yu;function tl(e){Xu.call(this,"mont",e),this.a=new Yu(e.a,16).toRed(this.red),this.b=new Yu(e.b,16).toRed(this.red),this.i4=new Yu(4).toRed(this.red).redInvm(),this.two=new Yu(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Qu(tl,Xu);var il=tl;function rl(e,t,i){Xu.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Yu(t,16),this.z=new Yu(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}tl.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),r=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},Qu(rl,Xu.BasePoint),tl.prototype.decodePoint=function(e,t){return this.point(el.toArray(e,t),1)},tl.prototype.point=function(e,t){return new rl(this,e,t)},tl.prototype.pointFromJSON=function(e){return rl.fromJSON(this,e)},rl.prototype.precompute=function(){},rl.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},rl.fromJSON=function(e,t){return new rl(e,t[0],t[1]||e.one)},rl.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},rl.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},rl.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),r=e.redMul(t),n=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},rl.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},rl.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(i),o=n.redMul(r),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},rl.prototype.mul=function(e){for(var t=e.clone(),i=this,r=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},rl.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},rl.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},rl.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},rl.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},rl.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var nl=_u,al=Uu,ol=Lu,sl=yu.assert;function cl(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,ol.call(this,"edwards",e),this.a=new nl(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new nl(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new nl(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),sl(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}al(cl,ol);var dl=cl;function ul(e,t,i,r,n){ol.BasePoint.call(this,e,"projective"),null===t&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new nl(t,16),this.y=new nl(i,16),this.z=r?new nl(r,16):this.curve.one,this.t=n&&new nl(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}cl.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},cl.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},cl.prototype.jpoint=function(e,t,i,r){return this.point(e,t,i,r)},cl.prototype.pointFromX=function(e,t){(e=new nl(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),r=this.c2.redSub(this.a.redMul(i)),n=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=r.redMul(n.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=o.fromRed().isOdd();return(t&&!s||!t&&s)&&(o=o.redNeg()),this.point(e,o)},cl.prototype.pointFromY=function(e,t){(e=new nl(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),r=i.redSub(this.c2),n=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(n.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},cl.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),r=t.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===r.cmp(n)},al(ul,ol.BasePoint),cl.prototype.pointFromJSON=function(e){return ul.fromJSON(this,e)},cl.prototype.point=function(e,t,i,r){return new ul(this,e,t,i,r)},ul.fromJSON=function(e,t){return new ul(e,t[0],t[1],t[2])},ul.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},ul.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},ul.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=r.redAdd(t),o=a.redSub(i),s=r.redSub(t),c=n.redMul(o),d=a.redMul(s),u=n.redMul(s),l=o.redMul(a);return this.curve.point(c,d,l,u)},ul.prototype._projDbl=function(){var e,t,i,r,n,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var d=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(e=o.redSub(s).redSub(c).redMul(d.redSub(this.curve.two)),t=d.redMul(r.redSub(c)),i=d.redSqr().redSub(d).redSub(d)):(n=this.z.redSqr(),a=d.redSub(n).redISub(n),e=o.redSub(s).redISub(c).redMul(a),t=d.redMul(r.redSub(c)),i=d.redMul(a))}else r=s.redAdd(c),n=this.curve._mulC(this.z).redSqr(),a=r.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(r)).redMul(a),t=this.curve._mulC(r).redMul(s.redISub(c)),i=r.redMul(a);return this.curve.point(e,t,i)},ul.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ul.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=i.redSub(t),o=n.redSub(r),s=n.redAdd(r),c=i.redAdd(t),d=a.redMul(o),u=s.redMul(c),l=a.redMul(c),h=o.redMul(s);return this.curve.point(d,u,h,l)},ul.prototype._projAdd=function(e){var t,i,r=this.z.redMul(e.z),n=r.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),d=n.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),l=r.redMul(c).redMul(u);return this.curve.twisted?(t=r.redMul(d).redMul(o.redSub(this.curve._mulA(a))),i=c.redMul(d)):(t=r.redMul(d).redMul(o.redSub(a)),i=this.curve._mulC(c).redMul(d)),this.curve.point(l,t,i)},ul.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},ul.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},ul.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},ul.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},ul.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},ul.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ul.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ul.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ul.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},ul.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},ul.prototype.toP=ul.prototype.normalize,ul.prototype.mixedAdd=ul.prototype.add,function(e){var t=e;t.base=Lu,t.short=Gu,t.mont=il,t.edwards=dl}(Ru);var ll={},hl={},fl={},pl=Au,gl=Uu;function ml(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function bl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function vl(e){return 1===e.length?"0"+e:e}function yl(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}fl.inherits=gl,fl.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)i.push(parseInt(e[n]+e[n+1],16))}else for(var r=0,n=0;n<e.length;n++){var a=e.charCodeAt(n);a<128?i[r++]=a:a<2048?(i[r++]=a>>6|192,i[r++]=63&a|128):ml(e,n)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),i[r++]=a>>18|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128,i[r++]=63&a|128):(i[r++]=a>>12|224,i[r++]=a>>6&63|128,i[r++]=63&a|128)}else for(n=0;n<e.length;n++)i[n]=0|e[n];return i},fl.toHex=function(e){for(var t="",i=0;i<e.length;i++)t+=vl(e[i].toString(16));return t},fl.htonl=bl,fl.toHex32=function(e,t){for(var i="",r=0;r<e.length;r++){var n=e[r];"little"===t&&(n=bl(n)),i+=yl(n.toString(16))}return i},fl.zero2=vl,fl.zero8=yl,fl.join32=function(e,t,i,r){var n=i-t;pl(n%4==0);for(var a=new Array(n/4),o=0,s=t;o<a.length;o++,s+=4){var c;c="big"===r?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[o]=c>>>0}return a},fl.split32=function(e,t){for(var i=new Array(4*e.length),r=0,n=0;r<e.length;r++,n+=4){var a=e[r];"big"===t?(i[n]=a>>>24,i[n+1]=a>>>16&255,i[n+2]=a>>>8&255,i[n+3]=255&a):(i[n+3]=a>>>24,i[n+2]=a>>>16&255,i[n+1]=a>>>8&255,i[n]=255&a)}return i},fl.rotr32=function(e,t){return e>>>t|e<<32-t},fl.rotl32=function(e,t){return e<<t|e>>>32-t},fl.sum32=function(e,t){return e+t>>>0},fl.sum32_3=function(e,t,i){return e+t+i>>>0},fl.sum32_4=function(e,t,i,r){return e+t+i+r>>>0},fl.sum32_5=function(e,t,i,r,n){return e+t+i+r+n>>>0},fl.sum64=function(e,t,i,r){var n=e[t],a=r+e[t+1]>>>0,o=(a<r?1:0)+i+n;e[t]=o>>>0,e[t+1]=a},fl.sum64_hi=function(e,t,i,r){return(t+r>>>0<t?1:0)+e+i>>>0},fl.sum64_lo=function(e,t,i,r){return t+r>>>0},fl.sum64_4_hi=function(e,t,i,r,n,a,o,s){var c=0,d=t;return c+=(d=d+r>>>0)<t?1:0,c+=(d=d+a>>>0)<a?1:0,e+i+n+o+(c+=(d=d+s>>>0)<s?1:0)>>>0},fl.sum64_4_lo=function(e,t,i,r,n,a,o,s){return t+r+a+s>>>0},fl.sum64_5_hi=function(e,t,i,r,n,a,o,s,c,d){var u=0,l=t;return u+=(l=l+r>>>0)<t?1:0,u+=(l=l+a>>>0)<a?1:0,u+=(l=l+s>>>0)<s?1:0,e+i+n+o+c+(u+=(l=l+d>>>0)<d?1:0)>>>0},fl.sum64_5_lo=function(e,t,i,r,n,a,o,s,c,d){return t+r+a+s+d>>>0},fl.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},fl.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},fl.shr64_hi=function(e,t,i){return e>>>i},fl.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0};var _l={},wl=fl,xl=Au;function Al(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_l.BlockHash=Al,Al.prototype.update=function(e,t){if(e=wl.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=wl.join32(e,0,e.length-i,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Al.prototype.digest=function(e){return this.update(this._pad()),xl(null===this.pending),this._digest(e)},Al.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,i=t-(e+this.padLength)%t,r=new Array(i+this.padLength);r[0]=128;for(var n=1;n<i;n++)r[n]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)r[n++]=0;r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=e>>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,a=8;a<this.padLength;a++)r[n++]=0;return r};var El={},Sl={},kl=fl.rotr32;function Ml(e,t,i){return e&t^~e&i}function Cl(e,t,i){return e&t^e&i^t&i}function Il(e,t,i){return e^t^i}Sl.ft_1=function(e,t,i,r){return 0===e?Ml(t,i,r):1===e||3===e?Il(t,i,r):2===e?Cl(t,i,r):void 0},Sl.ch32=Ml,Sl.maj32=Cl,Sl.p32=Il,Sl.s0_256=function(e){return kl(e,2)^kl(e,13)^kl(e,22)},Sl.s1_256=function(e){return kl(e,6)^kl(e,11)^kl(e,25)},Sl.g0_256=function(e){return kl(e,7)^kl(e,18)^e>>>3},Sl.g1_256=function(e){return kl(e,17)^kl(e,19)^e>>>10};var Dl=fl,Tl=_l,Rl=Sl,Bl=Dl.rotl32,zl=Dl.sum32,Pl=Dl.sum32_5,Ol=Rl.ft_1,Fl=Tl.BlockHash,Nl=[1518500249,1859775393,2400959708,3395469782];function Ll(){if(!(this instanceof Ll))return new Ll;Fl.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Dl.inherits(Ll,Fl);var jl=Ll;Ll.blockSize=512,Ll.outSize=160,Ll.hmacStrength=80,Ll.padLength=64,Ll.prototype._update=function(e,t){for(var i=this.W,r=0;r<16;r++)i[r]=e[t+r];for(;r<i.length;r++)i[r]=Bl(i[r-3]^i[r-8]^i[r-14]^i[r-16],1);var n=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4];for(r=0;r<i.length;r++){var d=~~(r/20),u=Pl(Bl(n,5),Ol(d,a,o,s),c,i[r],Nl[d]);c=s,s=o,o=Bl(a,30),a=n,n=u}this.h[0]=zl(this.h[0],n),this.h[1]=zl(this.h[1],a),this.h[2]=zl(this.h[2],o),this.h[3]=zl(this.h[3],s),this.h[4]=zl(this.h[4],c)},Ll.prototype._digest=function(e){return"hex"===e?Dl.toHex32(this.h,"big"):Dl.split32(this.h,"big")};var Ul=fl,ql=_l,Kl=Sl,Hl=Au,Vl=Ul.sum32,$l=Ul.sum32_4,Jl=Ul.sum32_5,Gl=Kl.ch32,Wl=Kl.maj32,Zl=Kl.s0_256,Yl=Kl.s1_256,Ql=Kl.g0_256,Xl=Kl.g1_256,eh=ql.BlockHash,th=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ih(){if(!(this instanceof ih))return new ih;eh.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=th,this.W=new Array(64)}Ul.inherits(ih,eh);var rh=ih;ih.blockSize=512,ih.outSize=256,ih.hmacStrength=192,ih.padLength=64,ih.prototype._update=function(e,t){for(var i=this.W,r=0;r<16;r++)i[r]=e[t+r];for(;r<i.length;r++)i[r]=$l(Xl(i[r-2]),i[r-7],Ql(i[r-15]),i[r-16]);var n=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4],d=this.h[5],u=this.h[6],l=this.h[7];for(Hl(this.k.length===i.length),r=0;r<i.length;r++){var h=Jl(l,Yl(c),Gl(c,d,u),this.k[r],i[r]),f=Vl(Zl(n),Wl(n,a,o));l=u,u=d,d=c,c=Vl(s,h),s=o,o=a,a=n,n=Vl(h,f)}this.h[0]=Vl(this.h[0],n),this.h[1]=Vl(this.h[1],a),this.h[2]=Vl(this.h[2],o),this.h[3]=Vl(this.h[3],s),this.h[4]=Vl(this.h[4],c),this.h[5]=Vl(this.h[5],d),this.h[6]=Vl(this.h[6],u),this.h[7]=Vl(this.h[7],l)},ih.prototype._digest=function(e){return"hex"===e?Ul.toHex32(this.h,"big"):Ul.split32(this.h,"big")};var nh=fl,ah=rh;function oh(){if(!(this instanceof oh))return new oh;ah.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}nh.inherits(oh,ah);var sh=oh;oh.blockSize=512,oh.outSize=224,oh.hmacStrength=192,oh.padLength=64,oh.prototype._digest=function(e){return"hex"===e?nh.toHex32(this.h.slice(0,7),"big"):nh.split32(this.h.slice(0,7),"big")};var ch=fl,dh=_l,uh=Au,lh=ch.rotr64_hi,hh=ch.rotr64_lo,fh=ch.shr64_hi,ph=ch.shr64_lo,gh=ch.sum64,mh=ch.sum64_hi,bh=ch.sum64_lo,vh=ch.sum64_4_hi,yh=ch.sum64_4_lo,_h=ch.sum64_5_hi,wh=ch.sum64_5_lo,xh=dh.BlockHash,Ah=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Eh(){if(!(this instanceof Eh))return new Eh;xh.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Ah,this.W=new Array(160)}ch.inherits(Eh,xh);var Sh=Eh;function kh(e,t,i,r,n){var a=e&i^~e&n;return a<0&&(a+=4294967296),a}function Mh(e,t,i,r,n,a){var o=t&r^~t&a;return o<0&&(o+=4294967296),o}function Ch(e,t,i,r,n){var a=e&i^e&n^i&n;return a<0&&(a+=4294967296),a}function Ih(e,t,i,r,n,a){var o=t&r^t&a^r&a;return o<0&&(o+=4294967296),o}function Dh(e,t){var i=lh(e,t,28)^lh(t,e,2)^lh(t,e,7);return i<0&&(i+=4294967296),i}function Th(e,t){var i=hh(e,t,28)^hh(t,e,2)^hh(t,e,7);return i<0&&(i+=4294967296),i}function Rh(e,t){var i=lh(e,t,14)^lh(e,t,18)^lh(t,e,9);return i<0&&(i+=4294967296),i}function Bh(e,t){var i=hh(e,t,14)^hh(e,t,18)^hh(t,e,9);return i<0&&(i+=4294967296),i}function zh(e,t){var i=lh(e,t,1)^lh(e,t,8)^fh(e,t,7);return i<0&&(i+=4294967296),i}function Ph(e,t){var i=hh(e,t,1)^hh(e,t,8)^ph(e,t,7);return i<0&&(i+=4294967296),i}function Oh(e,t){var i=lh(e,t,19)^lh(t,e,29)^fh(e,t,6);return i<0&&(i+=4294967296),i}function Fh(e,t){var i=hh(e,t,19)^hh(t,e,29)^ph(e,t,6);return i<0&&(i+=4294967296),i}Eh.blockSize=1024,Eh.outSize=512,Eh.hmacStrength=192,Eh.padLength=128,Eh.prototype._prepareBlock=function(e,t){for(var i=this.W,r=0;r<32;r++)i[r]=e[t+r];for(;r<i.length;r+=2){var n=Oh(i[r-4],i[r-3]),a=Fh(i[r-4],i[r-3]),o=i[r-14],s=i[r-13],c=zh(i[r-30],i[r-29]),d=Ph(i[r-30],i[r-29]),u=i[r-32],l=i[r-31];i[r]=vh(n,a,o,s,c,d,u,l),i[r+1]=yh(n,a,o,s,c,d,u,l)}},Eh.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,r=this.h[0],n=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],c=this.h[5],d=this.h[6],u=this.h[7],l=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],b=this.h[14],v=this.h[15];uh(this.k.length===i.length);for(var y=0;y<i.length;y+=2){var _=b,w=v,x=Rh(l,h),A=Bh(l,h),E=kh(l,h,f,p,g),S=Mh(l,h,f,p,g,m),k=this.k[y],M=this.k[y+1],C=i[y],I=i[y+1],D=_h(_,w,x,A,E,S,k,M,C,I),T=wh(_,w,x,A,E,S,k,M,C,I);_=Dh(r,n),w=Th(r,n),x=Ch(r,n,a,o,s),A=Ih(r,n,a,o,s,c);var R=mh(_,w,x,A),B=bh(_,w,x,A);b=g,v=m,g=f,m=p,f=l,p=h,l=mh(d,u,D,T),h=bh(u,u,D,T),d=s,u=c,s=a,c=o,a=r,o=n,r=mh(D,T,R,B),n=bh(D,T,R,B)}gh(this.h,0,r,n),gh(this.h,2,a,o),gh(this.h,4,s,c),gh(this.h,6,d,u),gh(this.h,8,l,h),gh(this.h,10,f,p),gh(this.h,12,g,m),gh(this.h,14,b,v)},Eh.prototype._digest=function(e){return"hex"===e?ch.toHex32(this.h,"big"):ch.split32(this.h,"big")};var Nh=fl,Lh=Sh;function jh(){if(!(this instanceof jh))return new jh;Lh.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Nh.inherits(jh,Lh);var Uh=jh;jh.blockSize=1024,jh.outSize=384,jh.hmacStrength=192,jh.padLength=128,jh.prototype._digest=function(e){return"hex"===e?Nh.toHex32(this.h.slice(0,12),"big"):Nh.split32(this.h.slice(0,12),"big")},El.sha1=jl,El.sha224=sh,El.sha256=rh,El.sha384=Uh,El.sha512=Sh;var qh={},Kh=fl,Hh=_l,Vh=Kh.rotl32,$h=Kh.sum32,Jh=Kh.sum32_3,Gh=Kh.sum32_4,Wh=Hh.BlockHash;function Zh(){if(!(this instanceof Zh))return new Zh;Wh.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Yh(e,t,i,r){return e<=15?t^i^r:e<=31?t&i|~t&r:e<=47?(t|~i)^r:e<=63?t&r|i&~r:t^(i|~r)}function Qh(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Xh(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Kh.inherits(Zh,Wh),qh.ripemd160=Zh,Zh.blockSize=512,Zh.outSize=160,Zh.hmacStrength=192,Zh.padLength=64,Zh.prototype._update=function(e,t){for(var i=this.h[0],r=this.h[1],n=this.h[2],a=this.h[3],o=this.h[4],s=i,c=r,d=n,u=a,l=o,h=0;h<80;h++){var f=$h(Vh(Gh(i,Yh(h,r,n,a),e[ef[h]+t],Qh(h)),rf[h]),o);i=o,o=a,a=Vh(n,10),n=r,r=f,f=$h(Vh(Gh(s,Yh(79-h,c,d,u),e[tf[h]+t],Xh(h)),nf[h]),l),s=l,l=u,u=Vh(d,10),d=c,c=f}f=Jh(this.h[1],n,u),this.h[1]=Jh(this.h[2],a,l),this.h[2]=Jh(this.h[3],o,s),this.h[3]=Jh(this.h[4],i,c),this.h[4]=Jh(this.h[0],r,d),this.h[0]=f},Zh.prototype._digest=function(e){return"hex"===e?Kh.toHex32(this.h,"little"):Kh.split32(this.h,"little")};var ef=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],tf=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],rf=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],nf=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],af=fl,of=Au;function sf(e,t,i){if(!(this instanceof sf))return new sf(e,t,i);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(af.toArray(t,i))}var cf,df,uf=sf;sf.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),of(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},sf.prototype.update=function(e,t){return this.inner.update(e,t),this},sf.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=hl;t.utils=fl,t.common=_l,t.sha=El,t.ripemd=qh,t.hmac=uf,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(),function(e){var t,i=ll,r=hl,n=Ru,a=yu.assert;function o(e){"short"===e.type?this.curve=new n.short(e):"edwards"===e.type?this.curve=new n.edwards(e):this.curve=new n.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=df?cf:(df=1,cf={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}();var lf=hl,hf=Su,ff=Au;function pf(e){if(!(this instanceof pf))return new pf(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=hf.toArray(e.entropy,e.entropyEnc||"hex"),i=hf.toArray(e.nonce,e.nonceEnc||"hex"),r=hf.toArray(e.pers,e.persEnc||"hex");ff(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,r)}var gf=pf;pf.prototype._init=function(e,t,i){var r=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},pf.prototype._hmac=function(){return new lf.hmac(this.hash,this.K)},pf.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},pf.prototype.reseed=function(e,t,i,r){"string"!=typeof t&&(r=i,i=t,t=null),e=hf.toArray(e,t),i=hf.toArray(i,r),ff(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},pf.prototype.generate=function(e,t,i,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=i,i=t,t=null),i&&(i=hf.toArray(i,r||"hex"),this._update(i));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var a=n.slice(0,e);return this._update(i),this._reseed++,hf.encode(a,t)};var mf=_u,bf=yu.assert;function vf(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var yf=vf;vf.fromPublic=function(e,t,i){return t instanceof vf?t:new vf(e,{pub:t,pubEnc:i})},vf.fromPrivate=function(e,t,i){return t instanceof vf?t:new vf(e,{priv:t,privEnc:i})},vf.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},vf.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},vf.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},vf.prototype._importPrivate=function(e,t){this.priv=new mf(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},vf.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?bf(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||bf(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},vf.prototype.derive=function(e){return e.validate()||bf(e.validate(),"public point not validated"),e.mul(this.priv).getX()},vf.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},vf.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)},vf.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var _f=_u,wf=yu,xf=wf.assert;function Af(e,t){if(e instanceof Af)return e;this._importDER(e,t)||(xf(e.r&&e.s,"Signature without r or s"),this.r=new _f(e.r,16),this.s=new _f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Ef=Af;function Sf(){this.place=0}function kf(e,t){var i=e[t.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4)return!1;if(0===e[t.place])return!1;for(var n=0,a=0,o=t.place;a<r;a++,o++)n<<=8,n|=e[o],n>>>=0;return!(n<=127)&&(t.place=o,n)}function Mf(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t<i;)t++;return 0===t?e:e.slice(t)}function Cf(e,t){if(t<128)e.push(t);else{var i=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}Af.prototype._importDER=function(e,t){e=wf.toArray(e,t);var i=new Sf;if(48!==e[i.place++])return!1;var r=kf(e,i);if(!1===r)return!1;if(r+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var n=kf(e,i);if(!1===n)return!1;if(0!=(128&e[i.place]))return!1;var a=e.slice(i.place,n+i.place);if(i.place+=n,2!==e[i.place++])return!1;var o=kf(e,i);if(!1===o)return!1;if(e.length!==o+i.place)return!1;if(0!=(128&e[i.place]))return!1;var s=e.slice(i.place,o+i.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new _f(a),this.s=new _f(s),this.recoveryParam=null,!0},Af.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=Mf(t),i=Mf(i);!(i[0]||128&i[1]);)i=i.slice(1);var r=[2];Cf(r,t.length),(r=r.concat(t)).push(2),Cf(r,i.length);var n=r.concat(i),a=[48];return Cf(a,n.length),a=a.concat(n),wf.encode(a,e)};var If=_u,Df=gf,Tf=ll,Rf=Mu,Bf=yu.assert,zf=yf,Pf=Ef;function Of(e){if(!(this instanceof Of))return new Of(e);"string"==typeof e&&(Bf(Object.prototype.hasOwnProperty.call(Tf,e),"Unknown curve "+e),e=Tf[e]),e instanceof Tf.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ff=Of;Of.prototype.keyPair=function(e){return new zf(this,e)},Of.prototype.keyFromPrivate=function(e,t){return zf.fromPrivate(this,e,t)},Of.prototype.keyFromPublic=function(e,t){return zf.fromPublic(this,e,t)},Of.prototype.genKeyPair=function(e){e||(e={});for(var t=new Df({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Rf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),r=this.n.sub(new If(2));;){var n=new If(t.generate(i));if(!(n.cmp(r)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Of.prototype._truncateToN=function(e,t,i){var r;if(If.isBN(e)||"number"==typeof e)r=(e=new If(e,16)).byteLength();else if("object"==typeof e)r=e.length,e=new If(e,16);else{var n=e.toString();r=n.length+1>>>1,e=new If(n,16)}"number"!=typeof i&&(i=8*r);var a=i-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Of.prototype.sign=function(e,t,i,r){if("object"==typeof i&&(r=i,i=null),r||(r={}),"string"!=typeof e&&"number"!=typeof e&&!If.isBN(e)){Bf("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),Bf(e.length>>>0===e.length);for(var n=0;n<e.length;n++)Bf((255&e[n])===e[n])}t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,r.msgBitLength),Bf(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),o=t.getPrivate().toArray("be",a),s=e.toArray("be",a);Bf(new If(s).eq(e),"Can not sign message");for(var c=new Df({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),d=this.n.sub(new If(1)),u=0;;u++){var l=r.k?r.k(u):new If(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(d)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var f=h.getX(),p=f.umod(this.n);if(0!==p.cmpn(0)){var g=l.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==f.cmp(p)?2:0);return r.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new Pf({r:p,s:g,recoveryParam:m})}}}}}},Of.prototype.verify=function(e,t,i,r,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),i=this.keyFromPublic(i,r);var a=(t=new Pf(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,c=o.invm(this.n),d=c.mul(e).umod(this.n),u=c.mul(a).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(d,i.getPublic(),u)).isInfinity()&&s.eqXToP(a):!(s=this.g.mulAdd(d,i.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(a)},Of.prototype.recoverPubKey=function(e,t,i,r){Bf((3&i)===i,"The recovery param is more than two bits"),t=new Pf(t,r);var n=this.n,a=new If(e),o=t.r,s=t.s,c=1&i,d=i>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var u=t.r.invm(n),l=n.sub(a).mul(u).umod(n),h=s.mul(u).umod(n);return this.g.mulAdd(l,o,h)},Of.prototype.getKeyRecoveryParam=function(e,t,i,r){if(null!==(t=new Pf(t,r)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(i))return n}throw new Error("Unable to find valid recovery factor")};var Nf=yu,Lf=Nf.assert,jf=Nf.parseBytes,Uf=Nf.cachedProperty;function qf(e,t){this.eddsa=e,this._secret=jf(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=jf(t.pub)}qf.fromPublic=function(e,t){return t instanceof qf?t:new qf(e,{pub:t})},qf.fromSecret=function(e,t){return t instanceof qf?t:new qf(e,{secret:t})},qf.prototype.secret=function(){return this._secret},Uf(qf,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Uf(qf,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Uf(qf,"privBytes",(function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r})),Uf(qf,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Uf(qf,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Uf(qf,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),qf.prototype.sign=function(e){return Lf(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},qf.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},qf.prototype.getSecret=function(e){return Lf(this._secret,"KeyPair is public only"),Nf.encode(this.secret(),e)},qf.prototype.getPublic=function(e){return Nf.encode(this.pubBytes(),e)};var Kf=qf,Hf=_u,Vf=yu,$f=Vf.assert,Jf=Vf.cachedProperty,Gf=Vf.parseBytes;function Wf(e,t){this.eddsa=e,"object"!=typeof t&&(t=Gf(t)),Array.isArray(t)&&($f(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),$f(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Hf&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Jf(Wf,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Jf(Wf,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Jf(Wf,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Jf(Wf,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Wf.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Wf.prototype.toHex=function(){return Vf.encode(this.toBytes(),"hex").toUpperCase()};var Zf=Wf,Yf=hl,Qf=ll,Xf=yu,ep=Xf.assert,tp=Xf.parseBytes,ip=Kf,rp=Zf;function np(e){if(ep("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof np))return new np(e);e=Qf[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=Yf.sha512}var ap=np;np.prototype.sign=function(e,t){e=tp(e);var i=this.keyFromSecret(t),r=this.hashInt(i.messagePrefix(),e),n=this.g.mul(r),a=this.encodePoint(n),o=this.hashInt(a,i.pubBytes(),e).mul(i.priv()),s=r.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},np.prototype.verify=function(e,t,i){if(e=tp(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(i),n=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(n)).eq(a)},np.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return Xf.intFromLE(e.digest()).umod(this.curve.n)},np.prototype.keyFromPublic=function(e){return ip.fromPublic(this,e)},np.prototype.keyFromSecret=function(e){return ip.fromSecret(this,e)},np.prototype.makeSignature=function(e){return e instanceof rp?e:new rp(this,e)},np.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},np.prototype.decodePoint=function(e){var t=(e=Xf.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),r=0!=(128&e[t]),n=Xf.intFromLE(i);return this.curve.pointFromY(n,r)},np.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},np.prototype.decodeInt=function(e){return Xf.intFromLE(e)},np.prototype.isPoint=function(e){return e instanceof this.pointClass},function(e){var t=e;t.version=vu,t.utils=yu,t.rand=Mu,t.curve=Ru,t.curves=ll,t.ec=Ff,t.eddsa=ap}(bu);var op,sp,cp,dp={},up={get exports(){return dp},set exports(e){dp=e}};
|
|
1
|
+
function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function n(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o(e,r){return Object.entries(r).reduce(((r,n)=>{let[i,s]=n;return t(t({},r),{},{[i]:a.isPrototypeOf(s)?new s(e.slug):"function"==typeof s?s.bind(e):"object"==typeof s&&!Array.isArray(s)&&s?o(e,s):s})}),{})}"undefined"==typeof globalThis&&("undefined"!=typeof window?(window.globalThis=window,window.global=window):"undefined"!=typeof self&&(self.globalThis=self,self.global=self)),Object.defineProperty(exports,"__esModule",{value:!0});class a{constructor(e){this.slug=e}static create(e){return class extends a{constructor(t){super(t),Object.assign(this,o(this,e(this)))}}}}var s=Object.freeze({__proto__:null,Agent:a});const u=new Map;function c(e,t){var r,n;null===(r=u.get(e))||void 0===r||r.forEach((n=e=>e(t),function(){try{return n(...arguments)}catch(e){console.log(e)}}))}const l=Symbol("MODULE_INITIALIZED");var d=Object.freeze({__proto__:null,MODULE_INITIALIZED:l,emit:c,off:function(e,t){const r=u.get(e);if(!r)return;const n=r.indexOf(t);-1!==n&&r.splice(n,1)},on:function(e,t){var r;u.has(e)?null===(r=u.get(e))||void 0===r||r.push(t):u.set(e,[t])}});let h=null;function f(e){h=e}var p=Object.freeze({__proto__:null,getInitConfig:function(){return h},get initConfig(){return h},setInitConfig:f});function g(e){f(e),c(l,void 0)}var m=Object.freeze({__proto__:null,initialize:g});function y(e,t){const r=!e||"object"!=typeof e||Array.isArray(e)?{}:e;return[t.reduce(((e,t)=>{if(t in e){const r=e[t];if(null!==r&&"object"==typeof r&&!Array.isArray(r))return r}const r={};return e[t]=r,r}),r),r]}function v(e,t){let r=e;return t.every((e=>!(!r||"object"!=typeof r||Array.isArray(r)||!(e in r))&&(r=r[e],!0)),e)}const w="tsec",b="general";function _(e){return e?b:h.clientId}function A(e){return function(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}((e?sessionStorage:localStorage).getItem(w))}function E(e,t){const r=e?sessionStorage:localStorage,n=t(A(e));r.setItem(w,JSON.stringify(n))}var C=Object.freeze({__proto__:null,COMMON_STORAGE_KEY:w,GENERAL_ID_KEY:b,getValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=_(!!t.isGeneral),n=A(!!t.sessionOnly),[i]=y(n,[this.slug.toString(),r]);return i[e]},hasValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=_(!!t.isGeneral),n=A(!!t.sessionOnly);return v(n,[this.slug.toString(),r,e])},removeValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=_(!!t.isGeneral);E(!!t.sessionOnly,(t=>{const[n,i]=y(t,[this.slug.toString(),r]);return delete n[e],i}))},setValue:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=_(!!r.isGeneral);E(!!r.sessionOnly,(r=>{const[i,o]=y(r,[this.slug.toString(),n]);return i[e]=t,o}))}});const x="RSA-PSS",S=async(e,t)=>await window.crypto.subtle.generateKey({name:e,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,t),I=async()=>await S("RSA-OAEP",["encrypt","decrypt"]),T=async()=>await S(x,["sign"]),M=async(e,t)=>{const r=(new TextEncoder).encode(t);return await window.crypto.subtle.sign({name:x,saltLength:32},e,r)};class D{constructor(e,t,r){this.slug=e,this.dbName=t,this.dbVersion=r}queryObjectStore(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{attemptToRecoverDB:i=!0}=n,o=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB,a=`${this.slug}:${this.dbName}`,s=o.open(a,this.dbVersion||1);s.onupgradeneeded=()=>{var t;const r=s.result;(null===(t=null==r?void 0:r.objectStoreNames)||void 0===t?void 0:t.contains)&&!r.objectStoreNames.contains(e)&&r.createObjectStore(e,{keyPath:"key"})},s.onsuccess=()=>{const u=s.result;let c;try{c=u.transaction(e,(null==n?void 0:n.operation)||"readwrite")}catch(s){if(i&&s instanceof DOMException&&"NotFoundError"===s.name){u.close();return void(o.deleteDatabase(a).onsuccess=()=>{this.queryObjectStore(e,r,t(t({},n),{},{attemptToRecoverDB:!1}))})}throw s}const l=c.objectStore(e);r(l),c.oncomplete=()=>{u.close()}}}put(e,t,r){return new Promise(((n,i)=>{this.queryObjectStore(e,(e=>{const o=e.put({key:t,value:r});o.onsuccess=()=>{n(o.result)},o.onerror=e=>{i("Failed adding item to objectStore, err: "+e)}}))}))}add(e,t,r){return new Promise(((n,i)=>{this.queryObjectStore(e,(e=>{const o=e.add({key:t,value:r});o.onsuccess=()=>{n(o.result)},o.onerror=e=>{const t=e.target.error;i(t)}}))}))}get(e,t){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const i=e.get(t);i.onsuccess=()=>{var e;i.result?r(null===(e=i.result)||void 0===e?void 0:e.value):r(void 0)},i.onerror=e=>{n("Failed adding item to objectStore, err: "+e)}}))}))}getAll(e,t){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const i=e.getAll(null,t);i.onsuccess=()=>{if(i.result){const e=i.result;(null==e?void 0:e.length)?r(e.map((e=>null==e?void 0:e.value))):r(e)}else r([])},i.onerror=e=>{n("Failed getting items, err: "+e)}}))}))}delete(e,t){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const i=e.delete(t);i.onsuccess=()=>{r()},i.onerror=e=>{n(`Failed deleting key: '${t}' from objectStore, err: `+e)}}))}))}clear(e){return new Promise(((t,r)=>{this.queryObjectStore(e,(e=>{const n=e.clear();n.onsuccess=()=>{t()},n.onerror=e=>{r("Failed clearing objectStore, err: "+e)}}))}))}}const R="platform",O="init",k="completed",N="RSA2048",P=[O,k];class B{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sign",r=arguments.length>2?arguments[2]:void 0;var n,i,o,a;this.agent=e,this.keysType=t,this.options=r,this._extractingKeysPromise=null;const s=!(null===(n=this.options)||void 0===n?void 0:n.productScope);this.keysDatabaseName=s||!(null===(i=this.options)||void 0===i?void 0:i.indexedDBName)?"ts_crypto_binding":this.options.indexedDBName,this.dbVersion=s?1:(null===(o=this.options)||void 0===o?void 0:o.dbVersion)||1,this.keysStoreName=s||!(null===(a=this.options)||void 0===a?void 0:a.keysStoreName)?"identifiers_store":this.options.keysStoreName,this.indexedDBClient=new D(s?R:e.slug,this.keysDatabaseName,this.dbVersion),this.indexedDBClientFallback=new D((s?R:e.slug)+`:${h.clientId}`,this.keysDatabaseName,this.dbVersion)}getKeysRecordKey(){return`${this.keysType}_keys`}getRotatedKeysRecordKey(){return`rotated_${this.keysType}_keys`}getRotatedKeysRecordKeyPending(){return`rotated_pending_${this.keysType}_keys`}arrayBufferToBase64(e){return window.btoa(String.fromCharCode(...new Uint8Array(e)))}async getPKRepresentations(e){const t=await crypto.subtle.exportKey("spki",e);return{arrayBufferKey:t,base64Key:this.arrayBufferToBase64(t)}}async generateKeyPair(){return"sign"==this.keysType?await T():await I()}async calcKeyIdentifier(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map((e=>e.toString(16).padStart(2,"0"))).join("")}async extractKeysData(){if(this._extractingKeysPromise)return this._extractingKeysPromise;this._extractingKeysPromise=(async()=>{var e,t;const r=(null===(t=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===t?void 0:t.isEnabled)?await this.getRotatedKeysData():await this.getKeysData(),{base64Key:n}=await this.getPKRepresentations(r.publicKey);return this.publicKeyBase64=n,this.keyIdentifier=r.keyIdentifier,r})();try{return await this._extractingKeysPromise}finally{this._extractingKeysPromise=null}}async generateKeyPairData(e){const r=await this.generateKeyPair(),{arrayBufferKey:n}=await this.getPKRepresentations(r.publicKey),i=e||await this.calcKeyIdentifier(n);return t(t({},r),{},{keyIdentifier:i,createdDate:Date.now()})}shouldKeyBeRotated(e){var t;const r=null===(t=this.options)||void 0===t?void 0:t.keyRotation;if(!(null==r?void 0:r.isEnabled)||!r.expiryDays||void 0===r.startedAt)return!1;const n=24*r.expiryDays*60*60*1e3,i=e.createdDate&&e.createdDate>=r.startedAt?e.createdDate:r.startedAt;return Date.now()-i>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(e,t){try{return await this.indexedDBClient.add(this.keysStoreName,e,t),t}catch(t){if(t instanceof DOMException&&"ConstraintError"===t.name){const t=await this.indexedDBClient.get(this.keysStoreName,e);if(t)return t}throw t}}async getKeysData(){const e=this.getKeysRecordKey();let t=await this.extractMainKeysData();if(t)return t;if(t=await this.extractFallbackMainKeysData(),t)return this.saveKeyData(e,t);const r=await this.generateKeyPairData();return this.saveKeyData(e,r)}async getOrCreateRotatedKeys(){let e=await this.extractRotatedKeysData();if(!e){const r=this.getRotatedKeysRecordKey(),n=await this.getKeysData(),i=t(t({},n),{},{createdDate:n.createdDate||Date.now()});e=await this.saveKeyData(r,i)}return e}async getRotatedKeysData(){const e=await this.getOrCreateRotatedKeys();if(this.shouldKeyBeRotated(e)){if(!await this.extractPendingRotatedKeysData()){const t=this.getRotatedKeysRecordKeyPending(),r=await this.generateKeyPairData(e.keyIdentifier);await this.saveKeyData(t,r)}}return e}async getPublicData(){return this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData(),{publicKey:this.publicKeyBase64,keyIdentifier:this.keyIdentifier}}async sign(e){if("sign"==this.keysType){const{privateKey:t}=await this.extractKeysData(),r=await M(t,e);return this.arrayBufferToBase64(r)}throw new Error("keysType must be 'sign' in order to use sign keys")}async clearKeys(){const e=this.getKeysRecordKey();await this.indexedDBClient.delete(this.keysStoreName,e)}getBaseRotationPayload(){return{keyIdentifier:this.keyIdentifier,slot:this.getRotatedKeysRecordKey(),publicKey:this.publicKeyBase64,publicKeyType:N,tenantId:this.options.keyRotation.tenantId}}async getRotationData(){var e,r;if(!(null===(r=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===r?void 0:r.isEnabled))return;this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData();const n=await this.extractPendingRotatedKeysData();if(n){const{base64Key:e}=await this.getPKRepresentations(n.publicKey),{privateKey:r}=await this.extractKeysData(),i=t(t({},this.getBaseRotationPayload()),{},{newPublicKey:e,createdDate:n.createdDate,newPublicKeyType:N}),o=JSON.stringify(i);return{data:o,signature:await this.signPayload(o,r)}}const i=await this.extractRotatedKeysData();if(i&&!1===i.confirmed){await this.extractKeysData();const e=JSON.stringify(this.getBaseRotationPayload());return{data:e,signature:await this.signPayload(e,i.privateKey)}}}async signPayload(e,t){const r=await M(t,e);return this.arrayBufferToBase64(r)}async handleRotateResponse(e){if(P.includes(e))if(e===O){const e=await this.extractPendingRotatedKeysData();if(e){await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKey());const r=t(t({},e),{},{confirmed:!1});await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),r),await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKeyPending());const{base64Key:n}=await this.getPKRepresentations(e.publicKey);this.publicKeyBase64=n,this.keyIdentifier=e.keyIdentifier}}else if(e===k){const e=await this.extractRotatedKeysData();e&&!1===e.confirmed&&await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),t(t({},e),{},{confirmed:!0}))}}}var F=Object.freeze({__proto__:null,createCryptoBinding:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sign",t=arguments.length>1?arguments[1]:void 0;return new B(this,e,t)},generateRSAKeyPair:I,generateRSASignKeyPair:T,signAssymetric:M,verifyAssymetric:async(e,t,r)=>{const n=(new TextEncoder).encode(t);return await window.crypto.subtle.verify(x,e,r,n)}}),L=Object.freeze({__proto__:null});const z=a.create((e=>{class t extends Error{constructor(t,r){super(`${e.slug}-${t} ${r}`)}}return{TsError:t,TsInternalError:class extends t{constructor(e){super(e,"Internal error")}}}}));var U=a.create((()=>t({exceptions:z},s)));class j{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.agent=e,this.middlewares=t,this.logs=[]}info(e,t){this.pushLog(3,e,t)}warn(e,t){this.pushLog(4,e,t)}error(e,t){this.pushLog(5,e,t)}pushLog(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.logs.push({timestamp:Date.now(),module:this.agent.slug,severity:e,fields:r,message:t});const n=this.middlewares.map((e=>e(this)));Promise.all(n).catch((()=>{}))}}var V=Object.freeze({__proto__:null,consoleMiddleware:function(e){const t=e.logs[e.logs.length-1];console.log(`${t.severity} ${t.message}`,t.fields)},createSdkLogger:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new j(this,e)}});function H(e,t){if(!(null==e?void 0:e.trim()))return"";if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;const r="http://mock.com",n=new URL(r);n.search=(null==t?void 0:t.toString())||"",n.pathname=e;return n.href.replace(r,"")}const G={"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent};function q(e,r,n){var i;const o=(a=r||{},encodeURI(JSON.stringify(a)).split(/%..|./).length-1);var a;return{method:e,headers:t(t(t({},{"X-TS-body-size":String(o)}),G),n||{}),body:null!==(i=r&&JSON.stringify(r||{}))&&void 0!==i?i:void 0}}function W(e,t,r,n,i){const o=H(e,n),a=q(t,r,i);return fetch(o,a)}async function K(e,t,r,n,i){let o;if(o=await W(e,t,r,n,i),!o.ok)throw new Error("Request failed");return o}var X=Object.freeze({__proto__:null,httpDelete:async function(e,r){const n=await K(e,"DELETE",void 0,void 0,r);return t(t({data:await n.json()},n),{},{headers:n.headers})},httpGet:async function(e,r,n){const i=await K(e,"GET",void 0,r,n);return t(t({data:await i.json()},i),{},{headers:i.headers})},httpPost:async function(e,r,n,i){const o=await K(e,"POST",r,n,i);return t(t({data:await o.json()},o),{},{headers:o.headers})},httpPut:async function(e,r,n,i){const o=await K(e,"PUT",r,n,i);return t(t({data:await o.json()},o),{},{headers:o.headers})},init:q}),Y=a.create((()=>({events:d,moduleMetadata:p,mainEntry:m,utils:U,storage:C,crypto:F,indexedDB:L,logger:V,http:X}))),Z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];r.push.apply(r,arguments);var n=Function.bind.apply(t,r);return new n}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Q={},ee={};function te(e){let t=e.length;for(;--t>=0;)e[t]=0}const re=256,ne=286,ie=30,oe=15,ae=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]),se=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]),ue=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ce=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),le=new Array(576);te(le);const de=new Array(60);te(de);const he=new Array(512);te(he);const fe=new Array(256);te(fe);const pe=new Array(29);te(pe);const ge=new Array(ie);function me(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let ye,ve,we;function be(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}te(ge);const _e=e=>e<256?he[e]:he[256+(e>>>7)],Ae=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ee=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,Ae(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Ce=(e,t,r)=>{Ee(e,r[2*t],r[2*t+1])},xe=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},Se=(e,t,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=oe;i++)n[i]=a=a+r[i-1]<<1;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=xe(n[t]++,t))}},Ie=e=>{let t;for(t=0;t<ne;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ie;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Te=e=>{e.bi_valid>8?Ae(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Me=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},De=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Me(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Me(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},Re=(e,t,r)=>{let n,i,o,a,s=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?Ce(e,i,t):(o=fe[i],Ce(e,o+re+1,t),a=ae[o],0!==a&&(i-=pe[o],Ee(e,i,a)),n--,o=_e(n),Ce(e,o,r),a=se[o],0!==a&&(n-=ge[o],Ee(e,n,a)))}while(s<e.last_lit);Ce(e,256,t)},Oe=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,c=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)De(e,r,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],De(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[2*u]=r[2*a]+r[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[2*a+1]=r[2*s+1]=u,e.heap[1]=u++,De(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let c,l,d,h,f,p,g=0;for(h=0;h<=oe;h++)e.bl_count[h]=0;for(r[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)l=e.heap[c],h=r[2*r[2*l+1]+1]+1,h>u&&(h=u,g++),r[2*l+1]=h,l>n||(e.bl_count[h]++,f=0,l>=s&&(f=a[l-s]),p=r[2*l],e.opt_len+=p*(h+f),o&&(e.static_len+=p*(i[2*l+1]+f)));if(0!==g){do{for(h=u-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(h=u;0!==h;h--)for(l=e.bl_count[h];0!==l;)d=e.heap[--c],d>n||(r[2*d+1]!==h&&(e.opt_len+=(h-r[2*d+1])*r[2*d],r[2*d+1]=h),l--)}})(e,t),Se(r,c,e.bl_count)},ke=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))},Ne=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<c)do{Ce(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(Ce(e,i,e.bl_tree),s--),Ce(e,16,e.bl_tree),Ee(e,s-3,2)):s<=10?(Ce(e,17,e.bl_tree),Ee(e,s-3,3)):(Ce(e,18,e.bl_tree),Ee(e,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}};let Pe=!1;const Be=(e,t,r,n)=>{Ee(e,0+(n?1:0),3),((e,t,r,n)=>{Te(e),n&&(Ae(e,r),Ae(e,~r)),e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r})(e,t,r,!0)};ee._tr_init=e=>{Pe||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(pe[n]=r,e=0;e<1<<ae[n];e++)fe[r++]=n;for(fe[r-1]=n,i=0,n=0;n<16;n++)for(ge[n]=i,e=0;e<1<<se[n];e++)he[i++]=n;for(i>>=7;n<ie;n++)for(ge[n]=i<<7,e=0;e<1<<se[n]-7;e++)he[256+i++]=n;for(t=0;t<=oe;t++)o[t]=0;for(e=0;e<=143;)le[2*e+1]=8,e++,o[8]++;for(;e<=255;)le[2*e+1]=9,e++,o[9]++;for(;e<=279;)le[2*e+1]=7,e++,o[7]++;for(;e<=287;)le[2*e+1]=8,e++,o[8]++;for(Se(le,287,o),e=0;e<ie;e++)de[2*e+1]=5,de[2*e]=xe(e,5);ye=new me(le,ae,257,ne,oe),ve=new me(de,se,0,ie,oe),we=new me(new Array(0),ue,0,19,7)})(),Pe=!0),e.l_desc=new be(e.dyn_ltree,ye),e.d_desc=new be(e.dyn_dtree,ve),e.bl_desc=new be(e.bl_tree,we),e.bi_buf=0,e.bi_valid=0,Ie(e)},ee._tr_stored_block=Be,ee._tr_flush_block=(e,t,r,n)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<re;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Oe(e,e.l_desc),Oe(e,e.d_desc),a=(e=>{let t;for(ke(e,e.dyn_ltree,e.l_desc.max_code),ke(e,e.dyn_dtree,e.d_desc.max_code),Oe(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ce[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Be(e,t,r,n):4===e.strategy||o===i?(Ee(e,2+(n?1:0),3),Re(e,le,de)):(Ee(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Ee(e,t-257,5),Ee(e,r-1,5),Ee(e,n-4,4),i=0;i<n;i++)Ee(e,e.bl_tree[2*ce[i]+1],3);Ne(e,e.dyn_ltree,t-1),Ne(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Re(e,e.dyn_ltree,e.dyn_dtree)),Ie(e),n&&Te(e)},ee._tr_tally=(e,t,r)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(fe[r]+re+1)]++,e.dyn_dtree[2*_e(t)]++),e.last_lit===e.lit_bufsize-1),ee._tr_align=e=>{Ee(e,2,3),Ce(e,256,le),(e=>{16===e.bi_valid?(Ae(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)};var Fe=(e,t,r,n)=>{let i=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};const Le=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var ze=(e,t,r,n)=>{const i=Le,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return-1^e},Ue={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"},je={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:Ve,_tr_stored_block:He,_tr_flush_block:Ge,_tr_tally:qe,_tr_align:We}=ee,Ke=Fe,Xe=ze,Ye=Ue,{Z_NO_FLUSH:Ze,Z_PARTIAL_FLUSH:Je,Z_FULL_FLUSH:$e,Z_FINISH:Qe,Z_BLOCK:et,Z_OK:tt,Z_STREAM_END:rt,Z_STREAM_ERROR:nt,Z_DATA_ERROR:it,Z_BUF_ERROR:ot,Z_DEFAULT_COMPRESSION:at,Z_FILTERED:st,Z_HUFFMAN_ONLY:ut,Z_RLE:ct,Z_FIXED:lt,Z_DEFAULT_STRATEGY:dt,Z_UNKNOWN:ht,Z_DEFLATED:ft}=je,pt=258,gt=262,mt=103,yt=113,vt=666,wt=(e,t)=>(e.msg=Ye[t],t),bt=e=>(e<<1)-(e>4?9:0),_t=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let At=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Et=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Ct=(e,t)=>{Ge(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Et(e.strm)},xt=(e,t)=>{e.pending_buf[e.pending++]=t},St=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},It=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=Ke(e.adler,t,i,r):2===e.state.wrap&&(e.adler=Xe(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},Tt=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-gt?e.strstart-(e.w_size-gt):0,c=e.window,l=e.w_mask,d=e.prev,h=e.strstart+pt;let f=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,c[r+a]===p&&c[r+a-1]===f&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h);if(n=pt-(h-o),o=h-pt,n>a){if(e.match_start=t,a=n,n>=s)break;f=c[o+a-1],p=c[o+a]}}}while((t=d[t&l])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},Mt=e=>{const t=e.w_size;let r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-gt)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);o+=t}if(0===e.strm.avail_in)break;if(n=It(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=At(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=At(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<gt&&0!==e.strm.avail_in)},Dt=(e,t)=>{let r,n;for(;;){if(e.lookahead<gt){if(Mt(e),e.lookahead<gt&&t===Ze)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-gt&&(e.match_length=Tt(e,r)),e.match_length>=3)if(n=qe(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=At(e,e.ins_h,e.window[e.strstart+1]);else n=qe(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Ct(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Qe?(Ct(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Ct(e,!1),0===e.strm.avail_out)?1:2},Rt=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<gt){if(Mt(e),e.lookahead<gt&&t===Ze)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-gt&&(e.match_length=Tt(e,r),e.match_length<=5&&(e.strategy===st||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=qe(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Ct(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=qe(e,0,e.window[e.strstart-1]),n&&Ct(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=qe(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Qe?(Ct(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Ct(e,!1),0===e.strm.avail_out)?1:2};function Ot(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const kt=[new Ot(0,0,0,0,((e,t)=>{let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Mt(e),0===e.lookahead&&t===Ze)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Ct(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-gt&&(Ct(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Qe?(Ct(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Ct(e,!1),e.strm.avail_out),1)})),new Ot(4,4,8,4,Dt),new Ot(4,5,16,8,Dt),new Ot(4,6,32,32,Dt),new Ot(4,4,16,16,Rt),new Ot(8,16,32,32,Rt),new Ot(8,16,128,128,Rt),new Ot(8,32,128,256,Rt),new Ot(32,128,258,1024,Rt),new Ot(32,258,258,4096,Rt)];function Nt(){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=ft,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),_t(this.dyn_ltree),_t(this.dyn_dtree),_t(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),_t(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),_t(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 Pt=e=>{if(!e||!e.state)return wt(e,nt);e.total_in=e.total_out=0,e.data_type=ht;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:yt,e.adler=2===t.wrap?0:1,t.last_flush=Ze,Ve(t),tt},Bt=e=>{const t=Pt(e);return t===tt&&(e=>{e.window_size=2*e.w_size,_t(e.head),e.max_lazy_match=kt[e.level].max_lazy,e.good_match=kt[e.level].good_length,e.nice_match=kt[e.level].nice_length,e.max_chain_length=kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Ft=(e,t,r,n,i,o)=>{if(!e)return nt;let a=1;if(t===at&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==ft||n<8||n>15||t<0||t>9||o<0||o>lt)return wt(e,nt);8===n&&(n=9);const s=new Nt;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Bt(e)};Q.deflateInit=(e,t)=>Ft(e,t,ft,15,8,dt),Q.deflateInit2=Ft,Q.deflateReset=Bt,Q.deflateResetKeep=Pt,Q.deflateSetHeader=(e,t)=>e&&e.state?2!==e.state.wrap?nt:(e.state.gzhead=t,tt):nt,Q.deflate=(e,t)=>{let r,n;if(!e||!e.state||t>et||t<0)return e?wt(e,nt):nt;const i=e.state;if(!e.output||!e.input&&0!==e.avail_in||i.status===vt&&t!==Qe)return wt(e,0===e.avail_out?ot:nt);i.strm=e;const o=i.last_flush;if(i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,xt(i,31),xt(i,139),xt(i,8),i.gzhead?(xt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),xt(i,255&i.gzhead.time),xt(i,i.gzhead.time>>8&255),xt(i,i.gzhead.time>>16&255),xt(i,i.gzhead.time>>24&255),xt(i,9===i.level?2:i.strategy>=ut||i.level<2?4:0),xt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(xt(i,255&i.gzhead.extra.length),xt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Xe(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(xt(i,0),xt(i,0),xt(i,0),xt(i,0),xt(i,0),xt(i,9===i.level?2:i.strategy>=ut||i.level<2?4:0),xt(i,3),i.status=yt);else{let t=ft+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=ut||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,i.status=yt,St(i,t),0!==i.strstart&&(St(i,e.adler>>>16),St(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(e.adler=Xe(e.adler,i.pending_buf,i.pending-r,r)),Et(e),r=i.pending,i.pending!==i.pending_buf_size));)xt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=Xe(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=Xe(e.adler,i.pending_buf,i.pending-r,r)),Et(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,xt(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=Xe(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=Xe(e.adler,i.pending_buf,i.pending-r,r)),Et(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,xt(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=Xe(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.status=mt)}else i.status=mt;if(i.status===mt&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Et(e),i.pending+2<=i.pending_buf_size&&(xt(i,255&e.adler),xt(i,e.adler>>8&255),e.adler=0,i.status=yt)):i.status=yt),0!==i.pending){if(Et(e),0===e.avail_out)return i.last_flush=-1,tt}else if(0===e.avail_in&&bt(t)<=bt(o)&&t!==Qe)return wt(e,ot);if(i.status===vt&&0!==e.avail_in)return wt(e,ot);if(0!==e.avail_in||0!==i.lookahead||t!==Ze&&i.status!==vt){let r=i.strategy===ut?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Mt(e),0===e.lookahead)){if(t===Ze)return 1;break}if(e.match_length=0,r=qe(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Ct(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Qe?(Ct(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Ct(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===ct?((e,t)=>{let r,n,i,o;const a=e.window;for(;;){if(e.lookahead<=pt){if(Mt(e),e.lookahead<=pt&&t===Ze)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+pt;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=pt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=qe(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=qe(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Ct(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Qe?(Ct(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Ct(e,!1),0===e.strm.avail_out)?1:2})(i,t):kt[i.level].func(i,t);if(3!==r&&4!==r||(i.status=vt),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),tt;if(2===r&&(t===Je?We(i):t!==et&&(He(i,0,0,!1),t===$e&&(_t(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Et(e),0===e.avail_out))return i.last_flush=-1,tt}return t!==Qe?tt:i.wrap<=0?rt:(2===i.wrap?(xt(i,255&e.adler),xt(i,e.adler>>8&255),xt(i,e.adler>>16&255),xt(i,e.adler>>24&255),xt(i,255&e.total_in),xt(i,e.total_in>>8&255),xt(i,e.total_in>>16&255),xt(i,e.total_in>>24&255)):(St(i,e.adler>>>16),St(i,65535&e.adler)),Et(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?tt:rt)},Q.deflateEnd=e=>{if(!e||!e.state)return nt;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&t!==mt&&t!==yt&&t!==vt?wt(e,nt):(e.state=null,t===yt?wt(e,it):tt)},Q.deflateSetDictionary=(e,t)=>{let r=t.length;if(!e||!e.state)return nt;const n=e.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return nt;if(1===i&&(e.adler=Ke(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(_t(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Mt(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=At(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Mt(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,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,tt},Q.deflateInfo="pako deflate (from Nodeca project)";var Lt={};const zt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Lt.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)zt(r,t)&&(e[t]=r[t])}}return e},Lt.flattenChunks=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r};var Ut={};let jt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){jt=!1}const Vt=new Uint8Array(256);for(let e=0;e<256;e++)Vt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Vt[254]=Vt[254]=1,Ut.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t};Ut.buf2string=(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let a=Vt[t];if(a>4)o[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],a--;a>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&jt)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},Ut.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Vt[e[r]]>t?r:t};const Ht=Q,Gt=Lt,qt=Ut,Wt=Ue,Kt=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},Xt=Object.prototype.toString,{Z_NO_FLUSH:Yt,Z_SYNC_FLUSH:Zt,Z_FULL_FLUSH:Jt,Z_FINISH:$t,Z_OK:Qt,Z_STREAM_END:er,Z_DEFAULT_COMPRESSION:tr,Z_DEFAULT_STRATEGY:rr,Z_DEFLATED:nr}=je;function ir(e){this.options=Gt.assign({level:tr,method:nr,chunkSize:16384,windowBits:15,memLevel:8,strategy:rr},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Kt,this.strm.avail_out=0;let r=Ht.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Qt)throw new Error(Wt[r]);if(t.header&&Ht.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?qt.string2buf(t.dictionary):"[object ArrayBuffer]"===Xt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Ht.deflateSetDictionary(this.strm,e),r!==Qt)throw new Error(Wt[r]);this._dict_set=!0}}ir.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?$t:Yt,"string"==typeof e?r.input=qt.string2buf(e):"[object ArrayBuffer]"===Xt.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Zt||o===Jt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Ht.deflate(r,o),i===er)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ht.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Qt;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ir.prototype.onData=function(e){this.chunks.push(e)},ir.prototype.onEnd=function(e){e===Qt&&(this.result=Gt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var or=function(e,t){return(t=t||{}).gzip=!0,function(e,t){const r=new ir(t);if(r.push(e,!0),r.err)throw r.msg||Wt[r.err];return r.result}(e,t)};const ar=["enabled","userId"];var sr,ur,cr=new Y("drs"),lr=["setItemLocalStorageSafe","localStorage","setItem","removeItemLocalStorageSafe","FALLBACK_SESSION_STORAGE","clientId","getClientId","getFullStorageKey","getItemSessionStorageSafe","sessionStorage","removeItem","getItemLocalStorageSafe","getItem","FALLBACK_LOCAL_STORAGE"];sr=lr,ur=116,function(e){for(;--e;)sr.push(sr.shift())}(++ur);var dr=function(e,t){return lr[e-=0]};class hr{constructor(e){this[dr("0x0")]={},this.FALLBACK_LOCAL_STORAGE={},this[dr("0x1")]=e}[dr("0x2")](){return this.clientId}setClientId(e){this[dr("0x1")]=e}[dr("0x3")](e){return this[dr("0x1")]+"_"+e}[dr("0x4")](e){const t=this.getFullStorageKey(e);try{return window.sessionStorage.getItem(t)}catch(e){return this[dr("0x0")][t]}}setItemSessionStorageSafe(e,t){const r=this.getFullStorageKey(e);try{window[dr("0x5")].setItem(r,t)}catch(e){this[dr("0x0")][r]=t}}removeItemSessionStorageSafe(e){const t=this[dr("0x3")](e);try{window[dr("0x5")][dr("0x6")](t)}catch(e){this[dr("0x0")][t]=void 0}}[dr("0x7")](e){const t=this.getFullStorageKey(e);try{return window.localStorage[dr("0x8")](t)}catch(e){return this[dr("0x9")][t]}}[dr("0xa")](e,t){const r=this[dr("0x3")](e);try{window[dr("0xb")][dr("0xc")](r,t)}catch(e){this[dr("0x9")][r]=t}}[dr("0xd")](e){const t=this[dr("0x3")](e);try{window[dr("0xb")].removeItem(t)}catch(e){this[dr("0x9")][t]=void 0}}}var fr,pr,gr=["logsLimit","unshift","map","all","catch","enabled","[AccountProtection SDK]","logs","pushLog","error","flush","%s %s %s","logPrefix","stringify","now","formatter","length"];fr=gr,pr=124,function(e){for(;--e;)fr.push(fr.shift())}(++pr);var mr=function(e,t){return gr[e-=0]};class yr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this[mr("0x0")]=e,this.logPrefix=mr("0x1"),this.logsLimit=1e4,this[mr("0x2")]=[],this.middlewares=[]}info(e,t){this[mr("0x3")](3,e,t)}warn(e,t){this[mr("0x3")](4,e,t)}[mr("0x4")](e,t){this[mr("0x3")](5,e,t)}[mr("0x5")](){const e=this[mr("0x2")];return this[mr("0x2")]=[],e}[mr("0x3")](e,r,n){this[mr("0x0")]&&console.log(mr("0x6"),this[mr("0x7")],r,JSON[mr("0x8")](n)),this[mr("0x2")].push({timestamp:Date[mr("0x9")](),severity:e,text:JSON[mr("0x8")](t(t({},n),{},{message:r}),this[mr("0xa")])}),this[mr("0x2")][mr("0xb")]>this[mr("0xc")]&&this.logs[mr("0xd")]();const i=this.middlewares[mr("0xe")]((e=>e()));Promise[mr("0xf")](i)[mr("0x10")]((()=>{}))}[mr("0xa")](e,t){if(t instanceof Error){const{name:e,stack:r,message:n}=t;return{name:e,stack:r,message:n}}return t}}const vr=new yr;var wr,br,_r=["error fetching config","parse","error loading config","shouldUpdateConf","getConfValue","now","length","setItemLocalStorageSafe","stringify","storageManager","requestsManager","conf","loadConf","fetchConf","device/conf?tenantId="];wr=_r,br=114,function(e){for(;--e;)wr.push(wr.shift())}(++br);var Ar=function(e,t){return _r[e-=0]};class Er{constructor(e,t){this[Ar("0x0")]=e,this[Ar("0x1")]=t,this[Ar("0x2")]=this[Ar("0x3")]()}async[Ar("0x4")](e){try{const t=Ar("0x5")+e,r=await this[Ar("0x1")].getData(t);return null!=r?r:{}}catch(t){return vr.error(Ar("0x6"),{clientId:e,error:t}),{}}}[Ar("0x3")](){const e=this[Ar("0x0")].getItemLocalStorageSafe("ric");if(null!=e)try{return JSON[Ar("0x7")](e)}catch(e){vr.error(Ar("0x8"),{error:e})}return{}}[Ar("0x9")](){const e=this[Ar("0xa")]("timestamp",0);return Date[Ar("0xb")]()-e>36e5}async refreshConf(e){if(!this[Ar("0x9")]())return!1;let t=await this[Ar("0x4")](e);return 0==Object.keys(t)[Ar("0xc")]?t=this[Ar("0x3")]():this.storageManager[Ar("0xd")]("ric",JSON[Ar("0xe")](t)),this[Ar("0x2")]=t,!0}[Ar("0xa")](e,t){const r=void 0!==this[Ar("0x2")]?this[Ar("0x2")][e]:void 0;return null!=r?r:t}}var Cr,xr,Sr=["EVENT_TYPE_ACTION","action","device","EVENT_TYPE_INTERACTION","interaction","EVENT_TYPE_IDENTIFICATION","identification","mobile_web"];Cr=Sr,xr=400,function(e){for(;--e;)Cr.push(Cr.shift())}(++xr);var Ir,Tr,Mr=function(e,t){return Sr[e-=0]};(Tr=Ir||(Ir={}))[Mr("0x0")]=Mr("0x1"),Tr.EVENT_TYPE_DEVICE=Mr("0x2"),Tr[Mr("0x3")]=Mr("0x4"),Tr[Mr("0x5")]=Mr("0x6");const Dr=Mr("0x7");var Rr,Or,kr=["splice","push","maintainLastXItems","length"];Rr=kr,Or=318,function(e){for(;--e;)Rr.push(Rr.shift())}(++Or);var Nr=function(e,t){return kr[e-=0]};class Pr{static[Nr("0x0")](e,t,r){return e[Nr("0x1")]>=t&&e[Nr("0x2")](0,1),e[Nr("0x3")](r),e}}var Br,Fr,Lr=["collect","extractEventData","getData","now","extractButtonsPressedData","shiftKey","buttons","detail","offsetX","offsetY","sourceCapabilities","firesTouchEvents","target","maintainLastXItems","bufferSize","isTrusted","cancelable","composed","view","metaKey","location","inputType","data","buffer"];Br=Lr,Fr=118,function(e){for(;--e;)Br.push(Br.shift())}(++Fr);var zr=function(e,t){return Lr[e-=0]};class Ur{constructor(e){this[zr("0x0")]=[],this[zr("0x1")]=e}[zr("0x2")](e){const t=this[zr("0x3")](e);Pr.maintainLastXItems(this[zr("0x0")],this.buffer,t)}[zr("0x4")](){return this.data}[zr("0x3")](e){return t({x:e.x,y:e.y,tspl:Date[zr("0x5")]()},this.extractButtonsPressedData(e))}[zr("0x6")](e){return t(t(t(t({},e.ctrlKey&&{ctrlKey:!0}),e.altKey&&{altKey:!0}),e[zr("0x7")]&&{shiftKey:!0}),0!=e[zr("0x8")]&&{buttons:e[zr("0x8")]})}}class jr{constructor(e){this[zr("0x0")]=[],this.buffer=e}[zr("0x2")](e){var t;const r={x:e.x,y:e.y,timestamp:Date[zr("0x5")](),mouseButtonType:e[zr("0x9")],offsetX:e[zr("0xa")],offsetY:e[zr("0xb")],isPressed:null==(null===(t=e[zr("0xc")])||void 0===t?void 0:t[zr("0xd")])?null:!e.sourceCapabilities[zr("0xd")],target_id:e[zr("0xe")].id};Pr[zr("0xf")](this[zr("0x0")],this[zr("0x1")],r)}[zr("0x4")](){const e=[...this.data];return this[zr("0x0")]=[],e}}class Vr{constructor(e){this[zr("0x0")]=[],this[zr("0x10")]=e}[zr("0x2")](e){var t;const r={isTrusted:e[zr("0x11")],cancelable:e[zr("0x12")],composed:e[zr("0x13")],isView:!!e[zr("0x14")],shiftKey:e[zr("0x7")],metaKey:e[zr("0x15")],firesTouchEvents:null===(t=e[zr("0xc")])||void 0===t?void 0:t.firesTouchEvents,timestamp:Date[zr("0x5")]()};Pr.maintainLastXItems(this[zr("0x0")],this[zr("0x10")],r)}[zr("0x4")](){const e=[...this[zr("0x0")]];return this[zr("0x0")]=[],e}}class Hr{constructor(e){this[zr("0x0")]=[],this.bufferSize=e}[zr("0x2")](e){var t;const r={isTrusted:e.isTrusted,cancelable:e[zr("0x12")],composed:e[zr("0x13")],isView:!!e[zr("0x14")],location:e[zr("0x16")],shiftKey:e.shiftKey,firesTouchEvents:null===(t=e[zr("0xc")])||void 0===t?void 0:t.firesTouchEvents,timestamp:Date[zr("0x5")]()};Pr.maintainLastXItems(this[zr("0x0")],this.bufferSize,r)}[zr("0x4")](){const e=this[zr("0x0")];return this[zr("0x0")]=[],e}}let Gr=class{constructor(e){this[zr("0x0")]=[],this[zr("0x10")]=e}[zr("0x2")](e){const t={isTrusted:e[zr("0x11")],cancelable:e.cancelable,composed:e[zr("0x13")],inputType:e[zr("0x17")],isView:!!e[zr("0x14")],timestamp:Date[zr("0x5")]()};Pr[zr("0xf")](this.data,this[zr("0x10")],t)}getData(){const e=this[zr("0x0")];return this[zr("0x0")]=[],e}};class qr{constructor(e){this[zr("0x0")]=[],this[zr("0x10")]=e}[zr("0x2")](e){const t={isTrusted:e[zr("0x11")],cancelable:e[zr("0x12")],composed:e.composed,timestamp:Date[zr("0x5")]()};Pr[zr("0xf")](this.data,this[zr("0x10")],t)}[zr("0x4")](){const e=this[zr("0x0")];return this.data=[],e}}var Wr,Kr,Xr=["sourceCapabilities","target","isTrusted","cancelable","composed","clipboardData","dataset","virtualKeyboard","inputTypeFilter","includes","registerEventListeners","addSafeInteractionListener","error","Error while adding listener","filter","handleEvent","forEach","collect","getGenericAttributes","getAttachedData","error adding interaction listener","getData","paste","mousemove","mouseup","mousedown","keyup","input","INPUT","SELECT","TEXTAREA","deviceEventDataCollectionIgnoreList","mouseEventsCollectionBuffer","safeEventCallback","interactionEventsCollectorsData","detail","firesTouchEvents"];Wr=Xr,Kr=355,function(e){for(;--e;)Wr.push(Wr.shift())}(++Kr);var Yr=function(e,t){return Xr[e-=0]};const Zr="change",Jr=Yr("0x0"),$r=Yr("0x1"),Qr=Yr("0x2"),en=Yr("0x3"),tn=Yr("0x4"),rn="keydown",nn=Yr("0x5"),on=[Yr("0x6"),Yr("0x7"),Yr("0x8")];class an{constructor(e,r,n){this[Yr("0x9")]=e,this[Yr("0xa")]=r,this[Yr("0xb")]=n,this[Yr("0xc")]={click:{eventTypesToAttach:[$r,Qr,en],attributesMapper:e=>{var t;return{x:e.x,y:e.y,mouseButtonType:e[Yr("0xd")],isPressed:null==(null===(t=e.sourceCapabilities)||void 0===t?void 0:t[Yr("0xe")])?null:!e[Yr("0xf")].firesTouchEvents,offsetX:e.offsetX,offsetY:e.offsetY,target_id:e[Yr("0x10")].id}}},[Jr]:{attributesMapper:e=>({target_id:e[Yr("0x10")].id,isTrusted:e[Yr("0x11")],cancelable:e[Yr("0x12")],composed:e[Yr("0x13")],dropEffect:e[Yr("0x14")].dropEffect,effectAllowed:e[Yr("0x14")].effectAllowed})},submit:{attributesMapper:e=>({target_id:e[Yr("0x10")].id})},[$r]:{continousCollectors:[new Ur(this.mouseEventsCollectionBuffer)]},[Qr]:{continousCollectors:[new jr(1)]},[en]:{continousCollectors:[new jr(1)]},focusout:{eventTypesToAttach:[nn,tn,rn,Zr],filter:this.inputTypeFilter,attributesMapper:e=>{const{target:r,isTrusted:n,cancelable:i,composed:o}=e;return t({target_id:r.id,dataset_keys:Object.keys(r[Yr("0x15")]||{}),isTrusted:n,cancelable:i,composed:o},navigator[Yr("0x16")]&&{navigator_virtualKeyboard:navigator[Yr("0x16")].overlaysContent})}},[nn]:{filter:this.inputTypeFilter,continousCollectors:[new Gr(50)]},[tn]:{filter:this[Yr("0x17")],continousCollectors:[new Hr(50)]},[rn]:{filter:this.inputTypeFilter,continousCollectors:[new Vr(50)]},[Zr]:{continousCollectors:[new qr(50)]}}}[Yr("0x17")](e){var t;const r=null===(t=e[Yr("0x10")])||void 0===t?void 0:t.tagName;return on[Yr("0x18")](r)}[Yr("0x19")](){for(const[e,t]of Object.entries(this[Yr("0xc")]))if(!this[Yr("0x9")][Yr("0x18")](e))try{this[Yr("0x1a")](e,t)}catch(t){vr[Yr("0x1b")](Yr("0x1c"),{error:t,eventType:e})}}[Yr("0x1d")](e,t){return!e.filter||e[Yr("0x1d")](t)}async[Yr("0x1e")](e,r,n){const{attributesMapper:i,continousCollectors:o}=e;if(!this[Yr("0x1d")](e,r))return!1;if(o)o[Yr("0x1f")]((e=>{e[Yr("0x20")](r)}));else{const e=this[Yr("0x21")](),o=this[Yr("0x22")](n),a=t(t(t({},e),i(r)),o&&{attachedEventsData:o});await this[Yr("0xb")](n,a)}return!0}[Yr("0x1a")](e,t){window.addEventListener(e,(async r=>{try{await this.handleEvent(t,r,e)}catch(e){vr[Yr("0x1b")](Yr("0x23"),{error:e})}}))}[Yr("0x22")](e){let t;const r=this[Yr("0xc")][e].eventTypesToAttach;return r&&(t={},r[Yr("0x1f")]((e=>{const{continousCollectors:r}=this[Yr("0xc")][e];r&&r[Yr("0x1f")]((r=>t[e]=r[Yr("0x24")]()))}))),t}[Yr("0x21")](){return{location:window.location.href}}}var sn,un,cn=["race","catch","warn","executor reached timeout","name","userAgentData","model","platform","platformVersion","bitness","mobile","wow64","resolve","setTimeout"];sn=cn,un=299,function(e){for(;--e;)sn.push(sn.shift())}(++un);var ln=function(e,t){return cn[e-=0]};function dn(){var e;return null===(e=navigator[ln("0x0")])||void 0===e?void 0:e.getHighEntropyValues(["architecture",ln("0x1"),ln("0x2"),ln("0x3"),"fullVersionList",ln("0x4"),ln("0x5"),ln("0x6"),"uaFullVersion"])}function hn(e,t){let r;const n=[Promise[ln("0x7")](e()).catch((()=>{})),new Promise(((e,n)=>r=window[ln("0x8")](n,t)))];return Promise[ln("0x9")](n)[ln("0xa")]((()=>vr[ln("0xb")](ln("0xc"),{fnName:e[ln("0xd")]}))).finally((()=>clearTimeout(r)))}var fn,pn,gn=["getHardwareConcurrency","getIndexedDB","getFIDOEnabled","getLanguage","getLocalStorage","getNavigatorProduct","getNavigatorUserAgent","getNavigatorUAData","getNavigatorHighEntropyData","navigatorStorageEstimation","navigatorOnLine","getMathFingerprint","getWindowOrientation","getCpuClass","getAddBehavior","getAudioFingerprint","getFonts","getPerformanceTiming","getPlugins","hasSequentum","getReferrer","getTimezone","getTouchSupport","getBuildID","getWebDriver","getWebGlRenderer","getWindowBasedKeys","getWindowOuter","getCryptoBindingData","bind","getNavigatorPermissionsState","notifications","geolocation","isGeoLocationExists","isSendBeaconFunction","getNavigatorPrototype","getInstalledRelatedApps","windowConstructorAliasTest","windowDocumentAuxVarsTest","CDPRuntimeDomainTest","Error","Object","defineProperty","stack","console","debug","document","$chrome_asyncScriptInfo","test","value","cache_","getOwnPropertyNames","getPrototypeOf","storeItem","isNodeReachable_","sort","Array","Symbol","name","token","collectPromisesData","sdkDeviceDataCollectionIgnoreList","warn","worker throw error","resolve","entries","worker promise rejected","credentials","isUserVerifyingPlatformAuthenticatorAvailable","crypto","getRandomValues","webRTCDisabled","RTCPeerConnection","__gCrWeb","yandex","__yb","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice","_phantom","__phantomas","callPhantom","Buffer","emit","spawn","domAutomationController","domAutomation","_selenium","callSelenium","_Selenium_IDE_Recorder","__$webdriverAsyncExecutor","__fxdriver_evaluate","__fxdriver_unwrapped","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","__selenium_evaluate","__selenium_unwrapped","__webdriver_evaluate","__webdriver_script_fn","__webdriver_script_func","__webdriver_script_function","__webdriverFuncgeb","awesomium","calledPhantom","cdc_adoQpoasnfa76pfcZLmcfl_Symbol","chrome_asyncScriptInfo","fmget_targets","geb","OSMJIF","watinExpressionError","watinExpressionResult","push","standard","no-preference","high","low","more","less","forced","100","active","inverted","none","rec2020","srgb","replace","matchMedia","log","sqrt","exp","acos","acosh","asin","asinh","atanh","atan","sin","sinh","cos","cosh","tan","tanh","expm1","length","toString","getSessionStorage","sessionStorage","localStorage","external","indexOf","__driver_evaluate","__driver_unwrapped","calledSelenium","ChromeDriverw","webdriver-evaluate","selenium-evaluate","webdriver-evaluate-response","$cdc_asdjflasutopfhvcZLmcfl_","filter","product","userAgent","userAgentData","storage","estimate","onLine","navigatorIsUserActive","userActivation","permissions","function","getOwnPropertyDescriptor","hardwareConcurrency","get","languages","isArray","platform","url","referrer","timing","getPerformanceMemory","memory","indexedDB","DocumentTouch","maxTouchPoints","msMaxTouchPoints","ontouchstart","type","suffixes","plugins","getScreen","availHeight","height","width","pixelDepth","orientation","angle","devicePixelRatio","charCodeAt","outerWidth","outerHeight","webdriver","getPlatform","getOsCpu","HTMLElement","prototype","addBehavior","getProductSub","productSub","enumerateDevices","kind","label","groupId","webkitOfflineAudioContext","triangle","frequency","createDynamicsCompressor","threshold","knee","ratio","attack","connect","destination","start","getChannelData","subarray","getAudioFingerprintExtended","createOscillator","startRendering","disconnect","frequencyBinCount","getFloatFrequencyData","call","fftSize","getFloatTimeDomainData","getHash","mmMwWLliI0O&1","monospace","serif","sans-serif-thin","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Calibri","Century","Century Gothic","Clarendon","Franklin Gothic","GOTHAM","Gill Sans","HELV","Helvetica Neue","Humanst521 BT","Leelawadee","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS UI Gothic","MT Extra","MYRIAD PRO","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","createElement","style","span","position","top","left","fontFamily","fontSize","10px","textContent","appendChild","map","offsetWidth","offsetHeight","body","getTimezoneOffset","getLanguages","getDocumentBasedKeys","DateTimeFormat","timeZone","getVendor","vendor","buildID","textBaseline","alphabetic","fillStyle","fillRect","#069","font",'11pt "Times New Roman"',"Cwm fjordbank gly ","fromCharCode","fillText","rgba(102, 204, 0, 0.2)","18pt Arial","hashCodeString","globalCompositeOperation","multiply","#f2f","#2ff","#ff2","beginPath","fill","#f9c","arc","toDataURL","rect","isPointInPath","evenodd","getContext","charging","chargingTime","dischargingTime","level","brave","webgl","webgl-experimental","WEBGL_debug_renderer_info","getParameter","UNMASKED_RENDERER_WEBGL","video","canPlayType",'video/mp4; codecs="avc1.42E01E"',"getPublicData","only screen and (max-width: 600px)","matches","deviceDataCalculationExpiry","reduce","abs","storageManager","cryptoBinding","calculate","configManager","getConfValue","dataPointsExtractor","lastDeviceData","now","getDeviceData","dataPoints","getBattery","getBrave","getCanvasFingerprint","getCodesTests","getCookieEnabled","getCryptoRandomValues","getDeviceMemory"];fn=gn,pn=349,function(e){for(;--e;)fn.push(fn.shift())}(++pn);var mn=function(e,t){return gn[e-=0]};const yn=mn("0x0"),vn=e=>e?[...e][mn("0x1")](((e,t)=>e+Math[mn("0x2")](t)),0):0;class wn{constructor(e,t,r){this[mn("0x3")]=e,this.configManager=t,this[mn("0x4")]=r}async[mn("0x5")](){const e=this[mn("0x6")].getConfValue("sdkDeviceDataCollectionIgnoreList",[]),t=this[mn("0x6")][mn("0x7")](yn,36e5),r=await new bn(e,this.cryptoBinding)[mn("0x8")]();return this[mn("0x9")]=r,this.storageManager.setItemLocalStorageSafe(yn,Date[mn("0xa")]()+t),r}async[mn("0xb")](){return Number(this.storageManager.getItemLocalStorageSafe(yn))<Date[mn("0xa")]()||!this.lastDeviceData?await this[mn("0x5")]()||{}:this[mn("0x9")]||{}}}class bn{constructor(e,t){this.sdkDeviceDataCollectionIgnoreList=e,this[mn("0x4")]=t,this[mn("0xc")]={battery:this[mn("0xd")],brave:this[mn("0xe")],canvas:this[mn("0xf")],codecs:this[mn("0x10")],connection:this.getConnection,cookieEnabled:this[mn("0x11")],cryptoRandomValues:this[mn("0x12")],deviceMemory:this[mn("0x13")],documentBasedKeys:this.getDocumentBasedKeys,hardwareConcurrency:this[mn("0x14")],indexedDB:this[mn("0x15")],fidoEnabled:this[mn("0x16")],languages:this.getLanguages,language:this[mn("0x17")],timezoneOffset:this.getTimezoneOffset,localStorage:this[mn("0x18")],navigatorBasedKeys:this.getNavigatorBasedKeys,navigatorProduct:this[mn("0x19")],navigatorUserAgent:this[mn("0x1a")],navigatorUAData:this[mn("0x1b")],navigatorHighEntropyData:this[mn("0x1c")],navigatorStorageEstimation:this[mn("0x1d")],navigatorOnLine:this[mn("0x1e")],navigatorIsUserActive:this.navigatorIsUserActive,math:this[mn("0x1f")],mediaMatch:this.getMediaMatch,openDatabase:this.getOpenDatabase,windowOrientation:this[mn("0x20")],platform:this.getPlatform,cpuClass:this[mn("0x21")],osClass:this.getOsCpu,addBehavior:this[mn("0x22")],productSub:this.getProductSub,mediaDevices:this.getMediaDevices,audioFingerprint:this[mn("0x23")],audioFingerprintExtended:this.getAudioFingerprintExtended,fonts:this[mn("0x24")],performanceTiming:this[mn("0x25")],performanceMemory:this.getPerformanceMemory,plugins:this[mn("0x26")],screen:this.getScreen,sequentum:this[mn("0x27")],sessionStorage:this.getSessionStorage,referrer:this[mn("0x28")],timezone:this[mn("0x29")],touchSupport:this[mn("0x2a")],vendor:this.getVendor,buildID:this[mn("0x2b")],webdriver:this[mn("0x2c")],webGlRenderer:this[mn("0x2d")],windowBasedKeys:this[mn("0x2e")],windowOuter:this[mn("0x2f")],webRTCDisabled:this.webRTCDisabled,cryptoBindingData:this[mn("0x30")][mn("0x31")](this),notificationState:this[mn("0x32")][mn("0x31")](this,mn("0x33")),geolocationState:this.getNavigatorPermissionsState.bind(this,mn("0x34")),isGeoLocationExists:this[mn("0x35")],isSendBeaconExists:this[mn("0x36")],navigatorPrototype:this[mn("0x37")],installedRelatedApps:this[mn("0x38")],windowConstructorAliasTest:this[mn("0x39")],windowDocumentAuxVarsTest:this[mn("0x3a")],CDPRuntimeDomainTest:this[mn("0x3b")]}}[mn("0x3b")](){let e=!1;const t=new(window[mn("0x3c")]);return window[mn("0x3d")][mn("0x3e")](t,mn("0x3f"),{configurable:!1,enumerable:!1,get:function(){return e=!0,""}}),window[mn("0x40")][mn("0x41")](t[mn("0x3f")]),e}windowDocumentAuxVarsTest(){for(const e of window[mn("0x3d")].getOwnPropertyNames(window[mn("0x42")]))if(e==mn("0x43")||/^\$cdc_[a-zA-Z0-9]{22}_$/[mn("0x44")](e))return!0;for(const e of window.Object.values(window[mn("0x3d")].getOwnPropertyDescriptors(window[mn("0x42")]))){if(!e[mn("0x45")]||void 0===e.value[mn("0x46")])continue;const t=window[mn("0x3d")][mn("0x47")](window[mn("0x3d")][mn("0x48")](e.value)),r=[mn("0x49"),"retrieveItem",mn("0x4a")];if(t.sort(),r[mn("0x4b")](),t.every(((e,t)=>e==r[t])))return!0}return!1}windowConstructorAliasTest(){const e=window.Object[mn("0x47")](window);for(const t of e){if(/^cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)$/[mn("0x44")](t))return!0;for(const e of[window[mn("0x4c")],window.Promise,window[mn("0x4d")]])if(t!=(null==e?void 0:e[mn("0x4e")])&&t!=mn("0x4f")&&"getAsyncToken"!=t&&window[t]===e)return!0}return!1}async[mn("0x8")](){const e=this.startPromisesLoop();return await this[mn("0x50")](e)}startPromisesLoop(){const e={};for(const[t,r]of Object.entries(this[mn("0xc")]))if(!this[mn("0x51")].includes(t))try{e[t]=hn(r,100)}catch(r){vr[mn("0x52")](mn("0x53"),{e:r,key:t}),e[t]=Promise[mn("0x54")]()}return e}async[mn("0x50")](e){const t={};for(const[r,n]of Object[mn("0x55")](e))try{t[r]=await n}catch(e){vr.warn(mn("0x56"),{e:e,key:r}),t[r]=void 0}return t}[mn("0x11")](){const e=navigator.cookieEnabled;return Promise.resolve(e)}async getFIDOEnabled(){return!!navigator[mn("0x57")]&&await window.PublicKeyCredential[mn("0x58")]()}[mn("0x12")](){const e=window[mn("0x59")][mn("0x5a")](new Uint8Array(16));return Array.from(e)}[mn("0x5b")](){const e=null==window[mn("0x5c")];return Promise.resolve(e)}[mn("0x2e")](){const e=["chrome","safari","__crWeb",mn("0x5d"),mn("0x5e"),mn("0x5f"),"__ybro",mn("0x60"),mn("0x61"),mn("0x62"),mn("0x63"),mn("0x64"),mn("0x65"),mn("0x66"),mn("0x67"),mn("0x68"),mn("0x69"),mn("0x6a"),mn("0x6b"),mn("0x6c"),mn("0x6d"),mn("0x6e"),mn("0x6f"),"__nightmare",mn("0x70"),"calledSelenium",mn("0x71"),mn("0x72"),mn("0x73"),"__driver_evaluate","__driver_unwrapped",mn("0x74"),mn("0x75"),mn("0x76"),mn("0x77"),mn("0x78"),mn("0x79"),mn("0x7a"),"__webdriver__chr",mn("0x7b"),mn("0x7c"),mn("0x7d"),mn("0x7e"),"__webdriver_unwrapped",mn("0x7f"),mn("0x80"),mn("0x81"),"cdc_adoQpoasnfa76pfcZLmcfl_Array","cdc_adoQpoasnfa76pfcZLmcfl_Promise",mn("0x82"),mn("0x83"),mn("0x84"),mn("0x85"),mn("0x86"),"spynner_additional_js_loaded",mn("0x87"),mn("0x88")],t=[];for(const r of e){const e=window[r];void 0!==e&&null!=e&&t[mn("0x89")](r)}return Promise[mn("0x54")](t)}getMediaMatch(){const e={"dynamic-range":["high",mn("0x8a")],"prefers-reduced-motion":[mn("0x8b"),mn("0x1")],"prefers-contrast":[mn("0x8b"),mn("0x8c"),mn("0x8d"),mn("0x8e"),mn("0x8f"),mn("0x90")],"max-monochrome":["0","10",mn("0x91"),"1000"],"forced-colors":[mn("0x92"),"none"],"inverted-colors":[mn("0x93"),mn("0x94")],"color-gamut":[mn("0x95"),"p3",mn("0x96")]},t={};for(const[r,n]of Object[mn("0x55")](e))for(const e of n)t[r[mn("0x97")](/-/g,"_")+"_"+e[mn("0x97")](/-/g,"_")]=window[mn("0x98")]("("+r+": "+e+")").matches;return Promise[mn("0x54")](t)}getMathFingerprint(){const e=[Math[mn("0x9c")](.12312423423423424),Math[mn("0x9d")](1e308),(t=1e154,Math[mn("0x99")](t+Math.sqrt(t*t-1))),Math[mn("0x9e")](.12312423423423424),Math[mn("0x9f")](1),Math[mn("0x99")](1+Math[mn("0x9a")](2)),Math[mn("0xa0")](.5),Math.log(3)/2,Math[mn("0xa1")](.5),Math[mn("0xa2")](-1e300),Math[mn("0xa3")](1),Math.exp(1)-1/Math[mn("0x9b")](1)/2,Math[mn("0xa4")](10.000000000123),Math[mn("0xa5")](1),(Math[mn("0x9b")](1)+1/Math[mn("0x9b")](1))/2,Math[mn("0xa6")](-1e300),Math[mn("0xa7")](1),(Math[mn("0x9b")](2)-1)/(Math[mn("0x9b")](2)+1),Math[mn("0x9b")](1),Math[mn("0xa8")](1),Math.exp(1)-1,Math.log1p(10),Math.log(11),Math.PI**-100];var t;let r="";for(let t=0;t<e[mn("0xa9")];t++)r+=e[t][mn("0xaa")]();return Promise[mn("0x54")](bn.hashCodeString(r))}getConnection(){const{connection:e}=navigator,t=(e=>{let{downlink:t,effectiveType:r,rtt:n,saveData:i}=e;return{downlink:t,effectiveType:r,rtt:n,saveData:i}})(e);return Promise[mn("0x54")](t)}[mn("0xab")](){return Promise.resolve(!!window[mn("0xac")])}[mn("0x18")](){return Promise[mn("0x54")](!!window[mn("0xad")])}[mn("0x27")](){return-1!==window[mn("0xae")].toString()[mn("0xaf")]("Sequentum")}getNavigatorBasedKeys(){return["webdriver",mn("0xb0"),mn("0x7b"),mn("0x79"),mn("0x74"),mn("0xb1"),"__webdriver_unwrapped",mn("0x7a"),mn("0x75"),"_Selenium_IDE_Recorder",mn("0x70"),mn("0xb2"),"_WEBDRIVER_ELEM_CACHE",mn("0xb3"),"driver-evaluate",mn("0xb4"),mn("0xb5"),"webdriverCommand",mn("0xb6"),"__webdriverFunc",mn("0x7c"),"__$webdriverAsyncExecutor",mn("0x76"),mn("0x77"),"__lastWatirPrompt","$chrome_asyncScriptInfo",mn("0xb7"),"serviceWorker"][mn("0xb8")]((e=>navigator[e]))}getNavigatorProduct(){const e=navigator[mn("0xb9")];return Promise.resolve(e)}[mn("0x1a")](){return navigator[mn("0xba")]}getNavigatorUAData(){return navigator[mn("0xbb")]}[mn("0x1c")](){return dn()}navigatorStorageEstimation(){return navigator[mn("0xbc")][mn("0xbd")]()}[mn("0x1e")](){return navigator[mn("0xbe")]}[mn("0xbf")](){return navigator[mn("0xc0")].isActive}async[mn("0x32")](e){try{const t=await navigator[mn("0xc1")].query({name:e});return null==t?void 0:t.state}catch(e){}}[mn("0x35")](){return!!navigator[mn("0x34")]}[mn("0x36")](){return typeof navigator.sendBeacon===mn("0xc2")}[mn("0x37")](){return{hardwareConcurrency:Object[mn("0xc3")](Object[mn("0x48")](navigator),mn("0xc4"))[mn("0xc5")][mn("0xaa")](),languages:Object[mn("0xc3")](Object[mn("0x48")](navigator),mn("0xc6"))[mn("0xc5")][mn("0xaa")]()}}async[mn("0x38")](){if(typeof navigator[mn("0x38")]===mn("0xc2"))try{const{related_applications:e}=await navigator[mn("0x38")]();if(e&&Array[mn("0xc7")](e))return e.map((e=>({platform:e[mn("0xc8")],url:e[mn("0xc9")]})))}catch(e){}}[mn("0x28")](){return document[mn("0xca")]}getPerformanceTiming(){return performance[mn("0xcb")]}[mn("0xcc")](){const{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:r}=performance[mn("0xcd")];return{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:r}}[mn("0x15")](){return Promise.resolve(!!window[mn("0xce")])}getOpenDatabase(){const{openDatabase:e}=window;return Promise[mn("0x54")](!!e)}[mn("0x2a")](){const e=window[mn("0xcf")]&&document instanceof DocumentTouch,t={maxTouchPoints:navigator[mn("0xd0")]||navigator[mn("0xd1")]||0,documentTouch:e,ontouchstart:mn("0xd2")in window};return Promise.resolve(t)}getPlugins(){function e(e){const t=[];for(let r=0;r<e[mn("0xa9")];++r)t[mn("0x89")]({type:e[r][mn("0xd3")],suffixes:e[r][mn("0xd4")]});return t}const t=[];for(let r=0;r<navigator[mn("0xd5")][mn("0xa9")];++r){const n=navigator[mn("0xd5")][r];n&&t[mn("0x89")]({name:n[mn("0x4e")],description:n.description,mimeTypes:e(n)})}return Promise[mn("0x54")](t)}[mn("0xd6")](){const e=window.screen||screen,{availLeft:t}=e,{availTop:r}=e,n={availHeight:e[mn("0xd7")],availLeft:t,availTop:r,availWidth:e.availWidth,colorDepth:e.colorDepth,height:e[mn("0xd8")],width:e[mn("0xd9")],pixelDepth:e[mn("0xda")],orientationAngle:e[mn("0xdb")]&&e[mn("0xdb")][mn("0xdc")],orientationType:e[mn("0xdb")]&&e[mn("0xdb")][mn("0xd3")],devicePixelRatio:window[mn("0xdd")]};return Promise[mn("0x54")](n)}static hashCodeString(e){if(null==e)return;let t=0,r=0;const n=e[mn("0xa9")];for(;r<n;)t=(t<<5)-t+e[mn("0xde")](r++)|0;return t}getWindowOuter(){const e={outerWidth:window[mn("0xdf")],outerHeight:window[mn("0xe0")]};return Promise.resolve(e)}[mn("0x2c")](){const e=navigator[mn("0xe1")];return Promise[mn("0x54")](e)}[mn("0x20")](){const e=window[mn("0xdb")];return Promise.resolve(e)}[mn("0xe2")](){const e=navigator.platform;return Promise.resolve(e)}getCpuClass(){const e=navigator.cpuClass;return Promise.resolve(e)}[mn("0xe3")](){const e=navigator.oscpu;return Promise.resolve(e)}getAddBehavior(){const e=!!window[mn("0xe4")][mn("0xe5")][mn("0xe6")];return Promise[mn("0x54")](e)}[mn("0xe7")](){const e=navigator[mn("0xe8")];return Promise[mn("0x54")](e)}async getMediaDevices(){const e=await navigator.mediaDevices[mn("0xe9")](),t=[];for(const r of e)t[mn("0x89")]({kind:r[mn("0xea")],label:r[mn("0xeb")],deviceId:r.deviceId,groupId:r[mn("0xec")]});return t}async[mn("0x23")](){const e=window.OfflineAudioContext||window[mn("0xed")];if(!e)return-1;const t=new e(1,5e3,44100),r=t.createOscillator();r[mn("0xd3")]=mn("0xee"),r[mn("0xef")][mn("0x45")]=1e4;const n=t[mn("0xf0")]();n[mn("0xf1")][mn("0x45")]=-50,n[mn("0xf2")].value=40,n[mn("0xf3")][mn("0x45")]=12,n[mn("0xf4")][mn("0x45")]=0,n.release[mn("0x45")]=.25,r[mn("0xf5")](n),n[mn("0xf5")](t[mn("0xf6")]),r[mn("0xf7")](0);const i=new Promise((async(e,r)=>{t.oncomplete=t=>e(t.renderedBuffer);try{await t.startRendering()}catch(e){r(e)}})),o=(await i)[mn("0xf8")](0)[mn("0xf9")](4500);return bn.getHash(o)}async[mn("0xfa")](){var e;const t=window.OfflineAudioContext||window[mn("0xed")];if(!t)return{};const r=new t(1,5e3,44100),n=r[mn("0xfb")]();n[mn("0xd3")]=mn("0xee"),n[mn("0xef")].value=1e4;const i=r[mn("0xf0")]();i[mn("0xf1")][mn("0x45")]=-50,i[mn("0xf2")][mn("0x45")]=40,i[mn("0xf4")][mn("0x45")]=0;const o=r.createAnalyser();n[mn("0xf5")](i),i[mn("0xf5")](o),i.connect(r[mn("0xf6")]),n.start(0);try{await r[mn("0xfc")](),i[mn("0xfd")](),n.disconnect();const t=new Float32Array(o[mn("0xfe")]);null===(e=o[mn("0xff")])||void 0===e||e[mn("0x100")](o,t);const a=new Float32Array(o[mn("0x101")]);return mn("0x102")in o&&o.getFloatTimeDomainData(a),{gain:i.reduction[mn("0x45")]||i.reduction,freq:vn(t),time:vn(a)}}catch(e){return{}}}static[mn("0x103")](e){let t=0;for(let r=0;r<e.length;++r)t+=Math[mn("0x2")](e[r]);return t}[mn("0x24")](){const e=mn("0x104"),t=[mn("0x105"),"sans-serif",mn("0x106")],r=[mn("0x107"),"ARNO PRO",mn("0x108"),mn("0x109"),mn("0x10a"),mn("0x10b"),mn("0x10c"),mn("0x10d"),"Bitstream Vera Sans Mono",mn("0x10e"),mn("0x10f"),mn("0x110"),mn("0x111"),"EUROSTILE",mn("0x112"),"Futura Bk BT","Futura Md BT",mn("0x113"),mn("0x114"),mn("0x115"),"Haettenschweiler",mn("0x116"),mn("0x117"),mn("0x118"),"Letter Gothic",mn("0x119"),mn("0x11a"),mn("0x11b"),mn("0x11c"),mn("0x11d"),mn("0x11e"),"MS Reference Specialty",mn("0x11f"),mn("0x120"),mn("0x121"),"Marlett","Meiryo UI",mn("0x122"),mn("0x123"),mn("0x124"),mn("0x125"),mn("0x126"),mn("0x127"),mn("0x128"),mn("0x129"),mn("0x12a"),"Small Fonts",mn("0x12b"),mn("0x12c"),mn("0x12d"),mn("0x12e"),"ZWAdobeF"],n=document[mn("0x12f")]("div");n[mn("0x130")].visibility="hidden";const i={},o={},a=t=>{const r=document[mn("0x12f")](mn("0x131")),{style:i}=r;return i[mn("0x132")]="absolute",i[mn("0x133")]="0",i[mn("0x134")]="0",i[mn("0x135")]=t,i[mn("0x136")]=mn("0x137"),r[mn("0x138")]=e,n[mn("0x139")](r),r},s=(e,t)=>a("'"+e+"',"+t),u=t[mn("0x13a")](a),c=(()=>{const e={};for(const n of r)e[n]=t[mn("0x13a")]((e=>s(n,e)));return e})();document[mn("0x13d")].appendChild(n);try{for(let e=0;e<t[mn("0xa9")];e++)i[t[e]]=u[e].offsetWidth,o[t[e]]=u[e][mn("0x13c")];const e=r[mn("0xb8")]((e=>{return r=c[e],t.some(((e,t)=>r[t][mn("0x13b")]!==i[e]||r[t][mn("0x13c")]!==o[e]));var r}));return Promise[mn("0x54")](e)}finally{document[mn("0x13d")].removeChild(n)}}[mn("0x13e")](){const e=(new Date)[mn("0x13e")]();return Promise.resolve(e)}getLanguage(){const e=navigator.language;return Promise[mn("0x54")](e)}[mn("0x13f")](){const e=navigator.languages;return Promise[mn("0x54")](e)}[mn("0x14")](){const e=navigator[mn("0xc4")];return Promise[mn("0x54")](e)}[mn("0x13")](){const e=navigator.deviceMemory;return Promise[mn("0x54")](e)}[mn("0x140")](){return["__webdriver_evaluate",mn("0x79"),mn("0x7e"),mn("0x7d"),mn("0x7c"),mn("0x74"),mn("0xb1"),"__webdriver_unwrapped",mn("0xb0"),mn("0x7a"),mn("0x75")][mn("0xb8")]((e=>document[e]))}[mn("0x29")](){const e=Intl[mn("0x141")]().resolvedOptions()[mn("0x142")];return Promise[mn("0x54")](e)}[mn("0x143")](){const e=navigator[mn("0x144")];return Promise[mn("0x54")](e)}[mn("0x2b")](){const e=navigator[mn("0x145")];return Promise.resolve(e)}async[mn("0xf")](){const e=document[mn("0x12f")]("canvas");e[mn("0xd9")]=1,e.height=1;const t=e[mn("0x160")]("2d"),r={winding:function(e){return e[mn("0x15d")](0,0,10,10),e[mn("0x15d")](2,2,6,6),!e[mn("0x15e")](5,5,mn("0x15f"))}(t),geometry:function(e,t){e.width=122,e[mn("0xd8")]=110,t[mn("0x153")]=mn("0x154");const r=[[mn("0x155"),40,40],[mn("0x156"),80,40],[mn("0x157"),60,80]];for(const[e,n,i]of r)t.fillStyle=e,t[mn("0x158")](),t.arc(n,i,40,0,2*Math.PI,!0),t.closePath(),t[mn("0x159")]();return t[mn("0x148")]=mn("0x15a"),t[mn("0x15b")](60,60,60,0,2*Math.PI,!0),t[mn("0x15b")](60,60,20,0,2*Math.PI,!0),t[mn("0x159")]("evenodd"),bn[mn("0x152")](e[mn("0x15c")]())}(e,t),text:function(e,t){e[mn("0xd9")]=240,e[mn("0xd8")]=60,t[mn("0x146")]=mn("0x147"),t[mn("0x148")]="#f60",t[mn("0x149")](100,1,62,20),t[mn("0x148")]=mn("0x14a"),t[mn("0x14b")]=mn("0x14c");const r=mn("0x14d")+String[mn("0x14e")](55357,56835);return t[mn("0x14f")](r,2,15),t[mn("0x148")]=mn("0x150"),t[mn("0x14b")]=mn("0x151"),t[mn("0x14f")](r,4,45),bn[mn("0x152")](e.toDataURL())}(e,t)};return Promise[mn("0x54")](r)}async[mn("0xd")](){const e=await navigator[mn("0xd")]();return{charging:e[mn("0x161")],chargingTime:e[mn("0x162")],dischargingTime:e[mn("0x163")],level:e[mn("0x164")]}}async[mn("0xe")](){return!!navigator[mn("0x165")]&&await navigator.brave.isBrave()}async[mn("0x2d")](){const e=document[mn("0x12f")]("canvas"),t=e.getContext(mn("0x166"))||e[mn("0x160")](mn("0x167")),r=t.getExtension(mn("0x168"));return Promise[mn("0x54")](t[mn("0x169")](r[mn("0x16a")]))}async[mn("0x10")](){const e=document.createElement(mn("0x16b")),t={basic:""===e[mn("0x16c")](mn("0x16d")),advanced:""===e[mn("0x16c")]("video/mp4;;Codecs =avc1.42E01E")};return Promise[mn("0x54")](t)}async[mn("0x30")](){const{publicKey:e,keyIdentifier:t}=await this.cryptoBinding[mn("0x16e")]();return{publicKey:e,keyIdentifier:t}}static isMobile(){return/iPhone|iPad|iPod|Android|MiuiBrowser/i.test(navigator[mn("0xba")])||null!=window[mn("0xdb")]||window[mn("0x98")](mn("0x16f"))[mn("0x170")]}}var _n,An,En=["uncompressed","ALLOW","CHALLENGE","DENY","TRUST","compress","compressed"];_n=En,An=138,function(e){for(;--e;)_n.push(_n.shift())}(++An);var Cn,xn,Sn,In,Tn=function(e,t){return En[e-=0]};(xn=Cn||(Cn={}))[Tn("0x0")]=Tn("0x1"),xn[Tn("0x2")]=Tn("0x2"),(In=Sn||(Sn={}))[Tn("0x3")]=Tn("0x3"),In[Tn("0x4")]=Tn("0x4"),In[Tn("0x5")]="DENY",In[Tn("0x6")]="TRUST";var Mn,Dn,Rn=["encode","RSA-OAEP","fromCharCode","importKey","jwk","parse","SHA-256","crypto is not supported","importPublicKey","generateSymKey","generateKey","AES-GCM","encrypt","decrypt","encryptPayload","string","crypto","getRandomValues","subtle","arrayBufferToBase64","encryptSymKeyBundle","exportKey","raw"];Mn=Rn,Dn=193,function(e){for(;--e;)Mn.push(Mn.shift())}(++Dn);var On=function(e,t){return Rn[e-=0]};class kn{constructor(e){this.configManager=e}[On("0x0")](){return window.crypto.subtle[On("0x1")]({name:On("0x2"),length:256},!0,[On("0x3"),On("0x4")])}async[On("0x5")](e,t){const r=typeof e===On("0x6")?(new TextEncoder).encode(e):e,n=window[On("0x7")][On("0x8")](new Uint8Array(12)),i={name:"AES-GCM",iv:n},o=await window[On("0x7")][On("0x9")].encrypt(i,t,r);return{payloadCipherText:this[On("0xa")](o),iv:n}}async[On("0xb")](e,t,r){const n=await window[On("0x7")].subtle[On("0xc")](On("0xd"),e),i=this[On("0xa")](n),o=this[On("0xa")](t),a=(new TextEncoder)[On("0xe")](JSON.stringify({symKey:i,iv:o})),s=await window[On("0x7")][On("0x9")].encrypt({name:On("0xf")},r,a);return this.arrayBufferToBase64(s)}arrayBufferToBase64(e){let t="";const r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String[On("0x10")](r[e]);return window.btoa(t)}importPublicKey(e){return window[On("0x7")][On("0x9")][On("0x11")](On("0x12"),JSON[On("0x13")](e),{name:On("0xf"),hash:On("0x14")},!0,[On("0x3")])}async[On("0x3")](e,t){if(!window[On("0x7")]||!window[On("0x7")][On("0x9")])throw new Error(On("0x15"));const r=await this[On("0x0")](),{payloadCipherText:n,iv:i}=await this[On("0x5")](t,r),o=await this[On("0x16")](e);return{encryptedData:n,encryptedKey:await this[On("0xb")](r,i,o)}}}var Nn,Pn,Bn=["errorSpace","errorCode","message","toString","name",", errorSpace: ",", errorCode: ","toLog","CLIENT","client","SERVER","server","COMMUNICATION","communication","error"];Nn=Bn,Pn=473,function(e){for(;--e;)Nn.push(Nn.shift())}(++Pn);var Fn,Ln,zn=function(e,t){return Bn[e-=0]};(Ln=Fn||(Fn={}))[zn("0x0")]=zn("0x1"),Ln[zn("0x2")]=zn("0x3"),Ln[zn("0x4")]=zn("0x5");class Un extends Error{constructor(e,t,r){var n,i;super(),this[zn("0x6")]=e,this[zn("0x7")]=t,this[zn("0x8")]=r,this[zn("0x9")]=(null===(n=this[zn("0x6")])||void 0===n?void 0:n.message)||this[zn("0x6")][zn("0xa")](),this.name=(null===(i=this[zn("0x6")])||void 0===i?void 0:i[zn("0xb")])||Un.name}toString(){return"SDKError: "+this[zn("0x9")]+(this[zn("0x7")]?zn("0xc")+this.errorSpace:"")+(this.errorCode?zn("0xd")+this[zn("0x8")]:"")}[zn("0xe")](){return t(t({name:this[zn("0xb")],message:this[zn("0x9")]},this[zn("0x7")]&&{errorSpace:this[zn("0x7")]}),this[zn("0x8")]&&{errorCode:this[zn("0x8")]})}}var jn,Vn,Hn=["filter","join"];jn=Hn,Vn=354,function(e){for(;--e;)jn.push(jn.shift())}(++Vn);var Gn,qn,Wn=function(e,t){return Hn[e-=0]},Kn=["keyIdentifier","warn","Crypto-binding is not supported. ","sessionToken","buildEncryptedRequestBody","getRotationData","data","signature","postData","find","setSessionToken","userId","setUserId","actionToken","cleanLocalStorageEvents","refreshConf","Encryption error - missing public key","COMMUNICATION","stringify","compressData","uncompressed","Failed to compress data, sending the data to the service uncompressed","getItemLocalStorageSafe","isNaN","setItemLocalStorageSafe","shouldSendDeviceEvent","EVENT_TYPE_DEVICE","sendPageLoadEvent","page_load","extractWindowRespurces","href","referrer","history","performance","getEntriesByType","resources","isArray","map","name","initiatorType","registerEventListeners","parse","Failed to parse events from localStorage","cleanupSentEvents","removeItemLocalStorageSafe","ddls","mouseEventsCollectionBuffer","publicKey","bufferInterval","EVENT_TYPE_ACTION","EVENT_TYPE_IDENTIFICATION","localStoredEventTypes","maxLocalStoredEvents","pendingQueueEnabled","configManager","getConfValue","enablePendingQueue","storageManager","deviceDataManager","requestsManager","cryptoBinding","serverPath","enableSessionToken","eventIndex","eventIdMap","flushLock","ACTION_TOKEN_CACHE_TTL","ACTION_TOKEN_CACHE_MAX_SIZE","flushTimeoutHandle","safeEventCallback","EVENT_TYPE_INTERACTION","emitEvent","eventsQueue","crypto","interactionEventsManager","isMobile","eventTypesToStore","maxEventStored","pollingSessionToken","generateEventIdentifier","getClientId","identityManager","getUserId","timestamp","action_type","set","getActionEventCacheKey","type","getDeviceId","index","attributes","correlationId","getCachedActionToken","includes","actionTokenCache","now","delete","token","cacheActionToken","size","keys","value","info","increaseEventIndex","location","toString","platform","sdkVersion","tabId","addEventToLocalStorage","length","flush","error","Error while emitting event","errorCode","catch","refreshSessionToken","sendDeviceDataEvent","Failed to refresh data","isTokenExpired","Failed to polling data","enrichUADataIfDoesNotExist","navigatorHighEntropyData","popAllEvents","pop","processingEvents","has","add","push","fetchEventsFromLocalStorage","forEach","sort","clientId","deviceId","sdkPlatform"];Gn=Kn,qn=180,function(e){for(;--e;)Gn.push(Gn.shift())}(++qn);var Xn=function(e,t){return Kn[e-=0]};const Yn=Xn("0x0"),Zn="lastDeviceInDeviceEvent",Jn="lse",$n=Xn("0x1"),Qn="deviceEventDataCollectionIgnoreList",ei=Xn("0x2"),ti=Xn("0x3"),ri=[Ir[Xn("0x4")],Ir[Xn("0x5")]],ni=Xn("0x6"),ii=Xn("0x7");class oi{get[Xn("0x8")](){return this[Xn("0x9")][Xn("0xa")](Xn("0xb"),!1)}constructor(e,r,n,i,o,a,s,u){this[Xn("0x9")]=e,this[Xn("0xc")]=r,this[Xn("0xd")]=n,this[Xn("0xe")]=i,this.identityManager=o,this[Xn("0xf")]=a,this[Xn("0x10")]=s,this[Xn("0x11")]=u,this[Xn("0x12")]=null,this[Xn("0x13")]=new WeakMap,this[Xn("0x14")]=!1,this.processingEvents=new Map,this.actionTokenCache=new Map,this[Xn("0x15")]=36e5,this[Xn("0x16")]=100,this[Xn("0x17")]=null,this[Xn("0x18")]=async(e,r)=>{try{const n=t({},t({interaction_type:e},r)),i={type:Ir[Xn("0x19")],attributes:n};return await this[Xn("0x1a")](i)}catch(e){}},this[Xn("0x11")]=u,this[Xn("0x1b")]=[],this[Xn("0x1c")]=new kn(e),this[Xn("0x1d")]=new an(this.configManager[Xn("0xa")](Qn,[]),this.configManager.getConfValue($n,100),this[Xn("0x18")]),this[Xn("0x1e")]=bn[Xn("0x1e")](),this[Xn("0x1f")]=this[Xn("0x9")][Xn("0xa")](ni,[Ir[Xn("0x4")]]),this[Xn("0x20")]=this[Xn("0x9")][Xn("0xa")](ii,4),this.pollingInterval=36e4,this[Xn("0x21")]()}[Xn("0x22")](e){var t;if(this.eventIdMap.has(e))return this.eventIdMap.get(e);const r=[e.type||"",this.identityManager[Xn("0x23")](),this.identityManager.getDeviceId()||"",this[Xn("0x24")][Xn("0x25")]()||"",e[Xn("0x26")],void 0!==(n=e.index)?n:"",(null===(t=e.attributes)||void 0===t?void 0:t[Xn("0x27")])||""][Wn("0x0")]((e=>""!==e))[Wn("0x1")]("-");var n;return this[Xn("0x13")][Xn("0x28")](e,r),r}[Xn("0x29")](e){var t;return((null==e?void 0:e[Xn("0x2a")])||"")+"-"+(this[Xn("0x24")][Xn("0x23")]()||"")+"-"+(this[Xn("0x24")][Xn("0x2b")]()||"")+"-"+((null==e?void 0:e.userId)||this[Xn("0x24")][Xn("0x25")]()||"")+"-"+((null==e?void 0:e[Xn("0x26")])||"")+"-"+((null==e?void 0:e[Xn("0x2c")])||"")+"-"+((null===(t=null==e?void 0:e[Xn("0x2d")])||void 0===t?void 0:t[Xn("0x27")])||(null==e?void 0:e[Xn("0x2e")])||"")}[Xn("0x2f")](e){if(!ri[Xn("0x30")](null==e?void 0:e[Xn("0x2a")]))return null;const t=this[Xn("0x29")](e),r=this[Xn("0x31")].get(t);return r?Date[Xn("0x32")]()-r[Xn("0x26")]>this[Xn("0x15")]?(this[Xn("0x31")][Xn("0x33")](t),null):r[Xn("0x34")]:null}[Xn("0x35")](e,t){if(!ri.includes(null==e?void 0:e.type)||!t)return;if(this[Xn("0x31")][Xn("0x36")]>=this[Xn("0x16")]){const e=this[Xn("0x31")][Xn("0x37")]().next()[Xn("0x38")];this[Xn("0x31")][Xn("0x33")](e)}const r=this.getActionEventCacheKey(e);this[Xn("0x31")][Xn("0x28")](r,{token:t,timestamp:Date.now()})}async[Xn("0x1a")](e){if(this[Xn("0x8")]&&ri.includes(null==e?void 0:e[Xn("0x2a")])){const t=this[Xn("0x2f")](e);if(t)return vr[Xn("0x39")]("Returning cached action token",{actionType:e[Xn("0x2a")],correlationId:e.correlationId}),{actionToken:t}}e[Xn("0x2c")]=this[Xn("0x3a")](),e[Xn("0x3b")]=location[Xn("0x3c")](),e.platform=navigator[Xn("0x3d")],e[Xn("0x3e")]="1.53.0",e[Xn("0x10")]=this[Xn("0x10")],e[Xn("0x3f")]=this[Xn("0x24")].getTabId(),e[Xn("0x26")]=Date[Xn("0x32")](),await this.enrichUADataIfDoesNotExist(e);let t=0;this.eventTypesToStore[Xn("0x30")](e[Xn("0x2a")])?t=this[Xn("0x40")](e):this[Xn("0x1b")].push(e);const r=this[Xn("0x9")][Xn("0xa")]("bufferSize",2);if(this[Xn("0x1b")][Xn("0x41")]+t>=r||ri[Xn("0x30")](e[Xn("0x2a")])){this[Xn("0x17")]&&(clearTimeout(this.flushTimeoutHandle),this[Xn("0x17")]=null);try{return await this[Xn("0x42")]()}catch(t){throw vr[Xn("0x43")](Xn("0x44"),{clientId:this[Xn("0x24")].getClientId(),eventType:e[Xn("0x2a")],error:t[Xn("0x45")]?t.toLog():t}),t}}if(!this.flushTimeoutHandle&&this[Xn("0x1b")][Xn("0x41")]>0){const t=this[Xn("0x9")][Xn("0xa")](ti,2),r=Math.min(t,30);this[Xn("0x17")]=setTimeout((()=>{this[Xn("0x17")]=null,this[Xn("0x42")]()[Xn("0x46")]((t=>{vr[Xn("0x43")]("Error while emitting event (delayed flush)",{clientId:this[Xn("0x24")][Xn("0x23")](),eventType:e[Xn("0x2a")],error:t[Xn("0x45")]?t.toLog():t})}))}),1e3*r)}return{}}async[Xn("0x47")](){try{return this[Xn("0x1b")][Xn("0x41")]>0||await this[Xn("0x48")](!0),await this[Xn("0x42")]()}catch(e){vr[Xn("0x43")](Xn("0x49"),{e:e})}}async[Xn("0x21")](){try{this[Xn("0x24")][Xn("0x4a")]()&&await this[Xn("0x47")]()}catch(e){vr[Xn("0x43")](Xn("0x4b"),{e:e})}finally{setTimeout((async()=>{await this.pollingSessionToken()}),this.pollingInterval)}}async[Xn("0x4c")](e){var t;if(!(null===(t=e.attributes)||void 0===t?void 0:t[Xn("0x4d")]))try{e[Xn("0x2d")][Xn("0x4d")]=await dn()}catch(e){}}[Xn("0x4e")](){if(this[Xn("0x8")]){const e=[],t=new Set;for(;this[Xn("0x1b")][Xn("0x41")];){const r=this.eventsQueue[Xn("0x4f")]();if(!r)break;const n=this[Xn("0x22")](r);this[Xn("0x50")][Xn("0x51")](n)||t.has(n)||(t[Xn("0x52")](n),e[Xn("0x53")](r))}const r=this[Xn("0x54")]();return(null==r?void 0:r[Xn("0x41")])&&r[Xn("0x55")]((r=>{const n=this.generateEventIdentifier(r);this.processingEvents[Xn("0x51")](n)||t[Xn("0x51")](n)||(t[Xn("0x52")](n),e[Xn("0x53")](r))})),e.sort(((e,t)=>e[Xn("0x26")]-t[Xn("0x26")]))}{const e=[],t=this.fetchEventsFromLocalStorage();for(;this[Xn("0x1b")][Xn("0x41")];){const t=this[Xn("0x1b")][Xn("0x4f")]();if(!t)break;e[Xn("0x53")](t)}return(null==t?void 0:t[Xn("0x41")])&&e[Xn("0x53")](...t),e[Xn("0x56")](((e,t)=>e[Xn("0x26")]-t.timestamp))}}async flush(){let e=[];if(this[Xn("0x8")]){for(;this.flushLock;)await new Promise((e=>setTimeout(e,10)));this.flushLock=!0;try{if(e=this[Xn("0x4e")](),0===e[Xn("0x41")])return{};e[Xn("0x55")]((e=>{const t=this.generateEventIdentifier(e);this[Xn("0x50")][Xn("0x28")](t,e)}))}finally{this[Xn("0x14")]=!1}}else if(e=this.popAllEvents(),0===e[Xn("0x41")])return{};const r={};r[Xn("0x57")]=this.identityManager.getClientId(),r[Xn("0x58")]=this[Xn("0x24")][Xn("0x2b")](),r.userId=this[Xn("0x24")][Xn("0x25")](),r[Xn("0x59")]=this[Xn("0x1e")]?Dr:"desktop_web",r.events=e;try{const{keyIdentifier:e}=await this[Xn("0xf")].getPublicData();r[Xn("0x5a")]=e}catch(e){vr[Xn("0x5b")](Xn("0x5c")+e)}this[Xn("0x11")]&&(r[Xn("0x5d")]=!0);try{const n=await this[Xn("0x5e")](r,!0),i=await this[Xn("0xf")][Xn("0x5f")]();let o;i&&(o=[{type:"key_rotation_data",data:i[Xn("0x60")],signature:i[Xn("0x61")]}]);const a=await this.requestsManager[Xn("0x62")]("device/events",t(t({},n),o?{headers:o}:{}));if(a.headers){const e=a.headers[Xn("0x63")]((e=>"key_rotation_status"===e.type));e&&e[Xn("0x38")]&&this[Xn("0xf")].handleRotateResponse(e[Xn("0x38")])}return a[Xn("0x58")]&&this[Xn("0x24")].setDeviceId(a[Xn("0x58")]),a[Xn("0x5d")]&&this[Xn("0x24")][Xn("0x64")](a[Xn("0x5d")]),a[Xn("0x65")]&&this[Xn("0x24")][Xn("0x66")](a.userId),this.pendingQueueEnabled?(e[Xn("0x55")]((e=>{ri.includes(e[Xn("0x2a")])&&a[Xn("0x67")]&&this[Xn("0x35")](e,a[Xn("0x67")])})),this.cleanupSentEvents(e),e[Xn("0x55")]((e=>{const t=this[Xn("0x22")](e);this[Xn("0x50")][Xn("0x33")](t)}))):this[Xn("0x68")](),a}catch(r){throw this[Xn("0x8")]&&e[Xn("0x55")]((e=>{const t=this[Xn("0x22")](e);this.processingEvents[Xn("0x33")](t)})),r}}async[Xn("0x5e")](e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=this[Xn("0x9")][Xn("0xa")](ei,null);if(null===r&&t)return await this[Xn("0x9")][Xn("0x69")](this[Xn("0x24")].getClientId()),await this.buildEncryptedRequestBody(e);if(null===r)throw new Un(new Error(Xn("0x6a")),Fn[Xn("0x6b")]);try{const t=JSON[Xn("0x6c")](e),n=this[Xn("0x6d")](t),i=n||t,{encryptedData:o,encryptedKey:a}=await this[Xn("0x1c")].encrypt(r,i);return{data:o,key:a,dataType:n?Cn.compress:Cn[Xn("0x6e")]}}catch(e){throw new Un(e,Fn.CLIENT)}}[Xn("0x6d")](e){try{return or(e)}catch(e){vr[Xn("0x43")](Xn("0x6f"),{clientId:this[Xn("0x24")][Xn("0x23")](),error:e})}}increaseEventIndex(){if(null===this[Xn("0x12")]){const e=this[Xn("0xc")][Xn("0x70")]("rei"),t=Number.parseInt(e);this[Xn("0x12")]=Number[Xn("0x71")](t)?-1:t}return this[Xn("0x12")]++,this.storageManager[Xn("0x72")]("rei",this[Xn("0x12")][Xn("0x3c")]()),this[Xn("0x12")]}[Xn("0x73")](){const e=this[Xn("0xc")].getItemLocalStorageSafe(Yn),t=this.storageManager[Xn("0x70")](Zn);return!e||!t||Date[Xn("0x32")]()-e>864e5||t!=this.identityManager[Xn("0x2b")]()}async[Xn("0x48")](e){if(!e&&!this[Xn("0x73")]())return vr[Xn("0x39")]("no need to send device event"),!1;const t=await this.deviceDataManager.getDeviceData(),r={type:Ir[Xn("0x74")],attributes:t},n=await this[Xn("0x1a")](r);return n&&(this[Xn("0xc")].setItemLocalStorageSafe(Yn,Date[Xn("0x32")]()),this.storageManager[Xn("0x72")](Zn,this.identityManager.getDeviceId())),n}async[Xn("0x75")](){const e=Xn("0x76");if(this[Xn("0x9")].getConfValue(Qn,[])[Xn("0x30")](e))return!1;const r=this[Xn("0x77")]();return await this[Xn("0x1a")]({type:Ir[Xn("0x19")],attributes:t(t({interaction_type:e,location:window[Xn("0x3b")][Xn("0x78")],referrer:document[Xn("0x79")]},window[Xn("0x7a")]&&{window_historyLength:window[Xn("0x7a")][Xn("0x41")]}),r&&{windowResources:r})}),!0}[Xn("0x77")](){try{const e=window[Xn("0x7b")][Xn("0x7c")](Xn("0x7d"));return e&&Array[Xn("0x7e")](e)?e[Xn("0x7f")]((e=>({name:e[Xn("0x80")],initiatorType:e[Xn("0x81")]}))):void 0}catch(e){}}[Xn("0x82")](){this[Xn("0x1d")].registerEventListeners(),this[Xn("0x24")][Xn("0x82")]()}[Xn("0x54")](){const e=this[Xn("0xc")][Xn("0x70")](Jn);if(!e)return[];try{return JSON[Xn("0x83")](e)}catch(e){return vr.error(Xn("0x84"),{error:e}),[]}}[Xn("0x40")](e){const t=this[Xn("0x54")]();return Pr.maintainLastXItems(t,this[Xn("0x20")],e),this[Xn("0xc")].setItemLocalStorageSafe(Jn,JSON[Xn("0x6c")](t)),t[Xn("0x41")]}cleanLocalStorageEvents(){this[Xn("0xc")].removeItemLocalStorageSafe(Jn)}[Xn("0x85")](e){if(0===e[Xn("0x41")])return;const t=this.fetchEventsFromLocalStorage();if(!t||0===t[Xn("0x41")])return;const r=new Set;for(const t of e)r[Xn("0x52")](this.generateEventIdentifier(t));const n=t.filter((e=>!r[Xn("0x51")](this[Xn("0x22")](e))));n[Xn("0x41")]!==t[Xn("0x41")]&&(n[Xn("0x41")]>0?this[Xn("0xc")].setItemLocalStorageSafe(Jn,JSON[Xn("0x6c")](n)):this[Xn("0xc")][Xn("0x86")](Jn))}}var ai,si,ui=["rst","userIdStorageExpiry","storageManager","configManager","setClientId","clientId","loadDeviceId","loadTabId","addEventListener","beforeunload","saveTabIdOnUnload","getDeviceId","setDeviceId","deviceId","Updating DeviceId","getItemSessionStorageSafe","getItemLocalStorageSafe","getClientId","getUserId","getConfValue","removeUserId","setItemLocalStorageSafe","now","removeItemLocalStorageSafe","removeItemSessionStorageSafe","tabId","floor","random","MAX_SAFE_INTEGER","toString","setItemSessionStorageSafe","setSessionToken","getSessionToken","isTokenExpired","parse","exp","rui","rci","rti"];ai=ui,si=153,function(e){for(;--e;)ai.push(ai.shift())}(++si);var ci=function(e,t){return ui[e-=0]};const li=ci("0x0"),di=ci("0x1"),hi="rdi",fi="rdit",pi=ci("0x2"),gi=ci("0x3"),mi=ci("0x4");class yi{constructor(e,t,r){this[ci("0x5")]=e,this[ci("0x6")]=t,this.clientId=r,this[ci("0x7")](this[ci("0x8")])}load(){this[ci("0x9")](),this[ci("0xa")]()}registerEventListeners(){window[ci("0xb")](ci("0xc"),(async()=>this[ci("0xd")]()))}[ci("0xe")](){return this.deviceId}[ci("0xf")](e){this[ci("0x10")]!==e&&(vr.info(ci("0x11"),{deviceId:e}),this[ci("0x10")]=e,this[ci("0x5")].setItemSessionStorageSafe(hi,e),this[ci("0x5")].setItemLocalStorageSafe(hi,e))}[ci("0x9")](){const e=this.storageManager[ci("0x12")](hi)||this[ci("0x5")][ci("0x13")](hi);return null!=e&&this[ci("0xf")](e),e}[ci("0x14")](){return this[ci("0x8")]}[ci("0x7")](e){this[ci("0x5")][ci("0x14")]()!=e&&this[ci("0x5")][ci("0x7")](e),this[ci("0x5")].setItemSessionStorageSafe(di,e)}[ci("0x15")](){if(Number(this[ci("0x5")][ci("0x13")](fi))+this[ci("0x6")][ci("0x16")](mi,864e5)<Date.now())return this[ci("0x17")](),null;const e=this[ci("0x5")][ci("0x12")](li);return null!=e?e:this[ci("0x5")][ci("0x13")](li)}setUserId(e){this.userId=e,this.storageManager.setItemSessionStorageSafe(li,e),this[ci("0x5")].setItemLocalStorageSafe(li,e),this[ci("0x5")][ci("0x18")](fi,Date[ci("0x19")]())}[ci("0x17")](){this.storageManager.removeItemSessionStorageSafe(li),this[ci("0x5")].removeItemLocalStorageSafe(li),this[ci("0x5")][ci("0x1a")](fi)}[ci("0xa")](){const e=this.storageManager[ci("0x12")](pi);e?(this.storageManager[ci("0x1b")](pi),this.tabId=e):this[ci("0x1c")]=Math[ci("0x1d")](Math[ci("0x1e")]()*Number[ci("0x1f")])[ci("0x20")]()}getTabId(){return this[ci("0x1c")]}[ci("0xd")](){this[ci("0x5")][ci("0x21")](pi,this[ci("0x1c")])}[ci("0x22")](e){this[ci("0x5")].setItemLocalStorageSafe(gi,e)}[ci("0x23")](){return this[ci("0x5")][ci("0x13")](gi)||this[ci("0x5")].getItemSessionStorageSafe(gi)}[ci("0x24")](){var e;const t=this[ci("0x23")]();if(!t)return!0;try{const r=JSON[ci("0x25")](atob(t.split(".")[1]));let n=(null!==(e=r[ci("0x26")])&&void 0!==e?e:r.iat)*(r[ci("0x26")]&&r[ci("0x26")]<1e12?1e3:1);return r[ci("0x26")]||(n+=9e5),Date[ci("0x19")]()>=n}catch(e){return vr.error("Invalid JWT:",{error:e}),!0}}}var vi,wi,bi=["postDataFromURL","POST","include","stringify","callServer","getData","GET","fetch","CLIENT","json","statusText","SERVER","status","COMMUNICATION","serverPath","postData"];vi=bi,wi=270,function(e){for(;--e;)vi.push(vi.shift())}(++wi);var _i=function(e,t){return bi[e-=0]};class Ai{constructor(e){this[_i("0x0")]=e}async[_i("0x1")](e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this[_i("0x2")](this[_i("0x0")]+e,t,r)}async postDataFromURL(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={method:_i("0x3"),credentials:_i("0x4"),headers:new Headers(t({"Content-Type":"application/json"},n)),body:JSON[_i("0x5")](r)};return await this[_i("0x6")](e,i)}async[_i("0x7")](e){const t=this[_i("0x0")]+e,r={method:_i("0x8"),credentials:_i("0x4")};return await this.callServer(t,r)}async[_i("0x6")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(_i("0x9")in window))throw new Un(new Error("fetch-api is not supported"),Fn[_i("0xa")]);try{const r=await fetch(e,t),n=await r[_i("0xb")]();if(r.ok)return n;throw new Un(new Error(n.message||r[_i("0xc")]),Fn[_i("0xd")],r[_i("0xe")])}catch(e){if(!(e instanceof Un))throw new Un(new Error(e.message),Fn[_i("0xf")]);throw e}}}var Ei,Ci,xi=["Invalid SDK params was provided: ","stringify","string","logIfInvalid","info","throwError","validateSDKParams","keys","REQUIRED_SDK_PARAMS","filter","throwOrReturnResult"];Ei=xi,Ci=244,function(e){for(;--e;)Ei.push(Ei.shift())}(++Ci);var Si=function(e,t){return xi[e-=0]};class Ii{constructor(){this.REQUIRED_SDK_PARAMS={clientId:Si("0x0")}}throwOrReturnResult(e,t,r){if(!e&&((null==t?void 0:t[Si("0x1")])&&vr[Si("0x2")](r),null==t?void 0:t[Si("0x3")]))throw new Error(r);return e}[Si("0x4")](e,t){const r=Object[Si("0x5")](this[Si("0x6")])[Si("0x7")]((t=>typeof e[t]!=this[Si("0x6")][t]));return this[Si("0x8")](0==r.length,t,Si("0x9")+JSON[Si("0xa")](r))}}var Ti,Mi,Di=["lastTimeLogsSent","logMiddleware","reportLogs","middlewares","push","getConfValue","enableLogsReporting","logsMinimumBatch","logs","now","flush","identityManager","getClientId","platform","requestsManager","postData","device/logs","configManager"];Ti=Di,Mi=467,function(e){for(;--e;)Ti.push(Ti.shift())}(++Mi);var Ri=function(e,t){return Di[e-=0]};class Oi{constructor(e,t,r){this.requestsManager=e,this.identityManager=t,this[Ri("0x0")]=r,this[Ri("0x1")]=0,this[Ri("0x2")]=async()=>{try{await this[Ri("0x3")]()}catch(e){}},vr[Ri("0x4")][Ri("0x5")](this.logMiddleware)}async reportLogs(){if(!this.configManager[Ri("0x6")](Ri("0x7"),!1))return;const e=this.configManager[Ri("0x6")](Ri("0x8"),6),t=this[Ri("0x0")][Ri("0x6")]("logsMinimumDelay",12e4);if(vr[Ri("0x9")].length<e||this.lastTimeLogsSent+t>Date[Ri("0xa")]())return;this[Ri("0x1")]=Date[Ri("0xa")]();const r=vr[Ri("0xb")](),n=this[Ri("0xc")][Ri("0xd")](),i=Math.floor(Date.now()/1e3),o={sdkVersion:"1.53.0",platform:navigator[Ri("0xe")],clientId:n,timestamp:i,logEntries:r};await this[Ri("0xf")][Ri("0x10")](Ri("0x11"),o)}}var ki,Ni,Pi=["storageManager","migrateIdentifiers","getDeviceId","getClientId","endsWith","postDataFromURL","deviceId","setItemLocalStorageSafe","true","rimd","identityManager","requestsManager"];ki=Pi,Ni=321,function(e){for(;--e;)ki.push(ki.shift())}(++Ni);var Bi=function(e,t){return Pi[e-=0]};const Fi=Bi("0x0");class Li{constructor(e,t,r){this[Bi("0x1")]=e,this[Bi("0x2")]=t,this[Bi("0x3")]=r}async[Bi("0x4")](e){if("true"!=this[Bi("0x3")].getItemLocalStorageSafe(Fi)){const t=this[Bi("0x1")][Bi("0x5")](),r=this.identityManager[Bi("0x6")](),n=(e[Bi("0x7")]("/")?e:e+"/")+"device/migrate-identifiers",i=await this[Bi("0x2")][Bi("0x8")](n,{deviceId:t,clientId:r});i.deviceId&&i[Bi("0x9")]==t&&this[Bi("0x3")][Bi("0xa")](Fi,Bi("0xb"))}}}var zi,Ui,ji=["clearUser","RiskID","TSAccountProtection","dispatchEvent","RiskIDReady","sdkEnabled","enableIdentifiersMigration","verbose","actions","https://collect.riskid.security/","email","ssn","national_id","passport_number","drivers_license_number","other","initializationPromise","disabledReason","enableSessionToken","identifiersMigrationEnabled","firstPartyMigrationUrl","validationManager","initializedInstance","SDK already initialized","string","clientId","options","serverPath","toString","enabled","validateSDKParams","invalid_params","mainEntry","initialize","requestsManager","storageManager","configManager","identityManager","load","generateDisabledToken","now","getConfValue","getActions","isInitialized","getSessionToken","Session token is not enabled","info","SDK disabled","session","eventsManager","object","userId","sdk init started","refreshConf","getClientId","keyRotation","createCryptoBinding","sign","isEnabled","expiryDays","deviceDataManager","cryptoBinding","missing_config","config_disabled","migrationsManager","migrateIdentifiers","sendDeviceDataEvent","catch","sendPageLoadEvent","updateUserId","flush","sdk init done","init_not_called","init_failed","action","warn","CLIENT","_error_'invalid action type - ","claimedUserIdType","Invalid claimedUserIdType","invalid_claimed_user_id_type_","EVENT_TYPE_ACTION","correlationId","claimedUserId","publicKey","extensionMetadata","extensionDeviceAttributes","suspiciousSignals","suspiciousContext","downloadFile","uploadFile","transactionData","undefined","customAttributes","emitEvent","Unhandled SDK error. Received eventResponse: ","stringify","errorSpace","SERVER","_error_","errorCode","message","unexpected_error_","includes","identifyUser called without a valid userid","identifyUser","getUserId","setUserId","EVENT_TYPE_IDENTIFICATION","unidentifiedUser","removeUserId","setUser","setAuthenticatedUser"];zi=ji,Ui=457,function(e){for(;--e;)zi.push(zi.shift())}(++Ui);var Vi=function(e,t){return ji[e-=0]};const Hi=[null,void 0,"undefined","",0],Gi=Vi("0x0"),qi=Vi("0x1"),Wi=Vi("0x2"),Ki=Vi("0x3"),Xi=Vi("0x4"),Yi=[Vi("0x5"),"phone_number","account_id",Vi("0x6"),Vi("0x7"),Vi("0x8"),Vi("0x9"),Vi("0xa")];class Zi{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r;if(this[Vi("0xb")]=null,this[Vi("0xc")]=null,this[Vi("0xd")]=!1,this[Vi("0xe")]=!1,this[Vi("0xf")]=null,this[Vi("0x10")]=new Ii,Zi[Vi("0x11")])throw new Error(Vi("0x12"));Zi[Vi("0x11")]=!0;const n=typeof t===Vi("0x13");this[Vi("0x14")]=n?t:e,this[Vi("0x15")]=n?{serverPath:e}:t,(r=this[Vi("0x15")])[Vi("0x16")]||(r[Vi("0x16")]=Xi),this[Vi("0x15")].serverPath=new URL(this[Vi("0x15")][Vi("0x16")])[Vi("0x17")](),this[Vi("0xf")]=this[Vi("0x15")][Vi("0xf")]||null,vr[Vi("0x18")]=!!this[Vi("0x15")][Vi("0x2")],this[Vi("0x10")][Vi("0x19")](this,{throwError:!0,logIfInvalid:!0})||(this.disabledReason=Vi("0x1a")),this.storageManager=new hr(this[Vi("0x14")]),this[Vi("0x1d")]=new Ai(this[Vi("0x15")][Vi("0x16")]),this.configManager=new Er(this.storageManager,this[Vi("0x1d")]),this.identityManager=new yi(this[Vi("0x1e")],this[Vi("0x1f")],this[Vi("0x14")]),this[Vi("0x20")][Vi("0x21")](),this.migrationsManager=new Li(this[Vi("0x20")],this[Vi("0x1d")],this[Vi("0x1e")]),this.enableSessionToken=this.options[Vi("0xd")]||!1,this.logsReporter=new Oi(this.requestsManager,this[Vi("0x20")],this[Vi("0x1f")])}[Vi("0x22")](e){const t=Date[Vi("0x23")]();return"disabled_sdk_"+(this.disabledReason||"unknown")+"_"+e+"_"+t}get actions(){return this[Vi("0x1f")][Vi("0x24")](Ki,[])}async[Vi("0x25")](){return await this[Vi("0x26")](),this[Vi("0x3")]}async[Vi("0x27")](){if(!this.enableSessionToken)throw new Error(Vi("0x28"));return await this[Vi("0x26")]()?(this[Vi("0x20")].isTokenExpired()&&await this[Vi("0x2c")].refreshSessionToken(),this[Vi("0x20")][Vi("0x27")]()):(vr[Vi("0x29")](Vi("0x2a")),this[Vi("0x22")](Vi("0x2b")))}async init(e){const t=typeof e!==Vi("0x2d")?e:null==e?void 0:e[Vi("0x2e")];return vr[Vi("0x29")](Vi("0x2f")),this[Vi("0xb")]=(async()=>{await this[Vi("0x1f")][Vi("0x30")](this[Vi("0x20")][Vi("0x31")]());const e=this[Vi("0x1f")][Vi("0x24")]("tenantId",null),r=this[Vi("0x1f")].getConfValue(Vi("0x32"),null);if(this.cryptoBinding=cr.crypto[Vi("0x33")](Vi("0x34"),(null==r?void 0:r[Vi("0x35")])?{keyRotation:{isEnabled:!0,expiryDays:r[Vi("0x36")],startedAt:r.startedAt,tenantId:e}}:void 0),this[Vi("0x37")]=new wn(this[Vi("0x1e")],this[Vi("0x1f")],this[Vi("0x38")]),this[Vi("0x2c")]=new oi(this[Vi("0x1f")],this[Vi("0x1e")],this.deviceDataManager,this.requestsManager,this[Vi("0x20")],this[Vi("0x38")],this[Vi("0x15")][Vi("0x16")],this.enableSessionToken),null!==this[Vi("0xc")])return!1;const n=this[Vi("0x1f")].getConfValue(Gi,void 0);return n?(this[Vi("0xe")]=this[Vi("0xe")]||this[Vi("0x1f")][Vi("0x24")](qi,!1),this[Vi("0xe")]&&this.firstPartyMigrationUrl&&await this[Vi("0x3b")][Vi("0x3c")](this[Vi("0xf")]),vr[Vi("0x18")]=vr.enabled||!!this[Vi("0x1f")][Vi("0x24")](Wi,!1),await this[Vi("0x2c")][Vi("0x3d")]()[Vi("0x3e")]((()=>{})),await this[Vi("0x2c")][Vi("0x3f")]()[Vi("0x3e")]((()=>{})),await this[Vi("0x40")](t).catch((()=>{})),this[Vi("0x2c")].registerEventListeners(),await this[Vi("0x2c")][Vi("0x41")]()[Vi("0x3e")]((()=>{})),vr[Vi("0x29")](Vi("0x42")),!0):(this[Vi("0xc")]=Vi(void 0===n?"0x39":"0x3a"),!1)})(),await this.initializationPromise}async[Vi("0x26")](){if(null===this[Vi("0xb")])return this[Vi("0xc")]||(this[Vi("0xc")]=Vi("0x43")),!1;const e=await this[Vi("0xb")];return e||this[Vi("0xc")]||(this.disabledReason=Vi("0x44")),e}async triggerActionEvent(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Date[Vi("0x23")]();if(!await this.isInitialized())return vr[Vi("0x29")](Vi("0x2a")),{actionToken:this[Vi("0x22")](Vi("0x45"))};if(!this.actions.includes(e))return vr[Vi("0x46")]("Invalid action type",{actionType:e}),{actionToken:Fn[Vi("0x47")]+Vi("0x48")+e+"'_"+n};const i=null==r?void 0:r[Vi("0x49")];if(i&&!Yi.includes(i))return vr[Vi("0x46")](Vi("0x4a"),{claimedUserIdType:i}),{actionToken:Vi("0x4b")+i+"_"+n};let o;this[Vi("0x1f")][Vi("0x24")]("enableDeviceAttributesInActions",!1)&&(o=await this.deviceDataManager.getDeviceData());const a=t({type:Ir[Vi("0x4c")],attributes:t(t(t(t(t(t(t(t(t(t(t(t(t({action_type:e},(null==r?void 0:r.correlationId)&&{correlation_id:r[Vi("0x4d")]}),(null==r?void 0:r[Vi("0x4e")])&&{claimed_user_id:r[Vi("0x4e")]}),i&&{claimed_user_id_type:i}),(null==r?void 0:r[Vi("0x4f")])&&{public_key:r.publicKey}),(null==r?void 0:r.extensionMetadata)&&{extension_metadata:r[Vi("0x50")]}),(null==r?void 0:r[Vi("0x51")])&&{extension_device_attributes:r.extensionDeviceAttributes}),(null==r?void 0:r[Vi("0x52")])&&{suspicious_signals:r[Vi("0x52")]}),(null==r?void 0:r[Vi("0x53")])&&{suspicious_context:r.suspiciousContext}),(null==r?void 0:r[Vi("0x54")])&&{download_file:r[Vi("0x54")]}),(null==r?void 0:r[Vi("0x55")])&&{upload_file:r[Vi("0x55")]}),(null==r?void 0:r[Vi("0x56")])&&{transactionData:r[Vi("0x56")]}),typeof PACKAGE_VERSION!==Vi("0x57")&&{platform_sdk_version:PACKAGE_VERSION}),o)},(null==r?void 0:r[Vi("0x58")])&&{customAttributes:r[Vi("0x58")]});try{const e=await this[Vi("0x2c")][Vi("0x59")](a),{actionToken:t}=e;if(!t)throw new Un(new Error(Vi("0x5a")+(typeof e==Vi("0x2d")?JSON[Vi("0x5b")](e).slice(15):e)),Fn.CLIENT);return e}catch(r){return{actionToken:r instanceof Un?r[Vi("0x5c")]===Fn[Vi("0x5d")]?r[Vi("0x5c")]+Vi("0x5e")+e+"_"+r[Vi("0x5f")]+"_'"+r[Vi("0x60")]+"'_"+n:r[Vi("0x5c")]+Vi("0x5e")+e+"_'"+r[Vi("0x60")]+"'_"+n:Vi("0x61")+e+"_"+n}}}async identifyUser(e){return await this[Vi("0x26")]()?this[Vi("0x40")](e):(vr[Vi("0x29")](Vi("0x2a")),!1)}async[Vi("0x40")](e){if(Hi[Vi("0x62")](e))return vr.info(Vi("0x63"),{userId:e}),!1;e=e.toString(),vr[Vi("0x29")](Vi("0x64"),{userId:e});const t=this.identityManager[Vi("0x65")]();return t===e||(this[Vi("0x20")][Vi("0x66")](e),!!(await this[Vi("0x2c")][Vi("0x59")]({type:Ir[Vi("0x67")],attributes:{previous_user_id:t,user_id:e}})).deviceId)}async[Vi("0x68")](){if(!await this[Vi("0x26")]())return vr[Vi("0x29")](Vi("0x2a")),!1;const e=this[Vi("0x20")][Vi("0x65")]();return null!=e&&this[Vi("0x20")][Vi("0x69")](),!!(await this[Vi("0x2c")][Vi("0x59")]({type:Ir.EVENT_TYPE_IDENTIFICATION,attributes:{previous_user_id:e}})).deviceId}async setAuthenticatedUser(e){return await this[Vi("0x64")](e)}async[Vi("0x6a")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this[Vi("0x6b")](e,t)}async[Vi("0x6c")](){return await this.unidentifiedUser()}}Zi.initializedInstance=!1,document.dispatchEvent(new CustomEvent("TSAccountProtectionReady"));var Ji,$i,Qi=["getActions","getSessionToken","identityManager","getDeviceId","getClientId","flush","events","MODULE_INITIALIZED","moduleMetadata","init","utils","TsError","not_initialized","tsPlatform not initialized","triggerActionEvent","setUser","setAuthenticatedUser","clearUser","identifyUser","unidentifiedUser"];Ji=Qi,$i=166,function(e){for(;--e;)Ji.push(Ji.shift())}(++$i);var eo=function(e,t){return Qi[e-=0]};let to=null;function ro(e){if(!e)throw new(cr[eo("0x4")].exceptions[eo("0x5")])(eo("0x6"),eo("0x7"))}cr[eo("0x0")].on(cr[eo("0x0")][eo("0x1")],(()=>{const{clientId:e,drs:t}=cr[eo("0x2")].getInitConfig(),r=t||{},{enabled:n,userId:o}=r,a=i(r,ar);!1!==n&&(to=new Zi(e,a),to[eo("0x3")]({userId:o}))}));const no=function(){return ro(to),to[eo("0xf")]()},io={getDeviceId:()=>to[eo("0x10")][eo("0x11")](),getClientId:()=>to.identityManager[eo("0x12")](),flush:()=>to.eventsManager[eo("0x13")]()};var oo=Object.freeze({__proto__:null,__internal:io,clearUser:function(){return ro(to),to[eo("0xb")](...arguments)},getActions:function(){return ro(to),to[eo("0xe")]()},getSessionToken:no,identifyUser:function(){return ro(to),to[eo("0xc")](...arguments)},setAuthenticatedUser:function(){return ro(to),to[eo("0xa")](...arguments)},setUser:function(){return ro(to),to[eo("0x9")](...arguments)},triggerActionEvent:function(){return ro(to),to[eo("0x8")](...arguments)},unidentifiedUser:function(){return ro(to),to[eo("0xd")](...arguments)}});class ao extends Error{constructor(e,t,r){super(r),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}}const so={BASE:window.location.origin,VERSION:"",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var uo,co,lo,ho;!function(e){var t;(t=e.feedback||(e.feedback={})).OK="ok",t.OTHER="other",t.DOCUMENT_NOT_FOUND="document_not_found",t.FACE_NOT_FOUND="face_not_found",t.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",t.OBSTRUCTED="obstructed",t.BLUR="blur",t.GLARE="glare",t.DOCUMENT_NOT_SUPPORTED="document_not_supported",t.DOCUMENT_NOT_MATCHING="document_not_matching",t.WRONG_DOCUMENT_SIDE="wrong_document_side",t.MULTI_FACE="multi_face",t.FACE_ROTATED="face_rotated",t.FACE_TOO_SMALL="face_too_small",t.FACE_TOO_CLOSE="face_too_close",t.CLOSED_EYES="closed_eyes",t.FACE_ANGLE_TOO_LARGE="face_angle_too_large",t.FACE_CLOSE_TO_BORDER="face_close_to_border",t.FACE_OCCLUDED="face_occluded",t.FACE_CROPPED="face_cropped",t.BARCODE_NOT_FOUND="barcode_not_found",t.GLARE_SELFIE="glare_selfie",t.BLUR_SELFIE="blur_selfie",t.RESTRICTED_CRITERIA="restricted_criteria"}(uo||(uo={})),function(e){var t;(t=e.image_type||(e.image_type={})).DOCUMENT_FRONT="document_front",t.DOCUMENT_BACK="document_back",t.SELFIE="selfie"}(co||(co={})),function(e){var t,r;(t=e.status||(e.status={})).PENDING="pending",t.CAPTURING="capturing",t.PROCESSING="processing",t.RECAPTURE="recapture",t.COMPLETE="complete",t.ERROR="error",t.EXPIRED="expired",(r=e.recapture_reason||(e.recapture_reason={})).IMAGE_MISSING="image_missing",r.DOCUMENT_EXPIRED="document_expired",r.DOCUMENT_NOT_SUPPORTED="document_not_supported",r.DOCUMENT_DAMAGED="document_damaged",r.POOR_IMAGE_QUALITY="poor_image_quality",r.DOCUMENT_NOT_FOUND="document_not_found",r.OBSTRUCTED="obstructed",r.BLUR="blur",r.GLARE="glare",r.DOCUMENT_NOT_MATCHING="document_not_matching",r.WRONG_DOCUMENT_SIDE="wrong_document_side",r.FACE_NOT_FOUND="face_not_found",r.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",r.INVALID_INPUT="invalid_input",r.MULTI_FACE="multi_face",r.FACE_ROTATED="face_rotated",r.FACE_TOO_SMALL="face_too_small",r.FACE_TOO_CLOSE="face_too_close",r.CLOSED_EYES="closed_eyes",r.FACE_ANGLE_TOO_LARGE="face_angle_too_large",r.FACE_CLOSE_TO_BORDER="face_close_to_border",r.FACE_OCCLUDED="face_occluded",r.FACE_CROPPED="face_cropped",r.BARCODE_NOT_FOUND="barcode_not_found",r.GLARE_SELFIE="glare_selfie",r.BLUR_SELFIE="blur_selfie",r.NO_FACE="no_face",r.DOCUMENT_TYPE_RESTRICTED="document_type_restricted"}(lo||(lo={})),function(e){var t;(t=e.client_type||(e.client_type={})).HOSTED_APP="hosted_app",t.MOBILE_SDK="mobile_sdk"}(ho||(ho={}));var fo={},po={get exports(){return fo},set exports(e){fo=e}};!function(e,t){!function(r,n){var i="function",o="undefined",a="object",s="string",u="major",c="model",l="name",d="type",h="vendor",f="version",p="architecture",g="console",m="mobile",y="tablet",v="smarttv",w="wearable",b="embedded",_="Amazon",A="Apple",E="ASUS",C="BlackBerry",x="Browser",S="Chrome",I="Firefox",T="Google",M="Huawei",D="LG",R="Microsoft",O="Motorola",k="Opera",N="Samsung",P="Sharp",B="Sony",F="Xiaomi",L="Zebra",z="Facebook",U="Chromium OS",j="Mac OS",V=" Browser",H=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},G=function(e,t){return typeof e===s&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},K=function(e,t){for(var r,o,s,u,c,l,d=0;d<t.length&&!c;){var h=t[d],f=t[d+1];for(r=o=0;r<h.length&&!c&&h[r];)if(c=h[r++].exec(e))for(s=0;s<f.length;s++)l=c[++o],typeof(u=f[s])===a&&u.length>0?2===u.length?typeof u[1]==i?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==i||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},X=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(G(t[r][i],e))return"?"===r?n:r}else if(G(t[r],e))return"?"===r?n:r;return t.hasOwnProperty("*")?t["*"]:e},Y={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,k+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[l,k+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[l,k]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[l,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[l,"Smart Lenovo "+x]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+x],f],[/\bfocus\/([\w\.]+)/i],[f,[l,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,k+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,k+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[f,[l,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360"+V]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+V],f],[/samsungbrowser\/([\w\.]+)/i],[f,[l,N+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[l,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,z],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,S+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/(wolvic)\/([\w\.]+)/i],[l,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[l,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,q]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,N],[d,y]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,N],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[h,A],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,A],[d,y]],[/(macintosh);/i],[c,[h,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,P],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,M],[d,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,M],[d,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[c,/_/g," "],[h,F],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,F],[d,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[d,m]],[/\b(opd2\d{3}a?) bui/i],[c,[h,"OPPO"],[d,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,O],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,O],[d,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,D],[d,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,D],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[d,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[h,T],[d,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,T],[d,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,B],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,B],[d,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,_],[d,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,_],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[d,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,C],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,E],[d,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,E],[d,m]],[/(nexus 9)/i],[c,[h,"HTC"],[d,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[d,m]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[c,[h,"TCL"],[d,y]],[/(itel) ((\w+))/i],[[h,q],c,[d,X,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[d,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[h,"Ulefone"],[d,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[c,[h,"Nothing"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[d,y]],[/(surface duo)/i],[c,[h,R],[d,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[d,m]],[/(u304aa)/i],[c,[h,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[d,y]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[d,y]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[d,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[d,y]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[d,y]],[/\b(k88) b/i],[c,[h,"ZTE"],[d,y]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[d,y]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[d,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[d,y]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[d,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[d,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[d,m]],[/\b(ph-1) /i],[c,[h,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[d,y]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[d,y]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[d,y]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[d,y]],[/(sprint) (\w+)/i],[h,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,R],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,L],[d,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,L],[d,m]],[/smart-tv.+(samsung)/i],[h,[d,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,N],[d,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,D],[d,v]],[/(apple) ?tv/i],[h,[c,A+" TV"],[d,v]],[/crkey/i],[[c,S+"cast"],[h,T],[d,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[h,_],[d,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,P],[d,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,B],[d,v]],[/(mitv-\w{5}) bui/i],[c,[h,F],[d,v]],[/Hbbtv.*(technisat) (.*);/i],[h,c,[d,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,W],[c,W],[d,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[d,g]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[c,[h,B],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,R],[d,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[c,[h,N],[d,w]],[/((pebble))app/i],[h,c,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[h,A],[d,w]],[/droid.+; (glass) \d/i],[c,[h,T],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,L],[d,w]],[/(quest( \d| pro)?)/i],[c,[h,z],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,b]],[/(aeobc)\b/i],[c,[h,_],[d,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[f,X,Y]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,X,Y],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,f],[/\(bb(10);/i],[f,[l,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[l,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,U],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,f]]},J=function e(t,g){if(typeof t===a&&(g=t,t=n),!(this instanceof e))return new e(t,g).getResult();var v=typeof r!==o&&r.navigator?r.navigator:n,w=t||(v&&v.userAgent?v.userAgent:""),b=v&&v.userAgentData?v.userAgentData:n,_=g?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(Z,g):Z,A=v&&v.userAgent==w;return this.getBrowser=function(){var e={};return e[l]=n,e[f]=n,K.call(e,w,_.browser),e[u]=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e[f]),A&&v&&v.brave&&typeof v.brave.isBrave==i&&(e[l]="Brave"),e},this.getCPU=function(){var e={};return e[p]=n,K.call(e,w,_.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[c]=n,e[d]=n,K.call(e,w,_.device),A&&!e[d]&&b&&b.mobile&&(e[d]=m),A&&"Macintosh"==e[c]&&v&&typeof v.standalone!==o&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[c]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[l]=n,e[f]=n,K.call(e,w,_.engine),e},this.getOS=function(){var e={};return e[l]=n,e[f]=n,K.call(e,w,_.os),A&&!e[l]&&b&&b.platform&&"Unknown"!=b.platform&&(e[l]=b.platform.replace(/chrome os/i,U).replace(/macos/i,j)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return w},this.setUA=function(e){return w=typeof e===s&&e.length>500?W(e,500):e,this},this.setUA(w),this};J.VERSION="1.0.39",J.BROWSER=H([l,f,u]),J.CPU=H([p]),J.DEVICE=H([c,h,d,g,m,v,y,w,b]),J.ENGINE=J.OS=H([l,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var $=typeof r!==o&&(r.jQuery||r.Zepto);if($&&!$.ua){var Q=new J;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)$.ua[r]=t[r]}}}("object"==typeof window?window:Z)}(po,fo);const go="1.4.10",mo=fo.UAParser(),yo=go;function vo(e,t){var r,n,i,o,a;return{Authorization:`Bearer ${t}`,"ts-sdk-version":yo,"ts-client-id":e,"ts-user-agent":navigator.userAgent,"ts-platform":"web-sdk","ts-os":null===(r=null==mo?void 0:mo.os)||void 0===r?void 0:r.name,"ts-os-version":null===(n=null==mo?void 0:mo.os)||void 0===n?void 0:n.version,"ts-device-model":null===(i=null==mo?void 0:mo.device)||void 0===i?void 0:i.model,"ts-manufacturer":null===(o=null==mo?void 0:mo.device)||void 0===o?void 0:o.vendor,"ts-browser":null===(a=null==mo?void 0:mo.browser)||void 0===a?void 0:a.name,"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent}}var wo="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},bo=[],_o=[],Ao="undefined"!=typeof Uint8Array?Uint8Array:Array,Eo=!1;function Co(){Eo=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)bo[t]=e[t],_o[e.charCodeAt(t)]=t;_o["-".charCodeAt(0)]=62,_o["_".charCodeAt(0)]=63}function xo(e,t,r){for(var n,i,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(bo[(i=n)>>18&63]+bo[i>>12&63]+bo[i>>6&63]+bo[63&i]);return o.join("")}function So(e){var t;Eo||Co();for(var r=e.length,n=r%3,i="",o=[],a=16383,s=0,u=r-n;s<u;s+=a)o.push(xo(e,s,s+a>u?u:s+a));return 1===n?(t=e[r-1],i+=bo[t>>2],i+=bo[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=bo[t>>10],i+=bo[t>>4&63],i+=bo[t<<2&63],i+="="),o.push(i),o.join("")}function Io(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?i-1:0,h=r?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=c}return(f?-1:1)*a*Math.pow(2,o-n)}function To(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+f]=255&a,f+=p,a/=256,c-=8);e[r+f-p]|=128*g}var Mo={}.toString,Do=Array.isArray||function(e){return"[object Array]"==Mo.call(e)};No.TYPED_ARRAY_SUPPORT=void 0===wo.TYPED_ARRAY_SUPPORT||wo.TYPED_ARRAY_SUPPORT;var Ro=Oo();function Oo(){return No.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ko(e,t){if(Oo()<t)throw new RangeError("Invalid typed array length");return No.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=No.prototype:(null===e&&(e=new No(t)),e.length=t),e}function No(e,t,r){if(!(No.TYPED_ARRAY_SUPPORT||this instanceof No))return new No(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Fo(this,e)}return Po(this,e,t,r)}function Po(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);No.TYPED_ARRAY_SUPPORT?(e=t).__proto__=No.prototype:e=Lo(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!No.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|jo(t,r);e=ko(e,n);var i=e.write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(Uo(t)){var r=0|zo(t.length);return 0===(e=ko(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?ko(e,0):Lo(e,t);if("Buffer"===t.type&&Do(t.data))return Lo(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Bo(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Fo(e,t){if(Bo(t),e=ko(e,t<0?0:0|zo(t)),!No.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function Lo(e,t){var r=t.length<0?0:0|zo(t.length);e=ko(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function zo(e){if(e>=Oo())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Oo().toString(16)+" bytes");return 0|e}function Uo(e){return!(null==e||!e._isBuffer)}function jo(e,t){if(Uo(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return pa(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ga(e).length;default:if(n)return pa(e).length;t=(""+t).toLowerCase(),n=!0}}function Vo(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return na(this,t,r);case"utf8":case"utf-8":return Qo(this,t,r);case"ascii":return ta(this,t,r);case"latin1":case"binary":return ra(this,t,r);case"base64":return $o(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ia(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Ho(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Go(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=No.from(t,n)),Uo(t))return 0===t.length?-1:qo(e,t,r,n,i);if("number"==typeof t)return t&=255,No.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):qo(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function qo(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var d=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){d=!1;break}if(d)return o}return-1}function Wo(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function Ko(e,t,r,n){return ma(pa(t,e.length-r),e,r,n)}function Xo(e,t,r,n){return ma(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function Yo(e,t,r,n){return Xo(e,t,r,n)}function Zo(e,t,r,n){return ma(ga(t),e,r,n)}function Jo(e,t,r,n){return ma(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function $o(e,t,r){return 0===t&&r===e.length?So(e):So(e.slice(t,r))}function Qo(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],l=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=d}return function(e){var t=e.length;if(t<=ea)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ea));return r}(n)}No.poolSize=8192,No._augment=function(e){return e.__proto__=No.prototype,e},No.from=function(e,t,r){return Po(null,e,t,r)},No.TYPED_ARRAY_SUPPORT&&(No.prototype.__proto__=Uint8Array.prototype,No.__proto__=Uint8Array),No.alloc=function(e,t,r){return function(e,t,r,n){return Bo(t),t<=0?ko(e,t):void 0!==r?"string"==typeof n?ko(e,t).fill(r,n):ko(e,t).fill(r):ko(e,t)}(null,e,t,r)},No.allocUnsafe=function(e){return Fo(null,e)},No.allocUnsafeSlow=function(e){return Fo(null,e)},No.isBuffer=ya,No.compare=function(e,t){if(!Uo(e)||!Uo(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},No.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},No.concat=function(e,t){if(!Do(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return No.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=No.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!Uo(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},No.byteLength=jo,No.prototype._isBuffer=!0,No.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Ho(this,t,t+1);return this},No.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Ho(this,t,t+3),Ho(this,t+1,t+2);return this},No.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Ho(this,t,t+7),Ho(this,t+1,t+6),Ho(this,t+2,t+5),Ho(this,t+3,t+4);return this},No.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Qo(this,0,e):Vo.apply(this,arguments)},No.prototype.equals=function(e){if(!Uo(e))throw new TypeError("Argument must be a Buffer");return this===e||0===No.compare(this,e)},No.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},No.prototype.compare=function(e,t,r,n,i){if(!Uo(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},No.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},No.prototype.indexOf=function(e,t,r){return Go(this,e,t,r,!0)},No.prototype.lastIndexOf=function(e,t,r){return Go(this,e,t,r,!1)},No.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Wo(this,e,t,r);case"utf8":case"utf-8":return Ko(this,e,t,r);case"ascii":return Xo(this,e,t,r);case"latin1":case"binary":return Yo(this,e,t,r);case"base64":return Zo(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Jo(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},No.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ea=4096;function ta(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function ra(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function na(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=fa(e[o]);return i}function ia(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function oa(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function aa(e,t,r,n,i,o){if(!Uo(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function sa(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function ua(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ca(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function la(e,t,r,n,i){return i||ca(e,0,r,4),To(e,t,r,n,23,4),r+4}function da(e,t,r,n,i){return i||ca(e,0,r,8),To(e,t,r,n,52,8),r+8}No.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),No.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=No.prototype;else{var i=t-e;r=new No(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},No.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||oa(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},No.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||oa(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},No.prototype.readUInt8=function(e,t){return t||oa(e,1,this.length),this[e]},No.prototype.readUInt16LE=function(e,t){return t||oa(e,2,this.length),this[e]|this[e+1]<<8},No.prototype.readUInt16BE=function(e,t){return t||oa(e,2,this.length),this[e]<<8|this[e+1]},No.prototype.readUInt32LE=function(e,t){return t||oa(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},No.prototype.readUInt32BE=function(e,t){return t||oa(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},No.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||oa(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},No.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||oa(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},No.prototype.readInt8=function(e,t){return t||oa(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},No.prototype.readInt16LE=function(e,t){t||oa(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},No.prototype.readInt16BE=function(e,t){t||oa(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},No.prototype.readInt32LE=function(e,t){return t||oa(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},No.prototype.readInt32BE=function(e,t){return t||oa(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},No.prototype.readFloatLE=function(e,t){return t||oa(e,4,this.length),Io(this,e,!0,23,4)},No.prototype.readFloatBE=function(e,t){return t||oa(e,4,this.length),Io(this,e,!1,23,4)},No.prototype.readDoubleLE=function(e,t){return t||oa(e,8,this.length),Io(this,e,!0,52,8)},No.prototype.readDoubleBE=function(e,t){return t||oa(e,8,this.length),Io(this,e,!1,52,8)},No.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||aa(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},No.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||aa(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},No.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,1,255,0),No.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},No.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,2,65535,0),No.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):sa(this,e,t,!0),t+2},No.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,2,65535,0),No.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):sa(this,e,t,!1),t+2},No.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,4,4294967295,0),No.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):ua(this,e,t,!0),t+4},No.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,4,4294967295,0),No.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ua(this,e,t,!1),t+4},No.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);aa(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},No.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);aa(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},No.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,1,127,-128),No.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},No.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,2,32767,-32768),No.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):sa(this,e,t,!0),t+2},No.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,2,32767,-32768),No.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):sa(this,e,t,!1),t+2},No.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,4,2147483647,-2147483648),No.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):ua(this,e,t,!0),t+4},No.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||aa(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),No.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ua(this,e,t,!1),t+4},No.prototype.writeFloatLE=function(e,t,r){return la(this,e,t,!0,r)},No.prototype.writeFloatBE=function(e,t,r){return la(this,e,t,!1,r)},No.prototype.writeDoubleLE=function(e,t,r){return da(this,e,t,!0,r)},No.prototype.writeDoubleBE=function(e,t,r){return da(this,e,t,!1,r)},No.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!No.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},No.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!No.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=Uo(e)?e:pa(new No(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var ha=/[^+\/0-9A-Za-z-_]/g;function fa(e){return e<16?"0"+e.toString(16):e.toString(16)}function pa(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function ga(e){return function(e){var t,r,n,i,o,a;Eo||Co();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new Ao(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)i=_o[e.charCodeAt(t)]<<18|_o[e.charCodeAt(t+1)]<<12|_o[e.charCodeAt(t+2)]<<6|_o[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=_o[e.charCodeAt(t)]<<2|_o[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=_o[e.charCodeAt(t)]<<10|_o[e.charCodeAt(t+1)]<<4|_o[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ha,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ma(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ya(e){return null!=e&&(!!e._isBuffer||va(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&va(e.slice(0,0))}(e))}function va(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var wa=Object.freeze({__proto__:null,Buffer:No,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),No.alloc(+e)},isBuffer:ya,kMaxLength:Ro});const ba=e=>null!=e,_a=e=>"string"==typeof e,Aa=e=>_a(e)&&""!==e,Ea=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),Ca=e=>e instanceof FormData,xa=e=>{const t=[],r=(e,n)=>{ba(n)&&(Array.isArray(n)?n.forEach((t=>{r(e,t)})):"object"==typeof n?Object.entries(n).forEach((t=>{let[n,i]=t;r(`${e}[${n}]`,i)})):((e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)})(e,n))};return Object.entries(e).forEach((e=>{let[t,n]=e;r(t,n)})),t.length>0?`?${t.join("&")}`:""},Sa=async(e,t)=>"function"==typeof t?t(e):t,Ia=async(e,r)=>{const n=await Sa(r,e.TOKEN),i=await Sa(r,e.USERNAME),o=await Sa(r,e.PASSWORD),a=await Sa(r,e.HEADERS),s=Object.entries(t(t({Accept:"application/json"},a),r.headers)).filter((e=>{let[t,r]=e;return ba(r)})).reduce(((e,r)=>{let[n,i]=r;return t(t({},e),{},{[n]:String(i)})}),{});if(Aa(n)&&(s.Authorization=`Bearer ${n}`),Aa(i)&&Aa(o)){const e=(e=>{try{return btoa(e)}catch(t){return No.from(e).toString("base64")}})(`${i}:${o}`);s.Authorization=`Basic ${e}`}return r.body&&(r.mediaType?s["Content-Type"]=r.mediaType:Ea(r.body)?s["Content-Type"]=r.body.type||"application/octet-stream":_a(r.body)?s["Content-Type"]="text/plain":Ca(r.body)||(s["Content-Type"]="application/json")),new Headers(s)},Ta=(e,r)=>new Promise((async(n,i)=>{try{const i=((e,t)=>{const r=e.ENCODE_PATH||encodeURI,n=null==t?void 0:t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,n)=>{var i;return(null===(i=null==t?void 0:t.path)||void 0===i?void 0:i.hasOwnProperty(n))?r(String(t.path[n])):e})),i=`${e.BASE}${n}`;return t.query?`${i}${xa(t.query)}`:i})(e,r),o=(e=>{if(e.formData){const t=new FormData,r=(e,r)=>{_a(r)||Ea(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter((e=>{let[t,r]=e;return ba(r)})).forEach((e=>{let[t,n]=e;Array.isArray(n)?n.forEach((e=>r(t,e))):r(t,n)})),t}})(r),a=(e=>{var t;if(void 0!==e.body)return(null===(t=e.mediaType)||void 0===t?void 0:t.includes("/json"))?JSON.stringify(e.body):_a(e.body)||Ea(e.body)||Ca(e.body)?e.body:JSON.stringify(e.body)})(r),s=await Ia(e,r),u=await(async(e,t,r,n,i,o)=>{const a=new AbortController,s={headers:o,body:null!=n?n:i,method:t.method,signal:a.signal};return e.WITH_CREDENTIALS&&(s.credentials=e.CREDENTIALS),await fetch(r,s)})(e,r,i,a,o,s),c=await(async e=>{if(204!==e.status)try{const t=e.headers.get("Content-Type");if(t)return["application/json","application/problem+json"].some((e=>t.toLowerCase().startsWith(e)))?await e.json():await e.text()}catch(e){console.error(e)}})(u),l=((e,t)=>{if(t){const r=e.headers.get(t);if(_a(r))return r}})(u,r.responseHeader),d={url:i,ok:u.ok,status:u.status,statusText:u.statusText,headers:u.headers,body:null!=l?l:c};((e,r)=>{var n,i;const o=t({400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"},e.errors)[r.status];if(o)throw new ao(e,r,o);if(!r.ok){const t=null!==(n=r.status)&&void 0!==n?n:"unknown",o=null!==(i=r.statusText)&&void 0!==i?i:"unknown",a=(()=>{try{return JSON.stringify(r.body,null,2)}catch(e){return}})();throw new ao(e,r,`Generic Error: status: ${t}; status text: ${o}; body: ${a}`)}})(r,d),n(d)}catch(e){i(e)}})),Ma=new Y("idv"),Da=Symbol(),Ra=Symbol(),Oa="verify-id-sdk";function ka(e){return sessionStorage.getItem(e)}const Na=new Map;function Pa(e,t){const r=Na.get(e);Ma.events.emit(r,t)}function Ba(e){Pa(Da,e)}function Fa(e,t,r,n,i){Ba({type:"verification-result",status:t,step:e,state:n,callbackUrl:i,sessionId:r})}function La(e,t){Ba({type:"capture-error",errorCode:t,step:e})}function za(e,t,r){Ba({type:"api-request-error",errorCode:t,step:e,error:r})}function Ua(e,t){return Ta(so,e).catch((r=>(e.url.endsWith("/events")||za(t,"request-error",r.message),Promise.reject(r))))}async function ja(e){var t;so.HEADERS=vo(e);const r=await function(e){return Ua({keepalive:!0,method:"GET",url:`/verify/api/v1/sdk-settings?clientId=${e}`},"init")}(e);return{autocapture_settings:null!==(t=r.body.autocapture_settings)&&void 0!==t?t:void 0,autocapture_enabled:r.body.autocapture_enabled}}Na.set(Da,Da),Na.set(Ra,Ra);var Va={setStep(e,t){e.commit("setStep",t)},setSessionId(e,t){e.commit("setSessionId",t)},setIsCapturingProcessStarted(e,t){e.commit("setIsCapturingProcessStarted",t)},setServerPath(e,t){e.commit("setServerPath",t)},setStartToken(e,t){e.commit("setStartToken",t)},setRootElement(e,t){e.commit("setRootElement",t)},setLanguage(e,t){e.commit("setLanguage",t)},setCallback(e,t){e.commit("setCallback",t)},setUserToken(e,t){e.commit("setUserToken",t)},setConsentVersion(e,t){e.commit("setConsentVersion",t)},setMissingImages(e,t){e.commit("setMissingImages",t)},setClientId(e,t){e.commit("setClientId",t)},setStatus(e,t){e.commit("setStatus",t)},setMarkdownSupportText(e,t){e.commit("setMarkdownSupportText",t)},setVideoCaptureSettings(e,t){e.commit("setVideoCaptureSettings",t)},setCdnHost(e,t){e.commit("setCdnHost",t)},setIsImageSigningEnabled(e,t){e.commit("setIsImageSigningEnabled",t)},setAutoCaptureSettings(e,t){e.commit("setAutoCaptureSettings",t)}},Ha={setStep:(e,t)=>(e.step=t,e),setSessionId:(e,t)=>(e.sessionId=t,e),setIsCapturingProcessStarted:(e,t)=>(e.isCapturingProcessStarted=t,e),setServerPath:(e,t)=>(e.serverPath=t,e),setStartToken:(e,t)=>(e.startToken=t,e),setRootElement:(e,t)=>(e.rootElementId=t,e),setLanguage:(e,t)=>(e.language=t,e),setCallback:(e,t)=>(e.callback=t,e),setUserToken:(e,t)=>(e.userToken=t,e),setConsentVersion:(e,t)=>(e.consentVersion=t,e),setMissingImages:(e,t)=>(e.missingImages=t,e),setClientId:(e,t)=>(e.clientId=t,e),setStatus:(e,t)=>(e.verificationStatus=t,e),setMarkdownSupportText:(e,t)=>(e.markdownSupportText=t,e),setVideoCaptureSettings:(e,t)=>(e.videoCaptureSettings=t,e),setCdnHost:(e,t)=>(e.cdnHost=t,e),setIsImageSigningEnabled:(e,t)=>(e.isImageSigningEnabled=t,e),setAutoCaptureSettings:(e,t)=>(e.autoCaptureSettings=t,e)};const Ga=new class{constructor(e){this.actions={},this.mutations={},this.state={},this.status="resting",Object.prototype.hasOwnProperty.call(e,"actions")&&(this.actions=e.actions),Object.prototype.hasOwnProperty.call(e,"mutations")&&(this.mutations=e.mutations);const t=this;this.state=new Proxy(e.state||{},{get:function(e,t){return e[t]},set:function(e,r,n){return e[r]=n,Pa(Ra,{key:r,state:e}),"mutation"!==t.status&&console.warn(`You should use a mutation to set ${String(r)}`),t.status="resting",!0}})}dispatch(e,t){return"function"!=typeof this.actions[e]?(console.error(`Action "${e} doesn't exist.`),!1):(this.status="action",this.actions[e](this,t),!0)}commit(e,t){if("function"!=typeof this.mutations[e])return console.info(`Mutation "${e}" doesn't exist`),!1;this.status="mutation";const r=this.mutations[e](this.state,t);return this.state=r,!0}}({actions:Va,mutations:Ha,state:{step:"",sessionId:"",serverPath:"",startToken:"",rootElementId:"",language:"en",callback:()=>null,userToken:"",missingImages:[],consentVersion:"",clientId:"",verificationStatus:"pending",markdownSupportText:"",isImageSigningEnabled:!0,isCapturingProcessStarted:!1}});var qa;function Wa(e){const t=[],r=function(e){var t,r,n,i;const o=e.stats.get(qa.BLUR_DETECTION),a=e.stats.get(qa.GLARE_DETECTION);if(!o&&!a||0===(null==o?void 0:o.durations.length)&&0===(null==a?void 0:a.durations.length))return;const s=Ya(null!==(t=null==o?void 0:o.durations)&&void 0!==t?t:null==a?void 0:a.durations),u=o&&a?Math.min(o.countSuccess,a.countSuccess):null!==(r=null==o?void 0:o.countSuccess)&&void 0!==r?r:null==a?void 0:a.countSuccess;return{name:Xa(qa.BLUR_DETECTION),count_success:u,count_failure_glare:null!==(n=null==a?void 0:a.countFailed)&&void 0!==n?n:0,count_failure_blur:null!==(i=null==o?void 0:o.countFailed)&&void 0!==i?i:0,avg_duration:s.duration_avg,std_duration:s.duration_std}}(e);r&&t.push(r);for(const[r,n]of e.stats.entries())r!==qa.BLUR_DETECTION&&r!==qa.GLARE_DETECTION&&n.durations.length>0&&t.push(Ka(n,r));return e.frameHandleDurations.length>0&&t.push(function(e){const t=Ya(e.frameHandleDurations);return{name:"stability_manager",avg_stable_count:Math.round(e.stableCounts.reduce(((e,t)=>e+t),0)/e.stableCounts.length),avg_duration:t.duration_avg,std_duration:t.duration_std}}(e)),t}function Ka(e,t){const r=Ya(e.durations);return{name:Xa(t),count_success:e.countSuccess,count_failure:e.countFailed,avg_duration:r.duration_avg,std_duration:r.duration_std}}function Xa(e){switch(e){case qa.BLUR_DETECTION:case qa.GLARE_DETECTION:return"blur_glare_detector";case qa.DOCUMENT_DETECTION:return"doc_detector";case qa.DOCUMENT_POSITION:return"doc_frame_detector";case qa.BARCODE_DETECTION:return"barcode_detector";case qa.FACE_DETECTION:return"face_detector";case qa.FACE_POSITION:return"face_frame_detector";default:return e}}function Ya(e){var t;if(e.length<2)return{duration_avg:null!==(t=e[0])&&void 0!==t?t:0,duration_std:0};const r=e.length,n=e.reduce(((e,t)=>e+t),0)/r;let i=0;for(let t=0;t<r;t++){const r=e[t];i+=Math.pow(r-n,2)}const o=Math.sqrt(i/(r-1));return{duration_avg:Math.round(n),duration_std:Math.round(o)}}!function(e){e.DOCUMENT_DETECTION="document_detection",e.DOCUMENT_POSITION="document_position",e.GLARE_DETECTION="glare_detection",e.BLUR_DETECTION="blur_detection",e.BARCODE_DETECTION="barcode_detection",e.FACE_DETECTION="face_detection",e.FACE_POSITION="face_position"}(qa||(qa={}));const Za=new class{createUploadImageEvent(e,t,r,n){return{event_type:"upload_image",upload_image_req:{process_result:"success",image_type:e,request_total_time_ms:String(t),request_processing_time_ms:String(r),request_build_time_ms:String(n)}}}createPageViewEvent(e){return{event_type:"page_view",page_view_req:{page_name:e}}}createProcessingCompleteEvent(){return{event_type:"processing_complete",processing_complete_req:{status:"complete"}}}createSdkInitEvent(e,t){return{event_type:"sdk_init",sdk_init_req:{user_wait_time:Math.round(e),model_stats:this.convertModelStats(t)}}}convertModelStats(e){return e.map((e=>({model_name:e.modelName,init_duration:Math.round(e.initDuration),download_duration:Math.round(e.downloadDuration)})))}createUserActionEvent(e,t,r){var n,i,o;const a={user_action_type:e,page_name:t,autocapture:!!r,autocapture_enabled:null!==(o=null===(i=null===(n=Ga.state)||void 0===n?void 0:n.autoCaptureSettings)||void 0===i?void 0:i.enabled)&&void 0!==o&&o};if(r){const e=Wa(r);a.stats=e}return{event_type:"user_action",user_action_req:a}}createErrorEvent(e,t,r){return{event_type:"error",error_req:{error_name:t,error_description:e,step:r}}}createCameraNotAllowedEvent(e,t){return{event_type:"error",error_req:{error_name:"camera_not_allowed",error_description:e,step:t}}}createDrsInitFailureEvent(e,t){return{event_type:"error",error_req:{error_name:"missing_drs_action_token",error_description:e,step:t}}}};async function Ja(e,t,r,n,i){r?(so.HEADERS=vo(n,t),await function(e,t,r){return Ua({keepalive:!0,method:"POST",url:`/verify/api/v1/verification/${e}/events`,path:{sid:e},body:t},r)}(r,i,e)):console.error("cannot send event, sessionId or startToken is not set")}const $a=new class{handelEventData(e){if("session-id-acquired"===e.type)this.sendRiskSessionToken()}sendRiskSessionToken(){try{const e=`${so.BASE}/verify/api/v1/verification/${Ga.state.sessionId}/risk-session-token`,t=Ga.state.clientId,r=vo(t,Ga.state.userToken);no().then((t=>{Ma.http.httpPost(e,{session_token:t},null,r).catch((t=>{throw console.log("unable to send session token to IDV",e),console.error(t),t}))})).catch((t=>{var r,n,i,o;console.log("unable to get session token from DRS",e),console.error(t);const a=(null==t?void 0:t.message)||"failed to initialize DRS",s=Za.createDrsInitFailureEvent(a,"init");Ja(null===(r=Ga.state)||void 0===r?void 0:r.step,null===(n=Ga.state)||void 0===n?void 0:n.userToken,null===(i=Ga.state)||void 0===i?void 0:i.sessionId,null===(o=Ga.state)||void 0===o?void 0:o.clientId,s).then((()=>{Ba({type:"failed-to-init-drs",errorCode:"other",step:"init"})}))}))}catch(e){throw console.log("Error sending risk session token"),console.error(e),e}}};async function Qa(e,t,r){const n=Za.createErrorEvent(e,t,r);await es(r,n)}async function es(e,t){var r,n,i,o,a;const s=null===(r=Ga.state)||void 0===r?void 0:r.userToken,u=(null===(n=Ga.state)||void 0===n?void 0:n.sessionId)||(null===(i=Ga.state)||void 0===i?void 0:i.startToken),c=null===(o=Ga.state)||void 0===o?void 0:o.clientId,l=(null===(a=Ga.state)||void 0===a?void 0:a.step)||e;await Ja(l,s,u,c,t)}const ts=function(){var e,t;(null===(t=null===(e=Ga.state.autoCaptureSettings)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.debug)&&console.log(...arguments)};var rs;!function(e){e.DOCUMENT_DETECTOR="document_detector",e.BLUR_GLARE_CLASSIFIER="blur_glare_classifier",e.FACE_LANDMARK="face_landmark"}(rs||(rs={}));var ns,is,os=(ns=function(e,t){return ns=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},ns(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ns(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),as=function(e){function t(t,r){var n,i,o,a=this.constructor,s=e.call(this,t,r)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),n=s,i=a.prototype,(o=Object.setPrototypeOf)?o(n,i):n.__proto__=i,function(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}(s),s}return os(t,e),t}(Error),ss=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),us=function(e){function t(t){void 0===t&&(t=void 0);var r=e.call(this,t)||this;return r.message=t,r}return ss(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(as),cs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ls=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return cs(t,e),t.kind="ArgumentException",t}(us),ds=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ds(t,e),t.kind="IllegalArgumentException",t}(us),fs=function(){function e(e){if(this.binarizer=e,null===e)throw new hs("Binarizer must be non-null.")}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},e.prototype.getBlackMatrix=function(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,r,n,i){var o=this.binarizer.getLuminanceSource().crop(t,r,n,i);return new e(this.binarizer.createBinarizer(o))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(e){return""}},e}(),ps=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ps(t,e),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(us),ms=function(){function e(e){this.source=e}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),ys=function(){function e(){}return e.arraycopy=function(e,t,r,n,i){for(;i--;)r[n++]=e[t++]},e.currentTimeMillis=function(){return Date.now()},e}(),vs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ws=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vs(t,e),t.kind="IndexOutOfBoundsException",t}(us),bs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_s=function(e){function t(t,r){void 0===t&&(t=void 0),void 0===r&&(r=void 0);var n=e.call(this,r)||this;return n.index=t,n.message=r,n}return bs(t,e),t.kind="ArrayIndexOutOfBoundsException",t}(ws),As=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Es=function(){function e(){}return e.fill=function(e,t){for(var r=0,n=e.length;r<n;r++)e[r]=t},e.fillWithin=function(t,r,n,i){e.rangeCheck(t.length,r,n);for(var o=r;o<n;o++)t[o]=i},e.rangeCheck=function(e,t,r){if(t>r)throw new hs("fromIndex("+t+") > toIndex("+r+")");if(t<0)throw new _s(t);if(r>e)throw new _s(r)},e.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},e.create=function(e,t,r){return Array.from({length:e}).map((function(e){return Array.from({length:t}).fill(r)}))},e.createInt32Array=function(e,t,r){return Array.from({length:e}).map((function(e){return Int32Array.from({length:t}).fill(r)}))},e.equals=function(e,t){if(!e)return!1;if(!t)return!1;if(!e.length)return!1;if(!t.length)return!1;if(e.length!==t.length)return!1;for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0},e.hashCode=function(e){var t,r;if(null===e)return 0;var n=1;try{for(var i=As(e),o=i.next();!o.done;o=i.next()){n=31*n+o.value}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.fillUint8Array=function(e,t){for(var r=0;r!==e.length;r++)e[r]=t},e.copyOf=function(e,t){return e.slice(0,t)},e.copyOfUint8Array=function(e,t){if(e.length<=t){var r=new Uint8Array(t);return r.set(e),r}return e.slice(0,t)},e.copyOfRange=function(e,t,r){var n=r-t,i=new Int32Array(n);return ys.arraycopy(e,t,i,0,n),i},e.binarySearch=function(t,r,n){void 0===n&&(n=e.numberComparator);for(var i=0,o=t.length-1;i<=o;){var a=o+i>>1,s=n(r,t[a]);if(s>0)i=a+1;else{if(!(s<0))return a;o=a-1}}return-i-1},e.numberComparator=function(e,t){return e-t},e}(),Cs=function(){function e(){}return e.numberOfTrailingZeros=function(e){var t;if(0===e)return 32;var r=31;return 0!==(t=e<<16)&&(r-=16,e=t),0!==(t=e<<8)&&(r-=8,e=t),0!==(t=e<<4)&&(r-=4,e=t),0!==(t=e<<2)&&(r-=2,e=t),r-(e<<1>>>31)},e.numberOfLeadingZeros=function(e){if(0===e)return 32;var t=1;return e>>>16==0&&(t+=16,e<<=16),e>>>24==0&&(t+=8,e<<=8),e>>>28==0&&(t+=4,e<<=4),e>>>30==0&&(t+=2,e<<=2),t-=e>>>31},e.toHexString=function(e){return e.toString(16)},e.toBinaryString=function(e){return String(parseInt(String(e),2))},e.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},e.truncDivision=function(e,t){return Math.trunc(e/t)},e.parseInt=function(e,t){return void 0===t&&(t=void 0),parseInt(e,t)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),xs=function(){function e(t,r){void 0===t?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=null==r?e.makeArray(t):r)}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var r=e.makeArray(t);ys.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},e.prototype.get=function(e){return 0!=(this.bits[Math.floor(e/32)]&1<<(31&e))},e.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},e.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},e.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var r=this.bits,n=Math.floor(e/32),i=r[n];i&=~((1<<(31&e))-1);for(var o=r.length;0===i;){if(++n===o)return t;i=r[n]}var a=32*n+Cs.numberOfTrailingZeros(i);return a>t?t:a},e.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var r=this.bits,n=Math.floor(e/32),i=~r[n];i&=~((1<<(31&e))-1);for(var o=r.length;0===i;){if(++n===o)return t;i=~r[n]}var a=32*n+Cs.numberOfTrailingZeros(i);return a>t?t:a},e.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},e.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new hs;if(t!==e){t--;for(var r=Math.floor(e/32),n=Math.floor(t/32),i=this.bits,o=r;o<=n;o++){var a=(2<<(o<n?31:31&t))-(1<<(o>r?0:31&e));i[o]|=a}}},e.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,r=0;r<e;r++)t[r]=0},e.prototype.isRange=function(e,t,r){if(t<e||e<0||t>this.size)throw new hs;if(t===e)return!0;t--;for(var n=Math.floor(e/32),i=Math.floor(t/32),o=this.bits,a=n;a<=i;a++){var s=(2<<(a<i?31:31&t))-(1<<(a>n?0:31&e))&4294967295;if((o[a]&s)!==(r?s:0))return!1}return!0},e.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},e.prototype.appendBits=function(e,t){if(t<0||t>32)throw new hs("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var r=t;r>0;r--)this.appendBit(1==(e>>r-1&1))},e.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var r=0;r<t;r++)this.appendBit(e.get(r))},e.prototype.xor=function(e){if(this.size!==e.size)throw new hs("Sizes don't match");for(var t=this.bits,r=0,n=t.length;r<n;r++)t[r]^=e.bits[r]},e.prototype.toBytes=function(e,t,r,n){for(var i=0;i<n;i++){for(var o=0,a=0;a<8;a++)this.get(e)&&(o|=1<<7-a),e++;t[r+i]=o}},e.prototype.getBitArray=function(){return this.bits},e.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),r=t+1,n=this.bits,i=0;i<r;i++){var o=n[i];o=(o=(o=(o=(o=o>>1&1431655765|(1431655765&o)<<1)>>2&858993459|(858993459&o)<<2)>>4&252645135|(252645135&o)<<4)>>8&16711935|(16711935&o)<<8)>>16&65535|(65535&o)<<16,e[t-i]=o}if(this.size!==32*r){var a=32*r-this.size,s=e[0]>>>a;for(i=1;i<r;i++){var u=e[i];s|=u<<32-a,e[i-1]=s,s=u>>>a}e[r-1]=s}this.bits=e},e.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.size===r.size&&Es.equals(this.bits,r.bits)},e.prototype.hashCode=function(){return 31*this.size+Es.hashCode(this.bits)},e.prototype.toString=function(){for(var e="",t=0,r=this.size;t<r;t++)0==(7&t)&&(e+=" "),e+=this.get(t)?"X":".";return e},e.prototype.clone=function(){return new e(this.size,this.bits.slice())},e.prototype.toArray=function(){for(var e=[],t=0,r=this.size;t<r;t++)e.push(this.get(t));return e},e}();!function(e){e[e.OTHER=0]="OTHER",e[e.PURE_BARCODE=1]="PURE_BARCODE",e[e.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",e[e.TRY_HARDER=3]="TRY_HARDER",e[e.CHARACTER_SET=4]="CHARACTER_SET",e[e.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",e[e.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",e[e.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",e[e.ASSUME_GS1=8]="ASSUME_GS1",e[e.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",e[e.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",e[e.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS"}(is||(is={}));var Ss,Is=is,Ts=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ms=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ts(t,e),t.getFormatInstance=function(){return new t},t.kind="FormatException",t}(us),Ds=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){e[e.Cp437=0]="Cp437",e[e.ISO8859_1=1]="ISO8859_1",e[e.ISO8859_2=2]="ISO8859_2",e[e.ISO8859_3=3]="ISO8859_3",e[e.ISO8859_4=4]="ISO8859_4",e[e.ISO8859_5=5]="ISO8859_5",e[e.ISO8859_6=6]="ISO8859_6",e[e.ISO8859_7=7]="ISO8859_7",e[e.ISO8859_8=8]="ISO8859_8",e[e.ISO8859_9=9]="ISO8859_9",e[e.ISO8859_10=10]="ISO8859_10",e[e.ISO8859_11=11]="ISO8859_11",e[e.ISO8859_13=12]="ISO8859_13",e[e.ISO8859_14=13]="ISO8859_14",e[e.ISO8859_15=14]="ISO8859_15",e[e.ISO8859_16=15]="ISO8859_16",e[e.SJIS=16]="SJIS",e[e.Cp1250=17]="Cp1250",e[e.Cp1251=18]="Cp1251",e[e.Cp1252=19]="Cp1252",e[e.Cp1256=20]="Cp1256",e[e.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",e[e.UTF8=22]="UTF8",e[e.ASCII=23]="ASCII",e[e.Big5=24]="Big5",e[e.GB18030=25]="GB18030",e[e.EUC_KR=26]="EUC_KR"}(Ss||(Ss={}));var Rs,Os=function(){function e(t,r,n){for(var i,o,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=t,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,e.VALUE_IDENTIFIER_TO_ECI.set(t,this),e.NAME_TO_ECI.set(n,this);for(var u=this.values,c=0,l=u.length;c!==l;c++){var d=u[c];e.VALUES_TO_ECI.set(d,this)}try{for(var h=Ds(a),f=h.next();!f.done;f=h.next()){var p=f.value;e.NAME_TO_ECI.set(p,this)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}return e.prototype.getValueIdentifier=function(){return this.valueIdentifier},e.prototype.getName=function(){return this.name},e.prototype.getValue=function(){return this.values[0]},e.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new Ms("incorect value");var r=e.VALUES_TO_ECI.get(t);if(void 0===r)throw new Ms("incorect value");return r},e.getCharacterSetECIByName=function(t){var r=e.NAME_TO_ECI.get(t);if(void 0===r)throw new Ms("incorect value");return r},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.getName()===r.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(Ss.Cp437,Int32Array.from([0,2]),"Cp437"),e.ISO8859_1=new e(Ss.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),e.ISO8859_2=new e(Ss.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),e.ISO8859_3=new e(Ss.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),e.ISO8859_4=new e(Ss.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),e.ISO8859_5=new e(Ss.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),e.ISO8859_6=new e(Ss.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),e.ISO8859_7=new e(Ss.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),e.ISO8859_8=new e(Ss.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),e.ISO8859_9=new e(Ss.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),e.ISO8859_10=new e(Ss.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),e.ISO8859_11=new e(Ss.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),e.ISO8859_13=new e(Ss.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),e.ISO8859_14=new e(Ss.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),e.ISO8859_15=new e(Ss.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),e.ISO8859_16=new e(Ss.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),e.SJIS=new e(Ss.SJIS,20,"SJIS","Shift_JIS"),e.Cp1250=new e(Ss.Cp1250,21,"Cp1250","windows-1250"),e.Cp1251=new e(Ss.Cp1251,22,"Cp1251","windows-1251"),e.Cp1252=new e(Ss.Cp1252,23,"Cp1252","windows-1252"),e.Cp1256=new e(Ss.Cp1256,24,"Cp1256","windows-1256"),e.UnicodeBigUnmarked=new e(Ss.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),e.UTF8=new e(Ss.UTF8,26,"UTF8","UTF-8"),e.ASCII=new e(Ss.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),e.Big5=new e(Ss.Big5,28,"Big5"),e.GB18030=new e(Ss.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),e.EUC_KR=new e(Ss.EUC_KR,30,"EUC_KR","EUC-KR"),e}(),ks=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ns=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ks(t,e),t.kind="UnsupportedOperationException",t}(us),Ps=function(){function e(){}return e.decode=function(e,t){var r=this.encodingName(t);return this.customDecoder?this.customDecoder(e,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&"ISO-8859-1"===t},e.encode=function(e,t){var r=this.encodingName(t);return this.customEncoder?this.customEncoder(e,r):"undefined"==typeof TextEncoder?this.encodeFallback(e):(new TextEncoder).encode(e)},e.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},e.encodingName=function(e){return"string"==typeof e?e:e.getName()},e.encodingCharacterSet=function(e){return e instanceof Os?e:Os.getCharacterSetECIByName(e)},e.decodeFallback=function(t,r){var n=this.encodingCharacterSet(r);if(e.isDecodeFallbackSupported(n)){for(var i="",o=0,a=t.length;o<a;o++){var s=t[o].toString(16);s.length<2&&(s="0"+s),i+="%"+s}return decodeURIComponent(i)}if(n.equals(Os.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new Ns("Encoding "+this.encodingName(r)+" not supported by fallback.")},e.isDecodeFallbackSupported=function(e){return e.equals(Os.UTF8)||e.equals(Os.ISO8859_1)||e.equals(Os.ASCII)},e.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))).split(""),r=[],n=0;n<t.length;n++)r.push(t[n].charCodeAt(0));return new Uint8Array(r)},e}(),Bs=function(){function e(){}return e.castAsNonUtf8Char=function(e,t){void 0===t&&(t=null);var r=t?t.getName():this.ISO88591;return Ps.decode(new Uint8Array([e]),r)},e.guessEncoding=function(t,r){if(null!=r&&void 0!==r.get(Is.CHARACTER_SET))return r.get(Is.CHARACTER_SET).toString();for(var n=t.length,i=!0,o=!0,a=!0,s=0,u=0,c=0,l=0,d=0,h=0,f=0,p=0,g=0,m=0,y=0,v=t.length>3&&239===t[0]&&187===t[1]&&191===t[2],w=0;w<n&&(i||o||a);w++){var b=255&t[w];a&&(s>0?0==(128&b)?a=!1:s--:0!=(128&b)&&(0==(64&b)?a=!1:(s++,0==(32&b)?u++:(s++,0==(16&b)?c++:(s++,0==(8&b)?l++:a=!1))))),i&&(b>127&&b<160?i=!1:b>159&&(b<192||215===b||247===b)&&y++),o&&(d>0?b<64||127===b||b>252?o=!1:d--:128===b||160===b||b>239?o=!1:b>160&&b<224?(h++,p=0,++f>g&&(g=f)):b>127?(d++,f=0,++p>m&&(m=p)):(f=0,p=0))}return a&&s>0&&(a=!1),o&&d>0&&(o=!1),a&&(v||u+c+l>0)?e.UTF8:o&&(e.ASSUME_SHIFT_JIS||g>=3||m>=3)?e.SHIFT_JIS:i&&o?2===g&&2===h||10*y>=n?e.SHIFT_JIS:e.ISO88591:i?e.ISO88591:o?e.SHIFT_JIS:a?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=-1;function i(e,r,i,o,a,s){if("%%"===e)return"%";if(void 0!==t[++n]){e=o?parseInt(o.substr(1)):void 0;var u,c=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=t[n];break;case"c":u=t[n][0];break;case"f":u=parseFloat(t[n]).toFixed(e);break;case"p":u=parseFloat(t[n]).toPrecision(e);break;case"e":u=parseFloat(t[n]).toExponential(e);break;case"x":u=parseInt(t[n]).toString(c||16);break;case"d":u=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(c);for(var l=parseInt(i),d=i&&i[0]+""=="0"?"0":" ";u.length<l;)u=void 0!==r?u+d:d+u;return u}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(o,i)},e.getBytes=function(e,t){return Ps.encode(e,t)},e.getCharCode=function(e,t){return void 0===t&&(t=0),e.charCodeAt(t)},e.getCharAt=function(e){return String.fromCharCode(e)},e.SHIFT_JIS=Os.SJIS.getName(),e.GB2312="GB2312",e.ISO88591=Os.ISO8859_1.getName(),e.EUC_JP="EUC_JP",e.UTF8=Os.UTF8.getName(),e.PLATFORM_DEFAULT_ENCODING=e.UTF8,e.ASSUME_SHIFT_JIS=!1,e}(),Fs=function(){function e(e){void 0===e&&(e=""),this.value=e}return e.prototype.enableDecoding=function(e){return this.encoding=e,this},e.prototype.append=function(e){return"string"==typeof e?this.value+=e.toString():this.encoding?this.value+=Bs.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},e.prototype.appendChars=function(e,t,r){for(var n=t;t<t+r;n++)this.append(e[n]);return this},e.prototype.length=function(){return this.value.length},e.prototype.charAt=function(e){return this.value.charAt(e)},e.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},e.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},e.prototype.substring=function(e,t){return this.value.substring(e,t)},e.prototype.setLengthToZero=function(){this.value=""},e.prototype.toString=function(){return this.value},e.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},e}(),Ls=function(){function e(e,t,r,n){if(this.width=e,this.height=t,this.rowSize=r,this.bits=n,null==t&&(t=e),this.height=t,e<1||t<1)throw new hs("Both dimensions must be greater than 0");null==r&&(r=Math.floor((e+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return e.parseFromBooleanArray=function(t){for(var r=t.length,n=t[0].length,i=new e(n,r),o=0;o<r;o++)for(var a=t[o],s=0;s<n;s++)a[s]&&i.set(s,o);return i},e.parseFromString=function(t,r,n){if(null===t)throw new hs("stringRepresentation cannot be null");for(var i=new Array(t.length),o=0,a=0,s=-1,u=0,c=0;c<t.length;)if("\n"===t.charAt(c)||"\r"===t.charAt(c)){if(o>a){if(-1===s)s=o-a;else if(o-a!==s)throw new hs("row lengths do not match");a=o,u++}c++}else if(t.substring(c,c+r.length)===r)c+=r.length,i[o]=!0,o++;else{if(t.substring(c,c+n.length)!==n)throw new hs("illegal character encountered: "+t.substring(c));c+=n.length,i[o]=!1,o++}if(o>a){if(-1===s)s=o-a;else if(o-a!==s)throw new hs("row lengths do not match");u++}for(var l=new e(s,u),d=0;d<o;d++)i[d]&&l.set(Math.floor(d%s),Math.floor(d/s));return l},e.prototype.get=function(e,t){var r=t*this.rowSize+Math.floor(e/32);return 0!=(this.bits[r]>>>(31&e)&1)},e.prototype.set=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]|=1<<(31&e)&4294967295},e.prototype.unset=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]&=~(1<<(31&e)&4294967295)},e.prototype.flip=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]^=1<<(31&e)&4294967295},e.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new hs("input matrix dimensions do not match");for(var t=new xs(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,i=0,o=this.height;i<o;i++)for(var a=i*r,s=e.getRow(i,t).getBitArray(),u=0;u<r;u++)n[a+u]^=s[u]},e.prototype.clear=function(){for(var e=this.bits,t=e.length,r=0;r<t;r++)e[r]=0},e.prototype.setRegion=function(e,t,r,n){if(t<0||e<0)throw new hs("Left and top must be nonnegative");if(n<1||r<1)throw new hs("Height and width must be at least 1");var i=e+r,o=t+n;if(o>this.height||i>this.width)throw new hs("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,u=t;u<o;u++)for(var c=u*a,l=e;l<i;l++)s[c+Math.floor(l/32)]|=1<<(31&l)&4294967295},e.prototype.getRow=function(e,t){null==t||t.getSize()<this.width?t=new xs(this.width):t.clear();for(var r=this.rowSize,n=this.bits,i=e*r,o=0;o<r;o++)t.setBulk(32*o,n[i+o]);return t},e.prototype.setRow=function(e,t){ys.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},e.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),r=new xs(e),n=new xs(e),i=0,o=Math.floor((t+1)/2);i<o;i++)r=this.getRow(i,r),n=this.getRow(t-1-i,n),r.reverse(),n.reverse(),this.setRow(i,n),this.setRow(t-1-i,r)},e.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,r=this.rowSize,n=this.bits,i=e,o=t,a=-1,s=-1,u=0;u<t;u++)for(var c=0;c<r;c++){var l=n[u*r+c];if(0!==l){if(u<o&&(o=u),u>s&&(s=u),32*c<i){for(var d=0;0==(l<<31-d&4294967295);)d++;32*c+d<i&&(i=32*c+d)}if(32*c+31>a){for(d=31;l>>>d==0;)d--;32*c+d>a&&(a=32*c+d)}}}return a<i||s<o?null:Int32Array.from([i,o,a-i+1,s-o+1])},e.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,r=0;r<t.length&&0===t[r];)r++;if(r===t.length)return null;for(var n=r/e,i=r%e*32,o=t[r],a=0;0==(o<<31-a&4294967295);)a++;return i+=a,Int32Array.from([i,n])},e.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,r=t.length-1;r>=0&&0===t[r];)r--;if(r<0)return null;for(var n=Math.floor(r/e),i=32*Math.floor(r%e),o=t[r],a=31;o>>>a==0;)a--;return i+=a,Int32Array.from([i,n])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&Es.equals(this.bits,r.bits)},e.prototype.hashCode=function(){var e=this.width;return e=31*(e=31*(e=31*(e=31*e+this.width)+this.height)+this.rowSize)+Es.hashCode(this.bits)},e.prototype.toString=function(e,t,r){return void 0===e&&(e="X "),void 0===t&&(t=" "),void 0===r&&(r="\n"),this.buildToString(e,t,r)},e.prototype.buildToString=function(e,t,r){for(var n=new Fs,i=0,o=this.height;i<o;i++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,i)?e:t);n.append(r)}return n.toString()},e.prototype.clone=function(){return new e(this.width,this.height,this.rowSize,this.bits.slice())},e}(),zs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Us=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zs(t,e),t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}(us),js=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vs=function(e){function t(r){var n=e.call(this,r)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return js(t,e),t.prototype.getBlackRow=function(e,r){var n=this.getLuminanceSource(),i=n.getWidth();null==r||r.getSize()<i?r=new xs(i):r.clear(),this.initArrays(i);for(var o=n.getRow(e,this.luminances),a=this.buckets,s=0;s<i;s++)a[(255&o[s])>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(a);if(i<3)for(s=0;s<i;s++)(255&o[s])<u&&r.set(s);else{var c=255&o[0],l=255&o[1];for(s=1;s<i-1;s++){var d=255&o[s+1];(4*l-c-d)/2<u&&r.set(s),c=l,l=d}}return r},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),r=e.getWidth(),n=e.getHeight(),i=new Ls(r,n);this.initArrays(r);for(var o=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=e.getRow(s,this.luminances),c=Math.floor(4*r/5),l=Math.floor(r/5);l<c;l++){o[(255&u[l])>>t.LUMINANCE_SHIFT]++}var d=t.estimateBlackPoint(o),h=e.getMatrix();for(a=0;a<n;a++){var f=a*r;for(l=0;l<r;l++){(255&h[f+l])<d&&i.set(l,a)}}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var r=this.buckets,n=0;n<t.LUMINANCE_BUCKETS;n++)r[n]=0},t.estimateBlackPoint=function(e){for(var r=e.length,n=0,i=0,o=0,a=0;a<r;a++)e[a]>o&&(i=a,o=e[a]),e[a]>n&&(n=e[a]);var s=0,u=0;for(a=0;a<r;a++){var c=a-i;(f=e[a]*c*c)>u&&(s=a,u=f)}if(i>s){var l=i;i=s,s=l}if(s-i<=r/16)throw new Us;var d=s-1,h=-1;for(a=s-1;a>i;a--){var f,p=a-i;(f=p*p*(s-a)*(n-e[a]))>h&&(d=a,h=f)}return d<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(ms),Hs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gs=function(e){function t(t){var r=e.call(this,t)||this;return r.matrix=null,r}return Hs(t,e),t.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),i=r.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var o=r.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;0!=(n&t.BLOCK_SIZE_MASK)&&a++;var s=i>>t.BLOCK_SIZE_POWER;0!=(i&t.BLOCK_SIZE_MASK)&&s++;var u=t.calculateBlackPoints(o,a,s,n,i),c=new Ls(n,i);t.calculateThresholdForBlock(o,a,s,n,i,u,c),this.matrix=c}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,r,n,i,o,a,s){for(var u=o-t.BLOCK_SIZE,c=i-t.BLOCK_SIZE,l=0;l<n;l++){var d=l<<t.BLOCK_SIZE_POWER;d>u&&(d=u);for(var h=t.cap(l,2,n-3),f=0;f<r;f++){var p=f<<t.BLOCK_SIZE_POWER;p>c&&(p=c);for(var g=t.cap(f,2,r-3),m=0,y=-2;y<=2;y++){var v=a[h+y];m+=v[g-2]+v[g-1]+v[g]+v[g+1]+v[g+2]}var w=m/25;t.thresholdBlock(e,p,d,w,i,s)}}},t.cap=function(e,t,r){return e<t?t:e>r?r:e},t.thresholdBlock=function(e,r,n,i,o,a){for(var s=0,u=n*o+r;s<t.BLOCK_SIZE;s++,u+=o)for(var c=0;c<t.BLOCK_SIZE;c++)(255&e[u+c])<=i&&a.set(r+c,n+s)},t.calculateBlackPoints=function(e,r,n,i,o){for(var a=o-t.BLOCK_SIZE,s=i-t.BLOCK_SIZE,u=new Array(n),c=0;c<n;c++){u[c]=new Int32Array(r);var l=c<<t.BLOCK_SIZE_POWER;l>a&&(l=a);for(var d=0;d<r;d++){var h=d<<t.BLOCK_SIZE_POWER;h>s&&(h=s);for(var f=0,p=255,g=0,m=0,y=l*i+h;m<t.BLOCK_SIZE;m++,y+=i){for(var v=0;v<t.BLOCK_SIZE;v++){var w=255&e[y+v];f+=w,w<p&&(p=w),w>g&&(g=w)}if(g-p>t.MIN_DYNAMIC_RANGE)for(m++,y+=i;m<t.BLOCK_SIZE;m++,y+=i)for(v=0;v<t.BLOCK_SIZE;v++)f+=255&e[y+v]}var b=f>>2*t.BLOCK_SIZE_POWER;if(g-p<=t.MIN_DYNAMIC_RANGE&&(b=p/2,c>0&&d>0)){var _=(u[c-1][d]+2*u[c][d-1]+u[c-1][d-1])/4;p<_&&(b=_)}u[c][d]=b}}return u},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=5*t.BLOCK_SIZE,t.MIN_DYNAMIC_RANGE=24,t}(Vs),qs=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.isCropSupported=function(){return!1},e.prototype.crop=function(e,t,r,n){throw new Ns("This luminance source does not support cropping.")},e.prototype.isRotateSupported=function(){return!1},e.prototype.rotateCounterClockwise=function(){throw new Ns("This luminance source does not support rotation by 90 degrees.")},e.prototype.rotateCounterClockwise45=function(){throw new Ns("This luminance source does not support rotation by 45 degrees.")},e.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new Fs,r=0;r<this.height;r++){for(var n=this.getRow(r,e),i=0;i<this.width;i++){var o=255&n[i],a=void 0;a=o<64?"#":o<128?"+":o<192?".":" ",t.append(a)}t.append("\n")}return t.toString()},e}(),Ws=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ks=function(e){function t(t){var r=e.call(this,t.getWidth(),t.getHeight())||this;return r.delegate=t,r}return Ws(t,e),t.prototype.getRow=function(e,t){for(var r=this.delegate.getRow(e,t),n=this.getWidth(),i=0;i<n;i++)r[i]=255-(255&r[i]);return r},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(t),n=0;n<t;n++)r[n]=255-(255&e[n]);return r},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,r,n,i){return new t(this.delegate.crop(e,r,n,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(qs),Xs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ys=function(e){function t(r,n){void 0===n&&(n=!1);var i=e.call(this,r.width,r.height)||this;return i.canvas=r,i.tempCanvasElement=null,i.buffer=t.makeBufferFromCanvasImageData(r,n),i}return Xs(t,e),t.makeBufferFromCanvasImageData=function(e,r){void 0===r&&(r=!1);var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height,r)},t.toGrayscaleBuffer=function(e,r,n,i){void 0===i&&(i=!1);var o=new Uint8ClampedArray(r*n);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX||!i)for(var a=0,s=0,u=e.length;a<u;a+=4,s++){var c=void 0;if(0===e[a+3])c=255;else c=306*e[a]+601*e[a+1]+117*e[a+2]+512>>10;o[s]=c}else{a=0,s=0;for(var l=e.length;a<l;a+=4,s++){c=void 0;if(0===e[a+3])c=255;else c=306*e[a]+601*e[a+1]+117*e[a+2]+512>>10;o[s]=255-c}}return o},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new hs("Requested row is outside the image: "+e);var r=this.getWidth(),n=e*r;return null===t?t=this.buffer.slice(n,n+r):(t.length<r&&(t=new Uint8ClampedArray(r)),t.set(this.buffer.slice(n,n+r))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,r,n,i){return e.prototype.crop.call(this,t,r,n,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var r=this.getTempCanvasElement(),n=r.getContext("2d"),i=e*t.DEGREE_TO_RADIANS,o=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(i))*o+Math.abs(Math.sin(i))*a),u=Math.ceil(Math.abs(Math.sin(i))*o+Math.abs(Math.cos(i))*a);return r.width=s,r.height=u,n.translate(s/2,u/2),n.rotate(i),n.drawImage(this.canvas,o/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(r),this},t.prototype.invert=function(){return new Ks(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(qs),Zs=function(){function e(e,t,r){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=r||void 0}return e.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},e}(),Js=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},$s=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Qs=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},eu=function(){function e(e,t,r){void 0===t&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return Js(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l,d;return $s(this,(function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),t=[];try{for(r=Qs(e),n=r.next();!n.done;n=r.next())i=n.value,"videoinput"===(o="video"===i.kind?"videoinput":i.kind)&&(a=i.deviceId||i.id,s=i.label||"Video device "+(t.length+1),u=i.groupId,c={deviceId:a,label:s,kind:o,groupId:u},t.push(c))}catch(e){l={error:e}}finally{try{n&&!n.done&&(d=r.return)&&d.call(r)}finally{if(l)throw l.error}}return[2,t]}}))}))},e.prototype.getVideoInputDevices=function(){return Js(this,void 0,void 0,(function(){return $s(this,(function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map((function(e){return new Zs(e.deviceId,e.label)}))]}}))}))},e.prototype.findDeviceById=function(e){return Js(this,void 0,void 0,(function(){var t;return $s(this,(function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(t=r.sent())?[2,t.find((function(t){return t.deviceId===e}))]:[2,null]}}))}))},e.prototype.decodeFromInputVideoDevice=function(e,t){return Js(this,void 0,void 0,(function(){return $s(this,(function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,r.sent()]}}))}))},e.prototype.decodeOnceFromVideoDevice=function(e,t){return Js(this,void 0,void 0,(function(){var r;return $s(this,(function(n){switch(n.label){case 0:return this.reset(),r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromConstraints=function(e,t){return Js(this,void 0,void 0,(function(){var r;return $s(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,t)];case 2:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromStream=function(e,t){return Js(this,void 0,void 0,(function(){var r;return $s(this,(function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}}))}))},e.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,r){return Js(this,void 0,void 0,(function(){return $s(this,(function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(e,t,r)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeFromVideoDevice=function(e,t,r){return Js(this,void 0,void 0,(function(){var n;return $s(this,(function(i){switch(i.label){case 0:return n={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,t,r)];case 1:return[2,i.sent()]}}))}))},e.prototype.decodeFromConstraints=function(e,t,r){return Js(this,void 0,void 0,(function(){var n;return $s(this,(function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeFromStream(n,t,r)];case 2:return[2,i.sent()]}}))}))},e.prototype.decodeFromStream=function(e,t,r){return Js(this,void 0,void 0,(function(){var n;return $s(this,(function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=i.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,i.sent()]}}))}))},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(e,t){return Js(this,void 0,void 0,(function(){var r;return $s(this,(function(n){switch(n.label){case 0:return r=this.prepareVideoElement(t),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}}))}))},e.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise((function(r,n){return t.playVideoOnLoad(e,(function(){return r()}))}))},e.prototype.playVideoOnLoad=function(e,t){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)},e.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},e.prototype.tryPlayVideo=function(e){return Js(this,void 0,void 0,(function(){return $s(this,(function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}}))}))},e.prototype.getMediaElement=function(e,t){var r=document.getElementById(e);if(!r)throw new ls("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==t.toLowerCase())throw new ls("element with id '"+e+"' must be an "+t+" element");return r},e.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new ls("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},e.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new ls("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},e.prototype.decodeFromVideoContinuously=function(e,t,r){if(void 0===e&&void 0===t)throw new ls("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,r):this.decodeFromVideoElementContinuously(e,r)},e.prototype.decodeFromImageElement=function(e){if(!e)throw new ls("An image element must be provided.");this.reset();var t=this.prepareImageElement(e);return this.imageElement=t,this.isImageLoaded(t)?this.decodeOnce(t,!1,!0):this._decodeOnLoadImage(t)},e.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},e.prototype.decodeFromVideoElementContinuously=function(e,t){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,t)},e.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new ls("A video element must be provided.");this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},e.prototype.decodeFromImageUrl=function(e){if(!e)throw new ls("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var r=this._decodeOnLoadImage(t);return t.src=e,r},e.prototype.decodeFromVideoUrl=function(e){if(!e)throw new ls("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),r=this.decodeFromVideoElement(t);return t.src=e,r},e.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new ls("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,t);return r.src=e,n},e.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise((function(r,n){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(r,n)},e.addEventListener("load",t.imageLoadedListener)}))},e.prototype._decodeOnLoadVideo=function(e){return Js(this,void 0,void 0,(function(){return $s(this,(function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}}))}))},e.prototype._decodeOnLoadVideoContinuously=function(e,t){return Js(this,void 0,void 0,(function(){return $s(this,(function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,t),[2]}}))}))},e.prototype.isImageLoaded=function(e){return!!e.complete&&0!==e.naturalWidth},e.prototype.prepareImageElement=function(e){var t;return void 0===e&&((t=document.createElement("img")).width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},e.prototype.prepareVideoElement=function(e){var t;return e||"undefined"==typeof document||((t=document.createElement("video")).width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},e.prototype.decodeOnce=function(e,t,r){var n=this;void 0===t&&(t=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var i=function i(o,a){if(n._stopAsyncDecode)return a(new Us("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{o(n.decode(e))}catch(e){if(t&&e instanceof Us||(e instanceof gs||e instanceof Ms)&&r)return setTimeout(i,n._timeBetweenDecodingAttempts,o,a);a(e)}};return new Promise((function(e,t){return i(e,t)}))},e.prototype.decodeContinuously=function(e,t){var r=this;this._stopContinuousDecode=!1;!function n(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(e);t(i,null),setTimeout(n,r.timeBetweenScansMillis)}catch(e){t(null,e),(e instanceof gs||e instanceof Ms||e instanceof Us)&&setTimeout(n,r._timeBetweenDecodingAttempts)}}()},e.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},e.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var t=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),t=!0):this.drawImageOnCanvas(e);var r=this.getCaptureCanvas(e),n=new Ys(r,t),i=new Gs(n);return new fs(i)},e.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),r=void 0;try{r=t.getContext("2d",{willReadFrequently:!0})}catch(e){r=t.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},e.prototype.drawFrameOnCanvas=function(e,t,r){void 0===t&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.drawImageOnCanvas=function(e,t,r){void 0===t&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},e.prototype.createCaptureCanvas=function(e){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var t,r,n=document.createElement("canvas");return void 0!==e&&(e instanceof HTMLVideoElement?(t=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(t=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),n.style.width=t+"px",n.style.height=r+"px",n.width=t,n.height=r,n},e.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach((function(e){return e.stop()})),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch(r){e.src=URL.createObjectURL(t)}},e.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch(t){e.src=""}this.videoElement.removeAttribute("src")},e}(),tu=function(){function e(e,t,r,n,i,o){void 0===r&&(r=null==t?0:8*t.length),void 0===o&&(o=ys.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=r,this.resultPoints=n,this.format=i,this.timestamp=o,this.text=e,this.rawBytes=t,this.numBits=null==r?null==t?0:8*t.length:r,this.resultPoints=n,this.format=i,this.resultMetadata=null,this.timestamp=null==o?ys.currentTimeMillis():o}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(e,t){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},e.prototype.putAllMetadata=function(e){null!==e&&(null===this.resultMetadata?this.resultMetadata=e:this.resultMetadata=new Map(e))},e.prototype.addResultPoints=function(e){var t=this.resultPoints;if(null===t)this.resultPoints=e;else if(null!==e&&e.length>0){var r=new Array(t.length+e.length);ys.arraycopy(t,0,r,0,t.length),ys.arraycopy(e,0,r,t.length,e.length),this.resultPoints=r}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}();!function(e){e[e.AZTEC=0]="AZTEC",e[e.CODABAR=1]="CODABAR",e[e.CODE_39=2]="CODE_39",e[e.CODE_93=3]="CODE_93",e[e.CODE_128=4]="CODE_128",e[e.DATA_MATRIX=5]="DATA_MATRIX",e[e.EAN_8=6]="EAN_8",e[e.EAN_13=7]="EAN_13",e[e.ITF=8]="ITF",e[e.MAXICODE=9]="MAXICODE",e[e.PDF_417=10]="PDF_417",e[e.QR_CODE=11]="QR_CODE",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Rs||(Rs={}));var ru,nu=Rs;!function(e){e[e.OTHER=0]="OTHER",e[e.ORIENTATION=1]="ORIENTATION",e[e.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",e[e.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",e[e.ISSUE_NUMBER=4]="ISSUE_NUMBER",e[e.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",e[e.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",e[e.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",e[e.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",e[e.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",e[e.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(ru||(ru={}));var iu,ou=ru,au=function(){function e(e,t,r,n,i,o){void 0===i&&(i=-1),void 0===o&&(o=-1),this.rawBytes=e,this.text=t,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=o,this.numBits=null==e?0:8*e.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(e){this.numBits=e},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(e){this.erasures=e},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(e){this.other=e},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),su=function(){function e(){}return e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(0===e)throw new hs;return this.logTable[e]},e.addOrSubtract=function(e,t){return e^t},e}(),uu=function(){function e(e,t){if(0===t.length)throw new hs;this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),ys.arraycopy(t,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){if(0===e)return this.getCoefficient(0);var t,r=this.coefficients;if(1===e){t=0;for(var n=0,i=r.length;n!==i;n++){var o=r[n];t=su.addOrSubtract(t,o)}return t}t=r[0];var a=r.length,s=this.field;for(n=1;n<a;n++)t=su.addOrSubtract(s.multiply(e,t),r[n]);return t},e.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new hs("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;var r=this.coefficients,n=t.coefficients;if(r.length>n.length){var i=r;r=n,n=i}var o=new Int32Array(n.length),a=n.length-r.length;ys.arraycopy(n,0,o,0,a);for(var s=a;s<n.length;s++)o[s]=su.addOrSubtract(r[s-a],n[s]);return new e(this.field,o)},e.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new hs("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),s=this.field,u=0;u<n;u++)for(var c=r[u],l=0;l<o;l++)a[u+l]=su.addOrSubtract(a[u+l],s.multiply(c,i[l]));return new e(s,a)},e.prototype.multiplyScalar=function(t){if(0===t)return this.field.getZero();if(1===t)return this;for(var r=this.coefficients.length,n=this.field,i=new Int32Array(r),o=this.coefficients,a=0;a<r;a++)i[a]=n.multiply(o[a],t);return new e(n,i)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new hs;if(0===r)return this.field.getZero();for(var n=this.coefficients,i=n.length,o=new Int32Array(i+t),a=this.field,s=0;s<i;s++)o[s]=a.multiply(n[s],r);return new e(a,o)},e.prototype.divide=function(e){if(!this.field.equals(e.field))throw new hs("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new hs("Divide by 0");for(var t=this.field,r=t.getZero(),n=this,i=e.getCoefficient(e.getDegree()),o=t.inverse(i);n.getDegree()>=e.getDegree()&&!n.isZero();){var a=n.getDegree()-e.getDegree(),s=t.multiply(n.getCoefficient(n.getDegree()),o),u=e.multiplyByMonomial(a,s),c=t.buildMonomial(a,s);r=r.addOrSubtract(c),n=n.addOrSubtract(u)}return[r,n]},e.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var r=this.getCoefficient(t);if(0!==r){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),0===t||1!==r){var n=this.field.log(r);0===n?e+="1":1===n?e+="a":(e+="a^",e+=n)}0!==t&&(1===t?e+="x":(e+="x^",e+=t))}}return e},e}(),cu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return cu(t,e),t.kind="ArithmeticException",t}(us),du=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hu=function(e){function t(t,r,n){var i=e.call(this)||this;i.primitive=t,i.size=r,i.generatorBase=n;for(var o=new Int32Array(r),a=1,s=0;s<r;s++)o[s]=a,(a*=2)>=r&&(a^=t,a&=r-1);i.expTable=o;var u=new Int32Array(r);for(s=0;s<r-1;s++)u[o[s]]=s;return i.logTable=u,i.zero=new uu(i,Int32Array.from([0])),i.one=new uu(i,Int32Array.from([1])),i}return du(t,e),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new hs;if(0===t)return this.zero;var r=new Int32Array(e+1);return r[0]=t,new uu(this,r)},t.prototype.inverse=function(e){if(0===e)throw new lu;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return"GF(0x"+Cs.toHexString(this.primitive)+","+this.size+")"},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(su),fu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t.kind="ReedSolomonException",t}(us),gu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gu(t,e),t.kind="IllegalStateException",t}(us),yu=function(){function e(e){this.field=e}return e.prototype.decode=function(e,t){for(var r=this.field,n=new uu(r,e),i=new Int32Array(t),o=!0,a=0;a<t;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));i[i.length-1-a]=s,0!==s&&(o=!1)}if(!o){var u=new uu(r,i),c=this.runEuclideanAlgorithm(r.buildMonomial(t,1),u,t),l=c[0],d=c[1],h=this.findErrorLocations(l),f=this.findErrorMagnitudes(d,h);for(a=0;a<h.length;a++){var p=e.length-1-r.log(h[a]);if(p<0)throw new pu("Bad error location");e[p]=hu.addOrSubtract(e[p],f[a])}}},e.prototype.runEuclideanAlgorithm=function(e,t,r){if(e.getDegree()<t.getDegree()){var n=e;e=t,t=n}for(var i=this.field,o=e,a=t,s=i.getZero(),u=i.getOne();a.getDegree()>=(r/2|0);){var c=o,l=s;if(s=u,(o=a).isZero())throw new pu("r_{i-1} was zero");a=c;for(var d=i.getZero(),h=o.getCoefficient(o.getDegree()),f=i.inverse(h);a.getDegree()>=o.getDegree()&&!a.isZero();){var p=a.getDegree()-o.getDegree(),g=i.multiply(a.getCoefficient(a.getDegree()),f);d=d.addOrSubtract(i.buildMonomial(p,g)),a=a.addOrSubtract(o.multiplyByMonomial(p,g))}if(u=d.multiply(s).addOrSubtract(l),a.getDegree()>=o.getDegree())throw new mu("Division algorithm failed to reduce polynomial?")}var m=u.getCoefficient(0);if(0===m)throw new pu("sigmaTilde(0) was zero");var y=i.inverse(m);return[u.multiplyScalar(y),a.multiplyScalar(y)]},e.prototype.findErrorLocations=function(e){var t=e.getDegree();if(1===t)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(t),n=0,i=this.field,o=1;o<i.getSize()&&n<t;o++)0===e.evaluateAt(o)&&(r[n]=i.inverse(o),n++);if(n!==t)throw new pu("Error locator degree does not match number of roots");return r},e.prototype.findErrorMagnitudes=function(e,t){for(var r=t.length,n=new Int32Array(r),i=this.field,o=0;o<r;o++){for(var a=i.inverse(t[o]),s=1,u=0;u<r;u++)if(o!==u){var c=i.multiply(t[u],a),l=0==(1&c)?1|c:-2&c;s=i.multiply(s,l)}n[o]=i.multiply(e.evaluateAt(a),i.inverse(s)),0!==i.getGeneratorBase()&&(n[o]=i.multiply(n[o],a))}return n},e}();!function(e){e[e.UPPER=0]="UPPER",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.DIGIT=3]="DIGIT",e[e.PUNCT=4]="PUNCT",e[e.BINARY=5]="BINARY"}(iu||(iu={}));var vu=function(){function e(){}return e.prototype.decode=function(t){this.ddata=t;var r=t.getBits(),n=this.extractBits(r),i=this.correctBits(n),o=e.convertBoolArrayToByteArray(i),a=e.getEncodedData(i),s=new au(o,a,null,null);return s.setNumBits(i.length),s},e.highLevelDecode=function(e){return this.getEncodedData(e)},e.getEncodedData=function(t){for(var r=t.length,n=iu.UPPER,i=iu.UPPER,o="",a=0;a<r;)if(i===iu.BINARY){if(r-a<5)break;var s=e.readCode(t,a,5);if(a+=5,0===s){if(r-a<11)break;s=e.readCode(t,a,11)+31,a+=11}for(var u=0;u<s;u++){if(r-a<8){a=r;break}var c=e.readCode(t,a,8);o+=Bs.castAsNonUtf8Char(c),a+=8}i=n}else{var l=i===iu.DIGIT?4:5;if(r-a<l)break;c=e.readCode(t,a,l);a+=l;var d=e.getCharacter(i,c);d.startsWith("CTRL_")?(n=i,i=e.getTable(d.charAt(5)),"L"===d.charAt(6)&&(n=i)):(o+=d,i=n)}return o},e.getTable=function(e){switch(e){case"L":return iu.LOWER;case"P":return iu.PUNCT;case"M":return iu.MIXED;case"D":return iu.DIGIT;case"B":return iu.BINARY;default:return iu.UPPER}},e.getCharacter=function(t,r){switch(t){case iu.UPPER:return e.UPPER_TABLE[r];case iu.LOWER:return e.LOWER_TABLE[r];case iu.MIXED:return e.MIXED_TABLE[r];case iu.PUNCT:return e.PUNCT_TABLE[r];case iu.DIGIT:return e.DIGIT_TABLE[r];default:throw new mu("Bad table")}},e.prototype.correctBits=function(t){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=hu.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=hu.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=hu.AZTEC_DATA_10):(n=12,r=hu.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),o=t.length/n;if(o<i)throw new Ms;for(var a=t.length%n,s=new Int32Array(o),u=0;u<o;u++,a+=n)s[u]=e.readCode(t,a,n);try{new yu(r).decode(s,o-i)}catch(e){throw new Ms(e)}var c=(1<<n)-1,l=0;for(u=0;u<i;u++){if(0===(f=s[u])||f===c)throw new Ms;1!==f&&f!==c-1||l++}var d=new Array(i*n-l),h=0;for(u=0;u<i;u++){var f;if(1===(f=s[u])||f===c-1)d.fill(f>1,h,h+n-1),h+=n-1;else for(var p=n-1;p>=0;--p)d[h++]=0!=(f&1<<p)}return d},e.prototype.extractBits=function(e){var t=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(t?11:14)+4*r,i=new Int32Array(n),o=new Array(this.totalBitsInLayer(r,t));if(t)for(var a=0;a<i.length;a++)i[a]=a;else{var s=n+1+2*Cs.truncDivision(Cs.truncDivision(n,2)-1,15),u=n/2,c=Cs.truncDivision(s,2);for(a=0;a<u;a++){var l=a+Cs.truncDivision(a,15);i[u-a-1]=c-l-1,i[u+a]=c+l+1}}a=0;for(var d=0;a<r;a++){for(var h=4*(r-a)+(t?9:12),f=2*a,p=n-1-f,g=0;g<h;g++)for(var m=2*g,y=0;y<2;y++)o[d+m+y]=e.get(i[f+y],i[f+g]),o[d+2*h+m+y]=e.get(i[f+g],i[p-y]),o[d+4*h+m+y]=e.get(i[p-y],i[p-g]),o[d+6*h+m+y]=e.get(i[p-g],i[f+y]);d+=8*h}return o},e.readCode=function(e,t,r){for(var n=0,i=t;i<t+r;i++)n<<=1,e[i]&&(n|=1);return n},e.readByte=function(t,r){var n=t.length-r;return n>=8?e.readCode(t,r,8):e.readCode(t,r,n)<<8-n},e.convertBoolArrayToByteArray=function(t){for(var r=new Uint8Array((t.length+7)/8),n=0;n<r.length;n++)r[n]=e.readByte(t,8*n);return r},e.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],e.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],e.MIXED_TABLE=["CTRL_PS"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~","","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],e.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],e.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],e}(),wu=function(){function e(){}return e.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},e.distance=function(e,t,r,n){var i=e-r,o=t-n;return Math.sqrt(i*i+o*o)},e.sum=function(e){for(var t=0,r=0,n=e.length;r!==n;r++){t+=e[r]}return t},e}(),bu=function(){function e(){}return e.floatToIntBits=function(e){return e},e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),_u=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var r=t;return this.x===r.x&&this.y===r.y}return!1},e.prototype.hashCode=function(){return 31*bu.floatToIntBits(this.x)+bu.floatToIntBits(this.y)},e.prototype.toString=function(){return"("+this.x+","+this.y+")"},e.orderBestPatterns=function(e){var t,r,n,i=this.distance(e[0],e[1]),o=this.distance(e[1],e[2]),a=this.distance(e[0],e[2]);if(o>=i&&o>=a?(r=e[0],t=e[1],n=e[2]):a>=o&&a>=i?(r=e[1],t=e[0],n=e[2]):(r=e[2],t=e[0],n=e[1]),this.crossProductZ(t,r,n)<0){var s=t;t=n,n=s}e[0]=t,e[1]=r,e[2]=n},e.distance=function(e,t){return wu.distance(e.x,e.y,t.x,t.y)},e.crossProductZ=function(e,t,r){var n=t.x,i=t.y;return(r.x-n)*(e.y-i)-(r.y-i)*(e.x-n)},e}(),Au=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),Eu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cu=function(e){function t(t,r,n,i,o){var a=e.call(this,t,r)||this;return a.compact=n,a.nbDatablocks=i,a.nbLayers=o,a}return Eu(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(Au),xu=function(){function e(t,r,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),null==r&&(r=e.INIT_SIZE),null==n&&(n=t.getWidth()/2|0),null==i&&(i=t.getHeight()/2|0);var o=r/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Us}return e.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,r=this.upInit,n=this.downInit,i=!1,o=!0,a=!1,s=!1,u=!1,c=!1,l=!1,d=this.width,h=this.height;o;){o=!1;for(var f=!0;(f||!s)&&t<d;)(f=this.containsBlackPoint(r,n,t,!1))?(t++,o=!0,s=!0):s||t++;if(t>=d){i=!0;break}for(var p=!0;(p||!u)&&n<h;)(p=this.containsBlackPoint(e,t,n,!0))?(n++,o=!0,u=!0):u||n++;if(n>=h){i=!0;break}for(var g=!0;(g||!c)&&e>=0;)(g=this.containsBlackPoint(r,n,e,!1))?(e--,o=!0,c=!0):c||e--;if(e<0){i=!0;break}for(var m=!0;(m||!l)&&r>=0;)(m=this.containsBlackPoint(e,t,r,!0))?(r--,o=!0,l=!0):l||r--;if(r<0){i=!0;break}o&&(a=!0)}if(!i&&a){for(var y=t-e,v=null,w=1;null===v&&w<y;w++)v=this.getBlackPointOnSegment(e,n-w,e+w,n);if(null==v)throw new Us;var b=null;for(w=1;null===b&&w<y;w++)b=this.getBlackPointOnSegment(e,r+w,e+w,r);if(null==b)throw new Us;var _=null;for(w=1;null===_&&w<y;w++)_=this.getBlackPointOnSegment(t,r+w,t-w,r);if(null==_)throw new Us;var A=null;for(w=1;null===A&&w<y;w++)A=this.getBlackPointOnSegment(t,n-w,t-w,n);if(null==A)throw new Us;return this.centerEdges(A,v,_,b)}throw new Us},e.prototype.getBlackPointOnSegment=function(e,t,r,n){for(var i=wu.round(wu.distance(e,t,r,n)),o=(r-e)/i,a=(n-t)/i,s=this.image,u=0;u<i;u++){var c=wu.round(e+u*o),l=wu.round(t+u*a);if(s.get(c,l))return new _u(c,l)}return null},e.prototype.centerEdges=function(t,r,n,i){var o=t.getX(),a=t.getY(),s=r.getX(),u=r.getY(),c=n.getX(),l=n.getY(),d=i.getX(),h=i.getY(),f=e.CORR;return o<this.width/2?[new _u(d-f,h+f),new _u(s+f,u+f),new _u(c-f,l-f),new _u(o+f,a-f)]:[new _u(d+f,h+f),new _u(s+f,u-f),new _u(c-f,l+f),new _u(o-f,a-f)]},e.prototype.containsBlackPoint=function(e,t,r,n){var i=this.image;if(n){for(var o=e;o<=t;o++)if(i.get(o,r))return!0}else for(var a=e;a<=t;a++)if(i.get(r,a))return!0;return!1},e.INIT_SIZE=10,e.CORR=1,e}(),Su=function(){function e(){}return e.checkAndNudgePoints=function(e,t){for(var r=e.getWidth(),n=e.getHeight(),i=!0,o=0;o<t.length&&i;o+=2){var a=Math.floor(t[o]),s=Math.floor(t[o+1]);if(a<-1||a>r||s<-1||s>n)throw new Us;i=!1,-1===a?(t[o]=0,i=!0):a===r&&(t[o]=r-1,i=!0),-1===s?(t[o+1]=0,i=!0):s===n&&(t[o+1]=n-1,i=!0)}i=!0;for(o=t.length-2;o>=0&&i;o-=2){a=Math.floor(t[o]),s=Math.floor(t[o+1]);if(a<-1||a>r||s<-1||s>n)throw new Us;i=!1,-1===a?(t[o]=0,i=!0):a===r&&(t[o]=r-1,i=!0),-1===s?(t[o+1]=0,i=!0):s===n&&(t[o+1]=n-1,i=!0)}},e}(),Iu=function(){function e(e,t,r,n,i,o,a,s,u){this.a11=e,this.a21=t,this.a31=r,this.a12=n,this.a22=i,this.a32=o,this.a13=a,this.a23=s,this.a33=u}return e.quadrilateralToQuadrilateral=function(t,r,n,i,o,a,s,u,c,l,d,h,f,p,g,m){var y=e.quadrilateralToSquare(t,r,n,i,o,a,s,u);return e.squareToQuadrilateral(c,l,d,h,f,p,g,m).times(y)},e.prototype.transformPoints=function(e){for(var t=e.length,r=this.a11,n=this.a12,i=this.a13,o=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,d=0;d<t;d+=2){var h=e[d],f=e[d+1],p=i*h+s*f+l;e[d]=(r*h+o*f+u)/p,e[d+1]=(n*h+a*f+c)/p}},e.prototype.transformPointsWithValues=function(e,t){for(var r=this.a11,n=this.a12,i=this.a13,o=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,d=e.length,h=0;h<d;h++){var f=e[h],p=t[h],g=i*f+s*p+l;e[h]=(r*f+o*p+u)/g,t[h]=(n*f+a*p+c)/g}},e.squareToQuadrilateral=function(t,r,n,i,o,a,s,u){var c=t-n+o-s,l=r-i+a-u;if(0===c&&0===l)return new e(n-t,o-n,t,i-r,a-i,r,0,0,1);var d=n-o,h=s-o,f=i-a,p=u-a,g=d*p-h*f,m=(c*p-h*l)/g,y=(d*l-c*f)/g;return new e(n-t+m*n,s-t+y*s,t,i-r+m*i,u-r+y*u,r,m,y,1)},e.quadrilateralToSquare=function(t,r,n,i,o,a,s,u){return e.squareToQuadrilateral(t,r,n,i,o,a,s,u).buildAdjoint()},e.prototype.buildAdjoint=function(){return new e(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},e.prototype.times=function(t){return new e(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},e}(),Tu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tu(t,e),t.prototype.sampleGrid=function(e,t,r,n,i,o,a,s,u,c,l,d,h,f,p,g,m,y,v){var w=Iu.quadrilateralToQuadrilateral(n,i,o,a,s,u,c,l,d,h,f,p,g,m,y,v);return this.sampleGridWithTransform(e,t,r,w)},t.prototype.sampleGridWithTransform=function(e,t,r,n){if(t<=0||r<=0)throw new Us;for(var i=new Ls(t,r),o=new Float32Array(2*t),a=0;a<r;a++){for(var s=o.length,u=a+.5,c=0;c<s;c+=2)o[c]=c/2+.5,o[c+1]=u;n.transformPoints(o),Su.checkAndNudgePoints(e,o);try{for(c=0;c<s;c+=2)e.get(Math.floor(o[c]),Math.floor(o[c+1]))&&i.set(c/2,a)}catch(e){throw new Us}}return i},t}(Su),Du=function(){function e(){}return e.setGridSampler=function(t){e.gridSampler=t},e.getInstance=function(){return e.gridSampler},e.gridSampler=new Mu,e}(),Ru=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toResultPoint=function(){return new _u(this.getX(),this.getY())},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e}(),Ou=function(){function e(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return e.prototype.detect=function(){return this.detectMirror(!1)},e.prototype.detectMirror=function(e){var t=this.getMatrixCenter(),r=this.getBullsEyeCorners(t);if(e){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var i=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),o=this.getMatrixCornerPoints(r);return new Cu(i,o,this.compact,this.nbDataBlocks,this.nbLayers)},e.prototype.extractParameters=function(e){if(!(this.isValidPoint(e[0])&&this.isValidPoint(e[1])&&this.isValidPoint(e[2])&&this.isValidPoint(e[3])))throw new Us;var t=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(r,t);for(var n=0,i=0;i<4;i++){var o=r[(this.shift+i)%4];this.compact?(n<<=7,n+=o>>1&127):(n<<=10,n+=(o>>2&992)+(o>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},e.prototype.getRotation=function(e,t){var r=0;e.forEach((function(e,n,i){r=(r<<3)+((e>>t-2<<1)+(1&e))})),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(Cs.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new Us},e.prototype.getCorrectedParameterData=function(e,t){var r,n;t?(r=7,n=2):(r=10,n=4);for(var i=r-n,o=new Int32Array(r),a=r-1;a>=0;--a)o[a]=15&e,e>>=4;try{new yu(hu.AZTEC_PARAM).decode(o,i)}catch(e){throw new Us}var s=0;for(a=0;a<n;a++)s=(s<<4)+o[a];return s},e.prototype.getBullsEyeCorners=function(e){var t=e,r=e,n=e,i=e,o=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(t,o,1,-1),s=this.getFirstDifferent(r,o,1,1),u=this.getFirstDifferent(n,o,-1,1),c=this.getFirstDifferent(i,o,-1,-1);if(this.nbCenterLayers>2){var l=this.distancePoint(c,a)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(l<.75||l>1.25||!this.isWhiteOrBlackRectangle(a,s,u,c))break}t=a,r=s,n=u,i=c,o=!o}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Us;this.compact=5===this.nbCenterLayers;var d=new _u(t.getX()+.5,t.getY()-.5),h=new _u(r.getX()+.5,r.getY()+.5),f=new _u(n.getX()-.5,n.getY()+.5),p=new _u(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,h,f,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var e,t,r,n;try{e=(u=new xu(this.image).detect())[0],t=u[1],r=u[2],n=u[3]}catch(a){var i=this.image.getWidth()/2,o=this.image.getHeight()/2;e=this.getFirstDifferent(new Ru(i+7,o-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Ru(i+7,o+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Ru(i-7,o+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Ru(i-7,o-7),!1,-1,-1).toResultPoint()}var a=wu.round((e.getX()+n.getX()+t.getX()+r.getX())/4),s=wu.round((e.getY()+n.getY()+t.getY()+r.getY())/4);try{var u;e=(u=new xu(this.image,15,a,s).detect())[0],t=u[1],r=u[2],n=u[3]}catch(i){e=this.getFirstDifferent(new Ru(a+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Ru(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Ru(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Ru(a-7,s-7),!1,-1,-1).toResultPoint()}return a=wu.round((e.getX()+n.getX()+t.getX()+r.getX())/4),s=wu.round((e.getY()+n.getY()+t.getY()+r.getY())/4),new Ru(a,s)},e.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(e,t,r,n,i){var o=Du.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return o.sampleGrid(e,a,a,s,s,u,s,u,u,s,u,t.getX(),t.getY(),r.getX(),r.getY(),n.getX(),n.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(e,t,r){for(var n=0,i=this.distanceResultPoint(e,t),o=i/r,a=e.getX(),s=e.getY(),u=o*(t.getX()-e.getX())/i,c=o*(t.getY()-e.getY())/i,l=0;l<r;l++)this.image.get(wu.round(a+l*u),wu.round(s+l*c))&&(n|=1<<r-l-1);return n},e.prototype.isWhiteOrBlackRectangle=function(e,t,r,n){e=new Ru(e.getX()-3,e.getY()+3),t=new Ru(t.getX()-3,t.getY()-3),r=new Ru(r.getX()+3,r.getY()-3),n=new Ru(n.getX()+3,n.getY()+3);var i=this.getColor(n,e);if(0===i)return!1;var o=this.getColor(e,t);return o===i&&((o=this.getColor(t,r))===i&&(o=this.getColor(r,n))===i)},e.prototype.getColor=function(e,t){for(var r=this.distancePoint(e,t),n=(t.getX()-e.getX())/r,i=(t.getY()-e.getY())/r,o=0,a=e.getX(),s=e.getY(),u=this.image.get(e.getX(),e.getY()),c=Math.ceil(r),l=0;l<c;l++)a+=n,s+=i,this.image.get(wu.round(a),wu.round(s))!==u&&o++;var d=o/r;return d>.1&&d<.9?0:d<=.1===u?1:-1},e.prototype.getFirstDifferent=function(e,t,r,n){for(var i=e.getX()+r,o=e.getY()+n;this.isValid(i,o)&&this.image.get(i,o)===t;)i+=r,o+=n;for(i-=r,o-=n;this.isValid(i,o)&&this.image.get(i,o)===t;)i+=r;for(i-=r;this.isValid(i,o)&&this.image.get(i,o)===t;)o+=n;return new Ru(i,o-=n)},e.prototype.expandSquare=function(e,t,r){var n=r/(2*t),i=e[0].getX()-e[2].getX(),o=e[0].getY()-e[2].getY(),a=(e[0].getX()+e[2].getX())/2,s=(e[0].getY()+e[2].getY())/2,u=new _u(a+n*i,s+n*o),c=new _u(a-n*i,s-n*o);return i=e[1].getX()-e[3].getX(),o=e[1].getY()-e[3].getY(),a=(e[1].getX()+e[3].getX())/2,s=(e[1].getY()+e[3].getY())/2,[u,new _u(a+n*i,s+n*o),c,new _u(a-n*i,s-n*o)]},e.prototype.isValid=function(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()},e.prototype.isValidPoint=function(e){var t=wu.round(e.getX()),r=wu.round(e.getY());return this.isValid(t,r)},e.prototype.distancePoint=function(e,t){return wu.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.distanceResultPoint=function(e,t){return wu.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(Cs.truncDivision(this.nbLayers-4,8)+1)+15},e}(),ku=function(){function e(){}return e.prototype.decode=function(e,t){void 0===t&&(t=null);var r=null,n=new Ou(e.getBlackMatrix()),i=null,o=null;try{i=(a=n.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(t,i),o=(new vu).decode(a)}catch(e){r=e}if(null==o)try{var a;i=(a=n.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(t,i),o=(new vu).decode(a)}catch(e){if(null!=r)throw r;throw e}var s=new tu(o.getText(),o.getRawBytes(),o.getNumBits(),i,nu.AZTEC,ys.currentTimeMillis()),u=o.getByteSegments();null!=u&&s.putMetadata(ou.BYTE_SEGMENTS,u);var c=o.getECLevel();return null!=c&&s.putMetadata(ou.ERROR_CORRECTION_LEVEL,c),s},e.prototype.reportFoundResultPoints=function(e,t){if(null!=e){var r=e.get(Is.NEED_RESULT_POINT_CALLBACK);null!=r&&t.forEach((function(e,t,n){r.foundPossibleResultPoint(e)}))}},e.prototype.reset=function(){},e}(),Nu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new ku,t)||this}Nu(t,e)}(eu);var Pu=function(){function e(){}return e.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch(c){if(t&&!0===t.get(Is.TRY_HARDER)&&e.isRotateSupported()){var r=e.rotateCounterClockwise(),n=this.doDecode(r,t),i=n.getResultMetadata(),o=270;null!==i&&!0===i.get(ou.ORIENTATION)&&(o+=i.get(ou.ORIENTATION)%360),n.putMetadata(ou.ORIENTATION,o);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),u=0;u<a.length;u++)a[u]=new _u(s-a[u].getY()-1,a[u].getX());return n}throw new Us}},e.prototype.reset=function(){},e.prototype.doDecode=function(e,t){var r,n=e.getWidth(),i=e.getHeight(),o=new xs(n),a=t&&!0===t.get(Is.TRY_HARDER),s=Math.max(1,i>>(a?8:5));r=a?i:15;for(var u=Math.trunc(i/2),c=0;c<r;c++){var l=Math.trunc((c+1)/2),d=u+s*(0==(1&c)?l:-l);if(d<0||d>=i)break;try{o=e.getBlackRow(d,o)}catch(e){continue}for(var h=function(e){if(1===e&&(o.reverse(),t&&!0===t.get(Is.NEED_RESULT_POINT_CALLBACK))){var r=new Map;t.forEach((function(e,t){return r.set(t,e)})),r.delete(Is.NEED_RESULT_POINT_CALLBACK),t=r}try{var i=f.decodeRow(d,o,t);if(1===e){i.putMetadata(ou.ORIENTATION,180);var a=i.getResultPoints();null!==a&&(a[0]=new _u(n-a[0].getX()-1,a[0].getY()),a[1]=new _u(n-a[1].getX()-1,a[1].getY()))}return{value:i}}catch(e){}},f=this,p=0;p<2;p++){var g=h(p);if("object"==typeof g)return g.value}}throw new Us},e.recordPattern=function(e,t,r){for(var n=r.length,i=0;i<n;i++)r[i]=0;var o=e.getSize();if(t>=o)throw new Us;for(var a=!e.get(t),s=0,u=t;u<o;){if(e.get(u)!==a)r[s]++;else{if(++s===n)break;r[s]=1,a=!a}u++}if(s!==n&&(s!==n-1||u!==o))throw new Us},e.recordPatternInReverse=function(t,r,n){for(var i=n.length,o=t.get(r);r>0&&i>=0;)t.get(--r)!==o&&(i--,o=!o);if(i>=0)throw new Us;e.recordPattern(t,r+1,n)},e.patternMatchVariance=function(e,t,r){for(var n=e.length,i=0,o=0,a=0;a<n;a++)i+=e[a],o+=t[a];if(i<o)return Number.POSITIVE_INFINITY;var s=i/o;r*=s;for(var u=0,c=0;c<n;c++){var l=e[c],d=t[c]*s,h=l>d?l-d:d-l;if(h>r)return Number.POSITIVE_INFINITY;u+=h}return u/i},e}(),Bu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Bu(t,e),t.findStartPattern=function(e){for(var r=e.getSize(),n=e.getNextSet(0),i=0,o=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u<r;u++)if(e.get(u)!==s)o[i]++;else{if(5===i){for(var c=t.MAX_AVG_VARIANCE,l=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var h=Pu.patternMatchVariance(o,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);h<c&&(c=h,l=d)}if(l>=0&&e.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,l]);a+=o[0]+o[1],(o=o.slice(2,o.length))[i-1]=0,o[i]=0,i--}else i++;o[i]=1,s=!s}throw new Us},t.decodeCode=function(e,r,n){Pu.recordPattern(e,n,r);for(var i=t.MAX_AVG_VARIANCE,o=-1,a=0;a<t.CODE_PATTERNS.length;a++){var s=t.CODE_PATTERNS[a],u=this.patternMatchVariance(r,s,t.MAX_INDIVIDUAL_VARIANCE);u<i&&(i=u,o=a)}if(o>=0)return o;throw new Us},t.prototype.decodeRow=function(e,r,n){var i,o=n&&!0===n.get(Is.ASSUME_GS1),a=t.findStartPattern(r),s=a[2],u=0,c=new Uint8Array(20);switch(c[u++]=s,s){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new Ms}for(var l=!1,d=!1,h="",f=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),m=0,y=0,v=s,w=0,b=!0,_=!1,A=!1;!l;){var E=d;switch(d=!1,m=y,y=t.decodeCode(r,g,p),c[u++]=y,y!==t.CODE_STOP&&(b=!0),y!==t.CODE_STOP&&(v+=++w*y),f=p,p+=g.reduce((function(e,t){return e+t}),0),y){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new Ms}switch(i){case t.CODE_CODE_A:if(y<64)h+=A===_?String.fromCharCode(" ".charCodeAt(0)+y):String.fromCharCode(" ".charCodeAt(0)+y+128),A=!1;else if(y<96)h+=A===_?String.fromCharCode(y-64):String.fromCharCode(y+64),A=!1;else switch(y!==t.CODE_STOP&&(b=!1),y){case t.CODE_FNC_1:o&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!_&&A?(_=!0,A=!1):_&&A?(_=!1,A=!1):A=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0}break;case t.CODE_CODE_B:if(y<96)h+=A===_?String.fromCharCode(" ".charCodeAt(0)+y):String.fromCharCode(" ".charCodeAt(0)+y+128),A=!1;else switch(y!==t.CODE_STOP&&(b=!1),y){case t.CODE_FNC_1:o&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!_&&A?(_=!0,A=!1):_&&A?(_=!1,A=!1):A=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0}break;case t.CODE_CODE_C:if(y<100)y<10&&(h+="0"),h+=y;else switch(y!==t.CODE_STOP&&(b=!1),y){case t.CODE_FNC_1:o&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:l=!0}}E&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var C=p-f;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-f)/2),!1))throw new Us;if((v-=w*m)%103!==m)throw new gs;var x=h.length;if(0===x)throw new Us;x>0&&b&&(h=i===t.CODE_CODE_C?h.substring(0,x-2):h.substring(0,x-1));for(var S=(a[1]+a[0])/2,I=f+C/2,T=c.length,M=new Uint8Array(T),D=0;D<T;D++)M[D]=c[D];var R=[new _u(S,e),new _u(I,e)];return new tu(h,M,0,R,nu.CODE_128,(new Date).getTime())},t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}(Pu),Lu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zu=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Uu=function(e){function t(t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.call(this)||this;return n.usingCheckDigit=t,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return Lu(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a,s,u=this.counters;u.fill(0),this.decodeRowResult="";var c,l,d=t.findAsteriskPattern(r,u),h=r.getNextSet(d[1]),f=r.getSize();do{t.recordPattern(r,h,u);var p=t.toNarrowWidePattern(u);if(p<0)throw new Us;c=t.patternToChar(p),this.decodeRowResult+=c,l=h;try{for(var g=(i=void 0,zu(u)),m=g.next();!m.done;m=g.next()){h+=m.value}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}h=r.getNextSet(h)}while("*"!==c);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var y,v=0;try{for(var w=zu(u),b=w.next();!b.done;b=w.next()){v+=b.value}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}if(h!==f&&2*(h-l-v)<v)throw new Us;if(this.usingCheckDigit){for(var _=this.decodeRowResult.length-1,A=0,E=0;E<_;E++)A+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(E));if(this.decodeRowResult.charAt(_)!==t.ALPHABET_STRING.charAt(A%43))throw new gs;this.decodeRowResult=this.decodeRowResult.substring(0,_)}if(0===this.decodeRowResult.length)throw new Us;y=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult;var C=(d[1]+d[0])/2,x=l+v/2;return new tu(y,null,0,[new _u(C,e),new _u(x,e)],nu.CODE_39,(new Date).getTime())},t.findAsteriskPattern=function(e,r){for(var n=e.getSize(),i=e.getNextSet(0),o=0,a=i,s=!1,u=r.length,c=i;c<n;c++)if(e.get(c)!==s)r[o]++;else{if(o===u-1){if(this.toNarrowWidePattern(r)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,a-Math.floor((c-a)/2)),a,!1))return[a,c];a+=r[0]+r[1],r.copyWithin(0,2,2+o-1),r[o-1]=0,r[o]=0,o--}else o++;r[o]=1,s=!s}throw new Us},t.toNarrowWidePattern=function(e){var t,r,n,i=e.length,o=0;do{var a=2147483647;try{for(var s=(t=void 0,zu(e)),u=s.next();!u.done;u=s.next()){(h=u.value)<a&&h>o&&(a=h)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}o=a,n=0;for(var c=0,l=0,d=0;d<i;d++){(h=e[d])>o&&(l|=1<<i-1-d,n++,c+=h)}if(3===n){for(d=0;d<i&&n>0;d++){var h;if((h=e[d])>o&&(n--,2*h>=c))return-1}return l}}while(n>3);return-1},t.patternToChar=function(e){for(var r=0;r<t.CHARACTER_ENCODINGS.length;r++)if(t.CHARACTER_ENCODINGS[r]===e)return t.ALPHABET_STRING.charAt(r);if(e===t.ASTERISK_ENCODING)return"*";throw new Us},t.decodeExtended=function(e){for(var t=e.length,r="",n=0;n<t;n++){var i=e.charAt(n);if("+"===i||"$"===i||"%"===i||"/"===i){var o=e.charAt(n+1),a="\0";switch(i){case"+":if(!(o>="A"&&o<="Z"))throw new Ms;a=String.fromCharCode(o.charCodeAt(0)+32);break;case"$":if(!(o>="A"&&o<="Z"))throw new Ms;a=String.fromCharCode(o.charCodeAt(0)-64);break;case"%":if(o>="A"&&o<="E")a=String.fromCharCode(o.charCodeAt(0)-38);else if(o>="F"&&o<="J")a=String.fromCharCode(o.charCodeAt(0)-11);else if(o>="K"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)+16);else if(o>="P"&&o<="T")a=String.fromCharCode(o.charCodeAt(0)+43);else if("U"===o)a="\0";else if("V"===o)a="@";else if("W"===o)a="`";else{if("X"!==o&&"Y"!==o&&"Z"!==o)throw new Ms;a=""}break;case"/":if(o>="A"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)-32);else{if("Z"!==o)throw new Ms;a=":"}}r+=a,n++}else r+=i}return r},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(Pu),ju=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vu=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hu=function(e){function t(){var t=e.call(this)||this;return t.decodeRowResult="",t.counters=new Int32Array(6),t}return ju(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a,s,u,c,l=this.findAsteriskPattern(r),d=r.getNextSet(l[1]),h=r.getSize(),f=this.counters;f.fill(0),this.decodeRowResult="";do{t.recordPattern(r,d,f);var p=this.toPattern(f);if(p<0)throw new Us;u=this.patternToChar(p),this.decodeRowResult+=u,c=d;try{for(var g=(i=void 0,Vu(f)),m=g.next();!m.done;m=g.next()){d+=m.value}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}d=r.getNextSet(d)}while("*"!==u);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var y=0;try{for(var v=Vu(f),w=v.next();!w.done;w=v.next()){y+=w.value}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}if(d===h||!r.get(d))throw new Us;if(this.decodeRowResult.length<2)throw new Us;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var b=this.decodeExtended(this.decodeRowResult),_=(l[1]+l[0])/2,A=c+y/2;return new tu(b,null,0,[new _u(_,e),new _u(A,e)],nu.CODE_93,(new Date).getTime())},t.prototype.findAsteriskPattern=function(e){var r=e.getSize(),n=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,o=n,a=!1,s=i.length,u=0,c=n;c<r;c++)if(e.get(c)!==a)i[u]++;else{if(u===s-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([o,c]);o+=i[0]+i[1],i.copyWithin(0,2,2+u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,a=!a}throw new Us},t.prototype.toPattern=function(e){var t,r,n=0;try{for(var i=Vu(e),o=i.next();!o.done;o=i.next()){n+=o.value}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var a=0,s=e.length,u=0;u<s;u++){var c=Math.round(9*e[u]/n);if(c<1||c>4)return-1;if(0==(1&u))for(var l=0;l<c;l++)a=a<<1|1;else a<<=c}return a},t.prototype.patternToChar=function(e){for(var r=0;r<t.CHARACTER_ENCODINGS.length;r++)if(t.CHARACTER_ENCODINGS[r]===e)return t.ALPHABET_STRING.charAt(r);throw new Us},t.prototype.decodeExtended=function(e){for(var t=e.length,r="",n=0;n<t;n++){var i=e.charAt(n);if(i>="a"&&i<="d"){if(n>=t-1)throw new Ms;var o=e.charAt(n+1),a="\0";switch(i){case"d":if(!(o>="A"&&o<="Z"))throw new Ms;a=String.fromCharCode(o.charCodeAt(0)+32);break;case"a":if(!(o>="A"&&o<="Z"))throw new Ms;a=String.fromCharCode(o.charCodeAt(0)-64);break;case"b":if(o>="A"&&o<="E")a=String.fromCharCode(o.charCodeAt(0)-38);else if(o>="F"&&o<="J")a=String.fromCharCode(o.charCodeAt(0)-11);else if(o>="K"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)+16);else if(o>="P"&&o<="T")a=String.fromCharCode(o.charCodeAt(0)+43);else if("U"===o)a="\0";else if("V"===o)a="@";else if("W"===o)a="`";else{if(!(o>="X"&&o<="Z"))throw new Ms;a=String.fromCharCode(127)}break;case"c":if(o>="A"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)-32);else{if("Z"!==o)throw new Ms;a=":"}}r+=a,n++}else r+=i}return r},t.prototype.checkChecksums=function(e){var t=e.length;this.checkOneChecksum(e,t-2,20),this.checkOneChecksum(e,t-1,15)},t.prototype.checkOneChecksum=function(e,r,n){for(var i=1,o=0,a=r-1;a>=0;a--)o+=i*t.ALPHABET_STRING.indexOf(e.charAt(a)),++i>n&&(i=1);if(e.charAt(r)!==t.ALPHABET_STRING[o%47])throw new gs},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(Pu),Gu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qu=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return Gu(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a=this.decodeStart(r),s=this.decodeEnd(r),u=new Fs;t.decodeMiddle(r,a[1],s[0],u);var c=u.toString(),l=null;null!=n&&(l=n.get(Is.ALLOWED_LENGTHS)),null==l&&(l=t.DEFAULT_ALLOWED_LENGTHS);var d=c.length,h=!1,f=0;try{for(var p=qu(l),g=p.next();!g.done;g=p.next()){var m=g.value;if(d===m){h=!0;break}m>f&&(f=m)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}if(!h&&d>f&&(h=!0),!h)throw new Ms;var y=[new _u(a[1],e),new _u(s[0],e)];return new tu(c,null,0,y,nu.ITF,(new Date).getTime())},t.decodeMiddle=function(e,r,n,i){var o=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(o.fill(0),a.fill(0),s.fill(0);r<n;){Pu.recordPattern(e,r,o);for(var u=0;u<5;u++){var c=2*u;a[u]=o[c],s[u]=o[c+1]}var l=t.decodeDigit(a);i.append(l.toString()),l=this.decodeDigit(s),i.append(l.toString()),o.forEach((function(e){r+=e}))}},t.prototype.decodeStart=function(e){var r=t.skipWhiteSpace(e),n=t.findGuardPattern(e,r,t.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(e,n[0]),n},t.prototype.validateQuietZone=function(e,t){var r=10*this.narrowLineWidth;r=r<t?r:t;for(var n=t-1;r>0&&n>=0&&!e.get(n);n--)r--;if(0!==r)throw new Us},t.skipWhiteSpace=function(e){var t=e.getSize(),r=e.getNextSet(0);if(r===t)throw new Us;return r},t.prototype.decodeEnd=function(e){e.reverse();try{var r=t.skipWhiteSpace(e),n=void 0;try{n=t.findGuardPattern(e,r,t.END_PATTERN_REVERSED[0])}catch(i){i instanceof Us&&(n=t.findGuardPattern(e,r,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,n[0]);var i=n[0];return n[0]=e.getSize()-n[1],n[1]=e.getSize()-i,n}finally{e.reverse()}},t.findGuardPattern=function(e,r,n){var i=n.length,o=new Int32Array(i),a=e.getSize(),s=!1,u=0,c=r;o.fill(0);for(var l=r;l<a;l++)if(e.get(l)!==s)o[u]++;else{if(u===i-1){if(Pu.patternMatchVariance(o,n,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[c,l];c+=o[0]+o[1],ys.arraycopy(o,2,o,0,u-1),o[u-1]=0,o[u]=0,u--}else u++;o[u]=1,s=!s}throw new Us},t.decodeDigit=function(e){for(var r=t.MAX_AVG_VARIANCE,n=-1,i=t.PATTERNS.length,o=0;o<i;o++){var a=t.PATTERNS[o],s=Pu.patternMatchVariance(e,a,t.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=o):s===r&&(n=-1)}if(n>=0)return n%10;throw new Us},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(Pu),Ku=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.decodeRowStringBuffer="",t}return Ku(t,e),t.findStartGuardPattern=function(e){for(var r,n=!1,i=0,o=Int32Array.from([0,0,0]);!n;){o=Int32Array.from([0,0,0]);var a=(r=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,o))[0],s=a-((i=r[1])-a);s>=0&&(n=e.isRange(s,a,!1))}return r},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var r=e.length;if(0===r)return!1;var n=parseInt(e.charAt(r-1),10);return t.getStandardUPCEANChecksum(e.substring(0,r-1))===n},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,r=0,n=t-1;n>=0;n-=2){if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Ms;r+=i}r*=3;for(n=t-2;n>=0;n-=2){var i;if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Ms;r+=i}return(1e3-r)%10},t.decodeEnd=function(e,r){return t.findGuardPattern(e,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,t,r,n){return this.findGuardPattern(e,t,r,n,new Int32Array(n.length))},t.findGuardPattern=function(e,r,n,i,o){for(var a=e.getSize(),s=0,u=r=n?e.getNextUnset(r):e.getNextSet(r),c=i.length,l=n,d=r;d<a;d++)if(e.get(d)!==l)o[s]++;else{if(s===c-1){if(Pu.patternMatchVariance(o,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([u,d]);u+=o[0]+o[1];for(var h=o.slice(2,o.length),f=0;f<s-1;f++)o[f]=h[f];o[s-1]=0,o[s]=0,s--}else s++;o[s]=1,l=!l}throw new Us},t.decodeDigit=function(e,r,n,i){this.recordPattern(e,n,r);for(var o=this.MAX_AVG_VARIANCE,a=-1,s=i.length,u=0;u<s;u++){var c=i[u],l=Pu.patternMatchVariance(r,c,t.MAX_INDIVIDUAL_VARIANCE);l<o&&(o=l,a=u)}if(a>=0)return a;throw new Us},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(Pu),Yu=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zu=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,r,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(r,n,i),a=i.toString(),s=e.parseExtensionString(a),u=[new _u((n[0]+n[1])/2,t),new _u(o,t)],c=new tu(a,null,0,u,nu.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(t,r,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],c=0,l=0;l<5&&u<s;l++){var d=Xu.decodeDigit(t,a,u,Xu.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var h=(i=void 0,Yu(a)),f=h.next();!f.done;f=h.next()){u+=f.value}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}d>=10&&(c|=1<<4-l),4!==l&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(5!==n.length)throw new Us;var p=this.determineCheckDigit(c);if(e.extensionChecksum(n.toString())!==p)throw new Us;return u},e.extensionChecksum=function(e){for(var t=e.length,r=0,n=t-2;n>=0;n-=2)r+=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0);r*=3;for(n=t-1;n>=0;n-=2)r+=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},e.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new Us},e.parseExtensionString=function(t){if(5!==t.length)return null;var r=e.parseExtension5String(t);return null==r?null:new Map([[ou.SUGGESTED_PRICE,r]])},e.parseExtension5String=function(e){var t;switch(e.charAt(0)){case"0":t="Ā£";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t=""}var r=parseInt(e.substring(1)),n=r%100;return t+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},e}(),Ju=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$u=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,r,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(r,n,i),a=i.toString(),s=e.parseExtensionString(a),u=[new _u((n[0]+n[1])/2,t),new _u(o,t)],c=new tu(a,null,0,u,nu.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(e,t,r){var n,i,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var a=e.getSize(),s=t[1],u=0,c=0;c<2&&s<a;c++){var l=Xu.decodeDigit(e,o,s,Xu.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var d=(n=void 0,Ju(o)),h=d.next();!h.done;h=d.next()){s+=h.value}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}l>=10&&(u|=1<<1-c),1!==c&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(2!==r.length)throw new Us;if(parseInt(r.toString())%4!==u)throw new Us;return s},e.parseExtensionString=function(e){return 2!==e.length?null:new Map([[ou.ISSUE_NUMBER,parseInt(e)]])},e}(),Qu=function(){function e(){}return e.decodeRow=function(e,t,r){var n=Xu.findGuardPattern(t,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new Zu).decodeRow(e,t,n)}catch(r){return(new $u).decodeRow(e,t,n)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),ec=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tc=function(e){function t(){var r=e.call(this)||this;r.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map((function(e){return Int32Array.from(e)}));for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],o=new Int32Array(i.length),a=0;a<i.length;a++)o[a]=i[i.length-a-1];t.L_AND_G_PATTERNS[n]=o}return r}return ec(t,e),t.prototype.decodeRow=function(e,r,n){var i=t.findStartGuardPattern(r),o=null==n?null:n.get(Is.NEED_RESULT_POINT_CALLBACK);if(null!=o){var a=new _u((i[0]+i[1])/2,e);o.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,i,this.decodeRowStringBuffer),u=s.rowOffset,c=s.resultString;if(null!=o){var l=new _u(u,e);o.foundPossibleResultPoint(l)}var d=t.decodeEnd(r,u);if(null!=o){var h=new _u((d[0]+d[1])/2,e);o.foundPossibleResultPoint(h)}var f=d[1],p=f+(f-d[0]);if(p>=r.getSize()||!r.isRange(f,p,!1))throw new Us;var g=c.toString();if(g.length<8)throw new Ms;if(!t.checkChecksum(g))throw new gs;var m=(i[1]+i[0])/2,y=(d[1]+d[0])/2,v=this.getBarcodeFormat(),w=[new _u(m,e),new _u(y,e)],b=new tu(g,null,0,w,v,(new Date).getTime()),_=0;try{var A=Qu.decodeRow(e,r,d[1]);b.putMetadata(ou.UPC_EAN_EXTENSION,A.getText()),b.putAllMetadata(A.getResultMetadata()),b.addResultPoints(A.getResultPoints()),_=A.getText().length}catch(e){}var E=null==n?null:n.get(Is.ALLOWED_EAN_EXTENSIONS);if(null!=E){var C=!1;for(var x in E)if(_.toString()===x){C=!0;break}if(!C)throw new Us}return v===nu.EAN_13||nu.UPC_A,b},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var r=e.length;if(0===r)return!1;var n=parseInt(e.charAt(r-1),10);return t.getStandardUPCEANChecksum(e.substring(0,r-1))===n},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,r=0,n=t-1;n>=0;n-=2){if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Ms;r+=i}r*=3;for(n=t-2;n>=0;n-=2){var i;if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Ms;r+=i}return(1e3-r)%10},t.decodeEnd=function(e,r){return t.findGuardPattern(e,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Xu),rc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ic=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return rc(t,e),t.prototype.decodeMiddle=function(e,r,n){var i,o,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),l=r[1],d=0,h=0;h<6&&l<c;h++){var f=tc.decodeDigit(e,u,l,tc.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f%10);try{for(var p=(i=void 0,nc(u)),g=p.next();!g.done;g=p.next()){l+=g.value}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}f>=10&&(d|=1<<5-h)}n=t.determineFirstDigit(n,d),l=tc.findGuardPattern(e,l,!0,tc.MIDDLE_PATTERN,new Int32Array(tc.MIDDLE_PATTERN.length).fill(0))[1];for(h=0;h<6&&l<c;h++){f=tc.decodeDigit(e,u,l,tc.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f);try{for(var m=(a=void 0,nc(u)),y=m.next();!y.done;y=m.next()){l+=y.value}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}return{rowOffset:l,resultString:n}},t.prototype.getBarcodeFormat=function(){return nu.EAN_13},t.determineFirstDigit=function(e,t){for(var r=0;r<10;r++)if(t===this.FIRST_DIGIT_ENCODINGS[r])return e=String.fromCharCode("0".charCodeAt(0)+r)+e;throw new Us},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(tc),oc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ac=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},sc=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return oc(t,e),t.prototype.decodeMiddle=function(e,t,r){var n,i,o,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=e.getSize(),c=t[1],l=0;l<4&&c<u;l++){var d=tc.decodeDigit(e,s,c,tc.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var h=(n=void 0,ac(s)),f=h.next();!f.done;f=h.next()){c+=f.value}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}c=tc.findGuardPattern(e,c,!0,tc.MIDDLE_PATTERN,new Int32Array(tc.MIDDLE_PATTERN.length).fill(0))[1];for(l=0;l<4&&c<u;l++){d=tc.decodeDigit(e,s,c,tc.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var p=(o=void 0,ac(s)),g=p.next();!g.done;g=p.next()){c+=g.value}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}return{rowOffset:c,resultString:r}},t.prototype.getBarcodeFormat=function(){return nu.EAN_8},t}(tc),uc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ean13Reader=new ic,t}return uc(t,e),t.prototype.getBarcodeFormat=function(){return nu.UPC_A},t.prototype.decode=function(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,t,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,r))},t.prototype.decodeMiddle=function(e,t,r){return this.ean13Reader.decodeMiddle(e,t,r)},t.prototype.maybeReturnResult=function(e){var t=e.getText();if("0"===t.charAt(0)){var r=new tu(t.substring(1),null,null,e.getResultPoints(),nu.UPC_A);return null!=e.getResultMetadata()&&r.putAllMetadata(e.getResultMetadata()),r}throw new Us},t.prototype.reset=function(){this.ean13Reader.reset()},t}(tc),lc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hc=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return lc(t,e),t.prototype.decodeMiddle=function(e,r,n){var i,o,a=this.decodeMiddleCounters.map((function(e){return e}));a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],c=0,l=0;l<6&&u<s;l++){var d=t.decodeDigit(e,a,u,t.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var h=(i=void 0,dc(a)),f=h.next();!f.done;f=h.next()){u+=f.value}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}d>=10&&(c|=1<<5-l)}return t.determineNumSysAndCheckDigit(new Fs(n),c),u},t.prototype.decodeEnd=function(e,r){return t.findGuardPatternWithoutCounters(e,r,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return tc.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,t){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return e.insert(0,"0"+r),void e.append("0"+n);throw Us.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return nu.UPC_E},t.convertUPCEtoUPCA=function(e){var t=e.slice(1,7).split("").map((function(e){return e.charCodeAt(0)})),r=new Fs;r.append(e.charAt(0));var n=t[5];switch(n){case 0:case 1:case 2:r.appendChars(t,0,2),r.append(n),r.append("0000"),r.appendChars(t,2,3);break;case 3:r.appendChars(t,0,3),r.append("00000"),r.appendChars(t,3,2);break;case 4:r.appendChars(t,0,4),r.append("00000"),r.append(t[4]);break;default:r.appendChars(t,0,5),r.append("0000"),r.append(n)}return e.length>=8&&r.append(e.charAt(7)),r.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(tc),fc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},gc=function(e){function t(t){var r=e.call(this)||this,n=null==t?null:t.get(Is.POSSIBLE_FORMATS),i=[];return null!=n&&(n.indexOf(nu.EAN_13)>-1&&i.push(new ic),n.indexOf(nu.UPC_A)>-1&&i.push(new cc),n.indexOf(nu.EAN_8)>-1&&i.push(new sc),n.indexOf(nu.UPC_E)>-1&&i.push(new hc)),0===i.length&&(i.push(new ic),i.push(new cc),i.push(new sc),i.push(new hc)),r.readers=i,r}return fc(t,e),t.prototype.decodeRow=function(e,t,r){var n,i;try{for(var o=pc(this.readers),a=o.next();!a.done;a=o.next()){var s=a.value;try{var u=s.decodeRow(e,t,r),c=u.getBarcodeFormat()===nu.EAN_13&&"0"===u.getText().charAt(0),l=null==r?null:r.get(Is.POSSIBLE_FORMATS),d=null==l||l.includes(nu.UPC_A);if(c&&d){var h=u.getRawBytes(),f=new tu(u.getText().substring(1),h,h?h.length:null,u.getResultPoints(),nu.UPC_A);return f.putAllMetadata(u.getResultMetadata()),f}return u}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Us},t.prototype.reset=function(){var e,t;try{for(var r=pc(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t}(Pu),mc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},t}return mc(t,e),t.prototype.decodeRow=function(e,t,r){var n=this.getValidRowData(t);if(!n)throw new Us;var i=this.codaBarDecodeRow(n.row);if(!i)throw new Us;return new tu(i,null,0,[new _u(n.left,e),new _u(n.right,e)],nu.CODABAR,(new Date).getTime())},t.prototype.getValidRowData=function(e){var t=e.toArray(),r=t.indexOf(!0);if(-1===r)return null;var n=t.lastIndexOf(!0);if(n<=r)return null;for(var i=[],o=(t=t.slice(r,n+1))[0],a=1,s=1;s<t.length;s++)t[s]===o?a++:(o=t[s],i.push(a),a=1);return i.push(a),i.length<23&&(i.length+1)%8!=0?null:{row:i,left:r,right:n}},t.prototype.codaBarDecodeRow=function(e){for(var t=[],r=Math.ceil(e.reduce((function(e,t){return(e+t)/2}),0));e.length>0;){var n=e.splice(0,8).splice(0,7).map((function(e){return e<r?"n":"w"})).join("");if(void 0===this.CODA_BAR_CHAR_SET[n])return null;t.push(this.CODA_BAR_CHAR_SET[n])}var i=t.join("");return this.validCodaBarString(i)?i:null},t.prototype.validCodaBarString=function(e){return/^[A-D].{1,}[A-D]$/.test(e)},t}(Pu),vc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},bc=function(e){function t(){var t=e.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=new Array(4),t.evenRoundingErrors=new Array(4),t.oddCounts=new Array(t.dataCharacterCounters.length/2),t.evenCounts=new Array(t.dataCharacterCounters.length/2),t}return vc(t,e),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,r){for(var n=0;n<r.length;n++)if(Pu.patternMatchVariance(e,r[n],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return n;throw new Us},t.count=function(e){return wu.sum(new Int32Array(e))},t.increment=function(e,t){for(var r=0,n=t[0],i=1;i<e.length;i++)t[i]>n&&(n=t[i],r=i);e[r]++},t.decrement=function(e,t){for(var r=0,n=t[0],i=1;i<e.length;i++)t[i]<n&&(n=t[i],r=i);e[r]--},t.isFinderPattern=function(e){var r,n,i=e[0]+e[1],o=i/(i+e[2]+e[3]);if(o>=t.MIN_FINDER_PATTERN_RATIO&&o<=t.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var u=wc(e),c=u.next();!c.done;c=u.next()){var l=c.value;l>s&&(s=l),l<a&&(a=l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s<10*a}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}(Pu),_c=function(){function e(e,t){this.value=e,this.checksumPortion=t}return e.prototype.getValue=function(){return this.value},e.prototype.getChecksumPortion=function(){return this.checksumPortion},e.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value&&this.checksumPortion===r.checksumPortion},e.prototype.hashCode=function(){return this.value^this.checksumPortion},e}(),Ac=function(){function e(e,t,r,n,i){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=new Array,this.resultPoints.push(new _u(r,i)),this.resultPoints.push(new _u(n,i))}return e.prototype.getValue=function(){return this.value},e.prototype.getStartEnd=function(){return this.startEnd},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.prototype.hashCode=function(){return this.value},e}(),Ec=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cc=function(){function e(){}return e.getRSSvalue=function(t,r,n){var i,o,a=0;try{for(var s=Ec(t),u=s.next();!u.done;u=s.next()){a+=u.value}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}for(var c=0,l=0,d=t.length,h=0;h<d-1;h++){var f=void 0;for(f=1,l|=1<<h;f<t[h];f++,l&=~(1<<h)){var p=e.combins(a-f-1,d-h-2);if(n&&0===l&&a-f-(d-h-1)>=d-h-1&&(p-=e.combins(a-f-(d-h),d-h-2)),d-h-1>1){for(var g=0,m=a-f-(d-h-2);m>r;m--)g+=e.combins(a-f-m-1,d-h-3);p-=g*(d-1-h)}else a-f>r&&p--;c+=p}a-=f}return c},e.combins=function(e,t){var r,n;e-t>t?(n=t,r=e-t):(n=e-t,r=t);for(var i=1,o=1,a=e;a>r;a--)i*=a,o<=n&&(i/=o,o++);for(;o<=n;)i/=o,o++;return i},e}(),xc=function(){function e(){}return e.buildBitArray=function(e){var t=2*e.length-1;null==e[e.length-1].getRightChar()&&(t-=1);for(var r=new xs(12*t),n=0,i=e[0].getRightChar().getValue(),o=11;o>=0;--o)0!=(i&1<<o)&&r.set(n),n++;for(o=1;o<e.length;++o){for(var a=e[o],s=a.getLeftChar().getValue(),u=11;u>=0;--u)0!=(s&1<<u)&&r.set(n),n++;if(null!==a.getRightChar()){var c=a.getRightChar().getValue();for(u=11;u>=0;--u)0!=(c&1<<u)&&r.set(n),n++}}return r},e}(),Sc=function(){function e(e,t){t?this.decodedInformation=null:(this.finished=e,this.decodedInformation=t)}return e.prototype.getDecodedInformation=function(){return this.decodedInformation},e.prototype.isFinished=function(){return this.finished},e}(),Ic=function(){function e(e){this.newPosition=e}return e.prototype.getNewPosition=function(){return this.newPosition},e}(),Tc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mc=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return Tc(t,e),t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t}(Ic),Dc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rc=function(e){function t(t,r,n){var i=e.call(this,t)||this;return n?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=r,i}return Dc(t,e),t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(Ic),Oc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kc=function(e){function t(t,r,n){var i=e.call(this,t)||this;if(r<0||r>10||n<0||n>10)throw new Ms;return i.firstDigit=r,i.secondDigit=n,i}return Oc(t,e),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(Ic),Nc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pc=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var r,n,i,o,a,s,u,c;if(!t)return null;if(t.length<2)throw new Us;var l=t.substring(0,2);try{for(var d=Nc(e.TWO_DIGIT_DATA_LENGTH),h=d.next();!h.done;h=d.next()){if((_=h.value)[0]===l)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,_[2],t):e.processFixedAI(2,_[1],t)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}if(t.length<3)throw new Us;var f=t.substring(0,3);try{for(var p=Nc(e.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next()){if((_=g.value)[0]===f)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,_[2],t):e.processFixedAI(3,_[1],t)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}try{for(var m=Nc(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),y=m.next();!y.done;y=m.next()){if((_=y.value)[0]===f)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,_[2],t):e.processFixedAI(4,_[1],t)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(t.length<4)throw new Us;var v=t.substring(0,4);try{for(var w=Nc(e.FOUR_DIGIT_DATA_LENGTH),b=w.next();!b.done;b=w.next()){var _;if((_=b.value)[0]===v)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,_[2],t):e.processFixedAI(4,_[1],t)}}catch(e){u={error:e}}finally{try{b&&!b.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}throw new Us},e.processFixedAI=function(t,r,n){if(n.length<t)throw new Us;var i=n.substring(0,t);if(n.length<t+r)throw new Us;var o=n.substring(t,t+r),a=n.substring(t+r),s="("+i+")"+o,u=e.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},e.processVariableAI=function(t,r,n){var i,o=n.substring(0,t);i=n.length<t+r?n.length:t+r;var a=n.substring(t,i),s=n.substring(i),u="("+o+")"+a,c=e.parseFieldsInGeneralPurpose(s);return null==c?u:u+c},e.VARIABLE_LENGTH=[],e.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",e.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",e.VARIABLE_LENGTH,20],["22",e.VARIABLE_LENGTH,29],["30",e.VARIABLE_LENGTH,8],["37",e.VARIABLE_LENGTH,8],["90",e.VARIABLE_LENGTH,30],["91",e.VARIABLE_LENGTH,30],["92",e.VARIABLE_LENGTH,30],["93",e.VARIABLE_LENGTH,30],["94",e.VARIABLE_LENGTH,30],["95",e.VARIABLE_LENGTH,30],["96",e.VARIABLE_LENGTH,30],["97",e.VARIABLE_LENGTH,3],["98",e.VARIABLE_LENGTH,30],["99",e.VARIABLE_LENGTH,30]],e.THREE_DIGIT_DATA_LENGTH=[["240",e.VARIABLE_LENGTH,30],["241",e.VARIABLE_LENGTH,30],["242",e.VARIABLE_LENGTH,6],["250",e.VARIABLE_LENGTH,30],["251",e.VARIABLE_LENGTH,30],["253",e.VARIABLE_LENGTH,17],["254",e.VARIABLE_LENGTH,20],["400",e.VARIABLE_LENGTH,30],["401",e.VARIABLE_LENGTH,30],["402",17],["403",e.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",e.VARIABLE_LENGTH,20],["421",e.VARIABLE_LENGTH,15],["422",3],["423",e.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",e.VARIABLE_LENGTH,15],["391",e.VARIABLE_LENGTH,18],["392",e.VARIABLE_LENGTH,15],["393",e.VARIABLE_LENGTH,18],["703",e.VARIABLE_LENGTH,30]],e.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",e.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",e.VARIABLE_LENGTH,20],["8003",e.VARIABLE_LENGTH,30],["8004",e.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",e.VARIABLE_LENGTH,30],["8008",e.VARIABLE_LENGTH,12],["8018",18],["8020",e.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",e.VARIABLE_LENGTH,70],["8200",e.VARIABLE_LENGTH,70]],e}(),Bc=function(){function e(e){this.buffer=new Fs,this.information=e}return e.prototype.decodeAllCodes=function(e,t){for(var r=t,n=null;;){var i=this.decodeGeneralPurposeField(r,n),o=Pc.parseFieldsInGeneralPurpose(i.getNewString());if(null!=o&&e.append(o),n=i.isRemaining()?""+i.getRemainingValue():null,r===i.getNewPosition())break;r=i.getNewPosition()}return e.toString()},e.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)},e.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return new kc(this.information.getSize(),0===t?kc.FNC1:t-1,kc.FNC1)}var r=this.extractNumericValueFromBitArray(e,7);return new kc(e+7,(r-8)/11,(r-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,r){return e.extractNumericValueFromBitArray(this.information,t,r)},e.extractNumericValueFromBitArray=function(e,t,r){for(var n=0,i=0;i<r;++i)e.get(t+i)&&(n|=1<<r-i-1);return n},e.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),null!=t&&this.buffer.append(t),this.current.setPosition(e);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new Rc(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new Rc(this.current.getPosition(),this.buffer.toString())},e.prototype.parseBlocks=function(){var e,t;do{var r=this.current.getPosition();if(e=this.current.isAlpha()?(t=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(t=this.parseIsoIec646Block()).isFinished():(t=this.parseNumericBlock()).isFinished(),!(r!==this.current.getPosition())&&!e)break}while(!e);return t.getDecodedInformation()},e.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var t=void 0;return t=e.isSecondDigitFNC1()?new Rc(this.current.getPosition(),this.buffer.toString()):new Rc(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new Sc(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){t=new Rc(this.current.getPosition(),this.buffer.toString());return new Sc(!0,t)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Sc(!1)},e.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var t=new Rc(this.current.getPosition(),this.buffer.toString());return new Sc(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Sc(!1)},e.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var t=new Rc(this.current.getPosition(),this.buffer.toString());return new Sc(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Sc(!1)},e.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,8);return n>=232&&n<253},e.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new Mc(e+5,Mc.FNC1);if(t>=5&&t<15)return new Mc(e+5,"0"+(t-5));var r,n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Mc(e+7,""+(n+1));if(n>=90&&n<116)return new Mc(e+7,""+(n+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Ms}return new Mc(e+8,r)},e.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},e.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new Mc(e+5,Mc.FNC1);if(t>=5&&t<15)return new Mc(e+5,"0"+(t-5));var r,n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Mc(e+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new mu("Decoding invalid alphanumeric value: "+n)}return new Mc(e+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+e<this.information.getSize();++t)if(2===t){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0},e.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0},e.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0},e}(),Fc=function(){function e(e){this.information=e,this.generalDecoder=new Bc(e)}return e.prototype.getInformation=function(){return this.information},e.prototype.getGeneralDecoder=function(){return this.generalDecoder},e}(),Lc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zc=function(e){function t(t){return e.call(this,t)||this}return Lc(t,e),t.prototype.encodeCompressedGtin=function(e,t){e.append("(01)");var r=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,t,r)},t.prototype.encodeCompressedGtinWithoutAI=function(e,r,n){for(var i=0;i<4;++i){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*i,10);o/100==0&&e.append("0"),o/10==0&&e.append("0"),e.append(o)}t.appendCheckDigit(e,n)},t.appendCheckDigit=function(e,t){for(var r=0,n=0;n<13;n++){var i=e.charAt(n+t).charCodeAt(0)-"0".charCodeAt(0);r+=0==(1&n)?3*i:i}10===(r=10-r%10)&&(r=0),e.append(r)},t.GTIN_SIZE=40,t}(Fc),Uc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jc=function(e){function t(t){return e.call(this,t)||this}return Uc(t,e),t.prototype.parseInformation=function(){var e=new Fs;e.append("(01)");var r=e.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(n),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(zc),Vc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hc=function(e){function t(t){return e.call(this,t)||this}return Vc(t,e),t.prototype.parseInformation=function(){var e=new Fs;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(Fc),Gc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qc=function(e){function t(t){return e.call(this,t)||this}return Gc(t,e),t.prototype.encodeCompressedWeight=function(e,t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t,r);this.addWeightCode(e,n);for(var i=this.checkWeight(n),o=1e5,a=0;a<5;++a)i/o==0&&e.append("0"),o/=10;e.append(i)},t}(zc),Wc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kc=function(e){function t(t){return e.call(this,t)||this}return Wc(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+qc.GTIN_SIZE+t.WEIGHT_SIZE)throw new Us;var e=new Fs;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+qc.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(qc),Xc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yc=function(e){function t(t){return e.call(this,t)||this}return Xc(t,e),t.prototype.addWeightCode=function(e,t){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t}(Kc),Zc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jc=function(e){function t(t){return e.call(this,t)||this}return Zc(t,e),t.prototype.addWeightCode=function(e,t){t<1e4?e.append("(3202)"):e.append("(3203)")},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(Kc),$c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qc=function(e){function t(t){return e.call(this,t)||this}return $c(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+zc.GTIN_SIZE)throw new Us;var e=new Fs;this.encodeCompressedGtin(e,t.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+zc.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(r),e.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+zc.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(n.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(zc),el=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tl=function(e){function t(t){return e.call(this,t)||this}return el(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+zc.GTIN_SIZE)throw new Us;var e=new Fs;this.encodeCompressedGtin(e,t.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+zc.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(r),e.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+zc.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);n/100==0&&e.append("0"),n/10==0&&e.append("0"),e.append(n);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+zc.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(zc),rl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nl=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dateCode=n,i.firstAIdigits=r,i}return rl(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new Us;var e=new Fs;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,t.DATE_SIZE);if(38400!==n){e.append("("),e.append(this.dateCode),e.append(")");var i=n%32,o=(n/=32)%12+1,a=n/=12;a/10==0&&e.append("0"),e.append(a),o/10==0&&e.append("0"),e.append(o),i/10==0&&e.append("0"),e.append(i)}},t.prototype.addWeightCode=function(e,t){e.append("("),e.append(this.firstAIdigits),e.append(t/1e5),e.append(")")},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(qc);var il=function(){function e(e,t,r,n){this.leftchar=e,this.rightchar=t,this.finderpattern=r,this.maybeLast=n}return e.prototype.mayBeLast=function(){return this.maybeLast},e.prototype.getLeftChar=function(){return this.leftchar},e.prototype.getRightChar=function(){return this.rightchar},e.prototype.getFinderPattern=function(){return this.finderpattern},e.prototype.mustBeLast=function(){return null==this.rightchar},e.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},e.equals=function(t,r){return t instanceof e&&(e.equalsOrNull(t.leftchar,r.leftchar)&&e.equalsOrNull(t.rightchar,r.rightchar)&&e.equalsOrNull(t.finderpattern,r.finderpattern))},e.equalsOrNull=function(t,r){return null===t?null===r:e.equals(t,r)},e.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},e}(),ol=function(){function e(e,t,r){this.pairs=e,this.rowNumber=t,this.wasReversed=r}return e.prototype.getPairs=function(){return this.pairs},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.isReversed=function(){return this.wasReversed},e.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},e.prototype.toString=function(){return"{ "+this.pairs+" }"},e.prototype.equals=function(t,r){return t instanceof e&&(this.checkEqualitity(t,r)&&t.wasReversed===r.wasReversed)},e.prototype.checkEqualitity=function(e,t){var r;if(e&&t)return e.forEach((function(e,n){t.forEach((function(t){e.getLeftChar().getValue()===t.getLeftChar().getValue()&&e.getRightChar().getValue()===t.getRightChar().getValue()&&e.getFinderPatter().getValue()===t.getFinderPatter().getValue()&&(r=!0)}))})),r},e}(),al=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ul=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.pairs=new Array(t.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return al(t,e),t.prototype.decodeRow=function(e,r,n){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,r))}catch(e){}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,r))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,t){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(e){if(e instanceof Us){if(!this.pairs.length)throw new Us;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(e,!1),r){var i=this.checkRowsBoolean(!1);if(null!=i)return i;if(null!=(i=this.checkRowsBoolean(!0)))return i}throw new Us},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var t=null;try{t=this.checkRows(new Array,0)}catch(e){console.log(e)}return e&&(this.rows=this.rows.reverse()),t},t.prototype.checkRows=function(e,r){for(var n,i,o=r;o<this.rows.length;o++){var a=this.rows[o];this.pairs.length=0;try{for(var s=(n=void 0,sl(e)),u=s.next();!u.done;u=s.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var l=new Array(e);l.push(a);try{return this.checkRows(l,o+1)}catch(e){console.log(e)}}}throw new Us},t.isValidSequence=function(e){var r,n;try{for(var i=sl(t.FINDER_PATTERN_SEQUENCES),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(e.length>a.length)){for(var s=!0,u=0;u<e.length;u++)if(e[u].getFinderPattern().getValue()!==a[u]){s=!1;break}if(s)return!0}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.prototype.storeRow=function(e,r){for(var n=0,i=!1,o=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>e){o=a.isEquivalent(this.pairs);break}i=a.isEquivalent(this.pairs),n++}o||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new ol(this.pairs,e,r)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,t){var r,n,i,o,a,s;try{for(var u=sl(t),c=u.next();!c.done;c=u.next()){var l=c.value;if(l.getPairs().length!==e.length){try{for(var d=(i=void 0,sl(l.getPairs())),h=d.next();!h.done;h=d.next()){var f=h.value,p=!1;try{for(var g=(a=void 0,sl(e)),m=g.next();!m.done;m=g.next()){var y=m.value;if(il.equals(f,y)){p=!0;break}}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}p||!1}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},t.isPartialRow=function(e,t){var r,n,i,o,a,s;try{for(var u=sl(t),c=u.next();!c.done;c=u.next()){var l=c.value,d=!0;try{for(var h=(i=void 0,sl(e)),f=h.next();!f.done;f=h.next()){var p=f.value,g=!1;try{for(var m=(a=void 0,sl(l.getPairs())),y=m.next();!y.done;y=m.next()){var v=y.value;if(p.equals(v)){g=!0;break}}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!g){d=!1;break}}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}if(d)return!0}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var t=function(e){try{if(e.get(1))return new jc(e);if(!e.get(2))return new Hc(e);switch(Bc.extractNumericValueFromBitArray(e,1,4)){case 4:return new Yc(e);case 5:return new Jc(e)}switch(Bc.extractNumericValueFromBitArray(e,1,5)){case 12:return new Qc(e);case 13:return new tl(e)}switch(Bc.extractNumericValueFromBitArray(e,1,7)){case 56:return new nl(e,"310","11");case 57:return new nl(e,"320","11");case 58:return new nl(e,"310","13");case 59:return new nl(e,"320","13");case 60:return new nl(e,"310","15");case 61:return new nl(e,"320","15");case 62:return new nl(e,"310","17");case 63:return new nl(e,"320","17")}}catch(t){throw console.log(t),new mu("unknown decoder: "+e)}}(xc.buildBitArray(e)).parseInformation(),r=e[0].getFinderPattern().getResultPoints(),n=e[e.length-1].getFinderPattern().getResultPoints(),i=[r[0],r[1],n[0],n[1]];return new tu(t,null,null,i,nu.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),t=e.getLeftChar(),r=e.getRightChar();if(null===r)return!1;for(var n=r.getChecksumPortion(),i=2,o=1;o<this.pairs.size();++o){var a=this.pairs.get(o);n+=a.getLeftChar().getChecksumPortion(),i++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),i++)}return 211*(i-4)+(n%=211)===t.getValue()},t.getNextSecondBar=function(e,t){var r;return e.get(t)?(r=e.getNextUnset(t),r=e.getNextSet(r)):(r=e.getNextSet(t),r=e.getNextUnset(r)),r},t.prototype.retrieveNextPair=function(e,r,n){var i,o=r.length%2==0;this.startFromEven&&(o=!o);var a=!0,s=-1;do{this.findNextPair(e,r,s),null===(i=this.parseFoundFinderPattern(e,n,o))?s=t.getNextSecondBar(e,this.startEnd[0]):a=!1}while(a);var u,c=this.decodeDataCharacter(e,i,o,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new Us;try{u=this.decodeDataCharacter(e,i,o,!1)}catch(e){u=null,console.log(e)}return new il(c,u,i,!0)},t.prototype.isEmptyPair=function(e){return 0===e.length},t.prototype.findNextPair=function(e,r,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var o,a=e.getSize();if(n>=0)o=n;else if(this.isEmptyPair(r))o=0;else{o=r[r.length-1].getFinderPattern().getStartEnd()[1]}var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;o<a&&(u=!e.get(o));)o++;for(var c=0,l=o,d=o;d<a;d++)if(e.get(d)!==u)i[c]++;else{if(3===c){if(s&&t.reverseCounters(i),t.isFinderPattern(i))return this.startEnd[0]=l,void(this.startEnd[1]=d);s&&t.reverseCounters(i),l+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,c--}else c++;i[c]=1,u=!u}throw new Us},t.reverseCounters=function(e){for(var t=e.length,r=0;r<t/2;++r){var n=e[r];e[r]=e[t-r-1],e[t-r-1]=n}},t.prototype.parseFoundFinderPattern=function(e,r,n){var i,o,a;if(n){for(var s=this.startEnd[0]-1;s>=0&&!e.get(s);)s--;s++,i=this.startEnd[0]-s,o=s,a=this.startEnd[1]}else o=this.startEnd[0],i=(a=e.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,c=this.getDecodeFinderCounters();ys.arraycopy(c,0,c,1,c.length-1),c[0]=i;try{u=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch(e){return null}return new Ac(u,[o,a],o,a,r)},t.prototype.decodeDataCharacter=function(e,r,n,i){for(var o=this.getDataCharacterCounters(),a=0;a<o.length;a++)o[a]=0;if(i)t.recordPatternInReverse(e,r.getStartEnd()[0],o);else{t.recordPattern(e,r.getStartEnd()[1],o);for(var s=0,u=o.length-1;s<u;s++,u--){var c=o[s];o[s]=o[u],o[u]=c}}var l=wu.sum(new Int32Array(o))/17,d=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(l-d)/d>.3)throw new Us;var h=this.getOddCounts(),f=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<o.length;s++){var m=1*o[s]/l,y=m+.5;if(y<1){if(m<.3)throw new Us;y=1}else if(y>8){if(m>8.7)throw new Us;y=8}var v=s/2;0==(1&s)?(h[v]=y,p[v]=m-y):(f[v]=y,g[v]=m-y)}this.adjustOddEvenCounts(17);var w=4*r.getValue()+(n?0:2)+(i?0:1)-1,b=0,_=0;for(s=h.length-1;s>=0;s--){if(t.isNotA1left(r,n,i)){var A=t.WEIGHTS[w][2*s];_+=h[s]*A}b+=h[s]}var E=0;for(s=f.length-1;s>=0;s--)if(t.isNotA1left(r,n,i)){A=t.WEIGHTS[w][2*s+1];E+=f[s]*A}var C=_+E;if(0!=(1&b)||b>13||b<4)throw new Us;var x=(13-b)/2,S=t.SYMBOL_WIDEST[x],I=9-S,T=Cc.getRSSvalue(h,S,!0),M=Cc.getRSSvalue(f,I,!1),D=t.EVEN_TOTAL_SUBSET[x],R=t.GSUM[x];return new _c(T*D+M+R,C)},t.isNotA1left=function(e,t,r){return!(0===e.getValue()&&t&&r)},t.prototype.adjustOddEvenCounts=function(e){var r=wu.sum(new Int32Array(this.getOddCounts())),n=wu.sum(new Int32Array(this.getEvenCounts())),i=!1,o=!1;r>13?o=!0:r<4&&(i=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-e,c=1==(1&r),l=0==(1&n);if(1===u)if(c){if(l)throw new Us;o=!0}else{if(!l)throw new Us;s=!0}else if(-1===u)if(c){if(l)throw new Us;i=!0}else{if(!l)throw new Us;a=!0}else{if(0!==u)throw new Us;if(c){if(!l)throw new Us;r<n?(i=!0,s=!0):(o=!0,a=!0)}else if(l)throw new Us}if(i){if(o)throw new Us;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Us;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],t.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t}(bc),cl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ll=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.count=0,i.finderPattern=n,i}return cl(t,e),t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(_c),dl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return dl(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a,s,u=this.decodePair(r,!1,e,n);t.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,e,n);t.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var l=hl(this.possibleLeftPairs),d=l.next();!d.done;d=l.next()){var h=d.value;if(h.getCount()>1)try{for(var f=(a=void 0,hl(this.possibleRightPairs)),p=f.next();!p.done;p=f.next()){var g=p.value;if(g.getCount()>1&&t.checkChecksum(h,g))return t.constructResult(h,g)}}catch(e){a={error:e}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}throw new Us},t.addOrTally=function(e,t){var r,n;if(null!=t){var i=!1;try{for(var o=hl(e),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.getValue()===t.getValue()){s.incrementCount(),i=!0;break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}i||e.push(t)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,t){for(var r=4537077*e.getValue()+t.getValue(),n=new String(r).toString(),i=new Fs,o=13-n.length;o>0;o--)i.append("0");i.append(n);var a=0;for(o=0;o<13;o++){var s=i.charAt(o).charCodeAt(0)-"0".charCodeAt(0);a+=0==(1&o)?3*s:s}10===(a=10-a%10)&&(a=0),i.append(a.toString());var u=e.getFinderPattern().getResultPoints(),c=t.getFinderPattern().getResultPoints();return new tu(i.toString(),null,0,[u[0],u[1],c[0],c[1]],nu.RSS_14,(new Date).getTime())},t.checkChecksum=function(e,t){var r=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,n=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},t.prototype.decodePair=function(e,t,r,n){try{var i=this.findFinderPattern(e,t),o=this.parseFoundFinderPattern(e,r,t,i),a=null==n?null:n.get(Is.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(i[0]+i[1])/2;t&&(s=e.getSize()-1-s),a.foundPossibleResultPoint(new _u(s,r))}var u=this.decodeDataCharacter(e,o,!0),c=this.decodeDataCharacter(e,o,!1);return new ll(1597*u.getValue()+c.getValue(),u.getChecksumPortion()+4*c.getChecksumPortion(),o)}catch(e){return null}},t.prototype.decodeDataCharacter=function(e,r,n){for(var i=this.getDataCharacterCounters(),o=0;o<i.length;o++)i[o]=0;if(n)Pu.recordPatternInReverse(e,r.getStartEnd()[0],i);else{Pu.recordPattern(e,r.getStartEnd()[1]+1,i);for(var a=0,s=i.length-1;a<s;a++,s--){var u=i[a];i[a]=i[s],i[s]=u}}var c=n?16:15,l=wu.sum(new Int32Array(i))/c,d=this.getOddCounts(),h=this.getEvenCounts(),f=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors();for(a=0;a<i.length;a++){var g=i[a]/l,m=Math.floor(g+.5);m<1?m=1:m>8&&(m=8);var y=Math.floor(a/2);0==(1&a)?(d[y]=m,f[y]=g-m):(h[y]=m,p[y]=g-m)}this.adjustOddEvenCounts(n,c);var v=0,w=0;for(a=d.length-1;a>=0;a--)w*=9,w+=d[a],v+=d[a];var b=0,_=0;for(a=h.length-1;a>=0;a--)b*=9,b+=h[a],_+=h[a];var A=w+3*b;if(n){if(0!=(1&v)||v>12||v<4)throw new Us;var E=(12-v)/2,C=9-(M=t.OUTSIDE_ODD_WIDEST[E]),x=Cc.getRSSvalue(d,M,!1),S=Cc.getRSSvalue(h,C,!0),I=t.OUTSIDE_EVEN_TOTAL_SUBSET[E],T=t.OUTSIDE_GSUM[E];return new _c(x*I+S+T,A)}if(0!=(1&_)||_>10||_<4)throw new Us;E=(10-_)/2,C=9-(M=t.INSIDE_ODD_WIDEST[E]),x=Cc.getRSSvalue(d,M,!0),S=Cc.getRSSvalue(h,C,!1);var M,D=t.INSIDE_ODD_TOTAL_SUBSET[E];T=t.INSIDE_GSUM[E];return new _c(S*D+x+T,A)},t.prototype.findFinderPattern=function(e,t){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=e.getSize(),i=!1,o=0;o<n&&t!==(i=!e.get(o));)o++;for(var a=0,s=o,u=o;u<n;u++)if(e.get(u)!==i)r[a]++;else{if(3===a){if(bc.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,i=!i}throw new Us},t.prototype.parseFoundFinderPattern=function(e,r,n,i){for(var o=e.get(i[0]),a=i[0]-1;a>=0&&o!==e.get(a);)a--;a++;var s=i[0]-a,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);ys.arraycopy(u,0,c,1,u.length-1),c[0]=s;var l=this.parseFinderValue(c,t.FINDER_PATTERNS),d=a,h=i[1];return n&&(d=e.getSize()-1-d,h=e.getSize()-1-h),new Ac(l,[a,i[1]],d,h,r)},t.prototype.adjustOddEvenCounts=function(e,t){var r=wu.sum(new Int32Array(this.getOddCounts())),n=wu.sum(new Int32Array(this.getEvenCounts())),i=!1,o=!1,a=!1,s=!1;e?(r>12?o=!0:r<4&&(i=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?o=!0:r<5&&(i=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-t,c=(1&r)==(e?1:0),l=1==(1&n);if(1===u)if(c){if(l)throw new Us;o=!0}else{if(!l)throw new Us;s=!0}else if(-1===u)if(c){if(l)throw new Us;i=!0}else{if(!l)throw new Us;a=!0}else{if(0!==u)throw new Us;if(c){if(!l)throw new Us;r<n?(i=!0,s=!0):(o=!0,a=!0)}else if(l)throw new Us}if(i){if(o)throw new Us;bc.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&bc.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Us;bc.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&bc.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],t}(bc),pl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gl=function(e){function t(t){var r=e.call(this)||this;r.readers=[];var n=t?t.get(Is.POSSIBLE_FORMATS):null,i=t&&void 0!==t.get(Is.ASSUME_CODE_39_CHECK_DIGIT),o=t&&void 0!==t.get(Is.ENABLE_CODE_39_EXTENDED_MODE);return n&&((n.includes(nu.EAN_13)||n.includes(nu.UPC_A)||n.includes(nu.EAN_8)||n.includes(nu.UPC_E))&&r.readers.push(new gc(t)),n.includes(nu.CODE_39)&&r.readers.push(new Uu(i,o)),n.includes(nu.CODE_93)&&r.readers.push(new Hu),n.includes(nu.CODE_128)&&r.readers.push(new Fu),n.includes(nu.ITF)&&r.readers.push(new Wu),n.includes(nu.CODABAR)&&r.readers.push(new yc),n.includes(nu.RSS_14)&&r.readers.push(new fl),n.includes(nu.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new ul))),0===r.readers.length&&(r.readers.push(new gc(t)),r.readers.push(new Uu),r.readers.push(new Hu),r.readers.push(new gc(t)),r.readers.push(new Fu),r.readers.push(new Wu),r.readers.push(new fl)),r}return pl(t,e),t.prototype.decodeRow=function(e,t,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(e,t,r)}catch(e){}throw new Us},t.prototype.reset=function(){this.readers.forEach((function(e){return e.reset()}))},t}(Pu),ml=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return void 0===t&&(t=500),e.call(this,new gl(r),t,r)||this}ml(t,e)}(eu);var yl,vl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wl=function(){function e(e,t,r){this.ecCodewords=e,this.ecBlocks=[t],r&&this.ecBlocks.push(r)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),bl=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),_l=function(){function e(e,t,r,n,i,o){var a,s;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=i,this.ecBlocks=o;var u=0,c=o.getECCodewords(),l=o.getECBlocks();try{for(var d=vl(l),h=d.next();!h.done;h=d.next()){var f=h.value;u+=f.getCount()*(f.getDataCodewords()+c)}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}this.totalCodewords=u}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,r){var n,i;if(0!=(1&t)||0!=(1&r))throw new Ms;try{for(var o=vl(e.VERSIONS),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===r)return s}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Ms},e.prototype.toString=function(){return""+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new wl(5,new bl(1,3))),new e(2,12,12,10,10,new wl(7,new bl(1,5))),new e(3,14,14,12,12,new wl(10,new bl(1,8))),new e(4,16,16,14,14,new wl(12,new bl(1,12))),new e(5,18,18,16,16,new wl(14,new bl(1,18))),new e(6,20,20,18,18,new wl(18,new bl(1,22))),new e(7,22,22,20,20,new wl(20,new bl(1,30))),new e(8,24,24,22,22,new wl(24,new bl(1,36))),new e(9,26,26,24,24,new wl(28,new bl(1,44))),new e(10,32,32,14,14,new wl(36,new bl(1,62))),new e(11,36,36,16,16,new wl(42,new bl(1,86))),new e(12,40,40,18,18,new wl(48,new bl(1,114))),new e(13,44,44,20,20,new wl(56,new bl(1,144))),new e(14,48,48,22,22,new wl(68,new bl(1,174))),new e(15,52,52,24,24,new wl(42,new bl(2,102))),new e(16,64,64,14,14,new wl(56,new bl(2,140))),new e(17,72,72,16,16,new wl(36,new bl(4,92))),new e(18,80,80,18,18,new wl(48,new bl(4,114))),new e(19,88,88,20,20,new wl(56,new bl(4,144))),new e(20,96,96,22,22,new wl(68,new bl(4,174))),new e(21,104,104,24,24,new wl(56,new bl(6,136))),new e(22,120,120,18,18,new wl(68,new bl(6,175))),new e(23,132,132,20,20,new wl(62,new bl(8,163))),new e(24,144,144,22,22,new wl(62,new bl(8,156),new bl(2,155))),new e(25,8,18,6,16,new wl(7,new bl(1,5))),new e(26,8,32,6,14,new wl(11,new bl(1,10))),new e(27,12,26,10,24,new wl(14,new bl(1,16))),new e(28,12,36,10,16,new wl(18,new bl(1,22))),new e(29,16,36,14,16,new wl(24,new bl(1,32))),new e(30,16,48,14,22,new wl(28,new bl(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),Al=function(){function e(t){var r=t.getHeight();if(r<8||r>144||0!=(1&r))throw new Ms;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new Ls(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(e){var t=e.getHeight(),r=e.getWidth();return _l.getVersionForDimensions(t,r)},e.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,r=4,n=0,i=this.mappingBitMatrix.getHeight(),o=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,c=!1;do{if(r!==i||0!==n||a)if(r!==i-2||0!==n||0==(3&o)||s)if(r!==i+4||2!==n||0!=(7&o)||u)if(r!==i-2||0!==n||4!=(7&o)||c){do{r<i&&n>=0&&!this.readMappingMatrix.get(n,r)&&(e[t++]=255&this.readUtah(r,n,i,o)),r-=2,n+=2}while(r>=0&&n<o);r+=1,n+=3;do{r>=0&&n<o&&!this.readMappingMatrix.get(n,r)&&(e[t++]=255&this.readUtah(r,n,i,o)),r+=2,n-=2}while(r<i&&n>=0);r+=3,n+=1}else e[t++]=255&this.readCorner4(i,o),r-=2,n+=2,c=!0;else e[t++]=255&this.readCorner3(i,o),r-=2,n+=2,u=!0;else e[t++]=255&this.readCorner2(i,o),r-=2,n+=2,s=!0;else e[t++]=255&this.readCorner1(i,o),r-=2,n+=2,a=!0}while(r<i||n<o);if(t!==this.version.getTotalCodewords())throw new Ms;return e},e.prototype.readModule=function(e,t,r,n){return e<0&&(e+=r,t+=4-(r+4&7)),t<0&&(t+=n,e+=4-(n+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},e.prototype.readUtah=function(e,t,r,n){var i=0;return this.readModule(e-2,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e-2,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t,r,n)&&(i|=1),i<<=1,this.readModule(e,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e,t,r,n)&&(i|=1),i},e.prototype.readCorner1=function(e,t){var r=0;return this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,1,e,t)&&(r|=1),r<<=1,this.readModule(e-1,2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(2,t-1,e,t)&&(r|=1),r<<=1,this.readModule(3,t-1,e,t)&&(r|=1),r},e.prototype.readCorner2=function(e,t){var r=0;return this.readModule(e-3,0,e,t)&&(r|=1),r<<=1,this.readModule(e-2,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(0,t-4,e,t)&&(r|=1),r<<=1,this.readModule(0,t-3,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r},e.prototype.readCorner3=function(e,t){var r=0;return this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(0,t-3,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-3,e,t)&&(r|=1),r<<=1,this.readModule(1,t-2,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r},e.prototype.readCorner4=function(e,t){var r=0;return this.readModule(e-3,0,e,t)&&(r|=1),r<<=1,this.readModule(e-2,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(2,t-1,e,t)&&(r|=1),r<<=1,this.readModule(3,t-1,e,t)&&(r|=1),r},e.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new hs("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),o=t/n|0,a=r/i|0,s=new Ls(a*i,o*n),u=0;u<o;++u)for(var c=u*n,l=0;l<a;++l)for(var d=l*i,h=0;h<n;++h)for(var f=u*(n+2)+1+h,p=c+h,g=0;g<i;++g){var m=l*(i+2)+1+g;if(e.get(m,f)){var y=d+g;s.set(y,p)}}return s},e}(),El=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cl=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,r){var n,i,o,a,s=r.getECBlocks(),u=0,c=s.getECBlocks();try{for(var l=El(c),d=l.next();!d.done;d=l.next()){u+=(m=d.value).getCount()}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var h=new Array(u),f=0;try{for(var p=El(c),g=p.next();!g.done;g=p.next())for(var m=g.value,y=0;y<m.getCount();y++){var v=m.getDataCodewords(),w=s.getECCodewords()+v;h[f++]=new e(v,new Uint8Array(w))}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}var b=h[0].codewords.length-s.getECCodewords(),_=b-1,A=0;for(y=0;y<_;y++)for(var E=0;E<f;E++)h[E].codewords[y]=t[A++];var C=24===r.getVersionNumber(),x=C?8:f;for(E=0;E<x;E++)h[E].codewords[b-1]=t[A++];var S=h[0].codewords.length;for(y=b;y<S;y++)for(E=0;E<f;E++){var I=C?(E+8)%f:E,T=C&&I>7?y-1:y;h[I].codewords[T]=t[A++]}if(A!==t.length)throw new hs;return h},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),xl=function(){function e(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new hs(""+e);var t=0,r=this.bitOffset,n=this.byteOffset,i=this.bytes;if(r>0){var o=8-r,a=e<o?e:o,s=255>>8-a<<(u=o-a);t=(i[n]&s)>>u,e-=a,8===(r+=a)&&(r=0,n++)}if(e>0){for(;e>=8;)t=t<<8|255&i[n],n++,e-=8;if(e>0){var u;s=255>>(u=8-e)<<u;t=t<<e|(i[n]&s)>>u,r+=e}}return this.bitOffset=r,this.byteOffset=n,t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();!function(e){e[e.PAD_ENCODE=0]="PAD_ENCODE",e[e.ASCII_ENCODE=1]="ASCII_ENCODE",e[e.C40_ENCODE=2]="C40_ENCODE",e[e.TEXT_ENCODE=3]="TEXT_ENCODE",e[e.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",e[e.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",e[e.BASE256_ENCODE=6]="BASE256_ENCODE"}(yl||(yl={}));var Sl,Il=function(){function e(){}return e.decode=function(e){var t=new xl(e),r=new Fs,n=new Fs,i=new Array,o=yl.ASCII_ENCODE;do{if(o===yl.ASCII_ENCODE)o=this.decodeAsciiSegment(t,r,n);else{switch(o){case yl.C40_ENCODE:this.decodeC40Segment(t,r);break;case yl.TEXT_ENCODE:this.decodeTextSegment(t,r);break;case yl.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,r);break;case yl.EDIFACT_ENCODE:this.decodeEdifactSegment(t,r);break;case yl.BASE256_ENCODE:this.decodeBase256Segment(t,r,i);break;default:throw new Ms}o=yl.ASCII_ENCODE}}while(o!==yl.PAD_ENCODE&&t.available()>0);return n.length()>0&&r.append(n.toString()),new au(e,r.toString(),0===i.length?null:i,null)},e.decodeAsciiSegment=function(e,t,r){var n=!1;do{var i=e.readBits(8);if(0===i)throw new Ms;if(i<=128)return n&&(i+=128),t.append(String.fromCharCode(i-1)),yl.ASCII_ENCODE;if(129===i)return yl.PAD_ENCODE;if(i<=229){var o=i-130;o<10&&t.append("0"),t.append(""+o)}else switch(i){case 230:return yl.C40_ENCODE;case 231:return yl.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:t.append("[)>05"),r.insert(0,"");break;case 237:t.append("[)>06"),r.insert(0,"");break;case 238:return yl.ANSIX12_ENCODE;case 239:return yl.TEXT_ENCODE;case 240:return yl.EDIFACT_ENCODE;default:if(254!==i||0!==e.available())throw new Ms}}while(e.available()>0);return yl.ASCII_ENCODE},e.decodeC40Segment=function(e,t){var r=!1,n=[],i=0;do{if(8===e.available())return;var o=e.readBits(8);if(254===o)return;this.parseTwoBytes(o,e.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(i){case 0:if(s<3)i=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new Ms;var u=this.C40_BASIC_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}break;case 1:r?(t.append(String.fromCharCode(s+128)),r=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){u=this.C40_SHIFT2_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}else switch(s){case 27:t.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Ms}i=0;break;case 3:r?(t.append(String.fromCharCode(s+224)),r=!1):t.append(String.fromCharCode(s+96)),i=0;break;default:throw new Ms}}}while(e.available()>0)},e.decodeTextSegment=function(e,t){var r=!1,n=[],i=0;do{if(8===e.available())return;var o=e.readBits(8);if(254===o)return;this.parseTwoBytes(o,e.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(i){case 0:if(s<3)i=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new Ms;var u=this.TEXT_BASIC_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}break;case 1:r?(t.append(String.fromCharCode(s+128)),r=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){u=this.TEXT_SHIFT2_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}else switch(s){case 27:t.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Ms}i=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new Ms;u=this.TEXT_SHIFT3_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u),i=0;break;default:throw new Ms}}}while(e.available()>0)},e.decodeAnsiX12Segment=function(e,t){var r=[];do{if(8===e.available())return;var n=e.readBits(8);if(254===n)return;this.parseTwoBytes(n,e.readBits(8),r);for(var i=0;i<3;i++){var o=r[i];switch(o){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(o<14)t.append(String.fromCharCode(o+44));else{if(!(o<40))throw new Ms;t.append(String.fromCharCode(o+51))}}}}while(e.available()>0)},e.parseTwoBytes=function(e,t,r){var n=(e<<8)+t-1,i=Math.floor(n/1600);r[0]=i,n-=1600*i,i=Math.floor(n/40),r[1]=i,r[2]=n-40*i},e.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var n=e.readBits(6);if(31===n){var i=8-e.getBitOffset();return void(8!==i&&e.readBits(i))}0==(32&n)&&(n|=64),t.append(String.fromCharCode(n))}}while(e.available()>0)},e.decodeBase256Segment=function(e,t,r){var n,i=1+e.getByteOffset(),o=this.unrandomize255State(e.readBits(8),i++);if((n=0===o?e.available()/8|0:o<250?o:250*(o-249)+this.unrandomize255State(e.readBits(8),i++))<0)throw new Ms;for(var a=new Uint8Array(n),s=0;s<n;s++){if(e.available()<8)throw new Ms;a[s]=this.unrandomize255State(e.readBits(8),i++)}r.push(a);try{t.append(Ps.decode(a,Bs.ISO88591))}catch(e){throw new mu("Platform does not support required encoding: "+e.message)}},e.unrandomize255State=function(e,t){var r=e-(149*t%255+1);return r>=0?r:r+256},e.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],e.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],e.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],e}(),Tl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ml=function(){function e(){this.rsDecoder=new yu(hu.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(e){var t,r,n=new Al(e),i=n.getVersion(),o=n.readCodewords(),a=Cl.getDataBlocks(o,i),s=0;try{for(var u=Tl(a),c=u.next();!c.done;c=u.next()){s+=c.value.getNumDataCodewords()}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}for(var l=new Uint8Array(s),d=a.length,h=0;h<d;h++){var f=a[h],p=f.getCodewords(),g=f.getNumDataCodewords();this.correctErrors(p,g);for(var m=0;m<g;m++)l[m*d+h]=p[m]}return Il.decode(l)},e.prototype.correctErrors=function(e,t){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-t)}catch(e){throw new gs}for(var n=0;n<t;n++)e[n]=r[n]},e}(),Dl=function(){function e(e){this.image=e,this.rectangleDetector=new xu(this.image)}return e.prototype.detect=function(){var t=this.rectangleDetector.detect(),r=this.detectSolid1(t);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new Us;var n=(r=this.shiftToModuleCenter(r))[0],i=r[1],o=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(o,a)+1;1==(1&s)&&(s+=1),1==(1&u)&&(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var c=e.sampleGrid(this.image,n,i,o,a,s,u);return new Au(c,[n,i,o,a])},e.shiftPoint=function(e,t,r){var n=(t.getX()-e.getX())/(r+1),i=(t.getY()-e.getY())/(r+1);return new _u(e.getX()+n,e.getY()+i)},e.moveAway=function(e,t,r){var n=e.getX(),i=e.getY();return n<t?n-=1:n+=1,i<r?i-=1:i+=1,new _u(n,i)},e.prototype.detectSolid1=function(e){var t=e[0],r=e[1],n=e[3],i=e[2],o=this.transitionsBetween(t,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,i),u=this.transitionsBetween(i,t),c=o,l=[i,t,r,n];return c>a&&(c=a,l[0]=t,l[1]=r,l[2]=n,l[3]=i),c>s&&(c=s,l[0]=r,l[1]=n,l[2]=i,l[3]=t),c>u&&(l[0]=n,l[1]=i,l[2]=t,l[3]=r),l},e.prototype.detectSolid2=function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(r,o),s=e.shiftPoint(n,i,4*(a+1)),u=e.shiftPoint(i,n,4*(a+1));return this.transitionsBetween(s,r)<this.transitionsBetween(u,o)?(t[0]=r,t[1]=n,t[2]=i,t[3]=o):(t[0]=n,t[1]=i,t[2]=o,t[3]=r),t},e.prototype.correctTopRight=function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(r,o),s=this.transitionsBetween(n,o),u=e.shiftPoint(r,n,4*(s+1)),c=e.shiftPoint(i,n,4*(a+1));a=this.transitionsBetween(u,o),s=this.transitionsBetween(c,o);var l=new _u(o.getX()+(i.getX()-n.getX())/(a+1),o.getY()+(i.getY()-n.getY())/(a+1)),d=new _u(o.getX()+(r.getX()-n.getX())/(s+1),o.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(l)?this.isValid(d)?this.transitionsBetween(u,l)+this.transitionsBetween(c,l)>this.transitionsBetween(u,d)+this.transitionsBetween(c,d)?l:d:l:this.isValid(d)?d:null},e.prototype.shiftToModuleCenter=function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(r,o)+1,s=this.transitionsBetween(i,o)+1,u=e.shiftPoint(r,n,4*s),c=e.shiftPoint(i,n,4*a);1==(1&(a=this.transitionsBetween(u,o)+1))&&(a+=1),1==(1&(s=this.transitionsBetween(c,o)+1))&&(s+=1);var l,d,h=(r.getX()+n.getX()+i.getX()+o.getX())/4,f=(r.getY()+n.getY()+i.getY()+o.getY())/4;return r=e.moveAway(r,h,f),n=e.moveAway(n,h,f),i=e.moveAway(i,h,f),o=e.moveAway(o,h,f),u=e.shiftPoint(r,n,4*s),u=e.shiftPoint(u,o,4*a),l=e.shiftPoint(n,r,4*s),l=e.shiftPoint(l,i,4*a),c=e.shiftPoint(i,o,4*s),c=e.shiftPoint(c,n,4*a),d=e.shiftPoint(o,i,4*s),[u,l,c,d=e.shiftPoint(d,r,4*a)]},e.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},e.sampleGrid=function(e,t,r,n,i,o,a){return Du.getInstance().sampleGrid(e,o,a,.5,.5,o-.5,.5,o-.5,a-.5,.5,a-.5,t.getX(),t.getY(),i.getX(),i.getY(),n.getX(),n.getY(),r.getX(),r.getY())},e.prototype.transitionsBetween=function(e,t){var r=Math.trunc(e.getX()),n=Math.trunc(e.getY()),i=Math.trunc(t.getX()),o=Math.trunc(t.getY()),a=Math.abs(o-n)>Math.abs(i-r);if(a){var s=r;r=n,n=s,s=i,i=o,o=s}for(var u=Math.abs(i-r),c=Math.abs(o-n),l=-u/2,d=n<o?1:-1,h=r<i?1:-1,f=0,p=this.image.get(a?n:r,a?r:n),g=r,m=n;g!==i;g+=h){var y=this.image.get(a?m:g,a?g:m);if(y!==p&&(f++,p=y),(l+=c)>0){if(m===o)break;m+=d,l-=u}}return f},e}(),Rl=function(){function e(){this.decoder=new Ml}return e.prototype.decode=function(t,r){var n,i;if(void 0===r&&(r=null),null!=r&&r.has(Is.PURE_BARCODE)){var o=e.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(o),i=e.NO_POINTS}else{var a=new Dl(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),i=a.getPoints()}var s=n.getRawBytes(),u=new tu(n.getText(),s,8*s.length,i,nu.DATA_MATRIX,ys.currentTimeMillis()),c=n.getByteSegments();null!=c&&u.putMetadata(ou.BYTE_SEGMENTS,c);var l=n.getECLevel();return null!=l&&u.putMetadata(ou.ERROR_CORRECTION_LEVEL,l),u},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(null==t||null==r)throw new Us;var n=this.moduleSize(t,e),i=t[1],o=r[1],a=t[0],s=(r[0]-a+1)/n,u=(o-i+1)/n;if(s<=0||u<=0)throw new Us;var c=n/2;i+=c,a+=c;for(var l=new Ls(s,u),d=0;d<u;d++)for(var h=i+d*n,f=0;f<s;f++)e.get(a+f*n,h)&&l.set(f,d);return l},e.moduleSize=function(e,t){for(var r=t.getWidth(),n=e[0],i=e[1];n<r&&t.get(n,i);)n++;if(n===r)throw new Us;var o=n-e[0];if(0===o)throw new Us;return o},e.NO_POINTS=[],e}(),Ol=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new Rl,t)||this}Ol(t,e)}(eu),function(e){e[e.L=0]="L",e[e.M=1]="M",e[e.Q=2]="Q",e[e.H=3]="H"}(Sl||(Sl={}));var kl,Nl=function(){function e(t,r,n){this.value=t,this.stringValue=r,this.bits=n,e.FOR_BITS.set(n,this),e.FOR_VALUE.set(t,this)}return e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.fromString=function(t){switch(t){case"L":return e.L;case"M":return e.M;case"Q":return e.Q;case"H":return e.H;default:throw new ls(t+"not available")}},e.prototype.toString=function(){return this.stringValue},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.forBits=function(t){if(t<0||t>=e.FOR_BITS.size)throw new hs;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(Sl.L,"L",1),e.M=new e(Sl.M,"M",0),e.Q=new e(Sl.Q,"Q",3),e.H=new e(Sl.H,"H",2),e}(),Pl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bl=function(){function e(e){this.errorCorrectionLevel=Nl.forBits(e>>3&3),this.dataMask=7&e}return e.numBitsDiffering=function(e,t){return Cs.bitCount(e^t)},e.decodeFormatInformation=function(t,r){var n=e.doDecodeFormatInformation(t,r);return null!==n?n:e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,r^e.FORMAT_INFO_MASK_QR)},e.doDecodeFormatInformation=function(t,r){var n,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Pl(e.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,l=c[0];if(l===t||l===r)return new e(c[1]);var d=e.numBitsDiffering(t,l);d<o&&(a=c[1],o=d),t!==r&&(d=e.numBitsDiffering(r,l))<o&&(a=c[1],o=d)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o<=3?new e(a):null},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask},e.FORMAT_INFO_MASK_QR=21522,e.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],e}(),Fl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ll=function(){function e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=t}return e.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},e.prototype.getNumBlocks=function(){var e,t,r=0,n=this.ecBlocks;try{for(var i=Fl(n),o=i.next();!o.done;o=i.next()){r+=o.value.getCount()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),zl=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),Ul=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},jl=function(){function e(e,t){for(var r,n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=i;var a=0,s=i[0].getECCodewordsPerBlock(),u=i[0].getECBlocks();try{for(var c=Ul(u),l=c.next();!l.done;l=c.next()){var d=l.value;a+=d.getCount()*(d.getDataCodewords()+s)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.totalCodewords=a}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},e.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},e.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new Ms;try{return this.getVersionForNumber((e-17)/4)}catch(e){throw new Ms}},e.getVersionForNumber=function(t){if(t<1||t>40)throw new hs;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var r=Number.MAX_SAFE_INTEGER,n=0,i=0;i<e.VERSION_DECODE_INFO.length;i++){var o=e.VERSION_DECODE_INFO[i];if(o===t)return e.getVersionForNumber(i+7);var a=Bl.numBitsDiffering(t,o);a<r&&(n=i+7,r=a)}return r<=3?e.getVersionForNumber(n):null},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new Ls(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var i=this.alignmentPatternCenters[n]-2,o=0;o<r;o++)0===n&&(0===o||o===r-1)||n===r-1&&0===o||t.setRegion(this.alignmentPatternCenters[o]-2,i,5,5);return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},e.prototype.toString=function(){return""+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array(0),new Ll(7,new zl(1,19)),new Ll(10,new zl(1,16)),new Ll(13,new zl(1,13)),new Ll(17,new zl(1,9))),new e(2,Int32Array.from([6,18]),new Ll(10,new zl(1,34)),new Ll(16,new zl(1,28)),new Ll(22,new zl(1,22)),new Ll(28,new zl(1,16))),new e(3,Int32Array.from([6,22]),new Ll(15,new zl(1,55)),new Ll(26,new zl(1,44)),new Ll(18,new zl(2,17)),new Ll(22,new zl(2,13))),new e(4,Int32Array.from([6,26]),new Ll(20,new zl(1,80)),new Ll(18,new zl(2,32)),new Ll(26,new zl(2,24)),new Ll(16,new zl(4,9))),new e(5,Int32Array.from([6,30]),new Ll(26,new zl(1,108)),new Ll(24,new zl(2,43)),new Ll(18,new zl(2,15),new zl(2,16)),new Ll(22,new zl(2,11),new zl(2,12))),new e(6,Int32Array.from([6,34]),new Ll(18,new zl(2,68)),new Ll(16,new zl(4,27)),new Ll(24,new zl(4,19)),new Ll(28,new zl(4,15))),new e(7,Int32Array.from([6,22,38]),new Ll(20,new zl(2,78)),new Ll(18,new zl(4,31)),new Ll(18,new zl(2,14),new zl(4,15)),new Ll(26,new zl(4,13),new zl(1,14))),new e(8,Int32Array.from([6,24,42]),new Ll(24,new zl(2,97)),new Ll(22,new zl(2,38),new zl(2,39)),new Ll(22,new zl(4,18),new zl(2,19)),new Ll(26,new zl(4,14),new zl(2,15))),new e(9,Int32Array.from([6,26,46]),new Ll(30,new zl(2,116)),new Ll(22,new zl(3,36),new zl(2,37)),new Ll(20,new zl(4,16),new zl(4,17)),new Ll(24,new zl(4,12),new zl(4,13))),new e(10,Int32Array.from([6,28,50]),new Ll(18,new zl(2,68),new zl(2,69)),new Ll(26,new zl(4,43),new zl(1,44)),new Ll(24,new zl(6,19),new zl(2,20)),new Ll(28,new zl(6,15),new zl(2,16))),new e(11,Int32Array.from([6,30,54]),new Ll(20,new zl(4,81)),new Ll(30,new zl(1,50),new zl(4,51)),new Ll(28,new zl(4,22),new zl(4,23)),new Ll(24,new zl(3,12),new zl(8,13))),new e(12,Int32Array.from([6,32,58]),new Ll(24,new zl(2,92),new zl(2,93)),new Ll(22,new zl(6,36),new zl(2,37)),new Ll(26,new zl(4,20),new zl(6,21)),new Ll(28,new zl(7,14),new zl(4,15))),new e(13,Int32Array.from([6,34,62]),new Ll(26,new zl(4,107)),new Ll(22,new zl(8,37),new zl(1,38)),new Ll(24,new zl(8,20),new zl(4,21)),new Ll(22,new zl(12,11),new zl(4,12))),new e(14,Int32Array.from([6,26,46,66]),new Ll(30,new zl(3,115),new zl(1,116)),new Ll(24,new zl(4,40),new zl(5,41)),new Ll(20,new zl(11,16),new zl(5,17)),new Ll(24,new zl(11,12),new zl(5,13))),new e(15,Int32Array.from([6,26,48,70]),new Ll(22,new zl(5,87),new zl(1,88)),new Ll(24,new zl(5,41),new zl(5,42)),new Ll(30,new zl(5,24),new zl(7,25)),new Ll(24,new zl(11,12),new zl(7,13))),new e(16,Int32Array.from([6,26,50,74]),new Ll(24,new zl(5,98),new zl(1,99)),new Ll(28,new zl(7,45),new zl(3,46)),new Ll(24,new zl(15,19),new zl(2,20)),new Ll(30,new zl(3,15),new zl(13,16))),new e(17,Int32Array.from([6,30,54,78]),new Ll(28,new zl(1,107),new zl(5,108)),new Ll(28,new zl(10,46),new zl(1,47)),new Ll(28,new zl(1,22),new zl(15,23)),new Ll(28,new zl(2,14),new zl(17,15))),new e(18,Int32Array.from([6,30,56,82]),new Ll(30,new zl(5,120),new zl(1,121)),new Ll(26,new zl(9,43),new zl(4,44)),new Ll(28,new zl(17,22),new zl(1,23)),new Ll(28,new zl(2,14),new zl(19,15))),new e(19,Int32Array.from([6,30,58,86]),new Ll(28,new zl(3,113),new zl(4,114)),new Ll(26,new zl(3,44),new zl(11,45)),new Ll(26,new zl(17,21),new zl(4,22)),new Ll(26,new zl(9,13),new zl(16,14))),new e(20,Int32Array.from([6,34,62,90]),new Ll(28,new zl(3,107),new zl(5,108)),new Ll(26,new zl(3,41),new zl(13,42)),new Ll(30,new zl(15,24),new zl(5,25)),new Ll(28,new zl(15,15),new zl(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new Ll(28,new zl(4,116),new zl(4,117)),new Ll(26,new zl(17,42)),new Ll(28,new zl(17,22),new zl(6,23)),new Ll(30,new zl(19,16),new zl(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new Ll(28,new zl(2,111),new zl(7,112)),new Ll(28,new zl(17,46)),new Ll(30,new zl(7,24),new zl(16,25)),new Ll(24,new zl(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new Ll(30,new zl(4,121),new zl(5,122)),new Ll(28,new zl(4,47),new zl(14,48)),new Ll(30,new zl(11,24),new zl(14,25)),new Ll(30,new zl(16,15),new zl(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new Ll(30,new zl(6,117),new zl(4,118)),new Ll(28,new zl(6,45),new zl(14,46)),new Ll(30,new zl(11,24),new zl(16,25)),new Ll(30,new zl(30,16),new zl(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new Ll(26,new zl(8,106),new zl(4,107)),new Ll(28,new zl(8,47),new zl(13,48)),new Ll(30,new zl(7,24),new zl(22,25)),new Ll(30,new zl(22,15),new zl(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new Ll(28,new zl(10,114),new zl(2,115)),new Ll(28,new zl(19,46),new zl(4,47)),new Ll(28,new zl(28,22),new zl(6,23)),new Ll(30,new zl(33,16),new zl(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new Ll(30,new zl(8,122),new zl(4,123)),new Ll(28,new zl(22,45),new zl(3,46)),new Ll(30,new zl(8,23),new zl(26,24)),new Ll(30,new zl(12,15),new zl(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new Ll(30,new zl(3,117),new zl(10,118)),new Ll(28,new zl(3,45),new zl(23,46)),new Ll(30,new zl(4,24),new zl(31,25)),new Ll(30,new zl(11,15),new zl(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new Ll(30,new zl(7,116),new zl(7,117)),new Ll(28,new zl(21,45),new zl(7,46)),new Ll(30,new zl(1,23),new zl(37,24)),new Ll(30,new zl(19,15),new zl(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new Ll(30,new zl(5,115),new zl(10,116)),new Ll(28,new zl(19,47),new zl(10,48)),new Ll(30,new zl(15,24),new zl(25,25)),new Ll(30,new zl(23,15),new zl(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new Ll(30,new zl(13,115),new zl(3,116)),new Ll(28,new zl(2,46),new zl(29,47)),new Ll(30,new zl(42,24),new zl(1,25)),new Ll(30,new zl(23,15),new zl(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new Ll(30,new zl(17,115)),new Ll(28,new zl(10,46),new zl(23,47)),new Ll(30,new zl(10,24),new zl(35,25)),new Ll(30,new zl(19,15),new zl(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new Ll(30,new zl(17,115),new zl(1,116)),new Ll(28,new zl(14,46),new zl(21,47)),new Ll(30,new zl(29,24),new zl(19,25)),new Ll(30,new zl(11,15),new zl(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new Ll(30,new zl(13,115),new zl(6,116)),new Ll(28,new zl(14,46),new zl(23,47)),new Ll(30,new zl(44,24),new zl(7,25)),new Ll(30,new zl(59,16),new zl(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new Ll(30,new zl(12,121),new zl(7,122)),new Ll(28,new zl(12,47),new zl(26,48)),new Ll(30,new zl(39,24),new zl(14,25)),new Ll(30,new zl(22,15),new zl(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new Ll(30,new zl(6,121),new zl(14,122)),new Ll(28,new zl(6,47),new zl(34,48)),new Ll(30,new zl(46,24),new zl(10,25)),new Ll(30,new zl(2,15),new zl(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new Ll(30,new zl(17,122),new zl(4,123)),new Ll(28,new zl(29,46),new zl(14,47)),new Ll(30,new zl(49,24),new zl(10,25)),new Ll(30,new zl(24,15),new zl(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new Ll(30,new zl(4,122),new zl(18,123)),new Ll(28,new zl(13,46),new zl(32,47)),new Ll(30,new zl(48,24),new zl(14,25)),new Ll(30,new zl(42,15),new zl(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new Ll(30,new zl(20,117),new zl(4,118)),new Ll(28,new zl(40,47),new zl(7,48)),new Ll(30,new zl(43,24),new zl(22,25)),new Ll(30,new zl(10,15),new zl(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new Ll(30,new zl(19,118),new zl(6,119)),new Ll(28,new zl(18,47),new zl(31,48)),new Ll(30,new zl(34,24),new zl(34,25)),new Ll(30,new zl(20,15),new zl(61,16)))],e}();!function(e){e[e.DATA_MASK_000=0]="DATA_MASK_000",e[e.DATA_MASK_001=1]="DATA_MASK_001",e[e.DATA_MASK_010=2]="DATA_MASK_010",e[e.DATA_MASK_011=3]="DATA_MASK_011",e[e.DATA_MASK_100=4]="DATA_MASK_100",e[e.DATA_MASK_101=5]="DATA_MASK_101",e[e.DATA_MASK_110=6]="DATA_MASK_110",e[e.DATA_MASK_111=7]="DATA_MASK_111"}(kl||(kl={}));var Vl,Hl=function(){function e(e,t){this.value=e,this.isMasked=t}return e.prototype.unmaskBitMatrix=function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)this.isMasked(r,n)&&e.flip(n,r)},e.values=new Map([[kl.DATA_MASK_000,new e(kl.DATA_MASK_000,(function(e,t){return 0==(e+t&1)}))],[kl.DATA_MASK_001,new e(kl.DATA_MASK_001,(function(e,t){return 0==(1&e)}))],[kl.DATA_MASK_010,new e(kl.DATA_MASK_010,(function(e,t){return t%3==0}))],[kl.DATA_MASK_011,new e(kl.DATA_MASK_011,(function(e,t){return(e+t)%3==0}))],[kl.DATA_MASK_100,new e(kl.DATA_MASK_100,(function(e,t){return 0==(Math.floor(e/2)+Math.floor(t/3)&1)}))],[kl.DATA_MASK_101,new e(kl.DATA_MASK_101,(function(e,t){return e*t%6==0}))],[kl.DATA_MASK_110,new e(kl.DATA_MASK_110,(function(e,t){return e*t%6<3}))],[kl.DATA_MASK_111,new e(kl.DATA_MASK_111,(function(e,t){return 0==(e+t+e*t%3&1)}))]]),e}(),Gl=function(){function e(e){var t=e.getHeight();if(t<21||1!=(3&t))throw new Ms;this.bitMatrix=e}return e.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var r=5;r>=0;r--)e=this.copyBit(8,r,e);var n=this.bitMatrix.getHeight(),i=0,o=n-7;for(r=n-1;r>=o;r--)i=this.copyBit(8,r,i);for(t=n-8;t<n;t++)i=this.copyBit(t,8,i);if(this.parsedFormatInfo=Bl.decodeFormatInformation(e,i),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new Ms},e.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return jl.getVersionForNumber(t);for(var r=0,n=e-11,i=5;i>=0;i--)for(var o=e-9;o>=n;o--)r=this.copyBit(o,i,r);var a=jl.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===e)return this.parsedVersion=a,a;r=0;for(o=5;o>=0;o--)for(i=e-9;i>=n;i--)r=this.copyBit(o,i,r);if(null!==(a=jl.decodeVersionInformation(r))&&a.getDimensionForVersion()===e)return this.parsedVersion=a,a;throw new Ms},e.prototype.copyBit=function(e,t,r){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?r<<1|1:r<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),r=Hl.values.get(e.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var i=t.buildFunctionPattern(),o=!0,a=new Uint8Array(t.getTotalCodewords()),s=0,u=0,c=0,l=n-1;l>0;l-=2){6===l&&l--;for(var d=0;d<n;d++)for(var h=o?n-1-d:d,f=0;f<2;f++)i.get(l-f,h)||(c++,u<<=1,this.bitMatrix.get(l-f,h)&&(u|=1),8===c&&(a[s++]=u,c=0,u=0));o=!o}if(s!==t.getTotalCodewords())throw new Ms;return a},e.prototype.remask=function(){if(null!==this.parsedFormatInfo){var e=Hl.values.get(this.parsedFormatInfo.getDataMask()),t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}},e.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},e.prototype.mirror=function(){for(var e=this.bitMatrix,t=0,r=e.getWidth();t<r;t++)for(var n=t+1,i=e.getHeight();n<i;n++)e.get(t,n)!==e.get(n,t)&&(e.flip(n,t),e.flip(t,n))},e}(),ql=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wl=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,r,n){var i,o,a,s;if(t.length!==r.getTotalCodewords())throw new hs;var u=r.getECBlocksForLevel(n),c=0,l=u.getECBlocks();try{for(var d=ql(l),h=d.next();!h.done;h=d.next()){c+=(y=h.value).getCount()}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var f=new Array(c),p=0;try{for(var g=ql(l),m=g.next();!m.done;m=g.next())for(var y=m.value,v=0;v<y.getCount();v++){var w=y.getDataCodewords(),b=u.getECCodewordsPerBlock()+w;f[p++]=new e(w,new Uint8Array(b))}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var _=f[0].codewords.length,A=f.length-1;A>=0;){if(f[A].codewords.length===_)break;A--}A++;var E=_-u.getECCodewordsPerBlock(),C=0;for(v=0;v<E;v++)for(var x=0;x<p;x++)f[x].codewords[v]=t[C++];for(x=A;x<p;x++)f[x].codewords[E]=t[C++];var S=f[0].codewords.length;for(v=E;v<S;v++)for(x=0;x<p;x++){var I=x<A?v:v+1;f[x].codewords[I]=t[C++]}return f},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}();!function(e){e[e.TERMINATOR=0]="TERMINATOR",e[e.NUMERIC=1]="NUMERIC",e[e.ALPHANUMERIC=2]="ALPHANUMERIC",e[e.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",e[e.BYTE=4]="BYTE",e[e.ECI=5]="ECI",e[e.KANJI=6]="KANJI",e[e.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",e[e.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",e[e.HANZI=9]="HANZI"}(Vl||(Vl={}));var Kl,Xl,Yl=function(){function e(t,r,n,i){this.value=t,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=i,e.FOR_BITS.set(i,this),e.FOR_VALUE.set(t,this)}return e.forBits=function(t){var r=e.FOR_BITS.get(t);if(void 0===r)throw new hs;return r},e.prototype.getCharacterCountBits=function(e){var t,r=e.getVersionNumber();return t=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[t]},e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.prototype.toString=function(){return this.stringValue},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.TERMINATOR=new e(Vl.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),e.NUMERIC=new e(Vl.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),e.ALPHANUMERIC=new e(Vl.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),e.STRUCTURED_APPEND=new e(Vl.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),e.BYTE=new e(Vl.BYTE,"BYTE",Int32Array.from([8,16,16]),4),e.ECI=new e(Vl.ECI,"ECI",Int32Array.from([0,0,0]),7),e.KANJI=new e(Vl.KANJI,"KANJI",Int32Array.from([8,10,12]),8),e.FNC1_FIRST_POSITION=new e(Vl.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),e.FNC1_SECOND_POSITION=new e(Vl.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),e.HANZI=new e(Vl.HANZI,"HANZI",Int32Array.from([8,10,12]),13),e}(),Zl=function(){function e(){}return e.decode=function(t,r,n,i){var o=new xl(t),a=new Fs,s=new Array,u=-1,c=-1;try{var l=null,d=!1,h=void 0;do{if(o.available()<4)h=Yl.TERMINATOR;else{var f=o.readBits(4);h=Yl.forBits(f)}switch(h){case Yl.TERMINATOR:break;case Yl.FNC1_FIRST_POSITION:case Yl.FNC1_SECOND_POSITION:d=!0;break;case Yl.STRUCTURED_APPEND:if(o.available()<16)throw new Ms;u=o.readBits(8),c=o.readBits(8);break;case Yl.ECI:var p=e.parseECIValue(o);if(null===(l=Os.getCharacterSetECIByValue(p)))throw new Ms;break;case Yl.HANZI:var g=o.readBits(4),m=o.readBits(h.getCharacterCountBits(r));g===e.GB2312_SUBSET&&e.decodeHanziSegment(o,a,m);break;default:var y=o.readBits(h.getCharacterCountBits(r));switch(h){case Yl.NUMERIC:e.decodeNumericSegment(o,a,y);break;case Yl.ALPHANUMERIC:e.decodeAlphanumericSegment(o,a,y,d);break;case Yl.BYTE:e.decodeByteSegment(o,a,y,l,s,i);break;case Yl.KANJI:e.decodeKanjiSegment(o,a,y);break;default:throw new Ms}}}while(h!==Yl.TERMINATOR)}catch(e){throw new Ms}return new au(t,a.toString(),0===s.length?null:s,null===n?null:n.toString(),u,c)},e.decodeHanziSegment=function(e,t,r){if(13*r>e.available())throw new Ms;for(var n=new Uint8Array(2*r),i=0;r>0;){var o=e.readBits(13),a=o/96<<8&4294967295|o%96;a+=a<959?41377:42657,n[i]=a>>8&255,n[i+1]=255&a,i+=2,r--}try{t.append(Ps.decode(n,Bs.GB2312))}catch(e){throw new Ms(e)}},e.decodeKanjiSegment=function(e,t,r){if(13*r>e.available())throw new Ms;for(var n=new Uint8Array(2*r),i=0;r>0;){var o=e.readBits(13),a=o/192<<8&4294967295|o%192;a+=a<7936?33088:49472,n[i]=a>>8,n[i+1]=a,i+=2,r--}try{t.append(Ps.decode(n,Bs.SHIFT_JIS))}catch(e){throw new Ms(e)}},e.decodeByteSegment=function(e,t,r,n,i,o){if(8*r>e.available())throw new Ms;for(var a,s=new Uint8Array(r),u=0;u<r;u++)s[u]=e.readBits(8);a=null===n?Bs.guessEncoding(s,o):n.getName();try{t.append(Ps.decode(s,a))}catch(e){throw new Ms(e)}i.push(s)},e.toAlphaNumericChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new Ms;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,r,n,i){for(var o=r.length();n>1;){if(t.available()<11)throw new Ms;var a=t.readBits(11);r.append(e.toAlphaNumericChar(Math.floor(a/45))),r.append(e.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(t.available()<6)throw new Ms;r.append(e.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=o;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},e.decodeNumericSegment=function(t,r,n){for(;n>=3;){if(t.available()<10)throw new Ms;var i=t.readBits(10);if(i>=1e3)throw new Ms;r.append(e.toAlphaNumericChar(Math.floor(i/100))),r.append(e.toAlphaNumericChar(Math.floor(i/10)%10)),r.append(e.toAlphaNumericChar(i%10)),n-=3}if(2===n){if(t.available()<7)throw new Ms;var o=t.readBits(7);if(o>=100)throw new Ms;r.append(e.toAlphaNumericChar(Math.floor(o/10))),r.append(e.toAlphaNumericChar(o%10))}else if(1===n){if(t.available()<4)throw new Ms;var a=t.readBits(4);if(a>=10)throw new Ms;r.append(e.toAlphaNumericChar(a))}},e.parseECIValue=function(e){var t=e.readBits(8);if(0==(128&t))return 127&t;if(128==(192&t))return(63&t)<<8&4294967295|e.readBits(8);if(192==(224&t))return(31&t)<<16&4294967295|e.readBits(16);throw new Ms},e.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.GB2312_SUBSET=1,e}(),Jl=function(){function e(e){this.mirrored=e}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(e){if(this.mirrored&&null!==e&&!(e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},e}(),$l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ql=function(){function e(){this.rsDecoder=new yu(hu.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(Ls.parseFromBooleanArray(e),t)},e.prototype.decodeBitMatrix=function(e,t){var r=new Gl(e),n=null;try{return this.decodeBitMatrixParser(r,t)}catch(e){n=e}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,t);return i.setOther(new Jl(!0)),i}catch(e){if(null!==n)throw n;throw e}},e.prototype.decodeBitMatrixParser=function(e,t){var r,n,i,o,a=e.readVersion(),s=e.readFormatInformation().getErrorCorrectionLevel(),u=e.readCodewords(),c=Wl.getDataBlocks(u,a,s),l=0;try{for(var d=$l(c),h=d.next();!h.done;h=d.next()){l+=(y=h.value).getNumDataCodewords()}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}var f=new Uint8Array(l),p=0;try{for(var g=$l(c),m=g.next();!m.done;m=g.next()){var y,v=(y=m.value).getCodewords(),w=y.getNumDataCodewords();this.correctErrors(v,w);for(var b=0;b<w;b++)f[p++]=v[b]}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}return Zl.decode(f,a,s,t)},e.prototype.correctErrors=function(e,t){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-t)}catch(e){throw new gs}for(var n=0;n<t;n++)e[n]=r[n]},e}(),ed=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),td=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.estimatedModuleSize=n,i}return ed(t,e),t.prototype.aboutEquals=function(e,t,r){if(Math.abs(t-this.getY())<=e&&Math.abs(r-this.getX())<=e){var n=Math.abs(e-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,r,n){return new t((this.getX()+r)/2,(this.getY()+e)/2,(this.estimatedModuleSize+n)/2)},t}(_u),rd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},nd=function(){function e(e,t,r,n,i,o,a){this.image=e,this.startX=t,this.startY=r,this.width=n,this.height=i,this.moduleSize=o,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var e=this.startX,t=this.height,r=e+this.width,n=this.startY+t/2,i=new Int32Array(3),o=this.image,a=0;a<t;a++){var s=n+(0==(1&a)?Math.floor((a+1)/2):-Math.floor((a+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var u=e;u<r&&!o.get(u,s);)u++;for(var c=0;u<r;){if(o.get(u,s))if(1===c)i[1]++;else if(2===c){var l;if(this.foundPatternCross(i))if(null!==(l=this.handlePossibleCenter(i,s,u)))return l;i[0]=i[2],i[1]=1,i[2]=0,c=1}else i[++c]++;else 1===c&&c++,i[c]++;u++}if(this.foundPatternCross(i))if(null!==(l=this.handlePossibleCenter(i,s,r)))return l}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new Us},e.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},e.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,r=t/2,n=0;n<3;n++)if(Math.abs(t-e[n])>=r)return!1;return!0},e.prototype.crossCheckVertical=function(t,r,n,i){var o=this.image,a=o.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=t;u>=0&&o.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!o.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&o.get(r,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!o.get(r,u)&&s[2]<=n;)s[2]++,u++;if(s[2]>n)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-i)>=2*i?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,u):NaN},e.prototype.handlePossibleCenter=function(t,r,n){var i,o,a=t[0]+t[1]+t[2],s=e.centerFromEnd(t,n),u=this.crossCheckVertical(r,s,2*t[1],a);if(!isNaN(u)){var c=(t[0]+t[1]+t[2])/3;try{for(var l=rd(this.possibleCenters),d=l.next();!d.done;d=l.next()){var h=d.value;if(h.aboutEquals(c,u,s))return h.combineEstimate(u,s,c)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}var f=new td(s,u,c);this.possibleCenters.push(f),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(f)}return null},e}(),id=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),od=function(e){function t(t,r,n,i){var o=e.call(this,t,r)||this;return o.estimatedModuleSize=n,o.count=i,void 0===i&&(o.count=1),o}return id(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,r){if(Math.abs(t-this.getY())<=e&&Math.abs(r-this.getX())<=e){var n=Math.abs(e-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,r,n){var i=this.count+1;return new t((this.count*this.getX()+r)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+n)/i,i)},t}(_u),ad=function(){function e(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),sd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ud=function(){function e(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var r=null!=t&&void 0!==t.get(Is.TRY_HARDER),n=null!=t&&void 0!==t.get(Is.PURE_BARCODE),i=this.image,o=i.getHeight(),a=i.getWidth(),s=Math.floor(3*o/(4*e.MAX_MODULES));(s<e.MIN_SKIP||r)&&(s=e.MIN_SKIP);for(var u=!1,c=new Int32Array(5),l=s-1;l<o&&!u;l+=s){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;for(var d=0,h=0;h<a;h++)if(i.get(h,l))1==(1&d)&&d++,c[d]++;else if(0==(1&d))if(4===d)if(e.foundPatternCross(c)){if(!0!==this.handlePossibleCenter(c,l,h,n)){c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,d=3;continue}if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var f=this.findRowSkip();f>c[2]&&(l+=f-c[2]-s,h=a-1)}d=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,d=3;else c[++d]++;else c[d]++;if(e.foundPatternCross(c))!0===this.handlePossibleCenter(c,l,a,n)&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return _u.orderBestPatterns(p),new ad(p)},e.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.foundPatternCross=function(e){for(var t=0,r=0;r<5;r++){var n=e[r];if(0===n)return!1;t+=n}if(t<7)return!1;var i=t/7,o=i/2;return Math.abs(i-e[0])<o&&Math.abs(i-e[1])<o&&Math.abs(3*i-e[2])<3*o&&Math.abs(i-e[3])<o&&Math.abs(i-e[4])<o},e.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},e.prototype.crossCheckDiagonal=function(t,r,n,i){for(var o=this.getCrossCheckStateCount(),a=0,s=this.image;t>=a&&r>=a&&s.get(r-a,t-a);)o[2]++,a++;if(t<a||r<a)return!1;for(;t>=a&&r>=a&&!s.get(r-a,t-a)&&o[1]<=n;)o[1]++,a++;if(t<a||r<a||o[1]>n)return!1;for(;t>=a&&r>=a&&s.get(r-a,t-a)&&o[0]<=n;)o[0]++,a++;if(o[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(a=1;t+a<u&&r+a<c&&s.get(r+a,t+a);)o[2]++,a++;if(t+a>=u||r+a>=c)return!1;for(;t+a<u&&r+a<c&&!s.get(r+a,t+a)&&o[3]<n;)o[3]++,a++;if(t+a>=u||r+a>=c||o[3]>=n)return!1;for(;t+a<u&&r+a<c&&s.get(r+a,t+a)&&o[4]<n;)o[4]++,a++;if(o[4]>=n)return!1;var l=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(l-i)<2*i&&e.foundPatternCross(o)},e.prototype.crossCheckVertical=function(t,r,n,i){for(var o=this.image,a=o.getHeight(),s=this.getCrossCheckStateCount(),u=t;u>=0&&o.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!o.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&o.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&o.get(r,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!o.get(r,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&o.get(r,u)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-i)>=2*i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,u):NaN},e.prototype.crossCheckHorizontal=function(t,r,n,i){for(var o=this.image,a=o.getWidth(),s=this.getCrossCheckStateCount(),u=t;u>=0&&o.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!o.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&o.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&o.get(u,r);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!o.get(u,r)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&o.get(u,r)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-i)>=i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,u):NaN},e.prototype.handlePossibleCenter=function(t,r,n,i){var o=t[0]+t[1]+t[2]+t[3]+t[4],a=e.centerFromEnd(t,n),s=this.crossCheckVertical(r,Math.floor(a),t[2],o);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],o),!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],o)))){for(var u=o/7,c=!1,l=this.possibleCenters,d=0,h=l.length;d<h;d++){var f=l[d];if(f.aboutEquals(u,s,a)){l[d]=f.combineEstimate(s,a,u),c=!0;break}}if(!c){var p=new od(a,s,u);l.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},e.prototype.findRowSkip=function(){var t,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var i=sd(this.possibleCenters),o=i.next();!o.done;o=i.next()){var a=o.value;if(a.getCount()>=e.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,r,n,i,o=0,a=0,s=this.possibleCenters.length;try{for(var u=sd(this.possibleCenters),c=u.next();!c.done;c=u.next()){(p=c.value).getCount()>=e.CENTER_QUORUM&&(o++,a+=p.getEstimatedModuleSize())}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(o<3)return!1;var l=a/s,d=0;try{for(var h=sd(this.possibleCenters),f=h.next();!f.done;f=h.next()){var p=f.value;d+=Math.abs(p.getEstimatedModuleSize()-l)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return d<=.05*a},e.prototype.selectBestPatterns=function(){var e,t,r,n,i=this.possibleCenters.length;if(i<3)throw new Us;var o,a=this.possibleCenters;if(i>3){var s=0,u=0;try{for(var c=sd(this.possibleCenters),l=c.next();!l.done;l=c.next()){var d=l.value.getEstimatedModuleSize();s+=d,u+=d*d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}o=s/i;var h=Math.sqrt(u/i-o*o);a.sort((function(e,t){var r=Math.abs(t.getEstimatedModuleSize()-o),n=Math.abs(e.getEstimatedModuleSize()-o);return r<n?-1:r>n?1:0}));for(var f=Math.max(.2*o,h),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-o)>f&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var m=sd(a),y=m.next();!y.done;y=m.next()){s+=y.value.getEstimatedModuleSize()}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}o=s/a.length,a.sort((function(e,t){if(t.getCount()===e.getCount()){var r=Math.abs(t.getEstimatedModuleSize()-o),n=Math.abs(e.getEstimatedModuleSize()-o);return r<n?1:r>n?-1:0}return t.getCount()-e.getCount()})),a.splice(3)}return[a[0],a[1],a[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),cd=function(){function e(e){this.image=e}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(e){this.resultPointCallback=null==e?null:e.get(Is.NEED_RESULT_POINT_CALLBACK);var t=new ud(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)},e.prototype.processFinderPatternInfo=function(t){var r=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),o=this.calculateModuleSize(r,n,i);if(o<1)throw new Us("No pattern found in proccess finder.");var a=e.computeDimension(r,n,i,o),s=jl.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var l=n.getX()-r.getX()+i.getX(),d=n.getY()-r.getY()+i.getY(),h=1-3/u,f=Math.floor(r.getX()+h*(l-r.getX())),p=Math.floor(r.getY()+h*(d-r.getY())),g=4;g<=16;g<<=1)try{c=this.findAlignmentInRegion(o,f,p,g);break}catch(e){if(!(e instanceof Us))throw e}var m=e.createTransform(r,n,i,c,a),y=e.sampleGrid(this.image,m,a);return new Au(y,null===c?[i,r,n]:[i,r,n,c])},e.createTransform=function(e,t,r,n,i){var o,a,s,u,c=i-3.5;return null!==n?(o=n.getX(),a=n.getY(),u=s=c-3):(o=t.getX()-e.getX()+r.getX(),a=t.getY()-e.getY()+r.getY(),s=c,u=c),Iu.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,s,u,3.5,c,e.getX(),e.getY(),t.getX(),t.getY(),o,a,r.getX(),r.getY())},e.sampleGrid=function(e,t,r){return Du.getInstance().sampleGridWithTransform(e,r,r,t)},e.computeDimension=function(e,t,r,n){var i=wu.round(_u.distance(e,t)/n),o=wu.round(_u.distance(e,r)/n),a=Math.floor((i+o)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new Us("Dimensions could be not found.")}return a},e.prototype.calculateModuleSize=function(e,t,r){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,r))/2},e.prototype.calculateModuleSizeOneWay=function(e,t){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,r,n){var i=this.sizeOfBlackWhiteBlackRun(e,t,r,n),o=1,a=e-(r-e);a<0?(o=e/(e-a),a=0):a>=this.image.getWidth()&&(o=(this.image.getWidth()-1-e)/(a-e),a=this.image.getWidth()-1);var s=Math.floor(t-(n-t)*o);return o=1,s<0?(o=t/(t-s),s=0):s>=this.image.getHeight()&&(o=(this.image.getHeight()-1-t)/(s-t),s=this.image.getHeight()-1),a=Math.floor(e+(a-e)*o),(i+=this.sizeOfBlackWhiteBlackRun(e,t,a,s))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(e,t,r,n){var i=Math.abs(n-t)>Math.abs(r-e);if(i){var o=e;e=t,t=o,o=r,r=n,n=o}for(var a=Math.abs(r-e),s=Math.abs(n-t),u=-a/2,c=e<r?1:-1,l=t<n?1:-1,d=0,h=r+c,f=e,p=t;f!==h;f+=c){var g=i?p:f,m=i?f:p;if(1===d===this.image.get(g,m)){if(2===d)return wu.distance(f,p,e,t);d++}if((u+=s)>0){if(p===n)break;p+=l,u-=a}}return 2===d?wu.distance(r+c,n,e,t):NaN},e.prototype.findAlignmentInRegion=function(e,t,r,n){var i=Math.floor(n*e),o=Math.max(0,t-i),a=Math.min(this.image.getWidth()-1,t+i);if(a-o<3*e)throw new Us("Alignment top exceeds estimated module size.");var s=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-s<3*e)throw new Us("Alignment bottom exceeds estimated module size.");return new nd(this.image,o,s,a-o,u-s,e,this.resultPointCallback).find()},e}(),ld=function(){function e(){this.decoder=new Ql}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,r){var n,i;if(null!=r&&void 0!==r.get(Is.PURE_BARCODE)){var o=e.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,r),i=e.NO_POINTS}else{var a=new cd(t.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),i=a.getPoints()}n.getOther()instanceof Jl&&n.getOther().applyMirroredCorrection(i);var s=new tu(n.getText(),n.getRawBytes(),void 0,i,nu.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(ou.BYTE_SEGMENTS,u);var c=n.getECLevel();return null!==c&&s.putMetadata(ou.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(ou.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(ou.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(null===t||null===r)throw new Us;var n=this.moduleSize(t,e),i=t[1],o=r[1],a=t[0],s=r[0];if(a>=s||i>=o)throw new Us;if(o-i!=s-a&&(s=a+(o-i))>=e.getWidth())throw new Us;var u=Math.round((s-a+1)/n),c=Math.round((o-i+1)/n);if(u<=0||c<=0)throw new Us;if(c!==u)throw new Us;var l=Math.floor(n/2);i+=l;var d=(a+=l)+Math.floor((u-1)*n)-s;if(d>0){if(d>l)throw new Us;a-=d}var h=i+Math.floor((c-1)*n)-o;if(h>0){if(h>l)throw new Us;i-=h}for(var f=new Ls(u,c),p=0;p<c;p++)for(var g=i+Math.floor(p*n),m=0;m<u;m++)e.get(a+Math.floor(m*n),g)&&f.set(m,p);return f},e.moduleSize=function(e,t){for(var r=t.getHeight(),n=t.getWidth(),i=e[0],o=e[1],a=!0,s=0;i<n&&o<r;){if(a!==t.get(i,o)){if(5==++s)break;a=!a}i++,o++}if(i===n||o===r)throw new Us;return(i-e[0])/7},e.NO_POINTS=new Array,e}(),dd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hd=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(e){return wu.sum(e)},e.toIntArray=function(t){var r,n;if(null==t||!t.length)return e.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),o=0;try{for(var a=dd(t),s=a.next();!s.done;s=a.next()){var u=s.value;i[o++]=u}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},e.getCodeword=function(t){var r=Es.binarySearch(e.SYMBOL_TABLE,262143&t);return r<0?-1:(e.CODEWORD_TABLE[r]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),fd=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),pd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},gd=function(){function e(){}return e.detectMultiple=function(t,r,n){var i=t.getBlackMatrix(),o=e.detect(n,i);return o.length||((i=i.clone()).rotate180(),o=e.detect(n,i)),new fd(i,o)},e.detect=function(t,r){for(var n,i,o=new Array,a=0,s=0,u=!1;a<r.getHeight();){var c=e.findVertices(r,a,s);if(null!=c[0]||null!=c[3]){if(u=!0,o.push(c),!t)break;null!=c[2]?(s=Math.trunc(c[2].getX()),a=Math.trunc(c[2].getY())):(s=Math.trunc(c[4].getX()),a=Math.trunc(c[4].getY()))}else{if(!u)break;u=!1,s=0;try{for(var l=(n=void 0,pd(o)),d=l.next();!d.done;d=l.next()){var h=d.value;null!=h[1]&&(a=Math.trunc(Math.max(a,h[1].getY()))),null!=h[3]&&(a=Math.max(a,Math.trunc(h[3].getY())))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}a+=e.ROW_STEP}}return o},e.findVertices=function(t,r,n){var i=t.getHeight(),o=t.getWidth(),a=new Array(8);return e.copyToResult(a,e.findRowsWithPattern(t,i,o,r,n,e.START_PATTERN),e.INDEXES_START_PATTERN),null!=a[4]&&(n=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY())),e.copyToResult(a,e.findRowsWithPattern(t,i,o,r,n,e.STOP_PATTERN),e.INDEXES_STOP_PATTERN),a},e.copyToResult=function(e,t,r){for(var n=0;n<r.length;n++)e[r[n]]=t[n]},e.findRowsWithPattern=function(t,r,n,i,o,a){for(var s=new Array(4),u=!1,c=new Int32Array(a.length);i<r;i+=e.ROW_STEP){if(null!=(f=e.findGuardPattern(t,o,i,n,!1,a,c))){for(;i>0;){if(null==(h=e.findGuardPattern(t,o,--i,n,!1,a,c))){i++;break}f=h}s[0]=new _u(f[0],i),s[1]=new _u(f[1],i),u=!0;break}}var l=i+1;if(u){for(var d=0,h=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);l<r;l++){var f;if(null!=(f=e.findGuardPattern(t,h[0],l,n,!1,a,c))&&Math.abs(h[0]-f[0])<e.MAX_PATTERN_DRIFT&&Math.abs(h[1]-f[1])<e.MAX_PATTERN_DRIFT)h=f,d=0;else{if(d>e.SKIPPED_ROW_COUNT_MAX)break;d++}}l-=d+1,s[2]=new _u(h[0],l),s[3]=new _u(h[1],l)}return l-i<e.BARCODE_MIN_HEIGHT&&Es.fill(s,null),s},e.findGuardPattern=function(t,r,n,i,o,a,s){Es.fillWithin(s,0,s.length,0);for(var u=r,c=0;t.get(u,n)&&u>0&&c++<e.MAX_PIXEL_DRIFT;)u--;for(var l=u,d=0,h=a.length,f=o;l<i;l++){if(t.get(l,n)!==f)s[d]++;else{if(d===h-1){if(e.patternMatchVariance(s,a,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return new Int32Array([u,l]);u+=s[0]+s[1],ys.arraycopy(s,2,s,0,d-1),s[d-1]=0,s[d]=0,d--}else d++;s[d]=1,f=!f}}return d===h-1&&e.patternMatchVariance(s,a,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE?new Int32Array([u,l-1]):null},e.patternMatchVariance=function(e,t,r){for(var n=e.length,i=0,o=0,a=0;a<n;a++)i+=e[a],o+=t[a];if(i<o)return 1/0;var s=i/o;r*=s;for(var u=0,c=0;c<n;c++){var l=e[c],d=t[c]*s,h=l>d?l-d:d-l;if(h>r)return 1/0;u+=h}return u/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),md=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yd=function(){function e(e,t){if(0===t.length)throw new hs;this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),ys.arraycopy(t,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){var t,r;if(0===e)return this.getCoefficient(0);if(1===e){var n=0;try{for(var i=md(this.coefficients),o=i.next();!o.done;o=i.next()){var a=o.value;n=this.field.add(n,a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}for(var s=this.coefficients[0],u=this.coefficients.length,c=1;c<u;c++)s=this.field.add(this.field.multiply(e,s),this.coefficients[c]);return s},e.prototype.add=function(t){if(!this.field.equals(t.field))throw new hs("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;var r=this.coefficients,n=t.coefficients;if(r.length>n.length){var i=r;r=n,n=i}var o=new Int32Array(n.length),a=n.length-r.length;ys.arraycopy(n,0,o,0,a);for(var s=a;s<n.length;s++)o[s]=this.field.add(r[s-a],n[s]);return new e(this.field,o)},e.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new hs("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},e.prototype.multiply=function(t){return t instanceof e?this.multiplyOther(t):this.multiplyScalar(t)},e.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new hs("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new e(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),s=0;s<n;s++)for(var u=r[s],c=0;c<o;c++)a[s+c]=this.field.add(a[s+c],this.field.multiply(u,i[c]));return new e(this.field,a)},e.prototype.negative=function(){for(var t=this.coefficients.length,r=new Int32Array(t),n=0;n<t;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new e(this.field,r)},e.prototype.multiplyScalar=function(t){if(0===t)return new e(this.field,new Int32Array([0]));if(1===t)return this;for(var r=this.coefficients.length,n=new Int32Array(r),i=0;i<r;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,n)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new hs;if(0===r)return new e(this.field,new Int32Array([0]));for(var n=this.coefficients.length,i=new Int32Array(n+t),o=0;o<n;o++)i[o]=this.field.multiply(this.coefficients[o],r);return new e(this.field,i)},e.prototype.toString=function(){for(var e=new Fs,t=this.getDegree();t>=0;t--){var r=this.getCoefficient(t);0!==r&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),0!==t&&1===r||e.append(r),0!==t&&(1===t?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()},e}(),vd=function(){function e(){}return e.prototype.add=function(e,t){return(e+t)%this.modulus},e.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(0===e)throw new hs;return this.logTable[e]},e.prototype.inverse=function(e){if(0===e)throw new lu;return this.expTable[this.modulus-this.logTable[e]-1]},e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(e){return e===this},e}(),wd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bd=function(e){function t(t,r){var n=e.call(this)||this;n.modulus=t,n.expTable=new Int32Array(t),n.logTable=new Int32Array(t);for(var i=1,o=0;o<t;o++)n.expTable[o]=i,i=i*r%t;for(o=0;o<t-1;o++)n.logTable[n.expTable[o]]=o;return n.zero=new yd(n,new Int32Array([0])),n.one=new yd(n,new Int32Array([1])),n}return wd(t,e),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new hs;if(0===t)return this.zero;var r=new Int32Array(e+1);return r[0]=t,new yd(this,r)},t.PDF417_GF=new t(hd.NUMBER_OF_CODEWORDS,3),t}(vd),_d=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ad=function(){function e(){this.field=bd.PDF417_GF}return e.prototype.decode=function(e,t,r){for(var n,i,o=new yd(this.field,e),a=new Int32Array(t),s=!1,u=t;u>0;u--){var c=o.evaluateAt(this.field.exp(u));a[t-u]=c,0!==c&&(s=!0)}if(!s)return 0;var l=this.field.getOne();if(null!=r)try{for(var d=_d(r),h=d.next();!h.done;h=d.next()){var f=h.value,p=this.field.exp(e.length-1-f),g=new yd(this.field,new Int32Array([this.field.subtract(0,p),1]));l=l.multiply(g)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var m=new yd(this.field,a),y=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),m,t),v=y[0],w=y[1],b=this.findErrorLocations(v),_=this.findErrorMagnitudes(w,v,b);for(u=0;u<b.length;u++){var A=e.length-1-this.field.log(b[u]);if(A<0)throw gs.getChecksumInstance();e[A]=this.field.subtract(e[A],_[u])}return b.length},e.prototype.runEuclideanAlgorithm=function(e,t,r){if(e.getDegree()<t.getDegree()){var n=e;e=t,t=n}for(var i=e,o=t,a=this.field.getZero(),s=this.field.getOne();o.getDegree()>=Math.round(r/2);){var u=i,c=a;if(a=s,(i=o).isZero())throw gs.getChecksumInstance();o=u;for(var l=this.field.getZero(),d=i.getCoefficient(i.getDegree()),h=this.field.inverse(d);o.getDegree()>=i.getDegree()&&!o.isZero();){var f=o.getDegree()-i.getDegree(),p=this.field.multiply(o.getCoefficient(o.getDegree()),h);l=l.add(this.field.buildMonomial(f,p)),o=o.subtract(i.multiplyByMonomial(f,p))}s=l.multiply(a).subtract(c).negative()}var g=s.getCoefficient(0);if(0===g)throw gs.getChecksumInstance();var m=this.field.inverse(g);return[s.multiply(m),o.multiply(m)]},e.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),r=new Int32Array(t),n=0,i=1;i<this.field.getSize()&&n<t;i++)0===e.evaluateAt(i)&&(r[n]=this.field.inverse(i),n++);if(n!==t)throw gs.getChecksumInstance();return r},e.prototype.findErrorMagnitudes=function(e,t,r){for(var n=t.getDegree(),i=new Int32Array(n),o=1;o<=n;o++)i[n-o]=this.field.multiply(o,t.getCoefficient(o));var a=new yd(this.field,i),s=r.length,u=new Int32Array(s);for(o=0;o<s;o++){var c=this.field.inverse(r[o]),l=this.field.subtract(0,e.evaluateAt(c)),d=this.field.inverse(a.evaluateAt(c));u[o]=this.field.multiply(l,d)}return u},e}(),Ed=function(){function e(t,r,n,i,o){t instanceof e?this.constructor_2(t):this.constructor_1(t,r,n,i,o)}return e.prototype.constructor_1=function(e,t,r,n,i){var o=null==t||null==r,a=null==n||null==i;if(o&&a)throw new Us;o?(t=new _u(0,n.getY()),r=new _u(0,i.getY())):a&&(n=new _u(e.getWidth()-1,t.getY()),i=new _u(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=t,this.bottomLeft=r,this.topRight=n,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.getY(),i.getY()))},e.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},e.merge=function(t,r){return null==t?r:null==r?t:new e(t.image,t.topLeft,t.bottomLeft,r.topRight,r.bottomRight)},e.prototype.addMissingRows=function(t,r,n){var i=this.topLeft,o=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(t>0){var u=n?this.topLeft:this.topRight,c=Math.trunc(u.getY()-t);c<0&&(c=0);var l=new _u(u.getX(),c);n?i=l:a=l}if(r>0){var d=n?this.bottomLeft:this.bottomRight,h=Math.trunc(d.getY()+r);h>=this.image.getHeight()&&(h=this.image.getHeight()-1);var f=new _u(d.getX(),h);n?o=f:s=f}return new e(this.image,i,o,a,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),Cd=function(){function e(e,t,r,n){this.columnCount=e,this.errorCorrectionLevel=n,this.rowCountUpperPart=t,this.rowCountLowerPart=r,this.rowCount=t+r}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),xd=function(){function e(){this.buffer=""}return e.form=function(e,t){var r=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,(function(e,n,i,o,a,s){if("%%"===e)return"%";if(void 0!==t[++r]){e=o?parseInt(o.substr(1)):void 0;var u,c=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=t[r];break;case"c":u=t[r][0];break;case"f":u=parseFloat(t[r]).toFixed(e);break;case"p":u=parseFloat(t[r]).toPrecision(e);break;case"e":u=parseFloat(t[r]).toExponential(e);break;case"x":u=parseInt(t[r]).toString(c||16);break;case"d":u=parseFloat(parseInt(t[r],c||10).toPrecision(e)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(c);for(var l=parseInt(i),d=i&&i[0]+""=="0"?"0":" ";u.length<l;)u=void 0!==n?u+d:d+u;return u}}))},e.prototype.format=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=e.form(t,r)},e.prototype.toString=function(){return this.buffer},e}(),Sd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Id=function(){function e(e){this.boundingBox=new Ed(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var r=this.getCodeword(t);if(null!=r)return r;for(var n=1;n<e.MAX_NEARBY_DISTANCE;n++){var i=this.imageRowToCodewordIndex(t)-n;if(i>=0&&null!=(r=this.codewords[i]))return r;if((i=this.imageRowToCodewordIndex(t)+n)<this.codewords.length&&null!=(r=this.codewords[i]))return r}return null},e.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},e.prototype.setCodeword=function(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t},e.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.getCodewords=function(){return this.codewords},e.prototype.toString=function(){var e,t,r=new xd,n=0;try{for(var i=Sd(this.codewords),o=i.next();!o.done;o=i.next()){var a=o.value;null!=a?r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue()):r.format("%3d: | %n",n++)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r.toString()},e.MAX_NEARBY_DISTANCE=5,e}(),Td=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Md=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Dd=function(){function e(){this.values=new Map}return e.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);null==t&&(t=0),t++,this.values.set(e,t)},e.prototype.getValue=function(){var e,t,r=-1,n=new Array,i=function(e,t){var i=function(){return e},o=function(){return t};o()>r?(r=o(),(n=[]).push(i())):o()===r&&n.push(i())};try{for(var o=Td(this.values.entries()),a=o.next();!a.done;a=o.next()){var s=Md(a.value,2);i(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return hd.toIntArray(n)},e.prototype.getConfidence=function(e){return this.values.get(e)},e}(),Rd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Od=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kd=function(e){function t(t,r){var n=e.call(this,t)||this;return n._isLeft=r,n}return Rd(t,e),t.prototype.setRowNumbers=function(){var e,t;try{for(var r=Od(this.getCodewords()),n=r.next();!n.done;n=r.next()){var i=n.value;null!=i&&i.setRowNumberAsRowIndicatorColumn()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=-1,u=1,c=0,l=o;l<a;l++)if(null!=t[l]){var d=t[l],h=d.getRowNumber()-s;if(0===h)c++;else if(1===h)u=Math.max(u,c),c=1,s=d.getRowNumber();else if(h<0||d.getRowNumber()>=e.getRowCount()||h>l)t[l]=null;else{for(var f=void 0,p=(f=u>2?(u-2)*h:h)>=l,g=1;g<=f&&!p;g++)p=null!=t[l-g];p?t[l]=null:(s=d.getRowNumber(),c=1)}}},t.prototype.getRowHeights=function(){var e,t,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var i=Od(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var t=this.getBoundingBox(),r=this._isLeft?t.getTopLeft():t.getTopRight(),n=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,u=i;u<o;u++)if(null!=a[u]){var c=a[u];c.setRowNumberAsRowIndicatorColumn();var l=c.getRowNumber()-s;0===l||(1===l?s=c.getRowNumber():c.getRowNumber()>=e.getRowCount()?a[u]=null:s=c.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,t,r=this.getCodewords(),n=new Dd,i=new Dd,o=new Dd,a=new Dd;try{for(var s=Od(r),u=s.next();!u.done;u=s.next()){var c=u.value;if(null!=c){c.setRowNumberAsRowIndicatorColumn();var l=c.getValue()%30,d=c.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:i.setValue(3*l+1);break;case 1:a.setValue(l/3),o.setValue(l%3);break;case 2:n.setValue(l+1)}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}if(0===n.getValue().length||0===i.getValue().length||0===o.getValue().length||0===a.getValue().length||n.getValue()[0]<1||i.getValue()[0]+o.getValue()[0]<hd.MIN_ROWS_IN_BARCODE||i.getValue()[0]+o.getValue()[0]>hd.MAX_ROWS_IN_BARCODE)return null;var h=new Cd(n.getValue()[0],i.getValue()[0],o.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,h),h},t.prototype.removeIncorrectCodewords=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(null!=e[r]){var i=n.getValue()%30,o=n.getRowNumber();if(o>t.getRowCount())e[r]=null;else switch(this._isLeft||(o+=2),o%3){case 0:3*i+1!==t.getRowCountUpperPart()&&(e[r]=null);break;case 1:Math.trunc(i/3)===t.getErrorCorrectionLevel()&&i%3===t.getRowCountLowerPart()||(e[r]=null);break;case 2:i+1!==t.getColumnCount()&&(e[r]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+e.prototype.toString.call(this)},t}(Id),Nd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pd=function(){function e(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e,t=hd.MAX_CODEWORDS_IN_BARCODE;do{e=t,t=this.adjustRowNumbersAndGetCount()}while(t>0&&t<e);return this.detectionResultColumns},e.prototype.adjustIndicatorColumnRowNumbers=function(e){null!=e&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},e.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(0===e)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var r=this.detectionResultColumns[t].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(t,n,r));return e},e.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},e.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(null!=e[r]&&null!=t[r]&&e[r].getRowNumber()===t[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var i=this.detectionResultColumns[n].getCodewords()[r];null!=i&&(i.setRowNumber(e[r].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},e.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var t=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var i=r[n].getRowNumber(),o=0,a=this.barcodeColumnCount+1;a>0&&o<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(o=e.adjustRowNumberIfValid(i,o,s),s.hasValidRowNumber()||t++)}return t},e.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var t=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var i=r[n].getRowNumber(),o=0,a=1;a<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(o=e.adjustRowNumberIfValid(i,o,s),s.hasValidRowNumber()||t++)}return t},e.adjustRowNumberIfValid=function(e,t,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),t=0):++t),t},e.prototype.adjustRowNumbers=function(t,r,n){var i,o;if(null!=this.detectionResultColumns[t-1]){var a=n[r],s=this.detectionResultColumns[t-1].getCodewords(),u=s;null!=this.detectionResultColumns[t+1]&&(u=this.detectionResultColumns[t+1].getCodewords());var c=new Array(14);c[2]=s[r],c[3]=u[r],r>0&&(c[0]=n[r-1],c[4]=s[r-1],c[5]=u[r-1]),r>1&&(c[8]=n[r-2],c[10]=s[r-2],c[11]=u[r-2]),r<n.length-1&&(c[1]=n[r+1],c[6]=s[r+1],c[7]=u[r+1]),r<n.length-2&&(c[9]=n[r+2],c[12]=s[r+2],c[13]=u[r+2]);try{for(var l=Nd(c),d=l.next();!d.done;d=l.next()){var h=d.value;if(e.adjustRowNumber(a,h))return}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}},e.adjustRowNumber=function(e,t){return null!=t&&(!(!t.hasValidRowNumber()||t.getBucket()!==e.getBucket())&&(e.setRowNumber(t.getRowNumber()),!0))},e.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},e.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},e.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},e.prototype.setBoundingBox=function(e){this.boundingBox=e},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.setDetectionResultColumn=function(e,t){this.detectionResultColumns[e]=t},e.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},e.prototype.toString=function(){var e=this.detectionResultColumns[0];null==e&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var t=new xd,r=0;r<e.getCodewords().length;r++){t.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var i=this.detectionResultColumns[n].getCodewords()[r];null!=i?t.format(" %3d|%3d",i.getRowNumber(),i.getValue()):t.format(" | ")}else t.format(" | ");t.format("%n")}return t.toString()},e}(),Bd=function(){function e(t,r,n,i){this.rowNumber=e.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),this.value=Math.trunc(i)}return e.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},e.prototype.isValidRowNumber=function(t){return t!==e.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},e.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},e.prototype.getWidth=function(){return this.endX-this.startX},e.prototype.getStartX=function(){return this.startX},e.prototype.getEndX=function(){return this.endX},e.prototype.getBucket=function(){return this.bucket},e.prototype.getValue=function(){return this.value},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.setRowNumber=function(e){this.rowNumber=e},e.prototype.toString=function(){return this.rowNumber+"|"+this.value},e.BARCODE_ROW_UNKNOWN=-1,e}(),Fd=function(){function e(){}return e.initialize=function(){for(var t=0;t<hd.SYMBOL_TABLE.length;t++)for(var r=hd.SYMBOL_TABLE[t],n=1&r,i=0;i<hd.BARS_IN_MODULE;i++){for(var o=0;(1&r)===n;)o+=1,r>>=1;n=1&r,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=new Array(hd.BARS_IN_MODULE)),e.RATIOS_TABLE[t][hd.BARS_IN_MODULE-i-1]=Math.fround(o/hd.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var r=e.getDecodedCodewordValue(e.sampleBitCounts(t));return-1!==r?r:e.getClosestDecodedValue(t)},e.sampleBitCounts=function(e){for(var t=wu.sum(e),r=new Int32Array(hd.BARS_IN_MODULE),n=0,i=0,o=0;o<hd.MODULES_IN_CODEWORD;o++){var a=t/(2*hd.MODULES_IN_CODEWORD)+o*t/hd.MODULES_IN_CODEWORD;i+e[n]<=a&&(i+=e[n],n++),r[n]++}return r},e.getDecodedCodewordValue=function(t){var r=e.getBitValue(t);return-1===hd.getCodeword(r)?-1:r},e.getBitValue=function(e){for(var t=0,r=0;r<e.length;r++)for(var n=0;n<e[r];n++)t=t<<1|(r%2==0?1:0);return Math.trunc(t)},e.getClosestDecodedValue=function(t){var r=wu.sum(t),n=new Array(hd.BARS_IN_MODULE);if(r>1)for(var i=0;i<n.length;i++)n[i]=Math.fround(t[i]/r);var o=bu.MAX_VALUE,a=-1;this.bSymbolTableReady||e.initialize();for(var s=0;s<e.RATIOS_TABLE.length;s++){for(var u=0,c=e.RATIOS_TABLE[s],l=0;l<hd.BARS_IN_MODULE;l++){var d=Math.fround(c[l]-n[l]);if((u+=Math.fround(d*d))>=o)break}u<o&&(o=u,a=hd.SYMBOL_TABLE[s])}return a},e.bSymbolTableReady=!1,e.RATIOS_TABLE=new Array(hd.SYMBOL_TABLE.length).map((function(e){return new Array(hd.BARS_IN_MODULE)})),e}(),Ld=function(){function e(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return e.prototype.getSegmentIndex=function(){return this.segmentIndex},e.prototype.setSegmentIndex=function(e){this.segmentIndex=e},e.prototype.getFileId=function(){return this.fileId},e.prototype.setFileId=function(e){this.fileId=e},e.prototype.getOptionalData=function(){return this.optionalData},e.prototype.setOptionalData=function(e){this.optionalData=e},e.prototype.isLastSegment=function(){return this.lastSegment},e.prototype.setLastSegment=function(e){this.lastSegment=e},e.prototype.getSegmentCount=function(){return this.segmentCount},e.prototype.setSegmentCount=function(e){this.segmentCount=e},e.prototype.getSender=function(){return this.sender||null},e.prototype.setSender=function(e){this.sender=e},e.prototype.getAddressee=function(){return this.addressee||null},e.prototype.setAddressee=function(e){this.addressee=e},e.prototype.getFileName=function(){return this.fileName},e.prototype.setFileName=function(e){this.fileName=e},e.prototype.getFileSize=function(){return this.fileSize},e.prototype.setFileSize=function(e){this.fileSize=e},e.prototype.getChecksum=function(){return this.checksum},e.prototype.setChecksum=function(e){this.checksum=e},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.setTimestamp=function(e){this.timestamp=e},e}(),zd=function(){function e(){}return e.parseLong=function(e,t){return void 0===t&&(t=void 0),parseInt(e,t)},e}(),Ud=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ud(t,e),t.kind="NullPointerException",t}(us),Vd=function(){function e(){}return e.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},e.prototype.writeBytesOffset=function(e,t,r){if(null==e)throw new jd;if(t<0||t>e.length||r<0||t+r>e.length||t+r<0)throw new ws;if(0!==r)for(var n=0;n<r;n++)this.write(e[t+n])},e.prototype.flush=function(){},e.prototype.close=function(){},e}(),Hd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Hd(t,e),t}(us),qd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wd=function(e){function t(t){void 0===t&&(t=32);var r=e.call(this)||this;if(r.count=0,t<0)throw new hs("Negative initial size: "+t);return r.buf=new Uint8Array(t),r}return qd(t,e),t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var t=this.buf.length<<1;if(t-e<0&&(t=e),t<0){if(e<0)throw new Gd;t=Cs.MAX_VALUE}this.buf=Es.copyOfUint8Array(this.buf,t)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,t,r){if(t<0||t>e.length||r<0||t+r-e.length>0)throw new ws;this.ensureCapacity(this.count+r),ys.arraycopy(e,t,this.buf,this.count,r),this.count+=r},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Es.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?"string"==typeof e?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(Vd);function Kd(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==wo)return wo.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function Xd(e){if(void 0===Xl&&(Xl=Kd()),null===Xl)throw new Error("BigInt is not supported!");return Xl(e)}!function(e){e[e.ALPHA=0]="ALPHA",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.PUNCT=3]="PUNCT",e[e.ALPHA_SHIFT=4]="ALPHA_SHIFT",e[e.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(Kl||(Kl={}));var Yd=function(){function e(){}return e.decode=function(t,r){var n=new Fs(""),i=Os.ISO8859_1;n.enableDecoding(i);for(var o=1,a=t[o++],s=new Ld;o<t[0];){switch(a){case e.TEXT_COMPACTION_MODE_LATCH:o=e.textCompaction(t,o,n);break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:o=e.byteCompaction(a,t,i,o,n);break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[o++]);break;case e.NUMERIC_COMPACTION_MODE_LATCH:o=e.numericCompaction(t,o,n);break;case e.ECI_CHARSET:Os.getCharacterSetECIByValue(t[o++]);break;case e.ECI_GENERAL_PURPOSE:o+=2;break;case e.ECI_USER_DEFINED:o++;break;case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=e.decodeMacroBlock(t,o,s);break;case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:throw new Ms;default:o--,o=e.textCompaction(t,o,n)}if(!(o<t.length))throw Ms.getFormatInstance();a=t[o++]}if(0===n.length())throw Ms.getFormatInstance();var u=new au(null,n.toString(),null,r);return u.setOther(s),u},e.decodeMacroBlock=function(t,r,n){if(r+e.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw Ms.getFormatInstance();for(var i=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<e.NUMBER_OF_SEQUENCE_CODEWORDS;o++,r++)i[o]=t[r];n.setSegmentIndex(Cs.parseInt(e.decodeBase900toBase10(i,e.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new Fs;r=e.textCompaction(t,r,a),n.setFileId(a.toString());var s=-1;for(t[r]===e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=r+1);r<t[0];)switch(t[r]){case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++r]){case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var u=new Fs;r=e.textCompaction(t,r+1,u),n.setFileName(u.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var c=new Fs;r=e.textCompaction(t,r+1,c),n.setSender(c.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var l=new Fs;r=e.textCompaction(t,r+1,l),n.setAddressee(l.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var d=new Fs;r=e.numericCompaction(t,r+1,d),n.setSegmentCount(Cs.parseInt(d.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var h=new Fs;r=e.numericCompaction(t,r+1,h),n.setTimestamp(zd.parseLong(h.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var f=new Fs;r=e.numericCompaction(t,r+1,f),n.setChecksum(Cs.parseInt(f.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new Fs;r=e.numericCompaction(t,r+1,p),n.setFileSize(zd.parseLong(p.toString()));break;default:throw Ms.getFormatInstance()}break;case e.MACRO_PDF417_TERMINATOR:r++,n.setLastSegment(!0);break;default:throw Ms.getFormatInstance()}if(-1!==s){var g=r-s;n.isLastSegment()&&g--,n.setOptionalData(Es.copyOfRange(t,s,s+g))}return r},e.textCompaction=function(t,r,n){for(var i=new Int32Array(2*(t[0]-r)),o=new Int32Array(2*(t[0]-r)),a=0,s=!1;r<t[0]&&!s;){var u=t[r++];if(u<e.TEXT_COMPACTION_MODE_LATCH)i[a]=u/30,i[a+1]=u%30,a+=2;else switch(u){case e.TEXT_COMPACTION_MODE_LATCH:i[a++]=e.TEXT_COMPACTION_MODE_LATCH;break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:r--,s=!0;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[a]=e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,u=t[r++],o[a]=u,a++}}return e.decodeTextCompaction(i,o,a,n),r},e.decodeTextCompaction=function(t,r,n,i){for(var o=Kl.ALPHA,a=Kl.ALPHA,s=0;s<n;){var u=t[s],c="";switch(o){case Kl.ALPHA:if(u<26)c=String.fromCharCode(65+u);else switch(u){case 26:c=" ";break;case e.LL:o=Kl.LOWER;break;case e.ML:o=Kl.MIXED;break;case e.PS:a=o,o=Kl.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=Kl.ALPHA}break;case Kl.LOWER:if(u<26)c=String.fromCharCode(97+u);else switch(u){case 26:c=" ";break;case e.AS:a=o,o=Kl.ALPHA_SHIFT;break;case e.ML:o=Kl.MIXED;break;case e.PS:a=o,o=Kl.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=Kl.ALPHA}break;case Kl.MIXED:if(u<e.PL)c=e.MIXED_CHARS[u];else switch(u){case e.PL:o=Kl.PUNCT;break;case 26:c=" ";break;case e.LL:o=Kl.LOWER;break;case e.AL:o=Kl.ALPHA;break;case e.PS:a=o,o=Kl.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=Kl.ALPHA}break;case Kl.PUNCT:if(u<e.PAL)c=e.PUNCT_CHARS[u];else switch(u){case e.PAL:o=Kl.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=Kl.ALPHA}break;case Kl.ALPHA_SHIFT:if(o=a,u<26)c=String.fromCharCode(65+u);else switch(u){case 26:c=" ";break;case e.TEXT_COMPACTION_MODE_LATCH:o=Kl.ALPHA}break;case Kl.PUNCT_SHIFT:if(o=a,u<e.PAL)c=e.PUNCT_CHARS[u];else switch(u){case e.PAL:o=Kl.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=Kl.ALPHA}}""!==c&&i.append(c),s++}},e.byteCompaction=function(t,r,n,i,o){var a=new Wd,s=0,u=0,c=!1;switch(t){case e.BYTE_COMPACTION_MODE_LATCH:for(var l=new Int32Array(6),d=r[i++];i<r[0]&&!c;)switch(l[s++]=d,u=900*u+d,d=r[i++]){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,c=!0;break;default:if(s%5==0&&s>0){for(var h=0;h<6;++h)a.write(Number(Xd(u)>>Xd(8*(5-h))));u=0,s=0}}i===r[0]&&d<e.TEXT_COMPACTION_MODE_LATCH&&(l[s++]=d);for(var f=0;f<s;f++)a.write(l[f]);break;case e.BYTE_COMPACTION_MODE_LATCH_6:for(;i<r[0]&&!c;){var p=r[i++];if(p<e.TEXT_COMPACTION_MODE_LATCH)s++,u=900*u+p;else switch(p){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,c=!0}if(s%5==0&&s>0){for(h=0;h<6;++h)a.write(Number(Xd(u)>>Xd(8*(5-h))));u=0,s=0}}}return o.append(Ps.decode(a.toByteArray(),n)),i},e.numericCompaction=function(t,r,n){for(var i=0,o=!1,a=new Int32Array(e.MAX_NUMERIC_CODEWORDS);r<t[0]&&!o;){var s=t[r++];if(r===t[0]&&(o=!0),s<e.TEXT_COMPACTION_MODE_LATCH)a[i]=s,i++;else switch(s){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:r--,o=!0}(i%e.MAX_NUMERIC_CODEWORDS==0||s===e.NUMERIC_COMPACTION_MODE_LATCH||o)&&i>0&&(n.append(e.decodeBase900toBase10(a,i)),i=0)}return r},e.decodeBase900toBase10=function(t,r){for(var n=Xd(0),i=0;i<r;i++)n+=e.EXP900[r-i-1]*Xd(t[i]);var o=n.toString();if("1"!==o.charAt(0))throw new Ms;return o.substring(1)},e.TEXT_COMPACTION_MODE_LATCH=900,e.BYTE_COMPACTION_MODE_LATCH=901,e.NUMERIC_COMPACTION_MODE_LATCH=902,e.BYTE_COMPACTION_MODE_LATCH_6=924,e.ECI_USER_DEFINED=925,e.ECI_GENERAL_PURPOSE=926,e.ECI_CHARSET=927,e.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,e.MACRO_PDF417_TERMINATOR=922,e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,e.MAX_NUMERIC_CODEWORDS=15,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,e.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,e.PL=25,e.LL=27,e.AS=27,e.ML=28,e.AL=28,e.PS=29,e.PAL=29,e.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",e.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",e.EXP900=Kd()?function(){var e=[];e[0]=Xd(1);var t=Xd(900);e[1]=t;for(var r=2;r<16;r++)e[r]=e[r-1]*t;return e}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),Zd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Jd=function(){function e(){}return e.decode=function(t,r,n,i,o,a,s){for(var u,c=new Ed(t,r,n,i,o),l=null,d=null,h=!0;;h=!1){if(null!=r&&(l=e.getRowIndicatorColumn(t,c,r,!0,a,s)),null!=i&&(d=e.getRowIndicatorColumn(t,c,i,!1,a,s)),null==(u=e.merge(l,d)))throw Us.getNotFoundInstance();var f=u.getBoundingBox();if(!h||null==f||!(f.getMinY()<c.getMinY()||f.getMaxY()>c.getMaxY()))break;c=f}u.setBoundingBox(c);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,l),u.setDetectionResultColumn(p,d);for(var g=null!=l,m=1;m<=p;m++){var y=g?m:p-m;if(void 0===u.getDetectionResultColumn(y)){var v=void 0;v=0===y||y===p?new kd(c,0===y):new Id(c),u.setDetectionResultColumn(y,v);for(var w=-1,b=w,_=c.getMinY();_<=c.getMaxY();_++){if((w=e.getStartColumn(u,y,_,g))<0||w>c.getMaxX()){if(-1===b)continue;w=b}var A=e.detectCodeword(t,c.getMinX(),c.getMaxX(),g,w,_,a,s);null!=A&&(v.setCodeword(_,A),b=w,a=Math.min(a,A.getWidth()),s=Math.max(s,A.getWidth()))}}}return e.createDecoderResult(u)},e.merge=function(t,r){if(null==t&&null==r)return null;var n=e.getBarcodeMetadata(t,r);if(null==n)return null;var i=Ed.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(r));return new Pd(n,i)},e.adjustBoundingBox=function(t){var r,n;if(null==t)return null;var i=t.getRowHeights();if(null==i)return null;var o=e.getMax(i),a=0;try{for(var s=Zd(i),u=s.next();!u.done;u=s.next()){var c=u.value;if(a+=o-c,c>0)break}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var l=t.getCodewords(),d=0;a>0&&null==l[d];d++)a--;var h=0;for(d=i.length-1;d>=0&&(h+=o-i[d],!(i[d]>0));d--);for(d=l.length-1;h>0&&null==l[d];d--)h--;return t.getBoundingBox().addMissingRows(a,h,t.isLeft())},e.getMax=function(e){var t,r,n=-1;try{for(var i=Zd(e),o=i.next();!o.done;o=i.next()){var a=o.value;n=Math.max(n,a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.getBarcodeMetadata=function(e,t){var r,n;return null==e||null==(r=e.getBarcodeMetadata())?null==t?null:t.getBarcodeMetadata():null==t||null==(n=t.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},e.getRowIndicatorColumn=function(t,r,n,i,o,a){for(var s=new kd(r,i),u=0;u<2;u++)for(var c=0===u?1:-1,l=Math.trunc(Math.trunc(n.getX())),d=Math.trunc(Math.trunc(n.getY()));d<=r.getMaxY()&&d>=r.getMinY();d+=c){var h=e.detectCodeword(t,0,t.getWidth(),i,l,d,o,a);null!=h&&(s.setCodeword(d,h),l=i?h.getStartX():h.getEndX())}return s},e.adjustCodewordCount=function(t,r){var n=r[0][1],i=n.getValue(),o=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(0===i.length){if(o<1||o>hd.MAX_CODEWORDS_IN_BARCODE)throw Us.getNotFoundInstance();n.setValue(o)}else i[0]!==o&&n.setValue(o)},e.createDecoderResult=function(t){var r=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,r);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),o=[],a=new Array,s=0;s<t.getBarcodeRowCount();s++)for(var u=0;u<t.getBarcodeColumnCount();u++){var c=r[s][u+1].getValue(),l=s*t.getBarcodeColumnCount()+u;0===c.length?n.push(l):1===c.length?i[l]=c[0]:(a.push(l),o.push(c))}for(var d=new Array(o.length),h=0;h<d.length;h++)d[h]=o[h];return e.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,hd.toIntArray(n),hd.toIntArray(a),d)},e.createDecoderResultFromAmbiguousValues=function(t,r,n,i,o){for(var a=new Int32Array(i.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)r[i[u]]=o[u][a[u]];try{return e.decodeCodewords(r,t,n)}catch(e){if(!(e instanceof gs))throw e}if(0===a.length)throw gs.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<o[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw gs.getChecksumInstance()}}throw gs.getChecksumInstance()},e.createBarcodeMatrix=function(e){for(var t,r,n,i,o=Array.from({length:e.getBarcodeRowCount()},(function(){return new Array(e.getBarcodeColumnCount()+2)})),a=0;a<o.length;a++)for(var s=0;s<o[a].length;s++)o[a][s]=new Dd;var u=0;try{for(var c=Zd(e.getDetectionResultColumns()),l=c.next();!l.done;l=c.next()){var d=l.value;if(null!=d)try{for(var h=(n=void 0,Zd(d.getCodewords())),f=h.next();!f.done;f=h.next()){var p=f.value;if(null!=p){var g=p.getRowNumber();if(g>=0){if(g>=o.length)continue;o[g][u].setValue(p.getValue())}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}u++}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return o},e.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},e.getStartColumn=function(t,r,n,i){var o,a,s=i?1:-1,u=null;if(e.isValidBarcodeColumn(t,r-s)&&(u=t.getDetectionResultColumn(r-s).getCodeword(n)),null!=u)return i?u.getEndX():u.getStartX();if(null!=(u=t.getDetectionResultColumn(r).getCodewordNearby(n)))return i?u.getStartX():u.getEndX();if(e.isValidBarcodeColumn(t,r-s)&&(u=t.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=u)return i?u.getEndX():u.getStartX();for(var c=0;e.isValidBarcodeColumn(t,r-s);){r-=s;try{for(var l=(o=void 0,Zd(t.getDetectionResultColumn(r).getCodewords())),d=l.next();!d.done;d=l.next()){var h=d.value;if(null!=h)return(i?h.getEndX():h.getStartX())+s*c*(h.getEndX()-h.getStartX())}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}c++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,r,n,i,o,a,s,u){o=e.adjustCodewordStartColumn(t,r,n,i,o,a);var c,l=e.getModuleBitCount(t,r,n,i,o,a);if(null==l)return null;var d=wu.sum(l);if(i)c=o+d;else{for(var h=0;h<l.length/2;h++){var f=l[h];l[h]=l[l.length-1-h],l[l.length-1-h]=f}o=(c=o)-d}if(!e.checkCodewordSkew(d,s,u))return null;var p=Fd.getDecodedValue(l),g=hd.getCodeword(p);return-1===g?null:new Bd(o,c,e.getCodewordBucketNumber(p),g)},e.getModuleBitCount=function(e,t,r,n,i,o){for(var a=i,s=new Int32Array(8),u=0,c=n?1:-1,l=n;(n?a<r:a>=t)&&u<s.length;)e.get(a,o)===l?(s[u]++,a+=c):(u++,l=!l);return u===s.length||a===(n?r:t)&&u===s.length-1?s:null},e.getNumberOfECCodeWords=function(e){return 2<<e},e.adjustCodewordStartColumn=function(t,r,n,i,o,a){for(var s=o,u=i?-1:1,c=0;c<2;c++){for(;(i?s>=r:s<n)&&i===t.get(s,a);){if(Math.abs(o-s)>e.CODEWORD_SKEW_SIZE)return o;s+=u}u=-u,i=!i}return s},e.checkCodewordSkew=function(t,r,n){return r-e.CODEWORD_SKEW_SIZE<=t&&t<=n+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,r,n){if(0===t.length)throw Ms.getFormatInstance();var i=1<<r+1,o=e.correctErrors(t,n,i);e.verifyCodewordCount(t,i);var a=Yd.decode(t,""+r);return a.setErrorsCorrected(o),a.setErasures(n.length),a},e.correctErrors=function(t,r,n){if(null!=r&&r.length>n/2+e.MAX_ERRORS||n<0||n>e.MAX_EC_CODEWORDS)throw gs.getChecksumInstance();return e.errorCorrection.decode(t,n,r)},e.verifyCodewordCount=function(e,t){if(e.length<4)throw Ms.getFormatInstance();var r=e[0];if(r>e.length)throw Ms.getFormatInstance();if(0===r){if(!(t<e.length))throw Ms.getFormatInstance();e[0]=e.length-t}},e.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),r=0,n=t.length-1;!((1&e)!==r&&(r=1&e,--n<0));)t[n]++,e>>=1;return t},e.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},e.toString=function(e){for(var t=new xd,r=0;r<e.length;r++){t.format("Row %2d: ",r);for(var n=0;n<e[r].length;n++){var i=e[r][n];0===i.getValue().length?t.format(" ",null):t.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format("%n")}return t.toString()},e.CODEWORD_SKEW_SIZE=2,e.MAX_ERRORS=3,e.MAX_EC_CODEWORDS=512,e.errorCorrection=new Ad,e}(),$d=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qd=function(){function e(){}return e.prototype.decode=function(t,r){void 0===r&&(r=null);var n=e.decode(t,r,!1);if(null==n||0===n.length||null==n[0])throw Us.getNotFoundInstance();return n[0]},e.prototype.decodeMultiple=function(t,r){void 0===r&&(r=null);try{return e.decode(t,r,!0)}catch(e){if(e instanceof Ms||e instanceof gs)throw Us.getNotFoundInstance();throw e}},e.decode=function(t,r,n){var i,o,a=new Array,s=gd.detectMultiple(t,r,n);try{for(var u=$d(s.getPoints()),c=u.next();!c.done;c=u.next()){var l=c.value,d=Jd.decode(s.getBits(),l[4],l[5],l[6],l[7],e.getMinCodewordWidth(l),e.getMaxCodewordWidth(l)),h=new tu(d.getText(),d.getRawBytes(),void 0,l,nu.PDF_417);h.putMetadata(ou.ERROR_CORRECTION_LEVEL,d.getECLevel());var f=d.getOther();null!=f&&h.putMetadata(ou.PDF417_EXTRA_METADATA,f),a.push(h)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return a.map((function(e){return e}))},e.getMaxWidth=function(e,t){return null==e||null==t?0:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMinWidth=function(e,t){return null==e||null==t?Cs.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*hd.MODULES_IN_CODEWORD/hd.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*hd.MODULES_IN_CODEWORD/hd.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*hd.MODULES_IN_CODEWORD/hd.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*hd.MODULES_IN_CODEWORD/hd.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),eh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),th=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return eh(t,e),t.kind="ReaderException",t}(us),rh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},nh=function(){function e(){}return e.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},e.prototype.decodeWithState=function(e){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(e)},e.prototype.setHints=function(e){this.hints=e;var t=null!=e&&void 0!==e.get(Is.TRY_HARDER),r=null==e?null:e.get(Is.POSSIBLE_FORMATS),n=new Array;if(null!=r){var i=r.some((function(e){return e===nu.UPC_A||e===nu.UPC_E||e===nu.EAN_13||e===nu.EAN_8||e===nu.CODABAR||e===nu.CODE_39||e===nu.CODE_93||e===nu.CODE_128||e===nu.ITF||e===nu.RSS_14||e===nu.RSS_EXPANDED}));i&&!t&&n.push(new gl(e)),r.includes(nu.QR_CODE)&&n.push(new ld),r.includes(nu.DATA_MATRIX)&&n.push(new Rl),r.includes(nu.AZTEC)&&n.push(new ku),r.includes(nu.PDF_417)&&n.push(new Qd),i&&t&&n.push(new gl(e))}0===n.length&&(t||n.push(new gl(e)),n.push(new ld),n.push(new Rl),n.push(new ku),n.push(new Qd),t&&n.push(new gl(e))),this.readers=n},e.prototype.reset=function(){var e,t;if(null!==this.readers)try{for(var r=rh(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.decodeInternal=function(e){var t,r;if(null===this.readers)throw new th("No readers where selected, nothing can be read.");try{for(var n=rh(this.readers),i=n.next();!i.done;i=n.next()){var o=i.value;try{return o.decode(e,this.hints)}catch(e){if(e instanceof th)continue}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}throw new Us("No MultiFormat Readers were able to detect the code.")},e}(),ih=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){void 0===t&&(t=null),void 0===r&&(r=500);var n=new nh;return n.setHints(t),e.call(this,n,r)||this}ih(t,e),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)}}(eu);var oh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new Qd,t)||this}oh(t,e)}(eu);var ah,sh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new ld,t)||this}sh(t,e)}(eu),function(e){e[e.ERROR_CORRECTION=0]="ERROR_CORRECTION",e[e.CHARACTER_SET=1]="CHARACTER_SET",e[e.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",e[e.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",e[e.MIN_SIZE=4]="MIN_SIZE",e[e.MAX_SIZE=5]="MAX_SIZE",e[e.MARGIN=6]="MARGIN",e[e.PDF417_COMPACT=7]="PDF417_COMPACT",e[e.PDF417_COMPACTION=8]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=10]="AZTEC_LAYERS",e[e.QR_VERSION=11]="QR_VERSION",e[e.GS1_FORMAT=12]="GS1_FORMAT",e[e.FORCE_C40=13]="FORCE_C40"}(ah||(ah={}));var uh=ah,ch=function(){function e(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new uu(e,Int32Array.from([1])))}return e.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var r=t[t.length-1],n=this.field,i=t.length;i<=e;i++){var o=r.multiply(new uu(n,Int32Array.from([1,n.exp(i-1+n.getGeneratorBase())])));t.push(o),r=o}return t[e]},e.prototype.encode=function(e,t){if(0===t)throw new hs("No error correction bytes");var r=e.length-t;if(r<=0)throw new hs("No data bytes provided");var n=this.buildGenerator(t),i=new Int32Array(r);ys.arraycopy(e,0,i,0,r);for(var o=new uu(this.field,i),a=(o=o.multiplyByMonomial(t,1)).divide(n)[1].getCoefficients(),s=t-a.length,u=0;u<s;u++)e[r+u]=0;ys.arraycopy(a,0,e,r+s,a.length)},e}(),lh=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o-1;a++)for(var s=n[a],u=0;u<i-1;u++){var c=s[u];c===s[u+1]&&c===n[a+1][u]&&c===n[a+1][u+1]&&r++}return e.N2*r},e.applyMaskPenaltyRule3=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var s=0;s<i;s++){var u=n[a];s+6<i&&1===u[s]&&0===u[s+1]&&1===u[s+2]&&1===u[s+3]&&1===u[s+4]&&0===u[s+5]&&1===u[s+6]&&(e.isWhiteHorizontal(u,s-4,s)||e.isWhiteHorizontal(u,s+7,s+11))&&r++,a+6<o&&1===n[a][s]&&0===n[a+1][s]&&1===n[a+2][s]&&1===n[a+3][s]&&1===n[a+4][s]&&0===n[a+5][s]&&1===n[a+6][s]&&(e.isWhiteVertical(n,s,a-4,a)||e.isWhiteVertical(n,s,a+7,a+11))&&r++}return r*e.N3},e.isWhiteHorizontal=function(e,t,r){t=Math.max(t,0),r=Math.min(r,e.length);for(var n=t;n<r;n++)if(1===e[n])return!1;return!0},e.isWhiteVertical=function(e,t,r,n){r=Math.max(r,0),n=Math.min(n,e.length);for(var i=r;i<n;i++)if(1===e[i][t])return!1;return!0},e.applyMaskPenaltyRule4=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var s=n[a],u=0;u<i;u++)1===s[u]&&r++;var c=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*r-c)/c)*e.N4},e.getDataMaskBit=function(e,t,r){var n,i;switch(e){case 0:n=r+t&1;break;case 1:n=1&r;break;case 2:n=t%3;break;case 3:n=(r+t)%3;break;case 4:n=Math.floor(r/2)+Math.floor(t/3)&1;break;case 5:n=(1&(i=r*t))+i%3;break;case 6:n=(1&(i=r*t))+i%3&1;break;case 7:n=(i=r*t)%3+(r+t&1)&1;break;default:throw new hs("Invalid mask pattern: "+e)}return 0===n},e.applyMaskPenaltyRule1Internal=function(t,r){for(var n=0,i=r?t.getHeight():t.getWidth(),o=r?t.getWidth():t.getHeight(),a=t.getArray(),s=0;s<i;s++){for(var u=0,c=-1,l=0;l<o;l++){var d=r?a[s][l]:a[l][s];d===c?u++:(u>=5&&(n+=e.N1+(u-5)),u=1,c=d)}u>=5&&(n+=e.N1+(u-5))}return n},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),dh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hh=function(){function e(e,t){this.width=e,this.height=t;for(var r=new Array(t),n=0;n!==t;n++)r[n]=new Uint8Array(e);this.bytes=r}return e.prototype.getHeight=function(){return this.height},e.prototype.getWidth=function(){return this.width},e.prototype.get=function(e,t){return this.bytes[t][e]},e.prototype.getArray=function(){return this.bytes},e.prototype.setNumber=function(e,t,r){this.bytes[t][e]=r},e.prototype.setBoolean=function(e,t,r){this.bytes[t][e]=r?1:0},e.prototype.clear=function(e){var t,r;try{for(var n=dh(this.bytes),i=n.next();!i.done;i=n.next()){var o=i.value;Es.fill(o,e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.width!==r.width)return!1;if(this.height!==r.height)return!1;for(var n=0,i=this.height;n<i;++n)for(var o=this.bytes[n],a=r.bytes[n],s=0,u=this.width;s<u;++s)if(o[s]!==a[s])return!1;return!0},e.prototype.toString=function(){for(var e=new Fs,t=0,r=this.height;t<r;++t){for(var n=this.bytes[t],i=0,o=this.width;i<o;++i)switch(n[i]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ")}e.append("\n")}return e.toString()},e}(),fh=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var e=new Fs;return e.append("<<\n"),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append("\n ecLevel: "),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append("\n version: "),e.append(this.version?this.version.toString():"null"),e.append("\n maskPattern: "),e.append(this.maskPattern.toString()),this.matrix?(e.append("\n matrix:\n"),e.append(this.matrix.toString())):e.append("\n matrix: null\n"),e.append(">>\n"),e.toString()},e.prototype.setMode=function(e){this.mode=e},e.prototype.setECLevel=function(e){this.ecLevel=e},e.prototype.setVersion=function(e){this.version=e},e.prototype.setMaskPattern=function(e){this.maskPattern=e},e.prototype.setMatrix=function(e){this.matrix=e},e.isValidMaskPattern=function(t){return t>=0&&t<e.NUM_MASK_PATTERNS},e.NUM_MASK_PATTERNS=8,e}(),ph=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ph(t,e),t.kind="WriterException",t}(us),mh=function(){function e(){}return e.clearMatrix=function(e){e.clear(255)},e.buildMatrix=function(t,r,n,i,o){e.clearMatrix(o),e.embedBasicPatterns(n,o),e.embedTypeInfo(r,i,o),e.maybeEmbedVersionInfo(n,o),e.embedDataBits(t,i,o)},e.embedBasicPatterns=function(t,r){e.embedPositionDetectionPatternsAndSeparators(r),e.embedDarkDotAtLeftBottomCorner(r),e.maybeEmbedPositionAdjustmentPatterns(t,r),e.embedTimingPatterns(r)},e.embedTypeInfo=function(t,r,n){var i=new xs;e.makeTypeInfoBits(t,r,i);for(var o=0,a=i.getSize();o<a;++o){var s=i.get(i.getSize()-1-o),u=e.TYPE_INFO_COORDINATES[o],c=u[0],l=u[1];if(n.setBoolean(c,l,s),o<8){var d=n.getWidth()-o-1,h=8;n.setBoolean(d,h,s)}else{d=8,h=n.getHeight()-7+(o-8);n.setBoolean(d,h,s)}}},e.maybeEmbedVersionInfo=function(t,r){if(!(t.getVersionNumber()<7)){var n=new xs;e.makeVersionInfoBits(t,n);for(var i=17,o=0;o<6;++o)for(var a=0;a<3;++a){var s=n.get(i);i--,r.setBoolean(o,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,o,s)}}},e.embedDataBits=function(t,r,n){for(var i=0,o=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(6===a&&(a-=1);s>=0&&s<n.getHeight();){for(var u=0;u<2;++u){var c=a-u;if(e.isEmpty(n.get(c,s))){var l=void 0;i<t.getSize()?(l=t.get(i),++i):l=!1,255!==r&&lh.getDataMaskBit(r,c,s)&&(l=!l),n.setBoolean(c,s,l)}}s+=o}s+=o=-o,a-=2}if(i!==t.getSize())throw new gh("Not all bits consumed: "+i+"/"+t.getSize())},e.findMSBSet=function(e){return 32-Cs.numberOfLeadingZeros(e)},e.calculateBCHCode=function(t,r){if(0===r)throw new hs("0 polynomial");var n=e.findMSBSet(r);for(t<<=n-1;e.findMSBSet(t)>=n;)t^=r<<e.findMSBSet(t)-n;return t},e.makeTypeInfoBits=function(t,r,n){if(!fh.isValidMaskPattern(r))throw new gh("Invalid mask pattern");var i=t.getBits()<<3|r;n.appendBits(i,5);var o=e.calculateBCHCode(i,e.TYPE_INFO_POLY);n.appendBits(o,10);var a=new xs;if(a.appendBits(e.TYPE_INFO_MASK_PATTERN,15),n.xor(a),15!==n.getSize())throw new gh("should not happen but we got: "+n.getSize())},e.makeVersionInfoBits=function(t,r){r.appendBits(t.getVersionNumber(),6);var n=e.calculateBCHCode(t.getVersionNumber(),e.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new gh("should not happen but we got: "+r.getSize())},e.isEmpty=function(e){return 255===e},e.embedTimingPatterns=function(t){for(var r=8;r<t.getWidth()-8;++r){var n=(r+1)%2;e.isEmpty(t.get(r,6))&&t.setNumber(r,6,n),e.isEmpty(t.get(6,r))&&t.setNumber(6,r,n)}},e.embedDarkDotAtLeftBottomCorner=function(e){if(0===e.get(8,e.getHeight()-8))throw new gh;e.setNumber(8,e.getHeight()-8,1)},e.embedHorizontalSeparationPattern=function(t,r,n){for(var i=0;i<8;++i){if(!e.isEmpty(n.get(t+i,r)))throw new gh;n.setNumber(t+i,r,0)}},e.embedVerticalSeparationPattern=function(t,r,n){for(var i=0;i<7;++i){if(!e.isEmpty(n.get(t,r+i)))throw new gh;n.setNumber(t,r+i,0)}},e.embedPositionAdjustmentPattern=function(t,r,n){for(var i=0;i<5;++i)for(var o=e.POSITION_ADJUSTMENT_PATTERN[i],a=0;a<5;++a)n.setNumber(t+a,r+i,o[a])},e.embedPositionDetectionPattern=function(t,r,n){for(var i=0;i<7;++i)for(var o=e.POSITION_DETECTION_PATTERN[i],a=0;a<7;++a)n.setNumber(t+a,r+i,o[a])},e.embedPositionDetectionPatternsAndSeparators=function(t){var r=e.POSITION_DETECTION_PATTERN[0].length;e.embedPositionDetectionPattern(0,0,t),e.embedPositionDetectionPattern(t.getWidth()-r,0,t),e.embedPositionDetectionPattern(0,t.getWidth()-r,t);e.embedHorizontalSeparationPattern(0,7,t),e.embedHorizontalSeparationPattern(t.getWidth()-8,7,t),e.embedHorizontalSeparationPattern(0,t.getWidth()-8,t);e.embedVerticalSeparationPattern(7,0,t),e.embedVerticalSeparationPattern(t.getHeight()-7-1,0,t),e.embedVerticalSeparationPattern(7,t.getHeight()-7,t)},e.maybeEmbedPositionAdjustmentPatterns=function(t,r){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,i=e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],o=0,a=i.length;o!==a;o++){var s=i[o];if(s>=0)for(var u=0;u!==a;u++){var c=i[u];c>=0&&e.isEmpty(r.get(c,s))&&e.embedPositionAdjustmentPattern(c-2,s-2,r)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e}(),yh=function(){function e(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return e.prototype.getDataBytes=function(){return this.dataBytes},e.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},e}(),vh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(){function e(){}e.calculateMaskPenalty=function(e){return lh.applyMaskPenaltyRule1(e)+lh.applyMaskPenaltyRule2(e)+lh.applyMaskPenaltyRule3(e)+lh.applyMaskPenaltyRule4(e)},e.encode=function(t,r,n){void 0===n&&(n=null);var i=e.DEFAULT_BYTE_MODE_ENCODING,o=null!==n&&void 0!==n.get(uh.CHARACTER_SET);o&&(i=n.get(uh.CHARACTER_SET).toString());var a=this.chooseMode(t,i),s=new xs;if(a===Yl.BYTE&&(o||e.DEFAULT_BYTE_MODE_ENCODING!==i)){var u=Os.getCharacterSetECIByName(i);void 0!==u&&this.appendECI(u,s)}this.appendModeInfo(a,s);var c,l=new xs;if(this.appendBytes(t,a,l,i),null!==n&&void 0!==n.get(uh.QR_VERSION)){var d=Number.parseInt(n.get(uh.QR_VERSION).toString(),10);c=jl.getVersionForNumber(d);var h=this.calculateBitsNeeded(a,s,l,c);if(!this.willFit(h,c,r))throw new gh("Data too big for requested version")}else c=this.recommendVersion(r,a,s,l);var f=new xs;f.appendBitArray(s);var p=a===Yl.BYTE?l.getSizeInBytes():t.length;this.appendLengthInfo(p,c,a,f),f.appendBitArray(l);var g=c.getECBlocksForLevel(r),m=c.getTotalCodewords()-g.getTotalECCodewords();this.terminateBits(m,f);var y=this.interleaveWithECBytes(f,c.getTotalCodewords(),m,g.getNumBlocks()),v=new fh;v.setECLevel(r),v.setMode(a),v.setVersion(c);var w=c.getDimensionForVersion(),b=new hh(w,w),_=this.chooseMaskPattern(y,r,c,b);return v.setMaskPattern(_),mh.buildMatrix(y,r,c,_,b),v.setMatrix(b),v},e.recommendVersion=function(e,t,r,n){var i=this.calculateBitsNeeded(t,r,n,jl.getVersionForNumber(1)),o=this.chooseVersion(i,e),a=this.calculateBitsNeeded(t,r,n,o);return this.chooseVersion(a,e)},e.calculateBitsNeeded=function(e,t,r,n){return t.getSize()+e.getCharacterCountBits(n)+r.getSize()},e.getAlphanumericCode=function(t){return t<e.ALPHANUMERIC_TABLE.length?e.ALPHANUMERIC_TABLE[t]:-1},e.chooseMode=function(t,r){if(void 0===r&&(r=null),Os.SJIS.getName()===r&&this.isOnlyDoubleByteKanji(t))return Yl.KANJI;for(var n=!1,i=!1,o=0,a=t.length;o<a;++o){var s=t.charAt(o);if(e.isDigit(s))n=!0;else{if(-1===this.getAlphanumericCode(s.charCodeAt(0)))return Yl.BYTE;i=!0}}return i?Yl.ALPHANUMERIC:n?Yl.NUMERIC:Yl.BYTE},e.isOnlyDoubleByteKanji=function(e){var t;try{t=Ps.encode(e,Os.SJIS)}catch(e){return!1}var r=t.length;if(r%2!=0)return!1;for(var n=0;n<r;n+=2){var i=255&t[n];if((i<129||i>159)&&(i<224||i>235))return!1}return!0},e.chooseMaskPattern=function(e,t,r,n){for(var i=Number.MAX_SAFE_INTEGER,o=-1,a=0;a<fh.NUM_MASK_PATTERNS;a++){mh.buildMatrix(e,t,r,a,n);var s=this.calculateMaskPenalty(n);s<i&&(i=s,o=a)}return o},e.chooseVersion=function(t,r){for(var n=1;n<=40;n++){var i=jl.getVersionForNumber(n);if(e.willFit(t,i,r))return i}throw new gh("Data too big")},e.willFit=function(e,t,r){return t.getTotalCodewords()-t.getECBlocksForLevel(r).getTotalECCodewords()>=(e+7)/8},e.terminateBits=function(e,t){var r=8*e;if(t.getSize()>r)throw new gh("data bits cannot fit in the QR Code"+t.getSize()+" > "+r);for(var n=0;n<4&&t.getSize()<r;++n)t.appendBit(!1);var i=7&t.getSize();if(i>0)for(n=i;n<8;n++)t.appendBit(!1);var o=e-t.getSizeInBytes();for(n=0;n<o;++n)t.appendBits(0==(1&n)?236:17,8);if(t.getSize()!==r)throw new gh("Bits size does not equal capacity")},e.getNumDataBytesAndNumECBytesForBlockID=function(e,t,r,n,i,o){if(n>=r)throw new gh("Block ID too large");var a=e%r,s=r-a,u=Math.floor(e/r),c=u+1,l=Math.floor(t/r),d=l+1,h=u-l,f=c-d;if(h!==f)throw new gh("EC bytes mismatch");if(r!==s+a)throw new gh("RS blocks mismatch");if(e!==(l+h)*s+(d+f)*a)throw new gh("Total bytes mismatch");n<s?(i[0]=l,o[0]=h):(i[0]=d,o[0]=f)},e.interleaveWithECBytes=function(t,r,n,i){var o,a,s,u;if(t.getSizeInBytes()!==n)throw new gh("Number of bits and data bytes does not match");for(var c=0,l=0,d=0,h=new Array,f=0;f<i;++f){var p=new Int32Array(1),g=new Int32Array(1);e.getNumDataBytesAndNumECBytesForBlockID(r,n,i,f,p,g);var m=p[0],y=new Uint8Array(m);t.toBytes(8*c,y,0,m);var v=e.generateECBytes(y,g[0]);h.push(new yh(y,v)),l=Math.max(l,m),d=Math.max(d,v.length),c+=p[0]}if(n!==c)throw new gh("Data bytes does not match offset");var w=new xs;for(f=0;f<l;++f)try{for(var b=(o=void 0,vh(h)),_=b.next();!_.done;_=b.next()){f<(y=_.value.getDataBytes()).length&&w.appendBits(y[f],8)}}catch(e){o={error:e}}finally{try{_&&!_.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}for(f=0;f<d;++f)try{for(var A=(s=void 0,vh(h)),E=A.next();!E.done;E=A.next()){f<(v=E.value.getErrorCorrectionBytes()).length&&w.appendBits(v[f],8)}}catch(e){s={error:e}}finally{try{E&&!E.done&&(u=A.return)&&u.call(A)}finally{if(s)throw s.error}}if(r!==w.getSizeInBytes())throw new gh("Interleaving error: "+r+" and "+w.getSizeInBytes()+" differ.");return w},e.generateECBytes=function(e,t){for(var r=e.length,n=new Int32Array(r+t),i=0;i<r;i++)n[i]=255&e[i];new ch(hu.QR_CODE_FIELD_256).encode(n,t);var o=new Uint8Array(t);for(i=0;i<t;i++)o[i]=n[r+i];return o},e.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},e.appendLengthInfo=function(e,t,r,n){var i=r.getCharacterCountBits(t);if(e>=1<<i)throw new gh(e+" is bigger than "+((1<<i)-1));n.appendBits(e,i)},e.appendBytes=function(t,r,n,i){switch(r){case Yl.NUMERIC:e.appendNumericBytes(t,n);break;case Yl.ALPHANUMERIC:e.appendAlphanumericBytes(t,n);break;case Yl.BYTE:e.append8BitBytes(t,n,i);break;case Yl.KANJI:e.appendKanjiBytes(t,n);break;default:throw new gh("Invalid mode: "+r)}},e.getDigit=function(e){return e.charCodeAt(0)-48},e.isDigit=function(t){var r=e.getDigit(t);return r>=0&&r<=9},e.appendNumericBytes=function(t,r){for(var n=t.length,i=0;i<n;){var o=e.getDigit(t.charAt(i));if(i+2<n){var a=e.getDigit(t.charAt(i+1)),s=e.getDigit(t.charAt(i+2));r.appendBits(100*o+10*a+s,10),i+=3}else if(i+1<n){a=e.getDigit(t.charAt(i+1));r.appendBits(10*o+a,7),i+=2}else r.appendBits(o,4),i++}},e.appendAlphanumericBytes=function(t,r){for(var n=t.length,i=0;i<n;){var o=e.getAlphanumericCode(t.charCodeAt(i));if(-1===o)throw new gh;if(i+1<n){var a=e.getAlphanumericCode(t.charCodeAt(i+1));if(-1===a)throw new gh;r.appendBits(45*o+a,11),i+=2}else r.appendBits(o,6),i++}},e.append8BitBytes=function(e,t,r){var n;try{n=Ps.encode(e,r)}catch(e){throw new gh(e)}for(var i=0,o=n.length;i!==o;i++){var a=n[i];t.appendBits(a,8)}},e.appendKanjiBytes=function(e,t){var r;try{r=Ps.encode(e,Os.SJIS)}catch(e){throw new gh(e)}for(var n=r.length,i=0;i<n;i+=2){var o=(255&r[i])<<8&4294967295|255&r[i+1],a=-1;if(o>=33088&&o<=40956?a=o-33088:o>=57408&&o<=60351&&(a=o-49472),-1===a)throw new gh("Invalid byte sequence");var s=192*(a>>8)+(255&a);t.appendBits(s,13)}},e.appendECI=function(e,t){t.appendBits(Yl.ECI.getBits(),4),t.appendBits(e.getValue(),8)},e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),e.DEFAULT_BYTE_MODE_ENCODING=Os.UTF8.getName()}();var wh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r,n,i,o,a,s,u){var c=e.call(this,a,s)||this;if(c.yuvData=t,c.dataWidth=r,c.dataHeight=n,c.left=i,c.top=o,i+a>r||o+s>n)throw new hs("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(a,s),c}wh(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new hs("Requested row is outside the image: "+e);var r=this.getWidth();(null==t||t.length<r)&&(t=new Uint8ClampedArray(r));var n=(e+this.top)*this.dataWidth+this.left;return ys.arraycopy(this.yuvData,n,t,0,r),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;var r=e*t,n=new Uint8ClampedArray(r),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return ys.arraycopy(this.yuvData,i,n,0,r),n;for(var o=0;o<t;o++){var a=o*e;ys.arraycopy(this.yuvData,i,n,a,e),i+=this.dataWidth}return n},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,r,n,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+r,n,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(e*r),i=this.yuvData,o=this.top*this.dataWidth+this.left,a=0;a<r;a++){for(var s=a*e,u=0;u<e;u++){var c=255&i[o+u*t.THUMBNAIL_SCALE_FACTOR];n[s+u]=4278190080|65793*c}o+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return n},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,t){for(var r=this.yuvData,n=0,i=this.top*this.dataWidth+this.left;n<t;n++,i+=this.dataWidth)for(var o=i+e/2,a=i,s=i+e-1;a<o;a++,s--){var u=r[a];r[a]=r[s],r[s]=u}},t.prototype.invert=function(){return new Ks(this)},t.THUMBNAIL_SCALE_FACTOR=2}(qs);var bh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r,n,i,o,a,s){var u=e.call(this,r,n)||this;if(u.dataWidth=i,u.dataHeight=o,u.left=a,u.top=s,4===t.BYTES_PER_ELEMENT){for(var c=r*n,l=new Uint8ClampedArray(c),d=0;d<c;d++){var h=t[d],f=h>>16&255,p=h>>7&510,g=255&h;l[d]=(f+p+g)/4&255}u.luminances=l}else u.luminances=t;if(void 0===i&&(u.dataWidth=r),void 0===o&&(u.dataHeight=n),void 0===a&&(u.left=0),void 0===s&&(u.top=0),u.left+r>u.dataWidth||u.top+n>u.dataHeight)throw new hs("Crop rectangle does not fit within image data.");return u}bh(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new hs("Requested row is outside the image: "+e);var r=this.getWidth();(null==t||t.length<r)&&(t=new Uint8ClampedArray(r));var n=(e+this.top)*this.dataWidth+this.left;return ys.arraycopy(this.luminances,n,t,0,r),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;var r=e*t,n=new Uint8ClampedArray(r),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return ys.arraycopy(this.luminances,i,n,0,r),n;for(var o=0;o<t;o++){var a=o*e;ys.arraycopy(this.luminances,i,n,a,e),i+=this.dataWidth}return n},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,r,n,i){return new t(this.luminances,n,i,this.dataWidth,this.dataHeight,this.left+e,this.top+r)},t.prototype.invert=function(){return new Ks(this)}}(qs);var _h,Ah,Eh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ch=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Eh(t,e),t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(Os),xh=function(){function e(){}return e.ISO_8859_1=Os.ISO8859_1,e}();_h=function(e,t){for(var r=1,n=0;n<255;n++)t[n]=r,e[r]=n,(r*=2)>=256&&(r^=301);return{LOG:e,ALOG:t}}([],[]),_h.LOG,_h.ALOG,function(e){e[e.FORCE_NONE=0]="FORCE_NONE",e[e.FORCE_SQUARE=1]="FORCE_SQUARE",e[e.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"}(Ah||(Ah={}));var Sh,Ih="[)>05",Th="[)>06",Mh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 0},e.prototype.encode=function(e){if(Gh.determineConsecutiveDigitCount(e.getMessage(),e.pos)>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var t=e.getCurrentChar(),r=Gh.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(r!==this.getEncodingMode())switch(r){case 5:return e.writeCodeword(231),void e.signalEncoderChange(5);case 1:return e.writeCodeword(230),void e.signalEncoderChange(1);case 3:e.writeCodeword(238),e.signalEncoderChange(3);break;case 2:e.writeCodeword(239),e.signalEncoderChange(2);break;case 4:e.writeCodeword(240),e.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+r)}else Gh.isExtendedASCII(t)?(e.writeCodeword(235),e.writeCodeword(t-128+1),e.pos++):(e.writeCodeword(t+1),e.pos++)}},e.prototype.encodeASCIIDigits=function(e,t){if(Gh.isDigit(e)&&Gh.isDigit(t))return 10*(e-48)+(t-48)+130;throw new Error("not digits: "+e+t)},e}(),Dh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 5},e.prototype.encode=function(e){var t=new Fs;for(t.append(0);e.hasMoreCharacters();){var r=e.getCurrentChar();if(t.append(r),e.pos++,Gh.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}var n=t.length()-1,i=e.getCodewordCount()+n+1;e.updateSymbolInfo(i);var o=e.getSymbolInfo().getDataCapacity()-i>0;if(e.hasMoreCharacters()||o)if(n<=249)t.setCharAt(0,Bs.getCharAt(n));else{if(!(n<=1555))throw new Error("Message length not in valid ranges: "+n);t.setCharAt(0,Bs.getCharAt(Math.floor(n/250)+249)),t.insert(1,Bs.getCharAt(n%250))}var a=0;for(r=t.length();a<r;a++)e.writeCodeword(this.randomize255State(t.charAt(a).charCodeAt(0),e.getCodewordCount()+1))},e.prototype.randomize255State=function(e,t){var r=e+(149*t%255+1);return r<=255?r:r-256},e}(),Rh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 1},e.prototype.encodeMaximal=function(e){for(var t=new Fs,r=0,n=e.pos,i=0;e.hasMoreCharacters();){var o=e.getCurrentChar();e.pos++,r=this.encodeChar(o,t),t.length()%3==0&&(n=e.pos,i=t.length())}if(i!==t.length()){var a=Math.floor(t.length()/3*2),s=Math.floor(e.getCodewordCount()+a+1);e.updateSymbolInfo(s);var u=e.getSymbolInfo().getDataCapacity()-s,c=Math.floor(t.length()%3);(2===c&&2!==u||1===c&&(r>3||1!==u))&&(e.pos=n)}t.length()>0&&e.writeCodeword(230),this.handleEOD(e,t)},e.prototype.encode=function(e){for(var t=new Fs;e.hasMoreCharacters();){var r=e.getCurrentChar();e.pos++;var n=this.encodeChar(r,t),i=2*Math.floor(t.length()/3),o=e.getCodewordCount()+i;e.updateSymbolInfo(o);var a=e.getSymbolInfo().getDataCapacity()-o;if(!e.hasMoreCharacters()){var s=new Fs;for(t.length()%3==2&&2!==a&&(n=this.backtrackOneCharacter(e,t,s,n));t.length()%3==1&&(n>3||1!==a);)n=this.backtrackOneCharacter(e,t,s,n);break}if(t.length()%3==0)if(Gh.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},e.prototype.backtrackOneCharacter=function(e,t,r,n){var i=t.length(),o=t.toString().substring(0,i-n);t.setLengthToZero(),t.append(o),e.pos--;var a=e.getCurrentChar();return n=this.encodeChar(a,r),e.resetSymbolInfo(),n},e.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var r=t.toString().substring(3);t.setLengthToZero(),t.append(r)},e.prototype.handleEOD=function(e,t){var r=Math.floor(t.length()/3*2),n=t.length()%3,i=e.getCodewordCount()+r;e.updateSymbolInfo(i);var o=e.getSymbolInfo().getDataCapacity()-i;if(2===n){for(t.append("\0");t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254)}else if(1===o&&1===n){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254),e.pos--}else{if(0!==n)throw new Error("Unexpected case. Please report!");for(;t.length()>=3;)this.writeNextTriplet(e,t);(o>0||e.hasMoreCharacters())&&e.writeCodeword(254)}e.signalEncoderChange(0)},e.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0))return t.append(e-65+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append("1");var r=2;return r+=this.encodeChar(e-128,t)},e.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,r=t/256,n=t%256,i=new Fs;return i.append(r),i.append(n),i.toString()},e}(),Oh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 4},e.prototype.encode=function(e){for(var t=new Fs;e.hasMoreCharacters();){var r=e.getCurrentChar();if(this.encodeChar(r,t),e.pos++,t.length()>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(4);if(t.setLengthToZero(),t.append(n),Gh.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}}t.append(Bs.getCharAt(31)),this.handleEOD(e,t)},e.prototype.handleEOD=function(e,t){try{var r=t.length();if(0===r)return;if(1===r){e.updateSymbolInfo();var n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=e.getRemainingCharacters();if(i>n&&(e.updateSymbolInfo(e.getCodewordCount()+1),n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),i<=n&&n<=2)return}if(r>4)throw new Error("Count must not exceed 4");var o=r-1,a=this.encodeToCodewords(t.toString()),s=!e.hasMoreCharacters()&&o<=2;if(o<=2)e.updateSymbolInfo(e.getCodewordCount()+o),(n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount())>=3&&(s=!1,e.updateSymbolInfo(e.getCodewordCount()+a.length));s?(e.resetSymbolInfo(),e.pos-=o):e.writeCodewords(a)}finally{e.signalEncoderChange(0)}},e.prototype.encodeChar=function(e,t){e>=" ".charCodeAt(0)&&e<="?".charCodeAt(0)?t.append(e):e>="@".charCodeAt(0)&&e<="^".charCodeAt(0)?t.append(Bs.getCharAt(e-64)):Gh.illegalCharacter(Bs.getCharAt(e))},e.prototype.encodeToCodewords=function(e){var t=e.length;if(0===t)throw new Error("StringBuilder must not be empty");var r=(e.charAt(0).charCodeAt(0)<<18)+((t>=2?e.charAt(1).charCodeAt(0):0)<<12)+((t>=3?e.charAt(2).charCodeAt(0):0)<<6)+(t>=4?e.charAt(3).charCodeAt(0):0),n=r>>16&255,i=r>>8&255,o=255&r,a=new Fs;return a.append(n),t>=2&&a.append(i),t>=3&&a.append(o),a.toString()},e}(),kh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ph=function(){function e(e,t,r,n,i,o,a,s){void 0===a&&(a=0),void 0===s&&(s=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=r,this.matrixWidth=n,this.matrixHeight=i,this.dataRegions=o,this.rsBlockData=a,this.rsBlockError=s}return e.lookup=function(e,t,r,n,i){var o,a;void 0===t&&(t=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=!0);try{for(var s=Nh(Fh),u=s.next();!u.done;u=s.next()){var c=u.value;if((1!==t||!c.rectangular)&&((2!==t||c.rectangular)&&(null==r||!(c.getSymbolWidth()<r.getWidth()||c.getSymbolHeight()<r.getHeight()))&&(null==n||!(c.getSymbolWidth()>n.getWidth()||c.getSymbolHeight()>n.getHeight()))&&e<=c.dataCapacity))return c}}catch(e){o={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);return null},e.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},e.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},e.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},e.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},e.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},e.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},e.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},e.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},e.prototype.getDataCapacity=function(){return this.dataCapacity},e.prototype.getErrorCodewords=function(){return this.errorCodewords},e.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},e.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},e}(),Bh=function(e){function t(){return e.call(this,!1,1558,620,22,22,36,-1,62)||this}return kh(t,e),t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(Ph),Fh=[new Ph(!1,3,5,8,8,1),new Ph(!1,5,7,10,10,1),new Ph(!0,5,7,16,6,1),new Ph(!1,8,10,12,12,1),new Ph(!0,10,11,14,6,2),new Ph(!1,12,12,14,14,1),new Ph(!0,16,14,24,10,1),new Ph(!1,18,14,16,16,1),new Ph(!1,22,18,18,18,1),new Ph(!0,22,18,16,10,2),new Ph(!1,30,20,20,20,1),new Ph(!0,32,24,16,14,2),new Ph(!1,36,24,22,22,1),new Ph(!1,44,28,24,24,1),new Ph(!0,49,28,22,14,2),new Ph(!1,62,36,14,14,4),new Ph(!1,86,42,16,16,4),new Ph(!1,114,48,18,18,4),new Ph(!1,144,56,20,20,4),new Ph(!1,174,68,22,22,4),new Ph(!1,204,84,24,24,4,102,42),new Ph(!1,280,112,14,14,16,140,56),new Ph(!1,368,144,16,16,16,92,36),new Ph(!1,456,192,18,18,16,114,48),new Ph(!1,576,224,20,20,16,144,56),new Ph(!1,696,272,22,22,16,174,68),new Ph(!1,816,336,24,24,16,136,56),new Ph(!1,1050,408,18,18,36,175,68),new Ph(!1,1304,496,20,20,36,163,62),new Bh],Lh=function(){function e(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split("").map((function(e){return e.charCodeAt(0)})),r=new Fs,n=0,i=t.length;n<i;n++){var o=String.fromCharCode(255&t[n]);if("?"===o&&"?"!==e.charAt(n))throw new Error("Message contains characters outside ISO-8859-1 encoding.");r.append(o)}this.msg=r.toString(),this.shape=0,this.codewords=new Fs,this.newEncoding=-1}return e.prototype.setSymbolShape=function(e){this.shape=e},e.prototype.setSizeConstraints=function(e,t){this.minSize=e,this.maxSize=t},e.prototype.getMessage=function(){return this.msg},e.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},e.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCodewords=function(){return this.codewords},e.prototype.writeCodewords=function(e){this.codewords.append(e)},e.prototype.writeCodeword=function(e){this.codewords.append(e)},e.prototype.getCodewordCount=function(){return this.codewords.length()},e.prototype.getNewEncoding=function(){return this.newEncoding},e.prototype.signalEncoderChange=function(e){this.newEncoding=e},e.prototype.resetEncoderSignal=function(){this.newEncoding=-1},e.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},e.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},e.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},e.prototype.getSymbolInfo=function(){return this.symbolInfo},e.prototype.updateSymbolInfo=function(e){void 0===e&&(e=this.getCodewordCount()),(null==this.symbolInfo||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=Ph.lookup(e,this.shape,this.minSize,this.maxSize,!0))},e.prototype.resetSymbolInfo=function(){this.symbolInfo=null},e}(),zh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zh(t,e),t.prototype.getEncodingMode=function(){return 3},t.prototype.encode=function(e){for(var t=new Fs;e.hasMoreCharacters();){var r=e.getCurrentChar();if(e.pos++,this.encodeChar(r,t),t.length()%3==0)if(this.writeNextTriplet(e,t),Gh.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},t.prototype.encodeChar=function(e,t){switch(e){case 13:t.append(0);break;case"*".charCodeAt(0):t.append(1);break;case">".charCodeAt(0):t.append(2);break;case" ".charCodeAt(0):t.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?t.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?t.append(e-65+14):Gh.illegalCharacter(Bs.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,t){e.updateSymbolInfo();var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),n=t.length();e.pos-=n,(e.getRemainingCharacters()>1||r>1||e.getRemainingCharacters()!==r)&&e.writeCodeword(254),e.getNewEncoding()<0&&e.signalEncoderChange(0)},t}(Rh),jh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jh(t,e),t.prototype.getEncodingMode=function(){return 2},t.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return t.append(e-97+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e==="`".charCodeAt(0))return t.append(2),t.append(0),2;if(e<="Z".charCodeAt(0))return t.append(2),t.append(e-65+1),2;if(e<=127)return t.append(2),t.append(e-123+27),2;t.append("1");var r=2;return r+=this.encodeChar(e-128,t)},t}(Rh),Hh=function(){function e(){}return e.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.encodeHighLevel=function(e,t,r,n,i){void 0===t&&(t=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=!1);var o=new Rh,a=[new Mh,o,new Vh,new Uh,new Oh,new Dh],s=new Lh(e);s.setSymbolShape(t),s.setSizeConstraints(r,n),e.startsWith(Ih)&&e.endsWith("")?(s.writeCodeword(236),s.setSkipAtEnd(2),s.pos+=Ih.length):e.startsWith(Th)&&e.endsWith("")&&(s.writeCodeword(237),s.setSkipAtEnd(2),s.pos+=Th.length);var u=0;for(i&&(o.encodeMaximal(s),u=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)a[u].encode(s),s.getNewEncoding()>=0&&(u=s.getNewEncoding(),s.resetEncoderSignal());var c=s.getCodewordCount();s.updateSymbolInfo();var l=s.getSymbolInfo().getDataCapacity();c<l&&0!==u&&5!==u&&4!==u&&s.writeCodeword("þ");var d=s.getCodewords();for(d.length()<l&&d.append(129);d.length()<l;)d.append(this.randomize253State(d.length()+1));return s.getCodewords().toString()},e.lookAheadTest=function(e,t,r){var n=this.lookAheadTestIntern(e,t,r);if(3===r&&3===n){for(var i=Math.min(t+3,e.length),o=t;o<i;o++)if(!this.isNativeX12(e.charCodeAt(o)))return 0}else if(4===r&&4===n)for(i=Math.min(t+4,e.length),o=t;o<i;o++)if(!this.isNativeEDIFACT(e.charCodeAt(o)))return 0;return n},e.lookAheadTestIntern=function(e,t,r){if(t>=e.length)return r;var n;0===r?n=[0,1,1,1,1,1.25]:(n=[1,2,2,2,2,2.25])[r]=0;for(var i=0,o=new Uint8Array(6),a=[];;){if(t+i===e.length){Es.fill(o,0),Es.fill(a,0);var s=this.findMinimums(n,a,Cs.MAX_VALUE,o),u=this.getMinimumCount(o);if(a[0]===s)return 0;if(1===u){if(o[5]>0)return 5;if(o[4]>0)return 4;if(o[2]>0)return 2;if(o[3]>0)return 3}return 1}var c=e.charCodeAt(t+i);if(i++,this.isDigit(c)?n[0]+=.5:this.isExtendedASCII(c)?(n[0]=Math.ceil(n[0]),n[0]+=2):(n[0]=Math.ceil(n[0]),n[0]++),this.isNativeC40(c)?n[1]+=2/3:this.isExtendedASCII(c)?n[1]+=8/3:n[1]+=4/3,this.isNativeText(c)?n[2]+=2/3:this.isExtendedASCII(c)?n[2]+=8/3:n[2]+=4/3,this.isNativeX12(c)?n[3]+=2/3:this.isExtendedASCII(c)?n[3]+=13/3:n[3]+=10/3,this.isNativeEDIFACT(c)?n[4]+=3/4:this.isExtendedASCII(c)?n[4]+=4.25:n[4]+=3.25,this.isSpecialB256(c)?n[5]+=4:n[5]++,i>=4){if(Es.fill(o,0),Es.fill(a,0),this.findMinimums(n,a,Cs.MAX_VALUE,o),a[0]<this.min(a[5],a[1],a[2],a[3],a[4]))return 0;if(a[5]<a[0]||a[5]+1<this.min(a[1],a[2],a[3],a[4]))return 5;if(a[4]+1<this.min(a[5],a[1],a[2],a[3],a[0]))return 4;if(a[2]+1<this.min(a[5],a[1],a[4],a[3],a[0]))return 2;if(a[3]+1<this.min(a[5],a[1],a[4],a[2],a[0]))return 3;if(a[1]+1<this.min(a[0],a[5],a[4],a[2])){if(a[1]<a[3])return 1;if(a[1]===a[3]){for(var l=t+i+1;l<e.length;){var d=e.charCodeAt(l);if(this.isX12TermSep(d))return 3;if(!this.isNativeX12(d))break;l++}return 1}}}}},e.min=function(e,t,r,n,i){var o=Math.min(e,Math.min(t,Math.min(r,n)));return void 0===i?o:Math.min(o,i)},e.findMinimums=function(e,t,r,n){for(var i=0;i<6;i++){var o=t[i]=Math.ceil(e[i]);r>o&&(r=o,Es.fill(n,0)),r===o&&(n[i]=n[i]+1)}return r},e.getMinimumCount=function(e){for(var t=0,r=0;r<6;r++)t+=e[r];return t||0},e.isDigit=function(e){return e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)},e.isExtendedASCII=function(e){return e>=128&&e<=255},e.isNativeC40=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},e.isNativeText=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)},e.isNativeX12=function(e){return this.isX12TermSep(e)||e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},e.isX12TermSep=function(e){return 13===e||e==="*".charCodeAt(0)||e===">".charCodeAt(0)},e.isNativeEDIFACT=function(e){return e>=" ".charCodeAt(0)&&e<="^".charCodeAt(0)},e.isSpecialB256=function(e){return!1},e.determineConsecutiveDigitCount=function(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n<r&&this.isDigit(e.charCodeAt(n));)n++;return n-t},e.illegalCharacter=function(e){var t=Cs.toHexString(e.charCodeAt(0));throw t="0000".substring(0,4-t.length)+t,new Error("Illegal character: "+e+" (0x"+t+")")},e}(),Gh=Hh,qh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wh=function(){function e(e){this.charset=e,this.name=e.name}return e.prototype.canEncode=function(e){try{return null!=Ps.encode(e,this.charset)}catch(e){return!1}},e}(),Kh=function(){function e(e,t,r){var n,i,o,a,s,u;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map((function(e){return new Wh(Ch.forName(e))})),this.encoders=[];var c=[];c.push(new Wh(xh.ISO_8859_1));for(var l=null!=t&&t.name.startsWith("UTF"),d=0;d<e.length;d++){var h=!1;try{for(var f=(n=void 0,qh(c)),p=f.next();!p.done;p=f.next()){var g=p.value,m=e.charAt(d);if(m.charCodeAt(0)===r||g.canEncode(m)){h=!0;break}}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}if(!h)try{for(var y=(o=void 0,qh(this.ENCODERS)),v=y.next();!v.done;v=y.next()){if((g=v.value).canEncode(e.charAt(d))){c.push(g),h=!0;break}}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}h||(l=!0)}if(1!==c.length||l){this.encoders=[];var w=0;try{for(var b=qh(c),_=b.next();!_.done;_=b.next()){g=_.value;this.encoders[w++]=g}}catch(e){s={error:e}}finally{try{_&&!_.done&&(u=b.return)&&u.call(b)}finally{if(s)throw s.error}}}else this.encoders=[c[0]];var A=-1;if(null!=t)for(d=0;d<this.encoders.length;d++)if(null!=this.encoders[d]&&t.name===this.encoders[d].name){A=d;break}this.priorityEncoderIndex=A}return e.prototype.length=function(){return this.encoders.length},e.prototype.getCharsetName=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].name},e.prototype.getCharset=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].charset},e.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},e.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},e.prototype.canEncode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return!0},e.prototype.encode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return Ps.encode(Bs.getCharAt(e),this.encoders[t].name)},e}(),Xh=function(){function e(e,t,r){this.fnc1=r;var n=new Kh(e,t,r);if(1===n.length())for(var i=0;i<this.bytes.length;i++){var o=e.charAt(i).charCodeAt(0);this.bytes[i]=o===r?1e3:o}else this.bytes=this.encodeMinimally(e,n,r)}return e.prototype.getFNC1Character=function(){return this.fnc1},e.prototype.length=function(){return this.bytes.length},e.prototype.haveNCharacters=function(e,t){if(e+t-1>=this.bytes.length)return!1;for(var r=0;r<t;r++)if(this.isECI(e+r))return!1;return!0},e.prototype.charAt=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},e.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw new Error(""+e);for(var r=new Fs,n=e;n<t;n++){if(this.isECI(n))throw new Error("value at "+n+" is not a character but an ECI");r.append(this.charAt(n))}return r.toString()},e.prototype.isECI=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},e.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return 1e3===this.bytes[e]},e.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},e.prototype.addEdge=function(e,t,r){(null==e[t][r.encoderIndex]||e[t][r.encoderIndex].cachedTotalSize>r.cachedTotalSize)&&(e[t][r.encoderIndex]=r)},e.prototype.addEdges=function(e,t,r,n,i,o){var a=e.charAt(n).charCodeAt(0),s=0,u=t.length();t.getPriorityEncoderIndex()>=0&&(a===o||t.canEncode(a,t.getPriorityEncoderIndex()))&&(u=(s=t.getPriorityEncoderIndex())+1);for(var c=s;c<u;c++)(a===o||t.canEncode(a,c))&&this.addEdge(r,n+1,new Yh(a,t,c,i,o))},e.prototype.encodeMinimally=function(e,t,r){var n=e.length,i=new(Yh[n+1][t.length()]);this.addEdges(e,t,i,0,null,r);for(var o=1;o<=n;o++){for(var a=0;a<t.length();a++)null!=i[o][a]&&o<n&&this.addEdges(e,t,i,o,i[o][a],r);for(a=0;a<t.length();a++)i[o-1][a]=null}var s=-1,u=Cs.MAX_VALUE;for(a=0;a<t.length();a++)if(null!=i[n][a]){var c=i[n][a];c.cachedTotalSize<u&&(u=c.cachedTotalSize,s=a)}if(s<0)throw new Error('Failed to encode "'+e+'"');for(var l=[],d=i[n][s];null!=d;){if(d.isFNC1())l.unshift(1e3);else{var h=t.encode(d.c,d.encoderIndex);for(o=h.length-1;o>=0;o--)l.unshift(255&h[o])}(null===d.previous?0:d.previous.encoderIndex)!==d.encoderIndex&&l.unshift(256+t.getECIValue(d.encoderIndex)),d=d.previous}var f=[];for(o=0;o<f.length;o++)f[o]=l[o];return f},e}(),Yh=function(){function e(e,t,r,n,i){this.c=e,this.encoderSet=t,this.encoderIndex=r,this.previous=n,this.fnc1=i,this.c=e===i?1e3:e;var o=this.isFNC1()?1:t.encode(e,r).length;(null===n?0:n.encoderIndex)!==r&&(o+=3),null!=n&&(o+=n.cachedTotalSize),this.cachedTotalSize=o}return e.prototype.isFNC1=function(){return 1e3===this.c},e}(),Zh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){e[e.ASCII=0]="ASCII",e[e.C40=1]="C40",e[e.TEXT=2]="TEXT",e[e.X12=3]="X12",e[e.EDF=4]="EDF",e[e.B256=5]="B256"}(Sh||(Sh={})),function(e){function t(t,r,n,i,o){var a=e.call(this,t,r,n)||this;return a.shape=i,a.macroId=o,a}Zh(t,e),t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape}}(Xh);var Jh=function(){function e(e){this.previous=e}return e.prototype.getPrevious=function(){return this.previous},e}(),$h=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qh=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.value=r,i.bitCount=n,i}return $h(t,e),t.prototype.appendTo=function(e,t){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,r){return new t(this,e,r)},t.prototype.addBinaryShift=function(e,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,r)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+Cs.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t}(Jh),ef=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r,n){var i=e.call(this,t,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=n,i}ef(t,e),t.prototype.appendTo=function(e,t){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):0===r?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+r],8)},t.prototype.addBinaryShift=function(e,r){return new t(this,e,r)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}(Qh);new Qh(null,0,0);var tf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){var t,r;try{for(var n=tf(e),i=n.next();!i.done;i=n.next()){var o=i.value;Es.fill(o,-1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15}(Es.createInt32Array(6,6)),function(e){var t=Bs.getCharCode(" "),r=Bs.getCharCode("."),n=Bs.getCharCode(",");e[0][t]=1;for(var i=Bs.getCharCode("Z"),o=Bs.getCharCode("A"),a=o;a<=i;a++)e[0][a]=a-o+2;e[1][t]=1;var s=Bs.getCharCode("z"),u=Bs.getCharCode("a");for(a=u;a<=s;a++)e[1][a]=a-u+2;e[2][t]=1;var c=Bs.getCharCode("9"),l=Bs.getCharCode("0");for(a=l;a<=c;a++)e[2][a]=a-l+2;e[2][n]=12,e[2][r]=13;for(var d=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],h=0;h<d.length;h++)e[3][Bs.getCharCode(d[h])]=h;var f=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(h=0;h<f.length;h++)Bs.getCharCode(f[h])>0&&(e[4][Bs.getCharCode(f[h])]=h)}(Es.createInt32Array(5,256));var rf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nf=function(e){function t(r){var n=e.call(this,r.width,r.height)||this;return n.canvas=r,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(r),n}return rf(t,e),t.makeBufferFromCanvasImageData=function(e){var r;try{r=e.getContext("2d",{willReadFrequently:!0})}catch(t){r=e.getContext("2d")}if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,r){for(var n=new Uint8ClampedArray(t*r),i=0,o=0,a=e.length;i<a;i+=4,o++){var s=void 0;if(0===e[i+3])s=255;else s=306*e[i]+601*e[i+1]+117*e[i+2]+512>>10;n[o]=s}return n},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new hs("Requested row is outside the image: "+e);var r=this.getWidth(),n=e*r;return null===t?t=this.buffer.slice(n,n+r):(t.length<r&&(t=new Uint8ClampedArray(r)),t.set(this.buffer.slice(n,n+r))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,r,n,i){return e.prototype.crop.call(this,t,r,n,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.invert=function(){return new Ks(this)},t.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,o=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(n))*i+Math.abs(Math.sin(n))*o),s=Math.ceil(Math.abs(Math.sin(n))*i+Math.abs(Math.cos(n))*o);r.width=a,r.height=s;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Canvas Context element.");return u.translate(a/2,s/2),u.rotate(n),u.drawImage(this.canvas,i/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(r),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(qs);function of(){return"undefined"!=typeof navigator}function af(){return!!(of()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var sf=function(){return sf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},sf.apply(this,arguments)},uf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},cf=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},lf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},df={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},hf=function(){function e(e,t,r){void 0===t&&(t=new Map),void 0===r&&(r={}),this.reader=e,this.hints=t,this.options=sf(sf({},df),r)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(e){this.hints.set(Is.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),e.addVideoSource=function(e,t){try{e.srcObject=t}catch(e){console.error("got interrupted by new loading request")}},e.mediaStreamSetTorch=function(e,t){return uf(this,void 0,void 0,(function(){return cf(this,(function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?"flash":"off",torch:!!t}]})];case 1:return r.sent(),[2]}}))}))},e.mediaStreamIsTorchCompatible=function(t){var r,n,i=t.getVideoTracks();try{for(var o=lf(i),a=o.next();!a.done;a=o.next()){var s=a.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(e){try{return"torch"in e.getCapabilities()}catch(e){return console.error(e),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},e.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},e.getMediaElement=function(e,t){var r=document.getElementById(e);if(!r)throw new ls("element with id '".concat(e,"' not found"));if(r.nodeName.toLowerCase()!==t.toLowerCase())throw new ls("element with id '".concat(e,"' must be an ").concat(t," element"));return r},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if("string"==typeof t)return e.getMediaElement(t,"video");if(!t&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if("string"==typeof t)return e.getMediaElement(t,"img");if(void 0===t){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},e.prepareVideoElement=function(t){var r=e.createVideoElement(t);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},e.isImageLoaded=function(e){return!!e.complete&&0!==e.naturalWidth},e.createBinaryBitmapFromCanvas=function(e){var t=new nf(e),r=new Gs(t);return new fs(r)},e.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},e.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimensions!")},e.createCaptureCanvas=function(t){if(!t)throw new ls("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=e.getMediaElementDimensions(t),i=n.width,o=n.height;return r.style.width=i+"px",r.style.height=o+"px",r.width=i,r.height=o,r},e.tryPlayVideo=function(t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:if(null==t?void 0:t.ended)return console.error("Trying to play video that has ended."),[2,!1];if(e.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}}))}))},e.createCanvasFromMediaElement=function(t){var r=e.createCaptureCanvas(t),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return e.drawImageOnCanvas(n,t),r},e.createBinaryBitmapFromMediaElem=function(t){var r=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(r)},e.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},e.listVideoInputDevices=function(){return uf(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l,d;return cf(this,(function(h){switch(h.label){case 0:if(!of())throw new Error("Can't enumerate devices, navigator is not present.");if(!af())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),t=[];try{for(r=lf(e),n=r.next();!n.done;n=r.next())i=n.value,"videoinput"===(o="video"===i.kind?"videoinput":i.kind)&&(a=i.deviceId||i.id,s=i.label||"Video device ".concat(t.length+1),u=i.groupId,c={deviceId:a,label:s,kind:o,groupId:u},t.push(c))}catch(e){l={error:e}}finally{try{n&&!n.done&&(d=r.return)&&d.call(r)}finally{if(l)throw l.error}}return[2,t]}}))}))},e.findDeviceById=function(t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find((function(e){return e.deviceId===t}))]:[2]}}))}))},e.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch(t){e.src=""}e&&e.removeAttribute("src")}},e.releaseAllStreams=function(){0!==e.streamTracker.length&&e.streamTracker.forEach((function(e){e.getTracks().forEach((function(e){return e.stop()}))})),e.streamTracker=[]},e.playVideoOnLoadAsync=function(t,r){return uf(this,void 0,void 0,(function(){return cf(this,(function(n){switch(n.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return n.sent()?[2,!0]:[2,new Promise((function(n,i){var o=setTimeout((function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener("canplay",a))}),r),a=function r(){e.tryPlayVideo(t).then((function(e){clearTimeout(o),t.removeEventListener("canplay",r),n(e)}))};t.addEventListener("canplay",a)}))]}}))}))},e.attachStreamToVideo=function(t,r,n){return void 0===n&&(n=5e3),uf(this,void 0,void 0,(function(){var i;return cf(this,(function(o){switch(o.label){case 0:return i=e.prepareVideoElement(r),e.addVideoSource(i,t),[4,e.playVideoOnLoadAsync(i,n)];case 1:return o.sent(),[2,i]}}))}))},e._waitImageLoad=function(t){return new Promise((function(r,n){var i=setTimeout((function(){e.isImageLoaded(t)||(t.removeEventListener("load",o),n())}),1e4),o=function e(){clearTimeout(i),t.removeEventListener("load",e),r()};t.addEventListener("load",o)}))},e.checkCallbackFnOrThrow=function(e){if(!e)throw new ls("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(e){e.getVideoTracks().forEach((function(e){return e.stop()})),e=void 0},e.prototype.decode=function(t){var r=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(r)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},e.prototype.decodeFromCanvas=function(t){var r=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(r)},e.prototype.decodeFromImageElement=function(t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:if(!t)throw new ls("An image element must be provided.");return r=e.prepareImageElement(t),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeFromImageUrl=function(t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:if(!t)throw new ls("An URL must be provided.");(r=e.prepareImageElement()).src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return e.destroyImageElement(r),[7];case 4:return[2]}}))}))},e.prototype.decodeFromConstraints=function(t,r,n){return uf(this,void 0,void 0,(function(){var i,o;return cf(this,(function(a){switch(a.label){case 0:return e.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(i,r,n)];case 3:return[2,a.sent()];case 4:throw o=a.sent(),e.disposeMediaStream(i),o;case 5:return[2]}}))}))},e.prototype.decodeFromStream=function(t,r,n){return uf(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,h=this;return cf(this,(function(f){switch(f.label){case 0:return e.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,r,i)];case 1:return o=f.sent(),a=function(){e.disposeMediaStream(t),e.cleanVideoSource(o)},s=this.scan(o,n,a),u=t.getVideoTracks(),c=sf(sf({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(e,t){return uf(this,void 0,void 0,(function(){var r,n,i,o,a,s;return cf(this,(function(c){switch(c.label){case 0:r=t?u.filter(t):u,c.label=1;case 1:c.trys.push([1,6,7,8]),n=lf(r),i=n.next(),c.label=2;case 2:return i.done?[3,5]:[4,i.value.applyConstraints(e)];case 3:c.sent(),c.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return o=c.sent(),a={error:o},[3,8];case 7:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}}))}))},streamVideoConstraintsGet:function(e){return u.find(e).getConstraints()},streamVideoSettingsGet:function(e){return u.find(e).getSettings()},streamVideoCapabilitiesGet:function(e){return u.find(e).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(l=null==u?void 0:u.find((function(t){return e.mediaStreamIsTorchCompatibleTrack(t)})),d=function(t){return uf(h,void 0,void 0,(function(){return cf(this,(function(r){switch(r.label){case 0:return[4,e.mediaStreamSetTorch(l,t)];case 1:return r.sent(),[2]}}))}))},c.switchTorch=d,c.stop=function(){return uf(h,void 0,void 0,(function(){return cf(this,(function(e){switch(e.label){case 0:return s.stop(),[4,d(!1)];case 1:return e.sent(),[2]}}))}))}),[2,c]}}))}))},e.prototype.decodeFromVideoDevice=function(t,r,n){return uf(this,void 0,void 0,(function(){var i;return cf(this,(function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(n),i={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(i,r,n)];case 1:return[2,o.sent()]}}))}))},e.prototype.decodeFromVideoElement=function(t,r){return uf(this,void 0,void 0,(function(){var n,i;return cf(this,(function(o){switch(o.label){case 0:if(e.checkCallbackFnOrThrow(r),!t)throw new ls("A video element must be provided.");return n=e.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,i)];case 1:return o.sent(),[2,this.scan(n,r)]}}))}))},e.prototype.decodeFromVideoUrl=function(t,r){return uf(this,void 0,void 0,(function(){var n,i,o;return cf(this,(function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(r),!t)throw new ls("An URL must be provided.");return(n=e.prepareVideoElement()).src=t,i=function(){e.cleanVideoSource(n)},o=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,o)];case 1:return a.sent(),[2,this.scan(n,r,i)]}}))}))},e.prototype.decodeOnceFromConstraints=function(e,t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:return[4,this.getUserMedia(e)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,t)];case 2:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromStream=function(t,r){return uf(this,void 0,void 0,(function(){var n,i;return cf(this,(function(o){switch(o.label){case 0:return n=Boolean(r),[4,e.attachStreamToVideo(t,r)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return[2,o.sent()];case 4:return n||e.cleanVideoSource(i),[7];case 5:return[2]}}))}))},e.prototype.decodeOnceFromVideoDevice=function(e,t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromVideoElement=function(t){return uf(this,void 0,void 0,(function(){var r,n;return cf(this,(function(i){switch(i.label){case 0:if(!t)throw new ls("A video element must be provided.");return r=e.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,n)];case 1:return i.sent(),[4,this.scanOneResult(r)];case 2:return[2,i.sent()]}}))}))},e.prototype.decodeOnceFromVideoUrl=function(t){return uf(this,void 0,void 0,(function(){var r,n;return cf(this,(function(i){switch(i.label){case 0:if(!t)throw new ls("An URL must be provided.");(r=e.prepareVideoElement()).src=t,n=this.decodeOnceFromVideoElement(r),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return e.cleanVideoSource(r),[7];case 4:return[2]}}))}))},e.prototype.scanOneResult=function(e,t,r,n){var i=this;return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise((function(o,a){i.scan(e,(function(e,i,s){if(e)return o(e),void s.stop();if(i){if(i instanceof Us&&t)return;if(i instanceof gs&&r)return;if(i instanceof Ms&&n)return;s.stop(),a(i)}}))}))},e.prototype.scan=function(t,r,n){var i=this;e.checkCallbackFnOrThrow(r);var o,a=e.createCaptureCanvas(t);try{o=a.getContext("2d",{willReadFrequently:!0})}catch(e){o=a.getContext("2d")}if(!o)throw new Error("Couldn't create canvas for visual element scan.");var s,u=function(){o=void 0,a=void 0},c=!1,l={stop:function(){c=!0,clearTimeout(s),u(),n&&n()}};return function d(){if(!c)try{e.drawImageOnCanvas(o,t);var h=i.decodeFromCanvas(a);r(h,void 0,l),s=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(e){if(r(void 0,e,l),e instanceof gs||e instanceof Ms||e instanceof Us)return void(s=setTimeout(d,i.options.delayBetweenScanAttempts));u(),n&&n(e)}}(),l},e.prototype._decodeOnLoadImage=function(t){return uf(this,void 0,void 0,(function(){return cf(this,(function(r){switch(r.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(t)]}}))}))},e.prototype.getUserMedia=function(t){return uf(this,void 0,void 0,(function(){var r;return cf(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),e.streamTracker.push(r),[2,r]}}))}))},e.streamTracker=[],e}(),ff=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new ku,t,r)||this}ff(t,e)}(hf);var pf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new gl(t),t,r)||this}pf(t,e)}(hf);var gf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new Rl,t,r)||this}gf(t,e)}(hf);var mf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yf=function(e){function t(t,r){var n=this,i=new nh;return i.setHints(t),(n=e.call(this,i,t,r)||this).reader=i,n}return mf(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Is.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t}(hf),vf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new Qd,t,r)||this}vf(t,e)}(hf);var wf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new ld,t,r)||this}wf(t,e)}(hf);const bf=[nu.PDF_417,nu.QR_CODE];class _f{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bf;this.reader=new yf,this.reader.possibleFormats=e,ts("Barcode detector initialized",e.map((e=>nu[e])))}getXYWidthHeight(e){if(!e||0===e.length)return{x:0,y:0,width:0,height:0};let t=1/0,r=-1/0,n=1/0,i=-1/0;for(const o of e){const e=o.getX(),a=o.getY();e<t&&(t=e),e>r&&(r=e),a<n&&(n=a),a>i&&(i=a)}return{x:t,y:n,width:r-t,height:i-n}}async detect(e){let t;if(e instanceof HTMLCanvasElement)t=e;else{t=document.createElement("canvas"),t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(!r)return ts("Warning: Unable to get 2D context for canvas."),[];null==r||r.drawImage(e,0,0)}try{const e=await this.reader.decodeFromCanvas(t);ts("Barcode detected:",e);const r=this.getXYWidthHeight(e.getResultPoints()),n={class:nu[e.getBarcodeFormat()],score:1,extra:e.getText(),x:r.x,y:r.y,width:r.width,height:r.height};return ts("Barcode result:",n),[n]}catch(e){return ts("Barcode not detected"),"NotFoundException"!==(null==e?void 0:e.name)&&ts("Barcode detection error:",e),[]}}}var Af;!function(e){e.NOT_AVAILABLE="notAvailable",e.LOADING="loading",e.LOADED="loaded"}(Af||(Af={}));const Ef={[rs.DOCUMENT_DETECTOR]:{status:Af.LOADING},[rs.BLUR_GLARE_CLASSIFIER]:{status:Af.LOADING},[rs.FACE_LANDMARK]:{status:Af.LOADING}};let Cf=null;function xf(){if(Cf)return ts("Reusing existing barcode detector instance"),Cf;try{return Cf=new _f,ts("Created new barcode detector instance"),Cf}catch(e){throw ts("Error initializing barcode model",e),Qa("Error initializing barcode model","barcode_model_not_supported","init"),e}}const Sf=[rs.DOCUMENT_DETECTOR,rs.BLUR_GLARE_CLASSIFIER],If=async()=>{let e=!1;for(;!e;){const t=Object.values(Ef).filter((e=>e.status===Af.NOT_AVAILABLE));if(t.length>0)throw new Error(`Model not available: ${t.join(", ")}`);if(e=Sf.every((e=>Ef[e].status===Af.LOADED)),e)return!0;await new Promise((e=>setTimeout(e,100)))}},Tf=e=>"function"==typeof e,Mf=function(e){};Ma.events.on(Ma.events.MODULE_INITIALIZED,(function(){const{clientId:e,IDV:r}=Ma.moduleMetadata.getInitConfig();if(!e||!r)return!1;const n=(null==r?void 0:r.serverPath)&&(i=null==r?void 0:r.serverPath,o="/verify",(null==i?void 0:i.endsWith(o))?i.slice(0,i.length-o.length):i);var i,o;so.BASE=n||window.location.origin,Ga.dispatch("setClientId",e),Ga.dispatch("setRootElement",(null==r?void 0:r.rootElement)||"root-element"),Ga.dispatch("setServerPath",null==r?void 0:r.serverPath),Ga.dispatch("setLanguage",null==r?void 0:r.language),Ga.dispatch("setCallback",null==r?void 0:r.callback),Ga.dispatch("setConsentVersion",null==r?void 0:r.consentVersion),Ga.dispatch("setMarkdownSupportText",null==r?void 0:r.markdownSupportText),Ga.dispatch("setVideoCaptureSettings",null==r?void 0:r.videoCaptureSettings),Ga.dispatch("setCdnHost",null==r?void 0:r.cdnHost),Ga.dispatch("setIsImageSigningEnabled",null==r?void 0:r.isImageSigningEnabled),(null==r?void 0:r.callbacks)&&(e=>{let{callbacks:t,callback:r}=e;Tf(t.sessionGranted)&&(Df=t.sessionGranted);Tf(t.sessionStarted)&&(Rf=t.sessionStarted);Tf(t.imageSubmitted)&&(Of=t.imageSubmitted);Tf(t.processing)&&(kf=t.processing);Tf(t.completed)&&(Nf=t.completed);Tf(t.recapture)&&(Pf=t.recapture);Tf(t.error)&&(Bf=t.error);Tf(r)&&(Ff=r)})(r);return Ga.dispatch("setStartToken",null==r?void 0:r.startToken),ja(Ga.state.clientId).then((e=>{!async function(e){if(null==e?void 0:e.autocapture_enabled){if("serviceWorker"in navigator)return Ga.dispatch("setAutoCaptureSettings",{enabled:!0,settings:e.autocapture_settings}),ts("service worker available"),navigator.serviceWorker.addEventListener("message",(e=>{if(e.data&&"MODEL_READY"===e.data.type){const r=e.data.modelName;Ef[r]={status:Af.LOADED,imageDimensions:e.data.imageDimensions,loadingStats:t(t({},e.data.stats),{},{modelName:r})}}else if(e.data&&"MODEL_LOAD_ERROR"===e.data.type){const t=e.data.modelName;Ef[t].status=Af.NOT_AVAILABLE,Qa(`${e.data.modelName} error: ${e.data.error}`,"model_load_error","init")}})),void xf();Qa("service worker not available","service_worker_not_available","init")}Ga.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:e.autocapture_settings})}(e)})),function(e){Ba({type:"init",step:e})}("init"),!0})),Ma.events.on(Da,(function(e){switch($a.handelEventData(e),Ff(e),e.type){case"session-granted":Df({session:Ga.state.sessionId});break;case"session-id-acquired":Rf({session:Ga.state.sessionId});break;case"capture-image-result":Of({session:Ga.state.sessionId},e.imageType);break;case"start-verification-processing":kf({session:Ga.state.sessionId});break;case"verification-complete":Nf({session:Ga.state.sessionId});break;case"capture-error":case"failed-to-init-drs":case"api-request-error":Bf({session:Ga.state.sessionId},e.errorCode,e.error);break;case"verification-recapture":Pf({session:Ga.state.sessionId},e.reason)}}));let Df=Mf,Rf=Mf,Of=Mf,kf=Mf,Nf=Mf,Pf=Mf,Bf=Mf,Ff=e=>{};async function Lf(e,t,r){so.HEADERS=vo(r,t);var n;return(await(n=e,Ua({method:"GET",url:`/verify/api/v1/verification/${n}/status`,path:{sid:n},errors:{404:"Session not found"}},"processing"))).body}function zf(e){try{return JSON.parse(e)}catch(e){return console.error(e),null}}async function Uf(e,t,r,n){so.HEADERS=vo(t);const i=await(o={start_token:e,accessed_from_desktop:!1,client_type:ho.client_type.MOBILE_SDK,consent:{granted:!0,document_id:r},image_signing_public_key:n},Ua({method:"POST",url:"/verify/api/v1/verification/start",headers:{},body:o,mediaType:"application/json"},"init"));var o;return{sessionId:i.body.session_id,userToken:i.body.user_token,requiredImages:i.body.required_images}}async function jf(e,t,r){let n,i,o;if(n)try{n=ka(Oa);const e=JSON.parse(n);i=e.sessionId,o=e.userToken}catch(e){}try{let a;if(o){a=(await Lf(i,o,r)).missing_images}else{const s=Ma.crypto.createCryptoBinding("sign"),u=await s.getPublicData(),c=await Uf(e,r,t,u.publicKey);i=c.sessionId,o=c.userToken,a=c.requiredImages,n=JSON.stringify({sessionId:i,userToken:o}),function(e,t){sessionStorage.setItem(e,t)}(Oa,n)}return{requiredImages:a,sessionId:i.toString(),userToken:o.toString()}}catch(e){throw console.log("Error starting session"),console.error(e),e}}function Vf(e){let{tagName:t,style:r,id:n="",className:i="",testid:o,options:a}=e;const s=document.createElement(t,a);return s.id=n,s.className=i,s.setAttribute("data-auto",o+"-auto"),Object.keys(r).forEach((e=>{s.style[e]=r[e]})),s}function Hf(e,t){Array.isArray(t)?t.forEach((t=>{e.appendChild(t)})):e.appendChild(t)}const Gf={blur_message:"Please focus camera on the document before capturing",blur_title:"Blurred image",document_incorrect_position_message:"Please make sure the document is fully within the frame, and nothing covers it",document_incorrect_position_title:"Incorrect document position",document_not_found_message:"Make sure you capture a valid government issued ID",document_not_found_title:"Document not detected",document_not_matching_message:"Please make sure to capture the back side of the document",document_not_matching_title:"Back image mismatch",document_not_supported_message:"Please use a different government issued ID instead",document_not_supported_title:"Document not supported",capturing_in_progress_message:"Capturing, stay steady",capturing_in_progress_title:"Capturing in progress",face_not_found_message:"Ensure your face is not covered and fully visible",face_not_found_title:"Face not detected",glare_message:"Avoid any direct light reflecting with glare",glare_title:"Glare detected",main_title_document_back:"Back side",main_title_document_face:"Selfie",main_title_document_front:"Front side",obstructed_message:"Some of the document parts are covered or missing",obstructed_title:"Missing information",other_error_code_message:"Please try again",other_error_code_title:"An error occurred",page_header_document:"Scan document",loading_screen_small_title:"Preparing...",page_header_face:"Face Recognition",second_title_document_back:"Please place your document on a solid surface, back side up.",second_title_document_face:"Please position your face in the center of the oval below.",second_title_document_front:"Please place your document on a solid surface, photo side up.",wrong_document_side_message:"The wrong document side has been detected",wrong_document_side_title:"Wrong document side detected",face_angle_too_large_title:"your face is not directly aligned with the camera",face_angle_too_large_message:"Please take another photo with your face fully visible for accurate detection",face_close_to_border_title:"Your face is too close to the edge",face_close_to_border_message:"Please adjust your position and make sure your entire face is within the frame",face_too_small_title:"Your face is too distant from the edge",face_too_small_message:"Please move closer to the camera so your face is clearer and easier to detect",face_too_close_title:"Your face is too close ",face_too_close_message:"Please adjust your position and make sure your entire face is within the frame",face_cropped_title:"Your face is partially cropped",face_cropped_message:"Please adjust your position and make sure your entire face is within the frame for optimal",no_face_title:"Face not found",no_face_message:"Please move closer to the camera or adjust your position so your face is clearer and easier to detect",multi_face_title:"Multiple faces detected",multi_face_message:"Please make sure only one face is visible in the frame to proceed",blur_selfie_title:"The selfie is out of focus",blur_selfie_message:"Please try taking another one with clearer focus for better detection",glare_selfie_title:"Too much reflection in your selfie",glare_selfie_message:"Please try taking another photo with better lighting and without glare for accurate detection",closed_eyes_title:"It looks like your eyes are closed",closed_eyes_message:"Please retake the photo with your eyes open",face_occluded_title:"Your face is partially hidden",face_occluded_message:"Please take another photo with your face fully visible for accurate detection",face_rotated_title:"Your face is not directly aligned with the camera",face_rotated_message:"Please take another photo with your face fully visible for accurate detection",barcode_not_found_title:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",barcode_not_found_message:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",searching_document_autocapture:"Searching for document",capturing_document_autocapture:"Capturing, please hold steady",click_manual_autocapture:"Click to capture manually",glare_blur_issues_autocapture:"Please make sure there are no light reflections, and try again",doc_not_in_frame_issues_autocapture:"Please bring the document closer and ensure it is fully within the capture frame for a clear image.",doc_not_found_autocapture:"Looking for document",capturing_face_issue_closer:"Please move closer to the frame",second_title_face_autocapture:"Get ready! Your selfie will be auto-captured, or tap to capture it manually",capturing_face_autocapture3:"Capturing... please, hold steady for 3",capturing_face_autocapture2:"Capturing... please, hold steady for 2",capturing_face_autocapture1:"Capturing... please, hold steady for 1",selfie_approval_autocapture:"Great job! Approve your selfie to continue",approve_button:"Approve",retake_button:"Retake"};const qf=new class{constructor(e){this.translations=e,this.translations=new Proxy(this.translations,{get:function(e,t){return e[t]},set:function(e,t,r){return e[t]=r,!0}})}overrideLanguage(e){Object.assign(this.translations,e)}translate(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];let i=this.translations[e];return i||(i=e),i.replace(/{(\d+)}/g,(function(e,t){return void 0!==r[t]?r[t]:e}))}}(Gf),Wf={en:Gf,es:{blur_message:"Favor enfoca la cĆ”mara en tĆŗ cĆ©dula antes de la captura",blur_title:"Imagen borrosa",document_incorrect_position_message:"AsegĆŗrate de que la cĆ©dula estĆ© completamente dentro del marco y nada la cubra",document_incorrect_position_title:"Posición incorrecta del documento",capturing_in_progress_title:"Capturando en progreso",capturing_in_progress_message:"Capturando, mantente estable",document_not_found_message:"AsegĆŗrate de utilizar una cĆ©dula valida",document_not_found_title:"CĆ©dula no detectada",document_not_matching_message:"Favor AsegĆŗrate de capturar la parte trasera de tu cĆ©dula",document_not_matching_title:"Parte trasera no corresponde",document_not_supported_message:"Favor utliza tu cĆ©dula",document_not_supported_title:"CĆ©dula no compatible",face_not_found_message:"Asegurase de no tapar su rostro",face_not_found_title:"Selfie no detectada",glare_message:"Evite luz directa que pueda generar brillo",glare_title:"Demasiado brillo",main_title_document_back:"Parte trasera de tu cĆ©dula",main_title_document_face:"Tómate un Selfie",main_title_document_front:"Parte frontal de tu cĆ©dula",obstructed_message:"Parte de la cĆ©dula documento no estĆ” visible o falta información",obstructed_title:"Falta información",other_error_code_message:"Intenta nuevamente",other_error_code_title:"Ha ocurrido un error",page_header_document:"EscanĆ©a tu cĆ©dula",page_header_face:"Reconocimiento Facial",second_title_document_back:"AsegĆŗrate de poner su cĆ©dula en una superfice plana con la parte trasera visible.",second_title_document_face:"AsegĆŗrate de posicionar tu rostro en el centro del circulo.",second_title_document_front:"AsegĆŗrate de poner su cĆ©dula en una superfice plana con la parte frontal visible.",wrong_document_side_message:"Lado incorrecto de tu cĆ©dula ha sido detectado",wrong_document_side_title:"Lado de tu cĆ©dula incorrecto",face_angle_too_large_title:"Tu rostro no estĆ” directamente alineado con la cĆ”mara.",face_angle_too_large_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_close_to_border_title:"Tu rostro estĆ” demasiado cerca del borde.",face_close_to_border_message:"Por favor, cambia la posicion de tu rostro y asegĆŗrate de que todo tu rostro estĆ© dentro del marco.",face_too_small_title:"Tu rostro estĆ” demasiado lejos del borde.",face_too_small_message:"Por favor, acĆ©rcate mĆ”s a la cĆ”mara para que tu rostro estĆ© mĆ”s claro y sea mĆ”s fĆ”cil de detectar.",face_too_close_title:"Tu rostro estĆ” demasiado cerca",face_too_close_message:"Acomode la posición y asegĆŗrese de que toda su rostro estĆ© dentro del marco.",face_cropped_title:"Tu rostro estĆ” parcialmente recortado.",face_cropped_message:"Por favor, cambia tu posición y asegĆŗrate de que todo tu rostro estĆ© dentro del marco para una detección óptima.",no_face_title:"Rostro no encontrado.",no_face_message:"Por favor, acĆ©rcate mĆ”s a la cĆ”mara o ajusta tu posición para que tu rostro estĆ© mĆ”s claro y sea mĆ”s fĆ”cil de detectar.",multi_face_title:"Se detectaron mĆŗltiples rostros.",multi_face_message:"Por favor, asegĆŗrate de que solo haya un rostro visible en el marco para continuar.",blur_selfie_title:"El autorretrato estĆ” fuera de foco.",blur_selfie_message:"Por favor, intenta tomar una nueva imagen con un enfoque mĆ”s claro para una mejor detección.",glare_selfie_title:"Demasiado reflejo en tu autorretrato.",glare_selfie_message:"Por favor, intenta tomar otra foto con una mejor iluminación y sin brillos para una detección precisa.",closed_eyes_title:"Parece que tienes los ojos cerrados.",closed_eyes_message:"Por favor, vuelve a tomar la foto con los ojos abiertos.",face_occluded_title:"Tu rostro estĆ” parcialmente oculto.",face_occluded_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_rotated_title:"Tu rostro estĆ” fuera de foco.",face_rotated_message:"Por favor, intenta tomar otro con un enfoque mĆ”s claro para una mejor detección.",barcode_not_found_title:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar mĆ”s despejado.",barcode_not_found_message:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar mĆ”s despejado.",searching_document_autocapture:"Buscando la cedula",capturing_document_autocapture:"Capturando, por favor mantente quieto",click_manual_autocapture:"Haz clic para capturar manualmente",glare_blur_issues_autocapture:"Por favor, asegĆŗrate de que no haya reflejos de luz antes de intentarlo de nuevo",doc_not_in_frame_issues_autocapture:"Por favor, acerque la cedula y asegĆŗrese de que estĆ© completamente dentro del marco de captura para obtener una imagen clara",second_title_face_autocapture:"Ā”PrepĆ”rate! Tu selfie se capturarĆ” automĆ”ticamente, o toca para capturarla manualmente",capturing_face_autocapture3:"Capturando... por favor, mantente quieto durante 3",capturing_face_autocapture2:"Capturando... por favor, mantente quieto durante 2",capturing_face_autocapture1:"Capturando... por favor, mantente quieto durante 1",selfie_approval_autocapture:"Ā”Buen trabajo! Aprueba tu selfie para continuar",approve_button:"Aprobar",retake_button:"Volver a tomar"},pt:{blur_message:"Por favor, foque a cĆ¢mera no documento antes de capturar",blur_title:"Imagem borrada",document_incorrect_position_message:"Certifique-se de que o documento esteja totalmente dentro do quadro e nada o cubra",document_incorrect_position_title:"Posição incorreta do documento",document_not_found_message:"Certifique-se de capturar um documento vĆ”lido emitido pelo governo",document_not_found_title:"Documento nĆ£o detectado",document_not_matching_message:"Por favor, certifique-se de capturar o verso do documento",document_not_matching_title:"Imagem do verso incorreta",document_not_supported_message:"Por favor, utilize um documento diferente emitido pelo governo",document_not_supported_title:"Documento nĆ£o suportado",capturing_in_progress_message:"Capturando, mantenha-se firme",capturing_in_progress_title:"Captura em andamento",face_not_found_message:"Certifique-se de que seu rosto nĆ£o esteja coberto e esteja totalmente visĆvel",face_not_found_title:"Rosto nĆ£o detectado",glare_message:"Evite qualquer luz direta refletindo com brilho",glare_title:"Brilho detectado",main_title_document_back:"Verso",main_title_document_face:"Selfie",main_title_document_front:"Frente",obstructed_message:"Algumas partes do documento estĆ£o encobertas ou ausentes",obstructed_title:"InformaƧƵes incompletas",other_error_code_message:"Por favor, tente novamente",other_error_code_title:"Ocorreu um eprro",page_header_document:"Digitalizar o documento",page_header_face:"Reconhecimento facial",second_title_document_back:"Coloque o documento em uma superfĆcie sólida, com o verso voltado para cima.",second_title_document_face:"Por favor, posicione seu rosto no centro do oval abaixo.",second_title_document_front:"Coloque o documento em uma superfĆcie sólida, com a foto voltada para cima.",wrong_document_side_message:"O lado errado do documento foi detectado",wrong_document_side_title:"Lado incorreto do documento identificado",face_angle_too_large_title:"Seu rosto nĆ£o estĆ” diretamente alinhado com a cĆ¢mera.",face_angle_too_large_message:"Tire outra foto com seu rosto totalmente visĆvel para uma detecção precisa.",face_close_to_border_title:"Seu rosto estĆ” muito próximo da borda.",face_close_to_border_message:"Por favor, reposicione seu rosto e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_too_small_title:"Seu rosto estĆ” muito longe da borda.",face_too_small_message:"Aproxime-se da cĆ¢mera para que seu rosto fique mais claro e fĆ”cil de detectar.",face_too_close_title:"Seu rosto estĆ” muito perto",face_too_close_message:"Ajuste a posição e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_cropped_title:"Seu rosto estĆ” parcialmente cortado.",face_cropped_message:"Mude sua posição e certifique-se de que todo o seu rosto esteja dentro do enquadramento para uma detecção ideal.",no_face_title:"Rosto nĆ£o encontrado..",no_face_message:"Aproxime-se da cĆ¢mera ou ajuste sua posição para que seu rosto fique mais claro e fĆ”cil de detectar.",multi_face_title:"VĆ”rios rostos foram detectados.",multi_face_message:"Certifique-se de que haja apenas um rosto visĆvel no quadro para continuar.",blur_selfie_title:"O autorretrato estĆ” fora de foco.",blur_selfie_message:"Tente tirar uma nova imagem com foco mais claro para melhor detecção.",glare_selfie_title:"Muita reflexĆ£o em seu autorretrato.",glare_selfie_message:"Tente tirar outra foto com melhor iluminação e sem brilho para uma detecção precisa.",closed_eyes_title:"Parece que seus olhos estĆ£o fechados.",closed_eyes_message:"Por favor, tire a foto novamente com os olhos abertos.",face_occluded_title:"Seu rosto estĆ” parcialmente oculto.",face_occluded_message:"Tire outra foto com seu rosto totalmente visĆvel para uma detecção precisa.",face_rotated_title:"Seu rosto estĆ” fora de foco.",face_rotated_message:"Por favor, tente pegar outro com foco mais claro para melhor detecção.",barcode_not_found_title:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocĆ”-lo em um local mais claro.",barcode_not_found_message:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocĆ”-lo em um local mais claro.",searching_document_autocapture:"Buscando o documento",capturing_document_autocapture:"Capturando, por favor mantenha-se imóvel",click_manual_autocapture:"Clique para capturar manualmente.",glare_blur_issues_autocapture:"Por favor, certifique-se de que nĆ£o hĆ” reflexos de luz antes de tentar novamente",doc_not_in_frame_issues_autocapture:"Por favor, aproxime o documento e certifique-se de que estĆ” totalmente dentro da moldura de captura para uma imagem nĆtida",second_title_face_autocapture:"Prepare-se! Sua selfie serĆ” capturada automaticamente, ou toque para capturĆ”-la manualmente",capturing_face_autocapture3:"Capturando... por favor, fique parado por 3",capturing_face_autocapture2:"Capturando... por favor, fique parado por 2",capturing_face_autocapture1:"Capturando... por favor, fique parado por 1",selfie_approval_autocapture:"Ćtimo trabalho! Aprove sua selfie para continuar",approve_button:"Aprovar",retake_button:"Tirar novamente"},frCa:{blur_message:"Veuillez faire la mise au point de lāappareil photo sur le document avant de le capturer",blur_title:"Image floue",document_not_found_message:"Munissez-vous dāune piĆØce dāidentitĆ© valide dĆ©livrĆ©e par le gouvernement",document_not_found_title:"Document non dĆ©tectĆ©",document_not_matching_message:"Veillez Ć capturer le verso du document",document_not_matching_title:"Non-concordance entre les images du recto et du verso",document_not_supported_message:"Veuillez utiliser une autre piĆØce dāidentitĆ© dĆ©livrĆ©e par le gouvernement",document_not_supported_title:"Document non pris en charge",face_not_found_message:"Assurez-vous que votre visage nāest pas couvert et quāil est entiĆØrement visible",face_not_found_title:"Visage non dĆ©tectĆ©",glare_message:"Ćvitez la lumiĆØre directe qui pourrait se reflĆ©ter sur le document",glare_title:"Reflet dĆ©tectĆ©",main_title_document_back:"Verso",main_title_document_face:"Ćgoportrait",main_title_document_front:"Face avant",obstructed_message:"Le document comporte des parties manquantes ou couvertes",obstructed_title:"Informations manquantes",other_error_code_message:"Veuillez rĆ©essayer",other_error_code_title:"Une erreur sāest produite",page_header_document:"NumĆ©riser le document",page_header_face:"Reconnaissance faciale",second_title_document_back:"Veuillez placer votre document sur une surface solide, le verso vers le haut.",second_title_document_face:"Veuillez positionner votre visage au centre de lāovale ci-dessous.",second_title_document_front:"Veuillez placer votre document sur une surface solide, photo vers le haut.",wrong_document_side_message:"Le mauvais cĆ“tĆ© du document a Ć©tĆ© dĆ©tectĆ©",wrong_document_side_title:"Mauvais cĆ“tĆ© du document dĆ©tectĆ©",face_angle_too_large_title:"votre visage nāest pas directement alignĆ© avec lāappareil photo",face_angle_too_large_message:"Veuillez prendre une autre photo avec votre visage entiĆØrement visible pour une dĆ©tection prĆ©cise",face_close_to_border_title:"Votre visage est trop prĆØs du bord",face_close_to_border_message:"Veuillez ajuster votre position et vous assurer que lāensemble de votre visage se trouve dans le cadre",face_too_small_title:"Votre visage est trop Ć©loignĆ© du bord",face_too_small_message:"Veuillez vous rapprocher de la camĆ©ra pour que votre visage soit plus clair et plus facile Ć dĆ©tecter",face_too_close_title:"Votre visage est trop proche",face_too_close_message:"Veuillez ajuster votre position et vous assurer que lāensemble de votre visage se trouve dans le cadre",face_cropped_title:"Votre visage est partiellement rognĆ©",face_cropped_message:"Veuillez ajuster votre position et vous assurer que lāensemble de votre visage se trouve dans le cadre pour optimiser",no_face_title:"Visage introuvable",no_face_message:"Veuillez vous rapprocher de la camĆ©ra ou ajuster votre position pour que votre visage soit plus clair et plus facile Ć dĆ©tecter",multi_face_title:"Plusieurs visages dĆ©tectĆ©s",multi_face_message:"Veuillez vous assurer quāun seul visage est visible dans le cadre pour continuer",blur_selfie_title:"LāĆ©goportrait nāest pas net",blur_selfie_message:"Essayez dāen prendre un autre avec une mise au point plus claire pour une meilleure dĆ©tection",glare_selfie_title:"Trop de reflets sur votre Ć©goportrait",glare_selfie_message:"Veuillez essayer de prendre une autre photo avec un meilleur Ć©clairage et sans reflet pour une dĆ©tection prĆ©cise",closed_eyes_title:"Il semble que vos yeux soient fermĆ©s.",closed_eyes_message:"Veuillez reprendre la photo avec les yeux ouverts",face_occluded_title:"Votre visage est partiellement cachĆ©.",face_occluded_message:"Veuillez prendre une autre photo avec votre visage entiĆØrement visible pour une dĆ©tection prĆ©cise",face_rotated_title:"votre visage nāest pas directement alignĆ© avec lāappareil photo",face_rotated_message:"Veuillez prendre une autre photo avec votre visage entiĆØrement visible pour une dĆ©tection prĆ©cise",barcode_not_found_title:"Nous avons des difficultĆ©s Ć capturer certains Ć©lĆ©ments importants de votre document. Veuillez essayer de le placer Ć un endroit plus clair",barcode_not_found_message:"Nous avons des difficultĆ©s Ć capturer certains Ć©lĆ©ments importants de votre document. Veuillez essayer de le placer Ć un endroit plus clair",searching_document_autocapture:"Recherche du document",capturing_document_autocapture:"Capture en cours, veuillez rester immobile",click_manual_autocapture:"Cliquez pour capturer manuellement",glare_blur_issues_autocapture:"Veuillez vous assurer quāil nāy a pas de reflets de lumiĆØre avant de rĆ©essayer",doc_not_in_frame_issues_autocapture:"Veuillez rapprocher le document et assurez-vous quāil soit entiĆØrement dans le cadre de capture pour une image claire",second_title_face_autocapture:"PrĆ©parez-vous! Votre selfie sera capturĆ© automatiquement, ou appuyez pour le capturer manuellement",capturing_face_autocapture3:"Capture... en cours, veuillez rester immobile pendant 3",capturing_face_autocapture2:"Capture... en cours, veuillez rester immobile pendant 2",capturing_face_autocapture1:"Capture... en cours, veuillez rester immobile pendant 1",selfie_approval_autocapture:"Bon travail! Approuvez votre selfie pour continuer",approve_button:"Approuver",retake_button:"Reprendre"}};const Kf=async(e,t,r,n,i,o)=>{var a,s,u,c,l,d,h;so.HEADERS=vo(r,t);const f=fo.UAParser();let p;if(Ga.state.isImageSigningEnabled){const e=Ma.crypto.createCryptoBinding("sign");p=await e.sign(n.data)}const g=await(m=e,y={image:{format:n.format,image_type:o,content:n.data,capture_margins:n.captureMargins,signature:p},device_info:{model:null===(a=null==f?void 0:f.device)||void 0===a?void 0:a.model,type:null===(s=null==f?void 0:f.device)||void 0===s?void 0:s.type,manufacturer:null===(u=null==f?void 0:f.device)||void 0===u?void 0:u.vendor,os:null===(c=null==f?void 0:f.os)||void 0===c?void 0:c.name,os_version:null===(l=null==f?void 0:f.os)||void 0===l?void 0:l.version,browser:null===(d=null==f?void 0:f.browser)||void 0===d?void 0:d.name,browser_version:null===(h=null==f?void 0:f.browser)||void 0===h?void 0:h.version,used_camera:null==i?void 0:i.selectedCamera,cameras:null==i?void 0:i.camerasInfo}},Ua({method:"POST",url:"/verify/api/v1/verification/{sid}/images",path:{sid:m},body:y,mediaType:"application/json",errors:{400:"Request is malformed or missing required fields",401:"Access token is malformed, missing data, or expired",404:"Session not found",409:"All required images were successfully submitted"}},y.image.image_type));var m,y;const v=function(e,t){const r=[...e].find((e=>e.includes(t)));return void 0!==r?r[1]:void 0}(g.headers,"x-ts-processing-time-ms");return"ok"!==g.body.feedback&&console.error("Error",g),{missing_images:g.body.missing_images,feedback:g.body.feedback,custom_feedback:g.body.custom_feedback,has_barcode:g.body.has_barcode,serverProcessingTime:v}},Xf=()=>{const e=document.getElementById("overlay-frame");if(e){const t=e.getBoundingClientRect(),r=(3840-screen.width)/2,n=(2160-screen.height)/2;return{top:n+t.top,bottom:n+t.bottom,right:r+t.right,left:r+t.left}}},Yf=e=>["document_front","document_back"].includes(e)?"environment":"user";function Zf(e){switch(e){case"document_front":return co.image_type.DOCUMENT_FRONT;case"document_back":return co.image_type.DOCUMENT_BACK;case"selfie":return co.image_type.SELFIE}}var Jf={},$f={get exports(){return Jf},set exports(e){Jf=e}};$f.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,r){r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return a}));var n=r(1),i=r(7);r.d(t,"a",(function(){return i.a})),r.d(t,"d",(function(){return n.b}));var o=n.a.FACING_MODES,a=n.a.IMAGE_TYPES},function(e,t,r){var n=r(6);r.d(t,"a",(function(){return n.a}));var i=r(2);r.d(t,"b",(function(){return i.a}))},function(e,t,r){function n(e,t){if(!(t>=0&&t<=1))throw new Error(t+" is invalid imageCompression, choose between: [0, 1]");if(!h.f.includes(e))throw new Error(e+" is invalid imageType, choose between: "+h.f.join(", "));return!0}function i(e,t){var r={};try{n(e,t),r.imageType=e,r.imageCompression=t}catch(e){console.error(e),console.error("default value of "+h.c.PNG+" is used"),r.imageType=h.c.PNG,r.imageCompression=null}return r}function o(){var e=window.navigator.platform,t=window.navigator.userAgent;return e||t}function a(){return"ontouchend"in document}function s(e,t,r){var n=e*parseFloat(r);return{imageWidth:n,imageHeight:t/(e/n)}}function u(e,t,r){return i(t,r).imageType===h.c.JPG?r?e.toDataURL(h.b[h.c.JPG],r):e.toDataURL(h.b[h.c.JPG]):e.toDataURL(h.b[t])}function c(e,t){return e||t}function l(){var e=o();if(/iPad|iPhone|iPod/.test(e))return!0;var t=a();return!(!/Mac/.test(e)||!t)}function d(){return{userAgent:window.navigator.userAgent,platform:window.navigator.platform,_getStringWithPlatform:o(),_getHasTouchEvents:a(),getIsIOS:l()}}t.c=s,t.b=u,t.e=c,t.d=l,t.a=d;var h=r(3)},function(e,t,r){function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"e",(function(){return o})),r.d(t,"a",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"c",(function(){return u})),r.d(t,"b",(function(){return c})),r.d(t,"d",(function(){return l}));var i,o=["user","environment"],a={USER:"user",ENVIRONMENT:"environment"},s=["jpg","png"],u={PNG:"png",JPG:"jpg"},c=(n(i={},"jpg","image/jpeg"),n(i,"png","image/png"),i),l={audio:!1,video:!0}},function(e,t,r){e.exports=r(5)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);r.d(t,"FACING_MODES",(function(){return n.b})),r.d(t,"IMAGE_TYPES",(function(){return n.c})),r.d(t,"_getDebugPlatformInfo",(function(){return n.d}));var i=r(9);r.d(t,"downloadPhoto",(function(){return i.a})),t.default=n.a},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return s}));var i=r(2),o=r(3),a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(){function e(){n(this,e)}return a(e,null,[{key:"getDataUri",value:function(e,t){var r=t.sizeFactor,n=t.imageType,o=t.imageCompression,a=t.isImageMirror,s=e.videoWidth,u=e.videoHeight,c=Object(i.c)(s,u,r),l=c.imageWidth,d=c.imageHeight,h=document.createElement("canvas");h.width=l,h.height=d;var f=h.getContext("2d");return a&&f.setTransform(-1,0,0,1,h.width,0),f.drawImage(e,0,0,l,d),Object(i.b)(h,n,o)}},{key:"getWindowURL",value:function(){return window.URL||window.webkitURL||window.mozURL||window.msURL}},{key:"getNavigatorMediaDevices",value:function(){var e=null,t=!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),r=!(!navigator.mozGetUserMedia&&!navigator.webkitGetUserMedia);if(t)e=navigator.mediaDevices;else if(r){var n=navigator.mozGetUserMedia||navigator.webkitGetUserMedia,i={getUserMedia:function(e){return new Promise((function(t,r){n.call(navigator,e,t,r)}))}};e=Object.assign(n,i)}return e}},{key:"isSupportedFacingMode",value:function(){return e.getNavigatorMediaDevices().getSupportedConstraints().facingMode}},{key:"getIdealConstraints",value:function(t,r){if(!Object(i.e)(t,r))return o.d;var n=e.getNavigatorMediaDevices().getSupportedConstraints();if(!n.width||!n.height)return console.error("Constraint width or height not supported! fallback to default resolution"),o.d;var a=void 0,s=void 0;return t&&(o.e.includes(t)?a=t:s={exact:t}),{audio:!1,video:{facingMode:a,deviceId:s,width:r&&r.width,height:r&&r.height}}}},{key:"getMaxResolutionConstraints",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments[1];console.warn("getMaxResolutionConstraints() numberOfMaxResolutionTry:",r);var n=[{width:{min:640}},{width:{min:800}},{width:{min:900}},{width:{min:1024}},{width:{min:1080}},{width:{min:1280}},{width:{min:1920}},{width:{min:2560}},{width:{min:3840}}],o=e.getIdealConstraints(t,{});if(0===r)return Object(i.d)()?(console.warn("fallback to iOS constraints"),e.getIdealConstraints(t,{width:{min:640,ideal:3840},height:{min:480,ideal:2160}})):(o.video.advanced=n,o);if(r<n.length){var a=n.slice(0,-r);return o.video.advanced=a,o}return null}},{key:"FACING_MODES",get:function(){return o.a}},{key:"IMAGE_TYPES",get:function(){return o.c}}]),e}()},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return u}));var i=r(1),o=r(8),a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=i.a.IMAGE_TYPES.PNG,u=function(){function e(t){n(this,e),this.videoElement=t,this.stream=null,this.numberOfMaxResolutionTry=0,this.settings=null,this.cameras=[],this.windowURL=i.a.getWindowURL(),this.mediaDevices=i.a.getNavigatorMediaDevices()}return a(e,[{key:"_getStreamDevice",value:function(e,t){var r=this;return new Promise((function(n,o){var a=i.a.getIdealConstraints(e,t);r.mediaDevices.getUserMedia(a).then((function(e){r._gotStream(e),n(e)})).catch((function(e){o(e)}))}))}},{key:"_getStreamDeviceMaxResolution",value:function(e){var t=this,r=i.a.getMaxResolutionConstraints(e,this.numberOfMaxResolutionTry);if(null==r){var n={};return this._getStreamDevice(e,n)}return new Promise((function(n,i){t.mediaDevices.getUserMedia(r).then((function(e){t._gotStream(e),n(e)})).catch((function(r){setTimeout((function(){t.numberOfMaxResolutionTry+=1,t._getStreamDeviceMaxResolution(e).catch((function(){i(r)}))}),20)}))}))}},{key:"_setVideoSrc",value:function(e){if("srcObject"in this.videoElement)this.videoElement.srcObject=e;else{var t=this.windowURL.createObjectURL(e);this.videoElement.src=t}}},{key:"_setSettings",value:function(e){this.settings=null;var t=e&&e.getTracks?e.getTracks():[];t.length>0&&t[0].getSettings&&(this.settings=t[0].getSettings())}},{key:"_enumerateCamerasPromise",value:function(){var e=this;return new Promise((function(t,r){var n=[];e.mediaDevices.enumerateDevices().then((function(e){e.forEach((function(e){"videoinput"===e.kind&&e.deviceId&&n.push(e)})),t(n)})).catch((function(e){r(e)}))}))}},{key:"_gotStream",value:function(e){this.stream=e,this._setSettings(e),this._setVideoSrc(e)}},{key:"getCameraSettings",value:function(){return this.settings}},{key:"enumerateCameras",value:function(){var e=this;return this.stream?this._enumerateCamerasPromise():this.stopCamera().then((function(){})).catch((function(){})).then((function(){var t={video:!0};return e.mediaDevices.getUserMedia(t).then((function(e){setTimeout((function(){e.getTracks().forEach((function(e){e.stop()}))}),20)})).then((function(){})).catch((function(){})).then((function(){return e._enumerateCamerasPromise()}))}))}},{key:"startCamera",value:function(e,t){var r=this;return this.stopCamera().then((function(){})).catch((function(){})).then((function(){return r._getStreamDevice(e,t)}))}},{key:"startCameraMaxResolution",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.numberOfMaxResolutionTry=0,this.stopCamera().then((function(){})).catch((function(){})).then((function(){return e._getStreamDeviceMaxResolution(t)}))}},{key:"getDataUri",value:function(e){var t={sizeFactor:void 0===e.sizeFactor?o.c:e.sizeFactor,imageType:void 0===e.imageType?s:e.imageType,imageCompression:void 0===e.imageCompression?o.a:e.imageCompression,isImageMirror:void 0===e.isImageMirror?o.b:e.isImageMirror};return i.a.getDataUri(this.videoElement,t)}},{key:"stopCamera",value:function(){var e=this;return new Promise((function(t,r){e.stream&&(e.stream.getTracks().forEach((function(e){e.stop()})),e.videoElement.src="",e.stream=null,e._setSettings(null),t()),r(Error("no stream to stop!"))}))}}]),e}()},function(e,t,r){r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=1,i=null,o=!1},function(e,t,r){var n=r(10);r.d(t,"a",(function(){return n.a}))},function(e,t,r){function n(e){for(var t=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n),o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return new Blob([n],{type:r})}function i(e,t){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function o(e){var t=c.c.PNG;return"image/jpeg"===e&&(t=c.c.JPG),t}function a(e,t,r){return e+"-"+i(t,4)+"."+o(r)}function s(e,t,r){window.URL=window.webkitURL||window.URL;var n=document.createElement("a");n.download=a(t,r,e.type),n.href=window.URL.createObjectURL(e);var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photo",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s(n(e),t,r)}t.a=u;var c=r(0)}]);var Qf=J(Jf);class ep{constructor(){this.currentStream=null,this.currentConstraints=null}static getInstance(){return ep.instance||(ep.instance=new ep),ep.instance}getStream(){return this.currentStream}isStreaming(){return this.currentStream&&this.currentStream.getTracks().some((e=>"live"===e.readyState))}stopStream(){this.currentStream&&(this.currentStream.getTracks().forEach((e=>e.stop())),this.currentStream=null)}areConstraintsEqual(e){return!!this.currentConstraints&&JSON.stringify(this.currentConstraints)===JSON.stringify(e)}async startNewStream(e){this.isStreaming()&&this.areConstraintsEqual(e)||(this.stopStream(),this.currentStream=await navigator.mediaDevices.getUserMedia(e),this.currentConstraints=e)}async enumerateDevices(){try{return await navigator.mediaDevices.enumerateDevices()}catch(e){throw console.error("Failed to enumerate devices:",e),e}}}const tp=[{os:{name:"Android"},label:"2 0"}];async function rp(){const e=(await async function(){const e=ep.getInstance();let t=await e.enumerateDevices();return t.filter((e=>"videoinput"===e.kind)).every((e=>""===e.label))&&(await e.startNewStream({video:{facingMode:{ideal:"environment"}},audio:!1}),t=await e.enumerateDevices(),e.stopStream()),t}()).filter((e=>{if(!(null==e?void 0:e.label)||"videoinput"!==e.kind||""===e.label)return!1;const t=e.label.toLowerCase();return np.some((e=>t.includes(e)))})),t=fo.UAParser(),r=e.find((e=>tp.find((r=>r.os.name===t.os.name&&e.label.includes(r.label)))));return r?{optionalCameras:e,selectedCamera:r}:{optionalCameras:e}}const np=["rear","back","rück","arriĆØre","trasera","trĆ”s","traseira","posteriore","åé¢","å¾é¢","čé¢","åē½®","å¾ē½®","čē½®","заГней","Ų§ŁŲ®ŁŁŁŲ©","ķ","arka","achterzijde","ąø«ąø„ąø±ąø","baksidan","bagside","sau","bak","tylny","takakamera","belakang","×××ר××Ŗ","ĻĪÆĻĻ","spate","hĆ”tsó","zadnĆ","darrere","zadnĆ”","заГнŃ","stražnja","belakang","ą¤¬ą„ą¤","camera2 0, facing back"],ip={width:{min:640,max:3840,ideal:3840},height:{min:480,max:2160,ideal:2160},frameRate:30},op={width:{min:640,max:1280,ideal:1280},height:{min:480,max:720,ideal:720},frameRate:30},ap=async e=>{var t,r;let n;return"environment"==e&&(n=await rp()),null!==(r=null===(t=null==n?void 0:n.selectedCamera)||void 0===t?void 0:t.deviceId)&&void 0!==r?r:e},sp=(e,t)=>{var r,n;return"user"===e?null!==(r=null==t?void 0:t.selfieVideoConstraints)&&void 0!==r?r:op:null!==(n=null==t?void 0:t.environmentVideoConstraints)&&void 0!==n?n:ip},up=e=>{const t=Vf({tagName:"video",style:{position:"absolute",zIndex:"0",top:"0",width:"100%",height:"100%",objectFit:"cover"},id:"video",testid:"video"});return t.style.transform="user"===e?"scaleX(-1)":"",t.autoplay=!0,t.muted=!0,t.setAttribute("playsinline","true"),t},cp={title:"other_error_code_title",message:"other_error_code_message"},lp={ok:cp,document_face_not_found:cp,restricted_criteria:cp,other:cp,glare:{title:"glare_title",message:"glare_message"},document_not_found:{title:"document_not_found_title",message:"document_not_found_message"},blur:{title:"blur_title",message:"blur_message"},document_not_supported:{title:"document_not_supported_title",message:"document_not_supported_message"},obstructed:{title:"obstructed_title",message:"obstructed_message"},document_not_matching:{title:"document_not_matching_title",message:"document_not_matching_message"},face_not_found:{title:"face_not_found_title",message:"face_not_found_message"},wrong_document_side:{title:"wrong_document_side_title",message:"wrong_document_side_message"},glare_selfie:{title:"glare_selfie_title",message:"glare_selfie_message"},blur_selfie:{title:"blur_selfie_title",message:"blur_selfie_message"},multi_face:{title:"multi_face_title",message:"multi_face_message"},face_rotated:{title:"face_rotated_title",message:"face_rotated_message"},face_too_small:{title:"face_too_small_title",message:"face_too_small_message"},face_too_close:{title:"face_too_close_title",message:"face_too_close_message"},closed_eyes:{title:"closed_eyes_title",message:"closed_eyes_message"},face_angle_too_large:{title:"face_angle_too_large_title",message:"face_angle_too_large_message"},face_close_to_border:{title:"face_close_to_border_title",message:"face_close_to_border_message"},face_occluded:{title:"face_occluded_title",message:"face_occluded_message"},face_cropped:{title:"face_cropped_title",message:"face_cropped_message"},barcode_not_found:{title:"barcode_not_found_title",message:"barcode_not_found_message"}},dp={loading_screen:{page:"page_header_document",title:"main_title_document_front",instructions:"loading_screen_small_title"},document_front:{page:"page_header_document",title:"main_title_document_front",instructions:"second_title_document_front"},document_back:{page:"page_header_document",title:"main_title_document_back",instructions:"second_title_document_back"},selfie:{page:"page_header_face",title:"main_title_document_face",instructions:"second_title_document_face"}},hp=(e,t)=>{const r=Vf({tagName:"div",style:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative",zIndex:"1",background:"transparent",boxShadow:"0 0 0 1000px rgb(0 0 0 / 50%)",borderStyle:"solid",borderWidth:"1px",borderColor:"white"},id:`overlay-frame ${e}`,testid:`overlay-frame ${e}`});if("environment"===e){!function(e){Hf(e,Vf({tagName:"div",style:{position:"absolute",top:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"none",borderBottomStyle:"none",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-left",testid:"overlay-frame__top-left"})),Hf(e,Vf({tagName:"div",style:{position:"absolute",top:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-right",testid:"overlay-frame__top-right"})),Hf(e,Vf({tagName:"div",style:{position:"absolute",bottom:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-right",testid:"overlay-frame__bottom-right"})),Hf(e,Vf({tagName:"div",style:{position:"absolute",bottom:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"solid",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-left",testid:"overlay-frame__bottom-left"}))}(r);const e=.85*t.clientWidth;r.style.width=`${e}px`,r.style.height=.65*e+"px",r.style.maxHeight=.5*window.innerHeight+"px"}else{const e=t.clientWidth*(t.clientHeight<700?.8:.85);r.style.width=.8*e+"px",r.style.height=`${e}px`,r.style.minHeight=.8*e+"px",r.style.maxHeight=.5*window.innerHeight+"px",r.style.borderRadius="50%"}return r};const fp=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 68 68"),t.innerHTML=`<style>.spinner-autocapture circle {animation: rotate 1.5s linear infinite;} @keyframes rotate { 50% {stroke-dashoffset: 94; stroke-dasharray: 6 57; } 100% { stroke-dashoffset: 188; stroke-dasharray: 51 12; }} </style> <g class="spinner-autocapture"> <circle cx="34" cy="34" fill="none" r="30" stroke-width="4" stroke="${null!=e?e:"#fff"}" stroke-dasharray="51 12" stroke-linecap="round" stroke-dashoffset="0" /> </g>`,t};function pp(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","16px"),e.setAttribute("height","16px"),e.innerHTML='\n <path d="M8 16C12.4187 16 16 12.4187 16 8C16 3.58125 12.4187 0 8 0C3.58125 0 0 3.58125 0 8C0 12.4187 3.58125 16 8 16ZM8 4C8.41562 4 8.75 4.33437 8.75 4.75V8.25C8.75 8.66562 8.41562 9 8 9C7.58437 9 7.25 8.66562 7.25 8.25V4.75C7.25 4.33437 7.58437 4 8 4ZM9 11C9 11.5531 8.55313 12 8 12C7.44688 12 7 11.5531 7 11C7 10.4469 7.44688 10 8 10C8.55313 10 9 10.4469 9 11Z" fill="#F2F2F2"/>\n ',e}const gp={all:{color:"black",margin:"0"},1:{color:"white",fontSize:"var(--font-size-4xl)",fontWeight:"var(--font-weight-bold)"},2:{color:"white",fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-semibold)"},3:{color:"white",fontSize:"var(--font-size-xl)",fontWeight:"var(--font-weight-medium)"},4:{fontSize:"var(--font-size-lg)",fontWeight:"var(--font-weight-regular)"},5:{fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-light)"},6:{fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-light)"}},mp=e=>{let{text:r,level:n=1,style:i={},id:o,testid:a}=e;const s=Vf({tagName:`h${n}`,style:t(t(t({},gp.all),gp[n]),i),id:o,testid:a});return s.textContent=r,s.id=o,s};var yp,vp={};let wp=null;try{wp=(yp||(yp=1,function(e){function r(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function i(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const o={exec:()=>null};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="string"==typeof e?e:e.source;const n={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(s.caret,"$1"),r=r.replace(e,i),n},getRegex:()=>new RegExp(r,t)};return n}const s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10107}-\u{10133}\u{10140}-\u{10178}\u{1018A}\u{1018B}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{103D1}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10858}-\u{10876}\u{10879}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A60}-\u{10A7E}\u{10A80}-\u{10A9F}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11052}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{11136}-\u{1113F}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111D0}-\u{111DA}\u{111DC}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{112F0}-\u{112F9}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{11450}-\u{11459}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116B8}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11730}-\u{1173B}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C50}-\u{11C6C}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11F50}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{12000}-\u{12399}\u{12400}-\u{1246E}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A70}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E96}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D7FF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1EC71}-\u{1ECAB}\u{1ECAD}-\u{1ECAF}\u{1ECB1}-\u{1ECB4}\u{1ED01}-\u{1ED2D}\u{1ED2F}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10C}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},u=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,c=/(?:[*+-]|\d{1,9}[.)])/,l=a(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,c).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),d=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\.|[^\[\]\\])+/,f=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),p=a(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,c).getRegex(),g="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",m=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,y=a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",m).replace("tag",g).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v=a(d).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),w={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",v).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:f,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:u,html:y,lheading:l,list:p,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:v,table:o,text:/^[^\n]+/},b=a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),_=t(t({},w),{},{table:b,paragraph:a(d).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",b).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex()}),A=t(t({},w),{},{html:a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(d).replace("hr",u).replace("heading"," *#{1,6} *[^\n]").replace("lheading",l).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),E=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,C=/^( {2,}|\\)\n(?!\s*$)/,x="\\p{P}\\p{S}",S=a(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,x).getRegex(),I=a(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,x).getRegex(),T=a("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,x).getRegex(),M=a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,x).getRegex(),D=a(/\\([punct])/,"gu").replace(/punct/g,x).getRegex(),R=a(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),O=a(m).replace("(?:--\x3e|$)","--\x3e").getRegex(),k=a("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",O).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),N=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,P=a(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",N).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),B=a(/^!?\[(label)\]\[(ref)\]/).replace("label",N).replace("ref",h).getRegex(),F=a(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),L={_backpedal:o,anyPunctuation:D,autolink:R,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:C,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:o,emStrongLDelim:I,emStrongRDelimAst:T,emStrongRDelimUnd:M,escape:E,link:P,nolink:F,punctuation:S,reflink:B,reflinkSearch:a("reflink|nolink(?!\\()","g").replace("reflink",B).replace("nolink",F).getRegex(),tag:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:o},z=t(t({},L),{},{link:a(/^!?\[(label)\]\((.*?)\)/).replace("label",N).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",N).getRegex()}),U=t(t({},L),{},{escape:a(E).replace("])","~|])").getRegex(),url:a(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),j=t(t({},U),{},{br:a(C).replace("{2,}","*").getRegex(),text:a(U.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),V={normal:w,gfm:_,pedantic:A},H={normal:L,gfm:U,breaks:j,pedantic:z},G={"&":"&","<":"<",">":">",'"':""","'":"'"},q=e=>G[e];function W(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,q)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,q);return e}function K(e){try{e=encodeURI(e).replace(s.percentDecode,"%")}catch(e){return null}return e}function X(e,t){const r=e.replace(s.findPipe,((e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(s.splitPipe);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(s.slashPipe,"|");return r}function Y(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){const o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.slice(0,n-i)}function Z(e,t,r,n,i){const o=t.href,a=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:o,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:o,title:a,text:s}}class J{constructor(t){n(this,"options",void 0),n(this,"rules",void 0),n(this,"lexer",void 0),this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Y(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=function(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(null===n)return t;const i=n[1];return t.split("\n").map((e=>{const t=e.match(r.other.beginningSpace);if(null===t)return e;const[n]=t;return n.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=Y(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Y(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=Y(t[0],"\n").split("\n"),r="",n="";const i=[];for(;e.length>0;){let t=!1;const o=[];let a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))o.push(e[a]),t=!0;else{if(t)break;o.push(e[a])}e=e.slice(a);const s=o.join("\n"),u=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${s}`:s,n=n?`${n}\n${u}`:u;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=c,0===e.length)break;const l=i[i.length-1];if("code"===(null==l?void 0:l.type))break;if("blockquote"===(null==l?void 0:l.type)){const t=l,o=t.raw+"\n"+e.join("\n"),a=this.blockquote(o);i[i.length-1]=a,r=r.substring(0,r.length-t.raw.length)+a.raw,n=n.substring(0,n.length-t.text.length)+a.text;break}if("list"!==(null==l?void 0:l.type));else{const t=l,o=t.raw+"\n"+e.join("\n"),a=this.list(o);i[i.length-1]=a,r=r.substring(0,r.length-l.raw.length)+a.raw,n=n.substring(0,n.length-t.raw.length)+a.raw,e=o.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let r=!1,n="",s="";if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let u=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],l=!u.trim(),d=0;if(this.options.pedantic?(d=2,s=u.trimStart()):l?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=u.slice(d),d+=t[1].length),l&&this.rules.other.blankLine.test(c)&&(n+=c+"\n",e=e.substring(c.length+1),r=!0),!r){const t=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),o=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d);for(;e;){const h=e.split("\n",1)[0];let f;if(c=h,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),f=c):f=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(o.test(c))break;if(a.test(c))break;if(t.test(c))break;if(r.test(c))break;if(f.search(this.rules.other.nonSpaceChar)>=d||!c.trim())s+="\n"+f.slice(d);else{if(l)break;if(u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(u))break;if(o.test(u))break;if(r.test(u))break;s+="\n"+c}l||c.trim()||(l=!0),n+=h+"\n",e=e.substring(h.length+1),u=f.slice(d)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(a=!0));let h,f=null;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(h="[ ] "!==f[0],s=s.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:n,task:!!f,checked:h,loose:!1,text:s,tokens:[]}),i.raw+=n}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),r=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!this.rules.other.tableDelimiter.test(t[2]))return;const r=X(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const e of n)this.rules.other.tableAlignRight.test(e)?o.align.push("right"):this.rules.other.tableAlignCenter.test(e)?o.align.push("center"):this.rules.other.tableAlignLeft.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(const e of i)o.rows.push(X(e,o.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),Z(t,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return Z(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=this.rules.inline.emStrongLDelim.exec(e);if(n&&(!n[3]||!r.match(this.rules.other.unicodeAlphaNumeric))&&(!n[1]&&!n[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...n[0]].length-1;let i,o,a=r,s=0;const u="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=u.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){s+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+s);const t=[...n[0]][0].length,u=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=u.slice(1,-1);return{type:"em",raw:u,text:e,tokens:this.lexer.inlineTokens(e)}}const c=u.slice(2,-2);return{type:"strong",raw:u,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,i;if("@"===t[2])e=t[0],i="mailto:"+e;else{let o;do{var r,n;o=t[0],t[0]=null!==(r=null===(n=this.rules.inline._backpedal.exec(t[0]))||void 0===n?void 0:n[0])&&void 0!==r?r:""}while(o!==t[0]);e=t[0],i="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class ${constructor(t){n(this,"tokens",void 0),n(this,"options",void 0),n(this,"state",void 0),n(this,"tokenizer",void 0),n(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new J,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:s,block:V.normal,inline:H.normal};this.options.pedantic?(r.block=V.pedantic,r.inline=H.pedantic):this.options.gfm&&(r.block=V.gfm,this.options.breaks?r.inline=H.breaks:r.inline=H.gfm),this.tokenizer.rules=r}static get rules(){return{block:V,inline:H}}static lex(e,t){return new $(t).lex(e)}static lexInline(e,t){return new $(t).inlineTokens(e)}lex(e){e=e.replace(s.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e){let t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(this.options.pedantic&&(e=e.replace(s.tabCharGlobal," ").replace(s.spaceLine,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(t=r.call({lexer:this},e,i))&&(e=e.substring(t.raw.length),i.push(t),!0)))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&i.length>0?i[i.length-1].raw+="\n":i.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),r=i[i.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?i.push(t):(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),r=i[i.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(r.raw+="\n"+t.raw,r.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),i.push(t);else{var a;if(n=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let i;this.options.extensions.startBlock.forEach((e=>{i=e.call({lexer:this},r),"number"==typeof i&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(n=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(n)))r=i[i.length-1],o&&"paragraph"===(null===(a=r)||void 0===a?void 0:a.type)?(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(t),o=n.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),r=i[i.length-1],r&&"text"===r.type?(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,i}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,r,n,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(u));)u=u.slice(0,i.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(t=r.call({lexer:this},e,s))&&(e=e.substring(t.raw.length),s.push(t),!0)))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),r=s[s.length-1],s.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),r=s[s.length-1],r&&"text"===t.type&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):s.push(t);else if(t=this.tokenizer.emStrong(e,u,a))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.autolink(e))e=e.substring(t.raw.length),s.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e))){if(n=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let i;this.options.extensions.startInline.forEach((e=>{i=e.call({lexer:this},r),"number"==typeof i&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(n=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(n))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(a=t.raw.slice(-1)),o=!0,r=s[s.length-1],r&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):s.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),s.push(t);return s}}class Q{constructor(t){n(this,"options",void 0),n(this,"parser",void 0),this.options=t||e.defaults}space(e){return""}code(e){var t;let{text:r,lang:n,escaped:i}=e;const o=null===(t=(n||"").match(s.notSpaceStart))||void 0===t?void 0:t[0],a=r.replace(s.endingNewline,"")+"\n";return o?'<pre><code class="language-'+W(o)+'">'+(i?a:W(a,!0))+"</code></pre>\n":"<pre><code>"+(i?a:W(a,!0))+"</code></pre>\n"}blockquote(e){let{tokens:t}=e;return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html(e){let{text:t}=e;return t}heading(e){let{tokens:t,depth:r}=e;return`<h${r}>${this.parser.parseInline(t)}</h${r}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,r=e.start;let n="";for(let t=0;t<e.items.length;t++){const r=e.items[t];n+=this.listitem(r)}const i=t?"ol":"ul";return"<"+i+(t&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+i+">\n"}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+W(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox(e){let{checked:t}=e;return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){let{tokens:t}=e;return`<p>${this.parser.parseInline(t)}</p>\n`}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let n="";for(let t=0;t<e.rows.length;t++){const i=e.rows[t];r="";for(let e=0;e<i.length;e++)r+=this.tablecell(i[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow(e){let{text:t}=e;return`<tr>\n${t}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>\n`}strong(e){let{tokens:t}=e;return`<strong>${this.parser.parseInline(t)}</strong>`}em(e){let{tokens:t}=e;return`<em>${this.parser.parseInline(t)}</em>`}codespan(e){let{text:t}=e;return`<code>${W(t,!0)}</code>`}br(e){return"<br>"}del(e){let{tokens:t}=e;return`<del>${this.parser.parseInline(t)}</del>`}link(e){let{href:t,title:r,tokens:n}=e;const i=this.parser.parseInline(n),o=K(t);if(null===o)return i;let a='<a href="'+(t=o)+'"';return r&&(a+=' title="'+W(r)+'"'),a+=">"+i+"</a>",a}image(e){let{href:t,title:r,text:n}=e;const i=K(t);if(null===i)return W(n);let o=`<img src="${t=i}" alt="${n}"`;return r&&(o+=` title="${W(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:W(e.text)}}class ee{strong(e){let{text:t}=e;return t}em(e){let{text:t}=e;return t}codespan(e){let{text:t}=e;return t}del(e){let{text:t}=e;return t}html(e){let{text:t}=e;return t}text(e){let{text:t}=e;return t}link(e){let{text:t}=e;return""+t}image(e){let{text:t}=e;return""+t}br(){return""}}class te{constructor(t){n(this,"options",void 0),n(this,"renderer",void 0),n(this,"textRenderer",void 0),this.options=t||e.defaults,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ee}static parse(e,t){return new te(t).parse(e)}static parseInline(e,t){return new te(t).parseInline(e)}parse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}const o=i;switch(o.type){case"space":r+=this.renderer.space(o);continue;case"hr":r+=this.renderer.hr(o);continue;case"heading":r+=this.renderer.heading(o);continue;case"code":r+=this.renderer.code(o);continue;case"table":r+=this.renderer.table(o);continue;case"blockquote":r+=this.renderer.blockquote(o);continue;case"list":r+=this.renderer.list(o);continue;case"html":r+=this.renderer.html(o);continue;case"paragraph":r+=this.renderer.paragraph(o);continue;case"text":{let i=o,a=this.renderer.text(i);for(;n+1<e.length&&"text"===e[n+1].type;)i=e[++n],a+="\n"+this.renderer.text(i);r+=t?this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):a;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}const o=i;switch(o.type){case"escape":case"text":r+=t.text(o);break;case"html":r+=t.html(o);break;case"link":r+=t.link(o);break;case"image":r+=t.image(o);break;case"strong":r+=t.strong(o);break;case"em":r+=t.em(o);break;case"codespan":r+=t.codespan(o);break;case"br":r+=t.br(o);break;case"del":r+=t.del(o);break;default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}}class re{constructor(t){n(this,"options",void 0),n(this,"block",void 0),this.options=t||e.defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?$.lex:$.lexInline}provideParser(){return this.block?te.parse:te.parseInline}}n(re,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class ne{constructor(){n(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),n(this,"options",this.setOptions),n(this,"parse",this.parseMarkdown(!0)),n(this,"parseInline",this.parseMarkdown(!1)),n(this,"Parser",te),n(this,"Renderer",Q),n(this,"TextRenderer",ee),n(this,"Lexer",$),n(this,"Tokenizer",J),n(this,"Hooks",re),this.use(...arguments)}walkTokens(e,t){let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const e=i;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=i;r=r.concat(this.walkTokens(e.items,t));break}default:{var n;const e=i;null!==(n=this.defaults.extensions)&&void 0!==n&&null!==(n=n.childTokens)&&void 0!==n&&n[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{const i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))})):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return n.forEach((r=>{const n=t({},r);if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const r=e.renderers[t.name];e.renderers[t.name]=r?function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];let o=t.renderer.apply(this,n);return!1===o&&(o=r.apply(this,n)),o}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const r=e[t.level];r?r.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),r.renderer){const e=this.defaults.renderer||new Q(this.defaults);for(const t in r.renderer){if(!(t in e))throw new Error(`renderer '${t}' does not exist`);if(["options","parser"].includes(t))continue;const n=t,i=r.renderer[n],o=e[n];e[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let a=i.apply(e,r);return!1===a&&(a=o.apply(e,r)),a||""}}n.renderer=e}if(r.tokenizer){const e=this.defaults.tokenizer||new J(this.defaults);for(const t in r.tokenizer){if(!(t in e))throw new Error(`tokenizer '${t}' does not exist`);if(["options","rules","lexer"].includes(t))continue;const n=t,i=r.tokenizer[n],o=e[n];e[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let a=i.apply(e,r);return!1===a&&(a=o.apply(e,r)),a}}n.tokenizer=e}if(r.hooks){const e=this.defaults.hooks||new re;for(const t in r.hooks){if(!(t in e))throw new Error(`hook '${t}' does not exist`);if(["options","block"].includes(t))continue;const n=t,i=r.hooks[n],o=e[n];re.passThroughHooks.has(t)?e[n]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>o.call(e,t)));const r=i.call(e,t);return o.call(e,r)}:e[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let a=i.apply(e,r);return!1===a&&(a=o.apply(e,r)),a}}n.hooks=e}if(r.walkTokens){const e=this.defaults.walkTokens,t=r.walkTokens;n.walkTokens=function(r){let n=[];return n.push(t.call(this,r)),e&&(n=n.concat(e.call(this,r))),n}}this.defaults=t(t({},this.defaults),n)})),this}setOptions(e){return this.defaults=t(t({},this.defaults),e),this}lexer(e,t){return $.lex(e,null!=t?t:this.defaults)}parser(e,t){return te.parse(e,null!=t?t:this.defaults)}parseMarkdown(e){return(r,n)=>{const i=t({},n),o=t(t({},this.defaults),i),a=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==r)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const s=o.hooks?o.hooks.provideLexer():e?$.lex:$.lexInline,u=o.hooks?o.hooks.provideParser():e?te.parse:te.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then((e=>s(e,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>u(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let e=s(r,o);o.hooks&&(e=o.hooks.processAllTokens(e)),o.walkTokens&&this.walkTokens(e,o.walkTokens);let t=u(e,o);return o.hooks&&(t=o.hooks.postprocess(t)),t}catch(e){return a(e)}}}onError(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+W(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}}const ie=new ne;function oe(e,t){return ie.parse(e,t)}oe.options=oe.setOptions=function(e){return ie.setOptions(e),oe.defaults=ie.defaults,i(oe.defaults),oe},oe.getDefaults=r,oe.defaults=e.defaults,oe.use=function(){return ie.use(...arguments),oe.defaults=ie.defaults,i(oe.defaults),oe},oe.walkTokens=function(e,t){return ie.walkTokens(e,t)},oe.parseInline=ie.parseInline,oe.Parser=te,oe.parser=te.parse,oe.Renderer=Q,oe.TextRenderer=ee,oe.Lexer=$,oe.lexer=$.lex,oe.Tokenizer=J,oe.Hooks=re,oe.parse=oe;const ae=oe.options,se=oe.setOptions,ue=oe.use,ce=oe.walkTokens,le=oe.parseInline,de=oe,he=te.parse,fe=$.lex;e.Hooks=re,e.Lexer=$,e.Marked=ne,e.Parser=te,e.Renderer=Q,e.TextRenderer=ee,e.Tokenizer=J,e.getDefaults=r,e.lexer=fe,e.marked=oe,e.options=ae,e.parse=de,e.parseInline=le,e.parser=he,e.setOptions=se,e.use=ue,e.walkTokens=ce}(vp)),vp).marked}catch(e){console.log("marked is not supported",e)}const bp=wp,_p=e=>{let{text:t,id:r,testid:n,clientHeight:i}=e;const o=!!i&&i<700,a=Vf({tagName:"div",style:{position:"relative",zIndex:"2",width:"100%",minHeight:o?"48px":"70px",textAlign:"center",backgroundColor:"#262626",display:"flex",justifyContent:"center",alignItems:"center"},id:r,testid:n});return Hf(a,mp({text:t,level:o?6:5,style:{color:"white"}})),a};const Ap=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","270"),e.setAttribute("height","175"),e.setAttribute("viewBox","40 60 250 140"),e.innerHTML='\n <g transform="matrix(1,0,0,1,0,0)"><g id="12" opacity="1" style="mix-blend-mode:normal"><g><defs><clipPath id="12_clipPath" x="-50%" y="-50%" width="200%" height="200%"><path d="M0,260v-260h333v260z" fill="white" clip-rule="nonzero"></path></clipPath></defs><g clip-path="url(#12_clipPath)"><g transform="matrix(1,0,0,1,48,60)"><g id="83287" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83288" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83288_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij3rlyasnggflf" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83288_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij3rlyasnggflf)"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116.5)"><g id="83289" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83289_fill_path" d="M135,0l-135,23.5h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,2)"><g id="83290" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83290_fill_path" d="M0,2c0,-1 1,-2 2,-2h228c1,0 2,1 2,2v18h-232z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,228.54000000000002,62.99940000000001)"><g id="83291" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83291_fill_path" d="M227,-0.00002l-227,60.99934l226.99998,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,42)"><g id="83292" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83292_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h109c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,143,42)"><g id="83293" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83293_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h65c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,58)"><g id="83294" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83294_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,58)"><g id="83295" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83295_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,194,58)"><g id="83296" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83296_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h14c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,74)"><g id="83297" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83297_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h83c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,117,74)"><g id="83298" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83298_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,165,74)"><g id="83299" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83299_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h43c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,68,92)"><g id="83300" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83300_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,74,92)"><g id="83301" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83301_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,80,92)"><g id="83302" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83302_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,86,92)"><g id="83303" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83303_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,92,92)"><g id="83304" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83304_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,98,92)"><g id="83305" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83305_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,104,92)"><g id="83306" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83306_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,110,92)"><g id="83307" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83307_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,116,92)"><g id="83308" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83308_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,122,92)"><g id="83309" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83309_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,128,92)"><g id="83310" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83310_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,134,92)"><g id="83311" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83311_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,140,92)"><g id="83312" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83312_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,146,92)"><g id="83313" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83313_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,152,92)"><g id="83314" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83314_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,158,92)"><g id="83315" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83315_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,164,92)"><g id="83316" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83316_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,170,92)"><g id="83317" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83317_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116)"><g id="83318" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83318_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,21)"><g id="83320" opacity="0.2" style="mix-blend-mode:normal"><g><g><path id="83320_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g><g transform="matrix(1,0,0,1,48,60)"><g id="83268" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83269" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83269_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij4hmxrv43iz67" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83269_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4hmxrv43iz67)"></path></g></g></g></g><g transform="matrix(1,0,0,1,196,100)"><g id="83270" opacity="0.4" style="mix-blend-mode:normal"><g><g><defs><clipPath id="ligziij4roiiqcgytn" clipPathUnits="userSpaceOnUse"><path d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z"></path></clipPath></defs><path id="83270_stroke_path" d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="10" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4roiiqcgytn)"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,98)"><g id="83271" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83271_fill_path" d="M135,0l-135,40h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,1,1)"><g id="83272" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83272_fill_path" d="M0,2c0,-1 1,-2 2,-2h229c1,0 2,1 2,2v18h-233z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,42,74.4508)"><g id="83273" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83273_fill_path" d="M18.00001,0h-8c-5.5225,0 -10.00001,4.47496 -10.00001,9.99992c0,1.09999 0.895,1.99998 2,1.99998h24.00002c1.1045,0 2,-0.89549 2,-1.99998c0,-5.52496 -4.475,-9.99992 -10.00001,-9.99992z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,47.5999,54.4509)"><g id="83274" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83274_fill_path" d="M17.306,8.653c0,0.9077 -0.1428,1.8102 -0.4232,2.6738c-0.2804,0.8636 -0.6957,1.6778 -1.2296,2.4124c-0.5339,0.7346 -1.1794,1.3801 -1.914,1.914c-0.7346,0.5339 -1.5488,0.9492 -2.4124,1.2296c-0.8636,0.2804 -1.7661,0.4232 -2.6738,0.4232c-0.9077,0 -1.8102,-0.1428 -2.6738,-0.4232c-0.8636,-0.2804 -1.6778,-0.6957 -2.4124,-1.2296c-0.7346,-0.5339 -1.3801,-1.1794 -1.914,-1.914c-0.5339,-0.7346 -0.9492,-1.5488 -1.2296,-2.4124c-0.2804,-0.8636 -0.4232,-1.7661 -0.4232,-2.6738c0,-0.9077 0.1428,-1.8102 0.4232,-2.6738c0.2804,-0.8636 0.6957,-1.6778 1.2296,-2.4124c0.5339,-0.7346 1.1794,-1.3801 1.914,-1.914c0.7346,-0.5339 1.5488,-0.9492 2.4124,-1.2296c0.8636,-0.2804 1.7661,-0.4232 2.6738,-0.4232c0.9077,0 1.8102,0.1428 2.6738,0.4232c0.8636,0.2804 1.6778,0.6957 2.4124,1.2296c0.7346,0.5339 1.3801,1.1794 1.914,1.914c0.5339,0.7346 0.9492,1.5488 1.2296,2.4124c0.2804,0.8636 0.4232,1.7661 0.4232,2.6738z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,32,48)"><g id="83275" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83275_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83275_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,32,94)"><g id="83276" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83276_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83276_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(-1,2.4492935982947064e-16,-2.4492935982947064e-16,-1,79,94)"><g id="83277" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83277_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83277_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,79,48)"><g id="83278" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83278_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83278_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,47)"><g id="83279" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83279_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,47)"><g id="83280" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83280_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,67)"><g id="83281" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83281_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,67)"><g id="83282" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83282_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,87)"><g id="83283" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83283_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,87)"><g id="83284" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83284_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h51c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,137,9)"><g id="83285" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83285_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,92.4999,98.9985)"><g id="83286" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83286_fill_path" d="M90.49994,0l-90.49994,96.99852l90.49994,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,0,20)"><g id="83319" opacity="0" style="mix-blend-mode:normal"><g><g><path id="83319_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g></g></g></g></g><animateTransform href="#83287" attributeName="transform" type="translate" values="118 70;118 70;118 70;118 70;118 70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="scale" values="0 1;0 1;1.02 1;1 1;1 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="translate" values="-118 -70;-118 -70;-118 -70;-118 -70;-118 -70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="0 0;0 0;9.018099999999999 -4;9.018099999999999 -4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.42 0 0.15 1;0.42 0 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="113.5 30.4997;113.5 30.4997;113.5 30.4997;113.5 30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="scale" values="-1 -1;-1 -1;-0.88 -0.88;-0.88 -0.88" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animate href="#83320" attributeName="opacity" values="0.2;0.2;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.39;0.43;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate><animateTransform href="#83268" attributeName="transform" type="translate" values="117 75;117 75;117 75;117 75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="scale" values="1 1;1 1;0 1;0 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="translate" values="-117 -75;-117 -75;-117 -75;-117 -75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animate href="#83271_fill_path" attributeName="d" values="M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,-0.0042l-135.0142,40.0042h135.0142z;M135,-0.0364l-135.1228,40.0364h135.1228z;M135,-0.0975l-135.3292,40.0975h135.3292z;M135,-0.1848l-135.6236,40.1848h135.6236z;M135,-0.2958l-135.9982,40.2958h135.9982z;M135,-0.4285l-136.4462,40.4285h136.4462z;M135,-0.5812l-136.9617,40.5812h136.9617z;M135,-0.7525l-137.5397,40.7525h137.5397z;M135,-0.941l-138.176,40.941h138.176z;M135,-1.1457l-138.8667,41.1457h138.8667z;M135,-1.3655l-139.6085,41.3655h139.6085z;M135,-1.5996l-140.3986,41.5996h140.3986z;M135,-1.8472l-141.2343,41.8472h141.2343z;M135,-2.1077l-142.1134,42.1077h142.1134z;M135,-2.3804l-143.0339,42.3804h143.0339z;M135,-2.6649l-143.994,42.6649h143.994z;M135,-2.9607l-144.9922,42.9607h144.9922z;M135,-3.2673l-146.0272,43.2673h146.0272z;M135,-3.5846l-147.0978,43.5846h147.0978z;M135,-3.9121l-148.2031,43.9121h148.2031z;M135,-4.2497l-149.3424,44.2497h149.3424z;M135,-4.5972l-150.5153,44.5972h150.5153z;M135,-4.9545l-151.7213,44.9545h151.7213z;M135,-5.3218l-152.9607,45.3218h152.9607z;M135,-5.6991l-154.2341,45.6991h154.2341z;M135,-6.0868l-155.5427,46.0868h155.5427z;M135,-6.4858l-156.8893,46.4858h156.8893z;M135,-6.898l-158.2804,46.898h158.2804z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z" dur="2.6s" repeatCount="indefinite" keyTimes="0;0.007692307692307693;0.015384615384615385;0.023076923076923078;0.03076923076923077;0.038461538461538464;0.046153846153846156;0.05384615384615385;0.06153846153846154;0.06923076923076923;0.07692307692307693;0.08461538461538462;0.09230769230769231;0.1;0.1076923076923077;0.11538461538461539;0.12307692307692308;0.13076923076923078;0.13846153846153847;0.14615384615384616;0.15384615384615385;0.16153846153846155;0.16923076923076924;0.17692307692307693;0.18461538461538463;0.19230769230769232;0.2;0.2076923076923077;0.2153846153846154;0.2230769230769231;0.23076923076923078;0.23846153846153847;0.24615384615384617;0.25384615384615383;0.26153846153846155;0.2692307692307692;0.27692307692307694;0.2846153846153846;0.2923076923076923;0.3;0.3076923076923077;0.3153846153846154;0.3230769230769231;0.33076923076923076;0.3384615384615385;0.34615384615384615;0.35384615384615387;0.36153846153846153;0.36923076923076925;0.3769230769230769;0.38461538461538464;0.3923076923076923;0.4;0.4076923076923077;0.4153846153846154;0.4230769230769231;0.4307692307692308;0.43846153846153846;0.4461538461538462;0.45384615384615384;0.46153846153846156;0.46923076923076923;0.47692307692307695;0.4846153846153846;0.49230769230769234;0.5;0.5076923076923077;0.5153846153846153;0.5230769230769231;0.5307692307692308;0.5384615384615384;0.5461538461538461;0.5538461538461539;0.5615384615384615;0.5692307692307692;0.5769230769230769;0.5846153846153846;0.5923076923076923;0.6;0.6076923076923076;0.6153846153846154;0.6230769230769231;0.6307692307692307;0.6384615384615384;0.6461538461538462;0.6538461538461539;0.6615384615384615;0.6692307692307692;0.676923076923077;0.6846153846153846;0.6923076923076923;0.7;0.7076923076923077;0.7153846153846154;0.7230769230769231;0.7307692307692307;0.7384615384615385;0.7461538461538462;0.7538461538461538;0.7615384615384615;0.7692307692307693;0.7769230769230769;0.7846153846153846;0.7923076923076923;0.8;0.8076923076923077;0.8153846153846154;0.823076923076923;0.8307692307692308;0.8384615384615385;0.8461538461538461;0.8538461538461538;0.8615384615384616;0.8692307692307693;0.8769230769230769;0.8846153846153846;0.8923076923076924;0.9;0.9076923076923077;0.9153846153846154;0.9230769230769231;0.9307692307692308;0.9384615384615385;0.9461538461538461;0.9538461538461539;0.9615384615384616;0.9692307692307692;0.9769230769230769;0.9846153846153847;0.9923076923076923;1" fill="freeze"></animate><animateTransform href="#83285" attributeName="transform" type="translate" values="88 2;88 2;88 2;88 2;88 2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="scale" values="0.98 1;0.98 1;1 1;0.96 1;0.96 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="translate" values="-88 -2;-88 -2;-88 -2;-88 -2;-88 -2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewX" values="0;0;-4;-4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewY" values="0;0;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animate href="#83319" attributeName="opacity" values="0;0;0.18;0.18" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.31;0.36;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate>\n ',e}();return t.setAttribute("style","position: absolute; z-index: 1; opacity: 0; transition: opacity 0.5s ease-in-out;"),"document_back"===e&&(t.style.opacity="1",setTimeout((()=>{t.style.opacity="0"}),5e3)),t};var Ep;!function(e){e.INVALID="invalid",e.VALID="valid",e.ACCEPTED="accepted",e.REJECTED="rejected"}(Ep||(Ep={}));const Cp="#ED3232",xp="#01B678",Sp="#FFF";const Ip=e=>{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;return t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t};async function Tp(e){let{context:t,onDetect:r,frame:n,showError:i,isSelfie:o=!1}=e;const a=t.state.name;if(a===Ep.REJECTED){i(function(e){switch(e){case qa.DOCUMENT_DETECTION:return"searching_document_autocapture";case qa.DOCUMENT_POSITION:return"doc_not_in_frame_issues_autocapture";case qa.BARCODE_DETECTION:return uo.feedback.BARCODE_NOT_FOUND;case qa.BLUR_DETECTION:return uo.feedback.BLUR;case qa.GLARE_DETECTION:return uo.feedback.GLARE;case qa.FACE_DETECTION:return uo.feedback.FACE_NOT_FOUND;case qa.FACE_POSITION:return uo.feedback.FACE_TOO_SMALL}}(t.invalidFramesCause));Mp("border-color",t.invalidFramesCause===qa.DOCUMENT_DETECTION?Sp:Cp)}if(a===Ep.VALID)if(o){Mp("border-color",xp);i(`capturing_face_autocapture${Math.ceil((t.validFramesThreshold-t.validFramesCounter)/t.validFramesThreshold*3)}`)}else i("capturing_in_progress_message"),Mp("border-color",Sp);a===Ep.ACCEPTED&&(Mp("border-color",Sp),i(null),"function"==typeof navigator.vibrate&&navigator.vibrate(200),await r({frame:n,suspendedPreview:!0,context:t}))}function Mp(e,t){document.querySelectorAll('[id^="overlay-frame"]').forEach((r=>{r.style[e]=t}))}function Dp(e){let t,r,n,{captureFrame:i,object:o,videoWidth:a,videoHeight:s,deviceWidth:u,deviceHeight:c,threshold:l,iouThreshold:d=.85}=e;if(a/s>=u/c){n=c/s;const e=(a*n-u)/2;t=o.x*n-e,r=o.y*n}else{n=u/a;const e=(s*n-c)/2;t=o.x*n,r=o.y*n-e}const h=t+o.width*n,f=r+o.height*n;!function(e,t,r,n){var i,o;if(null===(o=null===(i=Ga.state.autoCaptureSettings)||void 0===i?void 0:i.settings)||void 0===o?void 0:o.debug){const i=document.getElementById("image-preview-section"),o=document.getElementById("rectangle");if(o)o.style.width=`${r}px`,o.style.height=`${n}px`,o.style.left=`${e}px`,o.style.top=`${t}px`;else{const o=document.createElement("div");o.id="rectangle",o.style.position="absolute",o.style.border="1px solid yellow",o.style.width=`${r}px`,o.style.height=`${n}px`,o.style.left=`${e}px`,o.style.top=`${t}px`,i.appendChild(o)}}}(t,r,o.width*n,o.height*n);const p=function(e,t){const r=Math.max(e.left,t.left),n=Math.min(e.right,t.right),i=Math.max(e.top,t.top),o=n-r,a=Math.min(e.bottom,t.bottom)-i;if(o<=0||a<=0)return 0;const s=o*a;return s/((e.right-e.left)*(e.bottom-e.top)+(t.right-t.left)*(t.bottom-t.top)-s)}({top:i.top,left:i.left,bottom:i.bottom,right:i.right},{top:r,left:t,bottom:f,right:h}),g=p>d,m=o.width*n*(o.height*n)>l*(i.width*i.height);return g&&m}const Rp=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M10.7202 25.9524C9.81992 25.9524 9.08331 25.2158 9.08331 24.3155V11.2202C9.08331 10.3199 9.81992 9.58333 10.7202 9.58333C11.6205 9.58333 12.3571 10.3199 12.3571 11.2202V20.6938C16.3675 14.0337 23.662 9.58333 32 9.58333C44.6553 9.58333 54.9166 19.8447 54.9166 32.5C54.9166 45.1553 44.6553 55.4167 32 55.4167C23.8257 55.4167 16.654 51.1403 12.5924 44.6949C11.9274 43.631 12.7357 42.3214 13.994 42.3214C14.6079 42.3214 15.1603 42.6488 15.4979 43.1603C18.9968 48.5621 25.0841 52.1429 32 52.1429C42.8445 52.1429 51.6428 43.3445 51.6428 32.5C51.6428 21.6555 42.8445 12.8571 32 12.8571C24.726 12.8571 18.383 16.8062 14.9864 22.6786H23.8155C24.7158 22.6786 25.4524 23.4152 25.4524 24.3155C25.4524 25.2158 24.7158 25.9524 23.8155 25.9524H10.7202Z" fill="#FF8B8B"/> \n ',e}(),r=Vf({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"retake-image",testid:"retake-image"});return Hf(r,t),Hf(r,mp({text:e||"Retake",level:2,style:{color:"#FF8B8B",margin:"0",maxWidth:"100px",textAlign:"center"},id:"retake-image-text"})),r};const Op=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M32.5 8.66666C38.6884 8.66666 44.6233 11.125 48.9992 15.5008C53.375 19.8767 55.8333 25.8116 55.8333 32C55.8333 38.1884 53.375 44.1233 48.9992 48.4992C44.6233 52.875 38.6884 55.3333 32.5 55.3333C26.3116 55.3333 20.3767 52.875 16.0009 48.4992C11.625 44.1233 9.16668 38.1884 9.16668 32C9.16668 25.8116 11.625 19.8767 16.0009 15.5008C20.3767 11.125 26.3116 8.66666 32.5 8.66666ZM32.5 58.6667C39.5725 58.6667 46.3552 55.8572 51.3562 50.8562C56.3572 45.8552 59.1667 39.0724 59.1667 32C59.1667 24.9276 56.3572 18.1448 51.3562 13.1438C46.3552 8.14284 39.5725 5.33333 32.5 5.33333C25.4276 5.33333 18.6448 8.14284 13.6438 13.1438C8.64286 18.1448 5.83334 24.9276 5.83334 32C5.83334 39.0724 8.64286 45.8552 13.6438 50.8562C18.6448 55.8572 25.4276 58.6667 32.5 58.6667ZM43.6771 26.5104C44.3229 25.8646 44.3229 24.8021 43.6771 24.1562C43.0313 23.5104 41.9688 23.5104 41.3229 24.1562L29.1667 36.3125L23.6771 30.8229C23.0313 30.1771 21.9688 30.1771 21.3229 30.8229C20.6771 31.4687 20.6771 32.5312 21.3229 33.1771L27.9896 39.8437C28.6354 40.4896 29.6979 40.4896 30.3438 39.8437L43.6771 26.5104Z" fill="#BBF7DD"/>\n ',e}(),r=Vf({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"approve-image",testid:"approve-image"});return Hf(r,t),Hf(r,mp({text:e||"Approve",level:2,style:{color:"#BBF7DD",margin:"0",maxWidth:"100px",textAlign:"center"},id:"check-circle-text"})),r},kp=e=>{let{step:t,setImage:r,camera:n}=e;var i,o,a,s;const u=dp[t];(null===(i=Ga.state.autoCaptureSettings)||void 0===i?void 0:i.enabled)&&"selfie"===t&&(u.instructions="second_title_face_autocapture");const c=((e,t)=>Vf({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"document-capture",className:t}))("document-capture",t),l=Vf({tagName:"div",style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},id:"camera-hint-section",testid:"camera-hint-section"}),d=Vf({tagName:"div",style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"80%"},id:"central-container",testid:"central-container"}),h=document.getElementById(Ga.state.rootElementId);if(!h)throw new Error("Root element not found");const f=hp(Yf(t),h);Hf(l,Ap(t)),Hf(l,f);const p=(()=>{const e=Vf({tagName:"div",style:{zIndex:"2",width:"80%",height:"50px",color:"white",display:"flex",alignItems:"center",backgroundColor:"#2E2E2E",justifyContent:"center",opacity:".9"},id:"loading-block",testid:"loading-block"}),t=pp();return t.style.width="16px",t.style.height="16px",t.style.margin="0 10px",Hf(e,t),Hf(e,mp({text:"This may take a few seconds",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-loading-message"})),e})();Hf(f,p),p.style.visibility="hidden";const g=_p({text:qf.translate(u.page),id:"page-header",testid:"page-header",clientHeight:h.clientHeight}),m=(e=>{let{click:t,id:r,testid:n,color:i,withLoader:o}=e;if(o){const e=fp();e.style.position="absolute",e.style.left="-7px",e.style.top="-7px",e.style.height="63px",e.style.width="63px";const o=Vf({tagName:"button",style:{position:"relative",width:"49px",height:"49px",backgroundColor:i||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:r+"-inner",testid:n+"-inner"});return Hf(o,e),o.addEventListener("click",t),o}{const e=Vf({tagName:"button",style:{width:"65px",height:"65px",zIndex:"1",backgroundColor:"black",padding:"0",border:"solid 5px "+(i||"white"),borderRadius:"40px"},id:r+"-outer",testid:n+"-outer"});return Hf(e,Vf({tagName:"div",style:{width:"49px",height:"49px",backgroundColor:i||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:r+"-inner",testid:n+"-inner"})),e.addEventListener("click",t),e}})({click:()=>r({frame:Ip(n.videoElement),suspendedPreview:!1}),id:"submit-image",testid:"submit-image",withLoader:null===(a=null===(o=Ga.state)||void 0===o?void 0:o.autoCaptureSettings)||void 0===a?void 0:a.enabled}),y=((e,t)=>{const r=Vf({tagName:"div",style:{zIndex:"2",width:"70%",paddingBottom:"30px",backgroundColor:"transparent",justifyContent:"space-between",display:"none"},id:"approve-retake-block",testid:"approve-retake-block"}),n=Op(e);return Hf(r,Rp(t)),Hf(r,n),r})(qf.translate("approve_button"),qf.translate("retake_button")),v=(e=>{let{title:t,text:r,clientHeight:n,customTextColor:i}=e;const o=n<700,a=Vf({tagName:"div",style:{position:"relative",zIndex:"2",padding:"0 25px",margin:o?"8px 0":"32px 0"},id:"page-info",testid:"page-info"}),s=mp({text:t,level:o?2:1,style:{color:i||"white",textAlign:"center",marginBottom:o?"4px":"10px"},id:"step-title"}),u=mp({text:r,level:o?6:5,style:{color:i||"white",textAlign:"center",height:"35px"},id:"step-instructions"});return Hf(a,s),Hf(a,u),a})({text:qf.translate(u.instructions),title:qf.translate(u.title),clientHeight:h.clientHeight}),w=(e=>{const t=e<700,r=Vf({tagName:"div",style:{zIndex:"2",width:"85%",display:"flex",flexDirection:Ga.state.markdownSupportText?"column":"row",backgroundColor:"#2E2E2E",borderRadius:"4px",padding:"12px",visibility:"hidden",marginTop:"16px"},id:"error-block",testid:"error-block"}),n=Vf({tagName:"div",style:{display:"flex",flexDirection:"row",width:"100%",height:"inherit",alignItems:"center",paddingTop:"25px"},id:"image-error-block",testid:"image-error-block"}),i=pp();i.style.width="16px",i.style.height="16px",i.style.margin="0 10px",Ga.state.markdownSupportText?Hf(n,i):Hf(r,i);const o=Ga.state.markdownSupportText&&null!=bp?bp.parse(Ga.state.markdownSupportText,{async:!1}):"",a=mp({text:"",level:t?6:5,style:{color:"white",margin:"0",width:"85%",fontWeight:"400",height:"fit-content"},id:"image-error-message"}),s=mp({text:"",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-error-support-message"});return o&&(s.innerHTML=o,Hf(n,a)),Hf(r,o?[n,s]:a),r})(h.clientHeight),b=(null===(s=Ga.state.autoCaptureSettings)||void 0===s?void 0:s.enabled)?fp():function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","65"),e.setAttribute("height","65"),e.setAttribute("viewBox","0 0 24 24"),e.innerHTML='\n <path fill="#ffffff" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path fill="#ffffff" d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"><animateTransform attributeName="transform" type="rotate" dur="0.75s" values="0 12 12;360 12 12" repeatCount="indefinite"/></path>\n ',e}();b.style.display="none",Hf(d,g),Hf(d,v),Hf(d,l),Hf(d,w),Hf(c,d);const _=Vf({tagName:"div",style:{width:"100%",margin:"10%",zIndex:"1",display:"flex",justifyContent:"center"},id:"trigger-section",testid:"trigger-section"});Hf(_,b),Hf(_,m),Hf(_,y),Hf(c,_),Hf(c,n.videoElement);const A=Vf({tagName:"img",style:{display:"block",position:"absolute",objectFit:"cover",height:"100%",width:"100%",transform:"user"===Yf(t)?"scaleX(-1)":""},id:"image-preview",testid:"image-preview"});const E=(e=>{const t=Vf({tagName:"div",style:{position:"absolute",height:"100%",width:"100%",objectFit:"cover"},id:"image-preview-section",testid:"image-preview-section"});return t.appendChild(e),t})(A);return Hf(c,E),{component:c,setLoadingMode:e=>{var t;m.style.display="none",w.style.visibility="hidden",b.style.display="block",(null===(t=Ga.state.autoCaptureSettings)||void 0===t?void 0:t.enabled)&&(b.style.height="63px",b.style.width="63px"),e&&(p.style.visibility="visible")},setApprovalRetakeButtons:e=>{let{approveAction:t,retakeAction:r}=e;var n,i;m.style.display="none",w.style.display="none",y.style.display="flex";const o=y.querySelector("#approve-image"),a=y.querySelector("#retake-image"),s=o.cloneNode(!0);null===(n=o.parentNode)||void 0===n||n.replaceChild(s,o),s.addEventListener("click",t);const u=a.cloneNode(!0);null===(i=a.parentNode)||void 0===i||i.replaceChild(u,a),u.addEventListener("click",r)},hideApprovalRetakeButtons:()=>{y.style.display="none",w.style.display="flex"},setPreviewImage:(e,t)=>{A.src=e,p.style.visibility="hidden",n.videoElement.style.display="none",m.style.display="none",w.style.visibility="hidden",E.style.display="block",b.style.display=t?"none":"block"},setLoadingComplete:()=>{b.style.display="none",p.style.visibility="hidden"},setAutoCapturingError:(e,t)=>{if(!e)return void(w.style.visibility="hidden");let r;r=e==uo.feedback.RESTRICTED_CRITERIA&&t?t:lp[e]?lp[e].message:qf.translate(e)!==e?e:lp.other.message,document.getElementById("image-error-message").innerHTML=qf.translate(r),w.style.visibility="visible"},enableVideoElement:()=>{m.style.display="block",n.videoElement.style.display="block",E.style.display="none",b.style.display="none"},setCapturingShowErrorMode:(e,t)=>{m.style.display="block",E.style.display="none",n.videoElement.style.display="block";const r=e==uo.feedback.RESTRICTED_CRITERIA,i=lp[e]||lp.other;document.getElementById("image-error-message").innerHTML=t&&r&&null!=bp?bp.parse(t,{async:!1}):qf.translate(i.message),w.style.visibility="visible",p.style.visibility="hidden"},setTitleInstructionsMidStep:e=>{let{title:t,instructions:r}=e;t&&(document.getElementById("step-title").innerHTML=qf.translate(t)),r&&(document.getElementById("step-instructions").innerHTML=qf.translate(r))}}};class Np{constructor(){this.isValid=!0,this.failedStep=null,this.steps=[]}addStepResponse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t||(this.isValid=!1,this.failedStep=e),this.steps.push(new Pp(e,t,r))}}class Pp{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.duration=0,this.success=!0,this.step=e,this.success=t,this.duration=r}}class Bp{constructor(){this.name=Ep.ACCEPTED}async handleFrame(){return new Np}}class Fp{constructor(){this.name=Ep.VALID}async handleFrame(e){let{context:t,frame:r,deviceInfo:n,detectionStrategy:i}=e;const o=await i.validate({frame:r,deviceInfo:n});return o.isValid?(t.validFramesCounter++,t.validFramesCounter>=t.validFramesThreshold&&t.setState(new Bp)):(t.validFramesCounter=0,t.invalidFramesCounter=1,t.invalidFramesCause=o.failedStep,t.setState(new zp)),o}}class Lp{constructor(){this.name=Ep.REJECTED}async handleFrame(e){let{context:t,frame:r,detectionStrategy:n,deviceInfo:i}=e;const o=await n.validate({frame:r,deviceInfo:i});return o.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Fp),o):t.invalidFramesCause!==o.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=o.failedStep,t.setState(new zp),o):(t.invalidFramesCounter++,o)}}class zp{constructor(){this.name=Ep.INVALID}async handleFrame(e){let{context:t,frame:r,detectionStrategy:n,deviceInfo:i}=e;const o=await n.validate({frame:r,deviceInfo:i});return o.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Fp)):t.invalidFramesCause!==o.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=o.failedStep):(t.invalidFramesCounter++,t.invalidFramesCounter>=t.invalidFramesThreshold&&t.setState(new Lp)),o}}class Up{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;this.detectionStrategy=e,this.state=new zp,this.validFramesCounter=0,this.invalidFramesCounter=0,this.invalidFramesCause=null,this.validFramesThreshold=t,this.invalidFramesThreshold=r}setState(e){this.state=e}async handleFrame(e){let{frame:t,deviceInfo:r}=e;return await this.state.handleFrame({context:this,frame:t,deviceInfo:r,detectionStrategy:this.detectionStrategy})}}async function jp(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const a=Vp(r,i,o),s=await new Promise(((i,o)=>{navigator.serviceWorker.ready.then((s=>{var u;const c=t=>{t.data.type===e+"_RESULT"&&(navigator.serviceWorker.removeEventListener("message",c),i(t.data.result)),t.data.type===e+"_ERROR"&&(navigator.serviceWorker.removeEventListener("message",c),Qa(t.data.error.toString(),e,"error"),o(t.data.error))};navigator.serviceWorker.addEventListener("message",c),null===(u=s.active)||void 0===u||u.postMessage(t({type:e,imageData:a,height:r.height,width:r.width},n))}))}));return ts(`****** in web-SDK return result for ${e}`,s),s}function Vp(e,t,r){const n=document.createElement("canvas"),i=t||{height:e.height,width:e.width},o=n.getContext("2d");n.width=i.width,n.height=i.height,r?null==o||o.drawImage(e,r.x,r.y,r.width,r.height,0,0,i.width,i.height):null==o||o.drawImage(e,0,0,i.width,i.height);const a=null==o?void 0:o.getImageData(0,0,i.width,i.height);return n.remove(),a}async function Hp(e){if(e instanceof HTMLVideoElement&&e.paused)return[];return jp("DETECT_DOCUMENT",e,{},Ef[rs.DOCUMENT_DETECTOR].imageDimensions)}async function Gp(e,t){return jp("BLUR_GLARE_CLASSIFY",e,{},Ef[rs.BLUR_GLARE_CLASSIFIER].imageDimensions,t)}class qp{constructor(e){this.barcodeModel=null,this.hasBarcode=e,this.barcodeModel=xf()}async validate(e){let{frame:t,deviceInfo:r}=e;var n;const i=new Np;let o=Date.now();const a=null===(n=await Hp(t))||void 0===n?void 0:n[0];let s=Date.now()-o;if(i.addStepResponse(qa.DOCUMENT_DETECTION,void 0!==a,s),!a)return i;o=Date.now();const u=Dp({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:a,videoWidth:t.width,videoHeight:t.height,deviceWidth:r.width,deviceHeight:r.height,threshold:Ga.state.autoCaptureSettings.settings.capture.documentBackSizeThreshold,iouThreshold:Ga.state.autoCaptureSettings.settings.capture.documentBackIouThreshold});if(s=Date.now()-o,i.addStepResponse(qa.DOCUMENT_POSITION,u,s),!u)return i;o=Date.now();const c=await Gp(t,a);s=Date.now()-o;const l=c.some((e=>"blur"===e.class));if(i.addStepResponse(qa.BLUR_DETECTION,!l,s),l)return i;const d=c.some((e=>"glare"===e.class));if(i.addStepResponse(qa.GLARE_DETECTION,!d,s),d)return i;if(this.hasBarcode){o=Date.now();const e=await this.barcodeModel.detect(t);s=Date.now()-o;const r=(null==e?void 0:e.length)>0;if(i.addStepResponse(qa.BARCODE_DETECTION,r,s),!r)return i}return i}}class Wp{constructor(){this.durations=[],this.countSuccess=0,this.countFailed=0}}class Kp{constructor(){this.frameHandleDurations=[],this.stableCounts=[0],this.stats=new Map,Object.values(qa).forEach((e=>{this.stats.set(e,new Wp)}))}addStats(e,t){this.frameHandleDurations.push(t),e.isValid?this.stableCounts[this.stableCounts.length-1]++:this.stableCounts.push(0),e.steps.forEach((e=>{this.addStat(e.step,e.duration,e.success?1:0,e.success?0:1)}))}addStat(e,t,r,n){const i=this.stats.get(e);if(!i)throw new Error(`Stat for step ${e} not found`);i.durations.push(t),i.countSuccess+=r,i.countFailed+=n}}let Xp=!1;const Yp=e=>{Xp=e};class Zp{async validate(e){let{frame:t,deviceInfo:r}=e;var n;const i=new Np;let o=Date.now();const a=null===(n=await Hp(t))||void 0===n?void 0:n[0];let s=Date.now()-o;if(i.addStepResponse(qa.DOCUMENT_DETECTION,void 0!==a,s),!a)return i;o=Date.now();const u=Dp({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:a,videoWidth:t.width,videoHeight:t.height,deviceWidth:r.width,deviceHeight:r.height,threshold:Ga.state.autoCaptureSettings.settings.capture.documentFrontSizeThreshold,iouThreshold:Ga.state.autoCaptureSettings.settings.capture.documentFrontIouThreshold});if(s=Date.now()-o,i.addStepResponse(qa.DOCUMENT_POSITION,u,s),!u)return i;o=Date.now();const c=await Gp(t,a);s=Date.now()-o;const l=c.some((e=>"blur"===e.class));if(i.addStepResponse(qa.BLUR_DETECTION,!l,s),l)return i;const d=c.some((e=>"glare"===e.class));return i.addStepResponse(qa.GLARE_DETECTION,!d,s),i}}let Jp=!1;const $p=e=>{Jp=e};class Qp{async validate(e){let{frame:t,deviceInfo:r}=e;var n;const i=new Np;let o=Date.now();const a=null===(n=await async function(e){return e instanceof HTMLVideoElement&&e.paused?[]:jp("DETECT_FACE_LANDMARKS",e)}(t))||void 0===n?void 0:n[0];let s=Date.now()-o;if(i.addStepResponse(qa.FACE_DETECTION,"face"===(null==a?void 0:a.class),s),!a)return i;o=Date.now();const u=Dp({captureFrame:document.getElementById("overlay-frame user").getBoundingClientRect(),object:a,videoWidth:t.width,videoHeight:t.height,deviceWidth:r.width,deviceHeight:r.height,threshold:Ga.state.autoCaptureSettings.settings.faceDetector.selfieSizeThreshold,iouThreshold:Ga.state.autoCaptureSettings.settings.faceDetector.selfieIouThreshold});return s=Date.now()-o,i.addStepResponse(qa.FACE_POSITION,u,s),i}}let eg=!1;const tg=e=>{eg=e};async function rg(e,t){var r,n,i,o;let a="camera-error";if("NotAllowedError"===t.name){a="Permission dismissed"===t.message?"camera-permission-dismissed":"camera-permission-denied";const s=Za.createCameraNotAllowedEvent(t.message,e);await Ja(null===(r=Ga.state)||void 0===r?void 0:r.step,null===(n=Ga.state)||void 0===n?void 0:n.userToken,null===(i=Ga.state)||void 0===i?void 0:i.sessionId,null===(o=Ga.state)||void 0===o?void 0:o.clientId,s),Ga.dispatch("setIsCapturingProcessStarted",!1)}La(e,a)}function ng(e){const t=(e=>{var t,r,n,i;const[o,a]=e.split(",");if(!o||!a)throw new Error("unable-to-parse-data-uri");const s=null===(n=null===(r=null===(t=o.split(";"))||void 0===t?void 0:t[0])||void 0===r?void 0:r.split(":"))||void 0===n?void 0:n[1];if(!s)throw new Error("unable-to-parse-data-uri");const u=null===(i=s.split("/"))||void 0===i?void 0:i[1];if(!u)throw new Error("unable-to-parse-data-uri");return{data:a,format:u}})(e);return{image:{data:t.data,format:t.format,captureMargins:Xf()}}}let ig=!1;const og=async()=>{const e=await Lf(Ga.state.sessionId,Ga.state.userToken,Ga.state.clientId);ag(e)},ag=async e=>{var t;"expired"===(null==e?void 0:e.status)?za("processing","session-expired",`Session expired for session id: ${Ga.state.sessionId}`):(null==e?void 0:e.missing_images)&&(null===(t=null==e?void 0:e.missing_images)||void 0===t?void 0:t.length)>0&&setTimeout(og,3e3)},sg=e=>{let{step:t}=e;var r,n,i;const o=null===(n=null===(r=Ga.state)||void 0===r?void 0:r.autoCaptureSettings)||void 0===n?void 0:n.enabled;let a=!1;const s=null===(i=Ga.state)||void 0===i?void 0:i.videoCaptureSettings,u=(e=>{let t,r,n=!1;const i=up(e),o=new Qf(i),a=async()=>{n&&(await o.stopCamera(),o.stream&&o.stream.getTracks().forEach((e=>{"live"==e.readyState&&e.stop()})),n=!1)};return{videoStream:r,startVideoFeed:async e=>{var i,s,u;n&&await a(),"environment"==e&&(t=await rp());const c=null!==(s=null===(i=null==t?void 0:t.selectedCamera)||void 0===i?void 0:i.deviceId)&&void 0!==s?s:e,l=sp(e,null===(u=Ga.state)||void 0===u?void 0:u.videoCaptureSettings);ep.getInstance().stopStream(),r=await o.startCamera(c,l),n=!0},stopVideoFeed:a,videoElement:o.videoElement,getDataUri:o.getDataUri,getCameraInfo:()=>t}})(Yf(t));!function(e){Ba({type:"page-load",step:e})}(t),og();const c=kp({step:t,setImage:l,camera:u});async function l(e){let{suspendedPreview:r=!1,frame:n,context:i}=e;n||(n=Ip(u.videoElement)),"document_front"===t&&$p(!1),"document_back"===t&&Yp(!1),"selfie"===t&&tg(!1);const o=Date.now(),l=function(e){const t=e.getCameraInfo();return{selectedCamera:(null==t?void 0:t.selectedCamera)&&{label:t.selectedCamera.label},camerasInfo:(null==t?void 0:t.optionalCameras)&&t.optionalCameras.map((e=>({label:e.label})))}}(u);if(!a)return;c.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(e=>e.toDataURL("image/jpeg"))(n);c.setPreviewImage(f,"selfie"===t),await u.stopVideoFeed(),"selfie"!==t?await h(r,f,l,o,null==i?void 0:i.stats):(c.setTitleInstructionsMidStep({instructions:"selfie_approval_autocapture"}),c.setApprovalRetakeButtons({approveAction:async()=>{c.hideApprovalRetakeButtons(),await h(r,f,l,o,null==i?void 0:i.stats)},retakeAction:()=>{c.hideApprovalRetakeButtons(),d()}}))}function d(){"selfie"===t&&c.setTitleInstructionsMidStep({instructions:"second_title_face_autocapture"}),u.startVideoFeed(Yf(t)).then((()=>{a=!0,c.enableVideoElement(),o&&(c.setAutoCapturingError(null),f(t))})).catch((async e=>{throw await rg(t,e),e}))}async function h(e,r,n,i,l){const h=[];!function(e){var r,n,i,o;const a=Za.createUserActionEvent("capture_image",t,e);Ja(null===(r=Ga.state)||void 0===r?void 0:r.step,null===(n=Ga.state)||void 0===n?void 0:n.userToken,null===(i=Ga.state)||void 0===i?void 0:i.sessionId,null===(o=Ga.state)||void 0===o?void 0:o.clientId,a)}(l),function(e,t){Ba({type:"capture-image",imageType:t,step:e})}(t,Zf(t));try{const u=Date.now(),l=ng(r);a=!1,h.push(Kf(Ga.state.sessionId,Ga.state.userToken,Ga.state.clientId,null==l?void 0:l.image,n,Zf(t))),h.push(e?new Promise((e=>setTimeout(e,500))):Promise.resolve(null)),c.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(await Promise.all(h))[0];if(Object.prototype.hasOwnProperty.call(f,"has_barcode")&&(ig=f.has_barcode),async function(e){let{step:t,requestStartTime:r,imageProcessingStartTime:n,serverProcessingTime:i,userToken:o,sessionId:a,clientId:s}=e;const u=Date.now()-r,c=n?r-n:0,l=Za.createUploadImageEvent(t,String(u),String(i),String(c));await Ja(t,o,a,s,l)}({step:t,requestStartTime:u,imageProcessingStartTime:i,serverProcessingTime:f.serverProcessingTime,userToken:Ga.state.userToken,sessionId:Ga.state.sessionId,clientId:Ga.state.clientId}),Ga.dispatch("setMissingImages",f.missing_images),c.setLoadingComplete(),function(e,t,r){Ba({type:"capture-image-result",imageType:t,feedback:r,step:e})}(t,Zf(t),f.feedback),"ok"!==f.feedback)return await async function(e){Mp("border-color",Cp),o?c.setAutoCapturingError(e.feedback,e.custom_feedback):c.setCapturingShowErrorMode(e.feedback,e.custom_feedback),await new Promise((e=>setTimeout(e,1e3))),Mp("border-color",Sp)}(f),void d();Mp("border-color",xp),await new Promise((e=>setTimeout(e,750))),Mp("border-color",Sp),Ga.dispatch("setStep",(e=>{let t;return t=e&&e.length>0?e.shift():"processing",t})(Ga.state.missingImages))}catch(e){c.setLoadingComplete(),c.setCapturingShowErrorMode(uo.feedback.OTHER),u.startVideoFeed(Yf(t)).then((()=>{a=!0})).catch((async e=>{throw await rg(t,e),e})),La(t,"failed-to-submit-image")}}async function f(e){if("document_front"===e){for(;!a||u.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return u.videoElement.onloadedmetadata=()=>{var e;ts("video dimensions (width, height, orientation): ",u.videoElement.videoWidth,u.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:r,showError:n}=e;var i,o,a,s,u,c,l;const d=new Up(new Zp,null!==(a=null===(o=null===(i=Ga.state.autoCaptureSettings.settings)||void 0===i?void 0:i.stability)||void 0===o?void 0:o.numStableFrames)&&void 0!==a?a:2),h=new Kp;for($p(!0);d.state.name!==Ep.ACCEPTED&&Jp;){const e=Date.now(),i=Ip(t.videoElement),o={width:null!==(u=null===(s=t.videoElement.getBoundingClientRect())||void 0===s?void 0:s.width)&&void 0!==u?u:0,height:null!==(l=null===(c=t.videoElement.getBoundingClientRect())||void 0===c?void 0:c.height)&&void 0!==l?l:0},a=await d.handleFrame({frame:i,deviceInfo:o}),f=Date.now()-e+50;h.addStats(a,f),d.stats=h,await Tp({context:d,onDetect:r,showError:n,frame:i}),await new Promise((e=>setTimeout(e,50)))}}({camera:u,onDetect:l,showError:c.setAutoCapturingError})}if("document_back"===e){for(;!a||u.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return u.videoElement.onloadedmetadata=()=>{var e;ts("video dimensions (width, height, orientation): ",u.videoElement.videoWidth,u.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:r,showError:n,hasBarcode:i}=e;var o,a,s,u,c,l,d;const h=new Up(new qp(i),null!==(s=null===(a=null===(o=Ga.state.autoCaptureSettings.settings)||void 0===o?void 0:o.stability)||void 0===a?void 0:a.numStableFrames)&&void 0!==s?s:2);Yp(!0);const f=new Kp;for(;h.state.name!==Ep.ACCEPTED&&Xp;){const e=Date.now(),i=Ip(t.videoElement),o={width:null!==(c=null===(u=t.videoElement.getBoundingClientRect())||void 0===u?void 0:u.width)&&void 0!==c?c:0,height:null!==(d=null===(l=t.videoElement.getBoundingClientRect())||void 0===l?void 0:l.height)&&void 0!==d?d:0},a=await h.handleFrame({frame:i,deviceInfo:o}),s=Date.now()-e+50;f.addStats(a,s),h.stats=f,await Tp({context:h,onDetect:r,showError:n,frame:i}),await new Promise((e=>setTimeout(e,50)))}}({camera:u,onDetect:l,showError:c.setAutoCapturingError,hasBarcode:ig})}if("selfie"===e){for(;!a||u.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return u.videoElement.onloadedmetadata=()=>{var e;ts("video dimensions (width, height, orientation): ",u.videoElement.videoWidth,u.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:r,showError:n}=e;var i,o,a,s;const u=new Up(new Qp,30);tg(!0);const c=new Kp;for(;u.state.name!==Ep.ACCEPTED&⪚){const e=Date.now(),l=Ip(t.videoElement),d={width:null!==(o=null===(i=t.videoElement.getBoundingClientRect())||void 0===i?void 0:i.width)&&void 0!==o?o:0,height:null!==(s=null===(a=t.videoElement.getBoundingClientRect())||void 0===a?void 0:a.height)&&void 0!==s?s:0},h=await u.handleFrame({frame:l,deviceInfo:d}),f=Date.now()-e;c.addStats(h,f),u.stats=c,await Tp({context:u,onDetect:r,showError:n,frame:l,isSelfie:!0}),await new Promise((e=>setTimeout(e,50)))}}({camera:u,onDetect:l,showError:c.setAutoCapturingError})}}return o&&f(t),(async e=>{var t,r,n,i;const o=Za.createPageViewEvent(e);await Ja(null===(t=Ga.state)||void 0===t?void 0:t.step,null===(r=Ga.state)||void 0===r?void 0:r.userToken,null===(n=Ga.state)||void 0===n?void 0:n.sessionId,null===(i=Ga.state)||void 0===i?void 0:i.clientId,o)})(t),u.startVideoFeed(Yf(t)).then((()=>{a=!0})).catch((async e=>{throw await rg(t,e),e})),c.component},ug=()=>{Ba({type:"start-verification-processing",step:Ga.state.step}),Fa("processing","processing",Ga.state.sessionId);const e=cg("processing-verification");Hf(e,_p({text:"Processing Verification",id:"processing-verification-header",testid:"processing-verification-header"}));const t=async()=>{const e=await Lf(Ga.state.sessionId,Ga.state.userToken,Ga.state.clientId);i(e)},r=()=>{setTimeout(t,3e3)},n=async e=>{Ga.dispatch("setStep",e.status),Ga.dispatch("setStatus",e.status)},i=async e=>{var t,i;if(Ga.dispatch("setMissingImages",e.missing_images),e.status)if("complete"===(null==e?void 0:e.status)){ep.getInstance().stopStream();const r=Za.createProcessingCompleteEvent();await Ja(Ga.state.step,Ga.state.userToken,null===(t=Ga.state)||void 0===t?void 0:t.sessionId,null===(i=Ga.state)||void 0===i?void 0:i.clientId,r),n(e),Fa("complete",e.status,Ga.state.sessionId),function(e,t,r){Ba({type:"verification-complete",step:e,sessionId:t,callbackUrl:r})}("complete",Ga.state.sessionId,e.callback_url),function(e){sessionStorage.removeItem(e)}(Oa)}else"recapture"===(null==e?void 0:e.status)?(n(e),Ga.dispatch("setIsCapturingProcessStarted",!1),Fa("recapture",e.status,Ga.state.sessionId),function(e,t,r){Ba({type:"verification-recapture",step:e,sessionId:t,reason:r})}("recapture",e.status,e.recapture_reason)):"expired"===(null==e?void 0:e.status)?za("processing","session-expired",`Session expired for session id: ${Ga.state.sessionId}`):r();else"processing"!==e.state&&(n(e),r())};return t(),e},cg=e=>Vf({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"processing-verification"});function lg(e,t){var r;if(!e)return;null===(r=t.firstChild)||void 0===r||r.remove();const n=function(e){switch(e){case"processing":return ug;case"document_front":case"document_back":case"selfie":return sg;default:throw new Error("Invalid step")}}(e);Hf(t,n({step:e}))}function dg(e){let{key:t,state:r}=e;const n=r.rootElementId,i=document.getElementById(n);"step"===t&&"complete"!==r.step&&"recapture"!==r.step&&lg(r.step,i),i&&"processing"===r.step&&(i.style.visibility="hidden")}function hg(){const e=zf(ka(Oa));if(!zf)throw console.log("Error restarting session, stored session data is invalid or missing"),new Error("Error restarting session, stored session data is invalid or missing");const t=e.sessionId,r=e.userToken;return Ga.dispatch("setSessionId",t),Ga.dispatch("setUserToken",r),{sessionId:t,userToken:r}}async function fg(){var e,t;if(null===(e=Ga.state.autoCaptureSettings)||void 0===e?void 0:e.enabled){const e=Date.now();try{await mg(),ts("all models loaded - auto-capture enabled")}catch(e){Ga.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:null===(t=Ga.state.autoCaptureSettings)||void 0===t?void 0:t.settings}),ts("Model loading did not complete on time:",e);Qa(`timed out loading models: ${Sf.filter((e=>Ef[e].status!==Af.LOADED)).map((e=>e)).join(", ")}`,"model_load_timeout","init")}const r=Object.values(Ef).filter((e=>e.status===Af.LOADED)).map((e=>e.loadingStats));!async function(e,t){const r=Za.createSdkInitEvent(e,t);await es("init",r)}(Date.now()-e,r)}}async function pg(e){var r;try{await ep.getInstance().startNewStream({video:t(t({},sp("environment",null===(r=Ga.state)||void 0===r?void 0:r.videoCaptureSettings)),{},{deviceId:await ap("environment")})}),function(e,t){Ba({type:"session-id-acquired",step:e,sessionId:t})}("init",e),function(e,t,r){const n=document.getElementById(r);n.style.visibility="visible",lg(e.shift(),n)}(Ga.state.missingImages,Ga.state.sessionId,Ga.state.rootElementId)}catch(e){await rg("init",e)}}async function gg(e){let{status:t,sessionId:r,userToken:n,missingImages:i,rootElementId:o,language:a}=e;!function(e,t){Ba({type:"session-granted",step:e,sessionId:t})}("init",r),Ga.dispatch("setStatus",t),Ga.dispatch("setSessionId",r),Ga.dispatch("setUserToken",n),Ga.dispatch("setMissingImages",i),Ga.dispatch("setRootElement",o),Ga.dispatch("setLanguage",a),async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";qf.overrideLanguage(Wf[r]||Wf.en);let n=document.getElementById(t);if(!n){n=Vf({tagName:"div",style:{background:"#fff",position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%",font:"inherit"},id:t,testid:"root"});const e=document.createElement("style");e.innerHTML=`\n @media only screen and (max-height: 576px) {\n #${t} #trigger-section {\n margin: 0 !important;\n }\n #${t} #page-header {\n height: 5% !important;\n }\n }\n `,Hf(document.head,e),Hf(document.body,n)}}(Ga.state.sessionId,Ga.state.rootElementId,Ga.state.language),function(){try{Ma.events.off(Ra,dg)}catch(e){}Ma.events.on(Ra,dg)}(),await fg(),await pg(r)}const mg=async()=>{const e=Ga.state.autoCaptureSettings.settings.modelLoadingTimeout;return Promise.race([If(),new Promise(((t,r)=>setTimeout((()=>r(new Error(`Model loading timed out after ${e} ms`))),e)))])};async function yg(e){if(Ga.state.isCapturingProcessStarted)return void La(Ga.state.step,"trying-to-initialize-active-session");let t,r;if(e){const n=await async function(e){let t,r;try{const n=await jf(e,Ga.state.consentVersion,Ga.state.clientId);return t=n.sessionId,r=n.userToken,Ga.dispatch("setSessionId",t),Ga.dispatch("setUserToken",r),{sessionId:t,userToken:r}}catch(e){throw console.log("Error starting session"),console.error(e),e}}(e);t=n.sessionId,r=n.userToken}else{const e=hg();t=e.sessionId,r=e.userToken}if(!t)return void La(Ga.state.step,"other");const{missing_images:n,status:i}=await Lf(t,r,Ga.state.clientId);return Ga.dispatch("setIsCapturingProcessStarted",!0),await gg({status:i,sessionId:t,userToken:r,missingImages:n,rootElementId:Ga.state.rootElementId,language:Ga.state.language}),!0}async function vg(){try{return await async function(){if("recapture"===Ga.state.verificationStatus||"pending"===Ga.state.verificationStatus){const{sessionId:e,userToken:t}=hg(),{missing_images:r,status:n}=await Lf(e,t,Ga.state.clientId);return await gg({status:n,sessionId:e,userToken:t,missingImages:r,rootElementId:Ga.state.rootElementId,language:Ga.state.language}),!0}La(Ga.state.step,"trying-to-initialize-active-session")}()}catch(e){throw console.log("Error restarting session"),console.error(e),e}}var wg=Object.freeze({__proto__:null,recapture:vg,restart:async function(){return vg()},start:async function(e){try{return await yg(e)}catch(e){throw console.log("Error starting session"),console.error(e),e}},version:()=>go});class bg{static arrayBufferToBase64(e){return btoa(String.fromCharCode(...new Uint8Array(e)))}static base64ToArrayBuffer(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}static stringToBase64(e){return btoa(e)}static jsonToBase64(e){const t=JSON.stringify(e);return btoa(t)}static base64ToJson(e){const t=atob(e);return JSON.parse(t)}}const _g={log:console.log,error:console.error};var Ag,Eg;!function(e){e.NotInitialized="not_initialized",e.AuthenticationFailed="authentication_failed",e.AuthenticationAbortedTimeout="authentication_aborted_timeout",e.AuthenticationCanceled="webauthn_authentication_canceled",e.RegistrationFailed="registration_failed",e.AlreadyRegistered="username_already_registered",e.RegistrationAbortedTimeout="registration_aborted_timeout",e.RegistrationCanceled="webauthn_registration_canceled",e.AutofillAuthenticationAborted="autofill_authentication_aborted",e.AuthenticationProcessAlreadyActive="authentication_process_already_active",e.InvalidApprovalData="invalid_approval_data",e.FailedToInitCrossDeviceSession="cross_device_init_failed",e.FailedToGetCrossDeviceStatus="cross_device_status_failed",e.Unknown="unknown"}(Ag||(Ag={}));class Cg extends Error{constructor(e,t){super(e),this.errorCode=Ag.NotInitialized,this.data=t}}class xg extends Cg{constructor(e,t){super(null!=e?e:"WebAuthnSdk is not initialized",t),this.errorCode=Ag.NotInitialized}}class Sg extends Cg{constructor(e,t){super(null!=e?e:"Authentication failed with an error",t),this.errorCode=Ag.AuthenticationFailed}}class Ig extends Cg{constructor(e,t){super(null!=e?e:"Authentication was canceled by the user or got timeout",t),this.errorCode=Ag.AuthenticationCanceled}}class Tg extends Cg{constructor(e,t){super(null!=e?e:"Registration failed with an error",t),this.errorCode=Ag.RegistrationFailed}}class Mg extends Cg{constructor(e,t){super(null!=e?e:"Registration was canceled by the user or got timeout",t),this.errorCode=Ag.RegistrationCanceled}}class Dg extends Cg{constructor(e){super(null!=e?e:"Autofill flow was aborted"),this.errorCode=Ag.AutofillAuthenticationAborted}}class Rg extends Cg{constructor(e){super(null!=e?e:"Operation was aborted by timeout"),this.errorCode=Ag.AutofillAuthenticationAborted}}class Og extends Cg{constructor(e){super(null!=e?e:"Passkey with this username is already registered with the relying party."),this.errorCode=Ag.AlreadyRegistered}}class kg extends Cg{constructor(e,t){super(null!=e?e:"Authentication process is already active",t),this.errorCode=Ag.AuthenticationProcessAlreadyActive}}class Ng extends Cg{constructor(e,t){super(null!=e?e:"Invalid approval data",t),this.errorCode=Ag.InvalidApprovalData}}class Pg extends Cg{constructor(e,t){super(null!=e?e:"Failed to init cross device authentication",t),this.errorCode=Ag.FailedToInitCrossDeviceSession}}class Bg extends Cg{constructor(e,t){super(null!=e?e:"Failed to get cross device status",t),this.errorCode=Ag.FailedToGetCrossDeviceStatus}}function Fg(e){return e.errorCode&&Object.values(Ag).includes(e.errorCode)}!function(e){e[e.persistent=0]="persistent",e[e.session=1]="session"}(Eg||(Eg={}));class Lg{static get(e){return Lg.getStorageMedium(Lg.allowedKeys[e]).getItem(Lg.getStorageKey(e))||void 0}static set(e,t){return Lg.getStorageMedium(Lg.allowedKeys[e]).setItem(Lg.getStorageKey(e),t)}static remove(e){Lg.getStorageMedium(Lg.allowedKeys[e]).removeItem(Lg.getStorageKey(e))}static clear(e){for(const[t,r]of Object.entries(Lg.allowedKeys)){const n=t;e&&this.configurationKeys.includes(n)||Lg.getStorageMedium(r).removeItem(Lg.getStorageKey(n))}}static getStorageKey(e){return`WebAuthnSdk:${e}`}static getStorageMedium(e){return e===Eg.session?sessionStorage:localStorage}}Lg.allowedKeys={clientId:Eg.session},Lg.configurationKeys=["clientId"];class zg{static isNewApiDomain(e){return e&&(this.newApiDomains.includes(e)||e.startsWith("api.")&&e.endsWith(".transmitsecurity.io"))}static dnsPrefetch(e){const t=document.createElement("link");t.rel="dns-prefetch",t.href=e,document.head.appendChild(t)}static preconnect(e,t){const r=document.createElement("link");r.rel="preconnect",r.href=e,t&&(r.crossOrigin="anonymous"),document.head.appendChild(r)}static warmupConnection(e){this.dnsPrefetch(e),this.preconnect(e,!1),this.preconnect(e,!0)}static init(e,t){var r,n;try{this._serverPath=new URL(t.serverPath),this.isNewApiDomain(null===(r=this._serverPath)||void 0===r?void 0:r.hostname)&&this.warmupConnection(this._serverPath.origin),this._apiPaths=null!==(n=t.webauthnApiPaths)&&void 0!==n?n:this.getDefaultPaths(),this._clientId=e,Lg.set("clientId",e)}catch(e){throw new xg("Invalid options.serverPath",{error:e})}}static getDefaultPaths(){var e;const t=this.isNewApiDomain(null===(e=this._serverPath)||void 0===e?void 0:e.hostname)?"/cis":"";return{startAuthentication:`${t}/v1/auth/webauthn/authenticate/start`,startRegistration:`${t}/v1/auth/webauthn/register/start`,initCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/init`,startCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/start`,startCrossDeviceRegistration:`${t}/v1/auth/webauthn/cross-device/register/start`,getCrossDeviceTicketStatus:`${t}/v1/auth/webauthn/cross-device/status`,attachDeviceToCrossDeviceSession:`${t}/v1/auth/webauthn/cross-device/attach-device`}}static getApiPaths(){return this._apiPaths}static async sendRequest(e,t,r){_g.log(`[WebAuthn SDK] Calling ${t.method} ${e}...`);const n=new URL(this._serverPath);return n.pathname=e,r&&(n.search=r),fetch(n.toString(),t)}static async startRegistration(e){const r=await this.sendRequest(this._apiPaths.startRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(t({client_id:this.getValidatedClientId(),username:e.username,display_name:e.displayName},e.timeout&&{timeout:e.timeout}),e.limitSingleCredentialToDevice&&{limit_single_credential_to_device:e.limitSingleCredentialToDevice}))});if(!(null==r?void 0:r.ok))throw new Sg("Failed to start registration",null==r?void 0:r.body);return await r.json()}static async startAuthentication(e){const r=await this.sendRequest(this._apiPaths.startAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(t(t({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}),e.timeout&&{timeout:e.timeout}))});if(!(null==r?void 0:r.ok))throw new Sg("Failed to start authentication",null==r?void 0:r.body);return await r.json()}static async initCrossDeviceAuthentication(e){const r=await this.sendRequest(this._apiPaths.initCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(t({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}))});if(!(null==r?void 0:r.ok))throw new Pg(void 0,null==r?void 0:r.body);return await r.json()}static async getCrossDeviceTicketStatus(e){const t=await this.sendRequest(this._apiPaths.getCrossDeviceTicketStatus,{method:"GET"},`cross_device_ticket_id=${e.ticketId}`);if(!(null==t?void 0:t.ok))throw new Bg(void 0,null==t?void 0:t.body);return await t.json()}static async startCrossDeviceAuthentication(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new Sg("Failed to start cross device authentication",null==t?void 0:t.body);return await t.json()}static async startCrossDeviceRegistration(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new Tg("Failed to start cross device registration",null==t?void 0:t.body);return await t.json()}static async attachDeviceToCrossDeviceSession(e){const t=await this.sendRequest(this._apiPaths.attachDeviceToCrossDeviceSession,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new Tg("Failed to attach device to cross device session",null==t?void 0:t.body);return await t.json()}static getValidatedClientId(){var e;const t=null!==(e=this._clientId)&&void 0!==e?e:Lg.get("clientId");if(!t)throw new xg("Missing clientId");return t}}var Ug,jg,Vg,Hg;zg.newApiDomains=["api.idsec-dev.com","api.idsec-stg.com"],function(e){e.InputAutofill="input-autofill",e.Modal="modal"}(Ug||(Ug={})),function(e){e.Pending="pending",e.Scanned="scanned",e.Success="success",e.Error="error",e.Timeout="timeout",e.Aborted="aborted"}(jg||(jg={})),function(e){e.toAuthenticationError=e=>Fg(e)?e:"NotAllowedError"===e.name?new Ig:"OperationError"===e.name?new kg(e.message):"SecurityError"===e.name?new Sg(e.message):e===Ag.AuthenticationAbortedTimeout?new Rg:"AbortError"===e.name||e===Ag.AutofillAuthenticationAborted?new Dg:new Sg("Something went wrong during authentication",{error:e}),e.toRegistrationError=e=>Fg(e)?e:"NotAllowedError"===e.name?new Mg:"SecurityError"===e.name?new Tg(e.message):"InvalidStateError"===e.name?new Og:e===Ag.RegistrationAbortedTimeout?new Rg:new Tg("Something went wrong during registration",{error:e})}(Vg||(Vg={})),function(e){e.processCredentialRequestOptions=e=>t(t({},e),{},{challenge:bg.base64ToArrayBuffer(e.challenge),allowCredentials:e.allowCredentials.map((e=>t(t({},e),{},{id:bg.base64ToArrayBuffer(e.id)})))}),e.processCredentialCreationOptions=(e,r)=>{var n;const i=JSON.parse(JSON.stringify(e));return i.challenge=bg.base64ToArrayBuffer(e.challenge),i.user.id=bg.base64ToArrayBuffer(e.user.id),(null==r?void 0:r.limitSingleCredentialToDevice)&&(i.excludeCredentials=null===(n=e.excludeCredentials)||void 0===n?void 0:n.map((e=>t(t({},e),{},{id:bg.base64ToArrayBuffer(e.id)})))),(null==r?void 0:r.registerAsDiscoverable)?(i.authenticatorSelection.residentKey="preferred",i.authenticatorSelection.requireResidentKey=!0):(i.authenticatorSelection.residentKey="discouraged",i.authenticatorSelection.requireResidentKey=!1),i.authenticatorSelection.authenticatorAttachment=(null==r?void 0:r.allowCrossPlatformAuthenticators)?void 0:"platform",i},e.encodeAuthenticationResult=e=>{const{authenticatorAttachment:t}=e,r=e.response;return{id:e.id,rawId:bg.arrayBufferToBase64(e.rawId),response:{authenticatorData:bg.arrayBufferToBase64(r.authenticatorData),clientDataJSON:bg.arrayBufferToBase64(r.clientDataJSON),signature:bg.arrayBufferToBase64(r.signature),userHandle:bg.arrayBufferToBase64(r.userHandle)},authenticatorAttachment:t,type:e.type}},e.encodeRegistrationResult=e=>{const{authenticatorAttachment:t}=e,r=e.response;return{id:e.id,rawId:bg.arrayBufferToBase64(e.rawId),response:{attestationObject:bg.arrayBufferToBase64(r.attestationObject),clientDataJSON:bg.arrayBufferToBase64(r.clientDataJSON)},authenticatorAttachment:t,type:e.type}}}(Hg||(Hg={}));class Gg{async modal(e){try{const r=await this.performAuthentication(t(t({},e),{},{mediationType:Ug.Modal}));return bg.jsonToBase64(r)}catch(e){throw Vg.toAuthenticationError(e)}}activateAutofill(e,t){const{onSuccess:r,onError:n,onReady:i}=e;this.performAuthentication({username:t,mediationType:Ug.InputAutofill,onReady:i}).then((e=>{r(bg.jsonToBase64(e))})).catch((e=>{const t=Vg.toAuthenticationError(e);if(!n)throw t;n(t)}))}abortAutofill(){this.abortController&&this.abortController.abort(Ag.AutofillAuthenticationAborted)}abortAuthentication(){this.abortController&&this.abortController.abort(Ag.AuthenticationAbortedTimeout)}async performAuthentication(e){var t,r;const n="crossDeviceTicketId"in e?await zg.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await zg.startAuthentication({username:e.username,timeout:null===(t=e.options)||void 0===t?void 0:t.timeout}),i=n.credential_request_options,o=Hg.processCredentialRequestOptions(i),a=this.getMediatedCredentialRequest(o,e.mediationType);e.mediationType===Ug.InputAutofill&&(null===(r=e.onReady)||void 0===r||r.call(e));const s=await navigator.credentials.get(a).catch((e=>{throw Vg.toAuthenticationError(e)}));return{webauthnSessionId:n.webauthn_session_id,publicKeyCredential:Hg.encodeAuthenticationResult(s),userAgent:navigator.userAgent}}getMediatedCredentialRequest(e,t){const r={publicKey:e};return this.abortController=new AbortController,r.signal=this.abortController&&this.abortController.signal,t===Ug.InputAutofill?r.mediation="conditional":e.timeout&&setTimeout((()=>{this.abortAuthentication()}),e.timeout),r}}class qg{constructor(e,t){this.handler=e,this.intervalInMs=t}begin(){var e;this.intervalId=window.setInterval((e=this.handler,async function(){e.isRunning||(e.isRunning=!0,await e(...arguments),e.isRunning=!1)}),this.intervalInMs)}stop(){clearInterval(this.intervalId)}}const Wg=/^[A-Za-z0-9\-_.: ]*$/;function Kg(e){if(e&&(!function(e){return Object.keys(e).length<=10}(e)||!function(e){const t=e=>"string"==typeof e,r=e=>Wg.test(e);return Object.keys(e).every((n=>t(n)&&t(e[n])&&r(n)&&r(e[n])))}(e)))throw _g.error("Failed validating approval data"),new Ng("Provided approval data should have 10 properties max. Also, it should contain only \n alphanumeric characters, numbers, and the special characters: '-', '_', '.'")}class Xg{constructor(e,r,n){this.authenticationHandler=e,this.registrationHandler=r,this.approvalHandler=n,this.init={registration:async e=>(this.ticketStatus=jg.Pending,this.pollCrossDeviceSession(e.crossDeviceTicketId,e.handlers)),authentication:async e=>{const{username:r}=e,n=(await zg.initCrossDeviceAuthentication(t({},r&&{username:r}))).cross_device_ticket_id;return this.ticketStatus=jg.Pending,this.pollCrossDeviceSession(n,e.handlers)},approval:async e=>{const{username:t,approvalData:r}=e;Kg(r);const n=(await zg.initCrossDeviceAuthentication({username:t,approvalData:r})).cross_device_ticket_id;return this.ticketStatus=jg.Pending,this.pollCrossDeviceSession(n,e.handlers)}},this.authenticate={modal:async e=>this.authenticationHandler.modal({crossDeviceTicketId:e})},this.approve={modal:async e=>this.approvalHandler.modal({crossDeviceTicketId:e})}}async register(e,t){return this.registrationHandler.register({crossDeviceTicketId:e},t)}async attachDevice(e){const r=await zg.attachDeviceToCrossDeviceSession({ticketId:e});return t({status:r.status,startedAt:r.started_at},r.approval_data&&{approvalData:r.approval_data})}async pollCrossDeviceSession(e,t){return this.poller=new qg((async()=>{var r,n;const i=await zg.getCrossDeviceTicketStatus({ticketId:e}),o=i.status;if(o!==this.ticketStatus)switch(this.ticketStatus=o,o){case jg.Scanned:await t.onDeviceAttach();break;case jg.Error:case jg.Timeout:case jg.Aborted:await t.onFailure(i),null===(r=this.poller)||void 0===r||r.stop();break;case jg.Success:if("onCredentialRegister"in t)await t.onCredentialRegister();else{if(!i.session_id)throw new Bg("Cross device session is complete without returning session_id",i);await t.onCredentialAuthenticate(i.session_id)}null===(n=this.poller)||void 0===n||n.stop()}}),1e3),this.poller.begin(),setTimeout((()=>{var e;null===(e=this.poller)||void 0===e||e.stop(),t.onFailure({status:jg.Timeout})}),3e5),{crossDeviceTicketId:e,stop:()=>{var e;null===(e=this.poller)||void 0===e||e.stop()}}}}class Yg{async register(e,r){this.abortController=new AbortController;const n=t({allowCrossPlatformAuthenticators:!("crossDeviceTicketId"in e),registerAsDiscoverable:!0},r);try{const t="crossDeviceTicketId"in e?await zg.startCrossDeviceRegistration({ticketId:e.crossDeviceTicketId}):await zg.startRegistration({username:e.username,displayName:(null==r?void 0:r.displayName)||e.username,timeout:null==r?void 0:r.timeout,limitSingleCredentialToDevice:null==r?void 0:r.limitSingleCredentialToDevice}),i=Hg.processCredentialCreationOptions(t.credential_creation_options,n);setTimeout((()=>{this.abortRegistration()}),i.timeout);const o=await this.registerCredential(i),a={webauthnSessionId:t.webauthn_session_id,publicKeyCredential:o,userAgent:navigator.userAgent};return bg.jsonToBase64(a)}catch(e){throw Vg.toRegistrationError(e)}}abortRegistration(){this.abortController&&this.abortController.abort(Ag.RegistrationAbortedTimeout)}async registerCredential(e){const t=await navigator.credentials.create({publicKey:e,signal:this.abortController&&this.abortController.signal}).catch((e=>{throw Vg.toRegistrationError(e)}));return Hg.encodeRegistrationResult(t)}}class Zg{async modal(e){try{const t=await this.performApproval(e);return bg.jsonToBase64(t)}catch(e){throw Vg.toAuthenticationError(e)}}async performApproval(e){"approvalData"in e&&Kg(e.approvalData);const t="crossDeviceTicketId"in e?await zg.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await zg.startAuthentication({username:e.username,approvalData:e.approvalData}),r=t.credential_request_options,n=Hg.processCredentialRequestOptions(r),i=await navigator.credentials.get({publicKey:n}).catch((e=>{throw Vg.toAuthenticationError(e)}));return{webauthnSessionId:t.webauthn_session_id,publicKeyCredential:Hg.encodeAuthenticationResult(i),userAgent:navigator.userAgent}}}class Jg{constructor(){this._initialized=!1,this._authenticationHandler=new Gg,this._registrationHandler=new Yg,this._approvalHandler=new Zg,this._crossDeviceHandler=new Xg(this._authenticationHandler,this._registrationHandler,this._approvalHandler),this.authenticate={modal:async(e,t)=>(this.initCheck(),this._authenticationHandler.modal({username:e,options:t})),autofill:{activate:(e,t)=>(this.initCheck(),this._authenticationHandler.activateAutofill(e,t)),abort:()=>this._authenticationHandler.abortAutofill()}},this.approve={modal:async(e,t)=>(this.initCheck(),this._approvalHandler.modal({username:e,approvalData:t}))},this.register=async(e,t)=>(this.initCheck(),this._registrationHandler.register({username:e},t)),this.crossDevice={init:{registration:async e=>(this.initCheck(),this._crossDeviceHandler.init.registration(e)),authentication:async e=>(this.initCheck(),this._crossDeviceHandler.init.authentication(e)),approval:async e=>(this.initCheck(),this._crossDeviceHandler.init.approval(e))},authenticate:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.authenticate.modal(e))},approve:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.approve.modal(e))},register:async(e,t)=>(this.initCheck(),this._crossDeviceHandler.register(e,t)),attachDevice:async e=>(this.initCheck(),this._crossDeviceHandler.attachDevice(e))},this.isPlatformAuthenticatorSupported=async()=>{var e;try{return await(null===(e=Jg.StaticPublicKeyCredential)||void 0===e?void 0:e.isUserVerifyingPlatformAuthenticatorAvailable())}catch(e){return!1}},this.isAutofillSupported=async()=>{var e,t;return!(!(null===(e=Jg.StaticPublicKeyCredential)||void 0===e?void 0:e.isConditionalMediationAvailable)||!await(null===(t=Jg.StaticPublicKeyCredential)||void 0===t?void 0:t.isConditionalMediationAvailable()))}}async init(e,t){try{if(!e)throw new xg("Invalid clientId",{clientId:e});if(t.webauthnApiPaths){const e=zg.getDefaultPaths();if(function(e,t){const r=new Set(e),n=new Set(t);return[...e.filter((e=>!n.has(e))),...t.filter((e=>!r.has(e)))]}(Object.keys(t.webauthnApiPaths),Object.keys(e)).length)throw new xg("Invalid custom paths",{customApiPaths:t.webauthnApiPaths})}zg.init(e,t),this._initialized=!0}catch(e){throw Fg(e)?e:new xg("Failed to initialize SDK")}}getDefaultPaths(){return this.initCheck(),zg.getDefaultPaths()}getApiPaths(){return this.initCheck(),zg.getApiPaths()}initCheck(){if(!this._initialized)throw new xg}}Jg.StaticPublicKeyCredential=window.PublicKeyCredential;const $g=new Y("webauthn"),Qg=new Jg;$g.events.on($g.events.MODULE_INITIALIZED,(()=>{var e;const r=$g.moduleMetadata.getInitConfig();if(!(null===(e=null==r?void 0:r.webauthn)||void 0===e?void 0:e.serverPath))return;const{clientId:n,webauthn:i}=r;Qg.init(n,t({},i))}));const em={modal:async(e,t)=>(Qg.initCheck(),Qg.authenticate.modal(e,t)),autofill:{activate:(e,t)=>{Qg.initCheck(),Qg.authenticate.autofill.activate(e,t)},abort:()=>{Qg.initCheck(),Qg.authenticate.autofill.abort()}}},tm={modal:async(e,t)=>(Qg.initCheck(),Qg.approve.modal(e,t))};async function rm(e,t){return Qg.initCheck(),Qg.register(e,t)}const{crossDevice:nm}=Qg,{isPlatformAuthenticatorSupported:im}=Qg,{isAutofillSupported:om}=Qg,{getDefaultPaths:am}=Qg;window.localWebAuthnSDK=Qg;var sm=Object.freeze({__proto__:null,get WebauthnCrossDeviceStatus(){return jg},approve:tm,authenticate:em,crossDevice:nm,getDefaultPaths:am,isAutofillSupported:om,isPlatformAuthenticatorSupported:im,register:rm});const um=new Y("ido");var cm,lm,dm,hm,fm;!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(cm||(cm={})),function(e){e.InvalidInitOptions="invalid_initialization_options",e.NotInitialized="not_initialized",e.NoActiveJourney="no_active_journey",e.NetworkError="network_error",e.ClientResponseNotValid="client_response_not_valid",e.ServerError="server_error",e.InvalidState="invalid_state",e.InvalidCredentials="invalid_credentials",e.ExpiredOTPPasscode="expired_otp_passcode",e.ExpiredValidationPasscode="expired_validation_passcode",e.MaxResendReached="expired_otp_passcode"}(lm||(lm={})),function(e){e.ClientInput="client_input",e.Cancel="cancel",e.Fail="failure",e.Custom="custom",e.Resend="resend"}(dm||(dm={})),function(e){e.JourneySuccess="journey_success",e.ClientInputRequired="client_input_required",e.ClientInputUpdateRequired="client_input_update_required",e.JourneyRejection="journey_rejection"}(hm||(hm={})),function(e){e.Rejection="action:rejection",e.Success="action:success",e.Information="action:information",e.DebugBreak="action:debug_break",e.WaitForAnotherDevice="action:wait_for_another_device",e.CryptoBindingRegistration="action:crypto_binding_registration",e.CryptoBindingValidation="action:crypto_binding_validation",e.RegisterDeviceAction="transmit_platform_device_registration",e.ValidateDeviceAction="transmit_platform_device_validation",e.WebAuthnRegistration="action:webauthn_registration",e.DrsTriggerAction="action:drs_trigger_action",e.IdentityVerification="action:id_verification",e.EmailOTPAuthentication="transmit_platform_email_otp_authentication",e.SmsOTPAuthentication="transmit_platform_sms_otp_authentication",e.GenericOTPAuthentication="transmit_platform_generic_otp_authentication",e.EmailValidation="transmit_platform_email_validation",e.SmsValidation="transmit_platform_sms_validation",e.TotpRegistration="transmit_platform_totp_registration",e.TransactionSigningTOTP="transmit_platform_transaction_signing_totp",e.InvokeIDP="invoke_idp",e.WebAuthnTransactionSigning="transmit_platform_transaction_signing_webauthn",e.SelectOrganization="transmit_platform_select_organization",e.MobileApproveAuthentication="transmit_platform_mobile_approve_authentication"}(fm||(fm={}));const pm=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cm.Info;this.logLevel=e}setLogLevel(e){e<cm.Debug||e>cm.Error?this.error("Invalid log level"):this.logLevel=e}debug(e){this.logLevel<=cm.Debug&&console.debug(`[DEBUG] ${e}`)}info(e){this.logLevel<=cm.Info&&console.info(`[INFO] ${e}`)}warning(e){this.logLevel<=cm.Warning&&console.warn(`[WARNING] ${e}`)}error(e){this.logLevel<=cm.Error&&console.error(`[ERROR] ${e}`)}},gm={[fm.CryptoBindingRegistration]:"input",[fm.CryptoBindingValidation]:"input",[fm.RegisterDeviceAction]:"data",[fm.ValidateDeviceAction]:"data"},mm="api/v2/",ym={path:"auth/sso"},vm={path:"auth/anonymous_invoke"},wm={path:"auth/assert"},bm={path:"auth/poll"},_m={path:"auth/create_debug_token"},Am={path:"auth/key_exchange"},Em={headers:{mandatory:!0,dummy:[{type:"correlation_id",correlation_id:"337BFFE6BEE7D694B8FA41F42B00742CA537DC398F79369A3A60E04D0EB2E8E1"}]},data:{mandatory:!0,dummy:{collection_result:{metadata:{timestamp:(new Date).getTime()},content:{}},policy_request_id:"LoginWithMenu"},large_dummy:{metadata:{timestamp:1679422144431},content:{device_details:{logged_users:1,persistence_mode:"persistent",device_id:"8951bd7b67a959e7b12b5018816f9ce4",os_type:"Mac OS",os_version:"10.15.7",device_model:"Chrome 111.0.0.0"},location:{enabled:!1},capabilities:{fido2_user_verifying_platform_authenticator_available:!0,audio_acquisition_supported:!0,finger_print_supported:!1,image_acquisition_supported:!1,persistent_keys_supported:!0,face_id_key_bio_protection_supported:!1,fido_client_present:!1,fido2_client_present:!0,dyadic_present:!1,installed_plugins:[]},collector_state:{accounts:"disabled",devicedetails:"active",contacts:"disabled",owner:"disabled",software:"disabled",location:"disabled",locationcountry:"disabled",bluetooth:"disabled",externalsdkdetails:"active",hwauthenticators:"active",capabilities:"active",fidoauthenticators:"disabled",largedata:"active",localenrollments:"active",devicefingerprint:"active",apppermissions:"disabled"},local_enrollments:{}},fp2:{user_agent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",webdriver:!0,language:"en-US",color_depth:30,device_memory:8,pixel_ratio:2,hardware_concurrency:12,screen_resolution:[1680,1050],available_screen_resolution:[1680,1025],timezone_offset:240,timezone:"America/New_York",session_storage:!0,local_storage:!0,indexed_db:!0,add_behavior:!1,open_database:!0,cpu_class:"not available",platform:"MacIntel",do_not_track:"not available",plugins:[["PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chrome PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chromium PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Microsoft Edge PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["WebKit built-in PDF","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]]],canvas:["canvas winding:yes","canvas fp:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB9AAAADICAYAAACwGnoBAAAAAXNSR0IArs4c6QAAIABJREFUeF7s3XeYXVW9//H3Omdaeu+FGgiE9BDAgmIBQRRQ4eIP0JCQmdC8YgHrZRQLAooSSjIpRMpVCZciiIAiKhoIpEMoUtILKaS3KWf/nu8+e0/2nDkzc+bMmckMfNbz8Ejm7L3W2q8zwT8++/tdjlY+PLz+wAhgKHA0MBjoB/QEDq9j+6uAzcAGYDXwFvA6sMzh1of3eHjtgWHA8ZH/7Qa0q+Mfu3VfHf9sA14Flof/63B7q/fn5fY5cAefo5V/hdqeBCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQggTYh4FrbLj2844BPAh8FTg4C81xucyewBygAeuRy4uhcrwF/6sx7Tw3lwMKT6LDtNDr7T2Sxf26GvRjwAvBP4G84Z0tmNLxivIwufJ9d5Mpodb/v7zNiPY4EJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAE2rRAqwgUPbyTgC8AnwMsQG+TYz7wEPAYUGeaPQr4MPCh4BWBQTl7VFvSln4I52wrdQ4F6Dkz10QSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkMD7SOCQBegenlV/XwpMCtqzt0nWrcDdwKygR3yjH+IU4LPBqwPWqD43w8J029IcnLMt1hgK0HODrFkkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIIH3l0D9AXppaR6lpZX+I0f/vQkGHt5w4EqgJJNprNf4GnYzgA7EcWxhPz0pyuTWjK7ZxgG6UehfW0mCchK0J6/Be18G7gCmN3ilPYER5jd4JacDnw/CdDvpPXXsPQDxOBQ2vL/IrdOAO3HOtuwPC9C3056uHDyiveHNte0rttCRXmW7c/PCSH1/F+r6LJt72ja5di8BCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCCBNidQO1CcNPNo4lU/Ak7AeTvwXAc8twbnHUdl3jhmT9qVzVN6eFZf/W3g4kzvf43tXMW/6EIBf2Ud/+YcRvAgD3E653F4ptOkve6fbOBbvEARcZ7lc3ydefyW//AHPsWZ1N1XfRlwM3Bfg6sngEWA5dZ2lHsjOtPb+wHWzN7C9C8DO3fD3Bdg4Ttw3blwZO8GV09zwb3ALUyZftyR3pbfn83L/IY/ZDNPm7vnGYbyKa6BWGI40y5/JesHmDTzMPIqLwGOwnPjgd9QVlLmzze5bAKxxEA8Z9+Y/ZpcR1nJarK5J+sN6kYJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSKApAjUD9MllZ+K8J/DcNLZ3/W/mXlBOaWmMDX2/h+duIBHry8zJ7zZmQQ+vF3B9UHXemFv5DE9QwvF+oD2L15nAMfyOt/3wvEcOqtBLeI632MEznM1G9tKP+3iCM9MG6JuAHwdV55k/hIXoM4PDzhsRoEcXOAGYAHxmG9w2tykBejjrHeNLrrvyZFa1ugB9PV1ZS1fGszJz4gyutGr7uYyluPD8IqZ+7UAGt6S/ZHLZTJx3P2Ulz/qBufPuJq+yH55rT2XeLGYUn+Z3aljfbwUwl7KSb5DNPVlvUDdKQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAJNETgYoF9+Zzeq4quAFfTfMJrSUkt/D47JZc/iuYnMnGzhYEbDw7sK+CnQOaMbUi7qzN0NVoRnM294z38zD6tyf5qz2EE5XZmTNkC/Hfi+FYJntZidkN7ICvR06/TfBX1+B788F07LqgK9eta8kmv4CBt4thVVoO8jnzP4b67mWc5nYVbSDd3kymhaC/eSaU+SiC1hRvF3KJ4+FHgN532RRGwjzvs35QXdmHPpdoqn3w+Mo6zkWLK5p6EH0ecSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkECzCBwMFIunX+6fle25S5lRPKfWapfNOI5YYj0wFRjmH/+diC3Eeb8hlojjuespK3ma4um39NhUOOL5x88teKRy5cfWsofx9OYuXuUIOvFTTuQJVnMfb/lnmc/k1Fpnmr/Bdn7CYu7jTT7NQAbRgV9wEovYwu94iy9zNKczkASeP6+1Y99DJcfSlR8yhnbEeYxVzOYNJnIsv+YVzmAgP2AMv+Zl/swaulHA62ynH+15MhKg38h4/sMO/sVGPs3R/IfR/IUYYDXo9u7APvDPDv8Y0A74D/AOcDzwFrANOBGqW8yHAfoQ8IPh7UBfwDrap+a5Nu/rwA7ACqUtKG8PWFZrnfN/B+3PhQsLoO+L0KcSThqS/OfNjfDnRfCpkbBtF7z4Fpx0DCx8GzZuh48Ng9NtTTt9/hpgC0f564xlLOuYzT104ABv+d/Vx/xK8G104G7mMMDfc3JUEqOEi1nCIE7jDW7hQd6hJ5O5hE/xOt/lz2yiE9/jPJYxgE/yOpfzDwbzHj/lLJ7jaH++ā¦brB0xZVAGAtqpyy+87fNf4HUyf1sNzSz83GXvYnYKXM6qTDBVhJ29tL7uzrJF+rcOC5Dy8Hq5efB1QGSkNdigBLnWXzB/zn10h7RWRj1hcaCpHOK7cB1fwKc4cvBQCWL6UDjnPuTG//1SRguT7Vqy8CqoAWMXRFBQBWRaE0X3bu9kH/avgtoVv6ndkDVJq9tRY7wErc8bOvknxFBt+/csByS787LgGqxK1PMj2AlaStg6TOvmLQv3JLv9f+FVAlbnnS6QGspO0VOXerbBaF/PoNfwNUiVttIj2AlbjNZ2+W9l2XgVXiNptJD2CZsZpEUUC/AgBLv4dkgAJmFABYZqwmURTQrwDA0u8hGaCAGQUAlhmrSRQF9CsAsPR7SAYoYEYBgGXGahJFAf0K/B9qEBa1B23aowAAAABJRU5ErkJggg==","extensions:ANGLE_instanced_arrays;EXT_blend_minmax;EXT_color_buffer_half_float;EXT_disjoint_timer_query;EXT_float_blend;EXT_frag_depth;EXT_shader_texture_lod;EXT_texture_compression_rgtc;EXT_texture_filter_anisotropic;EXT_sRGB;KHR_parallel_shader_compile;OES_element_index_uint;OES_fbo_render_mipmap;OES_standard_derivatives;OES_texture_float;OES_texture_float_linear;OES_texture_half_float;OES_texture_half_float_linear;OES_vertex_array_object;WEBGL_color_buffer_float;WEBGL_compressed_texture_s3tc;WEBGL_compressed_texture_s3tc_srgb;WEBGL_debug_renderer_info;WEBGL_debug_shaders;WEBGL_depth_texture;WEBGL_draw_buffers;WEBGL_lose_context;WEBGL_multi_draw","webgl aliased line width range:[1, 1]","webgl aliased point size range:[1, 8191]","webgl alpha bits:8","webgl antialiasing:yes","webgl blue bits:8","webgl depth bits:24","webgl green bits:8","webgl max anisotropy:16","webgl max combined texture image units:32","webgl max cube map texture size:16384","webgl max fragment uniform vectors:1024","webgl max render buffer size:16384","webgl max texture image units:16","webgl max texture size:16384","webgl max varying vectors:32","webgl max vertex attribs:16","webgl max vertex texture image units:16","webgl max vertex uniform vectors:1024","webgl max viewport dims:[16384, 16384]","webgl red bits:8","webgl renderer:WebKit WebGL","webgl shading language version:WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)","webgl stencil bits:0","webgl vendor:WebKit","webgl version:WebGL 1.0 (OpenGL ES 2.0 Chromium)","webgl unmasked vendor:Google Inc. (ATI Technologies Inc.)","webgl unmasked renderer:ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)","webgl vertex shader high float precision:23","webgl vertex shader high float precision rangeMin:127","webgl vertex shader high float precision rangeMax:127","webgl vertex shader medium float precision:23","webgl vertex shader medium float precision rangeMin:127","webgl vertex shader medium float precision rangeMax:127","webgl vertex shader low float precision:23","webgl vertex shader low float precision rangeMin:127","webgl vertex shader low float precision rangeMax:127","webgl fragment shader high float precision:23","webgl fragment shader high float precision rangeMin:127","webgl fragment shader high float precision rangeMax:127","webgl fragment shader medium float precision:23","webgl fragment shader medium float precision rangeMin:127","webgl fragment shader medium float precision rangeMax:127","webgl fragment shader low float precision:23","webgl fragment shader low float precision rangeMin:127","webgl fragment shader low float precision rangeMax:127","webgl vertex shader high int precision:0","webgl vertex shader high int precision rangeMin:31","webgl vertex shader high int precision rangeMax:30","webgl vertex shader medium int precision:0","webgl vertex shader medium int precision rangeMin:31","webgl vertex shader medium int precision rangeMax:30","webgl vertex shader low int precision:0","webgl vertex shader low int precision rangeMin:31","webgl vertex shader low int precision rangeMax:30","webgl fragment shader high int precision:0","webgl fragment shader high int precision rangeMin:31","webgl fragment shader high int precision rangeMax:30","webgl fragment shader medium int precision:0","webgl fragment shader medium int precision rangeMin:31","webgl fragment shader medium int precision rangeMax:30","webgl fragment shader low int precision:0","webgl fragment shader low int precision rangeMin:31","webgl fragment shader low int precision rangeMax:30"],webgl_vendor_and_renderer:"Google Inc. (ATI Technologies Inc.)~ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)",ad_block:!1,has_lied_languages:!1,has_lied_resolution:!1,has_lied_os:!1,has_lied_browser:!1,touch_support:[0,!1,!1],fonts:["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Comic Sans MS","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","LUCIDA GRANDE","Microsoft Sans Serif","Monaco","Palatino","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],fonts_flash:"swf object not loaded",audio:"124.04347657808103",enumerate_devices:["id=;gid=;audioinput;","id=;gid=;videoinput;","id=;gid=;audiooutput;"]}},policy_request_id:"LoginWithMenu",params:{}}},Cm=[{"control_flow.0":["assertion_id","type"]}];class xm extends Error{constructor(e,t){pm.error(`[ERROR] ${e}`),super(e),this.description=e,this.errorCode=t}static convertFromAssertionError(e){switch(e){case 28:return lm.ClientResponseNotValid;case 29:case 31:case 35:return lm.InvalidCredentials;case 30:return lm.ExpiredOTPPasscode;case 32:return lm.ExpiredValidationPasscode;case 33:return lm.MaxResendReached;default:return lm.ServerError}}}var Sm,Im,Tm;!function(e){e.JsonRejection="Json Rejection",e.TextRejection="Text Rejection",e.UpdateAction="Update Action",e.NextAction="Next Action",e.JourneyEnd="Journey End"}(Sm||(Sm={})),function(e){e.Pending="pending",e.Completed="completed",e.Rejected="rejected"}(Im||(Im={})),function(e){e.Form="form",e.LoginForm="login_form",e.Rejection="rejection",e.Information="information",e.DebugBreak="debug_break",e.WaitForTicket="wait_for_ticket",e.DrsTriggerAction="transmit_acp",e.IdentityVerification="kyc",e.WebAuthnRegistration="transmit_platform_web_authn_registration"}(Tm||(Tm={}));var Mm={},Dm="6.6.1",Rm={},Om={},km={get exports(){return Om},set exports(e){Om=e}},Nm=$(wa);!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Nm.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,l=r;l<s;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&a}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(f).toString(e);n=(p=p.idivn(f)).isZero()?g+n:c[h-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[o-s-1]=a}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,f=0|a[1],p=8191&f,g=f>>>13,m=0|a[2],y=8191&m,v=m>>>13,w=0|a[3],b=8191&w,_=w>>>13,A=0|a[4],E=8191&A,C=A>>>13,x=0|a[5],S=8191&x,I=x>>>13,T=0|a[6],M=8191&T,D=T>>>13,R=0|a[7],O=8191&R,k=R>>>13,N=0|a[8],P=8191&N,B=N>>>13,F=0|a[9],L=8191&F,z=F>>>13,U=0|s[0],j=8191&U,V=U>>>13,H=0|s[1],G=8191&H,q=H>>>13,W=0|s[2],K=8191&W,X=W>>>13,Y=0|s[3],Z=8191&Y,J=Y>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,fe=0|s[9],pe=8191&fe,ge=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(d,j))|0)+((8191&(i=(i=Math.imul(d,V))+Math.imul(h,j)|0))<<13)|0;c=((o=Math.imul(h,V))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,V))+Math.imul(g,j)|0,o=Math.imul(g,V);var ye=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,j),i=(i=Math.imul(y,V))+Math.imul(v,j)|0,o=Math.imul(v,V),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,q)|0;var ve=(c+(n=n+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(b,j),i=(i=Math.imul(b,V))+Math.imul(_,j)|0,o=Math.imul(_,V),n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,X)|0;var we=(c+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,j),i=(i=Math.imul(E,V))+Math.imul(C,j)|0,o=Math.imul(C,V),n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,J)|0;var be=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,j),i=(i=Math.imul(S,V))+Math.imul(I,j)|0,o=Math.imul(I,V),n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var _e=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(M,j),i=(i=Math.imul(M,V))+Math.imul(D,j)|0,o=Math.imul(D,V),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var Ae=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,j),i=(i=Math.imul(O,V))+Math.imul(k,j)|0,o=Math.imul(k,V),n=n+Math.imul(M,G)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Ee=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(P,j),i=(i=Math.imul(P,V))+Math.imul(B,j)|0,o=Math.imul(B,V),n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Ce=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,j),i=(i=Math.imul(L,V))+Math.imul(z,j)|0,o=Math.imul(z,V),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,q)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(g,de)|0,o=o+Math.imul(g,he)|0;var xe=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ge)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ge)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,G),i=(i=Math.imul(L,q))+Math.imul(z,G)|0,o=Math.imul(z,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,X)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,X))+Math.imul(z,K)|0,o=Math.imul(z,X),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(b,de)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ie=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,ge)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,Z),i=(i=Math.imul(L,J))+Math.imul(z,Z)|0,o=Math.imul(z,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,he)|0;var Te=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ge)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,he)|0;var Me=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ge)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(M,de)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var De=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(z,oe)|0,o=Math.imul(z,ae),n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var Re=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ge)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(z,ue)|0,o=Math.imul(z,ce),n=n+Math.imul(P,de)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ge)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,de),i=(i=Math.imul(L,he))+Math.imul(z,de)|0,o=Math.imul(z,he);var ke=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ge)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ne=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,ge))+Math.imul(z,pe)|0))<<13)|0;return c=((o=Math.imul(z,ge))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=we,u[4]=be,u[5]=_e,u[6]=Ae,u[7]=Ee,u[8]=Ce,u[9]=xe,u[10]=Se,u[11]=Ie,u[12]=Te,u[13]=Me,u[14]=De,u[15]=Re,u[16]=Oe,u[17]=ke,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,h=c,f=0;f<a;f++){var p=r[l+f],g=n[l+f],m=r[l+f+a],y=n[l+f+a],v=d*m-h*y;y=d*y+h*m,m=v,r[l+f]=p+m,n[l+f]=g+y,r[l+f+a]=p-m,n[l+f+a]=g-y,f!==s&&(v=u*d-c*h,h=u*h+c*d,d=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,l,d,n,i);for(var f=0;f<n;f++){var p=s[f]*l[f]-u[f]*d[f];u[f]=s[f]*d[f]+u[f]*l[f],s[f]=p}return this.conjugate(s,u,n),this.transform(s,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<n;this.words[t]=u|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=n;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)s=(o=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(o,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(v,y),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(w,y),n(b,y),n(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),f=this.pow(e,o),p=a;0!==f.cmp(s);){for(var g=f,m=0;0!==g.cmp(s);m++)g=g.redSqr();r(m<p);var y=this.pow(d,new i(1).iushln(p-m-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=m}return h},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new E(e)},n(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(km,Z);var Pm=Bm;function Bm(e,t){if(!e)throw new Error(t||"Assertion failed")}Bm.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Fm={};!function(e){var t=Fm;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(),function(e){var t=Rm,r=Om,n=Pm,i=Fm;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,a=e.clone();for(n=0;n<i.length;n++){var s,u=a.andln(o-1);a.isOdd()?(s=u>(o>>1)-1?(o>>1)-u:u,a.isubn(s)):s=0,i[n]=s,a.iushrn(1)}return i},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}();var Lm,zm={},Um={get exports(){return zm},set exports(e){zm=e}},jm=$(Object.freeze({__proto__:null,default:{}}));function Vm(e){this.rand=e}if(Um.exports=function(e){return Lm||(Lm=new Vm(null)),Lm.generate(e)},zm.Rand=Vm,Vm.prototype.generate=function(e){return this._rand(e)},Vm.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Vm.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?Vm.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(Vm.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Hm=jm;if("function"!=typeof Hm.randomBytes)throw new Error("Not supported");Vm.prototype._rand=function(e){return Hm.randomBytes(e)}}catch(e){}var Gm={},qm=Om,Wm=Rm,Km=Wm.getNAF,Xm=Wm.getJSF,Ym=Wm.assert;function Zm(e,t){this.type=e,this.p=new qm(t.p,16),this.red=t.prime?qm.red(t.prime):qm.mont(this.p),this.zero=new qm(0).toRed(this.red),this.one=new qm(1).toRed(this.red),this.two=new qm(2).toRed(this.red),this.n=t.n&&new qm(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Jm=Zm;function $m(e,t){this.curve=e,this.type=t,this.precomputed=null}Zm.prototype.point=function(){throw new Error("Not implemented")},Zm.prototype.validate=function(){throw new Error("Not implemented")},Zm.prototype._fixedNafMul=function(e,t){Ym(e.precomputed);var r=e._getDoubles(),n=Km(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var u=o+r.step-1;u>=o;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o<s.length;o++)(a=s[o])===d?l=l.mixedAdd(r.points[o]):a===-d&&(l=l.mixedAdd(r.points[o].neg()));c=c.add(l)}return c.toP()},Zm.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Km(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];Ym(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},Zm.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o<n;o++){var h=(s=t[o])._getNAFPoints(e);u[o]=h.wnd,c[o]=h.points}for(o=n-1;o>=1;o-=2){var f=o-1,p=o;if(1===u[f]&&1===u[p]){var g=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(g[1]=t[f].add(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].add(t[p].neg())):(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=Xm(r[f],r[p]);for(d=Math.max(y[0].length,d),l[f]=new Array(d),l[p]=new Array(d),a=0;a<d;a++){var v=0|y[0][a],w=0|y[1][a];l[f][a]=m[3*(v+1)+(w+1)],l[p][a]=0,c[f]=g}}else l[f]=Km(r[f],u[f],this._bitLength),l[p]=Km(r[p],u[p],this._bitLength),d=Math.max(l[f].length,d),d=Math.max(l[p].length,d)}var b=this.jpoint(null,null,null),_=this._wnafT4;for(o=d;o>=0;o--){for(var A=0;o>=0;){var E=!0;for(a=0;a<n;a++)_[a]=0|l[a][o],0!==_[a]&&(E=!1);if(!E)break;A++,o--}if(o>=0&&A++,b=b.dblp(A),o<0)break;for(a=0;a<n;a++){var C=_[a];0!==C&&(C>0?s=c[a][C-1>>1]:C<0&&(s=c[a][-C-1>>1].neg()),b="affine"===s.type?b.mixedAdd(s):b.add(s))}}for(o=0;o<n;o++)c[o]=null;return i?b:b.toP()},Zm.BasePoint=$m,$m.prototype.eq=function(){throw new Error("Not implemented")},$m.prototype.validate=function(){return this.curve.validate(this)},Zm.prototype.decodePoint=function(e,t){e=Wm.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Ym(e[e.length-1]%2==0):7===e[0]&&Ym(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},$m.prototype.encodeCompressed=function(e){return this.encode(e,!0)},$m.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},$m.prototype.encode=function(e,t){return Wm.encode(this._encode(t),e)},$m.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},$m.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},$m.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},$m.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},$m.prototype._getBeta=function(){return null},$m.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Qm={},ey={get exports(){return Qm},set exports(e){Qm=e}};"function"==typeof Object.create?ey.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ey.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var ty=Om,ry=Qm,ny=Jm,iy=Rm.assert;function oy(e){ny.call(this,"short",e),this.a=new ty(e.a,16).toRed(this.red),this.b=new ty(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ry(oy,ny);var ay=oy;function sy(e,t,r,n){ny.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new ty(t,16),this.y=new ty(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function uy(e,t,r,n){ny.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ty(0)):(this.x=new ty(t,16),this.y=new ty(r,16),this.z=new ty(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}oy.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new ty(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new ty(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],iy(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new ty(e.a,16),b:new ty(e.b,16)}})):this._getEndoBasis(r)}}},oy.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:ty.mont(e),r=new ty(2).toRed(t).redInvm(),n=r.redNeg(),i=new ty(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},oy.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),f=new ty(1),p=new ty(0),g=new ty(0),m=new ty(1),y=0;0!==d.cmpn(0);){var v=h.div(d);u=h.sub(v.mul(d)),c=g.sub(v.mul(f));var w=m.sub(v.mul(p));if(!n&&u.cmp(l)<0)t=s.neg(),r=f,n=u.neg(),i=c;else if(n&&2==++y)break;s=u,h=d,d=u,g=f,f=c,m=p,p=w}o=u.neg(),a=c;var b=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(b)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},oy.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},oy.prototype.pointFromX=function(e,t){(e=new ty(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},oy.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},oy.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},ry(sy,ny.BasePoint),oy.prototype.point=function(e,t,r){return new sy(this,e,t,r)},oy.prototype.pointFromJSON=function(e,t){return sy.fromJSON(this,e,t)},sy.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},sy.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},sy.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},sy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},sy.prototype.isInfinity=function(){return this.inf},sy.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},sy.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},sy.prototype.getX=function(){return this.x.fromRed()},sy.prototype.getY=function(){return this.y.fromRed()},sy.prototype.mul=function(e){return e=new ty(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},sy.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},sy.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},sy.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},sy.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},sy.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ry(uy,ny.BasePoint),oy.prototype.jpoint=function(e,t,r){return new uy(this,e,t,r)},uy.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},uy.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},uy.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,p)},uy.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(c)),f=this.z.redMul(a);return this.curve.jpoint(d,h,f)},uy.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),d=c.redSqr(),h=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(d),g=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),y=f.redMul(m);y=y.redIAdd(y).redISub(h);var v=c.redMul(s);t+1<e&&(u=u.redMul(h)),o=g,s=v,c=y}return this.curve.jpoint(o,c.redMul(i),s)},uy.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},uy.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(h);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},uy.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),g=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},uy.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,p)},uy.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,h,f)},uy.prototype.mul=function(e,t){return e=new ty(e,t),this.curve._wnafMul(this,e)},uy.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},uy.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},uy.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},uy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var cy=Om,ly=Qm,dy=Jm,hy=Rm;function fy(e){dy.call(this,"mont",e),this.a=new cy(e.a,16).toRed(this.red),this.b=new cy(e.b,16).toRed(this.red),this.i4=new cy(4).toRed(this.red).redInvm(),this.two=new cy(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}ly(fy,dy);var py=fy;function gy(e,t,r){dy.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new cy(t,16),this.z=new cy(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}fy.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},ly(gy,dy.BasePoint),fy.prototype.decodePoint=function(e,t){return this.point(hy.toArray(e,t),1)},fy.prototype.point=function(e,t){return new gy(this,e,t)},fy.prototype.pointFromJSON=function(e){return gy.fromJSON(this,e)},gy.prototype.precompute=function(){},gy.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},gy.fromJSON=function(e,t){return new gy(e,t[0],t[1]||e.one)},gy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},gy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},gy.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},gy.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},gy.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},gy.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},gy.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},gy.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},gy.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},gy.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},gy.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var my=Om,yy=Qm,vy=Jm,wy=Rm.assert;function by(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,vy.call(this,"edwards",e),this.a=new my(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new my(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new my(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),wy(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}yy(by,vy);var _y=by;function Ay(e,t,r,n,i){vy.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new my(t,16),this.y=new my(r,16),this.z=n?new my(n,16):this.curve.one,this.t=i&&new my(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}by.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},by.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},by.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},by.prototype.pointFromX=function(e,t){(e=new my(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},by.prototype.pointFromY=function(e,t){(e=new my(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},by.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},yy(Ay,vy.BasePoint),by.prototype.pointFromJSON=function(e){return Ay.fromJSON(this,e)},by.prototype.point=function(e,t,r,n){return new Ay(this,e,t,r,n)},Ay.fromJSON=function(e,t){return new Ay(e,t[0],t[1],t[2])},Ay.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Ay.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Ay.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),l=i.redMul(s),d=a.redMul(o);return this.curve.point(u,c,d,l)},Ay.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},Ay.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Ay.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),d=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,d)},Ay.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,r)},Ay.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Ay.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Ay.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},Ay.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},Ay.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Ay.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Ay.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Ay.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Ay.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},Ay.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},Ay.prototype.toP=Ay.prototype.normalize,Ay.prototype.mixedAdd=Ay.prototype.add,function(e){var t=e;t.base=Jm,t.short=ay,t.mont=py,t.edwards=_y}(Gm);var Ey={},Cy={},xy={},Sy=Pm,Iy=Qm;function Ty(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function My(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Dy(e){return 1===e.length?"0"+e:e}function Ry(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}xy.inherits=Iy,xy.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):Ty(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},xy.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=Dy(e[r].toString(16));return t},xy.htonl=My,xy.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=My(i)),r+=Ry(i.toString(16))}return r},xy.zero2=Dy,xy.zero8=Ry,xy.join32=function(e,t,r,n){var i=r-t;Sy(i%4==0);for(var o=new Array(i/4),a=0,s=t;a<o.length;a++,s+=4){var u;u="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o},xy.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},xy.rotr32=function(e,t){return e>>>t|e<<32-t},xy.rotl32=function(e,t){return e<<t|e>>>32-t},xy.sum32=function(e,t){return e+t>>>0},xy.sum32_3=function(e,t,r){return e+t+r>>>0},xy.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},xy.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},xy.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},xy.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},xy.sum64_lo=function(e,t,r,n){return t+n>>>0},xy.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},xy.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},xy.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+s>>>0)<s?1:0,e+r+i+a+u+(l+=(d=d+c>>>0)<c?1:0)>>>0},xy.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},xy.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},xy.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},xy.shr64_hi=function(e,t,r){return e>>>r},xy.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var Oy={},ky=xy,Ny=Pm;function Py(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Oy.BlockHash=Py,Py.prototype.update=function(e,t){if(e=ky.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=ky.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Py.prototype.digest=function(e){return this.update(this._pad()),Ny(null===this.pending),this._digest(e)},Py.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var By={},Fy={},Ly=xy.rotr32;function zy(e,t,r){return e&t^~e&r}function Uy(e,t,r){return e&t^e&r^t&r}function jy(e,t,r){return e^t^r}Fy.ft_1=function(e,t,r,n){return 0===e?zy(t,r,n):1===e||3===e?jy(t,r,n):2===e?Uy(t,r,n):void 0},Fy.ch32=zy,Fy.maj32=Uy,Fy.p32=jy,Fy.s0_256=function(e){return Ly(e,2)^Ly(e,13)^Ly(e,22)},Fy.s1_256=function(e){return Ly(e,6)^Ly(e,11)^Ly(e,25)},Fy.g0_256=function(e){return Ly(e,7)^Ly(e,18)^e>>>3},Fy.g1_256=function(e){return Ly(e,17)^Ly(e,19)^e>>>10};var Vy=xy,Hy=Oy,Gy=Fy,qy=Vy.rotl32,Wy=Vy.sum32,Ky=Vy.sum32_5,Xy=Gy.ft_1,Yy=Hy.BlockHash,Zy=[1518500249,1859775393,2400959708,3395469782];function Jy(){if(!(this instanceof Jy))return new Jy;Yy.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Vy.inherits(Jy,Yy);var $y=Jy;Jy.blockSize=512,Jy.outSize=160,Jy.hmacStrength=80,Jy.padLength=64,Jy.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=qy(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),l=Ky(qy(i,5),Xy(c,o,a,s),u,r[n],Zy[c]);u=s,s=a,a=qy(o,30),o=i,i=l}this.h[0]=Wy(this.h[0],i),this.h[1]=Wy(this.h[1],o),this.h[2]=Wy(this.h[2],a),this.h[3]=Wy(this.h[3],s),this.h[4]=Wy(this.h[4],u)},Jy.prototype._digest=function(e){return"hex"===e?Vy.toHex32(this.h,"big"):Vy.split32(this.h,"big")};var Qy=xy,ev=Oy,tv=Fy,rv=Pm,nv=Qy.sum32,iv=Qy.sum32_4,ov=Qy.sum32_5,av=tv.ch32,sv=tv.maj32,uv=tv.s0_256,cv=tv.s1_256,lv=tv.g0_256,dv=tv.g1_256,hv=ev.BlockHash,fv=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function pv(){if(!(this instanceof pv))return new pv;hv.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=fv,this.W=new Array(64)}Qy.inherits(pv,hv);var gv=pv;pv.blockSize=512,pv.outSize=256,pv.hmacStrength=192,pv.padLength=64,pv.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=iv(dv(r[n-2]),r[n-7],lv(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],d=this.h[7];for(rv(this.k.length===r.length),n=0;n<r.length;n++){var h=ov(d,cv(u),av(u,c,l),this.k[n],r[n]),f=nv(uv(i),sv(i,o,a));d=l,l=c,c=u,u=nv(s,h),s=a,a=o,o=i,i=nv(h,f)}this.h[0]=nv(this.h[0],i),this.h[1]=nv(this.h[1],o),this.h[2]=nv(this.h[2],a),this.h[3]=nv(this.h[3],s),this.h[4]=nv(this.h[4],u),this.h[5]=nv(this.h[5],c),this.h[6]=nv(this.h[6],l),this.h[7]=nv(this.h[7],d)},pv.prototype._digest=function(e){return"hex"===e?Qy.toHex32(this.h,"big"):Qy.split32(this.h,"big")};var mv=xy,yv=gv;function vv(){if(!(this instanceof vv))return new vv;yv.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}mv.inherits(vv,yv);var wv=vv;vv.blockSize=512,vv.outSize=224,vv.hmacStrength=192,vv.padLength=64,vv.prototype._digest=function(e){return"hex"===e?mv.toHex32(this.h.slice(0,7),"big"):mv.split32(this.h.slice(0,7),"big")};var bv=xy,_v=Oy,Av=Pm,Ev=bv.rotr64_hi,Cv=bv.rotr64_lo,xv=bv.shr64_hi,Sv=bv.shr64_lo,Iv=bv.sum64,Tv=bv.sum64_hi,Mv=bv.sum64_lo,Dv=bv.sum64_4_hi,Rv=bv.sum64_4_lo,Ov=bv.sum64_5_hi,kv=bv.sum64_5_lo,Nv=_v.BlockHash,Pv=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Bv(){if(!(this instanceof Bv))return new Bv;Nv.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Pv,this.W=new Array(160)}bv.inherits(Bv,Nv);var Fv=Bv;function Lv(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function zv(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function Uv(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function jv(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function Vv(e,t){var r=Ev(e,t,28)^Ev(t,e,2)^Ev(t,e,7);return r<0&&(r+=4294967296),r}function Hv(e,t){var r=Cv(e,t,28)^Cv(t,e,2)^Cv(t,e,7);return r<0&&(r+=4294967296),r}function Gv(e,t){var r=Ev(e,t,14)^Ev(e,t,18)^Ev(t,e,9);return r<0&&(r+=4294967296),r}function qv(e,t){var r=Cv(e,t,14)^Cv(e,t,18)^Cv(t,e,9);return r<0&&(r+=4294967296),r}function Wv(e,t){var r=Ev(e,t,1)^Ev(e,t,8)^xv(e,t,7);return r<0&&(r+=4294967296),r}function Kv(e,t){var r=Cv(e,t,1)^Cv(e,t,8)^Sv(e,t,7);return r<0&&(r+=4294967296),r}function Xv(e,t){var r=Ev(e,t,19)^Ev(t,e,29)^xv(e,t,6);return r<0&&(r+=4294967296),r}function Yv(e,t){var r=Cv(e,t,19)^Cv(t,e,29)^Sv(e,t,6);return r<0&&(r+=4294967296),r}Bv.blockSize=1024,Bv.outSize=512,Bv.hmacStrength=192,Bv.padLength=128,Bv.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=Xv(r[n-4],r[n-3]),o=Yv(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=Wv(r[n-30],r[n-29]),c=Kv(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=Dv(i,o,a,s,u,c,l,d),r[n+1]=Rv(i,o,a,s,u,c,l,d)}},Bv.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],d=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],y=this.h[14],v=this.h[15];Av(this.k.length===r.length);for(var w=0;w<r.length;w+=2){var b=y,_=v,A=Gv(d,h),E=qv(d,h),C=Lv(d,h,f,p,g),x=zv(d,h,f,p,g,m),S=this.k[w],I=this.k[w+1],T=r[w],M=r[w+1],D=Ov(b,_,A,E,C,x,S,I,T,M),R=kv(b,_,A,E,C,x,S,I,T,M);b=Vv(n,i),_=Hv(n,i),A=Uv(n,i,o,a,s),E=jv(n,i,o,a,s,u);var O=Tv(b,_,A,E),k=Mv(b,_,A,E);y=g,v=m,g=f,m=p,f=d,p=h,d=Tv(c,l,D,R),h=Mv(l,l,D,R),c=s,l=u,s=o,u=a,o=n,a=i,n=Tv(D,R,O,k),i=Mv(D,R,O,k)}Iv(this.h,0,n,i),Iv(this.h,2,o,a),Iv(this.h,4,s,u),Iv(this.h,6,c,l),Iv(this.h,8,d,h),Iv(this.h,10,f,p),Iv(this.h,12,g,m),Iv(this.h,14,y,v)},Bv.prototype._digest=function(e){return"hex"===e?bv.toHex32(this.h,"big"):bv.split32(this.h,"big")};var Zv=xy,Jv=Fv;function $v(){if(!(this instanceof $v))return new $v;Jv.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Zv.inherits($v,Jv);var Qv=$v;$v.blockSize=1024,$v.outSize=384,$v.hmacStrength=192,$v.padLength=128,$v.prototype._digest=function(e){return"hex"===e?Zv.toHex32(this.h.slice(0,12),"big"):Zv.split32(this.h.slice(0,12),"big")},By.sha1=$y,By.sha224=wv,By.sha256=gv,By.sha384=Qv,By.sha512=Fv;var ew={},tw=xy,rw=Oy,nw=tw.rotl32,iw=tw.sum32,ow=tw.sum32_3,aw=tw.sum32_4,sw=rw.BlockHash;function uw(){if(!(this instanceof uw))return new uw;sw.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function cw(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function lw(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function dw(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}tw.inherits(uw,sw),ew.ripemd160=uw,uw.blockSize=512,uw.outSize=160,uw.hmacStrength=192,uw.padLength=64,uw.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=r,u=n,c=i,l=o,d=a,h=0;h<80;h++){var f=iw(nw(aw(r,cw(h,n,i,o),e[hw[h]+t],lw(h)),pw[h]),a);r=a,a=o,o=nw(i,10),i=n,n=f,f=iw(nw(aw(s,cw(79-h,u,c,l),e[fw[h]+t],dw(h)),gw[h]),d),s=d,d=l,l=nw(c,10),c=u,u=f}f=ow(this.h[1],i,l),this.h[1]=ow(this.h[2],o,d),this.h[2]=ow(this.h[3],a,s),this.h[3]=ow(this.h[4],r,u),this.h[4]=ow(this.h[0],n,c),this.h[0]=f},uw.prototype._digest=function(e){return"hex"===e?tw.toHex32(this.h,"little"):tw.split32(this.h,"little")};var hw=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],fw=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],pw=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],gw=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],mw=xy,yw=Pm;function vw(e,t,r){if(!(this instanceof vw))return new vw(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(mw.toArray(t,r))}var ww,bw,_w=vw;vw.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),yw(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},vw.prototype.update=function(e,t){return this.inner.update(e,t),this},vw.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=Cy;t.utils=xy,t.common=Oy,t.sha=By,t.ripemd=ew,t.hmac=_w,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(),function(e){var t,r=Ey,n=Cy,i=Gm,o=Rm.assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new a(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=a,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=bw?ww:(bw=1,ww={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}();var Aw=Cy,Ew=Fm,Cw=Pm;function xw(e){if(!(this instanceof xw))return new xw(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ew.toArray(e.entropy,e.entropyEnc||"hex"),r=Ew.toArray(e.nonce,e.nonceEnc||"hex"),n=Ew.toArray(e.pers,e.persEnc||"hex");Cw(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Sw=xw;xw.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},xw.prototype._hmac=function(){return new Aw.hmac(this.hash,this.K)},xw.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},xw.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Ew.toArray(e,t),r=Ew.toArray(r,n),Cw(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},xw.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Ew.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,Ew.encode(o,t)};var Iw=Om,Tw=Rm.assert;function Mw(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Dw=Mw;Mw.fromPublic=function(e,t,r){return t instanceof Mw?t:new Mw(e,{pub:t,pubEnc:r})},Mw.fromPrivate=function(e,t,r){return t instanceof Mw?t:new Mw(e,{priv:t,privEnc:r})},Mw.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Mw.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Mw.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Mw.prototype._importPrivate=function(e,t){this.priv=new Iw(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Mw.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Tw(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Tw(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Mw.prototype.derive=function(e){return e.validate()||Tw(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Mw.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Mw.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},Mw.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Rw=Om,Ow=Rm,kw=Ow.assert;function Nw(e,t){if(e instanceof Nw)return e;this._importDER(e,t)||(kw(e.r&&e.s,"Signature without r or s"),this.r=new Rw(e.r,16),this.s=new Rw(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Pw=Nw;function Bw(){this.place=0}function Fw(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function Lw(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function zw(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Nw.prototype._importDER=function(e,t){e=Ow.toArray(e,t);var r=new Bw;if(48!==e[r.place++])return!1;var n=Fw(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=Fw(e,r);if(!1===i)return!1;if(0!=(128&e[r.place]))return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=Fw(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;if(0!=(128&e[r.place]))return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new Rw(o),this.s=new Rw(s),this.recoveryParam=null,!0},Nw.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Lw(t),r=Lw(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];zw(n,t.length),(n=n.concat(t)).push(2),zw(n,r.length);var i=n.concat(r),o=[48];return zw(o,i.length),o=o.concat(i),Ow.encode(o,e)};var Uw=Om,jw=Sw,Vw=Ey,Hw=zm,Gw=Rm.assert,qw=Dw,Ww=Pw;function Kw(e){if(!(this instanceof Kw))return new Kw(e);"string"==typeof e&&(Gw(Object.prototype.hasOwnProperty.call(Vw,e),"Unknown curve "+e),e=Vw[e]),e instanceof Vw.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Xw=Kw;Kw.prototype.keyPair=function(e){return new qw(this,e)},Kw.prototype.keyFromPrivate=function(e,t){return qw.fromPrivate(this,e,t)},Kw.prototype.keyFromPublic=function(e,t){return qw.fromPublic(this,e,t)},Kw.prototype.genKeyPair=function(e){e||(e={});for(var t=new jw({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Hw(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Uw(2));;){var i=new Uw(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Kw.prototype._truncateToN=function(e,t,r){var n;if(Uw.isBN(e)||"number"==typeof e)n=(e=new Uw(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new Uw(e,16);else{var i=e.toString();n=i.length+1>>>1,e=new Uw(i,16)}"number"!=typeof r&&(r=8*n);var o=r-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Kw.prototype.sign=function(e,t,r,n){if("object"==typeof r&&(n=r,r=null),n||(n={}),"string"!=typeof e&&"number"!=typeof e&&!Uw.isBN(e)){Gw("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),Gw(e.length>>>0===e.length);for(var i=0;i<e.length;i++)Gw((255&e[i])===e[i])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,n.msgBitLength),Gw(!e.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),s=e.toArray("be",o);Gw(new Uw(s).eq(e),"Can not sign message");for(var u=new jw({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Uw(1)),l=0;;l++){var d=n.k?n.k(l):new Uw(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var f=h.getX(),p=f.umod(this.n);if(0!==p.cmpn(0)){var g=d.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==f.cmp(p)?2:0);return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new Ww({r:p,s:g,recoveryParam:m})}}}}}},Kw.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new Ww(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},Kw.prototype.recoverPubKey=function(e,t,r,n){Gw((3&r)===r,"The recovery param is more than two bits"),t=new Ww(t,n);var i=this.n,o=new Uw(e),a=t.r,s=t.s,u=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),d=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(d,a,h)},Kw.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Ww(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Yw=Rm,Zw=Yw.assert,Jw=Yw.parseBytes,$w=Yw.cachedProperty;function Qw(e,t){this.eddsa=e,this._secret=Jw(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Jw(t.pub)}Qw.fromPublic=function(e,t){return t instanceof Qw?t:new Qw(e,{pub:t})},Qw.fromSecret=function(e,t){return t instanceof Qw?t:new Qw(e,{secret:t})},Qw.prototype.secret=function(){return this._secret},$w(Qw,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),$w(Qw,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),$w(Qw,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),$w(Qw,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),$w(Qw,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),$w(Qw,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Qw.prototype.sign=function(e){return Zw(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Qw.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Qw.prototype.getSecret=function(e){return Zw(this._secret,"KeyPair is public only"),Yw.encode(this.secret(),e)},Qw.prototype.getPublic=function(e){return Yw.encode(this.pubBytes(),e)};var eb=Qw,tb=Om,rb=Rm,nb=rb.assert,ib=rb.cachedProperty,ob=rb.parseBytes;function ab(e,t){this.eddsa=e,"object"!=typeof t&&(t=ob(t)),Array.isArray(t)&&(nb(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),nb(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof tb&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}ib(ab,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),ib(ab,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),ib(ab,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),ib(ab,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),ab.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},ab.prototype.toHex=function(){return rb.encode(this.toBytes(),"hex").toUpperCase()};var sb=ab,ub=Cy,cb=Ey,lb=Rm,db=lb.assert,hb=lb.parseBytes,fb=eb,pb=sb;function gb(e){if(db("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof gb))return new gb(e);e=cb[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=ub.sha512}var mb=gb;gb.prototype.sign=function(e,t){e=hb(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},gb.prototype.verify=function(e,t,r){if(e=hb(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},gb.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return lb.intFromLE(e.digest()).umod(this.curve.n)},gb.prototype.keyFromPublic=function(e){return fb.fromPublic(this,e)},gb.prototype.keyFromSecret=function(e){return fb.fromSecret(this,e)},gb.prototype.makeSignature=function(e){return e instanceof pb?e:new pb(this,e)},gb.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},gb.prototype.decodePoint=function(e){var t=(e=lb.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=lb.intFromLE(r);return this.curve.pointFromY(i,n)},gb.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},gb.prototype.decodeInt=function(e){return lb.intFromLE(e)},gb.prototype.isPoint=function(e){return e instanceof this.pointClass},function(e){var t=e;t.version=Dm,t.utils=Rm,t.rand=zm,t.curve=Gm,t.curves=Ey,t.ec=Xw,t.eddsa=mb}(Mm);var yb,vb,wb,bb={},_b={get exports(){return bb},set exports(e){bb=e}};
|
|
2
2
|
/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
|
|
3
|
-
op=up,function(e){function t(e){return parseInt(e)===e}function i(e){if(!t(e.length))return!1;for(var i=0;i<e.length;i++)if(!t(e[i])||e[i]<0||e[i]>255)return!1;return!0}function r(e,r){if(e.buffer&&"Uint8Array"===e.name)return r&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!i(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(t(e.length)&&i(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function n(e){return new Uint8Array(e)}function a(e,t,i,r,n){null==r&&null==n||(e=e.slice?e.slice(r,n):Array.prototype.slice.call(e,r,n)),t.set(e,i)}var o,s={toBytes:function(e){var t=[],i=0;for(e=encodeURI(e);i<e.length;){var n=e.charCodeAt(i++);37===n?(t.push(parseInt(e.substr(i,2),16)),i+=2):t.push(n)}return r(t)},fromBytes:function(e){for(var t=[],i=0;i<e.length;){var r=e[i];r<128?(t.push(String.fromCharCode(r)),i++):r>191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[i+1])),i+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[i+1])<<6|63&e[i+2])),i+=3)}return t.join("")}},c=(o="0123456789abcdef",{toBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},fromBytes:function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];t.push(o[(240&r)>>4]+o[15&r])}return t.join("")}}),d={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],l=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],f=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],y=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],A=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],E=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(e){for(var t=[],i=0;i<e.length;i+=4)t.push(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]);return t}var k=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:r(t,!0)}),this._prepare()};k.prototype._prepare=function(){var e=d[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var i,r=4*(e+1),n=this.key.length/4,a=S(this.key);for(t=0;t<n;t++)i=t>>2,this._Ke[i][t%4]=a[t],this._Kd[e-i][t%4]=a[t];for(var o,s=0,c=n;c<r;){if(o=a[n-1],a[0]^=l[o>>16&255]<<24^l[o>>8&255]<<16^l[255&o]<<8^l[o>>24&255]^u[s]<<24,s+=1,8!=n)for(t=1;t<n;t++)a[t]^=a[t-1];else{for(t=1;t<n/2;t++)a[t]^=a[t-1];for(o=a[n/2-1],a[n/2]^=l[255&o]^l[o>>8&255]<<8^l[o>>16&255]<<16^l[o>>24&255]<<24,t=n/2+1;t<n;t++)a[t]^=a[t-1]}for(t=0;t<n&&c<r;)h=c>>2,f=c%4,this._Ke[h][f]=a[t],this._Kd[e-h][f]=a[t++],c++}for(var h=1;h<e;h++)for(var f=0;f<4;f++)o=this._Kd[h][f],this._Kd[h][f]=w[o>>24&255]^x[o>>16&255]^A[o>>8&255]^E[255&o]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,i=[0,0,0,0],r=S(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var o=1;o<t;o++){for(a=0;a<4;a++)i[a]=f[r[a]>>24&255]^p[r[(a+1)%4]>>16&255]^g[r[(a+2)%4]>>8&255]^m[255&r[(a+3)%4]]^this._Ke[o][a];r=i.slice()}var s,c=n(16);for(a=0;a<4;a++)s=this._Ke[t][a],c[4*a]=255&(l[r[a]>>24&255]^s>>24),c[4*a+1]=255&(l[r[(a+1)%4]>>16&255]^s>>16),c[4*a+2]=255&(l[r[(a+2)%4]>>8&255]^s>>8),c[4*a+3]=255&(l[255&r[(a+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,i=[0,0,0,0],r=S(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var o=1;o<t;o++){for(a=0;a<4;a++)i[a]=b[r[a]>>24&255]^v[r[(a+3)%4]>>16&255]^y[r[(a+2)%4]>>8&255]^_[255&r[(a+1)%4]]^this._Kd[o][a];r=i.slice()}var s,c=n(16);for(a=0;a<4;a++)s=this._Kd[t][a],c[4*a]=255&(h[r[a]>>24&255]^s>>24),c[4*a+1]=255&(h[r[(a+3)%4]>>16&255]^s>>16),c[4*a+2]=255&(h[r[(a+2)%4]>>8&255]^s>>8),c[4*a+3]=255&(h[255&r[(a+1)%4]]^s);return c};var M=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(t)};M.prototype.encrypt=function(e){if((e=r(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=n(e.length),i=n(16),o=0;o<e.length;o+=16)a(e,i,0,o,o+16),a(i=this._aes.encrypt(i),t,o);return t},M.prototype.decrypt=function(e){if((e=r(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=n(e.length),i=n(16),o=0;o<e.length;o+=16)a(e,i,0,o,o+16),a(i=this._aes.decrypt(i),t,o);return t};var C=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else i=n(16);this._lastCipherblock=r(i,!0),this._aes=new k(t)};C.prototype.encrypt=function(e){if((e=r(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=n(e.length),i=n(16),o=0;o<e.length;o+=16){a(e,i,0,o,o+16);for(var s=0;s<16;s++)i[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(i),a(this._lastCipherblock,t,o)}return t},C.prototype.decrypt=function(e){if((e=r(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=n(e.length),i=n(16),o=0;o<e.length;o+=16){a(e,i,0,o,o+16),i=this._aes.decrypt(i);for(var s=0;s<16;s++)t[o+s]=i[s]^this._lastCipherblock[s];a(e,this._lastCipherblock,0,o,o+16)}return t};var I=function e(t,i,a){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 size)")}else i=n(16);a||(a=1),this.segmentSize=a,this._shiftRegister=r(i,!0),this._aes=new k(t)};I.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,i=r(e,!0),n=0;n<i.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)i[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(i,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return i},I.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,i=r(e,!0),n=0;n<i.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)i[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return i};var D=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else i=n(16);this._lastPrecipher=r(i,!0),this._lastPrecipherIndex=16,this._aes=new k(t)};D.prototype.encrypt=function(e){for(var t=r(e,!0),i=0;i<t.length;i++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},D.prototype.decrypt=D.prototype.encrypt;var T=function e(t){if(!(this instanceof e))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=n(16),this.setValue(t)):this.setBytes(t)};T.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},T.prototype.setBytes=function(e){if(16!=(e=r(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",i instanceof T||(i=new T(i)),this._counter=i,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(t)};R.prototype.encrypt=function(e){for(var t=r(e,!0),i=0;i<t.length;i++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[i]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var B={AES:k,Counter:T,ModeOfOperation:{ecb:M,cbc:C,cfb:I,ofb:D,ctr:R},utils:{hex:c,utf8:s},padding:{pkcs7:{pad:function(e){var t=16-(e=r(e,!0)).length%16,i=n(e.length+t);a(e,i);for(var o=e.length;o<i.length;o++)i[o]=t;return i},strip:function(e){if((e=r(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var i=e.length-t,o=0;o<t;o++)if(e[i+o]!==t)throw new Error("PKCS#7 invalid padding byte");var s=n(i);return a(e,s,0,0,i),s}}},_arrayTest:{coerceArray:r,createArray:n,copyArray:a}};op.exports=B}();class lp{getExchangeRequestHeader(){if(!this.kp){const e={entropy:this.generateRandomHexString(192),entropyEnc:"hex"};this.kp=this.ec.genKeyPair(e)}return{type:"key_exchange",scheme:3,y:this.jsArrayToBase64(this.kp.getPublic().encode("array",!1))}}async processExchangeResponseHeader(e){if(e.scheme!=this.scheme)throw"Unsupported crypto scheme "+e.scheme;this.sessionId=e.crypto_session_id;const t=this.kp.derive(this.ec.keyFromPublic(atob(e.y)).getPublic()).toArray("be",32),i=new Uint8Array(t),r=await crypto.subtle.digest("SHA-256",i);this.aesKey=Array.from(new Uint8Array(r))}isReady(){return!(!this.aesKey||!this.sessionId)}decryptResponse(e){let t=null;if(e.headers.forEach((function(e){"encryption"==e.type&&(t=e)})),t){const i=this.base64ToJsArray(t.iv),r=new dp.ModeOfOperation.cbc(this.aesKey,i),n=this.base64ToJsArray(e.data),a=r.decrypt(n);let o=dp.utils.utf8.fromBytes(a);o=this.pkcs7Unpad(o),e.data=JSON.parse(o)}return e}encryptRequest(e){const t=this.generateRandomHexString(32),i=dp.utils.hex.toBytes(t),r={type:"encryption",iv:this.hexToBase64(t),crypto_session_id:this.sessionId},n=e.headers.map((e=>this.encryptStringToBase64(JSON.stringify(e),i))),a=JSON.stringify(e.data),o=this.encryptStringToBase64(a,i);e.headers=[r],e.enc_headers=n,e.data=o}encryptStringToBase64(e,t){const i=new dp.ModeOfOperation.cbc(this.aesKey,t),r=dp.utils.utf8.toBytes(e),n=this.pkcs7Pad(r),a=[...i.encrypt(n)];return this.jsArrayToBase64(a)}toJson(){return{scheme:3,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)}}static fromJson(e){return new lp(e)}jsArrayToBase64(e){let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return btoa(t)}base64ToJsArray(e){const t=atob(e),i=[];for(let e=0;e<t.length;e++)i.push(t.charCodeAt(e));return i}pkcs7Pad(e){const t=16-e.length%16,i=new Uint8Array(e.length+t);i.set(e,0);for(let r=0;r<t;r++)i[e.length+r]=t;return i}pkcs7Unpad(e){try{const t=e.charCodeAt(e.length-1);if(t<1||t>16)throw new mp(`Invalid padding length: ${t}`);if(e.length<t)throw new mp("Input string shorter than padding length");for(let i=1;i<=t;i++){if(e.charCodeAt(e.length-i)!==t)throw new mp("Invalid padding values")}return e.slice(0,-t)}catch(e){if(e instanceof mp)throw e;throw new mp(`Failed to unpad data: ${e instanceof Error?e.message:String(e)}`)}}constructor(e){if(this.scheme=3,this.ecCurveName="p256",this.ec=new bu.ec(this.ecCurveName),e&&(this.sessionId=e.session_id,this.aesKey=this.base64ToJsArray(e.key),!this.isReady()))throw new Error("Internal: Can't deserialize crypto session")}generateRandomHexString(e){const t=new Uint8Array(e);crypto.getRandomValues(t);let i="";const r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];for(let e=0;e<t.length;e++){i+=r[15&t[e]]}return i}hexToBase64(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let i=0,r=0,n="";for(let a=0;a<e.length;a++)if(i=(i<<4)+parseInt(e[a],16),r+=4,r>=6){n+=t[i>>r-6],r-=6,i&=255>>8-r}if(r){n+=t[i<<6-r]}for(;n.length%4;)n+="=";return n}}class hp{constructor(e,t){this.encrypted=e,this.cryptoSession=t}isReady(){var e;return(null===(e=this.cryptoSession)||void 0===e?void 0:e.isReady())||!1}async exchangeKeyAndEncryptRequest(e,t,i,r,n,a){if(!t.isReady()){const i=["aid","clientId"],n=new URLSearchParams(Array.from(r.searchParams.entries()).filter((e=>{let[t,r]=e;return i.includes(t)})));await t.performKeyExchange(e,n)}return t.promisePossiblyEncryptedTransportRequest(new gp(i,r,n.data,n.headers,a))}async performKeyExchange(e,i){const r={r:"Hello Encrypted World"},n=new URL(e+uu.path+"?"+i.toString()),a=new gp("POST",n,r,[],{"Content-Type":"application/json"}),o=this.promisePossiblyEncryptedTransportRequest(a);let s;const c=await fetch(o.url.toString(),{body:JSON.stringify(null==o?void 0:o.body),method:"POST",headers:o.headers,credentials:"include"});if(!c.ok)throw new Error("Request failed");let d;s=t(t({data:await c.json()},c),{},{headers:c.headers});try{d=s.data}catch(e){throw new Error(`Unsupported resposne format: ${e}`)}await this.postprocessResponse(d),d=this.possiblyDecryptResponse(d);const u=d.data;if(JSON.stringify(u)!==JSON.stringify(r))throw new Error("Key exchange failed");return Promise.resolve()}async postprocessResponse(e){var t;if(e.headers){const i=e.headers.find((e=>"key_exchange"==e.type));if(i)return null===(t=this.cryptoSession)||void 0===t?void 0:t.processExchangeResponseHeader(i)}}promisePossiblyEncryptedTransportRequest(e){const t={headers:e.envelopeHeaders,data:e.body};return this.encryptEnvelopedMessageIfNeeded(t),new fp(e.url.toString(),e.method,t,void 0,e.httpHeaders)}possiblyDecryptResponse(e){return this.cryptoSession&&(e=this.cryptoSession.decryptResponse(e)),e}encryptEnvelopedMessageIfNeeded(e){var t;const i=this.generateKeyExchangeHeaderIfNeeded();(null===(t=this.cryptoSession)||void 0===t?void 0:t.isReady())&&this.cryptoSession.encryptRequest(e),i&&e.headers.push(i)}generateKeyExchangeHeaderIfNeeded(){return this.encrypted&&!this.cryptoSession?(this.cryptoSession=new lp,this.cryptoSession.getExchangeRequestHeader()):null}}class fp{constructor(e,t,i,r,n){this.url=e,this.httpMethod=t,this.body=i,this.params=r,this.headers=n}}class pp{addEnvelopeHeader(e){this._envelopeHeaders.push(e)}get method(){return this._requestMethod}get url(){return this._url}get body(){return this._requestBody}get envelopeHeaders(){return this._envelopeHeaders}get httpHeaders(){return this._httpHeaders}constructor(e,t,i,r,n){if(!t||!i)throw new Error("Internal - Invalid arguments for constructing session message");this._requestMethod=e,this._url=t,this._requestBody=i,this._envelopeHeaders=r||[],this._httpHeaders=n}}class gp extends pp{static from(e,t,i,r){return new gp(e,t,i.data,i.headers,r)}}class mp extends Error{constructor(e){super(e),this.name="PaddingError",Object.setPrototypeOf(this,mp.prototype)}}class bp{constructor(e){this.urlBaseString=e+"/"+nu}convertHttpResponseToRawServiceResponse(e){const{status:t,statusText:i,body:r}=e;return this.rawFrom(t,i,r)}rawFrom(e,t,i){const{error_code:r,error_message:n,headers:a,data:o}=i;return{status:e,statusText:t,error_code:r,error_message:n,headers:a,data:this.buildAggregatedData(o)}}buildAggregatedData(e){switch(null==e?void 0:e.state){case gu.Pending:hu.forEach((i=>{const[[r,n]]=Object.entries(i),a=((e,t,i)=>{if(!e||"object"!=typeof e)return i;const r=Array.isArray(t)?t:t.split(".");let n=e;for(let e=0;e<r.length;e++)if(n=n[r[e]],void 0===n)return i;return n})(e,r);if(a){const i={};n.forEach((e=>{e in a&&(i[e]=a[e])})),e=t(t({},e),i)}}));break;case gu.Rejected:e.type=mu.Rejection}return e}async sendRequest(e,i,r,n){if(!(this.urlBaseString.toString().length>nu.length&&e))throw new Error("bad input");const a=new URL(this.urlBaseString);a.pathname+=e,iu.debug(`Got Full URL: ${a.toString()}`),Object.keys(i).map((e=>a.searchParams.append(e,i[e]))),iu.debug(`Request body: ${r}`);let o=new fp(a.toString(),"POST",r,a.searchParams,{"Content-type":"application/json;charset=UTF-8"});try{n.encrypted&&(o=await n.exchangeKeyAndEncryptRequest(this.urlBaseString,n,o.httpMethod,new URL(o.url),o.body,o.headers));const e=await fetch(o.url.toString(),{body:JSON.stringify(o.body),method:"POST",headers:o.headers,credentials:"include"});let i;const r=await e.json();if(n.encrypted){const e=r;n.postprocessResponse(e),i=n.possiblyDecryptResponse(e)}else i=r;return this.convertHttpResponseToRawServiceResponse(t(t({},e),{},{body:i}))}catch(e){throw new fu("Error occurred while retrieving response from server",Qd.NetworkError)}}}!function(e){e.Active="Active",e.Success="Journey Ended with Success",e.Rejected="Journey Ended with Rejection",e.Aborted="Journey aborted by client"}(sp||(sp={})),function(e){e.ClientSdk="Client SDK Journey",e.SSO="SSO Journey"}(cp||(cp={}));class vp extends hp{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;super(r,n),this.journeyType=e,this.sdkData=t,this.additionalParams=i,this.encrypted=r,this.cryptoSession=n,this.state=sp.Active}getQueryParams(){let e={};return this.deviceId&&(e.did=this.deviceId),this.sessionId&&(e.sid=this.sessionId),e}getInternalHeaders(){const e=[];return this.userId&&e.push({type:"uid",uid:this.userId}),e}toJson(){var e;return{journeyType:this.journeyType,challenge:this.challenge,assertionId:this.assertionId,userId:this.userId,sessionId:this.sessionId,deviceId:this.deviceId,actionType:this.actionType,additionalParams:this.additionalParams,sdkData:this.sdkData,encrypted:this.encrypted,cryptoSession:null===(e=this.cryptoSession)||void 0===e?void 0:e.toJson()}}getInvocationData(){const e=lu.data.dummy;return this.additionalParams&&Object.keys(this.additionalParams).length>0&&(e.params=this.additionalParams),this.sdkData&&Object.keys(this.sdkData).length>0&&(e.sdk_data=this.sdkData),e}complete(){if(this.isCompletedState())throw Error(`Cannot complete an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=sp.Success,this.cryptoSession=void 0}reject(){if(this.isCompletedState())throw Error(`Cannot reject an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=sp.Rejected,this.cryptoSession=void 0}abort(){if(this.isCompletedState())throw Error(`Cannot abort an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=sp.Aborted,this.cryptoSession=void 0}active(){if(this.isCompletedState())throw Error(`Cannot run a completed journey. Current state: ${this.state.toString()}`);this.state=sp.Active}isCompletedState(){return this.state===sp.Success||this.state===sp.Rejected||this.state===sp.Aborted}}class yp extends vp{constructor(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;if(super(cp.ClientSdk,t,i,r,n),this.journeyId=e,!this.journeyId)throw Error("Journey ID must be provided")}getInvocationData(){const e=super.getInvocationData();return e.policy_request_id=this.journeyId,e}getInvocationPath(){return ou.path}toJson(){return t(t({},super.toJson()),{},{journeyId:this.journeyId})}}class _p extends vp{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;super(cp.SSO,t,{},i,r),this.interactionId=e}getInvocationPath(){return au.path}getQueryParams(){return t(t({},super.getQueryParams()),{},{ssoInteractionId:this.interactionId})}toJson(){return t(t({},super.toJson()),{},{interactionId:this.interactionId})}}const wp=["assertion_id","type","escapes","form_id","vendor_name"],xp=[...wp,"challenge","assertion_error_code","assertion_error_message","assertions_complete","state","control_flow","rejection_data"],Ap={[Xd.Cancel]:Xd.Cancel,[Xd.Fail]:Xd.Fail},Ep=["data"],Sp=["json_data"];class kp{constructor(e){var t,i,r;this.rawResponse=e;const[{escapes:n,form_id:a}]=null!==(i=null===(t=e.data)||void 0===t?void 0:t.control_flow)&&void 0!==i?i:[{}];this.escapes=n,this.data=null!==(r=e.data)&&void 0!==r?r:{},this.formId=a}generateServiceResponse(e,i){var r,n;const a=this.getType(),o=this.getJourneyStepId(e);return t(t({type:a,journeyStepId:o,errorData:this.getErrorData(),data:this.getData(o),clientResponseOptions:this.getClientResponseActions()},i),{},{redirectUrl:null===(n=null===(r=this.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.url})}getActionType(){return this.data.type}getChallenge(){return this.data.challenge}getAssertionId(){return this.data.assertion_id}getJourneyState(){var e,t,i;let r;if((null===(e=this.rawResponse)||void 0===e?void 0:e.status)>=400)r=pu.TextRejection;else switch(this.data.state){case gu.Completed:r=pu.JourneyEnd;break;case gu.Rejected:r=pu.JsonRejection;break;case gu.Pending:r=(null===(i=null===(t=this.rawResponse)||void 0===t?void 0:t.data)||void 0===i?void 0:i.control_flow)?pu.NextAction:pu.UpdateAction;break;default:r=pu.JsonRejection}return r}getType(){let e=eu.JourneyRejection;return this.data.assertions_complete?e=eu.JourneySuccess:this.data.state===gu.Pending?e=eu.ClientInputRequired:16==this.data.assertion_error_code?e=eu.ClientInputUpdateRequired:4001===this.rawResponse.error_code&&(e=eu.JourneyRejection),e}getData(e){var i,r;const[a]=null!==(i=this.data.control_flow)&&void 0!==i?i:[{}],o=null!==(r=this.data)&&void 0!==r?r:{},{data:s}=o,c=n(o,Ep),d=null!=s?s:{},{json_data:u}=d,l=n(d,Sp);return this.removeFields(a,wp),this.data=t(t(t(t(t({},c),a),u&&{json_data:u}),Object.keys(l).length&&{data:l}),this.rejectionReason&&{rejectionReason:this.rejectionReason}),this.removeFields(this.data,xp),this.manipulateDataForJourneyStep(e),this.data}manipulateDataForJourneyStep(e){e===tu.InvokeIDP&&(this.data.authorization_url=this.generateAuthorizationUrlFromResponseData(this.data),delete this.data.authorization_parameters,delete this.data.authorization_endpoint)}generateAuthorizationUrlFromResponseData(e){const{authorization_endpoint:t,authorization_parameters:i}=e,r=Object.keys(i).map((e=>{const t=i[e]instanceof Object?JSON.stringify(i[e]):i[e];return`${e}=${encodeURIComponent(t)}`})).join("&"),n=new URL(t);return n.search=r,n}getErrorData(){if(this.data.assertion_error_code&&0!=this.data.assertion_error_code){const e=fu.convertFromAssertionError(this.data.assertion_error_code);return new fu(this.data.assertion_error_message,e)}}removeFields(e,t){for(const i of t)i in e&&delete e[i]}getJourneyStepId(e){const t=this.getType();if(t===eu.JourneyRejection)return this.rejectionReason=this.rawResponse.error_message,tu.Rejection;if(t===eu.JourneySuccess)return tu.Success;switch(e){case mu.Form:case mu.LoginForm:return this.formIdToStepId()||this.formId||e;case mu.Information:return tu.Information;case mu.DebugBreak:return tu.DebugBreak;case mu.WaitForTicket:return tu.WaitForAnotherDevice;case mu.Rejection:return tu.Rejection;case mu.DrsTriggerAction:return tu.DrsTriggerAction;case mu.IdentityVerification:return tu.IdentityVerification;case mu.WebAuthnRegistration:return tu.WebAuthnRegistration;default:return e||""}}formIdToStepId(){return this.formId}getClientResponseActions(){var e;const i={[Xd.ClientInput]:{type:Xd.ClientInput,id:"client_input",label:"Client Input"}};return null===(e=this.escapes)||void 0===e||e.forEach((e=>{let{id:r,display_name:n,schema:a}=e;var o;const s=null!==(o=Ap[r])&&void 0!==o?o:Xd.Custom;i[r]=t({type:s,id:r,label:n||r},a&&{schema:a})})),i}}class Mp extends Error{constructor(){super("Missing response data")}}class Cp extends Error{constructor(e,t){super("Action of type "+e+" cannot have response from type "+t)}}const Ip=new D("ido","sdkDataDB",1);async function Dp(e){try{return await Ip.get("sdkDataStore",e)}catch(e){console.error("Error retrieving SDK data:",e)}}const Tp=new class{constructor(){this.correlationId="",this.getIdentifier=(e,t)=>{var i;const r=null===(i=e.headers.find((e=>t in e)))||void 0===i?void 0:i[t];return iu.debug(`Getting identifier ${t} from response, value: ${r}`),r}}async init(e,t){if(!e||!t)throw new fu("Invalid initialization configuration",Qd.InvalidInitOptions);const{serverPath:i,logLevel:r,pollingTimeout:n,resource:a,locale:o}=t;if(!i)throw new fu("Invalid initialization options",Qd.InvalidInitOptions);iu.setLogLevel(null!=r?r:Yd.Info),this.pollingTimeout=null!=n?n:3,this.clientId=e,a&&(this.resource=a),o&&(this.locale=o),this.serverPath=i,this.api=new bp(this.serverPath),iu.info("IdoSdk initialized successfully")}async startJourney(e,t){var i,r;const{additionalParams:n,correlationId:a}=null!=t?t:{};this.correlationId=null!=a?a:crypto.randomUUID();const o=await Dp("sdk_data"),s=(null===(i=this.journey)||void 0===i?void 0:i.encrypted)||(null==t?void 0:t.encrypted)||!1,c=(null===(r=this.journey)||void 0===r?void 0:r.isReady())?this.journey.cryptoSession:void 0,d=new yp(e,o,n,s,c);return this.invokeJourney(d)}async startSsoJourney(e,t){var i,r;this.correlationId=e;const n=await Dp("sdk_data"),a=(null===(i=this.journey)||void 0===i?void 0:i.encrypted)||(null==t?void 0:t.encrypted)||!1,o=(null===(r=this.journey)||void 0===r?void 0:r.isReady())?this.journey.cryptoSession:void 0,s=new _p(e,n,a,o);return this.invokeJourney(s)}async submitClientResponse(e,t){var i,r,n,a,o,s,c;if(!this.journey)throw new fu("Error occurred while trying to submit client response since no journey is active",Qd.NoActiveJourney);const d={assertion_id:null===(i=this.journey)||void 0===i?void 0:i.assertionId,action:null===(r=this.journey)||void 0===r?void 0:r.actionType,assert:"action",input:t};if((null==t?void 0:t.fch)||(d.fch=null===(n=this.journey)||void 0===n?void 0:n.challenge),e===Xd.ClientInput)switch(null===(a=this.lastServiceResponse)||void 0===a?void 0:a.journeyStepId){case tu.CryptoBindingRegistration:case tu.RegisterDeviceAction:case tu.CryptoBindingValidation:case tu.ValidateDeviceAction:await this.handleCryptoBindingStep(d);break;case tu.WaitForAnotherDevice:return await this.handleWaitForAnotherDeviceAction(d);case tu.DrsTriggerAction:case tu.IdentityVerification:case tu.WebAuthnRegistration:case tu.SmsOTPAuthentication:case tu.EmailOTPAuthentication:case tu.EmailValidation:case tu.SmsValidation:case tu.WebAuthnTransactionSigning:case tu.SelectOrganization:this.handleDataAction(d,t);break;case tu.TotpRegistration:this.handleDataAction(d,{});break;case tu.InvokeIDP:case tu.MobileApproveAuthentication:this.handleDataAction(d,t)}else if(e===Xd.Resend)switch(null===(o=this.lastServiceResponse)||void 0===o?void 0:o.journeyStepId){case tu.SmsOTPAuthentication:case tu.EmailOTPAuthentication:case tu.EmailValidation:case tu.SmsValidation:case tu.MobileApproveAuthentication:this.handleResendAssertion(d);break;default:throw new Cp(null===(s=this.lastServiceResponse)||void 0===s?void 0:s.journeyStepId,e)}else Xd.Cancel,this.handleClientResponseOption(e,t,d);try{let e={headers:await this.getInternalHeaders(),data:d};const t=await(null===(c=this.api)||void 0===c?void 0:c.sendRequest(su.path,this.getQueryParams(),e,this.journey));if(!t)throw new Mp;return await this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}handleClientResponseOption(e,t,i){delete i.input,i.assert="escape",i.data={escape_id:e,escape_params:t}}handleResendAssertion(e){delete e.input,delete e.data,e.assert="resend"}async handleCryptoBindingStep(e){const t=Zd.crypto.createCryptoBinding("sign"),i=await this.handleCryptoBindingFieldValue(t);this.handleCryptoBindingActionPayload(e,i)}handleCryptoBindingActionPayload(e,i){const r=ru[this.lastServiceResponse.journeyStepId];e[r]=t(t({},e[r]),{},{"ts:idosdk:device":i})}handleDataAction(e,t){delete e.input,e.assert="data",e.data=t}async handleCryptoBindingFieldValue(e){var t,i,r,n,a,o,s,c,d;switch(null===(t=this.lastServiceResponse)||void 0===t?void 0:t.journeyStepId){case tu.CryptoBindingRegistration:case tu.RegisterDeviceAction:const{keyIdentifier:t,publicKey:u}=null!==(i=await e.getPublicData())&&void 0!==i?i:{};return{platform_device_id:t,platform_device_key:u};case tu.CryptoBindingValidation:case tu.ValidateDeviceAction:const{keyIdentifier:l}=null!==(r=await e.getPublicData())&&void 0!==r?r:{};return{platform_device_id:l,signature:await e.sign(null!==(s=null===(o=null===(a=null===(n=this.lastServiceResponse)||void 0===n?void 0:n.data)||void 0===a?void 0:a.app_data)||void 0===o?void 0:o.challenge)&&void 0!==s?s:null===(d=null===(c=this.lastServiceResponse)||void 0===c?void 0:c.data)||void 0===d?void 0:d.device_challenge)}}}async handleWaitForAnotherDeviceAction(e){var t,i,r,n;const a=await this.getInternalHeaders(),o=await(null===(t=this.api)||void 0===t?void 0:t.sendRequest(cu.path,this.getQueryParams(),{headers:a,data:{polling_timeout:this.pollingTimeout,ticket_id:null===(i=this.lastServiceResponse)||void 0===i?void 0:i.data.raw_ticket_id,type:"ticket"}},this.journey));if(!0===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.change_detected)){const t=await(null===(n=this.api)||void 0===n?void 0:n.sendRequest(su.path,this.getQueryParams(),{headers:a,data:e},this.journey));if(!t)throw new Mp;return this.handleServiceResponse(t)}return this.lastServiceResponse}async handleServiceResponse(e){var i,r,n,a,o,s;const c=new kp(e),d=c.getJourneyState();this.handleJourneyState(d),(null===(r=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===r?void 0:r.sdk_data)&&(await async function(e,i){try{const r=t(t({},await Dp(e)),i);await Ip.put("sdkDataStore",e,r)}catch(e){console.error("Error saving SDK data:",e)}}("sdk_data",e.data.data.sdk_data),delete e.data.data.sdk_data),this.journey.assertionId=null!==(n=c.getAssertionId())&&void 0!==n?n:this.journey.assertionId,this.journey.actionType=null!==(a=c.getActionType())&&void 0!==a?a:this.journey.actionType,this.journey.challenge=null!==(o=c.getChallenge())&&void 0!==o?o:this.journey.challenge;const{clientResponseOptions:u,data:l}=null!==(s=this.lastServiceResponse)&&void 0!==s?s:{},h=d===pu.UpdateAction?{clientResponseOptions:u,data:l}:{};let f=c.generateServiceResponse(this.journey.actionType,h);switch(this.lastServiceResponse=f,f.journeyStepId){case tu.ValidateDeviceAction:case tu.RegisterDeviceAction:if(d!==pu.NextAction)throw new Error(`Journey rejected on ${f.journeyStepId} device action, with ${f.errorData}`);f=await this.submitClientResponse(Xd.ClientInput,f.data);break;default:this.handleJourneySuccess(f)}return f}handleJourneySuccess(e){var t,i;null===(i=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===i||i.url,e.type===eu.JourneySuccess&&(e.token=e.data.token,delete e.data.token)}serializeState(){if(!this.lastServiceResponse||!this.journey)throw new fu("Error occurred while trying to serialize state since no journey is active",Qd.NoActiveJourney);return btoa(encodeURIComponent(JSON.stringify({journey:this.journey.toJson(),serviceResponse:this.lastServiceResponse})))}restoreFromSerializedState(e){var t;const{journey:i,serviceResponse:r}=JSON.parse(decodeURIComponent(null!==(t=atob(e))&&void 0!==t?t:{}));if(!i||!r)throw new fu("Invalid serialized state",Qd.InvalidState);if(this.lastServiceResponse=r,this.journey=function(e){let t,i;switch(e.cryptoSession&&(i=lp.fromJson(e.cryptoSession)),e.journeyType){case cp.ClientSdk:t=new yp(e.journeyId,e.sdkData,e.additionalParams,e.encrypted,i);break;case cp.SSO:t=new _p(e.interactionId,e.sdkData,e.encrypted,i);break;default:throw Error(`error when trying to deserialize Journey Json - unknown journey type ${e.journeyType}`)}return t.challenge=e.challenge,t.assertionId=e.assertionId,t.userId=e.userId,t.sessionId=e.sessionId,t.deviceId=e.deviceId,t.actionType=e.actionType,t}(i),this.journey.encrypted&&!this.journey.isReady())throw new fu("Failed to restore encryption context after redirection",Qd.InvalidState);return this.correlationId=i.correlationId,r}async getInternalHeaders(){const e=[];this.journey&&e.push(...this.journey.getInternalHeaders()),this.correlationId&&e.push({type:"correlation_id",correlation_id:this.correlationId});const t=await this.getDeviceHeader();return t&&e.push(t),e}async getDeviceHeader(){var e,t;try{const i=Zd.crypto.createCryptoBinding("sign"),{keyIdentifier:r,publicKey:n}=null!==(e=await i.getPublicData())&&void 0!==e?e:{};return r&&n?{type:"device",device:{device_key_id:r,device_public_key:n,device_type:"web",device_os:navigator.platform.toLowerCase(),device_os_version:(null===(t=navigator.userAgent.match(/(?:Version|Edge|Chrome|Firefox|Safari)\/(\d+\.\d+)/))||void 0===t?void 0:t[1])||"unknown",device_manufacturer:navigator.vendor||"unknown",device_model:navigator.platform||"unknown"}}:null}catch(e){return iu.error("Failed to create device header"),null}}getQueryParams(){var e,i;const r=t({aid:"default_application",clientId:this.clientId,locale:window.navigator.language||"en-US"},this.journey?this.journey.getQueryParams():{});return(null===(e=this.journey)||void 0===e?void 0:e.deviceId)&&(r.did=this.journey.deviceId),(null===(i=this.journey)||void 0===i?void 0:i.sessionId)&&(r.sid=this.journey.sessionId),this.resource&&(r.resource=this.resource),this.locale&&(r.locale=this.locale),r}async invokeJourney(e){var t,i,r;this.journey=e;const n=await this.getInternalHeaders(),a={data:e.getInvocationData(),headers:n};try{const e=await(null===(i=null===(t=null===window||void 0===window?void 0:window.tsPlatform)||void 0===t?void 0:t.drs)||void 0===i?void 0:i.getSessionToken());e&&a.headers.push(this.buildDrsSessionTokenSdkHeader(e))}catch(e){iu.warning(`Could not obtain DRS session token: ${e}`)}try{const t=await(null===(r=this.api)||void 0===r?void 0:r.sendRequest(e.getInvocationPath(),this.getQueryParams(),a,this.journey));if(!t)throw new Mp;return e.userId=this.getIdentifier(t,"uid"),e.sessionId=this.getIdentifier(t,"session_id"),e.deviceId=this.getIdentifier(t,"device_id"),e.active(),this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}buildDrsSessionTokenSdkHeader(e){return{type:"drs_session_token",drs_session_token:{token:e}}}handleJourneyState(e){switch(e){case pu.TextRejection:case pu.JsonRejection:this.rejectJourney();break;case pu.JourneyEnd:this.completeJourney();break;case pu.NextAction:case pu.UpdateAction:break;default:throw Error(`Unhandled service response state: ${e}`)}}completeJourney(){var e;null===(e=this.journey)||void 0===e||e.complete()}rejectJourney(){var e;null===(e=this.journey)||void 0===e||e.reject()}async generateDebugPin(){var e;if(!this.journey)throw new fu("Error occurred while trying to generate debug pin since no journey is active",Qd.NoActiveJourney);const t=await this.getInternalHeaders(),i=await(null===(e=this.api)||void 0===e?void 0:e.sendRequest(du.path,this.getQueryParams(),{headers:t,data:{}},this.journey));if(!i)throw new Mp;return i.data.debug_pin}};Zd.events.on(Zd.events.MODULE_INITIALIZED,(async()=>{var e;const t=Zd.moduleMetadata.getInitConfig();if(!(null===(e=null==t?void 0:t.ido)||void 0===e?void 0:e.serverPath))return;const{clientId:i,ido:r}=t;await Tp.init(i,r)})),function(){var e,t;const i="undefined"!=typeof window&&"undefined"!=typeof document;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&(null===(t=null===(e=globalThis.process)||void 0===e?void 0:e.versions)||void 0===t?void 0:t.node)&&!i)throw new Error("\nš« @TransmitSecurity/web-sdk is a BROWSER-ONLY package.\n\nā Node.js environments are not supported.\nā
Use this package in web browsers only.\n\nFor more information, visit: https://github.com/transmitsecurity-dev/ciam-web-sdk#browser-only\n");i||console.warn("ā ļø @TransmitSecurity/web-sdk: Browser environment not detected. Some features may not work correctly.")}();const Rp={drs:la,idv:sd};var Bp=new class{constructor(){this.factories=Rp,Object.assign(this,la),Object.assign(this,sd)}};exports.PACKAGE_VERSION="1.17.1",exports.authenticate=qd,exports.crossDevice=Vd,exports.default=Bp,exports.drs=la,exports.getDefaultPaths=Gd,exports.ido=Tp,exports.idv=sd,exports.initialize=g,exports.isAutofillSupported=Jd,exports.isPlatformAuthenticatorSupported=$d,exports.register=Hd,exports.webauthn=Wd;
|
|
3
|
+
yb=_b,function(e){function t(e){return parseInt(e)===e}function r(e){if(!t(e.length))return!1;for(var r=0;r<e.length;r++)if(!t(e[r])||e[r]<0||e[r]>255)return!1;return!0}function n(e,n){if(e.buffer&&"Uint8Array"===e.name)return n&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(t(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function o(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var a,s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var i=e.charCodeAt(r++);37===i?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(i)}return n(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(a="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(a[(240&n)>>4]+a[15&n])}return t.join("")}}),c={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],f=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],b=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],C=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function x(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var S=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:n(t,!0)}),this._prepare()};S.prototype._prepare=function(){var e=c[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,o=x(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,u=i;u<n;){if(a=o[i-1],o[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];for(a=o[i/2-1],o[i/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&u<n;)h=u>>2,f=u%4,this._Ke[h][f]=o[t],this._Kd[e-h][f]=o[t++],u++}for(var h=1;h<e;h++)for(var f=0;f<4;f++)a=this._Kd[h][f],this._Kd[h][f]=_[a>>24&255]^A[a>>16&255]^E[a>>8&255]^C[255&a]},S.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=f[n[o]>>24&255]^p[n[(o+1)%4]>>16&255]^g[n[(o+2)%4]>>8&255]^m[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var s,u=i(16);for(o=0;o<4;o++)s=this._Ke[t][o],u[4*o]=255&(d[n[o]>>24&255]^s>>24),u[4*o+1]=255&(d[n[(o+1)%4]>>16&255]^s>>16),u[4*o+2]=255&(d[n[(o+2)%4]>>8&255]^s>>8),u[4*o+3]=255&(d[255&n[(o+3)%4]]^s);return u},S.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=y[n[o]>>24&255]^v[n[(o+3)%4]>>16&255]^w[n[(o+2)%4]>>8&255]^b[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var s,u=i(16);for(o=0;o<4;o++)s=this._Kd[t][o],u[4*o]=255&(h[n[o]>>24&255]^s>>24),u[4*o+1]=255&(h[n[(o+3)%4]>>16&255]^s>>16),u[4*o+2]=255&(h[n[(o+2)%4]>>8&255]^s>>8),u[4*o+3]=255&(h[255&n[(o+1)%4]]^s);return u};var I=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new S(t)};I.prototype.encrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16)o(e,r,0,a,a+16),o(r=this._aes.encrypt(r),t,a);return t},I.prototype.decrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16)o(e,r,0,a,a+16),o(r=this._aes.decrypt(r),t,a);return t};var T=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=i(16);this._lastCipherblock=n(r,!0),this._aes=new S(t)};T.prototype.encrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16){o(e,r,0,a,a+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),o(this._lastCipherblock,t,a)}return t},T.prototype.decrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16){o(e,r,0,a,a+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[a+s]=r[s]^this._lastCipherblock[s];o(e,this._lastCipherblock,0,a,a+16)}return t};var M=function e(t,r,o){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 size)")}else r=i(16);o||(o=1),this.segmentSize=o,this._shiftRegister=n(r,!0),this._aes=new S(t)};M.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=n(e,!0),i=0;i<r.length;i+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[i+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(r,this._shiftRegister,16-this.segmentSize,i,i+this.segmentSize)}return r},M.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=n(e,!0),i=0;i<r.length;i+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[i+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(e,this._shiftRegister,16-this.segmentSize,i,i+this.segmentSize)}return r};var D=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=i(16);this._lastPrecipher=n(r,!0),this._lastPrecipherIndex=16,this._aes=new S(t)};D.prototype.encrypt=function(e){for(var t=n(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},D.prototype.decrypt=D.prototype.encrypt;var R=function e(t){if(!(this instanceof e))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=i(16),this.setValue(t)):this.setBytes(t)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(16!=(e=n(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof R||(r=new R(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new S(t)};O.prototype.encrypt=function(e){for(var t=n(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},O.prototype.decrypt=O.prototype.encrypt;var k={AES:S,Counter:R,ModeOfOperation:{ecb:I,cbc:T,cfb:M,ofb:D,ctr:O},utils:{hex:u,utf8:s},padding:{pkcs7:{pad:function(e){var t=16-(e=n(e,!0)).length%16,r=i(e.length+t);o(e,r);for(var a=e.length;a<r.length;a++)r[a]=t;return r},strip:function(e){if((e=n(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,a=0;a<t;a++)if(e[r+a]!==t)throw new Error("PKCS#7 invalid padding byte");var s=i(r);return o(e,s,0,0,r),s}}},_arrayTest:{coerceArray:n,createArray:i,copyArray:o}};yb.exports=k}();class Ab{getExchangeRequestHeader(){if(!this.kp){const e={entropy:this.generateRandomHexString(192),entropyEnc:"hex"};this.kp=this.ec.genKeyPair(e)}return{type:"key_exchange",scheme:3,y:this.jsArrayToBase64(this.kp.getPublic().encode("array",!1))}}async processExchangeResponseHeader(e){if(e.scheme!=this.scheme)throw"Unsupported crypto scheme "+e.scheme;this.sessionId=e.crypto_session_id;const t=this.kp.derive(this.ec.keyFromPublic(atob(e.y)).getPublic()).toArray("be",32),r=new Uint8Array(t),n=await crypto.subtle.digest("SHA-256",r);this.aesKey=Array.from(new Uint8Array(n))}isReady(){return!(!this.aesKey||!this.sessionId)}decryptResponse(e){let t=null;if(e.headers.forEach((function(e){"encryption"==e.type&&(t=e)})),t){const r=this.base64ToJsArray(t.iv),n=new bb.ModeOfOperation.cbc(this.aesKey,r),i=this.base64ToJsArray(e.data),o=n.decrypt(i);let a=bb.utils.utf8.fromBytes(o);a=this.pkcs7Unpad(a),e.data=JSON.parse(a)}return e}encryptRequest(e){const t=this.generateRandomHexString(32),r=bb.utils.hex.toBytes(t),n={type:"encryption",iv:this.hexToBase64(t),crypto_session_id:this.sessionId},i=e.headers.map((e=>this.encryptStringToBase64(JSON.stringify(e),r))),o=JSON.stringify(e.data),a=this.encryptStringToBase64(o,r);e.headers=[n],e.enc_headers=i,e.data=a}encryptStringToBase64(e,t){const r=new bb.ModeOfOperation.cbc(this.aesKey,t),n=bb.utils.utf8.toBytes(e),i=this.pkcs7Pad(n),o=[...r.encrypt(i)];return this.jsArrayToBase64(o)}toJson(){return{scheme:3,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)}}static fromJson(e){return new Ab(e)}jsArrayToBase64(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}base64ToJsArray(e){const t=atob(e),r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return r}pkcs7Pad(e){const t=16-e.length%16,r=new Uint8Array(e.length+t);r.set(e,0);for(let n=0;n<t;n++)r[e.length+n]=t;return r}pkcs7Unpad(e){try{const t=e.charCodeAt(e.length-1);if(t<1||t>16)throw new Ib(`Invalid padding length: ${t}`);if(e.length<t)throw new Ib("Input string shorter than padding length");for(let r=1;r<=t;r++){if(e.charCodeAt(e.length-r)!==t)throw new Ib("Invalid padding values")}return e.slice(0,-t)}catch(e){if(e instanceof Ib)throw e;throw new Ib(`Failed to unpad data: ${e instanceof Error?e.message:String(e)}`)}}constructor(e){if(this.scheme=3,this.ecCurveName="p256",this.ec=new Mm.ec(this.ecCurveName),e&&(this.sessionId=e.session_id,this.aesKey=this.base64ToJsArray(e.key),!this.isReady()))throw new Error("Internal: Can't deserialize crypto session")}generateRandomHexString(e){const t=new Uint8Array(e);crypto.getRandomValues(t);let r="";const n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];for(let e=0;e<t.length;e++){r+=n[15&t[e]]}return r}hexToBase64(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let r=0,n=0,i="";for(let o=0;o<e.length;o++)if(r=(r<<4)+parseInt(e[o],16),n+=4,n>=6){i+=t[r>>n-6],n-=6,r&=255>>8-n}if(n){i+=t[r<<6-n]}for(;i.length%4;)i+="=";return i}}class Eb{constructor(e,t){this.encrypted=e,this.cryptoSession=t}isReady(){var e;return(null===(e=this.cryptoSession)||void 0===e?void 0:e.isReady())||!1}async exchangeKeyAndEncryptRequest(e,t,r,n,i,o){if(!t.isReady()){const r=["aid","clientId"],i=new URLSearchParams(Array.from(n.searchParams.entries()).filter((e=>{let[t,n]=e;return r.includes(t)})));await t.performKeyExchange(e,i)}return t.promisePossiblyEncryptedTransportRequest(new Sb(r,n,i.data,i.headers,o))}async performKeyExchange(e,r){const n={r:"Hello Encrypted World"},i=new URL(e+Am.path+"?"+r.toString()),o=new Sb("POST",i,n,[],{"Content-Type":"application/json"}),a=this.promisePossiblyEncryptedTransportRequest(o);let s;const u=await fetch(a.url.toString(),{body:JSON.stringify(null==a?void 0:a.body),method:"POST",headers:a.headers,credentials:"include"});if(!u.ok)throw new Error("Request failed");let c;s=t(t({data:await u.json()},u),{},{headers:u.headers});try{c=s.data}catch(e){throw new Error(`Unsupported resposne format: ${e}`)}await this.postprocessResponse(c),c=this.possiblyDecryptResponse(c);const l=c.data;if(JSON.stringify(l)!==JSON.stringify(n))throw new Error("Key exchange failed");return Promise.resolve()}async postprocessResponse(e){var t;if(e.headers){const r=e.headers.find((e=>"key_exchange"==e.type));if(r)return null===(t=this.cryptoSession)||void 0===t?void 0:t.processExchangeResponseHeader(r)}}promisePossiblyEncryptedTransportRequest(e){const t={headers:e.envelopeHeaders,data:e.body};return this.encryptEnvelopedMessageIfNeeded(t),new Cb(e.url.toString(),e.method,t,void 0,e.httpHeaders)}possiblyDecryptResponse(e){return this.cryptoSession&&(e=this.cryptoSession.decryptResponse(e)),e}encryptEnvelopedMessageIfNeeded(e){var t;const r=this.generateKeyExchangeHeaderIfNeeded();(null===(t=this.cryptoSession)||void 0===t?void 0:t.isReady())&&this.cryptoSession.encryptRequest(e),r&&e.headers.push(r)}generateKeyExchangeHeaderIfNeeded(){return this.encrypted&&!this.cryptoSession?(this.cryptoSession=new Ab,this.cryptoSession.getExchangeRequestHeader()):null}}class Cb{constructor(e,t,r,n,i){this.url=e,this.httpMethod=t,this.body=r,this.params=n,this.headers=i}}class xb{addEnvelopeHeader(e){this._envelopeHeaders.push(e)}get method(){return this._requestMethod}get url(){return this._url}get body(){return this._requestBody}get envelopeHeaders(){return this._envelopeHeaders}get httpHeaders(){return this._httpHeaders}constructor(e,t,r,n,i){if(!t||!r)throw new Error("Internal - Invalid arguments for constructing session message");this._requestMethod=e,this._url=t,this._requestBody=r,this._envelopeHeaders=n||[],this._httpHeaders=i}}class Sb extends xb{static from(e,t,r,n){return new Sb(e,t,r.data,r.headers,n)}}class Ib extends Error{constructor(e){super(e),this.name="PaddingError",Object.setPrototypeOf(this,Ib.prototype)}}class Tb{constructor(e){this.urlBaseString=e+"/"+mm}convertHttpResponseToRawServiceResponse(e){const{status:t,statusText:r,body:n}=e;return this.rawFrom(t,r,n)}rawFrom(e,t,r){const{error_code:n,error_message:i,headers:o,data:a}=r;return{status:e,statusText:t,error_code:n,error_message:i,headers:o,data:this.buildAggregatedData(a)}}buildAggregatedData(e){switch(null==e?void 0:e.state){case Im.Pending:Cm.forEach((r=>{const[[n,i]]=Object.entries(r),o=((e,t,r)=>{if(!e||"object"!=typeof e)return r;const n=Array.isArray(t)?t:t.split(".");let i=e;for(let e=0;e<n.length;e++)if(i=i[n[e]],void 0===i)return r;return i})(e,n);if(o){const r={};i.forEach((e=>{e in o&&(r[e]=o[e])})),e=t(t({},e),r)}}));break;case Im.Rejected:e.type=Tm.Rejection}return e}async sendRequest(e,r,n,i){if(!(this.urlBaseString.toString().length>mm.length&&e))throw new Error("bad input");const o=new URL(this.urlBaseString);o.pathname+=e,pm.debug(`Got Full URL: ${o.toString()}`),Object.keys(r).map((e=>o.searchParams.append(e,r[e]))),pm.debug(`Request body: ${n}`);let a=new Cb(o.toString(),"POST",n,o.searchParams,{"Content-type":"application/json;charset=UTF-8"});try{i.encrypted&&(a=await i.exchangeKeyAndEncryptRequest(this.urlBaseString,i,a.httpMethod,new URL(a.url),a.body,a.headers));const e=await fetch(a.url.toString(),{body:JSON.stringify(a.body),method:"POST",headers:a.headers,credentials:"include"});let r;const n=await e.json();if(i.encrypted){const e=n;i.postprocessResponse(e),r=i.possiblyDecryptResponse(e)}else r=n;return this.convertHttpResponseToRawServiceResponse(t(t({},e),{},{body:r}))}catch(e){throw new xm("Error occurred while retrieving response from server",lm.NetworkError)}}}!function(e){e.Active="Active",e.Success="Journey Ended with Success",e.Rejected="Journey Ended with Rejection",e.Aborted="Journey aborted by client"}(vb||(vb={})),function(e){e.ClientSdk="Client SDK Journey",e.SSO="SSO Journey"}(wb||(wb={}));class Mb extends Eb{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;super(n,i),this.journeyType=e,this.sdkData=t,this.additionalParams=r,this.encrypted=n,this.cryptoSession=i,this.state=vb.Active}getQueryParams(){let e={};return this.deviceId&&(e.did=this.deviceId),this.sessionId&&(e.sid=this.sessionId),e}getInternalHeaders(){const e=[];return this.userId&&e.push({type:"uid",uid:this.userId}),e}toJson(){var e;return{journeyType:this.journeyType,challenge:this.challenge,assertionId:this.assertionId,userId:this.userId,sessionId:this.sessionId,deviceId:this.deviceId,actionType:this.actionType,additionalParams:this.additionalParams,sdkData:this.sdkData,encrypted:this.encrypted,cryptoSession:null===(e=this.cryptoSession)||void 0===e?void 0:e.toJson()}}getInvocationData(){const e=Em.data.dummy;return this.additionalParams&&Object.keys(this.additionalParams).length>0&&(e.params=this.additionalParams),this.sdkData&&Object.keys(this.sdkData).length>0&&(e.sdk_data=this.sdkData),e}complete(){if(this.isCompletedState())throw Error(`Cannot complete an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=vb.Success,this.cryptoSession=void 0}reject(){if(this.isCompletedState())throw Error(`Cannot reject an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=vb.Rejected,this.cryptoSession=void 0}abort(){if(this.isCompletedState())throw Error(`Cannot abort an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=vb.Aborted,this.cryptoSession=void 0}active(){if(this.isCompletedState())throw Error(`Cannot run a completed journey. Current state: ${this.state.toString()}`);this.state=vb.Active}isCompletedState(){return this.state===vb.Success||this.state===vb.Rejected||this.state===vb.Aborted}}class Db extends Mb{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;if(super(wb.ClientSdk,t,r,n,i),this.journeyId=e,!this.journeyId)throw Error("Journey ID must be provided")}getInvocationData(){const e=super.getInvocationData();return e.policy_request_id=this.journeyId,e}getInvocationPath(){return vm.path}toJson(){return t(t({},super.toJson()),{},{journeyId:this.journeyId})}}class Rb extends Mb{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;super(wb.SSO,t,{},r,n),this.interactionId=e}getInvocationPath(){return ym.path}getQueryParams(){return t(t({},super.getQueryParams()),{},{ssoInteractionId:this.interactionId})}toJson(){return t(t({},super.toJson()),{},{interactionId:this.interactionId})}}const Ob=["assertion_id","type","escapes","form_id","vendor_name"],kb=[...Ob,"challenge","assertion_error_code","assertion_error_message","assertions_complete","state","control_flow","rejection_data"],Nb={[dm.Cancel]:dm.Cancel,[dm.Fail]:dm.Fail},Pb=["data"],Bb=["json_data"];class Fb{constructor(e){var t,r,n;this.rawResponse=e;const[{escapes:i,form_id:o}]=null!==(r=null===(t=e.data)||void 0===t?void 0:t.control_flow)&&void 0!==r?r:[{}];this.escapes=i,this.data=null!==(n=e.data)&&void 0!==n?n:{},this.formId=o}generateServiceResponse(e,r){var n,i;const o=this.getType(),a=this.getJourneyStepId(e);return t(t({type:o,journeyStepId:a,errorData:this.getErrorData(),data:this.getData(a),clientResponseOptions:this.getClientResponseActions()},r),{},{redirectUrl:null===(i=null===(n=this.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.url})}getActionType(){return this.data.type}getChallenge(){return this.data.challenge}getAssertionId(){return this.data.assertion_id}getJourneyState(){var e,t,r;let n;if((null===(e=this.rawResponse)||void 0===e?void 0:e.status)>=400)n=Sm.TextRejection;else switch(this.data.state){case Im.Completed:n=Sm.JourneyEnd;break;case Im.Rejected:n=Sm.JsonRejection;break;case Im.Pending:n=(null===(r=null===(t=this.rawResponse)||void 0===t?void 0:t.data)||void 0===r?void 0:r.control_flow)?Sm.NextAction:Sm.UpdateAction;break;default:n=Sm.JsonRejection}return n}getType(){let e=hm.JourneyRejection;return this.data.assertions_complete?e=hm.JourneySuccess:this.data.state===Im.Pending?e=hm.ClientInputRequired:16==this.data.assertion_error_code?e=hm.ClientInputUpdateRequired:4001===this.rawResponse.error_code&&(e=hm.JourneyRejection),e}getData(e){var r,n;const[o]=null!==(r=this.data.control_flow)&&void 0!==r?r:[{}],a=null!==(n=this.data)&&void 0!==n?n:{},{data:s}=a,u=i(a,Pb),c=null!=s?s:{},{json_data:l}=c,d=i(c,Bb);return this.removeFields(o,Ob),this.data=t(t(t(t(t({},u),o),l&&{json_data:l}),Object.keys(d).length&&{data:d}),this.rejectionReason&&{rejectionReason:this.rejectionReason}),this.removeFields(this.data,kb),this.manipulateDataForJourneyStep(e),this.data}manipulateDataForJourneyStep(e){e===fm.InvokeIDP&&(this.data.authorization_url=this.generateAuthorizationUrlFromResponseData(this.data),delete this.data.authorization_parameters,delete this.data.authorization_endpoint)}generateAuthorizationUrlFromResponseData(e){const{authorization_endpoint:t,authorization_parameters:r}=e,n=Object.keys(r).map((e=>{const t=r[e]instanceof Object?JSON.stringify(r[e]):r[e];return`${e}=${encodeURIComponent(t)}`})).join("&"),i=new URL(t);return i.search=n,i}getErrorData(){if(this.data.assertion_error_code&&0!=this.data.assertion_error_code){const e=xm.convertFromAssertionError(this.data.assertion_error_code);return new xm(this.data.assertion_error_message,e)}}removeFields(e,t){for(const r of t)r in e&&delete e[r]}getJourneyStepId(e){const t=this.getType();if(t===hm.JourneyRejection)return this.rejectionReason=this.rawResponse.error_message,fm.Rejection;if(t===hm.JourneySuccess)return fm.Success;switch(e){case Tm.Form:case Tm.LoginForm:return this.formIdToStepId()||this.formId||e;case Tm.Information:return fm.Information;case Tm.DebugBreak:return fm.DebugBreak;case Tm.WaitForTicket:return fm.WaitForAnotherDevice;case Tm.Rejection:return fm.Rejection;case Tm.DrsTriggerAction:return fm.DrsTriggerAction;case Tm.IdentityVerification:return fm.IdentityVerification;case Tm.WebAuthnRegistration:return fm.WebAuthnRegistration;default:return e||""}}formIdToStepId(){return this.formId}getClientResponseActions(){var e;const r={[dm.ClientInput]:{type:dm.ClientInput,id:"client_input",label:"Client Input"}};return null===(e=this.escapes)||void 0===e||e.forEach((e=>{let{id:n,display_name:i,schema:o}=e;var a;const s=null!==(a=Nb[n])&&void 0!==a?a:dm.Custom;r[n]=t({type:s,id:n,label:i||n},o&&{schema:o})})),r}}class Lb extends Error{constructor(){super("Missing response data")}}class zb extends Error{constructor(e,t){super("Action of type "+e+" cannot have response from type "+t)}}const Ub=new D("ido","sdkDataDB",1);async function jb(e){try{return await Ub.get("sdkDataStore",e)}catch(e){console.error("Error retrieving SDK data:",e)}}const Vb=new class{constructor(){this.correlationId="",this.getIdentifier=(e,t)=>{var r;const n=null===(r=e.headers.find((e=>t in e)))||void 0===r?void 0:r[t];return pm.debug(`Getting identifier ${t} from response, value: ${n}`),n}}async init(e,t){if(!e||!t)throw new xm("Invalid initialization configuration",lm.InvalidInitOptions);const{serverPath:r,logLevel:n,pollingTimeout:i,resource:o,locale:a}=t;if(!r)throw new xm("Invalid initialization options",lm.InvalidInitOptions);pm.setLogLevel(null!=n?n:cm.Info),this.pollingTimeout=null!=i?i:3,this.clientId=e,o&&(this.resource=o),a&&(this.locale=a),this.serverPath=r,this.api=new Tb(this.serverPath),pm.info("IdoSdk initialized successfully")}async startJourney(e,t){var r,n;const{additionalParams:i,correlationId:o}=null!=t?t:{};this.correlationId=null!=o?o:crypto.randomUUID();const a=await jb("sdk_data"),s=(null===(r=this.journey)||void 0===r?void 0:r.encrypted)||(null==t?void 0:t.encrypted)||!1,u=(null===(n=this.journey)||void 0===n?void 0:n.isReady())?this.journey.cryptoSession:void 0,c=new Db(e,a,i,s,u);return this.invokeJourney(c)}async startSsoJourney(e,t){var r,n;this.correlationId=e;const i=await jb("sdk_data"),o=(null===(r=this.journey)||void 0===r?void 0:r.encrypted)||(null==t?void 0:t.encrypted)||!1,a=(null===(n=this.journey)||void 0===n?void 0:n.isReady())?this.journey.cryptoSession:void 0,s=new Rb(e,i,o,a);return this.invokeJourney(s)}async submitClientResponse(e,t){var r,n,i,o,a,s,u;if(!this.journey)throw new xm("Error occurred while trying to submit client response since no journey is active",lm.NoActiveJourney);const c={assertion_id:null===(r=this.journey)||void 0===r?void 0:r.assertionId,action:null===(n=this.journey)||void 0===n?void 0:n.actionType,assert:"action",input:t};if((null==t?void 0:t.fch)||(c.fch=null===(i=this.journey)||void 0===i?void 0:i.challenge),e===dm.ClientInput)switch(null===(o=this.lastServiceResponse)||void 0===o?void 0:o.journeyStepId){case fm.CryptoBindingRegistration:case fm.RegisterDeviceAction:case fm.CryptoBindingValidation:case fm.ValidateDeviceAction:await this.handleCryptoBindingStep(c);break;case fm.WaitForAnotherDevice:return await this.handleWaitForAnotherDeviceAction(c);case fm.DrsTriggerAction:case fm.IdentityVerification:case fm.WebAuthnRegistration:case fm.SmsOTPAuthentication:case fm.EmailOTPAuthentication:case fm.GenericOTPAuthentication:case fm.EmailValidation:case fm.SmsValidation:case fm.WebAuthnTransactionSigning:case fm.SelectOrganization:this.handleDataAction(c,t);break;case fm.TotpRegistration:this.handleDataAction(c,{});break;case fm.InvokeIDP:case fm.MobileApproveAuthentication:this.handleDataAction(c,t)}else if(e===dm.Resend)switch(null===(a=this.lastServiceResponse)||void 0===a?void 0:a.journeyStepId){case fm.SmsOTPAuthentication:case fm.EmailOTPAuthentication:case fm.GenericOTPAuthentication:case fm.EmailValidation:case fm.SmsValidation:case fm.MobileApproveAuthentication:this.handleResendAssertion(c);break;default:throw new zb(null===(s=this.lastServiceResponse)||void 0===s?void 0:s.journeyStepId,e)}else dm.Cancel,this.handleClientResponseOption(e,t,c);try{let e={headers:await this.getInternalHeaders(),data:c};const t=await(null===(u=this.api)||void 0===u?void 0:u.sendRequest(wm.path,this.getQueryParams(),e,this.journey));if(!t)throw new Lb;return await this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}handleClientResponseOption(e,t,r){delete r.input,r.assert="escape",r.data={escape_id:e,escape_params:t}}handleResendAssertion(e){delete e.input,delete e.data,e.assert="resend"}async handleCryptoBindingStep(e){const t=um.crypto.createCryptoBinding("sign"),r=await this.handleCryptoBindingFieldValue(t);this.handleCryptoBindingActionPayload(e,r)}handleCryptoBindingActionPayload(e,r){const n=gm[this.lastServiceResponse.journeyStepId];e[n]=t(t({},e[n]),{},{"ts:idosdk:device":r})}handleDataAction(e,t){delete e.input,e.assert="data",e.data=t}async handleCryptoBindingFieldValue(e){var t,r,n,i,o,a,s,u,c;switch(null===(t=this.lastServiceResponse)||void 0===t?void 0:t.journeyStepId){case fm.CryptoBindingRegistration:case fm.RegisterDeviceAction:const{keyIdentifier:t,publicKey:l}=null!==(r=await e.getPublicData())&&void 0!==r?r:{};return{platform_device_id:t,platform_device_key:l};case fm.CryptoBindingValidation:case fm.ValidateDeviceAction:const{keyIdentifier:d}=null!==(n=await e.getPublicData())&&void 0!==n?n:{};return{platform_device_id:d,signature:await e.sign(null!==(s=null===(a=null===(o=null===(i=this.lastServiceResponse)||void 0===i?void 0:i.data)||void 0===o?void 0:o.app_data)||void 0===a?void 0:a.challenge)&&void 0!==s?s:null===(c=null===(u=this.lastServiceResponse)||void 0===u?void 0:u.data)||void 0===c?void 0:c.device_challenge)}}}async handleWaitForAnotherDeviceAction(e){var t,r,n,i;const o=await this.getInternalHeaders(),a=await(null===(t=this.api)||void 0===t?void 0:t.sendRequest(bm.path,this.getQueryParams(),{headers:o,data:{polling_timeout:this.pollingTimeout,ticket_id:null===(r=this.lastServiceResponse)||void 0===r?void 0:r.data.raw_ticket_id,type:"ticket"}},this.journey));if(!0===(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.change_detected)){const t=await(null===(i=this.api)||void 0===i?void 0:i.sendRequest(wm.path,this.getQueryParams(),{headers:o,data:e},this.journey));if(!t)throw new Lb;return this.handleServiceResponse(t)}return this.lastServiceResponse}async handleServiceResponse(e){var r,n,i,o,a,s;const u=new Fb(e),c=u.getJourneyState();this.handleJourneyState(c),(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.sdk_data)&&(await async function(e,r){try{const n=t(t({},await jb(e)),r);await Ub.put("sdkDataStore",e,n)}catch(e){console.error("Error saving SDK data:",e)}}("sdk_data",e.data.data.sdk_data),delete e.data.data.sdk_data),this.journey.assertionId=null!==(i=u.getAssertionId())&&void 0!==i?i:this.journey.assertionId,this.journey.actionType=null!==(o=u.getActionType())&&void 0!==o?o:this.journey.actionType,this.journey.challenge=null!==(a=u.getChallenge())&&void 0!==a?a:this.journey.challenge;const{clientResponseOptions:l,data:d}=null!==(s=this.lastServiceResponse)&&void 0!==s?s:{},h=c===Sm.UpdateAction?{clientResponseOptions:l,data:d}:{};let f=u.generateServiceResponse(this.journey.actionType,h);switch(this.lastServiceResponse=f,f.journeyStepId){case fm.ValidateDeviceAction:case fm.RegisterDeviceAction:if(c!==Sm.NextAction)throw new Error(`Journey rejected on ${f.journeyStepId} device action, with ${f.errorData}`);f=await this.submitClientResponse(dm.ClientInput,f.data);break;default:this.handleJourneySuccess(f)}return f}handleJourneySuccess(e){var t,r;null===(r=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===r||r.url,e.type===hm.JourneySuccess&&(e.token=e.data.token,delete e.data.token)}serializeState(){if(!this.lastServiceResponse||!this.journey)throw new xm("Error occurred while trying to serialize state since no journey is active",lm.NoActiveJourney);return btoa(encodeURIComponent(JSON.stringify({journey:this.journey.toJson(),serviceResponse:this.lastServiceResponse})))}restoreFromSerializedState(e){var t;const{journey:r,serviceResponse:n}=JSON.parse(decodeURIComponent(null!==(t=atob(e))&&void 0!==t?t:{}));if(!r||!n)throw new xm("Invalid serialized state",lm.InvalidState);if(this.lastServiceResponse=n,this.journey=function(e){let t,r;switch(e.cryptoSession&&(r=Ab.fromJson(e.cryptoSession)),e.journeyType){case wb.ClientSdk:t=new Db(e.journeyId,e.sdkData,e.additionalParams,e.encrypted,r);break;case wb.SSO:t=new Rb(e.interactionId,e.sdkData,e.encrypted,r);break;default:throw Error(`error when trying to deserialize Journey Json - unknown journey type ${e.journeyType}`)}return t.challenge=e.challenge,t.assertionId=e.assertionId,t.userId=e.userId,t.sessionId=e.sessionId,t.deviceId=e.deviceId,t.actionType=e.actionType,t}(r),this.journey.encrypted&&!this.journey.isReady())throw new xm("Failed to restore encryption context after redirection",lm.InvalidState);return this.correlationId=r.correlationId,n}async getInternalHeaders(){const e=[];this.journey&&e.push(...this.journey.getInternalHeaders()),this.correlationId&&e.push({type:"correlation_id",correlation_id:this.correlationId});const t=await this.getDeviceHeader();return t&&e.push(t),e}async getDeviceHeader(){var e,t;try{const r=um.crypto.createCryptoBinding("sign"),{keyIdentifier:n,publicKey:i}=null!==(e=await r.getPublicData())&&void 0!==e?e:{};return n&&i?{type:"device",device:{device_key_id:n,device_public_key:i,device_type:"web",device_os:navigator.platform.toLowerCase(),device_os_version:(null===(t=navigator.userAgent.match(/(?:Version|Edge|Chrome|Firefox|Safari)\/(\d+\.\d+)/))||void 0===t?void 0:t[1])||"unknown",device_manufacturer:navigator.vendor||"unknown",device_model:navigator.platform||"unknown"}}:null}catch(e){return pm.error("Failed to create device header"),null}}getQueryParams(){var e,r;const n=t({aid:"default_application",clientId:this.clientId,locale:window.navigator.language||"en-US"},this.journey?this.journey.getQueryParams():{});return(null===(e=this.journey)||void 0===e?void 0:e.deviceId)&&(n.did=this.journey.deviceId),(null===(r=this.journey)||void 0===r?void 0:r.sessionId)&&(n.sid=this.journey.sessionId),this.resource&&(n.resource=this.resource),this.locale&&(n.locale=this.locale),n}async invokeJourney(e){var t,r,n;this.journey=e;const i=await this.getInternalHeaders(),o={data:e.getInvocationData(),headers:i};try{const e=await(null===(r=null===(t=null===window||void 0===window?void 0:window.tsPlatform)||void 0===t?void 0:t.drs)||void 0===r?void 0:r.getSessionToken());e&&o.headers.push(this.buildDrsSessionTokenSdkHeader(e))}catch(e){pm.warning(`Could not obtain DRS session token: ${e}`)}try{const t=await(null===(n=this.api)||void 0===n?void 0:n.sendRequest(e.getInvocationPath(),this.getQueryParams(),o,this.journey));if(!t)throw new Lb;return e.userId=this.getIdentifier(t,"uid"),e.sessionId=this.getIdentifier(t,"session_id"),e.deviceId=this.getIdentifier(t,"device_id"),e.active(),this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}buildDrsSessionTokenSdkHeader(e){return{type:"drs_session_token",drs_session_token:{token:e}}}handleJourneyState(e){switch(e){case Sm.TextRejection:case Sm.JsonRejection:this.rejectJourney();break;case Sm.JourneyEnd:this.completeJourney();break;case Sm.NextAction:case Sm.UpdateAction:break;default:throw Error(`Unhandled service response state: ${e}`)}}completeJourney(){var e;null===(e=this.journey)||void 0===e||e.complete()}rejectJourney(){var e;null===(e=this.journey)||void 0===e||e.reject()}async generateDebugPin(){var e;if(!this.journey)throw new xm("Error occurred while trying to generate debug pin since no journey is active",lm.NoActiveJourney);const t=await this.getInternalHeaders(),r=await(null===(e=this.api)||void 0===e?void 0:e.sendRequest(_m.path,this.getQueryParams(),{headers:t,data:{}},this.journey));if(!r)throw new Lb;return r.data.debug_pin}};um.events.on(um.events.MODULE_INITIALIZED,(async()=>{var e;const t=um.moduleMetadata.getInitConfig();if(!(null===(e=null==t?void 0:t.ido)||void 0===e?void 0:e.serverPath))return;const{clientId:r,ido:n}=t;await Vb.init(r,n)})),function(){var e,t;const r="undefined"!=typeof window&&"undefined"!=typeof document;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&(null===(t=null===(e=globalThis.process)||void 0===e?void 0:e.versions)||void 0===t?void 0:t.node)&&!r)throw new Error("\nš« @TransmitSecurity/web-sdk is a BROWSER-ONLY package.\n\nā Node.js environments are not supported.\nā
Use this package in web browsers only.\n\nFor more information, visit: https://github.com/transmitsecurity-dev/ciam-web-sdk#browser-only\n");r||console.warn("ā ļø @TransmitSecurity/web-sdk: Browser environment not detected. Some features may not work correctly.")}();const Hb={drs:oo,idv:wg};var Gb=new class{constructor(){this.factories=Hb,Object.assign(this,oo),Object.assign(this,wg)}};exports.PACKAGE_VERSION="1.18.1",exports.authenticate=em,exports.crossDevice=nm,exports.default=Gb,exports.drs=oo,exports.getDefaultPaths=am,exports.ido=Vb,exports.idv=wg,exports.initialize=g,exports.isAutofillSupported=om,exports.isPlatformAuthenticatorSupported=im,exports.register=rm,exports.webauthn=sm;
|